|
|
|
@ -3,12 +3,15 @@
|
|
|
|
<Row style="margin-top: 20px;width: 100%;background-color: #F7F8FA;">
|
|
|
|
<Row style="margin-top: 20px;width: 100%;background-color: #F7F8FA;">
|
|
|
|
<i-col span="24" style="text-align: left;padding-left: 10px;">
|
|
|
|
<i-col span="24" style="text-align: left;padding-left: 10px;">
|
|
|
|
<Row class="row-style">
|
|
|
|
<Row class="row-style">
|
|
|
|
|
|
|
|
<i-col span="3">
|
|
|
|
|
|
|
|
<i-input placeholder="请输入店铺名称或编码" style="margin-left: 10px;padding-right: 10px;" v-model="searchShop"/>
|
|
|
|
|
|
|
|
</i-col>
|
|
|
|
<i-col span="1" style="text-align: right;">
|
|
|
|
<i-col span="1" style="text-align: right;">
|
|
|
|
<span class="region">区域选择</span>
|
|
|
|
<span class="region">零售公司</span>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
<Select v-model="selectedRegion" filterable style="width: 200px;">
|
|
|
|
<Select v-model="selectedRegion" filterable style="width: 200px;" @on-change="downRegionChange" >
|
|
|
|
<Option v-for="item in regionList" :value="item.value" :key="item.value">{{ item.label }}
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}
|
|
|
|
</Option>
|
|
|
|
</Option>
|
|
|
|
</Select>
|
|
|
|
</Select>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
@ -17,17 +20,16 @@
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
<Select v-model="selectedStore" filterable style="width: 200px;">
|
|
|
|
<Select v-model="selectedStore" filterable style="width: 200px;">
|
|
|
|
<Option v-for="item in storeList" :value="item.value" :key="item.value">{{ item.label }}
|
|
|
|
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.name }}
|
|
|
|
</Option>
|
|
|
|
</Option>
|
|
|
|
</Select>
|
|
|
|
</Select>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
<i-col span="2">
|
|
|
|
<i-col span="2">
|
|
|
|
<Button type="primary">查询</Button>
|
|
|
|
<Button type="primary" @click="searchCustomerDataBtnClick">查询</Button>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
<i-col span="12" style="text-align: right;padding-right: 20px;">
|
|
|
|
<i-col span="9" style="text-align: right;padding-right: 20px;">
|
|
|
|
<Button type="primary" @click="downloadStoreCode" style="margin-right: 10px;">批量下载门店码</Button>
|
|
|
|
<Button type="primary" @click="downloadStoreCode" style="margin-right: 10px;">批量下载门店码</Button>
|
|
|
|
<Button type="primary" @click="downloadStoreSellerCode" style="margin-right: 10px;">批量下载导购码</Button>
|
|
|
|
<Button type="primary" @click="downloadStoreSellerCode" style="margin-right: 10px;">批量下载导购码</Button>
|
|
|
|
<Button type="primary" @click="showImport" style="margin-right: 10px;">批量开通</Button>
|
|
|
|
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
@ -35,14 +37,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<Table :columns="columns1" :data="data1" style="margin-top: 20px;">
|
|
|
|
<Table :columns="columns1" :data="data1" style="margin-top: 20px;">
|
|
|
|
<template slot-scope="{ row, index }" slot="qrCodeAction">
|
|
|
|
<template slot-scope="{ row, index }" slot="qrCodeAction">
|
|
|
|
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="instance(index)" >预览</Button>
|
|
|
|
<img :src="require('../../../static/img/qrCode-init.png')" @click="show(row)" style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;"/>
|
|
|
|
<Button ghost type="primary" size="small" @click="download(index)">下载</Button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template slot-scope="{ row, index }" slot="action">
|
|
|
|
|
|
|
|
<Button ghost type="primary" size="small" style="margin-right: 5px" @click="open(index)">开通门店企微号
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button ghost type="error" size="small" @click="remove(index)">删除微信号</Button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</Table>
|
|
|
|
</Table>
|
|
|
|
|
|
|
|
|
|
|
|
@ -57,7 +52,7 @@
|
|
|
|
<div slot="header">{{this.showStoreName}}</div>
|
|
|
|
<div slot="header">{{this.showStoreName}}</div>
|
|
|
|
<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">下载</Button>
|
|
|
|
<Button ghost type="primary" @click="download(rowData)">下载</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
@ -76,42 +71,41 @@
|
|
|
|
<i-input v-model="formValidate.alias" placeholder="请输入别名"></i-input>
|
|
|
|
<i-input v-model="formValidate.alias" placeholder="请输入别名"></i-input>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
<FormItem label="账号" prop="account">
|
|
|
|
<FormItem label="账号" prop="account">
|
|
|
|
<i-input v-model="formValidate.account" placeholder="请输入账号"></i-input>
|
|
|
|
<i-input v-model="formValidate.userId" placeholder="请输入账号"></i-input>
|
|
|
|
</FormItem>
|
|
|
|
|
|
|
|
<FormItem label="性别" prop="gender">
|
|
|
|
|
|
|
|
<RadioGroup v-model="formValidate.gender">
|
|
|
|
|
|
|
|
<Radio label="男">男</Radio>
|
|
|
|
|
|
|
|
<Radio label="女">女</Radio>
|
|
|
|
|
|
|
|
</RadioGroup>
|
|
|
|
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
<FormItem label="手机" prop="phone">
|
|
|
|
<FormItem label="手机" prop="phone">
|
|
|
|
<i-input v-model="formValidate.phone" placeholder="成员通过验证该手机号后可加入企业">
|
|
|
|
<i-input v-model="formValidate.mobile" placeholder="成员通过验证该手机号后可加入企业">
|
|
|
|
<Select v-model="formValidate.selectedPhoneRegion" slot="prepend" style="width: 80px" >
|
|
|
|
<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>
|
|
|
|
<Option v-for="item in prefixDefault" :key="item.prefix + item.en" :value="item.prefix">{{item.prefix}}</Option>
|
|
|
|
</Select>
|
|
|
|
</Select>
|
|
|
|
</i-input>
|
|
|
|
</i-input>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
<FormItem label="邮箱" prop="mail">
|
|
|
|
<FormItem label="邮箱" prop="mail">
|
|
|
|
<i-input v-model="formValidate.mail" placeholder="请输入邮箱"></i-input>
|
|
|
|
<i-input v-model="formValidate.email" placeholder="请输入邮箱"></i-input>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
<FormItem label="地址" prop="address">
|
|
|
|
<FormItem label="地址" prop="address">
|
|
|
|
<i-input v-model="formValidate.address" placeholder="请输入地址"></i-input>
|
|
|
|
<i-input v-model="formValidate.address" placeholder="请输入地址"></i-input>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
<FormItem label="部门" prop="party">
|
|
|
|
<FormItem label="零售公司" prop="party">
|
|
|
|
<Select v-model="formValidate.party" placeholder="选择部门">
|
|
|
|
<Select v-model="formValidate.departIds" placeholder="选择零售公司" @on-change="downCompanyChange(formValidate)">
|
|
|
|
<Option value="1">部门1</Option>
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{item.name}}</Option>
|
|
|
|
<Option value="2">部门2</Option>
|
|
|
|
</Select>
|
|
|
|
<Option value="3">部门3</Option>
|
|
|
|
</FormItem>
|
|
|
|
|
|
|
|
<FormItem label="店铺" prop="party">
|
|
|
|
|
|
|
|
<Select v-model="formValidate.storeId" placeholder="选择店铺">
|
|
|
|
|
|
|
|
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{item.name}}</Option>
|
|
|
|
</Select>
|
|
|
|
</Select>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
|
|
<FormItem label="职务" prop="duty">
|
|
|
|
<FormItem label="职务" prop="position">
|
|
|
|
<i-input v-model="formValidate.duty" placeholder="请输入职务"></i-input>
|
|
|
|
<i-input v-model="formValidate.position" placeholder="请输入职务"></i-input>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
|
|
<FormItem label="身份" prop="position">
|
|
|
|
<!--<FormItem label="身份" prop="position">
|
|
|
|
<i-input v-model="formValidate.position" placeholder="请输入身份"></i-input>
|
|
|
|
<i-input v-model="formValidate.position" placeholder="请输入身份"></i-input>
|
|
|
|
</FormItem>
|
|
|
|
</FormItem>-->
|
|
|
|
|
|
|
|
|
|
|
|
<FormItem label="">
|
|
|
|
<FormItem label="">
|
|
|
|
<CheckboxGroup v-model="formValidate.checkbox">
|
|
|
|
<CheckboxGroup v-model="formValidate.checkbox">
|
|
|
|
@ -120,7 +114,7 @@
|
|
|
|
</FormItem>
|
|
|
|
</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>
|
|
|
|
@ -159,17 +153,25 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Upload>
|
|
|
|
</Upload>
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
<Page :total="total" :current="pageNum" :page-size="pageSize" show-elevator show-total
|
|
|
|
|
|
|
|
placement="top" @on-change="handlePage" style="margin: 20px 50px 0 0;right:0px;position: absolute;"></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 staff from "../../services/staff/staff";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "IncreaseStoreManager",
|
|
|
|
name: "IncreaseStoreManager",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
userId: 13,
|
|
|
|
|
|
|
|
searchShop:null,
|
|
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
prefixDefault: data.prefixDefault,
|
|
|
|
prefixDefault: data.prefixDefault,
|
|
|
|
isShow: false,
|
|
|
|
isShow: false,
|
|
|
|
isShowImport: false,
|
|
|
|
isShowImport: false,
|
|
|
|
@ -183,20 +185,26 @@
|
|
|
|
regionList: [],
|
|
|
|
regionList: [],
|
|
|
|
errorList: [],
|
|
|
|
errorList: [],
|
|
|
|
selectedStore: null,
|
|
|
|
selectedStore: null,
|
|
|
|
storeList: [],
|
|
|
|
shopList: [],
|
|
|
|
|
|
|
|
rowData:{},
|
|
|
|
|
|
|
|
company:null,
|
|
|
|
columns1: [
|
|
|
|
columns1: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '序号',
|
|
|
|
title: '序号',
|
|
|
|
key: 'id',
|
|
|
|
key: 'orderNum',
|
|
|
|
width: 100
|
|
|
|
width: 100
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '门店名称',
|
|
|
|
title: '店铺名称',
|
|
|
|
key: 'storeName'
|
|
|
|
key: 'name'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: '店铺编码',
|
|
|
|
|
|
|
|
key: 'code'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '门店企业号',
|
|
|
|
title: '门店企业号',
|
|
|
|
key: 'storeWx'
|
|
|
|
key: 'cpUserId'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: '员工数',
|
|
|
|
title: '员工数',
|
|
|
|
@ -218,7 +226,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
data1: [
|
|
|
|
data1: [
|
|
|
|
{
|
|
|
|
/* {
|
|
|
|
id: 1,
|
|
|
|
id: 1,
|
|
|
|
storeName: '店铺1',
|
|
|
|
storeName: '店铺1',
|
|
|
|
storeWx: 'D1',
|
|
|
|
storeWx: 'D1',
|
|
|
|
@ -245,23 +253,24 @@
|
|
|
|
storeWx: 'D4',
|
|
|
|
storeWx: 'D4',
|
|
|
|
staffNum: 10,
|
|
|
|
staffNum: 10,
|
|
|
|
customerNum: 999
|
|
|
|
customerNum: 999
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
],
|
|
|
|
],
|
|
|
|
// 开通企业微信 表单
|
|
|
|
// 开通企业微信 表单
|
|
|
|
formValidate: {
|
|
|
|
formValidate: {
|
|
|
|
alias: '',
|
|
|
|
alias: '',
|
|
|
|
account: '',
|
|
|
|
userId: '',
|
|
|
|
gender: '',
|
|
|
|
gender: '',
|
|
|
|
phone: '',
|
|
|
|
mobile: '',
|
|
|
|
mail: '',
|
|
|
|
email: '',
|
|
|
|
address: '',
|
|
|
|
address: '',
|
|
|
|
party: '',
|
|
|
|
departIds: '',
|
|
|
|
selectedPhoneRegion: '86',
|
|
|
|
selectedPhoneRegion: '86',
|
|
|
|
duty: '',
|
|
|
|
duty: '',
|
|
|
|
position: '',
|
|
|
|
position: '',
|
|
|
|
interest: [],
|
|
|
|
interest: [],
|
|
|
|
desc: '',
|
|
|
|
desc: '',
|
|
|
|
checkbox: ['vail']
|
|
|
|
checkbox: ['vail'],
|
|
|
|
|
|
|
|
storeId:'',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ruleValidate: {
|
|
|
|
ruleValidate: {
|
|
|
|
account: [
|
|
|
|
account: [
|
|
|
|
@ -283,23 +292,148 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
this.listOfStore();
|
|
|
|
|
|
|
|
this.downRegionData();
|
|
|
|
|
|
|
|
this.downShopData();
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
onChangeDateLister: function () {
|
|
|
|
onChangeDateLister: function () {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
instance: function () {
|
|
|
|
searchCustomerDataBtnClick: function () {
|
|
|
|
|
|
|
|
this.listOfStore();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
listOfStore() {
|
|
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
let request = {
|
|
|
|
|
|
|
|
userId: 1 ,
|
|
|
|
|
|
|
|
companyId: that.changeData(that.selectedRegion),
|
|
|
|
|
|
|
|
storeId: that.changeData(that.selectedStore),
|
|
|
|
|
|
|
|
pageNum: that.pageNum,
|
|
|
|
|
|
|
|
pageSize: that.pageSize,
|
|
|
|
|
|
|
|
code:that.searchShop
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
http.storeList(request, function (data) {
|
|
|
|
|
|
|
|
data = data.data;
|
|
|
|
|
|
|
|
if(data.code == "0000") {
|
|
|
|
|
|
|
|
that.data1 = [];
|
|
|
|
|
|
|
|
let datas = data.results;
|
|
|
|
|
|
|
|
//总页数
|
|
|
|
|
|
|
|
if (datas.total == null) {
|
|
|
|
|
|
|
|
that.total = 0;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
that.total = datas.total;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (datas.list == null) {
|
|
|
|
|
|
|
|
datas.list = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
that.data1 = datas.list;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addStoreWX : function (request){
|
|
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
http.addStoreWX(request,function (data) {
|
|
|
|
|
|
|
|
data = data.data;
|
|
|
|
|
|
|
|
if (data.code == "0000"){
|
|
|
|
|
|
|
|
if (data.results.indexOf("8888") != -1){
|
|
|
|
|
|
|
|
let str = data.results.split(",");
|
|
|
|
|
|
|
|
that.$Message.success('该企业微信已被 【' + str[1] + '】绑定 请从新绑定微信号' );
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
that.$Message.success('添加成功!');
|
|
|
|
|
|
|
|
that.listOfStore();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//区域用户下的区域
|
|
|
|
|
|
|
|
downRegionData: function () {
|
|
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
that.regionList = [{"id":0,"name":"全部"}];
|
|
|
|
|
|
|
|
let request =
|
|
|
|
|
|
|
|
{userId: that.userId};
|
|
|
|
|
|
|
|
http.downCompanyData(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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
downRegionChange: function () {
|
|
|
|
|
|
|
|
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,regionId: that.changeData(selectValue)};
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
changeData: function (value) {
|
|
|
|
|
|
|
|
if(value == 0){return null;}
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
show: function (index) {
|
|
|
|
this.isShow = true;
|
|
|
|
this.isShow = true;
|
|
|
|
this.showStoreName = '店铺1';
|
|
|
|
this.showStoreName = index.name;
|
|
|
|
this.qrCodeImage = '../static/img/logo-title.png';
|
|
|
|
this.qrCodeImage = index.qrCodeAction;
|
|
|
|
|
|
|
|
this.rowData = index;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 下载二维码
|
|
|
|
|
|
|
|
download: function (index) {
|
|
|
|
|
|
|
|
let name = index.code+"-"+index.name
|
|
|
|
|
|
|
|
let image = new Image();
|
|
|
|
|
|
|
|
// 解决跨域 Canvas 污染问题
|
|
|
|
|
|
|
|
image.setAttribute("crossOrigin", "anonymous");
|
|
|
|
|
|
|
|
image.onload = function() {
|
|
|
|
|
|
|
|
let canvas = document.createElement("canvas");
|
|
|
|
|
|
|
|
canvas.width = image.width;
|
|
|
|
|
|
|
|
canvas.height = image.height;
|
|
|
|
|
|
|
|
let context = canvas.getContext("2d");
|
|
|
|
|
|
|
|
context.drawImage(image, 0, 0, image.width, image.height);
|
|
|
|
|
|
|
|
let url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
|
|
|
|
|
|
|
|
let a = document.createElement("a"); // 生成一个a元素
|
|
|
|
|
|
|
|
let event = new MouseEvent("click"); // 创建一个单击事件
|
|
|
|
|
|
|
|
a.download = name || "photo"; // 设置图片名称
|
|
|
|
|
|
|
|
a.href = url; // 将生成的URL设置为a.href属性
|
|
|
|
|
|
|
|
a.dispatchEvent(event); // 触发a的单击事件
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
image.src = index.qrCodeAction;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//切页处理
|
|
|
|
|
|
|
|
handlePage:function (value) {
|
|
|
|
|
|
|
|
this.pageNum = value;
|
|
|
|
|
|
|
|
this.listOfStore();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
ok: function () {
|
|
|
|
ok: function () {
|
|
|
|
this.isShow = false;
|
|
|
|
this.isShow = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cancel: function () {
|
|
|
|
cancel: function () {
|
|
|
|
this.isShow = false;
|
|
|
|
this.isShow = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
download: function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
open: function () {
|
|
|
|
open: function () {
|
|
|
|
this.isShowAdd = true;
|
|
|
|
this.isShowAdd = true;
|
|
|
|
@ -312,21 +446,13 @@
|
|
|
|
this.isShowImport = true;
|
|
|
|
this.isShowImport = true;
|
|
|
|
this.isShowError = false
|
|
|
|
this.isShowError = false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
downloadStoreCode(){
|
|
|
|
|
|
|
|
http.downloadStoreCode({},null);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
downloadStoreSellerCode(){
|
|
|
|
|
|
|
|
http.downloadStoreSellerCode({},null);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleSubmit (name) {
|
|
|
|
handleSubmit (name) {
|
|
|
|
this.$refs[name].validate((valid) => {
|
|
|
|
if (name) {
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
// 调用添加接口
|
|
|
|
// 调用添加接口
|
|
|
|
this.$Message.success('Success!');
|
|
|
|
this.addStoreWX(name);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$Message.error('Fail!');
|
|
|
|
this.$Message.error('Fail!');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleReset (name) {
|
|
|
|
handleReset (name) {
|
|
|
|
this.$refs[name].resetFields();
|
|
|
|
this.$refs[name].resetFields();
|
|
|
|
|