增加门店号

feature_0521
yechenhao 5 years ago
parent f9b618eb47
commit 9fc445bbce

@ -17,6 +17,7 @@
<Option v-for="(item,index) in shopList" :value="item.id" :key="index + item.id">{{ item.name }}</Option>
</Select>
<Button type="primary" @click="searchCustomerDataBtnClick" class="search-btn">查询</Button>
<Button type="primary" @click="open" style="margin-left: 20px;">开通门店号</Button>
<Button type="primary" @click="downloadStoreCode" style="margin-left: 20px;">批量下载门店码</Button>
<Button type="primary" @click="downloadStoreSellerCode" style="margin-left: 20px;">批量下载导购码</Button>
<Button type="primary" @click="isShowImport = true" style="margin-right: 10px;">批量导入账号</Button>
@ -32,7 +33,7 @@
class="table-img-qr-code"/>
</template>
<template slot-scope="{row}" slot="action">
<Button ghost class="router-btn" @click="open(row)"></Button>
<Button ghost class="router-btn" @click="openModify(row)"></Button>
<Button ghost class="router-btn" :to="{path:'/shop/increase/manager/staff',query:{storeId:row.id}}"> 门店导购管理</Button>
</template>
</Table>
@ -57,7 +58,7 @@
<!-- 开通企业微信号 -->
<Modal
v-model="isShowAdd"
v-model="isShowModify"
:footer-hide="true"
@on-ok="ok">
<div slot="header">开通企业微信号</div>
@ -85,6 +86,38 @@
</Form>
</Modal>
<!-- 开通企业微信号 -->
<Modal
v-model="isShowAdd"
:footer-hide="true"
@on-ok="ok">
<div slot="header">开通企业微信号</div>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="名称" prop="name">
<i-input type="text" v-model="formValidate.name" placeholder="请输入名字"></i-input>
</FormItem>
<FormItem label="别名" prop="alias">
<i-input v-model="formValidate.alias" placeholder="请输入别名"></i-input>
</FormItem>
<FormItem label="账号" prop="userId">
<i-input v-model="formValidate.userId" placeholder="请输入账号"></i-input>
</FormItem>
<FormItem label="手机" prop="mobile">
<i-input v-model="formValidate.mobile" placeholder="请输入手机"></i-input>
</FormItem>
<FormItem label="店铺" prop="storeId">
<Select v-model="formValidate.storeId" filterable>
<Option v-for="(item,index) in cpShopList" :value="item.id" :key="index + item.id">{{ item.name }}</Option>
</Select>
</FormItem>
<FormItem style="text-align: left;">
<Button type="primary" @click="handleSubmitAdd(formValidate)"></Button>
<Button @click="handleReset('formValidate')" style="margin-left: 8px">取消</Button>
</FormItem>
</Form>
</Modal>
<!-- 批量开通 -->
<Modal
width="85"
@ -147,6 +180,7 @@
isShowImport: false,
isShowError: false,
isShowAdd: false,
isShowModify: false,
showStoreName: '',
updateUrl: http.getBaseUrl() + "/store/emp/staff/import",
downLoadStoreCodeUrl: http.getBaseUrl() + "/store/emp/download/store/code",
@ -164,7 +198,9 @@
companyId: 0,
errorList: [],
selectedStore: 0,
selectedCpStore: 0,
shopList: [],
cpShopList: [],
rowData: {},
company: null,
columns1: [
@ -227,19 +263,28 @@
formValidate: {
alias: '',
id: '',
userId: '',
cpUserId: '',
mobile: '',
checkbox: ['vail'],
storeId: '',
cpUserName: '',
shopName: ''
name: ''
},
ruleValidate: {
userId: [
{required: true, message: '账号不能为空', trigger: 'blur'}
],
mobile: [
{required: true, message: '手机号码不能为空', trigger: 'blur'}
],
cpUserName: [
{required: true, message: '名称不能为空', trigger: 'blur'}
],
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
],
storeId: [
{required: true, message: '店铺不能为空', trigger: 'blur'}
]
}
}
@ -252,6 +297,7 @@
this.listOfStore();
this.getSelectList();
this.downShopData();
this.downCpShopData();
},
methods: {
searchCustomerDataBtnClick: function () {
@ -303,6 +349,17 @@
}
})
},
addStoreWX: function (request) {
let that = this;
http.addStoreWX(request, function (data) {
data = data.data;
if (data.code == "0000") {
that.$Message.success('修改成功!');
that.listOfStore();
this.handleAdd(this.formValidate);
}
})
},
//
insertAllOption: function () {
if (this.regionList.length === 0 || this.regionList[0].id !== 0) {
@ -400,6 +457,25 @@
}
})
},
downCpShopData: function () {
let that = this;
let customerList = this.organizationalList.filter(item => item.level === 3);
let customerIds = customerList.map(item => item.id);
let request =
{userId: that.userId, customerIds: JSON.stringify(customerIds)};
staff.downShopData(request, function (data) {
data = data.data.results;
if (data) {
that.cpShopList = [{"id": 0, "name": "全部"}];
for (let i = 0; i < data.length; i++) {
let entity = data[i];
if (entity) {
that.cpShopList.push(entity);
}
}
}
})
},
changeData: function (value) {
if (value == 0) {
return null;
@ -436,9 +512,23 @@
cancel: function () {
this.isShow = false;
},
open: function (item) {
open: function () {
this.isShowAdd = true;
this.formValidate = {
alias: "",
cpUserName: "",
userId: "",
id: "",
mobile: "",
checkbox: ['vail'],
storeId: "",
shopName: "",
}
},
openModify: function (item) {
this.isShowModify = true;
this.formValidate = {
alias: item.alias,
cpUserName: item.cpUserName,
@ -465,8 +555,17 @@
this.$Message.error('Fail!');
}
},
handleSubmitAdd(value) {
if (value) {
//
this.addStoreWX(value);
} else {
this.$Message.error('Fail!');
}
},
handleReset(name) {
this.$refs[name].resetFields();
this.isShowModify = false;
this.isShowAdd = false;
},
downLoadImportExcel() {

Loading…
Cancel
Save