批量上传门店号

feature_0521
yechenhao 5 years ago
parent 6b6fe8f588
commit e02412a650

@ -31,10 +31,10 @@
<img :src="require('../../../static/img/qrCode-init.png')" @click="show(row)" <img :src="require('../../../static/img/qrCode-init.png')" @click="show(row)"
class="table-img-qr-code"/> class="table-img-qr-code"/>
</template> </template>
<router-link slot-scope="{row}" slot="action" <template slot-scope="{row}" slot="action">
:to="{path:'/shop/increase/manager/staff',query:{storeId:row.id}}"> <Button ghost class="router-btn" @click="open(row)"></Button>
<Button ghost class="router-btn"> 门店导购管理</Button> <Button ghost class="router-btn" :to="{path:'/shop/increase/manager/staff',query:{storeId:row.id}}"> 门店导购管理</Button>
</router-link> </template>
</Table> </Table>
<!-- 预览二维码 --> <!-- 预览二维码 -->
@ -63,60 +63,23 @@
<div slot="header">开通企业微信号</div> <div slot="header">开通企业微信号</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"> <FormItem label="名称" prop="cpUserName">
<i-input type="text" v-model="formValidate.name" placeholder="请输入名字"></i-input> <i-input type="text" v-model="formValidate.cpUserName" placeholder="请输入名字"></i-input>
</FormItem> </FormItem>
<FormItem label="别名" prop="alias"> <FormItem label="别名" prop="alias">
<i-input v-model="formValidate.alias" placeholder="请输入别名"></i-input> <i-input v-model="formValidate.alias" placeholder="请输入别名"></i-input>
</FormItem> </FormItem>
<FormItem label="账号" prop="userId"> <FormItem label="账号" prop="userId">
<i-input v-model="formValidate.userId" placeholder="请输入账号"></i-input> <i-input v-model="formValidate.cpUserId" :disabled="true"></i-input>
</FormItem> </FormItem>
<FormItem label="手机" prop="mobile"> <FormItem label="手机" prop="mobile">
<i-input v-model="formValidate.mobile" placeholder="成员通过验证该手机号后可加入企业"> <i-input v-model="formValidate.mobile" placeholder="请输入手机"></i-input>
<Select v-model="formValidate.selectedPhoneRegion" slot="prepend" style="width: 80px">
<Option v-for="item in prefixDefault" :key="item.prefix + item.en" :value="item.prefix">
{{item.prefix}}
</Option>
</Select>
</i-input>
</FormItem>
<FormItem label="邮箱" prop="mail">
<i-input v-model="formValidate.email" placeholder="请输入邮箱"></i-input>
</FormItem>
<FormItem label="地址" prop="address">
<i-input v-model="formValidate.address" placeholder="请输入地址"></i-input>
</FormItem>
<FormItem label="零售公司" prop="departIds">
<Select v-model="formValidate.departIds" placeholder="选择零售公司"
@on-change="downCompanyChange(formValidate)">
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{item.name}}</Option>
</Select>
</FormItem> </FormItem>
<FormItem label="店铺" prop="storeId"> <FormItem label="店铺" prop="storeId">
<Select v-model="formValidate.storeId" placeholder="选择店铺"> <i-input v-model="formValidate.shopName" :disabled="true"></i-input>
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{item.name}}</Option>
</Select>
</FormItem> </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="">
<CheckboxGroup v-model="formValidate.checkbox">
<Checkbox label="vail">通过邮箱或短信发送企业邀请</Checkbox>
</CheckboxGroup>
</FormItem>
<FormItem style="text-align: left;"> <FormItem style="text-align: left;">
<Button type="primary" @click="handleSubmit(formValidate)"></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">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
@ -199,7 +162,6 @@
companyList: [], companyList: [],
customerList: [], customerList: [],
companyId: 0, companyId: 0,
errorList: [], errorList: [],
selectedStore: 0, selectedStore: 0,
shopList: [], shopList: [],
@ -262,36 +224,22 @@
} }
], ],
data1: [], data1: [],
//
formValidate: { formValidate: {
alias: '', alias: '',
userId: '', id: '',
gender: '', cpUserId: '',
mobile: '', mobile: '',
email: '',
address: '',
departIds: '',
selectedPhoneRegion: '86',
duty: '',
position: '',
interest: [],
desc: '',
checkbox: ['vail'], checkbox: ['vail'],
storeId: '', storeId: '',
cpUserName: '',
shopName: ''
}, },
ruleValidate: { ruleValidate: {
mobile: [ mobile: [
{required: true, message: '手机号码不能为空', trigger: 'blur'} {required: true, message: '手机号码不能为空', trigger: 'blur'}
], ],
// mail: [ cpUserName: [
// { required: true, message: '', trigger: 'blur' }, {required: true, message: '名称不能为空', trigger: 'blur'}
// { type: 'email', message: '', trigger: 'blur' }
// ],
departIds: [
{required: true, message: '请选择部门', trigger: 'change'}
],
storeId: [
{required: true, message: '请选择部门', trigger: 'change'},
] ]
} }
} }
@ -300,8 +248,6 @@
this.setMenuName("门店推广", "推广管理"); this.setMenuName("门店推广", "推广管理");
this.listOfStore(); this.listOfStore();
this.getSelectList(); this.getSelectList();
// this.downBigRegionData();
// this.downRegionData();
this.downShopData(); this.downShopData();
}, },
methods: { methods: {
@ -344,19 +290,14 @@
that.loading = false; that.loading = false;
}); });
}, },
addStoreWX: function (request) { modifyStoreWX: function (request) {
let that = this; let that = this;
http.addStoreWX(request, function (data) { http.modifyStoreWX(request, function (data) {
data = data.data; data = data.data;
if (data.code == "0000") { if (data.code == "0000") {
if (data.results.indexOf("8888") != -1) { that.$Message.success('修改成功!');
let str = data.results.split(","); that.listOfStore();
that.$Message.success('该企业微信已被 【' + str[1] + '】绑定 请从新绑定微信号'); this.handleAdd(this.formValidate);
} else {
that.$Message.success('添加成功!');
that.listOfStore();
this.handleAdd(this.formValidate);
}
} }
}) })
}, },
@ -493,9 +434,19 @@
cancel: function () { cancel: function () {
this.isShow = false; this.isShow = false;
}, },
open: function () { open: function (item) {
this.isShowAdd = true; this.isShowAdd = true;
this.formValidate = {
alias: item.alias,
cpUserName: item.cpUserName,
cpUserId: item.cpUserId,
id: item.userId,
mobile: item.mobile,
checkbox: ['vail'],
storeId: item.id,
shopName: item.name
}
}, },
remove: function () { remove: function () {
@ -504,10 +455,10 @@
this.isShowImport = true; this.isShowImport = true;
this.isShowError = false this.isShowError = false
}, },
handleSubmit(name) { handleSubmit(value) {
if (name) { if (value) {
// //
this.addStoreWX(name); this.modifyStoreWX(value);
} else { } else {
this.$Message.error('Fail!'); this.$Message.error('Fail!');
} }

@ -21,6 +21,9 @@ export function storeList(params, call, errorCallBack) {
export function addStoreWX(params, call) { export function addStoreWX(params, call) {
return http.post('/user/add', params).then(call); return http.post('/user/add', params).then(call);
} }
export function modifyStoreWX(params, call) {
return http.post('/user/update', params).then(call);
}
export function downloadImg(params,name, call) { export function downloadImg(params,name, call) {
return http.downloadImg('/user/img/download',name, params).then(call); return http.downloadImg('/user/img/download',name, params).then(call);
} }
@ -78,6 +81,7 @@ export default {
getBaseUrl, getBaseUrl,
storeList, storeList,
addStoreWX, addStoreWX,
modifyStoreWX,
downloadImg, downloadImg,
downCompanyData, downCompanyData,
downBigRegionData, downBigRegionData,

Loading…
Cancel
Save