Commit d0061aff by zhangxw

修改

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