Commit 63fe661b by wangzhihui

Merge branch 'SAAS+V5.8.0' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.8.0
2 parents 2a1b0768 af0b1667
......@@ -13,16 +13,16 @@
:model="infoForm"
:rules="formRules"
label-width="120px">
<el-form-item label="业务线:" prop="businessLine">
<el-select v-model="infoForm.businessLine" style="width:400px">
<el-option v-for="item in baseData.businessLineList"
<el-form-item label="业务线:" prop="sceneType">
<el-select v-model="infoForm.sceneType" style="width:400px">
<el-option v-for="item in baseData.sceneTypeList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</el-form-item>
<el-form-item label="业务场景:" prop="sceneType">
<el-select v-model="infoForm.sceneType"
<el-form-item label="业务场景:" prop="baseSceneCodeList">
<el-select v-model="infoForm.baseSceneCodeList"
multiple
collapse-tags
style="width:400px"
......@@ -252,8 +252,8 @@ export default {
payEndDate: "",
reportType: "1",
shopMerchantId: "",
businessLine: "",
sceneType: [""],
sceneType: "",
baseSceneCodeList: [""],
reconciliationStatus: "all",
packageMerge: false,
templateId: "",
......@@ -269,8 +269,8 @@ export default {
},
formRules: {
businessLine: [{ required: true, message: "请选择业务线", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务场景", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务线", trigger: "change" }],
baseSceneCodeList: [{ required: true, message: "请选择业务场景", trigger: "change" }],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" },
......@@ -288,7 +288,7 @@ export default {
selectLoading: false,
// 基本数据
baseData: {
businessLineList: [{
sceneTypeList: [{
confId: "0",
confLabel: "权益类",
}, {
......@@ -358,17 +358,17 @@ export default {
"scene": {
handler(val) {
const sceneStr = val == null ? "" : String(val);
const exists = this.baseData.businessLineList.some(i => i.confId === sceneStr);
this.infoForm.businessLine = exists ? sceneStr : (this.baseData.businessLineList[0]?.confId || "");
const exists = this.baseData.sceneTypeList.some(i => i.confId === sceneStr);
this.infoForm.sceneType = exists ? sceneStr : (this.baseData.sceneTypeList[0]?.confId || "");
// 首次打开弹框时,确保能根据当前业务线拉取“业务场景”列表
this.syncSceneTypeList();
},
immediate: true,
},
"infoForm.businessLine": {
"infoForm.sceneType": {
handler() {
// 切换业务线时,业务场景默认回到“全部”
this.infoForm.sceneType = [""];
this.infoForm.baseSceneCodeList = [""];
this.syncSceneTypeList();
},
},
......@@ -396,8 +396,8 @@ export default {
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
syncSceneTypeList() {
const sceneType = Number(this.infoForm?.businessLine);
if (this.infoForm?.businessLine === "" || this.infoForm?.businessLine === null || this.infoForm?.businessLine === undefined || Number.isNaN(sceneType)) {
const sceneType = Number(this.infoForm?.sceneType);
if (this.infoForm?.sceneType === "" || this.infoForm?.sceneType === null || this.infoForm?.sceneType === undefined || Number.isNaN(sceneType)) {
this.sceneTypeList = [];
return;
}
......@@ -421,12 +421,12 @@ export default {
return;
}
if (!value.length) {
this.infoForm.sceneType = [""];
this.infoForm.baseSceneCodeList = [""];
return;
}
if (value.includes("") && value.length > 1) {
// 多选时,“全部”与具体值互斥;以最后一次选择为准
this.infoForm.sceneType = value[value.length - 1] === ""
this.infoForm.baseSceneCodeList = value[value.length - 1] === ""
? [""]
: value.filter(v => v !== "");
}
......@@ -652,6 +652,7 @@ export default {
params.reportType = infoForm.reportType;
}
params.sceneType = this.scene;
params.baseSceneCodeList = infoForm.baseSceneCodeList;
// 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
......
......@@ -13,8 +13,8 @@
:model="infoForm"
:rules="formRules"
label-width="120px">
<el-form-item label="业务场景:" prop="businessLine">
<el-select v-model="infoForm.businessLine" style="width:400px">
<el-form-item label="业务场景:" prop="sceneType">
<el-select v-model="infoForm.sceneType" style="width:400px">
<el-option v-for="item in baseData.businessLineList"
:key="item.confId"
:label="item.confLabel"
......@@ -51,8 +51,6 @@
</el-form-item>
<el-form-item label="对账商户:" prop="merchant">
<el-select v-model="infoForm.merchant"
multiple
:multiple-limit="multipleLimit"
filterable
style="width:400px"
@change="handleChangeMerchant">
......@@ -231,8 +229,9 @@ export default {
},
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
sceneType: "",
merchantType: "2",
merchant: [],
merchant: "",
payStartDate: "",
payEndDate: "",
reportType: "1",
......@@ -253,7 +252,7 @@ export default {
},
formRules: {
businessLine: [{ required: true, message: "请选择业务线", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务场景", trigger: "change" }],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" },
......@@ -364,7 +363,7 @@ export default {
params.merchantTypeList = merchantTypeList;
getMerchantPageSearch(params).then((res) => {
this.baseData.merchantList = res.list;
this.infoForm.merchant = [];
this.infoForm.merchant = "";
}).finally(() => {
this.loading = false;
});
......@@ -373,10 +372,14 @@ export default {
handleChangeMerchant(e) {
console.log(e);
this.infoForm.shopMerchantId = "";
if (!e) {
this.baseData.shopMerchantList = [];
return;
}
const params = {
currentPage: 1,
pageSize: 9999,
partnerMerchantId: e[0],
partnerMerchantId: e,
scene: this.scene,
};
getShopList(params).then((res) => {
......@@ -406,7 +409,7 @@ export default {
judgeTmpl() {
this.isTmpl = this.infoForm.merchantType == "2";
this.merchantTypeStr = this.typeObj[this.infoForm.merchantType];
this.infoForm.merchant = [];
this.infoForm.merchant = "";
this.resetTmplData();
},
......@@ -547,15 +550,15 @@ export default {
// console.log(infoForm)
let params = {};
let merchantList = [];
let obj;
infoForm.merchant.forEach((item) => {
obj = {};
obj.merchantId = item;
obj.merchantName = this.baseData.merchantList.find(
mer => mer.merchantId === item,
).merchantName;
merchantList.push(obj);
});
const currentMerchant = this.baseData.merchantList.find(
mer => mer.merchantId === infoForm.merchant,
);
if (currentMerchant) {
merchantList.push({
merchantId: infoForm.merchant,
merchantName: currentMerchant.merchantName,
});
}
params.payStartDate = infoForm.payStartDate + " 00:00:00";
params.payEndDate = infoForm.payEndDate + " 23:59:59";
merchantList.forEach((item, index) => {
......@@ -568,7 +571,7 @@ export default {
if (infoForm.merchantType == "7") {
params.reportType = infoForm.reportType;
}
params.sceneType = this.scene;
params.sceneType = infoForm.sceneType;
// 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
......@@ -588,7 +591,7 @@ export default {
handleSystemBill() {
this.$refs.accountForm.validate((valid) => {
if (valid) {
if (this.infoForm.merchant.length == 1) {
if (this.infoForm.merchant) {
let params = this.getParams();
params.orderCurrentPage = 1;
params.orderPageSize = 10;
......@@ -598,7 +601,7 @@ export default {
this.$emit("handleBill", { billTmplInfo: res });
});
} else {
this.$message.warning("仅支持单商户进行系统对账");
this.$message.warning("请选择对账商户");
}
}
});
......
......@@ -981,7 +981,7 @@ export default {
// this.showFormData[this.findFormIdx('yqMerchantId')].isHide = true
// }
// this.showFormData[this.findFormIdx('merchantId')].isHide = true
this.showFormData[this.findFormIdx("businessModel")].isHide = true;
// this.showFormData[this.findFormIdx("businessModel")].isHide = true;
this.showFormData[this.findFormIdx("yqMerchantId")].isHide = false;
this.showFormData[this.findFormIdx("merchantId")].isHide = false;
this.sellerName_visible = false;
......
......@@ -27,10 +27,10 @@
:before-search-fn="beforeSearchFn">
<template #scene-tag="scope">
<template v-if="scope.scope.tagNames && scope.scope.tagNames.length">
<span v-for="item in scope.scope.tagNames"
:key="item.tagId"
<span v-for="(item, index) in scope.scope.tagNames"
:key="index"
class="scene-tag">
{{ getSceneTagLabel(scope.scope) }}
{{ item }}
</span>
</template>
<span v-else>-</span>
......@@ -79,15 +79,15 @@ export default {
keyFn: this.keyDowmGetList,
}, {
label: "标签",
name: "merchantType",
name: "tagIds",
type: "select",
multiple: true,
collapseTags: true,
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "merchantStoreServiceList",
optionId: "id",
optionLabel: "name",
optionsName: "sceneTagList",
}],
getListApi: getList,
// 表格参数
......@@ -143,22 +143,17 @@ export default {
close: "d2admin/page/close",
}),
async loadSceneTagOptions() {
const idx = this.showFormData.findIndex(i => i.name === "merchantType");
if (idx < 0) {
return;
}
try {
const res = await getSceneTags({});
const list = res?.data?.list || res?.data || res?.result || [];
const list = res || [];
const optionList = (Array.isArray(list) ? list : [])
.map(it => ({
confId: it?.confId ?? it?.tagId ?? it?.id,
confLabel: it?.confLabel ?? it?.tagName ?? it?.name ?? it?.label,
id: it?.id,
name: it?.name,
}))
.filter(it => it.confId !== undefined && it.confLabel);
this.$set(this.showFormData[idx], "optionList", optionList);
.filter(it => it.id !== undefined && it.name);
this.showFormData[1].optionList = optionList;
} catch (e) {
this.$set(this.showFormData[idx], "optionList", []);
}
},
beforeSearchFn() {
......@@ -219,8 +214,7 @@ export default {
}
},
getSceneTagLabel(row) {
const idx = Number(row?.procurementType) - 1;
return this.procureModeList?.[idx]?.confName || "-";
return row || "-";
},
},
};
......@@ -266,6 +260,7 @@ export default {
font-size: 14px;
padding: 1px 6px;
display: inline-block;
margin-right: 1px;
}
.taskStatus {
......
......@@ -1010,7 +1010,8 @@
"
:owning-merchant-distribution-rules="goodsTypeGroupRules.owningMerchantDistributionRules"
:table-select-options="tableSelectOptions"
:classification-obj-select="tableClassificationObjSelect" />
:classification-obj-select="tableClassificationObjSelect"
@distribution-rules-change="onDistributionRulesChange" />
<TipsDialog v-if="tipsDialogVisible"
:account-valid-merchants="accountValidMerchants"
:visible.sync="tipsDialogVisible" />
......@@ -1624,6 +1625,13 @@ export default {
},
methods: {
/** 费用归属/实际分账仅存在于 TableAccount 本地 form,不落 classificationObj;需单独上报以置父页 classificationUserTouched */
onDistributionRulesChange() {
this.emitClassificationChange(
CLASSIFICATION_EMIT.CLASSIFICATION_TOUCHED,
this.paneIndex,
);
},
emitClassificationChange(type, payload) {
this.$emit("classification-change", { type, payload });
},
......
......@@ -328,12 +328,14 @@ export default {
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef.clearValidate(validField)
this.$emit('distribution-rules-change')
},
handleClearValid2(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef2.clearValidate(validField)
this.$emit('distribution-rules-change')
},
/** validate 通过后兜底:每行须能解析出 merchantId(与快路径 distributionRulesLookComplete 一致) */
distributionRowsHaveMerchantId(rows) {
......
import { deepClone } from "@/common/util"
import {
filterUpgradeGoodsByMerchantCode,
trimCommodityCode,
trimMerchantGoodsCode
} from "../../merchantStep/utils/groundingUpgradeList"
......@@ -35,7 +36,7 @@ export function normalizeRuleGoodsTypesForCategory(item, upgradeArr, packageArr)
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: code,
commodityCode: trimCommodityCode(val),
merchantGoodsCode: code
})
})
......
......@@ -553,7 +553,7 @@ export default {
if (arr[0]?.categoryType == 2) {
const length = arr.length - 1
text = arr.reduce((str, item, index) => {
str += `${item.upgradeGoodsName}(${item.commodityCode})${index == length ? "" : "、"}`
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode})${index == length ? "" : "、"}`
return str
}, '')
return text
......
......@@ -584,7 +584,7 @@ export default {
if (arr[0]?.categoryType == 2) {
const length = arr.length - 1
text = arr.reduce((str, item, index) => {
str += `${item.upgradeGoodsName}(${item.commodityCode})${
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode})${
index == length ? "" : "、"
}`
return str
......
/**
* merchantGoodsInfo.rule.selectList 返回的扁平 list(upgradeGoodsId / goodsShowName / merchantGoodsCode)
* merchantGoodsInfo.rule.selectList 返回的扁平 list(可与 merchantGoodsCode 独立的 commodityCode)
* → 分账「具体商品」下拉统一结构
* @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, merchantGoodsCode?: *}>|undefined} list
* @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, merchantGoodsCode?: *, commodityCode?: *}>|undefined} list
* @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string, merchantGoodsCode: string}>}
*/
export function mapProductSearchListToUpgradeGoodsOptions(list) {
......@@ -15,13 +15,26 @@ export function mapProductSearchListToUpgradeGoodsOptions(list) {
rawCode != null && String(rawCode).trim() !== ""
? String(rawCode).trim()
: ""
const commodityCode = merchantGoodsCode
const commodityCode = trimCommodityCode(row)
return { upgradeGoodsId, upgradeGoodsName, commodityCode, merchantGoodsCode }
})
.filter((row) => row.merchantGoodsCode !== "")
}
/**
* 仅读取 row.commodityCode(trim),与 merchantGoodsCode 分离,不用商户码回填。
* @param {object|undefined} row
* @returns {string} trim 后非空则返回,否则 ""
*/
export function trimCommodityCode(row) {
if (!row || typeof row !== "object") return ""
if (row.commodityCode == null) return ""
const t = String(row.commodityCode).trim()
if (t === "" || t === "null" || t === "undefined") return ""
return t
}
/**
* @param {object|undefined} row
* @returns {string} trim 后非空则返回,否则 ""
*/
......@@ -76,7 +89,7 @@ export function flatMapUpgradeGoodsFromGoodsListPage(list) {
arr.push({
upgradeGoodsId: id,
upgradeGoodsName,
commodityCode: code,
commodityCode: trimCommodityCode(el),
merchantGoodsCode: code
})
})
......
......@@ -4,6 +4,7 @@
import { deepClone } from "@/common/util"
import {
filterUpgradeGoodsByMerchantCode,
trimCommodityCode,
trimMerchantGoodsCode
} from "./groundingUpgradeList"
......@@ -33,7 +34,7 @@ export function applyGoodsTypeGroupRelationBranches(
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: code,
commodityCode: trimCommodityCode(val),
merchantGoodsCode: code
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!