|
|
|
@ -7,20 +7,20 @@
|
|
|
|
|
<span class="region">区域选择</span>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
|
<Select v-model="selectedRegion" filterable style="width: 200px;">
|
|
|
|
|
<Option v-for="item in regionList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
|
|
<Select v-model="selectedRegion" filterable @on-change="downRegionChange" style="width: 200px;">
|
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="1" style="text-align: right;">
|
|
|
|
|
<span class="region">店铺选择</span>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
|
<Select v-model="selectedStore" filterable style="width: 200px;">
|
|
|
|
|
<Option v-for="item in storeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
|
|
<Select v-model="selectedStore" filterable style="width: 200px;" >
|
|
|
|
|
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="2">
|
|
|
|
|
<Button type="primary">查询</Button>
|
|
|
|
|
<Button type="primary" @click="searchCustomerDataBtnClick">查询</Button>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="12" style="text-align: right;padding-right: 20px;">
|
|
|
|
|
<Button type="primary" style="margin-right: 10px;">批量下载</Button>
|
|
|
|
@ -45,7 +45,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template slot-scope="{ row, index }" slot="action">
|
|
|
|
|
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="open(2, index)">修改</Button>
|
|
|
|
|
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="open(2, row)">修改</Button>
|
|
|
|
|
<Button ghost type="error" size="small" @click="remove(index)">删除</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</Table>
|
|
|
|
@ -57,7 +57,7 @@
|
|
|
|
|
:footer-hide="true"
|
|
|
|
|
width="230"
|
|
|
|
|
class-name="vertical-center-modal"
|
|
|
|
|
>
|
|
|
|
|
>
|
|
|
|
|
<div slot="header">{{this.showStoreName}}</div>
|
|
|
|
|
<img :src="qrCodeImage" style="width:200px;height:200px;"/>
|
|
|
|
|
<div style="text-align: center;">
|
|
|
|
@ -69,7 +69,7 @@
|
|
|
|
|
<Modal
|
|
|
|
|
v-model="isShowAdd"
|
|
|
|
|
:footer-hide="true"
|
|
|
|
|
>
|
|
|
|
|
>
|
|
|
|
|
<div slot="header">
|
|
|
|
|
<template v-if="flag === 1">
|
|
|
|
|
<span>添加推广人员</span>
|
|
|
|
@ -90,57 +90,58 @@
|
|
|
|
|
<FormItem label="工号" prop="staffCode">
|
|
|
|
|
<i-input v-model="formValidate.staffCode" placeholder="请输入工号" :disabled="flag !== 1 ? true : false" ></i-input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="角色" prop="role">
|
|
|
|
|
<Select v-model="formValidate.role" placeholder="选择角色">
|
|
|
|
|
<Option value="1">角色1</Option>
|
|
|
|
|
<Option value="2">角色2</Option>
|
|
|
|
|
<Option value="3">角色3</Option>
|
|
|
|
|
<FormItem label="角色" prop="role" :rules="rules">
|
|
|
|
|
<Select v-model="formValidate.role" placeholder="选择角色">
|
|
|
|
|
<Option :value="1" >店长</Option>
|
|
|
|
|
<Option :value="2" >副店长</Option>
|
|
|
|
|
<Option :value="3" >店长助理</Option>
|
|
|
|
|
<Option :value="4" >导购</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="所属区域" prop="region">
|
|
|
|
|
<Select v-model="formValidate.region" placeholder="选择区域">
|
|
|
|
|
<Option value="1">区域1</Option>
|
|
|
|
|
<Option value="2">区域2</Option>
|
|
|
|
|
<Option value="3">区域3</Option>
|
|
|
|
|
<Select v-model="formValidate.region" placeholder="选择区域">
|
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id" >{{item.name}}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="所属店铺" prop="store">
|
|
|
|
|
<FormItem label="所属店铺" prop="store" >
|
|
|
|
|
<Select v-model="formValidate.store" placeholder="选择店铺">
|
|
|
|
|
<Option value="1">店铺1</Option>
|
|
|
|
|
<Option value="2">店铺2</Option>
|
|
|
|
|
<Option value="3">店铺3</Option>
|
|
|
|
|
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{item.name}}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem style="text-align: left;">
|
|
|
|
|
<Row>
|
|
|
|
|
<i-col span="16">
|
|
|
|
|
<Button type="primary" @click="handleSubmit('formValidate')">保存并生成推广码</Button>
|
|
|
|
|
<Button type="primary" @click="handleSubmit(formValidate)">保存并生成推广码</Button>
|
|
|
|
|
<Button @click="handleReset('formValidate')" style="margin-left: 8px">取消</Button>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="8" style="text-align: right;">
|
|
|
|
|
<Button>继续添加</Button>
|
|
|
|
|
<Button @click="handleAdd(formValidate)" v-if="flag === 1">
|
|
|
|
|
<span>继续添加</span>
|
|
|
|
|
</Button>
|
|
|
|
|
</i-col>
|
|
|
|
|
</Row>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</Form>
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
<div style="margin: 30px;overflow: hidden">
|
|
|
|
|
<div style="float: right;">
|
|
|
|
|
<Page :total="total" :current="pageNum" :pageSize="pageSize"></Page>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin: 30px;overflow: hidden">
|
|
|
|
|
<div style="float: right;">
|
|
|
|
|
<Page :total="total" :current="pageNum" :pageSize="pageSize"></Page>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import data from "../../utils/PhoneRegionData";
|
|
|
|
|
|
|
|
|
|
import staff from "../../services/staff/staff";
|
|
|
|
|
import staff, {downRoleData} from "../../services/staff/staff";
|
|
|
|
|
import customerDetail from "../../services/datacenter/DataCenter";
|
|
|
|
|
export default {
|
|
|
|
|
name: "IncreaseStaffManager",
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
userId: 13,
|
|
|
|
|
// 标记 1添加 2修改
|
|
|
|
|
flag: 1,
|
|
|
|
|
prefixDefault: data.prefixDefault,
|
|
|
|
@ -152,13 +153,16 @@
|
|
|
|
|
spuLoading:false,
|
|
|
|
|
// 分页
|
|
|
|
|
total: 0,
|
|
|
|
|
pageSize: 15,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
selectedRegion: null,
|
|
|
|
|
regionList: [],
|
|
|
|
|
selectedStore: null,
|
|
|
|
|
storeList: [],
|
|
|
|
|
shopList:[],
|
|
|
|
|
roleList: [],
|
|
|
|
|
rowData:{},
|
|
|
|
|
rules: {required: false},
|
|
|
|
|
columns1: [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
@ -215,11 +219,13 @@
|
|
|
|
|
data1: [],
|
|
|
|
|
// 开通企业微信 表单
|
|
|
|
|
formValidate: {
|
|
|
|
|
name:'',
|
|
|
|
|
staffCode: '',
|
|
|
|
|
region: '',
|
|
|
|
|
phone: '',
|
|
|
|
|
role: '',
|
|
|
|
|
store: ''
|
|
|
|
|
store: '',
|
|
|
|
|
userId : ''
|
|
|
|
|
},
|
|
|
|
|
ruleValidate: {
|
|
|
|
|
name: [
|
|
|
|
@ -233,19 +239,22 @@
|
|
|
|
|
// { type: 'email', message: '邮箱格式错误', trigger: 'blur' }
|
|
|
|
|
// ],
|
|
|
|
|
role: [
|
|
|
|
|
{ required: true, message: '请选择角色', trigger: 'change' }
|
|
|
|
|
{ required: true,type:String ,message: '请选择角色', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
region: [
|
|
|
|
|
{ required: true, message: '请选择区域', trigger: 'change' }
|
|
|
|
|
{ required: true, type:String,message: '请选择区域', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
store: [
|
|
|
|
|
{ required: true, message: '请选择店铺', trigger: 'change' }
|
|
|
|
|
{ required: true,type:String, message: '请选择店铺', trigger: 'change' }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.listOfLogistics();
|
|
|
|
|
this.downRegionData();
|
|
|
|
|
this.downShopData();
|
|
|
|
|
this.downRoleData()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
changePage (page) {
|
|
|
|
@ -256,8 +265,8 @@
|
|
|
|
|
let that = this;
|
|
|
|
|
let request = {
|
|
|
|
|
userId: 1 ,
|
|
|
|
|
region: that.region,
|
|
|
|
|
shopId: that.store,
|
|
|
|
|
region: that.changeData(that.selectedRegion),
|
|
|
|
|
shopId: that.changeData(that.selectedStore),
|
|
|
|
|
pageNum: that.pageNum,
|
|
|
|
|
pageSize: that.pageSize,
|
|
|
|
|
};
|
|
|
|
@ -280,6 +289,86 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//区域用户下的区域
|
|
|
|
|
downRegionData: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
that.regionList = [{"id":0,"name":"全部"}];
|
|
|
|
|
let request =
|
|
|
|
|
{userId: that.userId};
|
|
|
|
|
staff.downRegionData(request, function (data) {
|
|
|
|
|
data = data.data.results;
|
|
|
|
|
if(data){
|
|
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
|
|
let entity = data[i];
|
|
|
|
|
if(entity){
|
|
|
|
|
that.regionList.push(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
downShopData: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
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){
|
|
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
|
|
let entity = data[i];
|
|
|
|
|
if(entity){
|
|
|
|
|
that.shopList.push(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
downRoleData: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
staff.downRoleData({}, function (data) {
|
|
|
|
|
data = data.data.results;
|
|
|
|
|
if(data){
|
|
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
|
|
let entity = data[i];
|
|
|
|
|
if(entity){
|
|
|
|
|
that.roleList.push(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
addSattf : function (request){
|
|
|
|
|
let that = this;
|
|
|
|
|
staff.addSattf(request,function (data) {
|
|
|
|
|
data = data.data;
|
|
|
|
|
if (data.code == "0000"){
|
|
|
|
|
that.$Message.success('添加成功!');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
editSattf : function (request){
|
|
|
|
|
let that = this;
|
|
|
|
|
staff.editSattf(request,function (data) {
|
|
|
|
|
data = data.data;
|
|
|
|
|
if (data.code == "0000"){
|
|
|
|
|
that.$Message.success('修改成功!');
|
|
|
|
|
that.isShowAdd = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
searchCustomerDataBtnClick: function () {
|
|
|
|
|
this.listOfLogistics();
|
|
|
|
|
},
|
|
|
|
|
changeData: function (value) {
|
|
|
|
|
if(value == 0){return null;}
|
|
|
|
|
return value;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
downRegionChange: function () {
|
|
|
|
|
this.downShopData();
|
|
|
|
|
},
|
|
|
|
|
// 日期选择
|
|
|
|
|
onChangeDateLister: function () {
|
|
|
|
|
|
|
|
|
@ -313,9 +402,22 @@
|
|
|
|
|
image.src = index.epWechatQrCode;
|
|
|
|
|
},
|
|
|
|
|
// 添加、修改推广人员
|
|
|
|
|
open: function (flag) {
|
|
|
|
|
open: function (flag,row) {
|
|
|
|
|
this.flag = flag;
|
|
|
|
|
this.isShowAdd = true;
|
|
|
|
|
if(flag == 2){
|
|
|
|
|
this.formValidate = {
|
|
|
|
|
name: row.name,
|
|
|
|
|
staffCode: row.staffCode,
|
|
|
|
|
region: row.region,
|
|
|
|
|
phone: row.mobil,
|
|
|
|
|
role: row.type,
|
|
|
|
|
store: row.storeId,
|
|
|
|
|
userId:row.userId,
|
|
|
|
|
id : row.id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 删除
|
|
|
|
|
remove: function () {
|
|
|
|
@ -325,19 +427,42 @@
|
|
|
|
|
onSwitchChangeLister: function () {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleSubmit (name) {
|
|
|
|
|
this.$refs[name].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
handleSubmit (value) {
|
|
|
|
|
|
|
|
|
|
if (value) {
|
|
|
|
|
let request = {
|
|
|
|
|
name : value.name,
|
|
|
|
|
storeId:value.store,
|
|
|
|
|
mobil: value.phone,
|
|
|
|
|
staffCode :value.staffCode,
|
|
|
|
|
roleId: value.role,
|
|
|
|
|
userId : this.formValidate.userId,
|
|
|
|
|
id:this.formValidate.id
|
|
|
|
|
};
|
|
|
|
|
if (this.flag == 1){
|
|
|
|
|
// 调用添加接口
|
|
|
|
|
this.$Message.success('Success!');
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.error('Fail!');
|
|
|
|
|
this.addSattf(request);
|
|
|
|
|
}else {
|
|
|
|
|
//修改接口
|
|
|
|
|
this.editSattf(request);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.error('Fail!');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleReset (name) {
|
|
|
|
|
this.$refs[name].resetFields();
|
|
|
|
|
this.isShowAdd = false;
|
|
|
|
|
},
|
|
|
|
|
handleAdd(value){
|
|
|
|
|
value.name = "";
|
|
|
|
|
value.store = "";
|
|
|
|
|
value.phone ="";
|
|
|
|
|
value.staffCode ="";
|
|
|
|
|
value.role ="";
|
|
|
|
|
value.region ="";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|