门店号管理修改bug

master
LegnaYet 6 years ago
parent ae630196ad
commit 6fe5ebe9bc

@ -67,7 +67,7 @@
<FormItem label="工号" prop="staffCode">
<i-input v-model="formValidate.staffCode" placeholder="请输入工号" :disabled="flag !== 1 ? true : false" ></i-input>
</FormItem>
<FormItem label="角色" prop="role" :rules="rules">
<FormItem label="角色" prop="role">
<Select v-model="formValidate.role" placeholder="选择角色" :disabled="flag !== 1 ? true : false">
<Option :value="1" >店长</Option>
<Option :value="4" >导购</Option>
@ -112,6 +112,7 @@
import staff from "../../services/staff/staff";
export default {
name: "IncreaseStaffManager",
inject:['setMenuName'],
data () {
return {
modal13: false,
@ -221,6 +222,7 @@
}
},
mounted() {
this.setMenuName("门店推广","推广管理","门店导购管理");
this.listOfLogistics();
this.downRegionData();
this.downShopData();
@ -413,6 +415,18 @@
if (value) {
let request = {};
if (this.flag == 1){
if (value.name == null || value.name == ""){
this.$Message.success('名称不能为空!');
return;
}
if (value.staffCode == null || value.staffCode == ""){
this.$Message.success('工号不能为空!');
return;
}
if (value.role == null || value.role == ""){
this.$Message.success('角色不能为空!');
return;
}
//
request = {
name : value.name,

@ -7,9 +7,18 @@
<i-input placeholder="请输入店铺名称或编码" style="margin-left: 10px;padding-right: 10px;" v-model="searchShop"/>
</i-col>
<i-col span="1" style="text-align: right;">
<span class="region">大区</span>
</i-col>
<i-col span="3" style="padding-left: 10px;">
<Select v-model="selectedBigRegion" filterable style="width: 200px;" @on-change="downBigRegionChange" >
<Option v-for="item in bigRegionList" :value="item.id" :key="item.id">{{ item.name }}
</Option>
</Select>
</i-col>
<i-col span="2" style="text-align: right;">
<span class="region">零售公司</span>
</i-col>
<i-col span="4" style="padding-left: 10px;">
<i-col span="3" style="padding-left: 10px;">
<Select v-model="selectedRegion" filterable style="width: 200px;" @on-change="downRegionChange" >
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}
</Option>
@ -18,19 +27,19 @@
<i-col span="1" style="text-align: right;">
<span class="region">店铺</span>
</i-col>
<i-col span="4" style="padding-left: 10px;">
<i-col span="3" style="padding-left: 10px;">
<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">
<i-col span="1" style="padding-left: 20px;">
<Button type="primary" @click="searchCustomerDataBtnClick"></Button>
</i-col>
<i-col span="9" style="text-align: right;padding-right: 20px;">
<i-col span="7" style="text-align: right;padding-right: 20px;">
<Button type="primary" @click="downloadStoreCode" style="margin-right: 10px;">批量下载门店码</Button>
<Button type="primary" @click="downloadStoreSellerCode" style="margin-right: 10px;">批量下载导购码</Button>
<Button type="primary" @click="open()" style="margin-right: 10px;">开通门店号</Button>
<!--<Button type="primary" @click="open()" style="margin-right: 10px;">开通门店号</Button>-->
</i-col>
</Row>
</i-col>
@ -100,12 +109,12 @@
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{item.name}}</Option>
</Select>
</FormItem>
<!--
<!--
<FormItem label="职务" prop="position">
<i-input v-model="formValidate.position" placeholder="请输入职务"></i-input>
</FormItem>
-->
<FormItem label="职务" prop="position">
<i-input v-model="formValidate.position" placeholder="请输入职务"></i-input>
</FormItem>
-->
<!--<FormItem label="身份" prop="position">
<i-input v-model="formValidate.position" placeholder="请输入身份"></i-input>
@ -169,6 +178,7 @@
export default {
name: "IncreaseStoreManager",
inject:['setMenuName'],
data() {
return {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
@ -185,10 +195,12 @@
updateUrl: http.getBaseUrl() + "/store/emp/import",
downLoadStoreCodeUrl: http.getBaseUrl() + "/store/emp/download/store/code",
qrCodeImage: '',
selectedRegion: null,
selectedRegion: 0,
selectedBigRegion: 0,
regionList: [],
bigRegionList: [],
errorList: [],
selectedStore: null,
selectedStore: 0,
shopList: [],
rowData:{},
company:null,
@ -230,34 +242,34 @@
}
],
data1: [
/* {
id: 1,
storeName: '店铺1',
storeWx: 'D1',
staffNum: 10,
customerNum: 999
},
{
id: 2,
storeName: '店铺2',
storeWx: 'D2',
staffNum: 10,
customerNum: 999
},
{
id: 3,
storeName: '店铺3',
storeWx: 'D3',
staffNum: 10,
customerNum: 999
},
{
id: 4,
storeName: '店铺4',
storeWx: 'D4',
staffNum: 10,
customerNum: 999
}*/
/* {
id: 1,
storeName: '店铺1',
storeWx: 'D1',
staffNum: 10,
customerNum: 999
},
{
id: 2,
storeName: '店铺2',
storeWx: 'D2',
staffNum: 10,
customerNum: 999
},
{
id: 3,
storeName: '店铺3',
storeWx: 'D3',
staffNum: 10,
customerNum: 999
},
{
id: 4,
storeName: '店铺4',
storeWx: 'D4',
staffNum: 10,
customerNum: 999
}*/
],
//
formValidate: {
@ -300,7 +312,9 @@
}
},
mounted() {
this.setMenuName("门店推广","推广管理");
this.listOfStore();
this.downBigRegionData();
this.downRegionData();
this.downShopData();
},
@ -358,12 +372,12 @@
//
downRegionData: function () {
let that = this;
that.regionList = [{"id":0,"name":"全部"}];
let request =
{userId: that.userId};
{userId: that.userId, bigRegionId: that.selectedBigRegion};
http.downCompanyData(request, function (data) {
data = data.data.results;
if(data){
that.regionList = [{"id":0,"name":"全部"}];
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
@ -373,24 +387,46 @@
}
})
},
//
downBigRegionData: function () {
let that = this;
let request =
{userId: that.userId};
http.downBigRegionData(request, function (data) {
data = data.data.results;
if(data){
that.bigRegionList = [{"id":0,"name":"全部"}];
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
that.bigRegionList.push(entity);
}
}
}
})
},
downRegionChange: function () {
this.downShopData();
},
downBigRegionChange: function () {
this.downRegionData();
// this.downShopData();
},
downCompanyChange: function (formValidate) {
this.downShopData(formValidate.departIds);
},
downShopData: function (selected) {
let that = this;
that.shopList = [{"id":0,"name":"全部"}];
let selectValue = selected;
if (!selected){
selectValue = that.selectedRegion
}
let request =
{userId: that.userId,companyId: that.changeData(selectValue)};
{userId: that.userId,companyId: that.changeData(selectValue),bigRegionId: that.changeData(that.selectedBigRegion)};
staff.downShopData(request, function (data) {
data = data.data.results;
if(data){
that.shopList = [{"id":0,"name":"全部"}];
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
@ -446,12 +482,12 @@
this.isShowError = false
},
handleSubmit (name) {
if (name) {
//
this.addStoreWX(name);
} else {
this.$Message.error('Fail!');
}
if (name) {
//
this.addStoreWX(name);
} else {
this.$Message.error('Fail!');
}
},
handleReset (name) {
this.$refs[name].resetFields();
@ -461,20 +497,26 @@
window.location.href = '/门店号批量开通模板.xlsx'
},
handleAdd(value){
value.alias = '',
value.userId = '',
value.gender = '',
value. mobile = '',
value.email = '',
value. address = '',
value. departIds = '',
value. selectedPhoneRegion ='86',
value.duty= '',
value.position='',
value.interest= [],
value.desc= '',
value.checkbox= ['vail'],
value.storeId=''
value.alias = '',
value.userId = '',
value.gender = '',
value. mobile = '',
value.email = '',
value. address = '',
value. departIds = '',
value. selectedPhoneRegion ='86',
value.duty= '',
value.position='',
value.interest= [],
value.desc= '',
value.checkbox= ['vail'],
value.storeId=''
},
downloadStoreCode(){
http.downloadStoreCode({},null);
},
downloadStoreSellerCode(){
http.downloadStoreSellerCode({},null);
},
updateSuccess (response) {
if (response.code === "0000") {

@ -31,6 +31,12 @@ export function downloadImg(params,name, call) {
export function downCompanyData(params, call) {
return http.get('/retail/company',params).then(call)
}
/**
* 下拉框数据品牌公司
*/
export function downBigRegionData(params, call) {
return http.get('/retail/big/region',params).then(call)
}
/**
* 下载门店码
@ -39,7 +45,7 @@ export function downCompanyData(params, call) {
* @returns {Promise<any | never>}
*/
export function downloadStoreCode(params, call) {
return http.downloadZip('/store/emp/download/store/code','门店码', params).then(call);
return http.downloadZip('/store/emp/download/store/code/bsd','门店码', params).then(call);
}
/**
* 下载门店导购码
@ -48,7 +54,7 @@ export function downloadStoreCode(params, call) {
* @returns {Promise<any | never>}
*/
export function downloadStoreSellerCode(params, call) {
return http.downloadZip('/store/emp/download/store/seller/code','门店导购码', params).then(call);
return http.downloadZip('/store/emp/download/store/seller/code/bsd','门店导购码', params).then(call);
}
@ -63,6 +69,7 @@ export default {
addStoreWX,
downloadImg,
downCompanyData,
downBigRegionData,
downloadStoreCode,
downloadStoreSellerCode,

Loading…
Cancel
Save