Commit 1e5f69ab by Jaxon

Merge branch 'SAAS+V5.8.0' into feature/goods-shelf

# Conflicts:
#	src/components/remoteSearchSelect/index.vue
2 parents 51983e3c 5e347192
Showing 38 changed files with 748 additions and 288 deletions
...@@ -9,92 +9,92 @@ ...@@ -9,92 +9,92 @@
import request from "./request"; import request from "./request";
// 分页查询潜客数据 // 分页查询潜客数据
export function potentialCustomersPage (data) { export function potentialCustomersPage(data) {
data.method = "dj.api.smartcarlife.sale.potentialCustomers.page"; data.method = "dj.api.smartcarlife.sale.potentialCustomers.page";
return request(data, "post"); return request(data, "post");
} }
// 潜客详情数据 // 潜客详情数据
export function potentialCustomersDetail (data) { export function potentialCustomersDetail(data) {
data.method = "dj.api.smartcarlife.sale.potentialCustomers.detail"; data.method = "dj.api.smartcarlife.sale.potentialCustomers.detail";
return request(data, "post"); return request(data, "post");
} }
// 潜客核验详情(含 merchantInfo) // 潜客核验详情(含 merchantInfo)
export function potentialCustomersVerificationDetail (data) { export function potentialCustomersVerificationDetail(data) {
data.method = data.method =
"dj.api.smartcarlife.sale.potentialCustomers.verificationDetail"; "dj.api.smartcarlife.sale.potentialCustomers.verificationDetail";
return request(data, "post"); return request(data, "post");
} }
// 首次绑定/重新绑定4S店 // 首次绑定/重新绑定4S店
export function bind4SStore (data) { export function bind4SStore(data) {
data.method = "dj.api.smartcarlife.sale.potentialCustomers.bind"; data.method = "dj.api.smartcarlife.sale.potentialCustomers.bind";
return request(data, "post"); return request(data, "post");
} }
// 潜客信息核验提交(dj.api.smartcarlife.sale.potentialCustomers.submitVerification) // 潜客信息核验提交(dj.api.smartcarlife.sale.potentialCustomers.submitVerification)
export function potentialCustomersInfoVerify (data) { export function potentialCustomersInfoVerify(data) {
data.method = data.method =
"dj.api.smartcarlife.sale.potentialCustomers.submitVerification"; "dj.api.smartcarlife.sale.potentialCustomers.submitVerification";
return request(data, "post"); return request(data, "post");
} }
// 潜客新建商户 — 校验商户名称是否与账户中心重复 // 潜客新建商户 — 校验商户名称是否与账户中心重复
export function potentialCustomersCheckMerchantName (data) { export function potentialCustomersCheckMerchantName(data) {
data.method = data.method =
"dj.api.smartcarlife.sale.potentialCustomers.checkMerchantName"; "dj.api.smartcarlife.sale.potentialCustomers.checkMerchantName";
data.method = "dj.api.smartcarlife.sale.potentialCustomers.infoVerify"; // data.method = "dj.api.smartcarlife.sale.potentialCustomers.infoVerify";
return request(data, "post"); return request(data, "post");
} }
// 分页查询大区 // 分页查询大区
export function regionPage (data) { export function regionPage(data) {
data.method = "dj.api.smartcarlife.sale.region.page"; data.method = "dj.api.smartcarlife.sale.region.page";
return request(data, "post"); return request(data, "post");
} }
// 获取大区人员 // 获取大区人员
export function regionUserList (data) { export function regionUserList(data) {
data.method = "dj.api.smartcarlife.sale.region.userList"; data.method = "dj.api.smartcarlife.sale.region.userList";
return request(data, "post"); return request(data, "post");
} }
// 更新大区人员 // 更新大区人员
export function updateRegionUser (data) { export function updateRegionUser(data) {
data.method = "dj.api.smartcarlife.sale.region.updateRegionUser"; data.method = "dj.api.smartcarlife.sale.region.updateRegionUser";
return request(data, "post"); return request(data, "post");
} }
// 区域运营模块接口 // 区域运营模块接口
// 区域运营管理人员列表 // 区域运营管理人员列表
export function organizationUserList (data) { export function organizationUserList(data) {
data.method = "dj.api.script.province.organization.list"; data.method = "dj.api.script.province.organization.list";
return request(data, "post"); return request(data, "post");
} }
// 区域运营管理编辑 // 区域运营管理编辑
export function organizationUserUpdate (data) { export function organizationUserUpdate(data) {
data.method = "dj.api.script.province.organization.upd"; data.method = "dj.api.script.province.organization.upd";
return request(data, "post"); return request(data, "post");
} }
// 关店管理列表/rop-dj-smartcarlife/router/dj.api.smartcarlife.sale.closeStore.page // 关店管理列表/rop-dj-smartcarlife/router/dj.api.smartcarlife.sale.closeStore.page
export function closeStorePage (data) { export function closeStorePage(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.page"; data.method = "dj.api.smartcarlife.sale.closeStore.page";
return request(data, "post"); return request(data, "post");
} }
//是否关店 //是否关店
export function closeStoreConfirm (data) { export function closeStoreConfirm(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.confirm"; data.method = "dj.api.smartcarlife.sale.closeStore.confirm";
return request(data, "post"); return request(data, "post");
} }
// 关店详情 // 关店详情
export function closeStoreDetail (data) { export function closeStoreDetail(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.detail"; data.method = "dj.api.smartcarlife.sale.closeStore.detail";
return request(data, "post"); return request(data, "post");
} }
// 关店操作记录 // 关店操作记录
export function closeStoreOperateLogList (data) { export function closeStoreOperateLogList(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.operateLog.list"; data.method = "dj.api.smartcarlife.sale.closeStore.operateLog.list";
return request(data, "post"); return request(data, "post");
} }
...@@ -102,7 +102,7 @@ export function closeStoreOperateLogList (data) { ...@@ -102,7 +102,7 @@ export function closeStoreOperateLogList (data) {
/** /**
* 分页查询门店上架审批单 * 分页查询门店上架审批单
*/ */
export function storeApprovePageQuery (data) { export function storeApprovePageQuery(data) {
data.method = "dj.api.oaapproval.store.approve.pageQuery"; data.method = "dj.api.oaapproval.store.approve.pageQuery";
return request(data, "post"); return request(data, "post");
} }
...@@ -111,7 +111,7 @@ export function storeApprovePageQuery (data) { ...@@ -111,7 +111,7 @@ export function storeApprovePageQuery (data) {
*创建门店上架审批单(草稿) *创建门店上架审批单(草稿)
*/ */
export function storeApproveCreateDraft (data) { export function storeApproveCreateDraft(data) {
data.method = "dj.api.oaapproval.store.approve.createDraft"; data.method = "dj.api.oaapproval.store.approve.createDraft";
return request(data, "post", ["file"], { return request(data, "post", ["file"], {
returnAll: true, returnAll: true,
...@@ -121,7 +121,7 @@ export function storeApproveCreateDraft (data) { ...@@ -121,7 +121,7 @@ export function storeApproveCreateDraft (data) {
*查询门店上架审批单详情 *查询门店上架审批单详情
*/ */
export function storeApproveQueryDetail (data) { export function storeApproveQueryDetail(data) {
data.method = "dj.api.oaapproval.store.approve.queryDetail"; data.method = "dj.api.oaapproval.store.approve.queryDetail";
return request(data, "post"); return request(data, "post");
} }
...@@ -130,7 +130,7 @@ export function storeApproveQueryDetail (data) { ...@@ -130,7 +130,7 @@ export function storeApproveQueryDetail (data) {
* 编辑门店上架审批单 * 编辑门店上架审批单
*/ */
export function storeApproveEditDraft (data) { export function storeApproveEditDraft(data) {
data.method = "dj.api.oaapproval.store.approve.editDraft"; data.method = "dj.api.oaapproval.store.approve.editDraft";
return request(data, "post", [], { return request(data, "post", [], {
returnAll: true, returnAll: true,
...@@ -140,7 +140,7 @@ export function storeApproveEditDraft (data) { ...@@ -140,7 +140,7 @@ export function storeApproveEditDraft (data) {
* *
* 重新发起审批单 * 重新发起审批单
*/ */
export function storeApproveReSubmit (data) { export function storeApproveReSubmit(data) {
data.method = "dj.api.oaapproval.store.approve.reSubmit"; data.method = "dj.api.oaapproval.store.approve.reSubmit";
return request(data, "post"); return request(data, "post");
} }
...@@ -148,7 +148,7 @@ export function storeApproveReSubmit (data) { ...@@ -148,7 +148,7 @@ export function storeApproveReSubmit (data) {
/** /**
* 查询销售范围类型列表 * 查询销售范围类型列表
*/ */
export function queryProductTypes (data = {}) { export function queryProductTypes(data = {}) {
data.method = "dj.api.oaapproval.store.approve.queryProductTypes"; data.method = "dj.api.oaapproval.store.approve.queryProductTypes";
return request(data, "post"); return request(data, "post");
} }
...@@ -156,7 +156,7 @@ export function queryProductTypes (data = {}) { ...@@ -156,7 +156,7 @@ export function queryProductTypes (data = {}) {
/** /**
* 查询销售品类列表 * 查询销售品类列表
*/ */
export function queryProductCategories (data = {}) { export function queryProductCategories(data = {}) {
data.method = "dj.api.oaapproval.store.approve.queryProductCategories"; data.method = "dj.api.oaapproval.store.approve.queryProductCategories";
return request(data, "post"); return request(data, "post");
} }
...@@ -164,7 +164,7 @@ export function queryProductCategories (data = {}) { ...@@ -164,7 +164,7 @@ export function queryProductCategories (data = {}) {
/** /**
* 查询签约主体 * 查询签约主体
*/ */
export function qyMerchantPageList (data = {}) { export function qyMerchantPageList(data = {}) {
data.method = "dj.smartcarlife.api.qyMerchant.pageList"; data.method = "dj.smartcarlife.api.qyMerchant.pageList";
return request(data, "post"); return request(data, "post");
} }
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
}" }"
:label="item.label" :label="item.label"
:prop="item.name" :prop="item.name"
:rules="item.rules"> :rules="item.rules"
:required="!!item.labelRequired">
<template #label> <template #label>
<span v-if="!getItemIsHide(item) && item.tips" <span v-if="!getItemIsHide(item) && item.tips"
class="tips-block"> class="tips-block">
......
...@@ -201,7 +201,10 @@ export default { ...@@ -201,7 +201,10 @@ export default {
if (dn) payload.districtName = dn; if (dn) payload.districtName = dn;
const addrTrim = submitStringField(d.detailAddress); const addrTrim = submitStringField(d.detailAddress);
if (addrTrim) payload.merchantAddress = addrTrim; if (addrTrim) {
payload.merchantAddress = addrTrim;
payload.detailAddress = addrTrim;
}
const mal = submitNumber(d.merchantAccountLevel); const mal = submitNumber(d.merchantAccountLevel);
if (mal !== undefined) payload.merchantAccountLevel = mal; if (mal !== undefined) payload.merchantAccountLevel = mal;
...@@ -210,7 +213,10 @@ export default { ...@@ -210,7 +213,10 @@ export default {
if (chId !== undefined) payload.channelId = chId; if (chId !== undefined) payload.channelId = chId;
const accessModeId = submitNumber(d.merchantModel); const accessModeId = submitNumber(d.merchantModel);
if (accessModeId !== undefined) payload.accessModeId = accessModeId; if (accessModeId !== undefined) {
payload.accessModeId = accessModeId;
payload.merchantModel = accessModeId;
}
const yqNo = submitNumber( const yqNo = submitNumber(
d.yqMerchantNo ?? this.customerRow?.yqMerchantNo d.yqMerchantNo ?? this.customerRow?.yqMerchantNo
...@@ -223,6 +229,7 @@ export default { ...@@ -223,6 +229,7 @@ export default {
const parentMerchantId = submitNumber(d.parentId); const parentMerchantId = submitNumber(d.parentId);
if (parentMerchantId !== undefined) { if (parentMerchantId !== undefined) {
payload.parentMerchantId = parentMerchantId; payload.parentMerchantId = parentMerchantId;
payload.parentId = parentMerchantId;
const parentRow = this.baseData.parentMerchantList.find( const parentRow = this.baseData.parentMerchantList.find(
(p) => String(p.id) === String(d.parentId) (p) => String(p.id) === String(d.parentId)
); );
......
...@@ -572,6 +572,7 @@ export default { ...@@ -572,6 +572,7 @@ export default {
await this.brandList(); await this.brandList();
}, },
resetMerchantVerifyForm() { resetMerchantVerifyForm() {
this.loading = false;
this.merchantNameBlurDuplicateBlocked = false; this.merchantNameBlurDuplicateBlocked = false;
this.editData = createEmptyMerchantVerifyEditData(); this.editData = createEmptyMerchantVerifyEditData();
this.isFirstBrand = false; this.isFirstBrand = false;
...@@ -579,6 +580,17 @@ export default { ...@@ -579,6 +580,17 @@ export default {
this.storeCurrentPage = 1; this.storeCurrentPage = 1;
this.storeAllPages = 0; this.storeAllPages = 0;
this.baseData.parentMerchantList = []; this.baseData.parentMerchantList = [];
// 先清空品牌树勾选再卸数据,避免树仍有选中态
const brandRef = this.$refs.brandListTree;
if (brandRef && brandRef.$refs && brandRef.$refs.tree) {
try {
brandRef.selectClear();
} catch (e) {
brandRef.$refs.tree.setCheckedKeys([]);
}
brandRef.filterText = "";
brandRef.brandTree = false;
}
this.brandListTree = []; this.brandListTree = [];
this.editFormData[this.findIdx("parentId")].isHide = false; this.editFormData[this.findIdx("parentId")].isHide = false;
this.editFormData[this.findIdx("channelId")].isHide = false; this.editFormData[this.findIdx("channelId")].isHide = false;
...@@ -590,6 +602,15 @@ export default { ...@@ -590,6 +602,15 @@ export default {
this.formRules.parentId[0].required = true; this.formRules.parentId[0].required = true;
this.formRules.channelId[0].required = true; this.formRules.channelId[0].required = true;
this.formRules.merchantModel[0].required = true; this.formRules.merchantModel[0].required = true;
if (
this.$refs.provinceForm &&
typeof this.$refs.provinceForm.resetAddressForm === "function"
) {
this.$refs.provinceForm.resetAddressForm();
}
this.$nextTick(() => {
this.$refs.editFormRef?.$refs[this.editChildRef]?.clearValidate();
});
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
@click.native="selectCity(item)"></el-option> @click.native="selectCity(item)"></el-option>
</el-select> </el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable placeholder="选择区" <el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable placeholder="选择区"
@clear="selectTown" class="select-padding" :style="embedSelectWidthStyle" @blur.native="$emit('merchant-address-part-blur')"> @clear="selectTown" class="select-padding" :style="embedSelectWidthStyle"
@blur.native="$emit('merchant-address-part-blur')">
<el-option v-for="(item, index) in townList" :key="'town' + index" :label="item.name" :value="item.name" <el-option v-for="(item, index) in townList" :key="'town' + index" :label="item.name" :value="item.name"
@click.native="selectTown(item)"></el-option> @click.native="selectTown(item)"></el-option>
</el-select> </el-select>
...@@ -210,6 +211,24 @@ export default { ...@@ -210,6 +211,24 @@ export default {
}) })
return pro return pro
}, },
/** 清空省市区与地图选址(嵌入商户核验等弹窗关闭时与父级 editData 一并重置) */
resetAddressForm() {
this.provinceForm = {
provinceName: '',
cityName: '',
townName: '',
provinceCode: '',
cityCode: '',
townCode: '',
lat: '',
lng: '',
fullAddress: ''
}
this.cityList = []
this.townList = []
this.dialogMapVisible = false
this.addressData = {}
},
// 省市回显 // 省市回显
init(provinceData) { init(provinceData) {
const { province, city, townName, fullAddress, lng, lat } = provinceData const { province, city, townName, fullAddress, lng, lat } = provinceData
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<script> <script>
let map, marker, geocoder let map, marker, geocoder
export default { export default {
name: 'map', name: 'ProvinceCityMapView',
props: { props: {
mapHeight: { mapHeight: {
type: Number, type: Number,
...@@ -34,6 +34,13 @@ export default { ...@@ -34,6 +34,13 @@ export default {
methods: { methods: {
async mapInit(lng, lat) { async mapInit(lng, lat) {
const mapapi = this.$mapapi const mapapi = this.$mapapi
try {
await mapapi.ready()
} catch (err) {
console.error(err)
this.$message.error('地图加载失败,请稍后重试')
return
}
console.log(lng, lat, '==========', this.$mapapi) console.log(lng, lat, '==========', this.$mapapi)
map = await mapapi.invoke('Map', 'mapContainer') map = await mapapi.invoke('Map', 'mapContainer')
if (lng) { if (lng) {
......
<template> <template>
<el-select ref="selectRef" <el-select
ref="selectRef"
:key="forceKey" :key="forceKey"
v-select-load-more="loadMore" v-select-load-more="loadMore"
:value="value" :value="value"
v-bind="selectProps" v-bind="selectProps"
v-on="selectEvent" v-on="selectEvent"
@visible-change="handleVisibleChange" @visible-change="handleVisibleChange"
@change="handleSelectChange"> @change="handleSelectChange"
<el-option v-for="subItem in localOptions" >
<el-option
v-for="subItem in localOptions"
:key="subItem[fieldName.value]" :key="subItem[fieldName.value]"
v-bind="{ v-bind="{
value: $attrs['value-key'] ? subItem : subItem[fieldName.value], value: $attrs['value-key'] ? subItem : subItem[fieldName.value],
label: subItem[fieldName.label], label: subItem[fieldName.label],
...isFunction(optionProps) ? optionProps(subItem) : optionProps, ...isFunction(optionProps) ? optionProps(subItem) : optionProps,
}"> }"
<slot name="options" :row="subItem"></slot> >
<slot
name="options"
:row="subItem"
></slot>
</el-option> </el-option>
<template #empty> <template #empty>
<div class="temp-wrapper empty-wrapper" style="text-align: center;cursor: not-allowed;padding:4px 0;"> <div
class="temp-wrapper empty-wrapper"
style="text-align: center;cursor: not-allowed;padding:4px 0;"
>
<div v-if="loading"> <div v-if="loading">
<span class="el-icon-loading" /> <span class="el-icon-loading" />
</div> </div>
<div v-else title="请键入其他关键字"> <div
v-else
title="请键入其他关键字"
>
没有找到相关数据 没有找到相关数据
</div> </div>
</div> </div>
</template> </template>
<div class="temp-wrapper page-tips" title="不要点我"> <div
class="temp-wrapper page-tips"
title="不要点我"
>
<div v-if="(pageQuery.currentPage <= pageQuery.pages) && loading"> <div v-if="(pageQuery.currentPage <= pageQuery.pages) && loading">
<span> <span>
下一页加载中 下一页加载中
...@@ -48,7 +64,7 @@ export default { ...@@ -48,7 +64,7 @@ export default {
name: "", name: "",
directives: { directives: {
"select-load-more": { "select-load-more": {
bind(el, binding, vnode) { bind (el, binding, vnode) {
const getWrapDom = () => vnode.componentInstance?.$refs?.popper?.$el?.querySelector(".el-select-dropdown__wrap"); const getWrapDom = () => vnode.componentInstance?.$refs?.popper?.$el?.querySelector(".el-select-dropdown__wrap");
const onScroll = function () { const onScroll = function () {
// 容差 2px,避免小数滚动高度导致触底判断抖动 // 容差 2px,避免小数滚动高度导致触底判断抖动
...@@ -74,10 +90,10 @@ export default { ...@@ -74,10 +90,10 @@ export default {
setTimeout(bindScroll, 0); setTimeout(bindScroll, 0);
setTimeout(bindScroll, 100); setTimeout(bindScroll, 100);
}, },
componentUpdated(el) { componentUpdated (el) {
el.__selectLoadMoreBindScroll?.(); el.__selectLoadMoreBindScroll?.();
}, },
unbind(el) { unbind (el) {
if (el.__selectLoadMoreWrap && el.__selectLoadMoreOnScroll) { if (el.__selectLoadMoreWrap && el.__selectLoadMoreOnScroll) {
el.__selectLoadMoreWrap.removeEventListener("scroll", el.__selectLoadMoreOnScroll); el.__selectLoadMoreWrap.removeEventListener("scroll", el.__selectLoadMoreOnScroll);
} }
...@@ -115,8 +131,15 @@ export default { ...@@ -115,8 +131,15 @@ export default {
}), }),
}, },
defaultValue: {
type: Object,
default: () => ({
label: "",
value: "",
}),
}
}, },
data() { data () {
return { return {
localOptions: [], localOptions: [],
pageQuery: { pageQuery: {
...@@ -132,7 +155,7 @@ export default { ...@@ -132,7 +155,7 @@ export default {
}; };
}, },
computed: { computed: {
selectProps() { selectProps () {
return { return {
"collapse-tags": true, "collapse-tags": true,
"filterable": true, "filterable": true,
...@@ -144,7 +167,7 @@ export default { ...@@ -144,7 +167,7 @@ export default {
...this.$attrs, ...this.$attrs,
}; };
}, },
selectEvent() { selectEvent () {
return { return {
"visible-change": this.visibleChange, "visible-change": this.visibleChange,
...omit(this.$listeners, ["change", "blur"]), ...omit(this.$listeners, ["change", "blur"]),
...@@ -154,31 +177,33 @@ export default { ...@@ -154,31 +177,33 @@ export default {
}, },
watch: { watch: {
options: { options: {
handler(val) { handler (val) {
this.localOptions = [...this.options]; this.localOptions = [...this.options];
}, },
immediate: true, immediate: true,
}, },
}, },
async mounted() { async mounted () {
console.log("初始化?");
if (this.immediate) { if (this.immediate) {
await this.getApi(false, true); await this.getApi(false, true);
} }
}, },
methods: { methods: {
blur() { blur () {
if (this.$refs.selectRef) { if (this.$refs.selectRef) {
console.log("使失焦?"); console.log("使失焦?");
this.$refs.selectRef.blur(); this.$refs.selectRef.blur();
} }
}, },
async getApi(loadMore = false, isImmediate = false) { async getApi (loadMore = false, isImmediate = false) {
if (!isFunction(this.fetchApi)) { if (!isFunction(this.fetchApi)) {
console.log("不是个函数?", this.fetchApi); console.log("不是个函数?", this.fetchApi);
return; return;
} }
this.loading = true; this.loading = true;
try { try {
const { fieldName: { value, label } } = this
const { list, query } = await this.fetchApi({ const { list, query } = await this.fetchApi({
// 组件内部的 查询 // 组件内部的 查询
pageQuery: this.pageQuery, pageQuery: this.pageQuery,
...@@ -189,9 +214,30 @@ export default { ...@@ -189,9 +214,30 @@ export default {
// 是否第一次触发 // 是否第一次触发
isImmediate, isImmediate,
}); });
let { defaultValue } = this;
if (loadMore) { if (loadMore) {
// 加载更多时,如果默认值已存在则移除,避免重复
if (defaultValue.value) {
const existIndex = list.findIndex((item) => item[value] == defaultValue.value);
if (existIndex > -1) {
list.splice(existIndex, 1);
}
}
// 将新数据追加到现有选项后面
this.localOptions = this.localOptions.concat(list); this.localOptions = this.localOptions.concat(list);
} else { } else {
// 首次加载或搜索时,如果有默认值则添加到列表开头
if (defaultValue.value && defaultValue.label) {
// 检查默认值是否已在列表中,避免重复添加
const exists = list.some((item) => item[value] == defaultValue.value);
if (!exists && list.length > 0 && !this.pageQuery.searchValue) {
list.unshift({
[value]: defaultValue.value,
[label]: defaultValue.label,
});
}
}
this.localOptions = list; this.localOptions = list;
} }
this.$emit("update:options", this.localOptions); this.$emit("update:options", this.localOptions);
...@@ -202,17 +248,18 @@ export default { ...@@ -202,17 +248,18 @@ export default {
}); });
} }
}, },
handleSelectChange(e) { handleSelectChange (e) {
this.$emit("input", e); this.$emit("input", e);
if (isFunction(this.$listeners?.change)) { if (isFunction(this.$listeners?.change)) {
this.$listeners.change(e); this.$listeners.change(e);
} }
}, },
async handleVisibleChange(e) { async handleVisibleChange (e) {
// 在多选的情况下 @blur响应不了 用这个替代 // 在多选的情况下 @blur响应不了 用这个替代
if (!e) { if (!e) {
// 失焦时, 检查 query.searchValue的内容. 如果有值 // 失焦时, 检查 query.searchValue的内容. 如果有值
// 需要去掉searchValue 重新获取默认的options // 需要去掉searchValue 重新获取默认的options
console.log("失焦?", this.pageQuery.searchValue);
if (this.pageQuery.searchValue) { if (this.pageQuery.searchValue) {
console.log("重新获取默认的options"); console.log("重新获取默认的options");
this.pageQuery.searchValue = ""; this.pageQuery.searchValue = "";
...@@ -227,7 +274,7 @@ export default { ...@@ -227,7 +274,7 @@ export default {
} }
}, },
isFunction, isFunction,
async loadMore() { async loadMore () {
if (this.loading) { if (this.loading) {
return; return;
} }
...@@ -238,7 +285,7 @@ export default { ...@@ -238,7 +285,7 @@ export default {
query.currentPage += 1; query.currentPage += 1;
await this.getApi(true); await this.getApi(true);
}, },
async remoteOptions(query) { async remoteOptions (query) {
this.loading = true; this.loading = true;
// 还原滚动条位置 // 还原滚动条位置
const wrap = this.$refs.selectRef.$refs.popper.$el.querySelector(".el-select-dropdown__wrap"); const wrap = this.$refs.selectRef.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");
...@@ -257,14 +304,14 @@ export default { ...@@ -257,14 +304,14 @@ export default {
await this.getApi(); await this.getApi();
}, },
// 重置页数.做成函数可以给父组件调用 // 重置页数.做成函数可以给父组件调用
resetPageQuery() { resetPageQuery () {
this.pageQuery.currentPage = 1; this.pageQuery.currentPage = 1;
}, },
forceUpdate() { forceUpdate () {
this.forceKey = nanoid(); this.forceKey = nanoid();
}, },
visibleChange(show) { visibleChange (show) {
// if (!show) { // if (!show) {
// this.options = []; // this.options = [];
// this.loading = true; // this.loading = true;
......
...@@ -20,17 +20,38 @@ ...@@ -20,17 +20,38 @@
:value="item.confId" /> :value="item.confId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="业务场景:" prop="baseSceneCodeList"> <!-- 权益类:多选 +「全部」;:key 避免切换业务线时 el-select 复用导致单选/多选展示层叠 -->
<el-select v-model="infoForm.baseSceneCodeList" <el-form-item v-if="!isLightBusinessLine"
:key="`biz-scene-equity-${infoForm.sceneType}`"
label="业务场景:"
prop="baseSceneCodeList"
required>
<el-select :key="`biz-scene-select-equity-${infoForm.sceneType}`"
v-model="infoForm.baseSceneCodeList"
multiple multiple
collapse-tags collapse-tags
style="width:400px" style="width:400px"
@change="handleSceneTypeChange"> @change="handleEquitySceneChange">
<el-option v-for="item in sceneTypeOptionList" <el-option v-for="item in equitySceneSelectOptions"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</el-form-item>
<!-- 轻改类:单选、无「全部」,默认第一项 -->
<el-form-item v-else
:key="`biz-scene-light-${infoForm.sceneType}`"
label="业务场景:"
prop="baseSceneCodeList"
required>
<el-select :key="`biz-scene-select-light-${infoForm.sceneType}`"
v-model="lightSceneSelectModel"
style="width:400px"
@change="handleLightSceneChange">
<el-option v-for="item in lightSceneSelectOptions"
:key="item.confId" :key="item.confId"
:label="item.confLabel" :label="item.confLabel"
:value="item.confId" /> :value="item.confId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商户类型:" prop="merchantType"> <el-form-item label="商户类型:" prop="merchantType">
...@@ -203,7 +224,10 @@ export default { ...@@ -203,7 +224,10 @@ export default {
return { return {
loading: false, loading: false,
multipleLimit: 10, multipleLimit: 10,
sceneTypeList: [], /** 权益类业务场景选项(接口原始列表,不含「全部」) */
equitySceneOptionList: [],
/** 轻改类业务场景选项(接口原始列表,无「全部」) */
lightSceneOptionList: [],
// 判断是否是模版模式 // 判断是否是模版模式
isTmpl: false, isTmpl: false,
localTmplList: deepClone(localTmplList), localTmplList: deepClone(localTmplList),
...@@ -269,7 +293,27 @@ export default { ...@@ -269,7 +293,27 @@ export default {
formRules: { formRules: {
sceneType: [{ required: true, message: "请选择业务线", trigger: "change" }], sceneType: [{ required: true, message: "请选择业务线", trigger: "change" }],
baseSceneCodeList: [{ required: true, message: "请选择业务场景", trigger: "change" }], baseSceneCodeList: [
{
validator: (rule, value, callback) => {
if (!Array.isArray(value) || !value.length) {
callback(new Error("请选择业务场景"));
return;
}
if (String(this.infoForm.sceneType) === "1") {
const v = value[0];
if (v === undefined || v === null || `${v}` === "") {
callback(new Error("请选择业务场景"));
return;
}
callback();
return;
}
callback();
},
trigger: "change",
},
],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }], merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [ merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" }, { required: true, message: "请选择对账商户", trigger: "change" },
...@@ -336,20 +380,45 @@ export default { ...@@ -336,20 +380,45 @@ export default {
...mapState({ ...mapState({
dowloadList: state => state.d2admin.user.dowloadList, dowloadList: state => state.d2admin.user.dowloadList,
}), }),
sceneTypeOptionList() { isLightBusinessLine() {
// 选项 = 全部 + 当前业务线动态获取的场景列表 return String(this.infoForm.sceneType) === "1";
const inputList = Array.isArray(this.sceneTypeList) ? this.sceneTypeList : []; },
const filteredList = inputList /** 轻改类单选:控件绑定标量,与接口统一的 baseSceneCodeList 为单元素数组 */
.map((item) => { lightSceneSelectModel: {
const confId = item?.confId ?? item?.id; get() {
const confLabel = item?.confLabel ?? item?.name; if (!this.isLightBusinessLine) {
return { confId, confLabel }; return "";
}) }
.filter(item => item.confId !== undefined && item.confId !== null && item.confId !== ""); const arr = this.infoForm.baseSceneCodeList;
return [ if (Array.isArray(arr) && arr.length) {
{ confId: "", confLabel: "全部" }, const v = arr[0];
...filteredList, if (v !== undefined && v !== null && `${v}` !== "") {
]; return v;
}
}
return "";
},
set(val) {
if (!this.isLightBusinessLine) {
return;
}
if (val === undefined || val === null || `${val}` === "") {
this.infoForm.baseSceneCodeList = [""];
} else {
this.infoForm.baseSceneCodeList = [val];
}
},
},
equitySceneSelectOptions() {
const rows = Array.isArray(this.equitySceneOptionList)
? this.equitySceneOptionList
: [];
return [{ confId: "", confLabel: "全部" }, ...rows];
},
lightSceneSelectOptions() {
return Array.isArray(this.lightSceneOptionList)
? this.lightSceneOptionList
: [];
}, },
}, },
...@@ -366,7 +435,6 @@ export default { ...@@ -366,7 +435,6 @@ export default {
}, },
"infoForm.sceneType": { "infoForm.sceneType": {
handler() { handler() {
// 切换业务线时,业务场景默认回到“全部”
this.infoForm.baseSceneCodeList = [""]; this.infoForm.baseSceneCodeList = [""];
this.syncSceneTypeList(); this.syncSceneTypeList();
}, },
...@@ -396,7 +464,8 @@ export default { ...@@ -396,7 +464,8 @@ export default {
syncSceneTypeList() { syncSceneTypeList() {
const sceneType = Number(this.infoForm?.sceneType); const sceneType = Number(this.infoForm?.sceneType);
if (this.infoForm?.sceneType === "" || this.infoForm?.sceneType === null || this.infoForm?.sceneType === undefined || Number.isNaN(sceneType)) { if (this.infoForm?.sceneType === "" || this.infoForm?.sceneType === null || this.infoForm?.sceneType === undefined || Number.isNaN(sceneType)) {
this.sceneTypeList = []; this.equitySceneOptionList = [];
this.lightSceneOptionList = [];
return; return;
} }
getScenesByParams({ bizTypeCode: sceneType === 0 ? 2 : 1 }).then((res) => { getScenesByParams({ bizTypeCode: sceneType === 0 ? 2 : 1 }).then((res) => {
...@@ -409,12 +478,44 @@ export default { ...@@ -409,12 +478,44 @@ export default {
confLabel: item?.name, confLabel: item?.name,
})) }))
.filter(item => item.confId !== undefined && item.confId !== null && item.confId !== ""); .filter(item => item.confId !== undefined && item.confId !== null && item.confId !== "");
this.sceneTypeList = normalized; if (sceneType === 0) {
this.equitySceneOptionList = normalized;
} else if (sceneType === 1) {
this.lightSceneOptionList = normalized;
}
this.applyDefaultBusinessScene();
this.clearBusinessSceneValidate();
}).catch(() => { }).catch(() => {
this.sceneTypeList = []; if (sceneType === 0) {
this.equitySceneOptionList = [];
} else if (sceneType === 1) {
this.lightSceneOptionList = [];
}
this.applyDefaultBusinessScene();
this.clearBusinessSceneValidate();
});
},
applyDefaultBusinessScene() {
if (String(this.infoForm.sceneType) === "1") {
const first = this.lightSceneOptionList[0]?.confId;
if (first !== undefined && first !== null && `${first}` !== "") {
this.infoForm.baseSceneCodeList = [first];
} else {
this.infoForm.baseSceneCodeList = [""];
}
return;
}
this.infoForm.baseSceneCodeList = [""];
},
clearBusinessSceneValidate() {
this.$nextTick(() => {
const form = this.$refs.accountForm;
if (form) {
form.clearValidate(["baseSceneCodeList"]);
}
}); });
}, },
handleSceneTypeChange(value) { handleEquitySceneChange(value) {
if (!Array.isArray(value)) { if (!Array.isArray(value)) {
return; return;
} }
...@@ -423,12 +524,16 @@ export default { ...@@ -423,12 +524,16 @@ export default {
return; return;
} }
if (value.includes("") && value.length > 1) { if (value.includes("") && value.length > 1) {
// 多选时,“全部”与具体值互斥;以最后一次选择为准
this.infoForm.baseSceneCodeList = value[value.length - 1] === "" this.infoForm.baseSceneCodeList = value[value.length - 1] === ""
? [""] ? [""]
: value.filter(v => v !== ""); : value.filter(v => v !== "");
} }
}, },
handleLightSceneChange() {
this.$nextTick(() => {
this.$refs.accountForm?.validateField("baseSceneCodeList");
});
},
selectMerchant() { selectMerchant() {
let params = {}; let params = {};
this.loading = true; this.loading = true;
...@@ -646,7 +751,9 @@ export default { ...@@ -646,7 +751,9 @@ export default {
params.reportType = infoForm.reportType; params.reportType = infoForm.reportType;
} }
params.sceneType = this.scene; params.sceneType = this.scene;
params.baseSceneCodeList = infoForm.baseSceneCodeList; (infoForm.baseSceneCodeList || []).forEach((code, index) => {
params[`baseSceneCodeList[${index}]`] = code;
});
// 对账状态 // 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus); infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType) // infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
......
...@@ -191,7 +191,8 @@ ...@@ -191,7 +191,8 @@
<auth-button :show-btn-ids="['9050101']" category="Button" /> <auth-button :show-btn-ids="['9050101']" category="Button" />
<!-- </span> --> <!-- </span> -->
</d2-table-header> </d2-table-header>
<el-table :data="tableData" <el-table v-loading="tableLoading"
:data="tableData"
row-key="uniqueKey" row-key="uniqueKey"
:tree-props="{ children: 'subOrderProfitAllocations' }"> :tree-props="{ children: 'subOrderProfitAllocations' }">
<!-- <el-table-column v-if="!userInfo.beSuper" <!-- <el-table-column v-if="!userInfo.beSuper"
...@@ -234,8 +235,7 @@ ...@@ -234,8 +235,7 @@
<span>{{ scope.row.customerName || "-" }}</span> <span>{{ scope.row.customerName || "-" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="sellerName_visible" <el-table-column prop="sellerName"
prop="sellerName"
label="转化员" label="转化员"
align="center"> align="center">
<template #default="scope"> <template #default="scope">
...@@ -694,6 +694,7 @@ export default { ...@@ -694,6 +694,7 @@ export default {
channelType: "", channelType: "",
subSceneType: [""], subSceneType: [""],
baseSceneCodeList: [""], baseSceneCodeList: [""],
baseSceneCode: "",
businessModel: "", businessModel: "",
reconciliationFlag: "", reconciliationFlag: "",
}, },
...@@ -749,6 +750,36 @@ export default { ...@@ -749,6 +750,36 @@ export default {
}, },
}, },
{ {
label: "业务场景",
name: "baseSceneCode",
type: "select",
isHide: true,
isClear: false,
prependAllOption: false,
optionList: [],
optionId: "baseSceneCode",
optionLabel: "name",
optionsName: "subSceneTypeLightList",
placeholder: "请选择业务场景",
changeAttr: (value) => {
const ALL = "";
let next;
if (
value === undefined
|| value === null
|| value === ""
|| `${value}` === ""
) {
next = [ALL];
} else {
const s
= typeof value === "string" ? value : String(value);
next = [s];
}
this.searchForm.baseSceneCodeList = next;
},
},
{
label: "商户名称", label: "商户名称",
name: "merchantNameKeyWord", name: "merchantNameKeyWord",
type: "input", type: "input",
...@@ -881,6 +912,7 @@ export default { ...@@ -881,6 +912,7 @@ export default {
}, },
], ],
tableData: [], tableData: [],
tableLoading: false,
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
...@@ -893,6 +925,8 @@ export default { ...@@ -893,6 +925,8 @@ export default {
PlatformMerchantList: [], PlatformMerchantList: [],
channelTypeList: [], channelTypeList: [],
subSceneTypeList: [], subSceneTypeList: [],
/** 轻改场景业务场景选项(无「全部」) */
subSceneTypeLightList: [],
reconciliationFlagList: [], reconciliationFlagList: [],
}, },
total: 0, total: 0,
...@@ -962,7 +996,7 @@ export default { ...@@ -962,7 +996,7 @@ export default {
this.getSummary(); this.getSummary();
}, },
"searchForm.sceneType": { "searchForm.sceneType": {
handler(val) { async handler(val) {
if (val == 0 || val == 4) { if (val == 0 || val == 4) {
/** /**
1.0场景(暂无业务支撑) 1.0场景(暂无业务支撑)
...@@ -1005,8 +1039,15 @@ export default { ...@@ -1005,8 +1039,15 @@ export default {
this.shopProfitType_visible = false; this.shopProfitType_visible = false;
this.yq_visible = true; this.yq_visible = true;
} }
this.handleReset(val); const idxMulti = this.findFormIdx("subSceneType");
this.syncSubSceneTypeList(); const idxSingle = this.findFormIdx("baseSceneCode");
if (idxMulti !== -1 && idxSingle !== -1) {
const lightTab = String(val) === "1";
this.showFormData[idxMulti].isHide = lightTab;
this.showFormData[idxSingle].isHide = !lightTab;
}
this.handleReset(val, true);
await this.syncSubSceneTypeList();
this.getList(); this.getList();
this.getTotal(); this.getTotal();
}, },
...@@ -1050,16 +1091,21 @@ export default { ...@@ -1050,16 +1091,21 @@ export default {
const sceneType = Number(this.searchForm?.sceneType); const sceneType = Number(this.searchForm?.sceneType);
if (sceneType === "" || sceneType === null || sceneType === undefined) { if (sceneType === "" || sceneType === null || sceneType === undefined) {
this.baseData.subSceneTypeList = []; this.baseData.subSceneTypeList = [];
this.baseData.subSceneTypeLightList = [];
this.searchForm.baseSceneCode = "";
this.searchForm.baseSceneCodeList = [""];
this.getOptionsList(); this.getOptionsList();
return; return Promise.resolve();
} }
const subSceneAllOption = { baseSceneCode: "", name: "全部" }; const subSceneAllOption = { baseSceneCode: "", name: "全部" };
const applySubSceneTypeList = (rows) => { const applySubSceneTypeList = (rows) => {
const rest = rows.filter(item => item.baseSceneCode !== ""); const rest = rows.filter(item => item.baseSceneCode !== "");
this.baseData.subSceneTypeList = [subSceneAllOption, ...rest]; this.baseData.subSceneTypeList = [subSceneAllOption, ...rest];
this.baseData.subSceneTypeLightList = rest;
this.applyDefaultBaseSceneCodeForLightTab();
this.getOptionsList(); this.getOptionsList();
}; };
getScenesByParams({ bizTypeCode: sceneType === 0 ? 2 : 1 }) return getScenesByParams({ bizTypeCode: sceneType === 0 ? 2 : 1 })
.then((res) => { .then((res) => {
const list = Array.isArray(res) const list = Array.isArray(res)
? res ? res
...@@ -1077,6 +1123,32 @@ export default { ...@@ -1077,6 +1123,32 @@ export default {
applySubSceneTypeList([]); applySubSceneTypeList([]);
}); });
}, },
/** 1.1 轻量 Tab 单选业务场景:默认第一项;非该 Tab 清空 */
applyDefaultBaseSceneCodeForLightTab() {
const lightTab
= this.searchForm.sceneType == 1 || this.searchForm.sceneType === "1";
if (!lightTab) {
this.searchForm.baseSceneCode = "";
return;
}
const list = this.baseData.subSceneTypeLightList || [];
const first = list[0];
if (
first
&& first.baseSceneCode !== undefined
&& first.baseSceneCode !== null
&& `${first.baseSceneCode}` !== ""
) {
const code = first.baseSceneCode;
this.searchForm.baseSceneCode = code;
this.searchForm.baseSceneCodeList = [
typeof code === "string" ? code : String(code),
];
} else {
this.searchForm.baseSceneCode = "";
this.searchForm.baseSceneCodeList = [""];
}
},
handleAccountConfirm() { handleAccountConfirm() {
this.fileVisible = true; this.fileVisible = true;
}, },
...@@ -1129,7 +1201,10 @@ export default { ...@@ -1129,7 +1201,10 @@ export default {
this.financeChart.setOption(funnelOption); this.financeChart.setOption(funnelOption);
}); });
}, },
handleReset(sceneType) { /**
* @param fromSceneTabWatch Tab 切换时由 watcher 传入 true:场景列表将在 syncSubSceneTypeList 后统一设默认项,此处不再按旧列表回填
*/
handleReset(sceneType, fromSceneTabWatch = false) {
this.searchForm = { this.searchForm = {
time: "", time: "",
yqMerchantId: "", yqMerchantId: "",
...@@ -1141,6 +1216,7 @@ export default { ...@@ -1141,6 +1216,7 @@ export default {
channelType: "", channelType: "",
subSceneType: [""], subSceneType: [""],
baseSceneCodeList: [""], baseSceneCodeList: [""],
baseSceneCode: "",
businessModel: "", businessModel: "",
sceneType, sceneType,
reconciliationFlag: "", reconciliationFlag: "",
...@@ -1157,6 +1233,9 @@ export default { ...@@ -1157,6 +1233,9 @@ export default {
}; };
// this.userInfo.beSuper && (this.baseData.storeIdList = []) // this.userInfo.beSuper && (this.baseData.storeIdList = [])
this.baseData.storeIdList = []; this.baseData.storeIdList = [];
if (!fromSceneTabWatch && (sceneType == 1 || sceneType === "1")) {
this.applyDefaultBaseSceneCodeForLightTab();
}
this.getOptionsList(); this.getOptionsList();
}, },
// 导出 // 导出
...@@ -1209,8 +1288,10 @@ export default { ...@@ -1209,8 +1288,10 @@ export default {
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === "select") { if (item.type === "select") {
const mayPrependAll = item.prependAllOption !== false;
if ( if (
this.baseData[item.optionsName]?.length mayPrependAll
&& this.baseData[item.optionsName]?.length
&& this.baseData[item.optionsName][0][ && this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel this.showFormData[index].optionLabel
] !== "全部" ] !== "全部"
...@@ -1223,7 +1304,7 @@ export default { ...@@ -1223,7 +1304,7 @@ export default {
this.$set( this.$set(
this.showFormData[index], this.showFormData[index],
"optionList", "optionList",
this.baseData[item.optionsName], this.baseData[item.optionsName] || [],
); );
} }
}); });
...@@ -1254,8 +1335,9 @@ export default { ...@@ -1254,8 +1335,9 @@ export default {
// const apiName = this.userInfo.beSuper ? 'getList' : 'getYqList' // const apiName = this.userInfo.beSuper ? 'getList' : 'getYqList'
// api[apiName](params).then(res => { // api[apiName](params).then(res => {
this.tableData = []; this.tableLoading = true;
api.getList(params).then((res) => { api.getList(params)
.then((res) => {
if (params.sceneType == this.searchForm.sceneType) { if (params.sceneType == this.searchForm.sceneType) {
let temp = 1; let temp = 1;
this.tableData = res.list.map((item, index) => { this.tableData = res.list.map((item, index) => {
...@@ -1294,6 +1376,9 @@ export default { ...@@ -1294,6 +1376,9 @@ export default {
this.page.pageSize = res.pageSize; this.page.pageSize = res.pageSize;
this.total = res.total; this.total = res.total;
} }
})
.finally(() => {
this.tableLoading = false;
}); });
}, },
// 价格计算精度丢失处理 // 价格计算精度丢失处理
...@@ -1409,9 +1494,12 @@ export default { ...@@ -1409,9 +1494,12 @@ export default {
? this.searchForm.channelType.join(",") ? this.searchForm.channelType.join(",")
: this.searchForm.channelType; : this.searchForm.channelType;
} }
if (Array.isArray(this.searchForm.baseSceneCodeList) && this.searchForm.baseSceneCodeList.length) { if (
Array.isArray(this.searchForm.baseSceneCodeList)
&& this.searchForm.baseSceneCodeList.length
) {
const selected = this.searchForm.baseSceneCodeList; const selected = this.searchForm.baseSceneCodeList;
// “全部”= 不传;否则按后端需要解构成 baseSceneCodeList[0]=xxx // “全部”= 不传;轻量 Tab 单选与完整 Tab 多选均走 baseSceneCodeList[n](数组序列化)
if (!selected.includes("")) { if (!selected.includes("")) {
selected.forEach((code, index) => { selected.forEach((code, index) => {
params[`baseSceneCodeList[${index}]`] = code; params[`baseSceneCodeList[${index}]`] = code;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<!-- 单选 --> <!-- 单选 -->
<!-- 太阳膜类产品 上架部位 --> <!-- 太阳膜类产品 上架部位 -->
<div v-if=" <div v-if="
item.type === 'radio' item.type === 'radio-select'
&& formData.goodsType == 1 && formData.goodsType == 1
&& !item.index && !item.index
"> ">
...@@ -26,13 +26,23 @@ ...@@ -26,13 +26,23 @@
:label-width="item.label ? '180px' : '0px'" :label-width="item.label ? '180px' : '0px'"
:prop="item.name" :prop="item.name"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"> :style="{ 'margin-bottom': !item.type ? '0px' : '22px' }">
<el-radio-group v-model="formData[item.name]"> <el-select v-model="formData[item.name]"
filterable
:placeholder="`请选择${item.label}`"
:style="{ width: item.width || formItemWidth }"
@change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.radioGroupList"
:key="subItem.confId"
:label="subItem.confName"
:value="subItem.confId" />
</el-select>
<!-- <el-radio-group v-model="formData[item.name]">
<el-radio v-for="(subItem, subIndex) in item.radioGroupList" <el-radio v-for="(subItem, subIndex) in item.radioGroupList"
:key="subIndex" :key="subIndex"
:label="subItem.confId"> :label="subItem.confId">
{{ subItem.confName }} {{ subItem.confName }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group> -->
</el-form-item> </el-form-item>
</div> </div>
<!-- 售后众筹显示升级/产品供货模式 --> <!-- 售后众筹显示升级/产品供货模式 -->
......
...@@ -88,8 +88,9 @@ export const packageGoodsForm = [{ ...@@ -88,8 +88,9 @@ export const packageGoodsForm = [{
}, { }, {
name: "position", name: "position",
label: "上架部位", label: "上架部位",
type: "radio", type: "radio-select",
radioGroupList: [], radioGroupList: [],
width: "432px"
}, { }, {
name: "goodsAlias", name: "goodsAlias",
label: "商品别名", label: "商品别名",
......
...@@ -115,8 +115,9 @@ export default { ...@@ -115,8 +115,9 @@ export default {
}, { }, {
name: "position", name: "position",
label: "上架部位", label: "上架部位",
type: "radio", type: "radio-select",
radioGroupList: [], radioGroupList: [],
width: "432px"
}, { }, {
name: "goodsAlias", name: "goodsAlias",
label: "商品别名", label: "商品别名",
...@@ -291,7 +292,7 @@ export default { ...@@ -291,7 +292,7 @@ export default {
}), }),
initData() { initData() {
// 获取业务场景数据 // 获取业务场景数据
getBaseSceneCodeList({}).then(res => { getBaseSceneCodeList({status: 1}).then(res => {
this.sceneCodeList = res || [] this.sceneCodeList = res || []
this.getBaseData(); this.getBaseData();
const id = this.$route.query.id; const id = this.$route.query.id;
......
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
const id = this.$route.query.id const id = this.$route.query.id
this.detailId = id this.detailId = id
if (!id) return this.show = true if (!id) return this.show = true
getBaseSceneCodeList({}).then(res => { getBaseSceneCodeList({status: 1}).then(res => {
this.baseSceneList = res || [] this.baseSceneList = res || []
this.getDetailInfo(id) this.getDetailInfo(id)
}).catch(() => { }).catch(() => {
......
...@@ -739,7 +739,7 @@ export default { ...@@ -739,7 +739,7 @@ export default {
this.positionTypeList = await this.get(BaseData.positionTypeList); this.positionTypeList = await this.get(BaseData.positionTypeList);
}, },
getBaseCodeList() { getBaseCodeList() {
getBaseSceneCodeList({}).then(res => { getBaseSceneCodeList({status: 1}).then(res => {
this.baseData.baseSceneList = res || [] this.baseData.baseSceneList = res || []
this.getOptionsList() this.getOptionsList()
}) })
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
class="groundingGoods-item"> class="groundingGoods-item">
<div v-for="(item, index) in i.formBlock[eleIndex]" :key="index"> <div v-for="(item, index) in i.formBlock[eleIndex]" :key="index">
<!-- 上架部位 --> <!-- 上架部位 -->
<div v-if="item.type === 'radio' && ele.goodsType == 1 && !item.index"> <div v-if="item.type === 'radio-select' && ele.goodsType == 1 && !item.index">
<el-form-item :id="`groundingGoodsList[${eleIndex}][${item.name}]`" <el-form-item :id="`groundingGoodsList[${eleIndex}][${item.name}]`"
class="dis-in-block" class="dis-in-block"
:label="item.label ? `${item.label}:` : ''" :label="item.label ? `${item.label}:` : ''"
...@@ -32,14 +32,24 @@ ...@@ -32,14 +32,24 @@
:prop="`groundingGoodsList[${eleIndex}][${item.name}]`" :prop="`groundingGoodsList[${eleIndex}][${item.name}]`"
:rules="rules[item.name]" :rules="rules[item.name]"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"> :style="{ 'margin-bottom': !item.type ? '0px' : '22px' }">
<el-radio-group v-model="ele[item.name]"> <el-select v-model="ele[item.name]"
filterable
:placeholder="`请选择${item.label}`"
:style="{ width: item.width || formItemWidth }"
@change="selectAddAttr($event, item)">
<el-option v-for="subItem in positionTypeList"
:key="subItem.position"
:label="subItem.confName"
:value="subItem.position" />
</el-select>
<!-- <el-radio-group v-model="ele[item.name]">
<el-radio v-for="(subItem, subIndex) in positionTypeList" <el-radio v-for="(subItem, subIndex) in positionTypeList"
:key="subIndex" :key="subIndex"
:label="subItem.position"> :label="subItem.position">
{{ {{
subItem.confName }} subItem.confName }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group> -->
</el-form-item> </el-form-item>
</div> </div>
<div v-if="item.type === 'radio' && item.index && (ele.goodsType == 1 || (formData.baseSceneCode && this.filterBaseSceneCodeBySceneType(3).includes(formData.baseSceneCode)))"> <div v-if="item.type === 'radio' && item.index && (ele.goodsType == 1 || (formData.baseSceneCode && this.filterBaseSceneCodeBySceneType(3).includes(formData.baseSceneCode)))">
......
...@@ -214,7 +214,7 @@ export default { ...@@ -214,7 +214,7 @@ export default {
}), }),
initData() { initData() {
// 获取业务场景数据 // 获取业务场景数据
getBaseSceneCodeList({}).then((res) => { getBaseSceneCodeList({status: 1}).then((res) => {
this.sceneCodeList = res || []; this.sceneCodeList = res || [];
this.getBaseData(); this.getBaseData();
const id = this.$route.query.id; const id = this.$route.query.id;
......
...@@ -496,7 +496,7 @@ export default { ...@@ -496,7 +496,7 @@ export default {
}); });
}, },
getBaseCodeList() { getBaseCodeList() {
getBaseSceneCodeList({}).then(res => { getBaseSceneCodeList({status: 1}).then(res => {
this.baseData.baseSceneList = res || [] this.baseData.baseSceneList = res || []
this.getOptionsList() this.getOptionsList()
}) })
......
...@@ -89,14 +89,9 @@ ...@@ -89,14 +89,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="第三方订单号" prop="thirdOrderCode" width="150" /> <el-table-column align="center" label="第三方订单号" prop="thirdOrderCode" width="150" />
<el-table-column align="center" label="所属业务" prop="customerSex"> <el-table-column align="center" label="展业场景" prop="baseSceneCode" width="140">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.businessType"> <span>{{ rightsSceneDisplay(scope.row) }}</span>
{{
scope.row.businessType == "2" ? "延保" : "权益"
}}
</span>
<span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="交易参考号" prop="tradeNo" width="150" /> <el-table-column align="center" label="交易参考号" prop="tradeNo" width="150" />
...@@ -491,7 +486,7 @@ import ruleInfoDialog from "./ruleInfoDialog"; ...@@ -491,7 +486,7 @@ import ruleInfoDialog from "./ruleInfoDialog";
export default { export default {
name: "CarDamage", name: "CarDamage",
props: { props: {
/** 订单列表两层导航:权益类子项默认「所属业务」;all=不选、与旧 tab4 一致 */ /** 订单列表两层导航:权益类子项预设 businessType;all=不选、与旧 tab4 一致 */
rightsNavPreset: { rightsNavPreset: {
type: String, type: String,
default: "" default: ""
...@@ -501,7 +496,7 @@ export default { ...@@ -501,7 +496,7 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
/** 业务类型(场景维度),传入 ordermanage 的 businessType,与搜索项「所属业务」并存时以本字段为准 */ /** 业务类型(场景维度),传入 ordermanage 的 businessType;设置时优先于 searchForm.businessType */
sceneBusinessType: { sceneBusinessType: {
type: [Number, String], type: [Number, String],
default: undefined, default: undefined,
...@@ -748,16 +743,7 @@ export default { ...@@ -748,16 +743,7 @@ export default {
keyFn: this.keyDowmGetList, keyFn: this.keyDowmGetList,
}, },
{ {
label: "所属业务", label: "展业场景",
name: "businessType",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "businessTypeList",
},
{
label: "场景",
name: "listSceneBaseCode", name: "listSceneBaseCode",
addHtml: "rightsSceneSelect", addHtml: "rightsSceneSelect",
isHide: true isHide: true
...@@ -997,16 +983,6 @@ export default { ...@@ -997,16 +983,6 @@ export default {
confLabel: "挂单", confLabel: "挂单",
}, },
], ],
businessTypeList: [
{
confId: "1",
confLabel: "权益",
},
{
confId: "2",
confLabel: "延保",
},
],
provinceInfoList: [], provinceInfoList: [],
invoiceStatusList: [ invoiceStatusList: [
{ {
...@@ -1217,6 +1193,20 @@ export default { ...@@ -1217,6 +1193,20 @@ export default {
if (!opt) return "-" if (!opt) return "-"
return opt.name || opt.subTypeName || opt.num || opt.baseSceneCode || "-" return opt.name || opt.subTypeName || opt.num || opt.baseSceneCode || "-"
}, },
/** 列表展示:与「展业场景」筛选项同一套数据源与文案(rightsSceneRowLabel) */
rightsSceneDisplay(row) {
if (row == null) return "-"
const key = String(row.baseSceneCode == null ? "" : row.baseSceneCode).trim()
if (key) {
const list = this.rightsSceneListForSearch || []
const opt = list.find((s) => String((s && s.baseSceneCode) || "").trim() === key)
if (opt) return this.rightsSceneRowLabel(opt)
return key
}
const nm = row.baseSceneName != null ? row.baseSceneName : row.sceneName
if (nm != null && String(nm).trim() !== "") return String(nm).trim()
return "-"
},
/** 客户来源:0 门店引流-售前 / 1 门店引流-售后 / 2 自然到店 */ /** 客户来源:0 门店引流-售前 / 1 门店引流-售后 / 2 自然到店 */
getSalesTypeLabel(v) { getSalesTypeLabel(v) {
if (v === null || v === undefined || v === "") return "-"; if (v === null || v === undefined || v === "") return "-";
......
...@@ -117,8 +117,10 @@ ...@@ -117,8 +117,10 @@
v-for="(u, k) in detailForm.photos" v-for="(u, k) in detailForm.photos"
:key="'ph' + k" :key="'ph' + k"
class="photo-row__item" class="photo-row__item"
:src="u"
fit="cover" fit="cover"
:src="u"
:preview-src-list="detailForm.photos || []"
:initial-index="k"
/> />
</div> </div>
</section> </section>
...@@ -374,6 +376,7 @@ export default { ...@@ -374,6 +376,7 @@ export default {
width: 120px; width: 120px;
height: 90px; height: 90px;
border-radius: 4px; border-radius: 4px;
cursor: pointer;
} }
.footer_box { .footer_box {
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
<auth-button :show-btn-ids="['9041101']" category="Button" /> <auth-button :show-btn-ids="['9041101']" category="Button" />
</div> </div>
<d2-table ref="constructionTable" :has-num="true" :search-form="tableSearchForm" :table-params="tableParams" <d2-table ref="constructionTable" :has-num="true" :search-form="tableSearchForm" :table-params="tableParams"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn"> :get-list-api="getListApi" :before-search-fn="beforeSearchFn"
<div slot="technicianCol" slot-scope="{ scope: row }" class="cell-multiline"> @apiFinish="handleConstructionTableApiFinish">
<div slot="technicianCol" slot-scope="{ scope: row }" class="cell-multiline cell-multiline--pre">
{{ row.technicianText || '-' }} {{ row.technicianText || '-' }}
</div> </div>
<div slot="serviceItemsCol" slot-scope="{ scope: row }" class="cell-stacked"> <div slot="serviceItemsCol" slot-scope="{ scope: row }" class="cell-stacked">
...@@ -67,12 +68,16 @@ ...@@ -67,12 +68,16 @@
class="thumb-cell__row" class="thumb-cell__row"
> >
<el-image <el-image
v-for="(url, i) in row.constructionPhotoUrls"
:key="'p' + (row._rowKey || 'r') + '-' + i"
class="thumb-cell__img" class="thumb-cell__img"
:src="url" lazy
:src="row.constructionPhotoUrls[0]"
fit="cover" fit="cover"
:preview-src-list="row.constructionPhotoUrls"
/> />
<span
v-if="row.constructionPhotoUrls.length > 1"
class="thumb-cell__more"
>(等{{ row.constructionPhotoUrls.length - 1 }}个图片)</span>
</div> </div>
<span v-else>-</span> <span v-else>-</span>
</div> </div>
...@@ -143,6 +148,8 @@ export default { ...@@ -143,6 +148,8 @@ export default {
tableSearchForm: {}, tableSearchForm: {},
tableParams: { tableParams: {
listName: 'list', listName: 'list',
// 稳定 el-table ref 为 constructionMutiTable,便于列表加载后 doLayout 修复横向滚动
mutiSelectName: 'construction',
btnId: `construction_order_${new Date().getTime() + parseInt(String(Math.random() * 1000), 10)}`, btnId: `construction_order_${new Date().getTime() + parseInt(String(Math.random() * 1000), 10)}`,
tableOption: { tableOption: {
width: '100', width: '100',
...@@ -301,6 +308,19 @@ export default { ...@@ -301,6 +308,19 @@ export default {
this.$refs.constructionTable.refreshTable(true, true) this.$refs.constructionTable.refreshTable(true, true)
} }
}, },
/** 宽表 + 固定操作列在数据/图片布局稳定后需重算,避免横向滚动条初始化拖不动 */
handleConstructionTableApiFinish() {
const d2 = this.$refs.constructionTable
if (!d2 || !d2.$refs) return
const elTable = d2.$refs.constructionMutiTable
if (!elTable || typeof elTable.doLayout !== 'function') return
this.$nextTick(() => {
elTable.doLayout()
requestAnimationFrame(() => {
elTable.doLayout()
})
})
},
handleExport() { handleExport() {
const t = this.$refs.constructionTable const t = this.$refs.constructionTable
const p = t && t.page ? t.page : {} const p = t && t.page ? t.page : {}
...@@ -447,12 +467,11 @@ export default { ...@@ -447,12 +467,11 @@ export default {
{ label: '施工单编号', prop: 'constructionCode', minWidth: 190, showOverFlow: true, ...center }, { label: '施工单编号', prop: 'constructionCode', minWidth: 190, showOverFlow: true, ...center },
{ label: '门店名称', prop: 'storeName', minWidth: 200, showOverFlow: true, ...center }, { label: '门店名称', prop: 'storeName', minWidth: 200, showOverFlow: true, ...center },
{ label: '技师姓名', prop: 'technicianText', minWidth: 160, addHtml: 'technicianCol', ...center }, { label: '技师姓名', prop: 'technicianText', minWidth: 160, addHtml: 'technicianCol', ...center },
{ label: '主订单编号', prop: 'mainOrderText', minWidth: 150, showOverFlow: true, ...center }, { label: '服务项目', prop: 'serviceLines', minWidth: 120, addHtml: 'serviceItemsCol', ...center },
{ label: '关联主订单编号', prop: 'mainOrderText', minWidth: 150, showOverFlow: true, ...center },
{ label: '客户车型', prop: 'carTypeName', minWidth: 120, ...center }, { label: '客户车型', prop: 'carTypeName', minWidth: 120, ...center },
{ label: '转化人员', prop: 'sellerNameText', minWidth: 100, ...center }, { label: '转化人员', prop: 'sellerNameText', minWidth: 100, ...center },
{ label: '服务项目', prop: 'serviceLines', minWidth: 120, addHtml: 'serviceItemsCol', ...center }, { label: '关联子订单编号', prop: 'subOrderCode', minWidth: 150, addHtml: 'subOrderCodeCol', ...center },
{ label: '实际出库数量(米/件)', prop: 'actualOutLines', minWidth: 140, addHtml: 'actualOutCol', ...center },
{ label: '子订单编号', prop: 'subOrderCode', minWidth: 150, addHtml: 'subOrderCodeCol', ...center },
{ label: '子商品名称', prop: 'subProductName', minWidth: 140, addHtml: 'subProductCol', ...center }, { label: '子商品名称', prop: 'subProductName', minWidth: 140, addHtml: 'subProductCol', ...center },
{ label: '物料编码', prop: 'materialCode', minWidth: 150, addHtml: 'materialCodeCol', ...center }, { label: '物料编码', prop: 'materialCode', minWidth: 150, addHtml: 'materialCodeCol', ...center },
{ label: '施工状态', prop: 'constructionStatusVal', minWidth: 120, addHtml: 'constructionStatusCol', ...center }, { label: '施工状态', prop: 'constructionStatusVal', minWidth: 120, addHtml: 'constructionStatusCol', ...center },
...@@ -460,7 +479,8 @@ export default { ...@@ -460,7 +479,8 @@ export default {
{ label: '派单时间', prop: 'dispatchTimeText', minWidth: 160, ...center }, { label: '派单时间', prop: 'dispatchTimeText', minWidth: 160, ...center },
{ label: '领单时间', prop: 'receiptTimeText', minWidth: 160, ...center }, { label: '领单时间', prop: 'receiptTimeText', minWidth: 160, ...center },
{ label: '完工时间', prop: 'completionTimeText', minWidth: 160, ...center }, { label: '完工时间', prop: 'completionTimeText', minWidth: 160, ...center },
{ label: '施工图片', prop: 'constructionPhotoUrl', minWidth: 120, addHtml: 'constructionPhotoCol', ...center } { label: '施工图片', prop: 'constructionPhotoUrl', minWidth: 140, addHtml: 'constructionPhotoCol', ...center },
{ label: '实际出库数量(米/件)', prop: 'actualOutLines', minWidth: 140, addHtml: 'actualOutCol', ...center }
] ]
} }
} }
...@@ -498,6 +518,10 @@ export default { ...@@ -498,6 +518,10 @@ export default {
text-align: center; text-align: center;
} }
.cell-multiline--pre {
white-space: pre-line;
}
.cell-stacked { .cell-stacked {
padding: 4px 0; padding: 4px 0;
text-align: center; text-align: center;
...@@ -527,7 +551,15 @@ export default { ...@@ -527,7 +551,15 @@ export default {
gap: 4px; gap: 4px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
max-width: 200px; max-width: 260px;
}
&__more {
font-size: 12px;
color: #606266;
line-height: 1.4;
text-align: left;
max-width: 120px;
} }
&__img { &__img {
......
...@@ -57,46 +57,35 @@ function formatTechnicianText(row) { ...@@ -57,46 +57,35 @@ function formatTechnicianText(row) {
const subs = row.subTechnicianList || [] const subs = row.subTechnicianList || []
const parts = [] const parts = []
mains.forEach((t) => { mains.forEach((t) => {
if (t && t.technicianName) parts.push(`${t.technicianName} (主)`) if (t && t.technicianName) parts.push(`${t.technicianName}(主)`)
}) })
subs.forEach((t) => { subs.forEach((t) => {
if (t && t.technicianName) parts.push(`${t.technicianName} (副)`) if (t && t.technicianName) parts.push(`${t.technicianName}(副)`)
}) })
return parts.length ? parts.join(' / ') : '-' return parts.length ? parts.join('\n') : '-'
} }
function serviceItemLinesForTable(row) { /** 服务项目行与实际出库行同源、同序(与有名称的服务明细一一对应) */
// 仅接口字段 serviceItemsDetailList[].serviceItemsName function serviceItemsAndOutboundLinesForTable(row) {
const fromDetail = (row.serviceItemsDetailList || []) const serviceLines = []
.filter((d) => d) const actualOutLines = []
.map((d) => {
const n = d.serviceItemsName
if (n == null || String(n).trim() === '') return null
return { name: String(n).trim() }
})
.filter(Boolean)
return fromDetail.length ? fromDetail : [{ name: '-' }]
}
/** 实际用量展示:子订单产品实际用料 或 服务明细 useNum+标准 */
function outboundLinesForTable(row) {
const subs = row.subOrderList || []
if (subs.length) {
return subs.map((s) => {
if (!s) return '-'
if (s.materialsUsed != null && s.materialsUsed !== '') return String(s.materialsUsed)
if (s.number != null) return `${s.number} 件`
return '-'
})
}
const out = []
;(row.serviceItemsDetailList || []).forEach((d) => { ;(row.serviceItemsDetailList || []).forEach((d) => {
if (!d) return if (!d) return
const n = d.useNum != null ? d.useNum : '' const n = d.serviceItemsName
const m = d.materialStandard != null ? d.materialStandard : '' if (n == null || String(n).trim() === '') return
if (n !== '' || m !== '') out.push([n, m].filter(Boolean).join(' / ')) serviceLines.push({ name: String(n).trim() })
if (d.useNum != null && d.useNum !== '') {
const num = Number(d.useNum)
const formatted = Number.isFinite(num) ? num.toFixed(2) : String(d.useNum).trim()
actualOutLines.push(`${formatted}米/件`)
} else {
actualOutLines.push('-')
}
}) })
return out.length ? out : ['-'] if (!serviceLines.length) {
return { serviceLines: [{ name: '-' }], actualOutLines: ['-'] }
}
return { serviceLines, actualOutLines }
} }
/** /**
...@@ -114,6 +103,7 @@ export function mapConstructionListRow(row, index) { ...@@ -114,6 +103,7 @@ export function mapConstructionListRow(row, index) {
const pictureUrl = constructionPhotoUrls[0] || '' const pictureUrl = constructionPhotoUrls[0] || ''
const cst = toIntOrNull(row.constructionStatus) const cst = toIntOrNull(row.constructionStatus)
const ist = toIntOrNull(row.constructionInnerStatus) const ist = toIntOrNull(row.constructionInnerStatus)
const { serviceLines, actualOutLines } = serviceItemsAndOutboundLinesForTable(row)
return { return {
...row, ...row,
_rowKey: row.id != null ? row.id : (row.constructionCode || `idx-${index}`), _rowKey: row.id != null ? row.id : (row.constructionCode || `idx-${index}`),
...@@ -122,8 +112,8 @@ export function mapConstructionListRow(row, index) { ...@@ -122,8 +112,8 @@ export function mapConstructionListRow(row, index) {
mainOrderText: row.orderCode || '-', mainOrderText: row.orderCode || '-',
carTypeName: formatConstructionCarModel(row), carTypeName: formatConstructionCarModel(row),
sellerNameText: row.sellerName || '-', sellerNameText: row.sellerName || '-',
serviceLines: serviceItemLinesForTable(row), serviceLines,
actualOutLines: outboundLinesForTable(row), actualOutLines,
subOrderListForView: subList, subOrderListForView: subList,
constructionStatusText: cst != null && CONSTRUCTION_STATUS_TEXT[cst] != null constructionStatusText: cst != null && CONSTRUCTION_STATUS_TEXT[cst] != null
? CONSTRUCTION_STATUS_TEXT[cst] : (cst != null ? String(cst) : '-'), ? CONSTRUCTION_STATUS_TEXT[cst] : (cst != null ? String(cst) : '-'),
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
size="small" size="small"
:rules="rules" :rules="rules"
> >
<template v-if="loadingComplete">
<template v-for="(item, index) in templateInfo"> <template v-for="(item, index) in templateInfo">
<el-form-item <el-form-item
:key="index" :key="index"
...@@ -139,10 +140,10 @@ ...@@ -139,10 +140,10 @@
</template> </template>
<el-form-item <el-form-item
label="业务场景:" label="业务场景:"
prop="sceneType" prop="baseSceneCode"
> >
<el-select <el-select
v-model="infoForm.sceneType" v-model="infoForm.baseSceneCode"
clearable clearable
:disabled="shelfTypeDisabled" :disabled="shelfTypeDisabled"
placeholder="请选择" placeholder="请选择"
...@@ -150,9 +151,9 @@ ...@@ -150,9 +151,9 @@
> >
<el-option <el-option
v-for="(subItem, index) in options.sceneTypeOpts" v-for="(subItem, index) in options.sceneTypeOpts"
:key="`sceneType-${index}`" :key="`baseSceneCode-${index}`"
:label="subItem.name" :label="subItem.name"
:value="subItem.sceneType" :value="subItem.baseSceneCode"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -192,6 +193,8 @@ ...@@ -192,6 +193,8 @@
:multiple="false" :multiple="false"
:collapse-tags="false" :collapse-tags="false"
@change="handleMerchantChange" @change="handleMerchantChange"
ref="remoteSelectRef"
:defaultValue="defaultValue"
> >
<template #options="{ row }"> <template #options="{ row }">
<div class="tab-select-options-wrapper"> <div class="tab-select-options-wrapper">
...@@ -258,6 +261,7 @@ ...@@ -258,6 +261,7 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
</template>
</el-form> </el-form>
</div> </div>
</div> </div>
...@@ -290,6 +294,10 @@ export default { ...@@ -290,6 +294,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
pageType: {
type: String,
default: ''
},
}, },
data () { data () {
return { return {
...@@ -298,22 +306,25 @@ export default { ...@@ -298,22 +306,25 @@ export default {
fileInfo: "", // 门店上架表文件信息 fileInfo: "", // 门店上架表文件信息
merchantId: "", // 4s店商户号, merchantId: "", // 4s店商户号,
shelfType: 1, // 上架类型:1-单店模式 2-项目制批量上架 shelfType: 1, // 上架类型:1-单店模式 2-项目制批量上架
sceneType: 1, sceneType: '',
baseSceneCode: '' baseSceneCode: ''
}, },
defaultValue: {},
uploadKey: Date.now(), uploadKey: Date.now(),
options: { options: {
merchant: [], merchant: [],
shelfType: shelfTypeOpt, shelfType: shelfTypeOpt,
sceneTypeOpts: [] sceneTypeOpts: []
}, },
loadingComplete: false,
} }
}, },
watch: { watch: {
'infoForm.sceneType': { 'infoForm.baseSceneCode': {
handler (val) { handler (val) {
if (this.options.sceneTypeOpts && this.options.sceneTypeOpts.length) { if (this.options.sceneTypeOpts && this.options.sceneTypeOpts.length) {
this.infoForm.baseSceneCode = this.options.sceneTypeOpts.find(item => item.sceneType == val)?.baseSceneCode || '' let item = this.options.sceneTypeOpts.find(item => item.baseSceneCode == val)
if (item) this.infoForm.sceneType = item.sceneType
} }
}, },
immediate: true, immediate: true,
...@@ -326,6 +337,7 @@ export default { ...@@ -326,6 +337,7 @@ export default {
this.GlOssApi = new GlOssApi({ this.GlOssApi = new GlOssApi({
baseConfig, baseConfig,
}); });
if (this.pageType != 'reapply') this.loadingComplete = true
} }
}, },
immediate: true, immediate: true,
...@@ -336,7 +348,7 @@ export default { ...@@ -336,7 +348,7 @@ export default {
rules () { rules () {
let { templateInfo } = this, let { templateInfo } = this,
rules = { rules = {
sceneType: [ baseSceneCode: [
{ required: true, message: "请选择业务场景", trigger: "change" }, { required: true, message: "请选择业务场景", trigger: "change" },
], ],
shelfType: [ shelfType: [
...@@ -387,7 +399,7 @@ export default { ...@@ -387,7 +399,7 @@ export default {
return this.$refs.formRef return this.$refs.formRef
}, },
sceneTypeName () { sceneTypeName () {
return this.options.sceneTypeOpts.find(item => item.sceneType == this.infoForm.sceneType)?.name || '' return this.options.sceneTypeOpts.find(item => item.baseSceneCode == this.infoForm.baseSceneCode)?.name || ''
} }
}, },
mounted () { mounted () {
...@@ -398,15 +410,21 @@ export default { ...@@ -398,15 +410,21 @@ export default {
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
...mapActions({ close: "d2admin/page/close" }), ...mapActions({ close: "d2admin/page/close" }),
init (data) { init (data) {
console.log(data)
this.infoForm = { this.infoForm = {
...this.infoForm, ...this.infoForm,
...data, ...data,
} }
this.defaultValue = {
label: data.merchantName,
value: data.merchantId,
}
this.loadingComplete = true
}, },
/**获取场景 */
async getStaffSceneLabelList () { async getStaffSceneLabelList () {
const res = await this.fetchStaffSceneLabelList({ params: { status: 1 } }); const res = await this.fetchStaffSceneLabelList({ params: { status: 1 }, forceRefresh: true });
this.options.sceneTypeOpts = res; this.options.sceneTypeOpts = res;
if (!this.infoForm.baseSceneCode) this.infoForm.baseSceneCode = res[0]?.baseSceneCode
}, },
handleFileChange (file, fileList, targetItem) { handleFileChange (file, fileList, targetItem) {
// return false // return false
...@@ -468,12 +486,24 @@ export default { ...@@ -468,12 +486,24 @@ export default {
1: '门店上架模版-单店模式', 1: '门店上架模版-单店模式',
2: '门店上架模版-项目制批量上架' 2: '门店上架模版-项目制批量上架'
}[shelfType] }[shelfType]
const url = `https://img02.glsx.com.cn/weapp/resource/saas/xlsx/${name}.xlsx`;
// 检测是否为苹果设备
const isAppleDevice = /iPad|iPhone|iPod|Mac/.test(navigator.userAgent) && !window.MSStream;
if (isAppleDevice) {
// 对于苹果设备,使用新窗口打开
window.open(url, '_blank');
} else {
// 非苹果设备使用 download 属性
const link = document.createElement("a"); const link = document.createElement("a");
link.href = `https://img02.glsx.com.cn/weapp/resource/saas/xlsx/${name}.xlsx` link.href = url;
link.download = `${name}.xlsx`;
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
window.URL.revokeObjectURL(link.href); }
}, },
handleOnExceed (files, fileList) { handleOnExceed (files, fileList) {
this.$message({ this.$message({
...@@ -593,7 +623,7 @@ export default { ...@@ -593,7 +623,7 @@ export default {
this.infoForm[controlId] = filtered; this.infoForm[controlId] = filtered;
}, },
handleMerchantChange (merchantNo) { handleMerchantChange (merchantNo) {
const merchant = this.options.merchant.find(item => item.merchantNo === merchantNo); const merchant = this.options.merchant.find(item => item.merchantNo == merchantNo);
if (merchant) { if (merchant) {
this.infoForm.merchantName = merchant.merchantName; this.infoForm.merchantName = merchant.merchantName;
} }
......
...@@ -76,7 +76,6 @@ export default { ...@@ -76,7 +76,6 @@ export default {
{ formList, data } = this { formList, data } = this
str = data[i.controlId] || i.value str = data[i.controlId] || i.value
if (str) { if (str) {
if (i.inputType == 4) str += '元'
if (i.inputType == 5) str = i.options.find(e => e.key == str).value if (i.inputType == 5) str = i.options.find(e => e.key == str).value
if (i.inputType == 6) { if (i.inputType == 6) {
let multipleStr = [] let multipleStr = []
...@@ -118,11 +117,18 @@ export default { ...@@ -118,11 +117,18 @@ export default {
} else { } else {
link.href = i.fileUrl; link.href = i.fileUrl;
} }
const isAppleDevice = /iPad|iPhone|iPod|Mac/.test(navigator.userAgent) && !window.MSStream;
if (isAppleDevice) {
// 对于苹果设备,使用新窗口打开
window.open(i.fileUrl, '_blank');
} else {
// 非苹果设备使用 download 属性
link.download = i.fileName; link.download = i.fileName;
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
window.URL.revokeObjectURL(link.href); }
} else { } else {
this.$message.warning("文件地址无效"); this.$message.warning("文件地址无效");
} }
......
...@@ -133,8 +133,10 @@ export default { ...@@ -133,8 +133,10 @@ export default {
this.salesCategoryDetailVisible = false this.salesCategoryDetailVisible = false
} else { } else {
this.$emit('add', data) this.$emit('add', data)
this.salesCategoryDetailVisible = false
} }
},
closeDetail () {
this.salesCategoryDetailVisible = false
} }
} }
} }
......
...@@ -197,6 +197,10 @@ export default { ...@@ -197,6 +197,10 @@ export default {
updateTrafficProviderInformation (data) { updateTrafficProviderInformation (data) {
let { trafficPartyId } = this, let { trafficPartyId } = this,
index = this.infoForm.trafficPartyDetails.findIndex(item => item.trafficPartyId == trafficPartyId) index = this.infoForm.trafficPartyDetails.findIndex(item => item.trafficPartyId == trafficPartyId)
console.log(data.areaOpIdList)
data.areaOpId = data.areaOpIdList.join('/')
data.onlineOpId = data.onlineOpIdList.join('/')
data.regionSupervisorId = data.regionSupervisorIdList.join('/')
this.$set(this.infoForm.trafficPartyDetails, index, data) this.$set(this.infoForm.trafficPartyDetails, index, data)
}, },
deleteSalesCategoryData (data) { deleteSalesCategoryData (data) {
...@@ -225,6 +229,7 @@ export default { ...@@ -225,6 +229,7 @@ export default {
}) })
let trafficPartyDetails = this.infoForm.trafficPartyDetails.find(item => item.trafficPartyId == this.trafficPartyId) let trafficPartyDetails = this.infoForm.trafficPartyDetails.find(item => item.trafficPartyId == this.trafficPartyId)
trafficPartyDetails.productDetails.push(data) trafficPartyDetails.productDetails.push(data)
this.salesCategoryRef.closeDetail()
} catch (error) { } catch (error) {
this.$message.error(error.message) this.$message.error(error.message)
} }
...@@ -240,6 +245,7 @@ export default { ...@@ -240,6 +245,7 @@ export default {
trafficProviderInformationRef.formRef.validate((valid) => { trafficProviderInformationRef.formRef.validate((valid) => {
if (valid) { if (valid) {
let componentData = deepClone(trafficProviderInformationRef.componentData) let componentData = deepClone(trafficProviderInformationRef.componentData)
console.log(componentData.areaOpIdList)
componentData.areaOpId = componentData.areaOpIdList.join(',') componentData.areaOpId = componentData.areaOpIdList.join(',')
componentData.onlineOpId = componentData.onlineOpIdList.join(',') componentData.onlineOpId = componentData.onlineOpIdList.join(',')
componentData.regionSupervisorId = componentData.regionSupervisorIdList.join(',') componentData.regionSupervisorId = componentData.regionSupervisorIdList.join(',')
...@@ -259,7 +265,10 @@ export default { ...@@ -259,7 +265,10 @@ export default {
const businessValidation = new Promise((resolve) => { const businessValidation = new Promise((resolve) => {
businessInformationRef.formRef.validate((valid) => { businessInformationRef.formRef.validate((valid) => {
if (valid) { if (valid) {
let { djGpr, djGrossProfit } = businessInformationRef
let componentData = deepClone(businessInformationRef.componentData) let componentData = deepClone(businessInformationRef.componentData)
componentData.djGpr = djGpr.split('%')[0]
componentData.djGrossProfit = djGrossProfit
businessValidationData = componentData businessValidationData = componentData
} }
resolve(valid) resolve(valid)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
:templateInfo="templateInfo" :templateInfo="templateInfo"
:shelfTypeDisabled="shelfTypeDisabled" :shelfTypeDisabled="shelfTypeDisabled"
:show="step == 1" :show="step == 1"
:pageType="pageType"
></step-one> ></step-one>
</div> </div>
<div :class="['detail',{show:step == 2}]"> <div :class="['detail',{show:step == 2}]">
...@@ -380,13 +381,21 @@ export default { ...@@ -380,13 +381,21 @@ export default {
this.updateStatus = false this.updateStatus = false
}, },
downloadError () { downloadError () {
// 检测是否为苹果设备
const isAppleDevice = /iPad|iPhone|iPod|Mac/.test(navigator.userAgent) && !window.MSStream;
const url = this.errorFileUrl
if (isAppleDevice) {
// 对于苹果设备,使用新窗口打开
window.open(url, '_blank');
} else {
// 非苹果设备使用 download 属性
const link = document.createElement("a"); const link = document.createElement("a");
link.href = this.errorFileUrl link.href = url;
link.download = '失败模板'; link.download = `失败模版.xlsx`;
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
window.URL.revokeObjectURL(link.href); }
} }
} }
} }
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
<div class="section-body"> <div class="section-body">
<div class="risk-alert"> <div class="risk-alert">
<i class="el-icon-warning risk-icon"></i> <i class="el-icon-warning risk-icon"></i>
<span class="risk-text">{{ detailInfo.hitRuleTypeName || '-' }}</span> <span class="risk-text">{{ detailInfo.hitRuleTypeName ? handleReplace(detailInfo.hitRuleTypeName) : '-' }}
</span>
</div> </div>
</div> </div>
...@@ -93,10 +94,11 @@ export default { ...@@ -93,10 +94,11 @@ export default {
showFormData: [ showFormData: [
{ {
label: '门店名称', label: '门店名称',
name: 'storeName', name: 'shopMerchantName',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle txtStyle: contentStyle,
}, },
{ {
label: '业务类型', label: '业务类型',
...@@ -104,6 +106,9 @@ export default { ...@@ -104,6 +106,9 @@ export default {
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle,
formatter: (cellValue) => {
return cellValue.businessTypes ? (cellValue.businessTypes.split(',') || []).map(item => busTypeOpt.find(opt => opt.confId === item).confLabel).join(',') : '-'
}
}, },
{ {
label: '合作模式', label: '合作模式',
...@@ -131,10 +136,7 @@ export default { ...@@ -131,10 +136,7 @@ export default {
name: 'areaName', name: 'areaName',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle
formatter: (cellValue) => {
return (cellValue.areaName || '') + (cellValue.city || '') + (cellValue.districtName || '') || '-'
}
}, },
{ {
label: '详细地址', label: '详细地址',
...@@ -149,7 +151,6 @@ export default { ...@@ -149,7 +151,6 @@ export default {
computed: { computed: {
visible: { visible: {
get() { get() {
return this.dialogVisible return this.dialogVisible
}, },
set(val) { set(val) {
...@@ -158,6 +159,7 @@ export default { ...@@ -158,6 +159,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.loading = true
if (this.visible) { if (this.visible) {
this.getDetail() this.getDetail()
this.closeStoreOperateLogList() this.closeStoreOperateLogList()
...@@ -165,18 +167,20 @@ export default { ...@@ -165,18 +167,20 @@ export default {
}, },
methods: { methods: {
handleReplace(val) {
return val.replace(/[\n]/g, ';')
},
handleClose() { handleClose() {
this.visible = false this.visible = false
}, },
getDetail() { getDetail() {
this.loading = true
this.detailInfo = { ...this.recordInfo }
closeStoreDetail({ id: this.recordInfo.id }).then(res => { closeStoreDetail({ id: this.recordInfo.id }).then(res => {
this.loading = false this.loading = false
if (res) { if (res) {
this.detailInfo = { ...this.detailInfo, ...res } this.detailInfo = res
console.log(this.detailInfo)
} }
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
...@@ -266,13 +270,15 @@ export default { ...@@ -266,13 +270,15 @@ export default {
.risk-icon { .risk-icon {
color: #ff9900; color: #ff9900;
font-size: 20px; font-size: 24px;
margin-right: 10px; margin-right: 10px;
} }
.risk-text { .risk-text {
color: #333; color: #333;
font-size: 14px; font-size: 14px;
white-space: pre-wrap;
word-break: break-all;
} }
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div style="position: absolute; right: 0; top: 0;"> <div style="position: absolute; right: 0; top: 0;">
<el-button type="primary" size="small">导出</el-button> <auth-button :show-btn-ids="['9210501']" label="导出" />
</div> </div>
</div> </div>
<d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch" <d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch"
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
signedDate: [], signedDate: [],
expectedOperationDate: [], expectedOperationDate: [],
closeDate: [], closeDate: [],
merchantName: '', shopMerchantName: '',
relatedMerchantName: '' relatedMerchantName: ''
}, },
searchFormSearch: {}, searchFormSearch: {},
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
isClear: true isClear: true
}, { }, {
label: '门店名称', label: '门店名称',
name: 'merchantName', name: 'shopMerchantName',
type: 'input', type: 'input',
maxlength: '50', maxlength: '50',
isClear: true isClear: true
...@@ -188,7 +188,6 @@ export default { ...@@ -188,7 +188,6 @@ export default {
label: '展业时间', label: '展业时间',
name: 'expectedOperationDate', name: 'expectedOperationDate',
type: 'datePicker', type: 'datePicker',
pickerOptions: 'rangePickerOptions',
isClear: true isClear: true
}, { }, {
label: '关店时间', label: '关店时间',
...@@ -218,7 +217,7 @@ export default { ...@@ -218,7 +217,7 @@ export default {
width: '100px' width: '100px'
}, { }, {
label: '门店名称', label: '门店名称',
prop: 'storeName', prop: 'shopMerchantName',
width: '140px' width: '140px'
}, { }, {
label: '归属人', label: '归属人',
...@@ -242,7 +241,10 @@ export default { ...@@ -242,7 +241,10 @@ export default {
}, { }, {
label: '业务类型', label: '业务类型',
prop: 'businessTypes', prop: 'businessTypes',
width: '150px' width: '150px',
formatter: (cellValue) => {
return cellValue.businessTypes ? cellValue.businessTypes.split(',').map(item => this.baseData.busTypeOpt.find(opt => opt.confId == item)?.confLabel || '').join(',') : '-'
}
}, { }, {
label: '合作模式', label: '合作模式',
prop: 'cooperationModeName' prop: 'cooperationModeName'
...@@ -339,7 +341,7 @@ export default { ...@@ -339,7 +341,7 @@ export default {
}) })
// 业务类型 // 业务类型
if (params.businessTypeList && params.businessTypeList.length) { if (params.businessTypeList && params.businessTypeList.length) {
params.businessType = params.businessTypeList.join(',') params.businessTypes = params.businessTypeList.join(',')
} }
delete params.businessTypeList delete params.businessTypeList
...@@ -383,7 +385,7 @@ export default { ...@@ -383,7 +385,7 @@ export default {
businessTypeList: [], businessTypeList: [],
cooperationMode: '', cooperationMode: '',
subBrandId: '', subBrandId: '',
merchantName: '', shopMerchantName: '',
salesPersonId: '', salesPersonId: '',
signedDate: [], signedDate: [],
expectedOperationDate: [], expectedOperationDate: [],
......
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
:submit-api="infoVerifySubmit" :merchant-type-labels="['4S店']" dialog-title="信息核验" dialog-width="1080px" :submit-api="infoVerifySubmit" :merchant-type-labels="['4S店']" dialog-title="信息核验" dialog-width="1080px"
@success="handleSearch"> @success="handleSearch">
<template #storeDetail="{ customerRow }"> <template #storeDetail="{ customerRow }">
<potential-customer-store-detail-section v-if="customerRow && customerRow.id != null" <potential-customer-store-detail-section v-if="customerRow && customerRow.id != null" :record-id="customerRow.id"
:record-id="customerRow.id" :show-visit-record="false" :show-section-title="true" /> :show-visit-record="false" :show-section-title="true" />
</template> </template>
</info-verify-merchant-dialog> </info-verify-merchant-dialog>
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" <glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" label-width="104px"
label-width="104px" dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData" dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData" :slotArr="slotArr"
:slotArr="slotArr" :base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm"> :base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm">
<template #merchantMutilHtml> <template #merchantMutilHtml>
<el-select v-model="editData[editFormData[1].name]" :placeholder="editFormData[1].placeholder" <el-select v-model="editData[editFormData[1].name]" :placeholder="editFormData[1].placeholder"
@change="editFormData[1].changeAttr" style="width: 274px" filterable remote reserve-keyword @change="editFormData[1].changeAttr" style="width: 274px" filterable remote reserve-keyword
...@@ -110,10 +110,10 @@ export default { ...@@ -110,10 +110,10 @@ export default {
label: '已签约', label: '已签约',
name: "3" name: "3"
}, },
{ // {
label: '已绑定', // label: '已绑定',
name: "4" // name: "4"
}, // },
{ {
label: '未签约', label: '未签约',
name: "2" name: "2"
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
maxlength: '20', maxlength: '20',
isClear: true isClear: true
}, { }, {
label: '商品编号', label: '产品编码',
name: 'productCode', name: 'productCode',
type: 'input', type: 'input',
maxlength: '40', maxlength: '40',
......
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
maxlength: "20", maxlength: "20",
isClear: true, isClear: true,
}, { }, {
label: "商品编号", label: "产品编码",
name: "productCode", name: "productCode",
type: "input", type: "input",
maxlength: "40", maxlength: "40",
......
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
maxlength: "20", maxlength: "20",
isClear: true, isClear: true,
}, { }, {
label: "商品编号", label: "产品编码",
name: "productCode", name: "productCode",
type: "input", type: "input",
maxlength: "40", maxlength: "40",
......
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
maxlength: "20", maxlength: "20",
isClear: true, isClear: true,
}, { }, {
label: "商品编号", label: "产品编码",
name: "productCode", name: "productCode",
type: "input", type: "input",
maxlength: "40", maxlength: "40",
......
...@@ -48,6 +48,23 @@ ...@@ -48,6 +48,23 @@
:disabled="!!scope.scope._statusSwitchLoading" :disabled="!!scope.scope._statusSwitchLoading"
@change="(val) => handleStatusSwitch(val, scope.scope)" /> @change="(val) => handleStatusSwitch(val, scope.scope)" />
</template> </template>
<template #description-cell="slotProps">
<template v-if="getDescriptionText(slotProps.scope)">
<el-tooltip effect="dark"
placement="top"
popper-class="manage-scene-desc-tooltip">
<template #content>
<div class="manage-scene-desc-tooltip__content">
{{ getDescriptionText(slotProps.scope) }}
</div>
</template>
<div class="scene-desc-ellipsis">
{{ getDescriptionText(slotProps.scope) }}
</div>
</el-tooltip>
</template>
<span v-else>-</span>
</template>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
...@@ -118,11 +135,10 @@ export default { ...@@ -118,11 +135,10 @@ export default {
addHtml: "scene-tag", addHtml: "scene-tag",
}, { }, {
label: "描述", label: "描述",
prop: "merchantId", prop: "description",
width: "380", width: "380",
formatter: (cellValue) => { align: "left",
return cellValue?.description || "-"; addHtml: "description-cell",
},
}, { }, {
label: "状态", label: "状态",
prop: "status", prop: "status",
...@@ -205,7 +221,7 @@ export default { ...@@ -205,7 +221,7 @@ export default {
await disableScene({ id: row.id }); await disableScene({ id: row.id });
} }
this.$set(row, "status", val); this.$set(row, "status", val);
this.$message?.success?.(val === 1 ? "已启用" : "已禁用"); this.$message?.success?.(val === 1 ? "操作成功,状态变为【启用】" : "操作成功,状态变为【禁用】");
} catch (e) { } catch (e) {
this.$set(row, "status", prevVal); this.$set(row, "status", prevVal);
this.$message?.error?.(e?.message || "操作失败,请稍后重试"); this.$message?.error?.(e?.message || "操作失败,请稍后重试");
...@@ -216,6 +232,14 @@ export default { ...@@ -216,6 +232,14 @@ export default {
getSceneTagLabel(row) { getSceneTagLabel(row) {
return row || "-"; return row || "-";
}, },
getDescriptionText(row) {
const v = row?.description;
if (v === undefined || v === null) {
return "";
}
const s = String(v).trim();
return s;
},
}, },
}; };
</script> </script>
...@@ -268,4 +292,29 @@ export default { ...@@ -268,4 +292,29 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.scene-desc-ellipsis {
display: -webkit-box;
-webkit-box-orient: vertical;
line-clamp: 2;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
line-height: 1.5;
max-width: 100%;
cursor: default;
}
</style>
<style lang="scss">
.manage-scene-desc-tooltip {
max-width: 480px;
}
.manage-scene-desc-tooltip__content {
white-space: pre-wrap;
word-break: break-word;
line-height: 1.5;
}
</style> </style>
...@@ -223,7 +223,6 @@ import warrantyCardDialog from "./components/warrantyCardDialog"; ...@@ -223,7 +223,6 @@ import warrantyCardDialog from "./components/warrantyCardDialog";
import financialRulesDetail from "./financialRulesDetail"; import financialRulesDetail from "./financialRulesDetail";
// import _ from "lodash" // import _ from "lodash"
import viewDetail from "./viewDetail"; import viewDetail from "./viewDetail";
import { getSceneTypeByBaseSceneCode } from "@/common/sceneBaseSceneCode";
import { normalizeBaseSceneListResponse } from "./merchantGroundingEdit/merchantDetailMap"; import { normalizeBaseSceneListResponse } from "./merchantGroundingEdit/merchantDetailMap";
export default { export default {
...@@ -675,10 +674,7 @@ export default { ...@@ -675,10 +674,7 @@ export default {
buildRelationRefPayload(row) { buildRelationRefPayload(row) {
const baseSceneCode = this.resolveRowBaseSceneCode(row); const baseSceneCode = this.resolveRowBaseSceneCode(row);
const merchantId = this.resolveRelationMerchantId(row); const merchantId = this.resolveRelationMerchantId(row);
let scene = Number(row.scene); const scene = this.resolveNumericSceneFromApiRow(row);
if (!Number.isFinite(scene)) {
scene = this.resolveSceneTypeByBaseSceneCode(baseSceneCode);
}
return { return {
merchantId, merchantId,
scene: Number.isFinite(scene) ? scene : 0, scene: Number.isFinite(scene) ? scene : 0,
...@@ -701,23 +697,33 @@ export default { ...@@ -701,23 +697,33 @@ export default {
const c = row.baseSceneCode; const c = row.baseSceneCode;
return c != null && c !== "" ? c : ""; return c != null && c !== "" ? c : "";
}, },
/** /** 大类 scene:优先行内 sceneType,其次行内 scene,最后用 getScenesByParams(baseSceneCodeListForFilter)按 baseSceneCode 取 sceneType */
* 列表行 scene 为空时,由 baseSceneCode 推导 scene 大类: parseFiniteSceneValue(v) {
* 先走员工场景映射(getSceneTypeByBaseSceneCode),再用 getBaseSceneCodeList 项上的 sceneType 兜底。 if (v === undefined || v === null || v === "") return NaN;
*/ const n = Number(v);
resolveSceneTypeByBaseSceneCode(baseSceneCode) { return Number.isFinite(n) ? n : NaN;
if (baseSceneCode == null || baseSceneCode === "") return NaN; },
const codeStr = String(baseSceneCode).trim(); resolveNumericSceneFromApiRow(row) {
if (!row || typeof row !== "object") return NaN;
const fromApiType = this.parseFiniteSceneValue(row.sceneType);
if (Number.isFinite(fromApiType)) return fromApiType;
const fromScene = this.parseFiniteSceneValue(row.scene);
if (Number.isFinite(fromScene)) return fromScene;
const code = row.baseSceneCode;
if (code == null || code === "") return NaN;
const codeStr = String(code).trim();
if (!codeStr) return NaN; if (!codeStr) return NaN;
let st = getSceneTypeByBaseSceneCode(codeStr);
if (Number.isFinite(st)) return st;
const list = this.baseData.baseSceneCodeListForFilter || []; const list = this.baseData.baseSceneCodeListForFilter || [];
const hit = list.find( const hit = list.find(
item => item != null && String(item.baseSceneCode).trim() === codeStr, item => item != null
&& String(item.baseSceneCode ?? "").trim() === codeStr,
); );
if (!hit) return NaN; return this.parseFiniteSceneValue(hit?.sceneType);
const fromApi = Number(hit.sceneType); },
return Number.isFinite(fromApi) ? fromApi : NaN; normalizeSceneFieldFromApi(row) {
if (!row || typeof row !== "object") return;
const n = this.resolveNumericSceneFromApiRow(row);
if (Number.isFinite(n)) row.scene = n;
}, },
/** 二手车收车场景 baseSceneCode=120101,不展示财务/对账 */ /** 二手车收车场景 baseSceneCode=120101,不展示财务/对账 */
isUsedCarCollectionBaseScene(row) { isUsedCarCollectionBaseScene(row) {
...@@ -1254,22 +1260,20 @@ export default { ...@@ -1254,22 +1260,20 @@ export default {
} else { } else {
row = { ...item }; row = { ...item };
} }
if ((row.scene == null || row.scene === "") && row.baseSceneCode != null && row.baseSceneCode !== "") {
const st = this.resolveSceneTypeByBaseSceneCode(row.baseSceneCode);
if (Number.isFinite(st)) {
row.scene = st;
}
}
if ((row.baseSceneName == null || row.baseSceneName === "") && row.baseSceneCodeName) { if ((row.baseSceneName == null || row.baseSceneName === "") && row.baseSceneCodeName) {
row.baseSceneName = row.baseSceneCodeName; row.baseSceneName = row.baseSceneCodeName;
} }
this.normalizeSceneFieldFromApi(row);
return row; return row;
}; };
const numbered = dataList.map((item, index) => ({ const numbered = dataList.map((item, index) => {
...flattenListItem(item), const row = flattenListItem(item);
return {
...row,
num: index + (pageNum - 1) * pageSize + 1, num: index + (pageNum - 1) * pageSize + 1,
})); };
});
this.restructureList = numbered.reduce((prev, cur) => { this.restructureList = numbered.reduce((prev, cur) => {
const sceneList = cur.sceneList; const sceneList = cur.sceneList;
...@@ -1297,6 +1301,7 @@ export default { ...@@ -1297,6 +1301,7 @@ export default {
if (!this.relationStatusIsExplicit(s.status) && this.relationStatusIsExplicit(base.status)) { if (!this.relationStatusIsExplicit(s.status) && this.relationStatusIsExplicit(base.status)) {
merged.status = base.status; merged.status = base.status;
} }
this.normalizeSceneFieldFromApi(merged);
prev.push(merged); prev.push(merged);
}); });
} else { } else {
...@@ -1304,7 +1309,6 @@ export default { ...@@ -1304,7 +1309,6 @@ export default {
} }
return prev; return prev;
}, []); }, []);
console.log(this.restructureList, 'this.restructureList');
}, },
// 商户关联 // 商户关联
......
...@@ -29,10 +29,13 @@ ...@@ -29,10 +29,13 @@
<span :class="{ 'labelColorEff': !formItem.formatEffectEndDate }">{{ "待生效"}}</span> <span :class="{ 'labelColorEff': !formItem.formatEffectEndDate }">{{ "待生效"}}</span>
</span> </span>
</template> </template>
<!-- 商户关系:operationType / createdBy / updatedDate --> <!-- 商户关系:左为本条 updatedDate;右为首条「生效中」,其余为上一条 updatedDate -->
<template v-else> <template v-else>
<span>操作类型:</span> <span>{{ formatRelationPeriodStart(formItem) }}</span>
<span class="labelColor">{{ formatRelationOperationType(formItem.operationType) }}</span> <span> - </span>
<span :class="{ labelColor: relationPeriodEndIsEffective(index) }">{{
formatRelationPeriodEnd(index)
}}</span>
</template> </template>
</span> </span>
<span class="updatedInfo"> <span class="updatedInfo">
...@@ -152,16 +155,22 @@ export default { ...@@ -152,16 +155,22 @@ export default {
if (bsc === "") return baseParams if (bsc === "") return baseParams
return { ...baseParams, baseSceneCode: bsc } return { ...baseParams, baseSceneCode: bsc }
}, },
/** 商户关系历史 operationType:1-新增 2-更新 3-禁用 4-启用 */ /** 商户关系历史:区间左端取本条 updatedDate */
formatRelationOperationType(operationType) { formatRelationPeriodStart(formItem) {
const map = { const raw = formItem?.updatedDate
1: "新增", if (raw == null || raw === "") return ""
2: "更新", return dayjs(raw).format("YYYY/MM/DD HH:mm")
3: "禁用", },
4: "启用", /** 首条(最新)右侧为「生效中」,其余为上一条的 updatedDate */
} relationPeriodEndIsEffective(index) {
const key = operationType != null ? Number(operationType) : NaN return index === 0
return !Number.isNaN(key) && map[key] != null ? map[key] : "-" },
formatRelationPeriodEnd(index) {
if (index === 0) return "生效中"
const prev = this.formArray[index - 1]
const raw = prev?.updatedDate
if (raw == null || raw === "") return "-"
return dayjs(raw).format("YYYY/MM/DD HH:mm")
}, },
handleClick(tab) { handleClick(tab) {
this.activeName = tab.name this.activeName = tab.name
...@@ -360,9 +369,9 @@ export default { ...@@ -360,9 +369,9 @@ export default {
if (res.length != 0) { if (res.length != 0) {
const format = "YYYY/MM/DD HH:mm" const format = "YYYY/MM/DD HH:mm"
this.formArray = res.map((item) => { this.formArray = res.map((item) => {
const updatedRaw = item.updatedDate != null ? item.updatedDate : item.operateDate const operateRaw = item.operateDate ?? item.updatedDate
item.formatUpdatedDate = updatedRaw ? dayjs(updatedRaw).format(format) : "-" item.formatUpdatedDate = operateRaw ? dayjs(operateRaw).format(format) : "-"
item.updatedBy = item.createdBy ?? item.operator ?? "-" item.updatedBy = item.operator ?? item.createdBy ?? "-"
item.show = false item.show = false
return item return item
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!