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