|
|
@@ -2,25 +2,34 @@
|
|
|
<div class="GZattributeEditor">
|
|
|
<van-nav-bar class="navBar" title="公装经销商编辑" left-arrow @click-left="onClickLeft" />
|
|
|
<div class="content" v-if="detail">
|
|
|
- <van-form ref="tabstoreVal">
|
|
|
- <van-field label="是否双包客户">
|
|
|
+ <van-form ref="tabstoreVal" @submit="onSubmit">
|
|
|
+ <van-field
|
|
|
+ label="是否双包客户"
|
|
|
+ :rules="[{ required: true, message: '请选择是否双包客户' }]">
|
|
|
+ <template #left-icon>
|
|
|
+ <span class="van-f-red">*</span>
|
|
|
+ </template>
|
|
|
<template #input>
|
|
|
- <van-radio-group v-model="detail.doubleContracting" direction="horizontal">
|
|
|
+ <van-radio-group v-model="detail.doubleCustomer" direction="horizontal">
|
|
|
<van-radio name="是">是</van-radio>
|
|
|
<van-radio name="否">否</van-radio>
|
|
|
</van-radio-group>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
- v-if="detail.doubleContracting == '是'"
|
|
|
+ v-if="detail.doubleCustomer == '是'"
|
|
|
+ :rules="[{ required: true, message: '请选择客户类型' }]"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
label="客户类型">
|
|
|
+ <template #left-icon>
|
|
|
+ <span class="van-f-red">*</span>
|
|
|
+ </template>
|
|
|
<template #input>
|
|
|
- <van-checkbox-group v-model="detail.mainProductCategorys" direction="horizontal">
|
|
|
+ <van-checkbox-group v-model="detail.customerType" direction="horizontal">
|
|
|
<van-checkbox
|
|
|
- v-for="(item, index) in mainProductCategorys"
|
|
|
- :name="item.dictValue"
|
|
|
+ v-for="(item, index) in doubleustomer"
|
|
|
+ :name="item.dictLabel"
|
|
|
shape="square"
|
|
|
:key="index">
|
|
|
{{ item.dictValue }}
|
|
|
@@ -28,29 +37,23 @@
|
|
|
</van-checkbox-group>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
- <van-field label="是否三大渠道">
|
|
|
- <template #input>
|
|
|
- <van-radio-group v-model="detail.doubleContracting" direction="horizontal">
|
|
|
- <van-radio name="是">是</van-radio>
|
|
|
- <van-radio name="否">否</van-radio>
|
|
|
- </van-radio-group>
|
|
|
- </template>
|
|
|
- </van-field>
|
|
|
<van-field
|
|
|
- v-if="detail.doubleContracting == '是'"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
- label="渠道类型">
|
|
|
+ label="渠道类型"
|
|
|
+ :rules="[{ required: true, message: '请选择渠道类型' }]">
|
|
|
+ <template #left-icon>
|
|
|
+ <span class="van-f-red">*</span>
|
|
|
+ </template>
|
|
|
<template #input>
|
|
|
- <van-checkbox-group v-model="detail.mainProductCategorys" direction="horizontal">
|
|
|
- <van-checkbox
|
|
|
- v-for="(item, index) in mainProductCategorys"
|
|
|
- :name="item.dictValue"
|
|
|
- shape="square"
|
|
|
+ <van-radio-group v-model="detail.channelType" direction="horizontal">
|
|
|
+ <van-radio
|
|
|
+ v-for="(item, index) in channelTypeArr"
|
|
|
+ :name="item.dictLabel"
|
|
|
:key="index">
|
|
|
{{ item.dictValue }}
|
|
|
- </van-checkbox>
|
|
|
- </van-checkbox-group>
|
|
|
+ </van-radio>
|
|
|
+ </van-radio-group>
|
|
|
</template>
|
|
|
</van-field>
|
|
|
</van-form>
|
|
|
@@ -66,49 +69,60 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { sendAndCheckVerCode, getDictOption } from '@/api/index';
|
|
|
-import { getStoreArchives, updateArchives } from '@/api/storeManagement';
|
|
|
+import { getDictOption } from '@/api/index';
|
|
|
+import { getGzVisitLabel, updateVisitLabel } from '@/api/storeManagement';
|
|
|
export default {
|
|
|
name: 'GZattributeEditor',
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ detail: null,
|
|
|
+ channelTypeArr: [],
|
|
|
+ doubleustomer: [],
|
|
|
+ };
|
|
|
},
|
|
|
activated() {
|
|
|
+ this.detail = null;
|
|
|
this.toastLoading(0, '加载中...', true);
|
|
|
- Promise.all([this.getDictOptionFun('gz_visit_label_channel_type')]).then((res) => {
|
|
|
- debugger;
|
|
|
+ // 公装拜访标签渠道类型:gz_visit_label_channel_type 公装拜访标签双包客户:gz_visit_label_double_customer
|
|
|
+ Promise.all([
|
|
|
+ this.getDictOptionFun('gz_visit_label_channel_type'),
|
|
|
+ this.getDictOptionFun('gz_visit_label_double_customer'),
|
|
|
+ ]).then((res) => {
|
|
|
+ this.channelTypeArr = res[0];
|
|
|
+ this.doubleustomer = res[1];
|
|
|
+ console.log(this.doubleustomer);
|
|
|
+ this.getDetaild();
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
getDictOptionFun(type) {
|
|
|
- getDictOption({}, type).then((res) => {});
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ getDictOption({}, type).then((res) => {
|
|
|
+ resolve(res.data);
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
getDetaild() {
|
|
|
- getStoreArchives({ storeCode: this.$route.query.storeCode }).then((res) => {
|
|
|
+ getGzVisitLabel({ storeCode: this.$route.query.storeCode }).then((res) => {
|
|
|
this.toastLoading().clear();
|
|
|
if (res.code == 200) {
|
|
|
- // let copyData = JSON.parse(JSON.stringify(res.data));
|
|
|
- res.data.mainProductCategorys = res.data.mainProductCategorys
|
|
|
- ? res.data.mainProductCategorys.split(',')
|
|
|
- : [];
|
|
|
+ res.data.customerType = res.data.customerType ? res.data.customerType.split(',') : [];
|
|
|
this.detail = res.data;
|
|
|
- this.mobileStatus = res.data.mobileStatus;
|
|
|
- // mobileStatus 是否验证通过 1,2是
|
|
|
- if (res.data.mobileStatus == '1' || res.data.mobileStatus == '2') {
|
|
|
- this.verificationPassedPhoneNum = this.detail.ownerMobile;
|
|
|
- }
|
|
|
- // 验证码和发送按钮是否显示
|
|
|
- this.verifyMobile = this.mobileStatus == '0' ? false : true;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 保存
|
|
|
confirmShare() {
|
|
|
+ this.$refs.tabstoreVal.submit();
|
|
|
+ },
|
|
|
+ onSubmit(value) {
|
|
|
this.toastLoading(0, '加载中...', true);
|
|
|
let params = JSON.parse(JSON.stringify(this.detail));
|
|
|
- params.mainProductCategorys = params.mainProductCategorys.join(',');
|
|
|
+ params.customerType = params.customerType.join(',');
|
|
|
params.storeCode = this.$route.query.storeCode;
|
|
|
- updateArchives(params).then((res) => {
|
|
|
+ params.chainCode = this.$route.query.chainCode;
|
|
|
+ if (params.doubleCustomer == '否') params.customerType = '';
|
|
|
+ updateVisitLabel(params).then((res) => {
|
|
|
this.toastLoading().clear();
|
|
|
if (res.code == 200) {
|
|
|
this.$toast(res.msg);
|