版本暂存
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import request from '@/utils/request';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
import qs from 'qs';
|
||||
|
||||
// 地区接口
|
||||
export const listPartitionInfo = query => {
|
||||
return request({
|
||||
url: '/partition/listPartitionInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@@ -7,140 +7,221 @@
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<div id="toolbar">
|
||||
<el-form-item label="装扮类型" prop="dateCycle">
|
||||
<el-select placeholder="请选择" v-model="dressTypeVal">
|
||||
<el-option
|
||||
v-for="(item, i) in dressTypeArr"
|
||||
:key="i"
|
||||
:label="item.desc"
|
||||
:value="item.val"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="获得方式" prop="dateCycle">
|
||||
<el-select placeholder="请选择" v-model="obtainWayVal">
|
||||
<el-option
|
||||
v-for="(item, i) in obtainWayArr"
|
||||
:key="i"
|
||||
:label="item.desc"
|
||||
:value="item.val"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnAdd"
|
||||
class="btn btn-default">
|
||||
<button
|
||||
id="btnAdd"
|
||||
class="btn btn-default"
|
||||
style="margin-right: 20px"
|
||||
>
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
<button @click="initData" id="getData" class="btn btn-default">
|
||||
查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade"
|
||||
<div
|
||||
class="modal fade"
|
||||
id="roomTagModal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog"
|
||||
role="document">
|
||||
aria-labelledby="modalLabel"
|
||||
>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"><span aria-hidden="true">×</span>
|
||||
aria-label="Close"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"
|
||||
id="modalLabel">新增</h4>
|
||||
<h4 class="modal-title" id="modalLabel">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal"
|
||||
id="addForm">
|
||||
<input type="hidden"
|
||||
name="id"
|
||||
id="id" />
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="id" id="id" />
|
||||
<div class="form-group">
|
||||
<label for="dressType"
|
||||
class="col-sm-3 control-label">装扮类型:</label>
|
||||
<label for="dressType" class="col-sm-3 control-label"
|
||||
>装扮类型:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType"
|
||||
id="dressType">
|
||||
<select name="dressType" id="dressType">
|
||||
<option value="">-- 请选择 --</option>
|
||||
<option value="0">头饰</option>
|
||||
<option value="1">座驾</option>
|
||||
<option value="2">铭牌</option>
|
||||
<option value="3">资料卡</option>
|
||||
<option value="4">聊天气泡</option>
|
||||
<option value="5">个人装扮</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"
|
||||
id="txtBox">
|
||||
<label for="dressId"
|
||||
class="col-sm-3 control-label">装扮id<font color="red">*</font>:</label>
|
||||
<div class="form-group">
|
||||
<label for="obtainWay" class="col-sm-3 control-label"
|
||||
>获得方式:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
<select name="obtainWay" id="obtainWay">
|
||||
<option value="">-- 请选择 --</option>
|
||||
<option value="1">普通</option>
|
||||
<option value="2">活动</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="txtBox">
|
||||
<label for="dressId" class="col-sm-3 control-label"
|
||||
>装扮id<font color="red">*</font>:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressId"
|
||||
id="dressId"
|
||||
placeholder="请输入对应的装扮id">
|
||||
placeholder="请输入对应的装扮id"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressSeq"
|
||||
class="col-sm-3 control-label">展示排序<font color="red">*</font>:</label>
|
||||
<label for="dressSeq" class="col-sm-3 control-label"
|
||||
>展示排序<font color="red">*</font>:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressSeq"
|
||||
id="dressSeq"
|
||||
placeholder="数字小的排前面,必填">
|
||||
placeholder="数字小的排前面,必填"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressPrice"
|
||||
class="col-sm-3 control-label">装扮价格:</label>
|
||||
<label for="dressPrice" class="col-sm-3 control-label"
|
||||
>装扮价格:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressPrice"
|
||||
id="dressPrice"
|
||||
placeholder="请输入价格">
|
||||
placeholder="请输入价格"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressDay"
|
||||
class="col-sm-3 control-label">有效期(天):</label>
|
||||
<label for="dressDay" class="col-sm-3 control-label"
|
||||
>有效期(天):</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressDay"
|
||||
id="dressDay"
|
||||
placeholder="请输入天数">
|
||||
placeholder="请输入天数"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressLimitStatus"
|
||||
class="col-sm-3 control-label">装扮限时状态:</label>
|
||||
<label for="dressLimitStatus" class="col-sm-3 control-label"
|
||||
>装扮限时状态:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType"
|
||||
id="dressLimitStatus">
|
||||
<select name="dressType" id="dressLimitStatus">
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="vipLimit" class="col-sm-3 control-label"
|
||||
>贵族限定:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType" id="vipLimit">
|
||||
<option value="">无限制</option>
|
||||
<option value="1">VIP1</option>
|
||||
<option value="2">VIP2</option>
|
||||
<option value="3">VIP3</option>
|
||||
<option value="4">VIP4</option>
|
||||
<option value="5">VIP5</option>
|
||||
<option value="6">VIP6</option>
|
||||
<option value="7">VIP7</option>
|
||||
<option value="8">VIP8</option>
|
||||
<option value="9">VIP9</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button type="button"
|
||||
class="btn btn-primary"
|
||||
id="add">确定</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
关闭
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="add">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { serverError } from '@/utils/maintainer';
|
||||
import TableHelper from "@/utils/bootstrap-table-helper";
|
||||
import { serverError } from "@/utils/maintainer";
|
||||
|
||||
export default {
|
||||
name: "DressShopAdminView",
|
||||
setup () {
|
||||
return {};
|
||||
data() {
|
||||
return {
|
||||
dressTypeVal: "",
|
||||
dressTypeArr: [
|
||||
{ desc: "全部", val: "" },
|
||||
{ desc: "头饰", val: "0" },
|
||||
{ desc: "座驾", val: "1" },
|
||||
{ desc: "铭牌", val: "2" },
|
||||
{ desc: "资料卡", val: "3" },
|
||||
{ desc: "聊天气泡", val: "4" },
|
||||
{ desc: "个人装扮", val: "5" },
|
||||
],
|
||||
obtainWayVal: "",
|
||||
obtainWayArr: [
|
||||
{ desc: "全部", val: "" },
|
||||
{ desc: "普通", val: "1" },
|
||||
{ desc: "活动", val: "2" },
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
@@ -149,81 +230,209 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
var dressTypeVal = this.dressTypeVal;
|
||||
var obtainWayVal = this.obtainWayVal;
|
||||
$("#table").bootstrapTable("destroy");
|
||||
$("#table").bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressId', title: '装扮id', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.zh', title: '装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.ar', title: '阿语装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.en', title: '英语装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.tr', title: '土耳其装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'pic', title: '装扮图片', align: 'left', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
if (null != val && val != '') {
|
||||
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
field: "id",
|
||||
title: "ID",
|
||||
align: "center",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: 'dressType',
|
||||
title: '装扮类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
field: "dressId",
|
||||
title: "装扮id",
|
||||
align: "center",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "name.zh",
|
||||
title: "装扮名称",
|
||||
align: "left",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "name.ar",
|
||||
title: "阿语装扮名称",
|
||||
align: "left",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "name.en",
|
||||
title: "英语装扮名称",
|
||||
align: "left",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "pic",
|
||||
title: "装扮图片",
|
||||
align: "left",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
formatter: function (val, row, index) {
|
||||
if (val == '0') {
|
||||
if (null != val && val != "") {
|
||||
return (
|
||||
'<img src="' +
|
||||
val +
|
||||
'" alt="" style="width: 30px; height: 30px;">'
|
||||
);
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "dressType",
|
||||
title: "装扮类型",
|
||||
align: "center",
|
||||
width: "5%",
|
||||
valign: "middle",
|
||||
formatter: function (val, row, index) {
|
||||
if (val == "0") {
|
||||
return "头饰";
|
||||
} else if (val == '1') {
|
||||
return '座驾';
|
||||
} else if (val == '2') {
|
||||
return '铭牌';
|
||||
} else if (val == '3') {
|
||||
return '资料卡';
|
||||
} else if (val == '4') {
|
||||
return '聊天气泡';
|
||||
} else if (val == "1") {
|
||||
return "座驾";
|
||||
} else if (val == "2") {
|
||||
return "铭牌";
|
||||
} else if (val == "3") {
|
||||
return "资料卡";
|
||||
} else if (val == "4") {
|
||||
return "聊天气泡";
|
||||
} else if (val == "5") {
|
||||
return "个人装扮";
|
||||
} else {
|
||||
return '-';
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{ field: 'dressSeq', title: '装扮排序', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressPrice', title: '装扮展示价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressDay', title: '装扮有效期(天)', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'buyNum', title: '购买数量', align: '购买数量 ', valign: 'middle', width: '10%' },
|
||||
{ field: 'userDonateNum', title: '购买赠送用户数量', align: '购买数量', valign: 'middle', width: '10%' },
|
||||
},
|
||||
{
|
||||
field: 'dressLimitStatus',
|
||||
title: '装扮限时状态',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
field: "obtainWay",
|
||||
title: "获得方式",
|
||||
align: "center",
|
||||
width: "5%",
|
||||
valign: "middle",
|
||||
formatter: function (val, row, index) {
|
||||
if (val == '0') {
|
||||
if (val == "1") {
|
||||
return "普通";
|
||||
} else if (val == "2") {
|
||||
return "活动";
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "dressSeq",
|
||||
title: "装扮排序",
|
||||
align: "center",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "dressPrice",
|
||||
title: "装扮展示价值",
|
||||
align: "center",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "dressDay",
|
||||
title: "装扮有效期(天)",
|
||||
align: "center",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "buyNum",
|
||||
title: "购买数量",
|
||||
align: "购买数量 ",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "userDonateNum",
|
||||
title: "购买赠送用户数量",
|
||||
align: "购买数量",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
},
|
||||
{
|
||||
field: "dressLimitStatus",
|
||||
title: "装扮限时状态",
|
||||
align: "center",
|
||||
width: "5%",
|
||||
valign: "middle",
|
||||
formatter: function (val, row, index) {
|
||||
if (val == "0") {
|
||||
return "有效";
|
||||
} else {
|
||||
return '无效';
|
||||
return "无效";
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
field: "vipLimit",
|
||||
title: "贵族限定",
|
||||
align: "center",
|
||||
width: "5%",
|
||||
valign: "middle",
|
||||
formatter: function (val, row, index) {
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||||
if (val == "1") {
|
||||
return "VIP1";
|
||||
}
|
||||
if (val == "2") {
|
||||
return "VIP2";
|
||||
}
|
||||
if (val == "3") {
|
||||
return "VIP3";
|
||||
}
|
||||
if (val == "4") {
|
||||
return "VIP4";
|
||||
}
|
||||
if (val == "5") {
|
||||
return "VIP5";
|
||||
}
|
||||
if (val == "6") {
|
||||
return "VIP6";
|
||||
}
|
||||
if (val == "7") {
|
||||
return "VIP7";
|
||||
}
|
||||
if (val == "8") {
|
||||
return "VIP8";
|
||||
}
|
||||
if (val == "9") {
|
||||
return "VIP9";
|
||||
} else {
|
||||
return "无限制";
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "id",
|
||||
title: "操作",
|
||||
align: "center",
|
||||
width: "10%",
|
||||
formatter: function (val, row, index) {
|
||||
return (
|
||||
'<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' +
|
||||
val +
|
||||
">" +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
|
||||
}
|
||||
}
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' +
|
||||
val +
|
||||
" data-new-status=" +
|
||||
2 +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>'
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
undefinedText: "-",
|
||||
cache: false,
|
||||
@@ -235,28 +444,32 @@ export default {
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams (params) { //设置查询参数
|
||||
queryParams: function queryParams(params) {
|
||||
//设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize
|
||||
pageSize: params.pageSize,
|
||||
dressType: dressTypeVal,
|
||||
obtainWay: obtainWayVal,
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
ajax: function (request) {
|
||||
//使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/dress/shop/list',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
url: "/admin/dress/shop/list",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
dataType: "json",
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
apiResult(res);
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
request.success({
|
||||
total: res.data.total,
|
||||
rows: res.data.rows.map(i => {
|
||||
rows: res.data.rows.map((i) => {
|
||||
let value = i.name;
|
||||
if (value.startsWith('{') && value.endsWith('}')) {
|
||||
if (value.startsWith("{") && value.endsWith("}")) {
|
||||
i.name = JSON.parse(i.name);
|
||||
} else {
|
||||
i.name = {
|
||||
@@ -266,46 +479,48 @@ export default {
|
||||
};
|
||||
}
|
||||
return i;
|
||||
})
|
||||
}),
|
||||
});
|
||||
},
|
||||
error: function (req) {
|
||||
serverError(req);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
});
|
||||
},
|
||||
toolbar: "#toolbar",
|
||||
onLoadSuccess: function () {
|
||||
//加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
onLoadError: function () {
|
||||
//加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
$("#btnSearch").on("click", function () {
|
||||
TableHelper.doRefresh("#table");
|
||||
});
|
||||
|
||||
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
clearModal();
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#roomTagModal").modal("show");
|
||||
});
|
||||
|
||||
$("#add").click(function () {
|
||||
var id = $("#id").val();
|
||||
var dressType = $('#dressType').val();
|
||||
var dressType = $("#dressType").val();
|
||||
var obtainWay = $("#obtainWay").val();
|
||||
var dressId = $("#dressId").val();
|
||||
var dressSeq = $('#dressSeq').val();
|
||||
var dressPrice = $('#dressPrice').val();
|
||||
var dressDay = $('#dressDay').val();
|
||||
var dressLimitStatus = $('#dressLimitStatus').val();
|
||||
var dressSeq = $("#dressSeq").val();
|
||||
var dressPrice = $("#dressPrice").val();
|
||||
var dressDay = $("#dressDay").val();
|
||||
var dressLimitStatus = $("#dressLimitStatus").val();
|
||||
var vipLimit = $("#vipLimit").val();
|
||||
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
if ($("#addForm").validationEngine("validate")) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/dress/shop/saveOrUpdate",
|
||||
@@ -313,31 +528,32 @@ export default {
|
||||
id: id,
|
||||
dressId: dressId,
|
||||
dressType: dressType,
|
||||
obtainWay: obtainWay,
|
||||
dressSeq: dressSeq,
|
||||
dressPrice: dressPrice,
|
||||
dressDay: dressDay,
|
||||
dressLimitStatus: dressLimitStatus,
|
||||
vipLimit: vipLimit,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagModal").modal('hide');
|
||||
$("#roomTagModal").modal("hide");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagModal").modal('hide');
|
||||
}
|
||||
$("#roomTagModal").modal("hide");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
$("#table").on("click", ".opt-edit", function () {
|
||||
var id = $(this).attr("data-id");
|
||||
clearModal();
|
||||
|
||||
@@ -350,116 +566,113 @@ export default {
|
||||
var json = res.data;
|
||||
if (json) {
|
||||
$("#id").val(id);
|
||||
$('#dressId').val(json.dressId);
|
||||
$('#dressType').val(json.dressType);
|
||||
$('#dressSeq').val(json.dressSeq);
|
||||
$('#dressPrice').val(json.dressPrice);
|
||||
$('#dressDay').val(json.dressDay);
|
||||
$('#dressLimitStatus').val(json.dressLimitStatus);
|
||||
$("#dressId").val(json.dressId);
|
||||
$("#dressType").val(json.dressType);
|
||||
$("#obtainWay").val(json.obtainWay);
|
||||
$("#dressSeq").val(json.dressSeq);
|
||||
$("#dressPrice").val(json.dressPrice);
|
||||
$("#dressDay").val(json.dressDay);
|
||||
$("#dressLimitStatus").val(json.dressLimitStatus);
|
||||
$("#vipLimit").val(json.vipLimit);
|
||||
// 打开编辑弹窗
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#roomTagModal").modal("show");
|
||||
$("#modalLabel").text("编辑");
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
$("#tipModal").modal("show");
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-remove', function () {
|
||||
$("#table").on("click", ".opt-remove", function () {
|
||||
var id = $(this).attr("data-id");
|
||||
|
||||
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
|
||||
if (
|
||||
confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")
|
||||
) {
|
||||
const requestParam = {
|
||||
id: id
|
||||
}
|
||||
id: id,
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/dress/shop/delById",
|
||||
data: requestParam,
|
||||
dataType: "json",
|
||||
contentType: 'application/json',
|
||||
contentType: "application/json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("修改成功");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("修改失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
$("#tipModal").modal("show");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function apiResult(json) {
|
||||
if (json.code == 200 && json.message == 'success') {
|
||||
if (json.code == 200 && json.message == "success") {
|
||||
return true;
|
||||
}
|
||||
$("#tipMsg").text("请求失败,错误信息:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$('#iconBtn').on('click', function () {
|
||||
if ($('#iconFile').val() == '') {
|
||||
$('#tipMsg').text('上传图片为空');
|
||||
$('#tipModal').modal('show');
|
||||
$("#iconBtn").on("click", function () {
|
||||
if ($("#iconFile").val() == "") {
|
||||
$("#tipMsg").text("上传图片为空");
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'iconFile', //需要上传的文件域的ID,即<input type="file">的ID。
|
||||
url: '/admin/upload/img', //后台方法的路径
|
||||
type: 'post', //当要提交自定义参数时,这个参数要设置成post
|
||||
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写,jQuery会自动判断。
|
||||
fileElementId: "iconFile", //需要上传的文件域的ID,即<input type="file">的ID。
|
||||
url: "/admin/upload/img", //后台方法的路径
|
||||
type: "post", //当要提交自定义参数时,这个参数要设置成post
|
||||
dataType: "json", //服务器返回的数据类型。可以为xml,script,json,html。如果不填写,jQuery会自动判断。
|
||||
secureuri: false, //是否启用安全提交,默认为false。
|
||||
async: true, //是否是异步
|
||||
success: function (json) { //提交成功后自动执行的处理函数,参数data就是服务器返回的数据。
|
||||
success: function (json) {
|
||||
//提交成功后自动执行的处理函数,参数data就是服务器返回的数据。
|
||||
if (json.path) {
|
||||
$('#iconUrl').val(json.path);
|
||||
$('#iconImgUrl').attr("src", json.path);
|
||||
$("#iconUrl").val(json.path);
|
||||
$("#iconImgUrl").attr("src", json.path);
|
||||
|
||||
console.log(json.path);
|
||||
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
}
|
||||
},
|
||||
error: function (data, status, e) { //提交失败自动执行的处理函数。
|
||||
error: function (data, status, e) {
|
||||
//提交失败自动执行的处理函数。
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
function clearModal() {
|
||||
$('#iconImgUrl').attr('src', '');
|
||||
$("#iconImgUrl").attr("src", "");
|
||||
|
||||
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
|
||||
$(this).val('');
|
||||
})
|
||||
|
||||
$('#type').val(1);
|
||||
$("#addForm")
|
||||
.find("input[type=text],input[type=hidden],input[type=file]")
|
||||
.each(function () {
|
||||
$(this).val("");
|
||||
});
|
||||
|
||||
$("#type").val(1);
|
||||
}
|
||||
|
||||
|
||||
$("#type").change(function () {
|
||||
var optVal = $(this).val();
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
151
src/views/privilege/personalHomepageGiftRecordManagement.vue
Normal file
151
src/views/privilege/personalHomepageGiftRecordManagement.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>平台ID</span>
|
||||
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="x" align="center" label="个人主页id" />
|
||||
<el-table-column prop="x" align="center" label="个人主页名称" />
|
||||
<el-table-column prop="x" align="center" label="用户uID" />
|
||||
<el-table-column prop="x" align="center" label="用户昵称" />
|
||||
<el-table-column prop="x" align="center" label="赠送天数" />
|
||||
<el-table-column prop="x" align="center" label="备注" />
|
||||
<el-table-column prop="x" align="center" label="操作时间" />
|
||||
<el-table-column prop="x" align="center" label="操作人" />
|
||||
<!-- <el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="
|
||||
operationDialog = true;
|
||||
operationValue.partitionId = scope.row.x;
|
||||
operationValue.nameZh = scope.row.x;
|
||||
operationValue.nameEn = scope.row.x;
|
||||
operationValue.nameAr = scope.row.x;
|
||||
operationValue.nameTr = scope.row.x;
|
||||
operationValue.price = scope.row.x;
|
||||
operationValue.day = scope.row.x;
|
||||
operationValue.imageUrl = scope.row.x;
|
||||
operationValue.status = scope.row.x;
|
||||
"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="send()"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>赠送</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import { } from "@/api/personalHomepageResourceManagement/personalHomepageResourceManagement";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "personalHomepageGiftRecordManagement",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
id: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [{ x: "x" }],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
// get({}).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// this.loading = false;
|
||||
// } else {
|
||||
// ElMessage({
|
||||
// showClose: true,
|
||||
// message: res.message,
|
||||
// type: "error",
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
.operation {
|
||||
margin-bottom: 20px;
|
||||
width: 55%;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
152
src/views/privilege/personalHomepageRecordManagement.vue
Normal file
152
src/views/privilege/personalHomepageRecordManagement.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>平台ID</span>
|
||||
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="x" align="center" label="个人主页id" />
|
||||
<el-table-column prop="x" align="center" label="个人主页名称" />
|
||||
<el-table-column prop="x" align="center" label="用户uID" />
|
||||
<el-table-column prop="x" align="center" label="用户昵称" />
|
||||
<el-table-column prop="x" align="center" label="拥有个人主页" />
|
||||
<el-table-column prop="x" align="center" label="个人主页状态" />
|
||||
<el-table-column prop="x" align="center" label="购买时间" />
|
||||
<el-table-column prop="x" align="center" label="有效时间" />
|
||||
<el-table-column prop="x" align="center" label="过期时间" />
|
||||
<!-- <el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="
|
||||
operationDialog = true;
|
||||
operationValue.partitionId = scope.row.x;
|
||||
operationValue.nameZh = scope.row.x;
|
||||
operationValue.nameEn = scope.row.x;
|
||||
operationValue.nameAr = scope.row.x;
|
||||
operationValue.nameTr = scope.row.x;
|
||||
operationValue.price = scope.row.x;
|
||||
operationValue.day = scope.row.x;
|
||||
operationValue.imageUrl = scope.row.x;
|
||||
operationValue.status = scope.row.x;
|
||||
"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="send()"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>赠送</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import { } from "@/api/personalHomepageResourceManagement/personalHomepageResourceManagement";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "personalHomepageRecordManagement",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
id: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [{ x: "x" }],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
// get({}).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// this.loading = false;
|
||||
// } else {
|
||||
// ElMessage({
|
||||
// showClose: true,
|
||||
// message: res.message,
|
||||
// type: "error",
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
.operation {
|
||||
margin-bottom: 20px;
|
||||
width: 55%;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
369
src/views/privilege/personalHomepageResourceManagement.vue
Normal file
369
src/views/privilege/personalHomepageResourceManagement.vue
Normal file
@@ -0,0 +1,369 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>地区</span>
|
||||
<el-select v-model="inquire.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.partitionArr"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>名称</span>
|
||||
<el-input v-model="inquire.name" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>状态</span>
|
||||
<el-select v-model="inquire.status" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- 新增按钮 -->
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
operationDialog = true;
|
||||
operationValue.partitionId = '';
|
||||
operationValue.nameZh = '';
|
||||
operationValue.nameEn = '';
|
||||
operationValue.nameAr = '';
|
||||
operationValue.nameTr = '';
|
||||
operationValue.price = '';
|
||||
operationValue.day = '';
|
||||
operationValue.imageUrl = '';
|
||||
operationValue.status = '';
|
||||
"
|
||||
>新增</el-button
|
||||
>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="x" align="center" label="地区" />
|
||||
<el-table-column prop="x" align="center" label="名称" />
|
||||
<el-table-column prop="x" align="center" label="阿语名称" />
|
||||
<el-table-column prop="x" align="center" label="英语名称" />
|
||||
<el-table-column prop="x" align="center" label="土耳其名称" />
|
||||
<el-table-column prop="x" align="center" label="价格" />
|
||||
<el-table-column prop="x" align="center" label="有效期" />
|
||||
<el-table-column prop="x" align="center" label="图片">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 200px; height: 200px"
|
||||
:src="scope.row.x"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="[scope.row.x]"
|
||||
fit="scale-down"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="状态">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.x }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="操作人" />
|
||||
<el-table-column prop="x" align="center" label="操作时间" />
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="
|
||||
operationDialog = true;
|
||||
operationValue.partitionId = scope.row.x;
|
||||
operationValue.nameZh = scope.row.x;
|
||||
operationValue.nameEn = scope.row.x;
|
||||
operationValue.nameAr = scope.row.x;
|
||||
operationValue.nameTr = scope.row.x;
|
||||
operationValue.price = scope.row.x;
|
||||
operationValue.day = scope.row.x;
|
||||
operationValue.imageUrl = scope.row.x;
|
||||
operationValue.status = scope.row.x;
|
||||
"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="send()"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>赠送</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 新增&操作弹窗 -->
|
||||
<el-dialog
|
||||
v-model="operationDialog"
|
||||
:title="operationDialogTitle"
|
||||
width="28%"
|
||||
center
|
||||
>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">地区</span>
|
||||
<el-select v-model="operationValue.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in operationValue.partitionArr"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">华语名称</span>
|
||||
<el-input
|
||||
v-model="operationValue.nameZh"
|
||||
style="width: 200px"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">英语名称</span>
|
||||
<el-input
|
||||
v-model="operationValue.nameEn"
|
||||
style="width: 200px"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">阿拉伯名称</span>
|
||||
<el-input
|
||||
v-model="operationValue.nameAr"
|
||||
style="width: 200px"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">土耳其名称</span>
|
||||
<el-input
|
||||
v-model="operationValue.nameTr"
|
||||
style="width: 200px"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">价格</span>
|
||||
<el-input
|
||||
v-model="operationValue.price"
|
||||
style="width: 200px"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">有效天数</span>
|
||||
<el-input
|
||||
v-model="operationValue.day"
|
||||
style="width: 200px"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span class="left" style="margin-right: 20px">图片</span>
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
v-if="operationValue.imageUrl"
|
||||
:src="operationValue.imageUrl"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<span style="margin-right: 20px">状态</span>
|
||||
<el-select v-model="operationValue.status" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in operationValue.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="operationDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="operation()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listPartitionInfo } from "@/api/personalHomepageResourceManagement/personalHomepageResourceManagement";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "personalHomepageResourceManagement",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
partitionId: "",
|
||||
partitionArr: [],
|
||||
name: "",
|
||||
status: "",
|
||||
options: [
|
||||
{ label: "有效", value: 1 },
|
||||
{ label: "无效", value: 0 },
|
||||
],
|
||||
},
|
||||
operationDialog: false,
|
||||
operationDialogTitle: "新增%编辑",
|
||||
operationValue: {
|
||||
partitionId: "",
|
||||
partitionArr: [],
|
||||
nameZh: "",
|
||||
nameEn: "",
|
||||
nameAr: "",
|
||||
nameTr: "",
|
||||
price: "",
|
||||
day: "",
|
||||
imageUrl: "",
|
||||
status: "",
|
||||
options: [
|
||||
{ label: "有效", value: 1 },
|
||||
{ label: "无效", value: 0 },
|
||||
],
|
||||
},
|
||||
// 表格
|
||||
tableData: [{ x: "x" }],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listPartitionInfo().then((res) => {
|
||||
this.inquire.partitionArr = this.operationValue.partitionArr = res.data;
|
||||
// this.getData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
// get({}).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// this.loading = false;
|
||||
// } else {
|
||||
// ElMessage({
|
||||
// showClose: true,
|
||||
// message: res.message,
|
||||
// type: "error",
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
beforeAvatarUpload() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传中~",
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
handleAvatarError() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传失败!",
|
||||
type: "error",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(file);
|
||||
this.ediObj.imageUrl1 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
.operation {
|
||||
margin-bottom: 20px;
|
||||
width: 55%;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
@@ -15,58 +15,85 @@
|
||||
<option value="4">工会账号</option>
|
||||
<option value="5">大头账号</option>
|
||||
</select>
|
||||
|
||||
操作时间:
|
||||
<input type="text" name="startTime" id="startTime" class="input-sm" placeholder="请选择开始时间">
|
||||
- <input type="text" name="endTime" id="endTime" class="input-sm" placeholder="请选择结束时间">
|
||||
操作时间:
|
||||
<input
|
||||
type="text"
|
||||
name="startTime"
|
||||
id="startTime"
|
||||
class="input-sm"
|
||||
placeholder="请选择开始时间"
|
||||
/>
|
||||
-
|
||||
<input
|
||||
type="text"
|
||||
name="endTime"
|
||||
id="endTime"
|
||||
class="input-sm"
|
||||
placeholder="请选择结束时间"
|
||||
/>
|
||||
</form>
|
||||
<button id="btnSearch" class="btn btn-primary">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button class="btn btn-success" id='addBtn'>
|
||||
<button class="btn btn-success" id="addBtn">
|
||||
<i class="glyphicon glyphicon-plus"></i>生成账号
|
||||
</button>
|
||||
<button id="btnExport" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-export"></i>导出
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="genAccountModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div
|
||||
class="modal fade"
|
||||
id="genAccountModal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="modalLabel"
|
||||
>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
<button
|
||||
type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="modalLabel">生成账号</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<div class="form-group">
|
||||
<label for="partitionId" class="col-sm-3 control-label">选择地区:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="partitionId" id="partitionId" class="form-control">
|
||||
<option value="1">英语区</option>
|
||||
<option value="2">阿拉伯语区</option>
|
||||
<option value="4">华语区</option>
|
||||
</select>
|
||||
<label for="partitionId" class="col-sm-3 control-label"
|
||||
>选择地区:</label
|
||||
>
|
||||
<div class="col-sm-7">
|
||||
<select
|
||||
name="partitionId"
|
||||
id="partitionId"
|
||||
class="form-control validate[required]"
|
||||
></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nick" class="col-sm-3 control-label">昵称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="nick" id="nick" placeholder='不填写默认“Peko小新”'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="nick"
|
||||
id="nick"
|
||||
placeholder="不填写默认“Peko小新”"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -81,116 +108,204 @@
|
||||
<div class="form-group">
|
||||
<label for="avatar" class="col-sm-3 control-label">头像:</label>
|
||||
<div class="col-sm-9">
|
||||
<img src="" id="picUrl" style="width:40px;height:40px;" alt="">
|
||||
<input type="file" id="uploadAvatarFile" name="uploadAvatarFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success" type="button" id="uploadPicBtn">上传</button>
|
||||
<input type="hidden" class="form-control validate[required]" name="avatar" id="avatar"
|
||||
style="width:40px"><span>不上传将使用默认头像</span>
|
||||
<img
|
||||
src=""
|
||||
id="picUrl"
|
||||
style="width: 40px; height: 40px"
|
||||
alt=""
|
||||
/>
|
||||
<input
|
||||
type="file"
|
||||
id="uploadAvatarFile"
|
||||
name="uploadAvatarFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"
|
||||
/>
|
||||
<button class="btn btn-success" type="button" id="uploadPicBtn">
|
||||
上传
|
||||
</button>
|
||||
<input
|
||||
type="hidden"
|
||||
class="form-control validate[required]"
|
||||
name="avatar"
|
||||
id="avatar"
|
||||
style="width: 40px"
|
||||
/><span>不上传将使用默认头像</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
</div>
|
||||
<div class="form-group"></div>
|
||||
<div class="form-group">
|
||||
<label for="size" class="col-sm-3 control-label">数量:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="size" id="size" placeholder='一次生成最多不超过20个'
|
||||
oninput="value=value.replace(/[^\d]/g,'')">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="size"
|
||||
id="size"
|
||||
placeholder="一次生成最多不超过20个"
|
||||
oninput="value=value.replace(/[^\d]/g,'')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="remark" class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="remark" id="remark" value="仅供后台记录用"
|
||||
placeholder="请输入备注,50字内">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="remark"
|
||||
id="remark"
|
||||
value="仅供后台记录用"
|
||||
placeholder="请输入备注,50字内"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="genDefUser" class="col-sm-3 control-label">帐号类型:</label>
|
||||
<label for="genDefUser" class="col-sm-3 control-label"
|
||||
>帐号类型:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<select name="defUser" id="genDefUser" class="form-control validate[required]">
|
||||
<select
|
||||
name="defUser"
|
||||
id="genDefUser"
|
||||
class="form-control validate[required]"
|
||||
>
|
||||
<option value="4">工会账号</option>
|
||||
<!-- <option value="5">大头账号</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="header_block" style="display: none;">
|
||||
<div id="header_block" style="display: none">
|
||||
<div class="form-group">
|
||||
<label for="phone" class="col-sm-3 control-label">手机号:</label>
|
||||
<label for="phone" class="col-sm-3 control-label"
|
||||
>手机号:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required, maxlength: 20]" name="phone"
|
||||
id="phone" placeholder='请输入手机号,必填'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required, maxlength: 20]"
|
||||
name="phone"
|
||||
id="phone"
|
||||
placeholder="请输入手机号,必填"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="realName" class="col-sm-3 control-label">实际姓名:</label>
|
||||
<label for="realName" class="col-sm-3 control-label"
|
||||
>实际姓名:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required] validate[maxlength: 20]"
|
||||
name="realName" id="realName" placeholder='请输入身份证上的姓名,必填'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[maxlength: 20]"
|
||||
name="realName"
|
||||
id="realName"
|
||||
placeholder="请输入身份证上的姓名,必填"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idCardNum" class="col-sm-3 control-label">身份证号:</label>
|
||||
<label for="idCardNum" class="col-sm-3 control-label"
|
||||
>身份证号:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required] validate[maxlength: 30]"
|
||||
name="idCardNum" id="idCardNum" placeholder='请输入身份证号码,必填'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[maxlength: 30]"
|
||||
name="idCardNum"
|
||||
id="idCardNum"
|
||||
placeholder="请输入身份证号码,必填"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="alipayAccount" class="col-sm-3 control-label">支付宝账号:</label>
|
||||
<label for="alipayAccount" class="col-sm-3 control-label"
|
||||
>支付宝账号:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required] validate[maxlength: 60]"
|
||||
name="alipayAccount" id="alipayAccount" placeholder='请输入支付宝帐号,必填'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[maxlength: 60]"
|
||||
name="alipayAccount"
|
||||
id="alipayAccount"
|
||||
placeholder="请输入支付宝帐号,必填"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="alipayAccountName" class="col-sm-3 control-label">支付宝姓名:</label>
|
||||
<label for="alipayAccountName" class="col-sm-3 control-label"
|
||||
>支付宝姓名:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required] validate[maxlength: 60]"
|
||||
name="alipayAccountName" id="alipayAccountName" placeholder='请输入支付宝姓名'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[maxlength: 60]"
|
||||
name="alipayAccountName"
|
||||
id="alipayAccountName"
|
||||
placeholder="请输入支付宝姓名"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bankCardNum" class="col-sm-3 control-label">银行卡号:</label>
|
||||
<label for="bankCardNum" class="col-sm-3 control-label"
|
||||
>银行卡号:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required] validate[maxlength: 30]"
|
||||
name="bankCardNum" id="bankCardNum" placeholder='请输入银行卡号'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[maxlength: 30]"
|
||||
name="bankCardNum"
|
||||
id="bankCardNum"
|
||||
placeholder="请输入银行卡号"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bankCardName" class="col-sm-3 control-label">持卡人:</label>
|
||||
<label for="bankCardName" class="col-sm-3 control-label"
|
||||
>持卡人:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required] validate[maxlength: 20]"
|
||||
name="bankCardName" id="bankCardName" placeholder='请输入银行卡-持卡人姓名'>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[maxlength: 20]"
|
||||
name="bankCardName"
|
||||
id="bankCardName"
|
||||
placeholder="请输入银行卡-持卡人姓名"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="paymentPwd" class="col-sm-3 control-label">支付密码:</label>
|
||||
<label for="paymentPwd" class="col-sm-3 control-label"
|
||||
>支付密码:</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
<input
|
||||
type="text"
|
||||
class="form-control validate[required] validate[minlength: 6] validate[maxlength: 20]"
|
||||
name="paymentPwd" id="paymentPwd" placeholder='请输入6位数字的支付密码,必填'>
|
||||
name="paymentPwd"
|
||||
id="paymentPwd"
|
||||
placeholder="请输入6位数字的支付密码,必填"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
关闭
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="add">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { showLoading, hideLoading } from '@/utils/maintainer';
|
||||
|
||||
import TableHelper from "@/utils/bootstrap-table-helper";
|
||||
import { showLoading, hideLoading } from "@/utils/maintainer";
|
||||
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
||||
import { buildSelectOption } from '@/utils/system-helper';
|
||||
export default {
|
||||
name: "GenAccountView",
|
||||
setup() {
|
||||
@@ -198,74 +313,102 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initPartition();
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initPartition() {
|
||||
getPartitionInfoList().then((res) => {
|
||||
let data = res.data;
|
||||
this.partitionInfos = data;
|
||||
buildSelectOption(
|
||||
"#partitionId",
|
||||
null,
|
||||
data.map((v) => {
|
||||
return {
|
||||
value: v.id,
|
||||
text: v.desc,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
$(function () {
|
||||
var picker1 = $('#startTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
var picker1 = $("#startTime").datetimepicker({
|
||||
format: "yyyy-mm-dd hh:ii:00",
|
||||
autoclose: true,
|
||||
endDate: new Date()
|
||||
endDate: new Date(),
|
||||
});
|
||||
|
||||
var picker2 = $('#endTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
var picker2 = $("#endTime").datetimepicker({
|
||||
format: "yyyy-mm-dd hh:ii:00",
|
||||
autoclose: true,
|
||||
});
|
||||
|
||||
picker1.on('changeDate', function () {
|
||||
var date = $('#startTime').datetimepicker('getDate');
|
||||
picker2.datetimepicker('setStartDate', date);
|
||||
picker1.on("changeDate", function () {
|
||||
var date = $("#startTime").datetimepicker("getDate");
|
||||
picker2.datetimepicker("setStartDate", date);
|
||||
});
|
||||
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#endTime').datetimepicker('getDate');
|
||||
picker1.datetimepicker('setEndDate', date);
|
||||
picker2.on("changeDate", function () {
|
||||
var date = $("#endTime").datetimepicker("getDate");
|
||||
picker1.datetimepicker("setEndDate", date);
|
||||
});
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
$("#table").bootstrapTable("destroy");
|
||||
$("#table").bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'uid', title: 'UID', align: 'center', width: '5%' },
|
||||
{ field: 'erbanNo', title: 'ID', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
|
||||
{ field: "uid", title: "UID", align: "center", width: "5%" },
|
||||
{ field: "erbanNo", title: "ID", align: "center", width: "5%" },
|
||||
{ field: "nick", title: "昵称", align: "center", width: "5%" },
|
||||
{
|
||||
field: 'defUser', title: '账号类型', align: 'center', width: '5%',
|
||||
field: "defUser",
|
||||
title: "账号类型",
|
||||
align: "center",
|
||||
width: "5%",
|
||||
formatter: function (val, row, index) {
|
||||
if (val == null) {
|
||||
return '-';
|
||||
return "-";
|
||||
}
|
||||
if (val == 1) {
|
||||
return '普通账号';
|
||||
return "普通账号";
|
||||
} else if (val == 2) {
|
||||
return '官方账号';
|
||||
return "官方账号";
|
||||
} else if (val == 3) {
|
||||
return '机器账号';
|
||||
return "机器账号";
|
||||
} else if (val == 4) {
|
||||
return '工会账户';
|
||||
return "工会账户";
|
||||
} else if (val == 5) {
|
||||
return '大头账号';
|
||||
return "大头账号";
|
||||
}
|
||||
return val;
|
||||
}
|
||||
},
|
||||
{ field: 'remark', title: '备注', align: 'center', width: '5%' },
|
||||
{ field: 'operator', title: '操作人', align: 'center', width: '5%' },
|
||||
},
|
||||
{ field: "remark", title: "备注", align: "center", width: "5%" },
|
||||
{
|
||||
field: 'createTime', title: '操作时间', align: 'center', valign: 'middle', width: '10%',
|
||||
field: "operator",
|
||||
title: "操作人",
|
||||
align: "center",
|
||||
width: "5%",
|
||||
},
|
||||
{
|
||||
field: "createTime",
|
||||
title: "操作时间",
|
||||
align: "center",
|
||||
valign: "middle",
|
||||
width: "10%",
|
||||
formatter: function (val, row, index) {
|
||||
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format('yyyy-MM-dd hh:mm:ss');
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
undefinedText: '-',
|
||||
undefinedText: "-",
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
@@ -275,107 +418,110 @@ export default {
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
queryParams: function queryParams(params) {
|
||||
//设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
defUser: $('#defUser').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
defUser: $("#defUser").val(),
|
||||
startTime: $("#startTime").val(),
|
||||
endTime: $("#endTime").val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/gen/account/list',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
toolbar: "#toolbar",
|
||||
url: "/admin/gen/account/list",
|
||||
onLoadSuccess: function () {
|
||||
//加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
onLoadError: function () {
|
||||
//加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
},
|
||||
});
|
||||
$('#addBtn').on('click', function () {
|
||||
$("#addBtn").on("click", function () {
|
||||
$("#addForm")[0].reset();
|
||||
$('#addForm').validationEngine('hideAll');
|
||||
$('#picUrl').attr('src', '');
|
||||
$('#genDefUser').val(4);
|
||||
$('#header_block').attr('style', 'display:none;');
|
||||
$('#genAccountModal').modal('show');
|
||||
$("#addForm").validationEngine("hideAll");
|
||||
$("#picUrl").attr("src", "");
|
||||
$("#genDefUser").val(4);
|
||||
$("#header_block").attr("style", "display:none;");
|
||||
$("#genAccountModal").modal("show");
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
$("#btnSearch").on("click", function () {
|
||||
TableHelper.doRefresh("#table");
|
||||
});
|
||||
$('#uploadPicBtn').on('click', function () {
|
||||
$("#uploadPicBtn").on("click", function () {
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/gen/account/headImg',
|
||||
dataType: 'json',
|
||||
type: "post",
|
||||
url: "/admin/gen/account/headImg",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('#avatar').val(json.path);
|
||||
$('#picUrl').attr('src', json.path);
|
||||
$("#avatar").val(json.path);
|
||||
$("#picUrl").attr("src", json.path);
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal("show");
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#addForm').ajaxSubmit(options);
|
||||
},
|
||||
};
|
||||
$("#addForm").ajaxSubmit(options);
|
||||
});
|
||||
$("#add").click(function () {
|
||||
if ($('#addForm').validationEngine('validate')) {
|
||||
var size = $('#size').val();
|
||||
if ($("#addForm").validationEngine("validate")) {
|
||||
var size = $("#size").val();
|
||||
if (!size) {
|
||||
$("#tipMsg").text("请填写数量");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
if (size > 20) {
|
||||
$("#tipMsg").text("一次只允许生成20个账号");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
if (!$('#gender').val()) {
|
||||
if (!$("#gender").val()) {
|
||||
$("#tipMsg").text("请选择性别");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
if ($('#remark').val().length > 50) {
|
||||
if ($("#remark").val().length > 50) {
|
||||
$("#tipMsg").text("备注不能超过50字");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
if ($('#genDefUser').val() == 5) {
|
||||
if ($("#genDefUser").val() == 5) {
|
||||
// 验证手机号
|
||||
var phoneReg = /^1[0-9]{10}$/;
|
||||
if (!phoneReg.test($('#phone').val())) {
|
||||
if (!phoneReg.test($("#phone").val())) {
|
||||
$("#tipMsg").text("手机号不正确");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
// 验证身份证号
|
||||
var idCardNumReg = /(^\d{15}$)|(^\d{17}(\d|X|x)$)/;
|
||||
if (!idCardNumReg.test($('#idCardNum').val())) {
|
||||
if (!idCardNumReg.test($("#idCardNum").val())) {
|
||||
$("#tipMsg").text("身份证号不正确");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证银行卡号
|
||||
var bankCardNumReg = /^\d{10,30}$/;
|
||||
if (!bankCardNumReg.test($('#bankCardNum').val())) {
|
||||
if (!bankCardNumReg.test($("#bankCardNum").val())) {
|
||||
$("#tipMsg").text("银行卡号不正确");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证支付密码
|
||||
var paymentPwdReg = /^\d{6}$/;
|
||||
if (!paymentPwdReg.test($('#paymentPwd').val())) {
|
||||
if (!paymentPwdReg.test($("#paymentPwd").val())) {
|
||||
$("#tipMsg").text("支付密码不正确,必须为6位数字");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -384,52 +530,51 @@ export default {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/gen/account/add",
|
||||
data: $('#addForm').serialize(),
|
||||
dataType: 'json',
|
||||
data: $("#addForm").serialize(),
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#genAccountModal").modal('hide');
|
||||
if (json.success == "true") {
|
||||
$("#genAccountModal").modal("hide");
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
TableHelper.doRefresh("#table");
|
||||
hideLoading();
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,错误信息:" + json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
hideLoading();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#genDefUser').on('change', function () {
|
||||
var defUser = $('#genDefUser').val();
|
||||
$("#genDefUser").on("change", function () {
|
||||
var defUser = $("#genDefUser").val();
|
||||
if (defUser == 4) {
|
||||
$('#header_block').attr('style', 'display:none;');
|
||||
$("#header_block").attr("style", "display:none;");
|
||||
} else if (defUser == 5) {
|
||||
$('#header_block').removeAttr('style');
|
||||
$("#header_block").removeAttr("style");
|
||||
}
|
||||
});
|
||||
|
||||
//导出
|
||||
$('#btnExport').on('click', function () {
|
||||
var startTime = $('#startTime').val();
|
||||
var endTime = $('#endTime').val();
|
||||
if (null == startTime || startTime.trim() == '') {
|
||||
$("#btnExport").on("click", function () {
|
||||
var startTime = $("#startTime").val();
|
||||
var endTime = $("#endTime").val();
|
||||
if (null == startTime || startTime.trim() == "") {
|
||||
$("#tipMsg").text("开始日期不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
if (null == endTime || endTime.trim() == '') {
|
||||
if (null == endTime || endTime.trim() == "") {
|
||||
$("#tipMsg").text("结束日期不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
if (startTime > endTime) {
|
||||
$("#tipMsg").text("开始日期不能大于结束日期");
|
||||
$("#tipModal").modal('show');
|
||||
$("#tipModal").modal("show");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -437,12 +582,9 @@ export default {
|
||||
form.attr("action", "/admin/gen/account/export");
|
||||
form.submit();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user