Merge branch 'feature_0521' of http://git.51jingcheng.com/zhenghuang/bsdgy-front into feature_0521

feature_0521
liuyang 5 years ago
commit 50e60964bf

@ -18,7 +18,8 @@
:columns="columns1"
:data="data1"
style="margin-top: 20px;"
size="small">
size="small"
>
<template slot-scope="{ row }" slot="qrCodeAction">
<img
:src="require('../../../static/img/qrCode-init.png')"
@ -43,24 +44,14 @@
type="primary"
size="small"
style="border: 0px;color:#2074E2"
@click="open(2, row)">修改
</Button>
<Button
ghost
type="error"
size="small"
style="border: 0px"
@click="remove(row)">删除
</Button>
@click="open(2, row)"
>修改</Button>
<Button ghost type="error" size="small" style="border: 0px" @click="remove(row)"></Button>
</template>
</Table>
<!-- 预览二维码 -->
<Modal
v-model="isShow"
:footer-hide="true"
width="230"
class-name="vertical-center-modal">
<Modal v-model="isShow" :footer-hide="true" width="230" class-name="vertical-center-modal">
<div slot="header">
<p></p>
</div>
@ -83,88 +74,59 @@
</template>
</div>
<Form ref="formValidate"
:model="formValidate"
:rules="ruleValidate"
:label-width="80">
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="名称" prop="name">
<i-input
v-model="formValidate.name"
placeholder="请输入名字"
></i-input>
<i-input v-model="formValidate.name" placeholder="请输入名字"></i-input>
</FormItem>
<FormItem label="手机" prop="phone">
<i-input
v-model="formValidate.phone"
placeholder="成员通过验证该手机号后可加入企业"
:disabled="flag !== 1">
</i-input>
</FormItem>
<FormItem label="工号" prop="staffCode">
<i-input
v-model="formValidate.staffCode"
placeholder="请输入工号"
:disabled="flag !== 1"
></i-input>
</FormItem>
<FormItem label="工号" prop="staffCode">
<i-input v-model="formValidate.staffCode" placeholder="请输入工号" :disabled="flag !== 1"></i-input>
</FormItem>
<FormItem label="角色" prop="roleId">
<Select
v-model="formValidate.roleId"
placeholder="选择角色"
:disabled="flag !== 1">
<Select v-model="formValidate.roleId" placeholder="选择角色" :disabled="flag !== 1">
<Option :value="4">店长</Option>
<Option :value="5">导购</Option>
</Select>
</FormItem>
<FormItem v-if="flag === 1" label="" prop="checkbox">
<FormItem v-if="flag === 1" label prop="checkbox">
<CheckboxGroup v-model="formValidate.checkbox">
<Checkbox label="vail">同步开通账号</Checkbox>
</CheckboxGroup>
</FormItem>
<FormItem v-if="flag !== 1 && formValidate.roleCode === 'DZ-DIANZHANG'" label="主店长" prop="type">
<Checkbox :disabled="formValidate.type === 1" v-model="formValidate.type"
:true-value="1" :false-value="2"></Checkbox>
<FormItem
v-if="flag !== 1 && formValidate.roleCode === 'DZ-DIANZHANG'"
label="主店长"
prop="type"
>
<Checkbox
:disabled="formValidate.type === 1"
v-model="formValidate.type"
:true-value="1"
:false-value="2"
></Checkbox>
</FormItem>
<FormItem style="text-align: left;">
<Row>
<i-col span="16">
<Button type="primary" @click="handleSubmit(formValidate)"
>保存
</Button
>
<Button
@click="handleReset('formValidate')"
style="margin-left: 8px"
>取消
</Button
>
<Button type="primary" @click="handleSubmit(formValidate)"></Button>
<Button @click="handleReset('formValidate')" style="margin-left: 8px">取消</Button>
</i-col>
</Row>
</FormItem>
</Form>
</Modal>
<Modal
v-model="modal13"
title="删除提示"
@on-cancel="cancel"
align="center"
>
<p style="margin-top: 20px;margin-bottom: 20px">
确定要删除此账户吗删除后不可恢复
</p>
<div
slot="footer"
style="text-align: center;margin-bottom: 10px;margin-top: 10px"
>
<Modal v-model="modal13" title="删除提示" @on-cancel="cancel" align="center">
<p style="margin-top: 20px;margin-bottom: 20px">确定要删除此账户吗删除后不可恢复</p>
<div slot="footer" style="text-align: center;margin-bottom: 10px;margin-top: 10px">
<Button style="width: 100px;" @click="modal13 = false">取消删除</Button>
<Button
type="error"
style="width: 100px;margin-left: 20px"
@click="deleteStaff"
>确认删除
</Button
>
<Button type="error" style="width: 100px;margin-left: 20px" @click="deleteStaff"></Button>
</div>
</Modal>
@ -184,25 +146,26 @@
<script>
import data from "../../utils/PhoneRegionData";
import http from "../../services/store/IncreaseStoreManager";
import accountManagementService from '../../services/account/AccountManagement';
import accountManagementService from "../../services/account/AccountManagement";
import staff from "../../services/staff/staff";
export default {
name: "IncreaseStaffManager",
inject: ['setMenuName'],
inject: ["setMenuName"],
data() {
let _this = this;
return {
modal13: false,
deleteId: null,
userId: '',
userId: "",
// 1 2
flag: 1,
prefixDefault: data.prefixDefault,
isShow: false,
isShowAdd: false,
showStoreName: '',
showStoreCode: '',
qrCodeImage: '',
showStoreName: "",
showStoreCode: "",
qrCodeImage: "",
loading: false,
spuLoading: false,
//
@ -219,118 +182,135 @@
rules: { required: false },
columns1: [
{
title: '序号',
key: 'id',
title: "序号",
key: "id"
},
{
title: '姓名',
key: 'name',
title: "姓名",
key: "name"
},
{
title: '员工ID',
key: 'staffCode',
title: "员工ID",
key: "staffCode"
},
{
title: '手机号码',
key: 'mobil',
title: "手机号码",
key: "mobil"
},
{
title: '店铺',
key: 'storeName',
title: "店铺",
key: "storeName"
},
{
title: '角色',
key: 'roleName',
title: "角色",
key: "roleName"
},
{
title: '客户数',
key: 'customerNum',
title: "客户数",
key: "customerNum"
},
{
title: '推广码',
slot: 'qrCodeAction',
key: 'epWechatQrCode',
title: "推广码",
slot: "qrCodeAction",
key: "epWechatQrCode"
},
{
title: '停用/启用',
key: 'status',
title: "停用/启用",
key: "status",
render: (h, params) => {
let _this = this;
return h('div', [
h('i-switch', {
return h("div", [
h("i-switch", {
props: {
value: params.row.status,
'true-value': 1,//
'false-value': 2,//
size: 'large'
"true-value": 1, //
"false-value": 2, //
size: "large"
},
on: { //
'on-change': function (value) {
on: {
//
"on-change": function(value) {
//
// _this.modifyStatus(params.row.accountId, value);
let request = {
status: value,
id: _this.formValidate.id
};
debugger
debugger;
//
_this.editSattf(request);
}
},
scopedSlots: {
open: () => h('span', '开启'),
close: () => h('span', '关闭')
open: () => h("span", "开启"),
close: () => h("span", "关闭")
}
})
])
]);
}
},
{
title: '操作',
slot: 'action',
title: "操作",
slot: "action"
}
],
data1: [],
//
formValidate: {
name: '',
staffCode: '',
region: '',
phone: '',
name: "",
staffCode: "",
region: "",
phone: "",
roleId: 0,
store: '',
userId: '',
type: '',
store: "",
userId: "",
type: "",
status: 0,
checkbox: ['vail'],
roleCode: ''
checkbox: ["vail"],
roleCode: ""
},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
staffCode: [
{required: true, message: '工号不能为空', trigger: 'blur'}
{ required: true, message: "工号不能为空", trigger: "blur" }
],
phone: [
{required: true, message: '手机号码不能为空', trigger: 'blur'},
{pattern: /^1[1-9]\d{9}$/, message: "手机号码格式不正确", trigger: "blur"}
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[1-9]\d{9}$/,
message: "手机号码格式不正确",
trigger: "blur"
}
],
// mail: [
// { required: true, message: '', trigger: 'blur' },
// { type: 'email', message: '', trigger: 'blur' }
// ],
roleId: [
{type: 'number', required: true, message: '请选择角色', trigger: 'change'}
{
type: "number",
required: true,
message: "请选择角色",
trigger: "change"
}
],
region: [
{required: true, type: String, message: '请选择区域', trigger: 'change'}
{
required: true,
type: String,
message: "请选择区域",
trigger: "change"
}
],
store: [
{required: true, type: String, message: '请选择店铺', trigger: 'change'}
]
{
required: true,
type: String,
message: "请选择店铺",
trigger: "change"
}
]
}
};
},
mounted() {
this.userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
@ -338,22 +318,21 @@
this.listOfLogistics();
},
methods: {
cancel: function () {
},
cancel: function() {},
listOfLogistics() {
this.loading = true;
let that = this;
let request = {
shopId: that.selectedStore,
pageNum: that.pageNum,
pageSize: that.pageSize,
pageSize: that.pageSize
};
staff.getStaffList(request, function (data) {
staff.getStaffList(
request,
function(data) {
that.loading = false;
data = data.data;
if (data.code == "0000") {
that.data1 = [];
let datas = data.results;
//
@ -372,16 +351,17 @@
that.data1.push(item);
}
}
}, function () {
},
function() {
that.loading = false;
});
}
);
},
//
downRegionData: function() {
let that = this;
that.regionList = [{"id": 0, "name": "全部"}];
let request =
{userId: that.userId};
that.regionList = [{ id: 0, name: "全部" }];
let request = { userId: that.userId };
staff.downRegionData(request, function(data) {
data = data.data.results;
if (data) {
@ -392,13 +372,15 @@
}
}
}
})
});
},
downShopData: function() {
let that = this;
that.shopList = [{"id": 0, "name": "全部"}];
let request =
{userId: that.userId, regionId: that.changeData(that.selectedRegion)};
that.shopList = [{ id: 0, name: "全部" }];
let request = {
userId: that.userId,
regionId: that.changeData(that.selectedRegion)
};
staff.downShopData(request, function(data) {
data = data.data.results;
if (data) {
@ -409,7 +391,7 @@
}
}
}
})
});
},
downRoleData: function() {
let that = this;
@ -423,7 +405,7 @@
}
}
}
})
});
},
addSattf: function(request) {
let that = this;
@ -431,34 +413,33 @@
data = data.data;
if (data.code == "0000") {
if (data.results == "0001") {
that.$Message.error('添加失败!');
that.$Message.error("添加失败!");
} else if (data.results == "0002") {
that.$Message.error('该工号已经被使用!');
that.$Message.error("该工号已经被使用!");
} else if (data.results == "0003") {
that.$Message.error('该手机号已经被使用!');
that.$Message.error("该手机号已经被使用!");
} else if (data.results == "0004") {
that.$Message.error('该工号已经被使用!');
that.$Message.error("该工号已经被使用!");
} else if (data.results == "0000") {
that.$Message.success('添加成功!');
that.$Message.success("添加成功!");
that.handleAdd(that.formValidate);
that.listOfLogistics();
}
} else {
that.$Message.error(data.msg);
}
})
});
},
editSattf: function(request) {
let that = this;
staff.editSattf(request, function(data) {
data = data.data;
if (data.code == "0000") {
that.$Message.success('修改成功!');
that.$Message.success("修改成功!");
that.isShowAdd = false;
that.listOfLogistics();
}
})
});
},
searchCustomerDataBtnClick: function() {
@ -478,8 +459,7 @@
downRegionChange: function() {
this.downShopData();
},
onChangeDateLister: function () {
},
onChangeDateLister: function() {},
//
show: function(index) {
this.isShow = true;
@ -493,11 +473,10 @@
let name = index.staffCode + "-" + index.name + "-导购码";
http.downloadImg(
{
url: index.epWechatQrCode,
url: index.epWechatQrCode
},
name,
function (/*data*/) {
}
function(/*data*/) {}
);
},
// 广
@ -516,7 +495,7 @@
id: row.id,
roleCode: row.roleCode
};
debugger
debugger;
} else {
this.handleAdd(this.formValidate);
}
@ -532,7 +511,7 @@
//
deleteStaff: function() {
let requset = {
staffId: this.deleteId,
staffId: this.deleteId
};
let that = this;
staff.removeStaff(requset, function(data) {
@ -559,14 +538,16 @@
accountId: accountId,
status: status
};
accountManagementService.postAccountModifyStatus(request, function (res) {
accountManagementService.postAccountModifyStatus(
request,
function(res) {
let data = res.data;
if (data.code !== "0000") {
that.$Message.error("修改失败");
}
}, function (res) {
});
},
function(res) {}
);
},
handleSubmit(value) {
if (value) {
@ -591,11 +572,10 @@
mobil: value.phone,
staffCode: value.staffCode,
roleId: value.roleId,
isOpen: this.formValidate.checkbox[0],
isOpen: this.formValidate.checkbox[0]
};
this.addSattf(request);
} else {
request = {
name: value.name,
storeId: this.selectedStore,
@ -604,7 +584,7 @@
roleId: value.roleId,
userId: this.formValidate.userId,
type: this.formValidate.type,
id: this.formValidate.id,
id: this.formValidate.id
};
//
this.editSattf(request);
@ -626,8 +606,8 @@
value.type = "";
value.region = "";
value.checkbox = ["vail"];
},
},
}
}
};
</script>

Loading…
Cancel
Save