Commit 610b7d0a by 张立顺

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 65a13344 26fb29fe
Showing 38 changed files with 1094 additions and 525 deletions
......@@ -8,6 +8,11 @@ node_modules
.cursor
.trae
# 本地环境文件不上传
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
......
......@@ -32,4 +32,4 @@
"javascript.suggest.autoImports": true, // 确保这个是 true
"vue.updateImportsOnFileMove.enabled": true,
"i18n-ally.sourceLanguage": "zh-chs"
}
\ No newline at end of file
}
......@@ -3,6 +3,7 @@
<div class="glsk-form-dialog">
<d2-dialog :append-to-body="appendToBody"
:btn-ok-label="dialogConfig.okText"
:noCancel="dialogConfig.hideClose"
:is-visible="selectVisible"
:title="dialogConfig.title"
:width="dialogWidth"
......@@ -56,6 +57,7 @@ export default {
return {
title: "提示",
okText: "确定",
hideClose: false,
};
},
},
......
......@@ -117,7 +117,7 @@ let baseConfig = config;
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch(
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config-cym"
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config"
)
.then(
(response) => {
......
......@@ -169,6 +169,12 @@ import {
userType,
} from "@/common/constants";
import { deepClone } from "@/common/util";
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
filterUpgradeGoodsByMerchantCode,
trimMerchantGoodsCode,
} from "@/views/systemConfig/merchant/merchantStep/utils/groundingUpgradeList";
import classificationCpt from "./components/classificationCpt.vue";
import ruleUpdateDialog from "./components/ruleupdateDialog.vue";
......@@ -628,13 +634,17 @@ export default {
item.goodsTypes?.length
&& item.goodsTypes[0]?.categoryType == 2
) {
item.upgradeGoods = deepClone(item.goodsTypes);
const withCode = filterUpgradeGoodsByMerchantCode(item.goodsTypes);
item.upgradeGoods = deepClone(withCode);
item.categoryType = 2;
item.goodsTypes?.forEach((val) => {
withCode.forEach((val) => {
const code = trimMerchantGoodsCode(val);
if (!code) return;
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode,
commodityCode: code,
merchantGoodsCode: code,
});
});
item.goodsTypes = []; // 与分类互不干扰
......@@ -682,16 +692,15 @@ export default {
// 取消选中具体商品
deleteUpgradeGoodsItem(item) {
this.selectUpgradeGoodsList = this.selectUpgradeGoodsList.filter(
el => el?.upgradeGoodsId != item?.upgradeGoodsId,
el => !sameUpgradeGoodsRow(el, item),
);
},
assignUpgradeGoodsList(list) {
const newDatas = [...this.selectUpgradeGoodsList, ...list];
const hash = {};
this.selectUpgradeGoodsList = newDatas.reduce((item, next) => {
hash[next?.upgradeGoodsId]
? ""
: (hash[next?.upgradeGoodsId] = true && item.push(next));
const k = getUpgradeGoodsRowKey(next);
hash[k] ? "" : (hash[k] = true && item.push(next));
return item;
}, []);
},
......@@ -1151,11 +1160,14 @@ export default {
this.allPages = res.pages;
const resArr = res.list.reduce((arr, val) => {
val.upgradeGoodsList.forEach((el) => {
const { upgradeGoodsName, id, merchantGoodsCode: mg } = el;
const code = mg != null && String(mg).trim() !== "" ? String(mg).trim() : "";
if (!code) return;
const item = {};
const { upgradeGoodsName, id, commodityCode } = el;
item.upgradeGoodsId = id;
item.upgradeGoodsName = upgradeGoodsName;
item.commodityCode = commodityCode;
item.commodityCode = code;
item.merchantGoodsCode = code;
arr.push(item);
});
return arr;
......@@ -1170,9 +1182,11 @@ export default {
},
unique(arr) {
const res = new Map();
return arr.filter(
a => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1),
);
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a);
if (!k) return false;
return !res.has(k) && res.set(k, 1);
});
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = [], packageArr = []) {
......@@ -1479,13 +1493,17 @@ export default {
item.goodsTypes?.length
&& item.goodsTypes[0]?.categoryType == 2
) {
item.upgradeGoods = deepClone(item.goodsTypes);
const withCode = filterUpgradeGoodsByMerchantCode(item.goodsTypes);
item.upgradeGoods = deepClone(withCode);
item.categoryType = 2;
item.goodsTypes?.forEach((val) => {
withCode.forEach((val) => {
const code = trimMerchantGoodsCode(val);
if (!code) return;
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode,
commodityCode: code,
merchantGoodsCode: code,
});
});
item.goodsTypes = []; // 与分类互不干扰
......@@ -1551,7 +1569,7 @@ export default {
(arr, item) => {
if (
list.findIndex(
el => item?.upgradeGoodsId == el?.upgradeGoodsId,
el => sameUpgradeGoodsRow(item, el),
) == -1
) {
arr.push(item);
......
......@@ -79,6 +79,10 @@ import { getQueryFeeCategoryByTypeApi } from "@api/merchant";
import { mapActions, mapGetters } from "vuex";
import { sceneList } from "@/common/constants";
import { deepClone } from "@/common/util";
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
} from "@/views/systemConfig/merchant/merchantStep/utils/groundingUpgradeList";
import classificationCpt from "./components/classificationCptCheck.vue";
// import { merchantSettleDistributeRuleLastRule } from "@api/shelfManage"
import ruleUpdateDialog from "./components/ruleupdateDialog.vue";
......@@ -271,9 +275,8 @@ export default {
const newDatas = [...this.selectUpgradeGoodsList, ...list];
const hash = {};
this.selectUpgradeGoodsList = newDatas.reduce((item, next) => {
hash[next?.upgradeGoodsId]
? ""
: (hash[next?.upgradeGoodsId] = true && item.push(next));
const k = getUpgradeGoodsRowKey(next);
hash[k] ? "" : (hash[k] = true && item.push(next));
return item;
}, []);
},
......@@ -307,11 +310,14 @@ export default {
this.allPages = res.pages;
const resArr = res.list.reduce((arr, val) => {
val.upgradeGoodsList.forEach((el) => {
const { upgradeGoodsName, id, merchantGoodsCode: mg } = el;
const code = mg != null && String(mg).trim() !== "" ? String(mg).trim() : "";
if (!code) return;
const item = {};
const { upgradeGoodsName, id, commodityCode } = el;
item.upgradeGoodsId = id;
item.upgradeGoodsName = upgradeGoodsName;
item.commodityCode = commodityCode;
item.commodityCode = code;
item.merchantGoodsCode = code;
arr.push(item);
});
return arr;
......@@ -329,9 +335,11 @@ export default {
// 数据去重
unique(arr) {
const res = new Map();
return arr.filter(
a => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1),
);
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a);
if (!k) return false;
return !res.has(k) && res.set(k, 1);
});
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = [], packageArr = []) {
......@@ -570,7 +578,7 @@ export default {
},
deleteUpgradeGoodsItem(item) {
this.selectUpgradeGoodsList = this.selectUpgradeGoodsList.filter(
el => el?.upgradeGoodsId != item?.upgradeGoodsId,
el => !sameUpgradeGoodsRow(el, item),
);
},
deleteSelectGoodsList(list) {
......@@ -590,7 +598,7 @@ export default {
if (
list
&& list.findIndex(
el => item?.upgradeGoodsId == el?.upgradeGoodsId,
el => sameUpgradeGoodsRow(item, el),
) == -1
) {
arr.push(item);
......
......@@ -70,14 +70,14 @@
:remote-method="remoteMethod"
reserve-keyword
style="width: 370px"
value-key="upgradeGoodsId"
value-key="merchantGoodsCode"
@change="upgradeGoodsChange"
@visible-change="visibleChange">
<el-option v-for="subItem in copyUpgradeGoodsList"
:key="subItem.upgradeGoodsId"
:key="subItem.merchantGoodsCode"
:disabled="subItem | filterupgradeGoodsItem(disabledUpgradeGoodsList)
"
:label="`${subItem.upgradeGoodsName}(${subItem.commodityCode})`"
:label="`${subItem.upgradeGoodsName}(${subItem.merchantGoodsCode})`"
:value="subItem" />
</el-select>
</el-form-item>
......@@ -208,8 +208,11 @@ import {
merchantPackageGoodsInfoPage,
} from "@api/grounding";
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
mapProductSearchListToUpgradeGoodsOptions,
resolveProductSearchPages,
filterUpgradeGoodsByMerchantCode,
} from "@/views/systemConfig/merchant/merchantStep/utils/groundingUpgradeList";
import { resolveBaseSceneCodeFromRouter } from "@/common/sceneBaseSceneCode";
import { divisionRuleTestGet } from "@api/merchant";
......@@ -453,7 +456,7 @@ export default {
const list = this.selectUpgradeGoodsList.filter((item) => {
if (
selectList.findIndex((el) => {
return el.upgradeGoodsId == item.upgradeGoodsId;
return sameUpgradeGoodsRow(el, item);
}) == -1
) {
return item;
......@@ -625,7 +628,7 @@ export default {
// 过滤具体商品
filterupgradeGoodsItem(item, list) {
return (
list.findIndex(el => el.upgradeGoodsId == item.upgradeGoodsId) != -1
list.findIndex(el => sameUpgradeGoodsRow(el, item)) != -1
);
},
// 过滤套餐商品
......@@ -672,7 +675,9 @@ export default {
"upgradeGoodsList": {
handler(val, oldVal) {
if (val) {
this.copyUpgradeGoodsList = deepClone(val);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(val),
);
}
},
deep: true,
......@@ -698,7 +703,7 @@ export default {
if (val?.length < oldVal?.length) {
// 对比出已经取消的商品
const deleteItem = oldVal.find((item) => {
if (!val.find(el => el.upgradeGoodsId == item.upgradeGoodsId)) {
if (!val.find(el => sameUpgradeGoodsRow(el, item))) {
return item;
}
});
......@@ -764,7 +769,9 @@ export default {
},
mounted() {
// this.init4sServiceList()
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList),
);
this.copyPackageGoodsList = deepClone(this.packageGoodsList);
},
......@@ -797,7 +804,9 @@ export default {
"upgradeGoods",
"packageGoods",
]);
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList),
);
this.copyPackageGoodsList = deepClone(this.packageGoodsList);
this.$emit("deleteSelectGoodsTypeList", this.classificationObj.goodsTypes);
this.classificationObj.goodsTypes = [];
......@@ -907,15 +916,18 @@ export default {
// console.log(defaultSelect, "defaultSelect")
if (defaultSelect?.length)
arr = arr.concat(defaultSelect);
arr = filterUpgradeGoodsByMerchantCode(arr);
this.copyUpgradeGoodsList = this.unique(arr);
})
.catch(() => { });
},
unique(arr) {
const res = new Map();
return arr.filter(
a => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1),
);
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a);
if (!k) return false;
return !res.has(k) && res.set(k, 1);
});
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = []) {
......@@ -1377,6 +1389,9 @@ export default {
val.categoryType = 1; // 按商品分类
return val;
});
if (obj.categoryType === 2) {
obj.upgradeGoods = filterUpgradeGoodsByMerchantCode(obj.upgradeGoods);
}
const upgradeGoods = obj.upgradeGoods;
upgradeGoods
&& upgradeGoods.map((val) => {
......
......@@ -65,13 +65,13 @@
:remote-method="remoteMethod"
reserve-keyword
style="width: 320px"
value-key="upgradeGoodsId"
value-key="merchantGoodsCode"
@visible-change="visibleChange">
<el-option v-for="subItem in copyUpgradeGoodsList"
:key="subItem.upgradeGoodsId"
:key="subItem.merchantGoodsCode"
:disabled="subItem | filterupgradeGoodsItem(disabledUpgradeGoodsList)
"
:label="`${subItem.upgradeGoodsName}(${subItem.commodityCode})`"
:label="`${subItem.upgradeGoodsName}(${subItem.merchantGoodsCode})`"
:value="subItem">
</el-option>
</el-select>
......@@ -204,8 +204,11 @@ import {
merchantPackageGoodsInfoPage,
} from "@api/grounding";
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
mapProductSearchListToUpgradeGoodsOptions,
resolveProductSearchPages,
filterUpgradeGoodsByMerchantCode,
} from "@/views/systemConfig/merchant/merchantStep/utils/groundingUpgradeList";
import { resolveBaseSceneCodeFromRouter } from "@/common/sceneBaseSceneCode";
import { getMerchantLevelListApi, listPartnerMerchantApi } from "@api/merchant";
......@@ -430,7 +433,7 @@ export default {
const list = this.selectUpgradeGoodsList.filter((item) => {
if (
selectList.findIndex((el) => {
return el.upgradeGoodsId == item?.upgradeGoodsId;
return sameUpgradeGoodsRow(el, item);
}) == -1
) {
return item;
......@@ -461,7 +464,7 @@ export default {
// 过滤具体商品
filterupgradeGoodsItem(item, list) {
return (
list.findIndex(el => el.upgradeGoodsId == item.upgradeGoodsId) != -1
list.findIndex(el => sameUpgradeGoodsRow(el, item)) != -1
);
},
// 过滤套餐商品
......@@ -510,7 +513,9 @@ export default {
"upgradeGoodsList": {
handler(val, oldVal) {
if (val) {
this.copyUpgradeGoodsList = deepClone(val);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(val),
);
}
},
deep: true,
......@@ -533,7 +538,7 @@ export default {
if (val?.length < oldVal?.length) {
// 对比出已经取消的商品
const deleteItem = oldVal.find((item) => {
if (!val.find(el => el.upgradeGoodsId == item.upgradeGoodsId)) {
if (!val.find(el => sameUpgradeGoodsRow(el, item))) {
return item;
}
});
......@@ -617,7 +622,9 @@ export default {
this.getRowItem();
},
mounted() {
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList),
);
this.copyPackageGoodsList = deepClone(this.packageGoodsList);
},
......@@ -651,7 +658,9 @@ export default {
"upgradeGoods",
"packageGoods",
]);
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList),
);
this.copyPackageGoodsList = deepClone(this.packageGoodsList);
// 清空 商品分类 具体商品 套餐商品
this.$emit(
......@@ -802,15 +811,18 @@ export default {
let arr = this.copyUpgradeGoodsList.concat(resArr);
if (defaultSelect?.length)
arr = arr.concat(defaultSelect);
arr = filterUpgradeGoodsByMerchantCode(arr);
this.copyUpgradeGoodsList = this.unique(arr);
})
.catch(() => { });
},
unique(arr) {
const res = new Map();
return arr.filter(
a => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1),
);
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a);
if (!k) return false;
return !res.has(k) && res.set(k, 1);
});
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = []) {
......@@ -855,6 +867,9 @@ export default {
},
getParams() {
const obj = deepClone(this.classificationObj);
if (obj.categoryType === 2) {
obj.upgradeGoods = filterUpgradeGoodsByMerchantCode(obj.upgradeGoods);
}
obj.packageGoods = obj.packageGoods.map((val) => {
val.categoryType = 3; // 按商品套餐
if (val.tempPackageCode) {
......@@ -1194,6 +1209,11 @@ export default {
= checkRecordItem?.goodsTypeGroupRelations;
that.classificationObj.upgradeGoods = checkRecordItem?.upgradeGoods;
that.classificationObj.packageGoods = checkRecordItem?.packageGoods;
if (that.classificationObj.categoryType === 2) {
that.classificationObj.upgradeGoods = filterUpgradeGoodsByMerchantCode(
that.classificationObj.upgradeGoods,
);
}
that.classificationObj.groupType = checkRecordItem?.groupType;
that.classificationObj.flowCostArr = that.getClassificationObjFormat(
that.classificationObj.flowCostArr,
......@@ -1246,6 +1266,11 @@ export default {
);
}
// 按具体商品
if (this.classificationObj.categoryType === 2) {
this.classificationObj.upgradeGoods = filterUpgradeGoodsByMerchantCode(
this.classificationObj.upgradeGoods,
);
}
this.classificationObj.upgradeGoods?.map((val) => {
val.categoryType = this.classificationObj.categoryType;
return val;
......
......@@ -196,6 +196,12 @@ import {
userType,
} from "@/common/constants";
import { deepClone } from "@/common/util";
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
filterUpgradeGoodsByMerchantCode,
trimMerchantGoodsCode,
} from "@/views/systemConfig/merchant/merchantStep/utils/groundingUpgradeList";
import classificationCpt from "../editCon/components/classificationCpt.vue";
import ruleUpdateDialog from "../editCon/components/ruleupdateDialog.vue";
......@@ -660,13 +666,17 @@ export default {
item.goodsTypes?.length
&& item.goodsTypes[0]?.categoryType == 2
) {
item.upgradeGoods = deepClone(item.goodsTypes);
const withCode = filterUpgradeGoodsByMerchantCode(item.goodsTypes);
item.upgradeGoods = deepClone(withCode);
item.categoryType = 2;
item.goodsTypes?.forEach((val) => {
withCode.forEach((val) => {
const code = trimMerchantGoodsCode(val);
if (!code) return;
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode,
commodityCode: code,
merchantGoodsCode: code,
});
});
item.goodsTypes = []; // 与分类互不干扰
......@@ -714,16 +724,15 @@ export default {
// 取消选中具体商品
deleteUpgradeGoodsItem(item) {
this.selectUpgradeGoodsList = this.selectUpgradeGoodsList.filter(
el => el?.upgradeGoodsId != item?.upgradeGoodsId,
el => !sameUpgradeGoodsRow(el, item),
);
},
assignUpgradeGoodsList(list) {
const newDatas = [...this.selectUpgradeGoodsList, ...list];
const hash = {};
this.selectUpgradeGoodsList = newDatas.reduce((item, next) => {
hash[next?.upgradeGoodsId]
? ""
: (hash[next?.upgradeGoodsId] = true && item.push(next));
const k = getUpgradeGoodsRowKey(next);
hash[k] ? "" : (hash[k] = true && item.push(next));
return item;
}, []);
},
......@@ -1182,11 +1191,14 @@ export default {
this.allPages = res.pages;
const resArr = res.list.reduce((arr, val) => {
val.upgradeGoodsList.forEach((el) => {
const { upgradeGoodsName, id, merchantGoodsCode: mg } = el;
const code = mg != null && String(mg).trim() !== "" ? String(mg).trim() : "";
if (!code) return;
const item = {};
const { upgradeGoodsName, id, commodityCode } = el;
item.upgradeGoodsId = id;
item.upgradeGoodsName = upgradeGoodsName;
item.commodityCode = commodityCode;
item.commodityCode = code;
item.merchantGoodsCode = code;
arr.push(item);
});
return arr;
......@@ -1201,9 +1213,11 @@ export default {
},
unique(arr) {
const res = new Map();
return arr.filter(
a => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1),
);
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a);
if (!k) return false;
return !res.has(k) && res.set(k, 1);
});
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = [], packageArr = []) {
......@@ -1511,13 +1525,17 @@ export default {
item.goodsTypes?.length
&& item.goodsTypes[0]?.categoryType == 2
) {
item.upgradeGoods = deepClone(item.goodsTypes);
const withCode = filterUpgradeGoodsByMerchantCode(item.goodsTypes);
item.upgradeGoods = deepClone(withCode);
item.categoryType = 2;
item.goodsTypes?.forEach((val) => {
withCode.forEach((val) => {
const code = trimMerchantGoodsCode(val);
if (!code) return;
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode,
commodityCode: code,
merchantGoodsCode: code,
});
});
item.goodsTypes = []; // 与分类互不干扰
......@@ -1583,7 +1601,7 @@ export default {
(arr, item) => {
if (
list.findIndex(
el => item?.upgradeGoodsId == el?.upgradeGoodsId,
el => sameUpgradeGoodsRow(item, el),
) == -1
) {
arr.push(item);
......
<template>
<div class="examine-record">
<div class="title">
审核记录
</div>
<template v-if="list && list.length">
<div v-if="list.length > 2 && useExpand"
class="up-down"
@click="handleToggleVisible">
<el-button size="mini"
type="text"
:icon="visible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" />
{{ visible ? "收起" : "展开" }}
</div>
<div style="width:100%;">
<div class="record-div">
<div v-for="(item, index) in getList"
:key="index"
class="record-div-d">
<span class="span-txt-one text-hide">
{{ item.status ? $$(statusForShow, [item.status], "text") : "" }}
</span>
<span class="span-txt-two status-wrapper">
<span :class="item.status ? examineStatusClass[item.status] : ''">
{{
item.status
? $$(statusForShow, [item.status], "status")
: ""
}}
</span>
<span v-if="item.rejectedStatus">
<span style="display: inline-block; margin: 0 8px">至</span>
<span>
{{
item.rejectedStatus
? $$(
rejectedForShow,
[item.rejectedStatus],
"rejectedStatus",
)
: ""
}}
</span>
</span>
</span>
<span class="span-txt-two reviewer item-wrapper ">
<span>审核人:</span>
<div class="value">
<el-tooltip class="item"
popper-class="remark-popper-class"
effect="dark"
:content="item.reviewedBy"
placement="bottom">
<el-button type="text" class="value-btn text-hide">
{{ item.reviewedBy }}
</el-button>
</el-tooltip>
</div>
</span>
<span class="span-txt-two ">
审核时间:{{ item.reviewedDateFormat || item.reviewedDate }}
</span>
<span v-if="item.remark" class="span-txt-two remark item-wrapper">
<span class="label">备注:</span>
<div class="value">
<el-tooltip class="item"
popper-class="remark-popper-class"
effect="dark"
:content="item.remark"
placement="bottom">
<el-button type="text" class="value-btn text-hide">
{{ item.remark }}
</el-button>
</el-tooltip>
</div>
</span>
<span v-if="[4, 6, 7, 9, 11].includes(item.status)"
class="span-txt-two reject-cause item-wrapper">
<span class="label">驳回原因:</span>
<div class="value">
<el-tooltip class="item"
popper-class="remark-popper-class"
effect="dark"
:content="item.rejectCause"
placement="bottom">
<el-button type="text" class="text-hide value-btn">
{{ item.rejectCause }}
</el-button>
</el-tooltip>
</div>
</span>
</div>
</div>
</div>
</template>
<div v-else class="emptyCom">
<img :src="emptyImg"
class="emptyImg"
alt="" />
<span class="tips">暂无数据</span>
</div>
</div>
</template>
<script>
import emptyImg from "@/assets/empty.png";
export default {
name: "",
props: {
list: {
required: true,
type: Array,
},
useExpand: {
type: Boolean,
default: true,
},
},
data() {
return {
visible: false,
emptyImg,
examineStatusClass: {
2: "greenSp",
4: "redSp",
5: "greenSp",
6: "redSp",
7: "redSp",
8: "greenSp",
9: "redSp",
10: "greenSp",
11: "redSp",
},
statusForShow: {
2: { text: "运营审核", status: "通过" },
4: { text: "运营审核", status: "驳回" },
5: { text: "商务审核", status: "通过" },
6: { text: "商务审核", status: "驳回" },
7: { text: "采购驳回", status: "驳回" },
8: { text: "总监审核", status: "通过" },
9: { text: "总监审核", status: "驳回" },
10: { text: "经理通过", status: "通过" },
11: { text: "经理驳回", status: "驳回" },
},
rejectedForShow: {
1: { rejectedStatus: "采购商户" },
2: { rejectedStatus: "运营审核" },
3: { rejectedStatus: "商务审核" },
6: { rejectedStatus: "经理审核" },
},
};
},
computed: {
getList() {
// 如果不使用展开功能, 直接返回整个list
if (!this.useExpand) {
return this.list;
}
if (this.visible) {
return this.list;
} else {
return this.list.slice(0, 2);
}
},
},
mounted() {
},
methods: {
handleToggleVisible() {
this.visible = !this.visible;
},
},
};
</script>
<style scoped lang="scss">
.examine-record {
position: relative;
width: 100%;
min-height: 60px;
border-radius: 4px;
border: 1px solid #fafafa;
background: #fafafa;
> .title {
padding: 16px 20px;
line-height: 20px;
font-weight: 600;
font-size: 16px;
color: #333333;
text-align: left;
}
.up-down {
position: absolute;
right: 20px;
top: 20px;
width: 42px;
height: 20px;
font-family: PingFangSC-Regular;
color: #2a58ad;
font-size: 12px;
cursor: pointer;
}
.record-div {
padding: 0 20px 16px;
font-size: 14px;
color: #666666;
overflow: hidden;
width: 100%;
box-sizing: border-box;
.record-div-d {
margin-top: 10px;
overflow: hidden;
width: 100%;
position: relative;
display: flex;
align-items: center;
padding: 4px 0 4px 24px;
box-sizing: border-box;
&::before {
position: absolute;
content: "";
left: 6px;
top: 50%;
transform: translateY(-50%);
width: 6px;
height: 6px;
background: #185efe;
border-radius: 6px;
}
> .span-txt-one {
max-width: 5em;
}
.span-txt-two {
margin-left: 12px;
flex-shrink: 0;
&.status-wrapper {
width: 180px;
}
&.reviewer {
width: 140px;
}
&.remark {
flex: 1;
}
&.reject-cause {
flex: 1;
}
&.item-wrapper {
overflow: hidden;
display: flex;
align-items: center;
.label {
flex-shrink: 0;
}
.value {
flex: 1;
text-align: left;
overflow: hidden;
.value-btn {
max-width: 100%;
padding: 0;
}
}
}
}
}
.greenSp {
color: #4aca74;
}
.redSp {
color: #eb4e4e;
}
}
.emptyCom {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.emptyImg {
width: 64px;
}
.tips {
font-size: 14px;
color: #999999;
margin: 20px 0;
}
}
}
</style>
......@@ -326,7 +326,7 @@ export default {
...this.dowloadList,
{
// name: '采购审核',
name: '运营审核',
name: '总监审核',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
......
......@@ -35,6 +35,7 @@
:search-form="tableSearchForm"
:table-params="tableParams"
:table-data="tableData"
:selectable-fn="selectableFn"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<template #auth-button="scope">
......@@ -281,6 +282,9 @@ export default {
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
selectableFn(row, index) {
return row.status == 2 && row.sendOutMerchantId != null;
},
getBaseData(res) {
const allOpt = {
id: "",
......@@ -303,18 +307,6 @@ export default {
}
});
},
// 根据所选场景获取类目
// handleChangeSelect(value) {
// this.searchForm.goodsType = ''
// this.baseData.productTypeList = []
// getProductTypeBySceneId({ sceneType: value }).then(res => {
// this.baseData.productTypeList = res
// this.getBaseData()
// })
// },
// selectableFn(row, index) {
// return row.status == 1 && row.sendOutMerchantId != null
// },
beforeSearchFn() {
return new Promise((resolve) => {
......
......@@ -136,14 +136,10 @@
:visible.sync="allocateVisible"
@editClose="allocateClose">
</AllocateDialog>
<!-- :config="rejectConfig.setting" :dialog-config="rejectConfig.config" :config="rejectConfig.setting" -->
<baseDialog :dialog-config="rejectConfig.config"
:is-show.sync="rejectVisible"
@handleClick="handleRejectConfirm">
<!-- <d2-dialog v-if="rejectVisible" :is-visible="rejectVisible" title="驳回提2" @confirmDialog="handleRejectConfirm"
@closeDialog="handleRejectClose"> -->
<div class="reject-dialog" style="margin: 0;">
<div class="edit-page edit-tmpl">
<div class="title">
商品信息
......@@ -239,81 +235,8 @@
<p style="margin-left: 150px; color: #999999;">
说明:驳回后,整个采购订单进行驳回,无法再重新进行发货操作。
</p>
<div class="examine-record">
<div class="title">
审核记录
</div>
<div v-if="auditDetaiList && auditDetaiList.length"
class="up-down"
@click="handleUpDown">
<el-button :icon="isVisible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
size="mini"
type="text" />
{{ isVisible ? "收起" : "展开" }}
</div>
<div>
<div v-if="auditDetaiList && auditDetaiList.length" class="record-div">
<div v-for="(item, index) in auditDetaiList"
:key="index"
class="record-div-d">
<span class="dot"></span>
<span class="span-txt-one">{{ item.status ? $$(statusForShow, [item.status], 'text') : '' }}</span>
<span class="span-txt-two" style="display: inline-block; width: 116px;">
<span :class="item.status ? examineStatusClass[item.status] : ''">
{{ item.status ? $$(statusForShow, [item.status], 'status') : '' }}
</span>
<span v-if="item.rejectedStatus">
<span style="display: inline-block; margin: 0 8px;">至</span>
<span>{{ item.rejectedStatus ? $$(rejectedForShow, [item.rejectedStatus], 'rejectedStatus') : '' }}</span>
</span>
</span>
<span class="span-txt-two reviewer ellipsis">
审核人:
<el-tooltip class="item"
:content="item.reviewedBy"
effect="dark"
placement="bottom"
popper-class="remark-popper-class">
<el-button type="text">
{{ item.reviewedBy }}
</el-button>
</el-tooltip>
</span>
<span class="span-txt-two">审核时间:{{ item.reviewedDateFormat }}</span>
<span v-if="item.remark" class="span-txt-two">
备注:
<el-tooltip class="item"
:content="item.remark"
effect="dark"
placement="bottom"
popper-class="remark-popper-class">
<el-button type="text">
{{ item.remark ? (item.remark.length > 5 ? (`${item.remark.slice(0, 5)}...`) : item.remark) : '' }}
</el-button>
</el-tooltip>
</span>
<span v-if="[4, 6, 7, 9].includes(item.status)" class="span-txt-two">
驳回原因:
<el-tooltip class="item"
:content="item.rejectCause"
effect="dark"
placement="bottom"
popper-class="remark-popper-class">
<el-button type="text">
{{ item.rejectCause ? (item.rejectCause.length > 5 ? (`${item.rejectCause.slice(0, 5)}...`) : item.rejectCause) : '' }}
</el-button>
</el-tooltip>
</span>
</div>
</div>
<div v-else class="emptyCom">
<img alt=""
class="emptyImg"
:src="emptyImgUrl">
<span class="tips">暂无数据</span>
</div>
</div>
</div>
<ExamineRecord :list="originalAuditDetaiList" style="margin-top:20px;" />
</div>
<!-- <div class="footer">
<el-button @click="handleRejectClose">取消</el-button>
......@@ -369,7 +292,8 @@ import { deepClone, Util } from "@/common/util";
import { baseConfig } from "@/main";
import AllocateDialog from "./components/AllocateDialog";
import EditOrderDialog from "./components/EditOrderDialog";
import orderDeatilDialog from "./components/orderDetailDialog";
import ExamineRecord from "./components/examineRecord.vue";
import OrderDeatilDialog from "./components/orderDetailDialog";
import {
defaultDeliveryStatusOptions,
defaultPutStatusOptions,
......@@ -379,13 +303,14 @@ import {
rejectNodeOptions,
signStatusType,
} from "./constant";
// import { limitPrice } from '@/common/format'
export default {
name: "PurchaseAndDelivery",
components: {
OrderDeatilDialog: orderDeatilDialog,
OrderDeatilDialog,
EditOrderDialog,
AllocateDialog,
ExamineRecord,
},
data() {
return {
......@@ -443,8 +368,8 @@ export default {
7: "redSp",
8: "greenSp",
9: "redSp",
10: 'greenSp',
11: 'redSp'
10: "greenSp",
11: "redSp",
},
examineStatus: 1,
statusForShow: {
......@@ -455,8 +380,8 @@ export default {
7: { text: "采购驳回", status: "驳回" },
8: { text: "总监审核", status: "通过" },
9: { text: "总监审核", status: "驳回" },
10: { text: '经理通过', status: '通过' },
11: { text: '经理驳回', status: '驳回' },
10: { text: "经理通过", status: "通过" },
11: { text: "经理驳回", status: "驳回" },
},
rejectedForShow: {
1: { rejectedStatus: "采购商户" },
......@@ -1158,10 +1083,6 @@ export default {
}
});
},
handleUpDown() {
this.auditDetaiList = this.isVisible ? deepClone(this.originalAuditDetaiList.slice(0, 2)) : deepClone(this.originalAuditDetaiList);
this.isVisible = !this.isVisible;
},
rejectRefreshTable(pageObj) {
this.getDetail(pageObj);
},
......@@ -1180,7 +1101,6 @@ export default {
return item;
});
}
this.auditDetaiList = deepClone(this.originalAuditDetaiList.slice(0, 2));
});
},
// 批量分配
......@@ -1427,100 +1347,6 @@ export default {
vertical-align: middle;
}
.examine-record {
position: relative;
width: 850px;
min-height: 60px;
border-radius: 4px;
border: 1px solid #fafafa;
background: #fafafa;
margin-top: 23px;
.title {
margin: 16px 20px;
width: 64px;
height: 19px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
text-align: center;
}
.up-down {
position: absolute;
right: 20px;
top: 20px;
width: 42px;
height: 20px;
font-family: PingFangSC-Regular;
color: #2a58ad;
font-size: 12px;
cursor: pointer;
}
.dot {
width: 6px;
height: 6px;
background: #185efe;
border-radius: 6px;
display: inline-block;
}
.record-div {
margin: 16px 20px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
.record-div-d {
margin-top: 10px;
}
.span-txt-one {
margin-left: 14px;
width: 203px;
height: 21px;
}
.reviewer {
display: inline-block;
width: 140px;
}
.span-txt-two {
margin-left: 20px;
}
.greenSp {
color: #4aca74;
}
.redSp {
color: #eb4e4e;
}
}
.emptyCom {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.emptyImg {
width: 64px;
}
.tips {
font-size: 14px;
color: #999999;
margin: 20px 0;
}
}
}
.footer {
display: flex;
justify-content: flex-end;
......
......@@ -34,17 +34,27 @@
</div>
</div>
<div v-if="isBtn" class="btns">
<el-button type="text" @click="handleWorking(item)">
转入职
</el-button>
<el-button type="text" @click="handleEdit(item, index)">
编辑
</el-button>
<el-button type="text" @click="handleDelete(index)">
删除
</el-button>
<el-button v-if="isPendingTrial(item)" type="text" @click="handleEdit(item, index)">
编辑
</el-button>
<el-button v-if="isPendingTrial(item)" type="text" @click="handleResolve(item, index)">
处理
</el-button>
<el-button v-if="isPendingTrial(item)" type="text" @click="handleDelete(index)">
删除
</el-button>
<el-button v-if="isProcessedTrial(item)" type="text" @click="handleWorking(item)">
转入职
</el-button>
<el-button v-if="isProcessedTrial(item)" type="text" @click="handleViewResult(item)">
查看结果
</el-button>
</div>
<div else class="btns">
<el-button v-if="isProcessedTrial(item)" type="text" @click="handleViewResult(item)">
查看结果
</el-button>
</div>
</div>
</div>
</template>
......@@ -57,6 +67,9 @@
<!-- 新增试岗 -->
<glsk-form-dialog v-if="isAddVisible" ref="addResumeDialog" :base-data="baseData" default-width="406px" :dialog-config="isAddDialogConfig" :edit-data="isAddForm" :edit-form-data="isAddFormData" :form-rules="isAddRules" label-width="150px" :select-visible="isAddVisible" :slot-arr="slotArr" @handleAddSelectTypeConfirm="handleAddSelectTypeConfirm" @handleClose="isAddDialogVisible" @handleConfirm="handleAddConfirm" @handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
</glsk-form-dialog>
<!-- 试岗处理 -->
<glsk-form-dialog v-if="isResolveVisible" :base-data="baseData" default-width="406px" :dialog-config="isResolveDialogConfig" :edit-data="isResolveForm" :edit-form-data="isResolveFormData" :form-rules="isResolveRules" label-width="150px" :select-visible="isResolveVisible" @handleClose="isResolveDialogVisible" @handleConfirm="handleResolveConfirm">
</glsk-form-dialog>
</div>
</template>
......@@ -64,7 +77,6 @@
import GlOssApi from "glsk-oss-jssdk";
import { mapMutations } from "vuex";
import { addDict, deleteDict, getDictList, updateDict } from "@/api/recruitment";
import { interviewResultOpt, processResultOpt } from "@/common/constants.js";
import { deepClone, Util } from "@/common/util";
import { baseConfig } from "@/main";
......@@ -89,6 +101,7 @@ export default {
imgList: [],
detailVisible: false,
isAddVisible: false,
isResolveVisible: false,
slotArr: [],
trialOnboardingsData: [],
paramsObj: {},
......@@ -98,6 +111,10 @@ export default {
title: "新增简历",
okText: "确定",
},
isResolveDialogConfig: {
title: "试岗处理",
okText: "确定",
},
isAddRules: {
personName: [
{ required: true, message: "请输入人员姓名", trigger: "blur" },
......@@ -122,6 +139,11 @@ export default {
{ required: true, message: "请选择试岗时间", trigger: "change" },
],
},
isResolveRules: {
processResult: [
{ required: true, message: "请选择处理结果", trigger: "change" },
],
},
isAddForm: {
personName: "",
phoneNumber: "",
......@@ -174,9 +196,35 @@ export default {
dateType: "date",
},
],
isResolveForm: {
processResult: "",
processRemark: "",
},
isResolveFormData: [
{
label: "处理结果",
name: "processResult",
type: "radio",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "trialProcessResultOpt",
},
{
label: "说明",
name: "processRemark",
type: "textarea",
isClear: true,
showLimit: true,
maxlength: 200,
rows: 4,
},
],
baseData: {
interviewResultOpt,
processResultOpt,
trialProcessResultOpt: [
{ confId: 1, confValue: "通过" },
{ confId: 0, confValue: "不通过" },
],
channelData: [],
},
};
......@@ -267,6 +315,13 @@ export default {
this.uploadFileList = [];
this.isAddVisible = !this.isAddVisible;
},
isResolveDialogVisible() {
this.isResolveForm = {
processResult: "",
processRemark: "",
};
this.isResolveVisible = !this.isResolveVisible;
},
getCurrentDate() {
const time = new Date();
const y = time.getFullYear();
......@@ -280,6 +335,7 @@ export default {
data.trialTime
? (data.trialTime = Util.dateFormate(data.trialTime, "YYYY-MM-DD"))
: "";
data.processResult = null;
this.$emit("handleAddConfirm", data, this.isAdd, this.index);
this.isAddDialogVisible();
},
......@@ -313,6 +369,27 @@ export default {
this.checkParams(this.isAddForm);
this.updateParams(this.isAddForm);
},
handleResolve(data, index) {
this.index = index;
this.recordInfo = deepClone(data);
this.isResolveForm = {
processResult: "",
processRemark: "",
};
this.recordInfo.frontUpdatedDate = Util.dateFormate(new Date(), "YYYY-MM-DD HH:mm:ss");
this.recordInfo.processorName = this.userInfo.detail.userName;
console.log(this.recordInfo)
this.isResolveVisible = true;
},
handleResolveConfirm(data) {
const params = {
...this.recordInfo,
processResult: data.processResult,
processRemark: data.processRemark,
};
this.$emit("handleAddConfirm", params, false, this.index);
this.isResolveDialogVisible();
},
checkParams(data) {
if (!data)
return;
......@@ -429,6 +506,15 @@ export default {
handleWorking(data) {
this.$emit("handleWorking", data);
},
handleViewResult(data) {
this.$emit("handleViewResult", data);
},
isPendingTrial(item) {
return item?.processResult === null
},
isProcessedTrial(item) {
return !this.isPendingTrial(item)
},
handleDetailClose() {
this.detailVisible = !this.detailVisible;
},
......
......@@ -17,6 +17,7 @@
:trialOnboardings="detailInfo.trialOnboardings"
@handleAddConfirm="handleTrialConfirm"
@handleWorking="handleWorking"
@handleViewResult="handleViewResult"
:isBtn="isBtn"
></trialOnboard>
<!-- 入职计划 -->
......@@ -40,6 +41,18 @@
>取消</el-button
>
</div>
<glsk-form-dialog
v-if="trialViewResultVisible"
class="trial-view-result-dialog"
dialog-width="640px"
:dialog-config="trialViewDialogConfig"
:edit-data="trialViewResultForm"
:edit-form-data="trialViewResultFormData"
:select-visible="trialViewResultVisible"
@handleClose="handleTrialViewResultClose"
@handleConfirm="handleTrialViewResultClose"
>
</glsk-form-dialog>
</div>
</template>
<script>
......@@ -49,13 +62,73 @@ import { handleRecruitment } from "@/api/recruitment"
export default {
mixins: [recruitMixin],
data() {
const editItemStyle = {
marginBottom: "10px",
}
const contentStyle = {
width: "406px",
display: 'inline-block',
'word-break': 'break-all',
'white-space': 'pre-wrap',
'line-height': '22px',
'margin-top': '4px'
}
return {
loading: false,
btnLoding: false,
isBtn: true
isBtn: true,
trialViewResultVisible: false,
trialViewDialogConfig: {
title: "查看结果",
okText: "返回",
hideClose: true
},
trialViewResultForm: {},
trialViewResultFormData: [
{
label: "处理结果",
name: "processResult",
type: "showTxt",
formatter: (row) => {
const obj = {
"1": "通过",
"0": "不通过"
}
return obj[String(row.processResult)] || "-"
},
style: editItemStyle
},
{
label: "说明",
name: "processRemark",
type: "showTxt",
formatter: (row) => row.processRemark || "-",
style: editItemStyle,
txtStyle: contentStyle,
},
{
label: "处理人",
name: "processorName",
type: "showTxt",
style: editItemStyle
},
{
label: "处理时间",
name: "frontUpdatedDate",
type: "showTxt",
formatter: (row) => {
const date = row.frontUpdatedDate || row.updatedDate
return date ? Util.dateFormate(new Date(date), "YYYY-MM-DD HH:mm") : "-"
},
style: editItemStyle
}
]
}
},
methods: {
handleTrialViewResultClose() {
this.trialViewResultVisible = false
},
handleSave() {
this.btnLoding = true
let params = {
......@@ -99,6 +172,11 @@ export default {
this.$refs.entryInfo.handleEntry?.(true)
this.$refs.entryInfo.isEntryForm = deepClone({ ...obj, skillTagIds: [] })
},
// 试岗计划 - 查看结果
handleViewResult(data) {
this.trialViewResultForm = deepClone({ ...data })
this.trialViewResultVisible = true
},
//转试岗
handleTrial(data) {
let params = {
......@@ -253,4 +331,12 @@ export default {
scrollbar-color: transparent transparent;
scrollbar-width: thin;
}
::v-deep .trial-view-result-dialog .el-dialog__footer .el-button {
width: 56px !important;
padding: 8px 14px !important;
color: #666666 !important;
background: #e8e8e8 !important;
border-color: #e8e8e8 !important;
}
</style>
......@@ -8,6 +8,7 @@
<trialOnboard
:trialOnboardings="detailInfo.trialOnboardings"
:isBtn="isBtn"
@handleViewResult="handleViewResult"
></trialOnboard>
<entryInfo
:onboardingPlans="detailInfo.onboardingPlans"
......@@ -23,17 +24,87 @@
>关闭</el-button
>
</div>
<glsk-form-dialog
v-if="trialViewResultVisible"
class="trial-view-result-dialog"
dialog-width="640px"
:dialog-config="trialViewDialogConfig"
:edit-data="trialViewResultForm"
:edit-form-data="trialViewResultFormData"
:select-visible="trialViewResultVisible"
@handleClose="handleTrialViewResultClose"
@handleConfirm="handleTrialViewResultClose"
>
</glsk-form-dialog>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { recruitMixin } from "./components/recruitMixin"
export default {
mixins: [recruitMixin],
data() {
const editItemStyle = {
marginBottom: "10px",
}
const contentStyle = {
width: "406px",
display: 'inline-block',
'word-break': 'break-all',
'white-space': 'pre-wrap',
'line-height': '22px',
'margin-top': '4px'
}
return {
loading: false,
detailInfo: {},
isBtn: false
isBtn: false,
trialViewResultVisible: false,
trialViewDialogConfig: {
title: "查看结果",
okText: "返回",
hideClose: true
},
trialViewResultForm: {},
trialViewResultFormData: [
{
label: "处理结果",
name: "processResult",
type: "showTxt",
formatter: (row) => {
const obj = {
"1": "通过",
"0": "不通过"
}
return obj[String(row.processResult)] || "-"
},
style: editItemStyle
},
{
label: "说明",
name: "processRemark",
type: "showTxt",
formatter: (row) => row.processRemark || "-",
style: editItemStyle,
txtStyle: contentStyle,
},
{
label: "处理人",
name: "processorName",
type: "showTxt",
style: editItemStyle
},
{
label: "处理时间",
name: "frontUpdatedDate",
type: "showTxt",
formatter: (row) => {
const date = row.frontUpdatedDate || row.updatedDate
return date ? Util.dateFormate(new Date(date), "YYYY-MM-DD HH:mm") : "-"
},
style: editItemStyle
}
]
}
},
mounted() {
......@@ -42,7 +113,15 @@ export default {
methods: {
handleCancel() {
this.$router.push("/recruitmentManagement")
}
},
// 试岗计划 - 查看结果
handleViewResult(data) {
this.trialViewResultForm = deepClone({ ...data })
this.trialViewResultVisible = true
},
handleTrialViewResultClose() {
this.trialViewResultVisible = false
},
}
}
</script>
......@@ -131,4 +210,12 @@ export default {
scrollbar-color: transparent transparent;
scrollbar-width: thin;
}
::v-deep .trial-view-result-dialog .el-dialog__footer .el-button {
width: 56px !important;
padding: 8px 14px !important;
color: #666666 !important;
background: #e8e8e8 !important;
border-color: #e8e8e8 !important;
}
</style>
<!-- 库存管理 -->
<template>
<div>
<d2-container>
<template #header>
<div class="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm" />
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:当前库存<span class="count-txt">{{ statisticsData }}</span>
</span>
</template>
<div>
<auth-button category="Button" />
</div>
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<auth-button :data="scope.scope" />
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<StockMonthDialog v-if="stockMonthVisible"
:record-info="recordInfo"
:stock-month-visible="stockMonthVisible"
@dialogClose="dialogClose" />
<StockDetailDialog v-if="stockDetailDialogVisible"
:record-info="recordInfo"
:visible.sync="stockDetailDialogVisible">
</StockDetailDialog>
<StatementOfAccountDialog v-if="statementOfAccountDialogVisible"
:visible.sync="statementOfAccountDialogVisible"
:yq-merchant-list="baseData.yqMerchantList"
@handleRelateProConfirm="handleRelateProConfirm">
</StatementOfAccountDialog>
</div>
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm" />
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<template #left>
<span class="leftSpan">
合计:当前库存<span class="count-txt">{{ statisticsData }}</span>
</span>
</template>
<div>
<auth-button category="Button" />
</div>
</d2-table-header>
<d2-table ref="recordTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template #auth-button="scope">
<auth-button :data="scope.scope" />
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<StockMonthDialog v-if="stockMonthVisible" :record-info="recordInfo" :stock-month-visible="stockMonthVisible"
@dialogClose="dialogClose" />
<StockDetailDialog v-if="stockDetailDialogVisible" :record-info="recordInfo"
:visible.sync="stockDetailDialogVisible">
</StockDetailDialog>
<StatementOfAccountDialog v-if="statementOfAccountDialogVisible" :visible.sync="statementOfAccountDialogVisible"
:yq-merchant-list="baseData.yqMerchantList" @handleRelateProConfirm="handleRelateProConfirm">
</StatementOfAccountDialog>
</div>
</template>
<script>
......@@ -248,6 +232,7 @@ export default {
// 库存记录统计
stockMonthReportCount() {
this.beforeSearchFn()
stockMonthReportCount(this.searchFormSearch).then((res) => {
this.statisticsData = res;
});
......
<!-- 商务审核 -->
<template>
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<!-- <span slot="left"
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm" />
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<!-- <span slot="left"
v-if="!userInfo.beSuper && userInfo.beYQMerchant">
<auth-button category="Button"
:show-btn-ids="['9080501']" />
</span> -->
<auth-button category="Button" :show-btn-ids="['9081001']" />
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<div>
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081002']" />
</span>
<span v-if="scope.scope.billStatus == 2" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081003']" />
</span>
<span v-if="scope.scope.billStatus == 2" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081004']" />
</span>
</div>
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<TransferDetailDialog v-if="transferDetailVisible"
:hide-contact="true"
:params-obj="transferObj"
:visible.sync="transferDetailVisible" />
</div>
<auth-button category="Button" :show-btn-ids="['9081001']" />
</d2-table-header>
<d2-table ref="recordTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template #auth-button="scope">
<div>
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081002']" />
</span>
<span v-if="scope.scope.billStatus == 2" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081003']" />
</span>
<span v-if="scope.scope.billStatus == 2" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081004']" />
</span>
</div>
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<TransferDetailDialog v-if="transferDetailVisible" :hide-contact="true" :is-store="true" :params-obj="transferObj"
:visible.sync="transferDetailVisible" />
</div>
</template>
<script>
......@@ -338,7 +328,7 @@ export default {
if (
this.baseData[item.optionsName].length
&& this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {};
......@@ -472,6 +462,7 @@ export default {
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
......
<!-- 运营审核 -->
<template>
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<!-- <span slot="left"
<div>
<d2-container>
<template #header>
<div class="header" style="padding: 10px 20px">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm" />
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<!-- <span slot="left"
v-if="!userInfo.beSuper && userInfo.beYQMerchant">
<auth-button category="Button"
:show-btn-ids="['9080501']" />
</span> -->
<auth-button category="Button" :show-btn-ids="['9080901']" />
</d2-table-header>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<div>
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080902']" />
</span>
<span v-if="scope.scope.billStatus == 1" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080903']" />
</span>
<span v-if="scope.scope.billStatus == 1" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080904']" />
</span>
</div>
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<TransferDetailDialog v-if="transferDetailVisible"
:hide-contact="true"
:params-obj="transferObj"
:visible.sync="transferDetailVisible" />
</div>
<auth-button category="Button" :show-btn-ids="['9080901']" />
</d2-table-header>
<d2-table ref="recordTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template #auth-button="scope">
<div>
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080902']" />
</span>
<span v-if="scope.scope.billStatus == 1" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080903']" />
</span>
<span v-if="scope.scope.billStatus == 1" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9080904']" />
</span>
</div>
</template>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<TransferDetailDialog v-if="transferDetailVisible" :hide-contact="true" :is-store="false" :params-obj="transferObj"
:visible.sync="transferDetailVisible" />
</div>
</template>
<script>
......@@ -332,7 +322,7 @@ export default {
if (
this.baseData[item.optionsName].length
&& this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {};
......@@ -446,6 +436,7 @@ export default {
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
......
......@@ -62,8 +62,8 @@
<auth-button :data="scope.scope"
:show-btn-ids="['9063002']" />
</span>
<!-- 自定义周期 -->
<span v-if="scope.scope.report_type.includes('门店产值及个人成交排名') || scope.scope.report_type.includes('BI数据分析表')"
<!-- 自定义周期:门店产值及个人成交排名 / BI数据分析表 / 无日报门店产值表 -->
<span v-if="isCustomPeriodReportType(scope.scope.report_type)"
style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9063003']" />
......@@ -279,6 +279,19 @@ export default {
// }),
// ...mapActions('d2admin/user', ['actionSetDownloadList']),
/**
* 是否展示「自定义周期」按钮(与 common/constants.js downloadReportManage_reportType 中报表名称一致)
*/
isCustomPeriodReportType(reportType) {
if (!reportType || typeof reportType !== "string") return false;
const keywords = [
"门店产值及个人成交排名",
"BI数据分析表",
"无日报门店产值表",
];
return keywords.some((k) => reportType.includes(k));
},
async getBaseData() {
this.getOptionsList();
},
......
......@@ -1035,6 +1035,9 @@ import {
import {
mapProductSearchListToUpgradeGoodsOptions,
resolveProductSearchPages,
sameUpgradeGoodsRow,
getUpgradeGoodsRowKey,
filterUpgradeGoodsByMerchantCode,
} from "../../merchantStep/utils/groundingUpgradeList";
import { divisionRuleTestGet } from "@api/merchant";
// 1按毛利比例;2按收入比例;3按固定金额
......@@ -1313,7 +1316,7 @@ export default {
const list = this.selectUpgradeGoodsList.filter((item) => {
if (
selectList.findIndex((el) => {
return el.upgradeGoodsId == item.upgradeGoodsId;
return sameUpgradeGoodsRow(el, item);
}) == -1
) {
return item;
......@@ -1509,7 +1512,9 @@ export default {
"upgradeGoodsList": {
handler(val) {
if (val) {
this.copyUpgradeGoodsList = deepClone(val);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(val),
);
}
},
},
......@@ -1530,7 +1535,7 @@ export default {
if (oldVal && val?.length < oldVal?.length) {
const deleteItem = oldVal.find(
item =>
!val.some(el => el.upgradeGoodsId == item.upgradeGoodsId),
!val.some(el => sameUpgradeGoodsRow(el, item)),
);
this.emitClassificationChange(
CLASSIFICATION_EMIT.DELETE_UPGRADE_GOODS_ITEM,
......@@ -1611,7 +1616,9 @@ export default {
},
mounted() {
// this.init4sServiceList()
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList),
);
this.copyPackageGoodsList = deepClone(this.packageGoodsList);
this.$nextTick(() => this.replayPendingCalculateErrorOps());
},
......@@ -1630,7 +1637,7 @@ export default {
if (!item || !Array.isArray(list))
return false;
return (
list.findIndex(el => el.upgradeGoodsId == item.upgradeGoodsId) !== -1
list.findIndex(el => sameUpgradeGoodsRow(el, item)) !== -1
);
},
filterPackageGoodsItemDisabled(item, list) {
......@@ -1674,7 +1681,9 @@ export default {
"upgradeGoods",
"packageGoods",
]);
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList);
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList),
);
this.copyPackageGoodsList = deepClone(this.packageGoodsList);
this.emitClassificationChange(
CLASSIFICATION_EMIT.DELETE_SELECT_GOODS_TYPE_LIST,
......@@ -1834,6 +1843,7 @@ export default {
let arr = this.copyUpgradeGoodsList.concat(resArr);
if (defaultSelect?.length)
arr = arr.concat(defaultSelect);
arr = filterUpgradeGoodsByMerchantCode(arr);
this.copyUpgradeGoodsList = this.unique(arr);
})
.catch((err) => {
......@@ -1843,9 +1853,11 @@ export default {
},
unique(arr) {
const res = new Map();
return arr.filter(
a => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1),
);
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a);
if (!k) return false;
return !res.has(k) && res.set(k, 1);
});
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = []) {
......@@ -2258,6 +2270,11 @@ export default {
= v && typeof v === "object" ? [v] : v ? [v] : [];
}
});
if (this.classificationObj.categoryType === 2) {
this.classificationObj.upgradeGoods = filterUpgradeGoodsByMerchantCode(
this.classificationObj.upgradeGoods
);
}
/*
* 整表深拷贝:与父级/接口合并后的数据断开引用,避免表单编辑意外回写共享对象。
* 代价:分类结构大或多 tab 时 clone 成本高;后续优化可优先考虑「仅对变更节点 $set」而非每次 init 全量 clone。
......
......@@ -84,13 +84,13 @@
:remote-method="remoteMethod"
popper-class="classification-upgrade-goods-popper"
style="width: 370px"
value-key="upgradeGoodsId"
value-key="merchantGoodsCode"
filterable
@visible-change="visibleChange"
@change="upgradeGoodsChange">
<el-option v-for="subItem in copyUpgradeGoodsList"
:key="subItem.upgradeGoodsId"
:label="`${subItem.upgradeGoodsName}(${subItem.commodityCode})`"
:key="subItem.merchantGoodsCode"
:label="`${subItem.upgradeGoodsName}(${subItem.merchantGoodsCode})`"
:disabled="filterUpgradeGoodsItemDisabled(subItem, disabledUpgradeGoodsList)"
:value="subItem" />
</el-select>
......
......@@ -174,8 +174,11 @@ import {
merchantPackageGoodsInfoPage
} from "@api/grounding"
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
mapProductSearchListToUpgradeGoodsOptions,
resolveProductSearchPages
resolveProductSearchPages,
filterUpgradeGoodsByMerchantCode
} from "../merchantStep/utils/groundingUpgradeList"
import {
fillDjGoodsTypeGroupRelations,
......@@ -638,7 +641,7 @@ export default {
*
* 【提交性能优化】千 Tab × 多商品时 deepClone 每一条会占用大量时间与内存。
* 下游 classificationCpt 的 disabledGoodsTypeList / disabledUpgradeGoodsList /
* disabledPackageGoodsList 仅按 goodsType、upgradeGoodsId、packageCode 与展示名字段比对,
* disabledPackageGoodsList 仅按 goodsType、merchantGoodsCode(具体商品)、packageCode 与展示名字段比对,
* 无深层嵌套依赖,故聚合时使用 { ...item } 浅拷贝即可,语义与跨 Tab 互斥一致。
*/
rebuildCrossTabGoodsSelectionsFromRules() {
......@@ -806,6 +809,7 @@ export default {
ruleAuditSituation({
merchantId,
sceneType,
baseSceneCode: resolveBaseSceneCodeFromRouter(this.routerInfo),
ruleType: 1
})
.then((res) => {
......@@ -1093,16 +1097,15 @@ export default {
// 取消选中具体商品
deleteUpgradeGoodsItem(item) {
this.selectUpgradeGoodsList = this.selectUpgradeGoodsList.filter(
(el) => el?.upgradeGoodsId != item?.upgradeGoodsId
(el) => !sameUpgradeGoodsRow(el, item)
)
},
assignUpgradeGoodsList(list) {
const newDatas = [...this.selectUpgradeGoodsList, ...list]
const hash = {}
this.selectUpgradeGoodsList = newDatas.reduce((item, next) => {
hash[next?.upgradeGoodsId]
? ""
: (hash[next?.upgradeGoodsId] = true && item.push(next))
const k = getUpgradeGoodsRowKey(next)
hash[k] ? "" : (hash[k] = true && item.push(next))
return item
}, [])
// console.log(list, this.selectUpgradeGoodsList, 'this.selectUpgradeGoodsList')
......@@ -1611,6 +1614,7 @@ export default {
const resArr = mapProductSearchListToUpgradeGoodsOptions(res.list)
let arr = this.upgradeGoodsList.concat(resArr)
if (defaultSelect?.length) arr = arr.concat(defaultSelect)
arr = filterUpgradeGoodsByMerchantCode(arr)
this.upgradeGoodsList = this.unique(arr)
})
.catch((err) => {
......@@ -1620,9 +1624,11 @@ export default {
},
unique(arr) {
const res = new Map()
return arr.filter(
(a) => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1)
)
return arr.filter((a) => {
const k = getUpgradeGoodsRowKey(a)
if (!k) return false
return !res.has(k) && res.set(k, 1)
})
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = []) {
......@@ -2057,9 +2063,7 @@ export default {
this.selectUpgradeGoodsList = this.selectUpgradeGoodsList.reduce(
(arr, item) => {
if (
list.findIndex(
(el) => item?.upgradeGoodsId == el?.upgradeGoodsId
) == -1
list.findIndex((el) => sameUpgradeGoodsRow(item, el)) == -1
) {
arr.push(item)
}
......
import { deepClone } from "@/common/util"
import {
filterUpgradeGoodsByMerchantCode,
trimMerchantGoodsCode
} from "../../merchantStep/utils/groundingUpgradeList"
/**
* 按 goodsTypes[0].categoryType 将接口 goodsTypes 归一为 classification 表单字段,
......@@ -22,13 +26,17 @@ export function normalizeRuleGoodsTypesForCategory(item, upgradeArr, packageArr)
return
}
if (categoryType == 2) {
item.upgradeGoods = deepClone(item.goodsTypes)
const withCode = filterUpgradeGoodsByMerchantCode(item.goodsTypes)
item.upgradeGoods = deepClone(withCode)
item.categoryType = 2
item.goodsTypes.forEach((val) => {
withCode.forEach((val) => {
const code = trimMerchantGoodsCode(val)
if (!code) return
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode
commodityCode: code,
merchantGoodsCode: code
})
})
item.goodsTypes = []
......
......@@ -50,9 +50,9 @@
<el-select v-model="classificationObj.upgradeGoods" multiple collapse-tags remote reserve-keyword
placeholder="请选择商品" @change="emitUserClassificationTouched" @visible-change="visibleChange" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" style="width: 320px" popper-class="class123"
value-key="upgradeGoodsId" filterable>
<el-option v-for="subItem in copyUpgradeGoodsList" :key="subItem.upgradeGoodsId"
:label="`${subItem.upgradeGoodsName}(${subItem.commodityCode})`" :disabled="subItem | filterupgradeGoodsItem(disabledUpgradeGoodsList)
value-key="merchantGoodsCode" filterable>
<el-option v-for="subItem in copyUpgradeGoodsList" :key="subItem.merchantGoodsCode"
:label="`${subItem.upgradeGoodsName}(${subItem.merchantGoodsCode})`" :disabled="subItem | filterupgradeGoodsItem(disabledUpgradeGoodsList)
" :value="subItem">
</el-option>
</el-select>
......@@ -788,8 +788,10 @@ import { createElSelectLoadmoreDirective } from "../utils/selectLoadmoreDirectiv
import {
mapProductSearchListToUpgradeGoodsOptions,
resolveProductSearchPages,
sameUpgradeGoodsRow,
uniqueUpgradeGoodsById,
uniquePackageByPackageCode
uniquePackageByPackageCode,
filterUpgradeGoodsByMerchantCode
} from "../utils/groundingUpgradeList"
import { CLASSIFICATION_EMIT } from "../../financialRules/utils/classificationEmitTypes"
export default {
......@@ -998,7 +1000,7 @@ export default {
const list = this.selectUpgradeGoodsList.filter((item) => {
if (
selectList.findIndex((el) => {
return el.upgradeGoodsId == item?.upgradeGoodsId
return sameUpgradeGoodsRow(el, item)
}) == -1
) {
return item
......@@ -1029,7 +1031,7 @@ export default {
// 过滤具体商品
filterupgradeGoodsItem(item, list) {
return (
list.findIndex((el) => el.upgradeGoodsId == item.upgradeGoodsId) != -1
list.findIndex((el) => sameUpgradeGoodsRow(el, item)) != -1
)
},
// 过滤套餐商品
......@@ -1087,7 +1089,9 @@ export default {
upgradeGoodsList: {
handler(val, oldVal) {
if (val) {
this.copyUpgradeGoodsList = deepClone(val)
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(val)
)
}
},
deep: true
......@@ -1108,7 +1112,7 @@ export default {
if (oldVal && val?.length < oldVal?.length) {
// 对比出已经取消的商品
const deleteItem = oldVal.find((item) => {
if (!val.find((el) => el.upgradeGoodsId == item.upgradeGoodsId)) {
if (!val.find((el) => sameUpgradeGoodsRow(el, item))) {
return item
}
})
......@@ -1214,7 +1218,9 @@ export default {
this.getRowItem()
},
mounted() {
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList)
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList)
)
this.copyPackageGoodsList = deepClone(this.packageGoodsList)
},
......@@ -1242,7 +1248,9 @@ export default {
"upgradeGoods",
"packageGoods"
])
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList)
this.copyUpgradeGoodsList = filterUpgradeGoodsByMerchantCode(
deepClone(this.upgradeGoodsList)
)
this.copyPackageGoodsList = deepClone(this.packageGoodsList)
// 清空 商品分类 具体商品 套餐商品
this.emitClassificationChange(
......@@ -1401,6 +1409,7 @@ export default {
const resArr = mapProductSearchListToUpgradeGoodsOptions(res.list)
let arr = this.copyUpgradeGoodsList.concat(resArr)
if (defaultSelect?.length) arr = arr.concat(defaultSelect)
arr = filterUpgradeGoodsByMerchantCode(arr)
this.copyUpgradeGoodsList = uniqueUpgradeGoodsById(arr)
})
.catch(() => { })
......@@ -1912,6 +1921,11 @@ export default {
checkRecordItem?.upgradeGoods || []
that.classificationObj.packageGoods =
checkRecordItem?.packageGoods || []
if (that.classificationObj.categoryType === 2) {
that.classificationObj.upgradeGoods = filterUpgradeGoodsByMerchantCode(
that.classificationObj.upgradeGoods
)
}
that.classificationObj.flowCostArr = that.getClassificationObjFormat(
that.classificationObj.flowCostArr,
checkRecordItem?.expenseCategoryRules || [],
......@@ -1981,6 +1995,11 @@ export default {
},
// 换成后端数据结构
getBackendFormat() {
if (this.classificationObj.categoryType === 2) {
this.classificationObj.upgradeGoods = filterUpgradeGoodsByMerchantCode(
this.classificationObj.upgradeGoods || []
)
}
const flowServiceCostArr = [
...this.classificationObj.flowCostArr,
...this.classificationObj.serviceCostArr,
......
......@@ -132,10 +132,13 @@ import {
import { financialRulePayloadDeepEqual } from "../financialRules/utils/rulePayloadCanonicalCompare"
import { CLASSIFICATION_EMIT } from "../financialRules/utils/classificationEmitTypes"
import {
getUpgradeGoodsRowKey,
sameUpgradeGoodsRow,
mapProductSearchListToUpgradeGoodsOptions,
resolveProductSearchPages,
uniqueUpgradeGoodsById,
uniquePackageByPackageCode
uniquePackageByPackageCode,
filterUpgradeGoodsByMerchantCode
} from "./utils/groundingUpgradeList"
import { normalizeReconciliationRuleForCompare } from "./utils/normalizeReconciliationRuleForCompare"
import { getEffectivePhantomFullCategoryRuleRaw as resolveEffectivePhantomRaw } from "./utils/effectivePhantomReconciliationRule"
......@@ -967,7 +970,7 @@ export default {
const { merchantId, scene: sceneType } = this.routerInfo
ruleAuditSituation({
merchantId,
sceneType,
baseSceneCode: resolveBaseSceneCodeFromRouter(this.routerInfo),
ruleType: 3
})
.then((res) => {
......@@ -1077,7 +1080,7 @@ export default {
assignUpgradeGoodsList(list) {
this.selectUpgradeGoodsList = uniqueBy(
[...this.selectUpgradeGoodsList, ...list],
(x) => x?.upgradeGoodsId
(x) => getUpgradeGoodsRowKey(x)
)
},
// 取消选中套餐商品
......@@ -1111,6 +1114,7 @@ export default {
let arr = this.upgradeGoodsList.concat(resArr)
if (defaultSelect?.length) arr = arr.concat(defaultSelect)
arr = filterUpgradeGoodsByMerchantCode(arr)
this.upgradeGoodsList = uniqueUpgradeGoodsById(arr)
})
.catch(() => { })
......@@ -1302,7 +1306,7 @@ export default {
},
deleteUpgradeGoodsItem(item) {
this.selectUpgradeGoodsList = this.selectUpgradeGoodsList.filter(
(el) => el?.upgradeGoodsId != item?.upgradeGoodsId
(el) => !sameUpgradeGoodsRow(el, item)
)
},
deleteSelectUpgradeGoodsList(list) {
......@@ -1310,9 +1314,7 @@ export default {
(arr, item) => {
if (
list &&
list.findIndex(
(el) => item?.upgradeGoodsId == el?.upgradeGoodsId
) == -1
list.findIndex((el) => sameUpgradeGoodsRow(item, el)) == -1
) {
arr.push(item)
}
......
......@@ -2,17 +2,66 @@
* merchantGoodsInfo.rule.selectList 返回的扁平 list(upgradeGoodsId / goodsShowName / merchantGoodsCode)
* → 分账「具体商品」下拉统一结构
* @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, merchantGoodsCode?: *}>|undefined} list
* @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string}>}
* @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string, merchantGoodsCode: string}>}
*/
export function mapProductSearchListToUpgradeGoodsOptions(list) {
return (list || []).map((row) => {
const upgradeGoodsId = row && row.upgradeGoodsId
const upgradeGoodsName =
row && row.goodsShowName != null ? String(row.goodsShowName) : ""
const commodityCode =
row && row.merchantGoodsCode != null ? String(row.merchantGoodsCode) : ""
return { upgradeGoodsId, upgradeGoodsName, commodityCode }
})
return (list || [])
.map((row) => {
const upgradeGoodsId = row && row.upgradeGoodsId
const upgradeGoodsName =
row && row.goodsShowName != null ? String(row.goodsShowName) : ""
const rawCode = row && row.merchantGoodsCode
const merchantGoodsCode =
rawCode != null && String(rawCode).trim() !== ""
? String(rawCode).trim()
: ""
const commodityCode = merchantGoodsCode
return { upgradeGoodsId, upgradeGoodsName, commodityCode, merchantGoodsCode }
})
.filter((row) => row.merchantGoodsCode !== "")
}
/**
* @param {object|undefined} row
* @returns {string} trim 后非空则返回,否则 ""
*/
export function trimMerchantGoodsCode(row) {
if (!row || typeof row !== "object") return ""
if (row.merchantGoodsCode == null) return ""
const t = String(row.merchantGoodsCode).trim()
if (t === "" || t === "null" || t === "undefined") return ""
return t
}
/**
* 仅保留含非空 trim 后 merchantGoodsCode 的具体商品行(不依赖 commodityCode)。
* @param {Array|undefined} arr
* @returns {Array}
*/
export function filterUpgradeGoodsByMerchantCode(arr) {
return (arr || []).filter((row) => trimMerchantGoodsCode(row) !== "")
}
/**
* 具体商品行主键:仅 merchantGoodsCode(trim);无码返回 ""
* @param {object|undefined} row
* @returns {string}
*/
export function getUpgradeGoodsRowKey(row) {
const code = trimMerchantGoodsCode(row)
if (!code) return ""
return `c:${code}`
}
/**
* @param {object|undefined} a
* @param {object|undefined} b
* @returns {boolean}
*/
export function sameUpgradeGoodsRow(a, b) {
const ka = getUpgradeGoodsRowKey(a)
const kb = getUpgradeGoodsRowKey(b)
return ka !== "" && ka === kb
}
/**
......@@ -21,11 +70,14 @@ export function mapProductSearchListToUpgradeGoodsOptions(list) {
export function flatMapUpgradeGoodsFromGoodsListPage(list) {
return (list || []).reduce((arr, val) => {
;(val.upgradeGoodsList || []).forEach((el) => {
const { upgradeGoodsName, id, commodityCode } = el
const { upgradeGoodsName, id, merchantGoodsCode: mg } = el
const code = mg != null && String(mg).trim() !== "" ? String(mg).trim() : ""
if (!code) return
arr.push({
upgradeGoodsId: id,
upgradeGoodsName,
commodityCode
commodityCode: code,
merchantGoodsCode: code
})
})
return arr
......@@ -55,9 +107,11 @@ export function resolveProductSearchPages(res, currentPage, pageSize) {
export function uniqueUpgradeGoodsById(arr) {
const res = new Map()
return arr.filter(
(a) => !res.has(a.upgradeGoodsId) && res.set(a.upgradeGoodsId, 1)
)
return (arr || []).filter((a) => {
const k = getUpgradeGoodsRowKey(a)
if (!k) return false
return !res.has(k) && res.set(k, 1)
})
}
/**
......
......@@ -2,6 +2,10 @@
* B4(长期):与 financialRules 等页的同类归一逻辑可逐步迁入本目录或 merchant/shared,避免多处拷贝。
*/
import { deepClone } from "@/common/util"
import {
filterUpgradeGoodsByMerchantCode,
trimMerchantGoodsCode
} from "./groundingUpgradeList"
/**
* 将列表项中的 goodsTypeGroupRelations 同步到对账规则槽位(upgradeGoods / packageGoods / 分类)
......@@ -20,13 +24,17 @@ export function applyGoodsTypeGroupRelationBranches(
if (!item?.goodsTypeGroupRelations?.length) return
const ct = item.goodsTypeGroupRelations[0]?.categoryType
if (ct == 2) {
ruleSlot.upgradeGoods = deepClone(item.goodsTypeGroupRelations)
const rel = filterUpgradeGoodsByMerchantCode(item.goodsTypeGroupRelations)
ruleSlot.upgradeGoods = deepClone(rel)
ruleSlot.categoryType = 2
item.goodsTypeGroupRelations.forEach((val) => {
rel.forEach((val) => {
const code = trimMerchantGoodsCode(val)
if (!code) return
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode
commodityCode: code,
merchantGoodsCode: code
})
})
ruleSlot.goodsTypeGroupRelations = []
......
import { deepClone } from "@/common/util"
import { uniqueBy } from "./arrayUniqueBy"
import { getUpgradeGoodsRowKey } from "./groundingUpgradeList"
/**
* 商户对账 / 财务分账共用:嘀加商品来源 + 特殊品类时补齐 goodsTypeGroupRelations。
......@@ -111,7 +112,9 @@ export function rebuildCrossTabReconciliationSelections(
goodsAgg.push(deepClone(item))
}
const pushU = (item) => {
if (!item || item.upgradeGoodsId == null) return
if (!item) return
const k = getUpgradeGoodsRowKey(item)
if (!k) return
upgradeAgg.push(deepClone(item))
}
const pushP = (item) => {
......@@ -135,7 +138,7 @@ export function rebuildCrossTabReconciliationSelections(
goodsSelectList: uniqueBy(goodsAgg, (x) => x.goodsType),
selectUpgradeGoodsList: uniqueBy(
upgradeAgg,
(x) => x && x.upgradeGoodsId
(x) => getUpgradeGoodsRowKey(x)
),
selectPackageGoodsList: uniqueBy(
packageAgg,
......@@ -171,8 +174,9 @@ export function rebuildFinancialCrossTabGoodsSelections(rules) {
}
}
const pushU = (item) => {
if (!item || item.upgradeGoodsId == null) return
const k = item.upgradeGoodsId
if (!item) return
const k = getUpgradeGoodsRowKey(item)
if (!k) return
if (!hashU[k]) {
hashU[k] = true
upgradeAgg.push(typeof item === "object" ? { ...item } : item)
......
......@@ -74,18 +74,18 @@ const cdn = {
`${CDN_DOMAIN}/js.cookie.min.js`,
`${CDN_DOMAIN}/nprogress.min.js`,
`${CDN_DOMAIN}/echarts.min.js`,
// `${CDN_DOMAIN}/lodash.min.js`,
`${CDN_DOMAIN}/qs.min.js`,
`${CDN_DOMAIN}/ua-parser.min.js`,
`${CDN_DOMAIN}/html2canvas.min.js`,
`${CDN_DOMAIN}/element-ui.min.js`,
`${CDN_DOMAIN}/better-scroll.min.js`,
`${CDN_DOMAIN}/dayjs.min.js`,
`${CDN_DOMAIN}/xlsx.min.js`,
// `${CDN_DOMAIN}/lodash.min.js`,
// `${CDN_DOMAIN}/better-scroll.min.js`,
// `https://cdn.bootcdn.net/ajax/libs/better-scroll/2.4.2/better-scroll.min.js`,
// `https://img01.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/better-scroll.min.js`,
`${CDN_DOMAIN}/dayjs.min.js`,
// `${CDN_DOMAIN}/vue-qr.js`,
`${CDN_DOMAIN}/xlsx.min.js`,
// `${CDN_DOMAIN}/flex.css`
],
};
......@@ -159,8 +159,9 @@ module.exports = {
dayjs: "dayjs",
// "vue-qr": "vue-qr",
xlsx: "XLSX",
// 模块名须与 import 路径一致:import BScroll from 'better-scroll'
"better-scroll": "BScroll",
// 与 CDN UMD 全局名一致(非 BScroll)
// "better-scroll": "BetterScroll",
BScroll: "better-scroll",
// lodash: "_",
};
}
......@@ -226,7 +227,7 @@ module.exports = {
configFile: path.resolve(__dirname, ".sentryclirc"),
// 与部署路径一致,便于 Sentry 将 map 与线上资源对齐
urlPrefix: `~${publicPath}`,
}),
})
);
}
......@@ -282,12 +283,12 @@ module.exports = {
// optional. Resolve result css code as you wish.
return resultCss.replace(
/process.env.VUE_APP_ELEMENT_COLOR/g,
process.env.VUE_APP_ELEMENT_COLOR,
process.env.VUE_APP_ELEMENT_COLOR
);
},
matchColors: [
...forElementUI.getElementUISeries(
process.env.VUE_APP_ELEMENT_COLOR,
process.env.VUE_APP_ELEMENT_COLOR
), // Element-ui主色系列
],
externalCssFiles: [
......@@ -301,7 +302,7 @@ module.exports = {
.when(
process.env.NODE_ENV === "development",
// sourcemap不包含列信息
(config) => config.devtool("cheap-source-map"),
(config) => config.devtool("cheap-source-map")
)
// TRAVIS 构建 vue-loader 添加 filename
.when(
......@@ -309,7 +310,7 @@ module.exports = {
process.env.NODE_ENV === "development",
VueFilenameInjector(config, {
propName: process.env.VUE_APP_SOURCE_VIEWER_PROP_NAME,
}),
})
);
// svg
const svgRule = config.module.rule("svg");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!