Commit d0061aff by zhangxw

修改

1 parent 003719c6
...@@ -433,5 +433,14 @@ export function getReconciliationGoodsTypeListApi(data = {}) { ...@@ -433,5 +433,14 @@ export function getReconciliationGoodsTypeListApi(data = {}) {
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
} }
/**
* 获取轻改门店列表数据
*/
export function getMerchantList(data) {
data.method = "dj.api.servicemerchantref.pageServiceMerchantRef";
return request(data, RequestMethods.POST);
}
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
<el-option v-if="includeAll" <el-option v-if="includeAll"
:label="allLabel" :label="allLabel"
value="-1" value="-1"
:disabled="hasOtherSelected" /> :disabled="allExclusive && hasOtherSelected" />
<template v-for="p in provinceOptions"> <template v-for="p in provinceOptions">
<el-option :key="`province_${p.code}`" <el-option :key="`province_${p.code}`"
:value="getProvinceSelectValue(p.code)" :value="getProvinceSelectValue(p.code)"
:label="p.name" :label="p.name"
:disabled="hasAllSelected"> :disabled="allExclusive && hasAllSelected">
<div style="display: flex; align-items: center; justify-content: space-between;"> <div style="display: flex; align-items: center; justify-content: space-between;">
<span style="color: #000;font-weight: 500;">{{ p.name }}</span> <span style="color: #000;font-weight: 500;">{{ p.name }}</span>
<span style="flex: 1;text-align: end;" @click.stop="toggleProvince(p.code)"> <span style="flex: 1;text-align: end;" @click.stop="toggleProvince(p.code)">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
:key="`city_${p.code}_${c.code}`" :key="`city_${p.code}_${c.code}`"
:label="c.name" :label="c.name"
:value="c.code" :value="c.code"
:disabled="hasAllSelected"> :disabled="allExclusive && hasAllSelected">
<div style="padding-left: 18px"> <div style="padding-left: 18px">
{{ c.name }} {{ c.name }}
</div> </div>
...@@ -84,6 +84,10 @@ export default { ...@@ -84,6 +84,10 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
allExclusive: {
type: Boolean,
default: true,
},
allLabel: { allLabel: {
type: String, type: String,
default: "全国", default: "全国",
...@@ -179,17 +183,22 @@ export default { ...@@ -179,17 +183,22 @@ export default {
}); });
}); });
const hasAll = details.some(d => `${d.cityCode}` === "-1" || `${d.cityCode}` === "ALL"); const hasAll = details.some(d => `${d.cityCode}` === "-1" || `${d.cityCode}` === "ALL");
if (hasAll) { if (hasAll && this.allExclusive) {
return [{ provinceCode: "-1", provinceName: this.allLabel, cityCode: "-1", cityName: this.allLabel }]; return [{ provinceCode: "-1", provinceName: this.allLabel, cityCode: "-1", cityName: this.allLabel }];
} }
const seen = new Set(); const seen = new Set();
return details.filter((d) => { const unique = details.filter((d) => {
const code = `${d.cityCode ?? ""}`; const code = `${d.cityCode ?? ""}`;
if (!code || seen.has(code)) if (!code || seen.has(code))
return false; return false;
seen.add(code); seen.add(code);
return true; return true;
}); });
if (!this.allExclusive && unique.some(d => `${d.cityCode}` === "-1" || `${d.cityCode}` === "ALL")) {
const allObj = { provinceCode: "-1", provinceName: this.allLabel, cityCode: "-1", cityName: this.allLabel };
return [allObj].concat(unique.filter(d => `${d.cityCode}` !== "-1" && `${d.cityCode}` !== "ALL"));
}
return unique;
}, },
selectedCityCodes() { selectedCityCodes() {
return this.selectedDetails.map(d => `${d.cityCode ?? ""}`).filter(Boolean); return this.selectedDetails.map(d => `${d.cityCode ?? ""}`).filter(Boolean);
...@@ -297,7 +306,7 @@ export default { ...@@ -297,7 +306,7 @@ export default {
const prevDetails = Array.isArray(this.selectedDetails) ? this.selectedDetails.map(d => ({ ...d })) : []; const prevDetails = Array.isArray(this.selectedDetails) ? this.selectedDetails.map(d => ({ ...d })) : [];
const values = Array.isArray(raw) ? raw : []; const values = Array.isArray(raw) ? raw : [];
const hasAll = values.includes("-1") || values.includes("ALL"); const hasAll = values.includes("-1") || values.includes("ALL");
if (hasAll) { if (hasAll && this.allExclusive) {
const allObj = { provinceCode: "-1", provinceName: this.allLabel, cityCode: "-1", cityName: this.allLabel }; const allObj = { provinceCode: "-1", provinceName: this.allLabel, cityCode: "-1", cityName: this.allLabel };
this.$emit("before-change", { prev: prevDetails, next: [allObj], isOpen: this.isOpen }); this.$emit("before-change", { prev: prevDetails, next: [allObj], isOpen: this.isOpen });
this.$emit("input", [allObj]); this.$emit("input", [allObj]);
...@@ -306,7 +315,11 @@ export default { ...@@ -306,7 +315,11 @@ export default {
return; return;
} }
const citySet = new Set(values.filter(v => v && !this.isProvinceSelectValue(v)).map(v => String(v))); const citySet = new Set(
values
.filter(v => v && !this.isProvinceSelectValue(v))
.map(v => String(v === "ALL" ? "-1" : v)),
);
const provinceTokens = values.filter(v => this.isProvinceSelectValue(v)); const provinceTokens = values.filter(v => this.isProvinceSelectValue(v));
provinceTokens.forEach((token) => { provinceTokens.forEach((token) => {
const pCode = this.getProvinceCodeFromSelectValue(token); const pCode = this.getProvinceCodeFromSelectValue(token);
...@@ -329,6 +342,14 @@ export default { ...@@ -329,6 +342,14 @@ export default {
return { ...meta }; return { ...meta };
return { provinceCode: k, provinceName: k, cityCode: k, cityName: k }; return { provinceCode: k, provinceName: k, cityCode: k, cityName: k };
}); });
if (!this.allExclusive) {
const hasAllInNext = nextDetails.some(d => `${d.cityCode}` === "-1" || `${d.cityCode}` === "ALL");
if (hasAllInNext) {
const allObj = { provinceCode: "-1", provinceName: this.allLabel, cityCode: "-1", cityName: this.allLabel };
const rest = nextDetails.filter(d => `${d.cityCode}` !== "-1" && `${d.cityCode}` !== "ALL");
nextDetails.splice(0, nextDetails.length, allObj, ...rest);
}
}
const emit = () => { const emit = () => {
this.$emit("before-change", { prev: prevDetails, next: nextDetails, isOpen: this.isOpen }); this.$emit("before-change", { prev: prevDetails, next: nextDetails, isOpen: this.isOpen });
this.$emit("input", nextDetails); this.$emit("input", nextDetails);
......
...@@ -419,7 +419,7 @@ ...@@ -419,7 +419,7 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- store-api (精品升级 次新车升配 售后众筹 查询嘀加的门店数据 getList)(售前会员权益升级 售后会员权益升级 售前延保 售后延保 二手车查询账户中心所有4s店 getAccountMerchantList --> <!-- store-api (精品升级 次新车升配 售后众筹 查询嘀加的门店数据 getMerchantList 售后会员权益升级 售前延保 售后延保 二手车查询账户中心所有4s店 getAccountMerchantList -->
<RelateStoreDialog v-if="relateStoreVisible" <RelateStoreDialog v-if="relateStoreVisible"
ref="formRelateStore" ref="formRelateStore"
:relate-store-visible="relateStoreVisible" :relate-store-visible="relateStoreVisible"
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
:selected-scene-type="selectedSceneType" :selected-scene-type="selectedSceneType"
:store-api=" :store-api="
filterBaseSceneCodeBySceneType([1, 2, 3]).includes(`${formData.baseSceneCode}`) filterBaseSceneCodeBySceneType([1, 2, 3]).includes(`${formData.baseSceneCode}`)
? getList ? getMerchantList
: getAccountMerchantList : getAccountMerchantList
" "
:store-search-form="storeSearchForm" :store-search-form="storeSearchForm"
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
<script> <script>
import GlOssApi from "glsk-oss-jssdk"; import GlOssApi from "glsk-oss-jssdk";
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import { getAccountMerchantList, getList } from "@/api/merchant"; import { getAccountMerchantList, getMerchantList } from "@/api/merchant";
import { uploadImg, uploadPDF } from "@/api/sys.base"; import { uploadImg, uploadPDF } from "@/api/sys.base";
import { limitPrice } from "@/common/format"; import { limitPrice } from "@/common/format";
import { deepClone } from "@/common/util"; import { deepClone } from "@/common/util";
...@@ -571,7 +571,7 @@ export default { ...@@ -571,7 +571,7 @@ export default {
}, },
data() { data() {
return { return {
getList, getMerchantList,
getAccountMerchantList, getAccountMerchantList,
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类 extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
......
...@@ -340,14 +340,14 @@ ...@@ -340,14 +340,14 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- store-api (精品升级 次新车升配 售后众筹 查询嘀加的门店数据 getList)(售前会员权益升级 售后会员权益升级 售前延保 售后延保 二手车 查询账户中心所有4s店 getAccountMerchantList --> <!-- store-api (精品升级 次新车升配 售后众筹 查询嘀加的门店数据 getMerchantList 售后会员权益升级 售前延保 售后延保 二手车 查询账户中心所有4s店 getAccountMerchantList -->
<RelateStoreDialog v-if="relateStoreVisible" <RelateStoreDialog v-if="relateStoreVisible"
ref="formRelateStore" ref="formRelateStore"
:is-hide="true" :is-hide="true"
:relate-store-visible="relateStoreVisible" :relate-store-visible="relateStoreVisible"
:selected-base-scene-code="formData.baseSceneCode" :selected-base-scene-code="formData.baseSceneCode"
:selected-scene-type="selectedSceneType" :selected-scene-type="selectedSceneType"
:store-api="filterBaseSceneCodeBySceneType([1, 2, 3]).includes(formData.baseSceneCode) ? getList : getAccountMerchantList" :store-api="filterBaseSceneCodeBySceneType([1, 2, 3]).includes(formData.baseSceneCode) ? getMerchantList : getAccountMerchantList"
:store-search-form="storeSearchForm" :store-search-form="storeSearchForm"
:store-selected="storeSelected" :store-selected="storeSelected"
@handleRelateStoreClose="handleRelateStoreClose" @handleRelateStoreClose="handleRelateStoreClose"
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
<script> <script>
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import { getAccountMerchantList, getList } from "@/api/merchant"; import { getAccountMerchantList, getMerchantList } from "@/api/merchant";
import { uploadImg, uploadPDF } from "@/api/sys.base"; import { uploadImg, uploadPDF } from "@/api/sys.base";
import { limitPrice } from "@/common/format"; import { limitPrice } from "@/common/format";
import { deepClone } from "@/common/util"; import { deepClone } from "@/common/util";
...@@ -482,7 +482,7 @@ export default { ...@@ -482,7 +482,7 @@ export default {
}, },
data() { data() {
return { return {
getList, getMerchantList,
getAccountMerchantList, getAccountMerchantList,
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类 extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
@selection-change="handleAreaSelectChange" /> --> @selection-change="handleAreaSelectChange" /> -->
<ApplicableAreaQuerySelect v-model="applicableAreas" <ApplicableAreaQuerySelect v-model="applicableAreas"
:options="baseData.applicableAreaList" :options="baseData.applicableAreaList"
:all-exclusive="false"
width="100%" width="100%"
@change="val => handleAreaSelectChange(val)" /> @change="val => handleAreaSelectChange(val)" />
</template> </template>
...@@ -432,7 +433,7 @@ export default { ...@@ -432,7 +433,7 @@ export default {
{ {
label: "供应商", label: "供应商",
prop: "listShowProviderName", prop: "listShowProviderName",
width: "180" width: "180",
}, },
{ {
label: "适用车型", label: "适用车型",
...@@ -1155,7 +1156,7 @@ export default { ...@@ -1155,7 +1156,7 @@ export default {
handleUpdateClose() { handleUpdateClose() {
this.drawerUpdateVisible = false; this.drawerUpdateVisible = false;
// 获取最新的供应商筛选项数据 // 获取最新的供应商筛选项数据
this.getProviderList() this.getProviderList();
this.$refs.productManageTable.refreshTable(); // 刷新列表 this.$refs.productManageTable.refreshTable(); // 刷新列表
}, },
handleDelete(row) { handleDelete(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!