导购换店开发。

feature_0521
kevin jiang 6 years ago
parent f8b35f9a91
commit 07f8a6a523

@ -1,195 +1,195 @@
<template> <template>
<div> <div>
<Row class="search-row"> <Row class="search-row">
<i-col span="24" class="search-col"> <i-col span="24" class="search-col">
<Row class="row-style"> <Row class="row-style">
<i-col span="12" style="text-align: left;padding-right: 20px;"> <i-col span="12" style="text-align: left;padding-right: 20px;">
<Button type="primary" @click="back()"></Button> <Button type="primary" @click="back()"></Button>
</i-col> </i-col>
<i-col span="12" style="text-align: right;padding-right: 20px;"> <i-col span="12" style="text-align: right;padding-right: 20px;">
<Button type="primary" @click="open(1)">广</Button> <Button type="primary" @click="open(1)">广</Button>
</i-col> </i-col>
</Row>
</i-col>
</Row> </Row>
</i-col>
</Row>
<Table <Table
:loading="loading" :loading="loading"
:columns="columns1" :columns="columns1"
:data="data1" :data="data1"
style="margin-top: 20px;" style="margin-top: 20px;"
size="small" size="small">
> <template slot-scope="{ row }" slot="qrCodeAction">
<template slot-scope="{ row }" slot="qrCodeAction"> <img
<img :src="require('../../../static/img/qrCode-init.png')"
:src="require('../../../static/img/qrCode-init.png')" @click="show(row)"
@click="show(row)" style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;"
style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;" />
/> </template>
</template> <!-- <template slot-scope="{ row, index }" slot="accountFlag">-->
<template slot-scope="{ row, index }" slot="state"> <!-- <i-switch-->
<i-switch <!-- size="large"-->
size="large" <!-- :value="row.accountFlag"-->
:value="row.qrCodeState" <!-- @on-change="onSwitchChangeLister"-->
@on-change="onSwitchChangeLister(row, index)" <!-- >-->
> <!-- <span slot="open">开启</span>-->
<span slot="open">开启</span> <!-- <span slot="close">关闭</span>-->
<span slot="close">关闭</span> <!-- </i-switch>-->
</i-switch> <!-- </template>-->
</template>
<template slot-scope="{ row }" slot="action"> <template slot-scope="{ row }" slot="action">
<Button <Button
ghost ghost
type="primary" type="primary"
size="small" size="small"
style="border: 0px;color:#2074E2" style="border: 0px;color:#2074E2"
@click="open(2, row)" @click="open(2, row)">修改
>修改 </Button>
</Button> <Button
<Button ghost
ghost type="error"
type="error" size="small"
size="small" style="border: 0px"
style="border: 0px" @click="remove(row)">删除
@click="remove(row)" </Button>
>删除</Button </template>
> </Table>
</template>
</Table>
<!-- 预览二维码 --> <!-- 预览二维码 -->
<Modal <Modal
v-model="isShow" v-model="isShow"
:footer-hide="true" :footer-hide="true"
width="230" width="230"
class-name="vertical-center-modal" class-name="vertical-center-modal">
> <div slot="header">
<div slot="header"> <p></p>
<p></p> </div>
</div> <p>{{ this.showStoreCode }}</p>
<p>{{ this.showStoreCode }}</p> <p>{{ this.showStoreName }}</p>
<p>{{ this.showStoreName }}</p> <img :src="qrCodeImage" style="width:200px;height:200px;"/>
<img :src="qrCodeImage" style="width:200px;height:200px;" /> <div style="text-align: center;">
<div style="text-align: center;"> <Button ghost type="primary" @click="download(rowData)"></Button>
<Button ghost type="primary" @click="download(rowData)"></Button> </div>
</div> </Modal>
</Modal>
<!-- 添加推广人员 --> <!-- 添加推广人员 -->
<Modal v-model="isShowAdd" :footer-hide="true"> <Modal v-model="isShowAdd" :footer-hide="true">
<div slot="header"> <div slot="header">
<template v-if="flag === 1"> <template v-if="flag === 1">
<span>添加推广人员</span> <span>添加推广人员</span>
</template> </template>
<template v-else> <template v-else>
<span>修改推广人员</span> <span>修改推广人员</span>
</template> </template>
</div> </div>
<Form <Form
ref="formValidate" ref="formValidate"
:model="formValidate" :model="formValidate"
:rules="ruleValidate" :rules="ruleValidate"
:label-width="80" :label-width="80"
> >
<FormItem label="名称" prop="name"> <FormItem label="名称" prop="name">
<i-input <i-input
v-model="formValidate.name" v-model="formValidate.name"
placeholder="请输入名字" placeholder="请输入名字"
></i-input> ></i-input>
</FormItem> </FormItem>
<FormItem label="手机" prop="phone"> <FormItem label="手机" prop="phone">
<i-input <i-input
v-model="formValidate.phone" v-model="formValidate.phone"
placeholder="成员通过验证该手机号后可加入企业" placeholder="成员通过验证该手机号后可加入企业"
:disabled="flag !== 1" :disabled="flag !== 1"
> >
</i-input> </i-input>
</FormItem> </FormItem>
<FormItem label="工号" prop="staffCode"> <FormItem label="工号" prop="staffCode">
<i-input <i-input
v-model="formValidate.staffCode" v-model="formValidate.staffCode"
placeholder="请输入工号" placeholder="请输入工号"
:disabled="flag !== 1" :disabled="flag !== 1"
></i-input> ></i-input>
</FormItem> </FormItem>
<FormItem label="角色" prop="role"> <FormItem label="角色" prop="role">
<Select <Select
v-model="formValidate.role" v-model="formValidate.role"
placeholder="选择角色" placeholder="选择角色"
:disabled="flag !== 1" :disabled="flag !== 1"
> >
<Option value="DZ-DIANZHANG">店长</Option> <Option value="DZ-DIANZHANG">店长</Option>
<Option value="DG-DAOGOU">导购</Option> <Option value="DG-DAOGOU">导购</Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem v-if="flag === 1" label="" prop="checkbox"> <FormItem v-if="flag === 1" label="" prop="checkbox">
<CheckboxGroup v-model="formValidate.checkbox"> <CheckboxGroup v-model="formValidate.checkbox">
<Checkbox label="vail">同步开通账号</Checkbox> <Checkbox label="vail">同步开通账号</Checkbox>
</CheckboxGroup> </CheckboxGroup>
</FormItem> </FormItem>
<FormItem v-if="flag !== 1 && formValidate.role === 'DZ-DIANZHANG'" label="主店长" prop="type"> <FormItem v-if="flag !== 1 && formValidate.role === 'DZ-DIANZHANG'" label="主店长" prop="type">
<Checkbox :disabled="formValidate.type === 1 ? true : false" v-model="formValidate.type" :true-value="1" :false-value="2"></Checkbox> <Checkbox :disabled="formValidate.type === 1 ? true : false" v-model="formValidate.type"
</FormItem> :true-value="1" :false-value="2"></Checkbox>
<FormItem style="text-align: left;"> </FormItem>
<Row> <FormItem style="text-align: left;">
<i-col span="16"> <Row>
<Button type="primary" @click="handleSubmit(formValidate)" <i-col span="16">
>保存</Button <Button type="primary" @click="handleSubmit(formValidate)"
> >保存
<Button </Button
@click="handleReset('formValidate')" >
style="margin-left: 8px" <Button
>取消</Button @click="handleReset('formValidate')"
> style="margin-left: 8px"
</i-col> >取消
</Row> </Button
</FormItem> >
</Form> </i-col>
</Modal> </Row>
</FormItem>
</Form>
</Modal>
<Modal <Modal
v-model="modal13" v-model="modal13"
title="删除提示" title="删除提示"
@on-cancel="cancel" @on-cancel="cancel"
align="center" 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
> >
</div> <p style="margin-top: 20px;margin-bottom: 20px">
</Modal> 确定要删除此账户吗删除后不可恢复
</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
>
</div>
</Modal>
<Page <Page
:total="total" :total="total"
:current="pageNum" :current="pageNum"
:page-size="pageSize" :page-size="pageSize"
show-elevator show-elevator
show-total show-total
placement="top" placement="top"
@on-change="handlePage" @on-change="handlePage"
class="ks-page" class="ks-page"
></Page> ></Page>
</div> </div>
</template> </template>
<script> <script>
import data from "../../utils/PhoneRegionData"; import data from "../../utils/PhoneRegionData";
import http from "../../services/store/IncreaseStoreManager"; import http from "../../services/store/IncreaseStoreManager";
import accountManagementService from '../../services/account/AccountManagement';
import staff from "../../services/staff/staff"; import staff from "../../services/staff/staff";
export default { export default {
name: "IncreaseStaffManager", name: "IncreaseStaffManager",
@ -256,8 +256,31 @@ import staff from "../../services/staff/staff";
key: 'epWechatQrCode', key: 'epWechatQrCode',
}, },
{ {
title: '停用/启用', title: '停用/启用',
slot: 'status', key: 'accountFlag',
render: (h, params) => {
let _this = this;
return h('div', [
h('i-switch', {
props: {
value: params.row.accountFlag,
'true-value': true,//
'false-value': false,//
size: 'large'
},
on: { //
'on-change': function (value) {
//
_this.modifyStatus(params.row.accountId, value);
}
},
scopedSlots: {
open: () => h('span', '开启'),
close: () => h('span', '关闭')
}
})
])
}
}, },
{ {
title: '操作', title: '操作',
@ -294,7 +317,7 @@ import staff from "../../services/staff/staff";
// { type: 'email', message: '', trigger: 'blur' } // { type: 'email', message: '', trigger: 'blur' }
// ], // ],
role: [ role: [
{required: true, message: '请选择角色', trigger: 'change'} {required: true, message: '请选择角色', trigger: 'change'}
], ],
region: [ region: [
{required: true, type: String, message: '请选择区域', trigger: 'change'} {required: true, type: String, message: '请选择区域', trigger: 'change'}
@ -306,8 +329,8 @@ import staff from "../../services/staff/staff";
} }
}, },
mounted() { mounted() {
this.userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId; this.userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
this.setMenuName("门店推广", "推广管理", "门店导购管理"); this.setMenuName("门店推广", "推广管理", "门店导购管理");
this.listOfLogistics(); this.listOfLogistics();
}, },
methods: { methods: {
@ -315,7 +338,7 @@ import staff from "../../services/staff/staff";
}, },
listOfLogistics() { listOfLogistics() {
this.loading = true; this.loading = true;
let that = this; let that = this;
let request = { let request = {
shopId: that.selectedStore, shopId: that.selectedStore,
@ -323,7 +346,7 @@ import staff from "../../services/staff/staff";
pageSize: that.pageSize, pageSize: that.pageSize,
}; };
staff.getStaffList(request, function (data) { staff.getStaffList(request, function (data) {
that.loading = false; that.loading = false;
data = data.data; data = data.data;
if (data.code == "0000") { if (data.code == "0000") {
@ -338,10 +361,15 @@ import staff from "../../services/staff/staff";
if (datas.records == null) { if (datas.records == null) {
datas.records = []; datas.records = [];
} }
that.data1 = datas.records;
for (let i = 0; i < datas.records.length; i++) {
let item = datas.records[i];
that.data1.push(item);
}
} }
}, function () { }, function () {
that.loading = false; that.loading = false;
}); });
}, },
// //
@ -427,170 +455,193 @@ import staff from "../../services/staff/staff";
}) })
}, },
searchCustomerDataBtnClick: function() { searchCustomerDataBtnClick: function () {
this.listOfLogistics(); this.listOfLogistics();
}, },
changeData: function(value) { changeData: function (value) {
if (value == 0) { if (value == 0) {
return null; return null;
} }
return value; return value;
}, },
// //
handlePage: function(value) { handlePage: function (value) {
this.pageNum = value; this.pageNum = value;
this.listOfLogistics(); this.listOfLogistics();
}, },
downRegionChange: function() { downRegionChange: function () {
this.downShopData(); this.downShopData();
}, },
onChangeDateLister: function() {}, onChangeDateLister: function () {
// },
show: function(index) { //
this.isShow = true; show: function (index) {
this.showStoreName = "姓名:" + index.name; this.isShow = true;
this.showStoreCode = "工号:" + index.staffCode; this.showStoreName = "姓名:" + index.name;
this.qrCodeImage = index.epWechatQrCode; this.showStoreCode = "工号:" + index.staffCode;
this.rowData = index; this.qrCodeImage = index.epWechatQrCode;
}, this.rowData = index;
// },
download: function(index) { //
let name = index.staffCode + "-" + index.name + "-导购码"; download: function (index) {
http.downloadImg( let name = index.staffCode + "-" + index.name + "-导购码";
{ http.downloadImg(
url: index.epWechatQrCode, {
}, url: index.epWechatQrCode,
name, },
function(/*data*/) {} name,
); function (/*data*/) {
}, }
// 广 );
open: function(flag, row) { },
this.flag = flag; // 广
this.isShowAdd = true; open: function (flag, row) {
let role; this.flag = flag;
this.isShowAdd = true;
let role;
if (row && row.type) { if (row && row.type) {
if (row.type === 1 || row.type === 2) { if (row.type === 1 || row.type === 2) {
role = "DZ-DIANZHANG"; role = "DZ-DIANZHANG";
} else { } else {
role = "DG-DAOGOU"; role = "DG-DAOGOU";
} }
} }
if (flag == 2) { if (flag == 2) {
this.formValidate = { this.formValidate = {
name: row.name, name: row.name,
staffCode: row.staffCode, staffCode: row.staffCode,
phone: row.mobil, phone: row.mobil,
role: role, role: role,
store: row.storeId, store: row.storeId,
type: row.type, type: row.type,
userId: row.userId, userId: row.userId,
id: row.id, id: row.id,
}; };
} else { } else {
this.handleAdd(this.formValidate); this.handleAdd(this.formValidate);
} }
}, },
back: function() { back: function () {
this.$router.push({ path: "/shop/increase/manager" }); this.$router.push({path: "/shop/increase/manager"});
}, },
// //
remove: function(row) { remove: function (row) {
this.modal13 = true; this.modal13 = true;
this.deleteId = row.id; this.deleteId = row.id;
}, },
// //
deleteStaff: function() { deleteStaff: function () {
let requset = { let requset = {
staffId: this.deleteId, staffId: this.deleteId,
}; };
let that = this; let that = this;
staff.removeStaff(requset, function(data) { staff.removeStaff(requset, function (data) {
data = data.data; data = data.data;
if (data.results) { if (data.results) {
that.$Message.success("删除成功!"); that.$Message.success("删除成功!");
that.modal13 = false; that.modal13 = false;
that.listOfLogistics(); that.listOfLogistics();
} else { } else {
that.$Message.success("删除失败!"); that.$Message.success("删除失败!");
} }
}); });
}, },
// switch // switch
onSwitchChangeLister: function() {}, modifyStatus(accountId, val) {
handleSubmit(value) { debugger
if (value) { let that = this;
let request = {}; let status;
if (this.flag == 1) { if (val) {
if (value.name == null || value.name == "") { status = 1;
this.$Message.success("名称不能为空!"); } else {
return; status = 2;
} }
if (value.staffCode == null || value.staffCode == "") { let request = {
this.$Message.success("工号不能为空!"); accountId: accountId,
return; status: status
} };
if (value.role == null || value.role == "") { accountManagementService.postAccountModifyStatus(request, function (res) {
this.$Message.success("角色不能为空!"); let data = res.data;
return; if (data.code !== "0000") {
} that.$Message.error("修改失败");
// }
request = { }, function (res) {
name: value.name,
storeId: this.selectedStore, });
mobil: value.phone, },
staffCode: value.staffCode, handleSubmit(value) {
role: value.role, if (value) {
isOpen: this.formValidate.checkbox[0], let request = {};
}; if (this.flag == 1) {
this.addSattf(request); if (value.name == null || value.name == "") {
} else { this.$Message.success("名称不能为空!");
let newRole; return;
if (value.role === "DZ-DIANZHANG") { }
newRole = 1; if (value.staffCode == null || value.staffCode == "") {
} else { this.$Message.success("工号不能为空!");
newRole = 4; return;
} }
if (value.role == null || value.role == "") {
this.$Message.success("角色不能为空!");
return;
}
//
request = {
name: value.name,
storeId: this.selectedStore,
mobil: value.phone,
staffCode: value.staffCode,
role: value.role,
isOpen: this.formValidate.checkbox[0],
};
this.addSattf(request);
} else {
let newRole;
if (value.role === "DZ-DIANZHANG") {
newRole = 1;
} else {
newRole = 4;
}
request = { request = {
name: value.name, name: value.name,
storeId: this.selectedStore, storeId: this.selectedStore,
mobil: value.phone, mobil: value.phone,
staffCode: value.staffCode, staffCode: value.staffCode,
roleId: newRole, roleId: newRole,
userId: this.formValidate.userId, userId: this.formValidate.userId,
type: this.formValidate.type, type: this.formValidate.type,
id: this.formValidate.id, id: this.formValidate.id,
}; };
// //
this.editSattf(request); this.editSattf(request);
} }
} else { } else {
this.$Message.error("Fail!"); this.$Message.error("Fail!");
} }
}, },
handleReset(name) { handleReset(name) {
this.$refs[name].resetFields(); this.$refs[name].resetFields();
this.isShowAdd = false; this.isShowAdd = false;
}, },
handleAdd(value) { handleAdd(value) {
value.name = ""; value.name = "";
value.store = ""; value.store = "";
value.phone = ""; value.phone = "";
value.staffCode = ""; value.staffCode = "";
value.role = ""; value.role = "";
value.type = ""; value.type = "";
value.region = ""; value.region = "";
value.checkbox = ["vail"]; value.checkbox = ["vail"];
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.table-staff { .table-staff {
margin-top: 20px !important; margin-top: 20px !important;
} }
</style> </style>

@ -44,11 +44,21 @@ export function listRoleInfoApi(params, call) {
return http.get('/role/info/list', params).then(call); return http.get('/role/info/list', params).then(call);
} }
/**
* 修改账号状态
* @param params
* @param call
* @returns {Promise<any | never>}
*/
export function postAccountModifyStatus(params, call, p) {
return http.post('account/modify/status', params).then(call);
}
export default { export default {
listAccountInfoApi, listAccountInfoApi,
removeAccountApi, removeAccountApi,
listAllShopApi, listAllShopApi,
listRoleInfoApi listRoleInfoApi,
postAccountModifyStatus
} }

Loading…
Cancel
Save