Commit 9c3b08c6 by 张立顺

feat 功能联调

1 parent 92a16697
...@@ -20,16 +20,22 @@ export function getProductManageListPageSku(data) { ...@@ -20,16 +20,22 @@ export function getProductManageListPageSku(data) {
return request(data); return request(data);
} }
// 新增产品 // 新增产品:所有参数转 json 字符串赋值到 requestJson
export function addProductManage(data) { export function addProductManage(data) {
data.method = `${path}productManager.add`; const requestData = {
return request(data, "post"); method: `${path}productManager.add`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
} }
// 编辑产品 // 编辑产品:所有参数转 json 字符串赋值到 requestJson
export function UpdateProductManage(data) { export function UpdateProductManage(data) {
data.method = `${path}productManager.update`; const requestData = {
return request(data, "post"); method: `${path}productManager.update`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
} }
// 获取权益/升级类目服务项目 // 获取权益/升级类目服务项目
...@@ -85,3 +91,9 @@ export function getBaseGoodsOperationLogPage(data) { ...@@ -85,3 +91,9 @@ export function getBaseGoodsOperationLogPage(data) {
data.method = "dj.api.basegoods.get.goods.operationLog.page"; data.method = "dj.api.basegoods.get.goods.operationLog.page";
return request(data); return request(data);
} }
// 删除 SKU(升级商品)
export function upgradeGoodsDelete(data) {
data.method = "dj.smartcarlife.api.upgradegoods.delete";
return request(data, "post");
}
...@@ -360,10 +360,22 @@ ...@@ -360,10 +360,22 @@
v-if=" v-if="
item.type === 'photo' || item.type === 'photo' ||
item.type === 'video' || item.type === 'video' ||
item.type === 'descList' item.type === 'descList' ||
item.type === 'radio'
" "
> >
<template v-if="item.type === 'photo'"> <template v-if="item.type === 'radio'">
<el-radio-group v-model="formData[item.name]" :disabled="item.isDisabled || pageData.pageDisabled" @change="item.name === 'accessoryType' && handleAccessoryTypeChange()">
<el-radio
v-for="(opt, optIdx) in (item.radioOptions || [])"
:key="optIdx"
:label="opt.value"
>
{{ opt.label }}
</el-radio>
</el-radio-group>
</template>
<template v-else-if="item.type === 'photo'">
<p class="photo-top-tips"> <p class="photo-top-tips">
{{ item.topTips }} {{ item.topTips }}
</p> </p>
...@@ -694,6 +706,19 @@ export default { ...@@ -694,6 +706,19 @@ export default {
], ],
convertedValue: [ convertedValue: [
{ required: true, message: "请输入比例换算", trigger: "change" } { required: true, message: "请输入比例换算", trigger: "change" }
],
accessoryType: [
{
validator: (rule, value, cb) => {
// 权益/延保类目配件性质不必填
if (this.equitySceneType?.includes(this.formData?.goodsType) || this.extendedPosiType?.includes(this.formData?.goodsType))
return cb();
if (!value && value !== 0)
return cb(new Error("请选择配件性质"));
cb();
},
trigger: "change"
}
] ]
}, },
copyMembranesFormBlock: [ copyMembranesFormBlock: [
...@@ -787,6 +812,9 @@ export default { ...@@ -787,6 +812,9 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.formData = deepClone(this.originData) this.formData = deepClone(this.originData)
if (newVal.accessoryType != null) {
this.$nextTick(() => this.handleAccessoryTypeChange())
}
} }
}, },
deep: true deep: true
...@@ -1147,6 +1175,9 @@ export default { ...@@ -1147,6 +1175,9 @@ export default {
const fileType = fileName.substr(fileName.lastIndexOf(".") + 1) const fileType = fileName.substr(fileName.lastIndexOf(".") + 1)
this.GlOssApi.multipartUpload(file, success, fail, bucketName, fileType) this.GlOssApi.multipartUpload(file, success, fail, bucketName, fileType)
}, },
handleAccessoryTypeChange() {
this.$emit("accessoryTypeChange", this.formData.accessoryType)
},
// 图片删除 // 图片删除
handleImgDelete(targetItem, subIndex = -1) { handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formData[targetItem.name]) Array.isArray(this.formData[targetItem.name])
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:form-list="editForm" :form-list="editForm"
:form-ref="proFormRef" :form-ref="proFormRef"
:is-product="false" :is-product="false"
@accessoryTypeChange="handleAccessoryTypeChange"
@handleAddBrandSupplyConfirm="handleAddBrandSupplyConfirm" @handleAddBrandSupplyConfirm="handleAddBrandSupplyConfirm"
@handleEditBrandSupplyConfirm="handleEditBrandSupplyConfirm"> @handleEditBrandSupplyConfirm="handleEditBrandSupplyConfirm">
</productForm> </productForm>
...@@ -44,7 +45,8 @@ export default { ...@@ -44,7 +45,8 @@ export default {
positionIds: [], positionIds: [],
carTypeList: [1, 2, 3, 4], carTypeList: [1, 2, 3, 4],
goodsPositionList: [], goodsPositionList: [],
goodsSource: 0 goodsSource: 0,
accessoryType: ''
}, },
proFormRef: 'pro', proFormRef: 'pro',
editForm: [{ editForm: [{
...@@ -120,6 +122,15 @@ export default { ...@@ -120,6 +122,15 @@ export default {
label: '详情描述', label: '详情描述',
type: 'descList', type: 'descList',
maxlength: 256 maxlength: 256
}, {
name: 'accessoryType',
label: '配件性质',
type: 'radio',
isRequired: true,
radioOptions: [
{ value: 1, label: '原厂件' },
{ value: 2, label: '品牌件' }
]
}] }]
}], }],
baseData: { baseData: {
...@@ -266,6 +277,9 @@ export default { ...@@ -266,6 +277,9 @@ export default {
editBrandSupplyMerchant(data).then(res => { editBrandSupplyMerchant(data).then(res => {
this.getBrandSupplyList(data.partitionFlag) this.getBrandSupplyList(data.partitionFlag)
}) })
},
handleAccessoryTypeChange(val) {
this.$emit('accessoryTypeChange', val)
} }
} }
} }
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<script> <script>
import { baseGoodsDelete } from "@api/commodity"; import { baseGoodsDelete } from "@api/commodity";
import { getAllCategory, getBrandSupplyMerchant } from "@api/product"; import { getAllCategory, getBrandSupplyMerchant } from "@api/product";
import { getProductManageListPageLimit, getProductManageListPageSku, productImport } from "@api/productManage"; import { getProductManageListPageLimit, getProductManageListPageSku, productImport, upgradeGoodsDelete } from "@api/productManage";
import { mapActions, mapMutations, mapState } from "vuex"; import { mapActions, mapMutations, mapState } from "vuex";
import { BaseData } from "@/common/constants"; import { BaseData } from "@/common/constants";
import { Util } from "@/common/util"; import { Util } from "@/common/util";
...@@ -504,11 +504,15 @@ export default { ...@@ -504,11 +504,15 @@ export default {
resolve(); resolve();
}); });
}, },
// SKU 行编辑/查看需传 baseGoodsId 作为 id,与 SPU 一样跳转产品编辑页 // SKU 行编辑/查看需传 baseGoodsId 作为 id,与 SPU 一样跳转产品编辑页;同时保留 upgradeGoodsId/commodityCode 供详情抽屉使用
getAuthButtonData(row) { getAuthButtonData(row) {
// SKU 行(无 upgradeGoodsList)用 baseGoodsId 作为 id 跳转 // SKU 行(无 upgradeGoodsList)用 baseGoodsId 作为 id 跳转,保留 skuId 供详情用
if (!Object.keys(row || {}).includes("upgradeGoodsList") && row.baseGoodsId) { if (!Object.keys(row || {}).includes("upgradeGoodsList") && row.baseGoodsId) {
return { ...row, id: row.baseGoodsId }; return {
...row,
id: row.baseGoodsId,
skuId: row.id,
};
} }
return row; return row;
}, },
...@@ -810,37 +814,49 @@ export default { ...@@ -810,37 +814,49 @@ export default {
}); });
}, },
handleDelete(row) { handleDelete(row) {
let html = "需下架商品才可以删除!"; // 与 handleCommodityDetail 一致:有 upgradeGoodsList 为 SPU 行,否则为 SKU 行
row.status == 1 || row.status == 2 const isSpuRow = row.upgradeGoodsList && row.upgradeGoodsList.length > 0;
? this.$confirm(html, "提示", { const skuConfirmMsg = "确认删除此sku信息吗?删除后将无法恢复。";
const spuConfirmMsg = "确认删除此spu信息吗?删除将会连同下级sku一并删除,删除后将无法恢复。";
if (row.status === 1 || row.status === 2) {
this.$confirm("需下架商品才可以删除!", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
showCancelButton: false, showCancelButton: false,
type: "warning", type: "warning",
}).then(() => { }).then(() => {});
}) return;
: this.$confirm("删除后不可恢复,是否删除?", "提示", { }
this.$confirm(isSpuRow ? spuConfirmMsg : skuConfirmMsg, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
type: "warning", type: "warning",
}).then(() => { }).then(() => {
baseGoodsDelete({ baseGoodsId: row.id }).then((res) => { const req = isSpuRow
? baseGoodsDelete({ baseGoodsId: row.id })
: upgradeGoodsDelete({ id: row.skuId });
req.then((res) => {
this.notice.okTips(); this.notice.okTips();
this.$refs.productManageTable.refreshTable(); this.$refs.productManageTable.refreshTable();
}); });
}).catch((err) => { }).catch((err) => {
if (err !== "cancel")
console.log(err); console.log(err);
}); });
}, },
handleCommodityDetail(row) { handleCommodityDetail(row) {
console.log(row); console.log(row);
const id = row.baseGoodsId ?? row.id;
this.commodityDetailInfoId = id; this.commodityDetailInfoId = "";
this.commodityDetailInfoSkuId = row.commodityCode; this.commodityDetailInfoSkuId = "";
// 根据行类型判断:有 upgradeGoodsList 为 SPU 行用 SPU 抽屉,否则为 SKU 行用 SKU 分页抽屉 // 根据行类型判断:有 upgradeGoodsList 为 SPU 行用 SPU 抽屉,否则为 SKU 行用 SKU 抽屉
const isSpuRow = row.upgradeGoodsList && row.upgradeGoodsList.length > 0; const isSpuRow = row.upgradeGoodsList && row.upgradeGoodsList.length > 0;
if (isSpuRow) { if (isSpuRow) {
this.commodityDetailInfoId = row.baseGoodsId || row.id;
this.drawerDetailVisible = true; this.drawerDetailVisible = true;
this.drawerSkuDetailVisible = false; this.drawerSkuDetailVisible = false;
} else { } else {
this.commodityDetailInfoId = row.baseGoodsId || row.id;
// SKU 行:用 skuId(getAuthButtonData 保留)或 upgradeGoodsId/commodityCode,避免被 id 覆盖
this.commodityDetailInfoSkuId = row.skuId;
this.drawerSkuDetailVisible = true; this.drawerSkuDetailVisible = true;
this.drawerDetailVisible = false; this.drawerDetailVisible = false;
} }
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<!-- SPU --> <!-- SPU -->
<SourceMaterial ref="source-material-form" <SourceMaterial ref="source-material-form"
:add-or-edit="addOrEdit" :add-or-edit="addOrEdit"
:form-data="productFormData" /> :form-data="productFormData"
@accessoryTypeChange="handleAccessoryTypeChange" />
<!-- SKU --> <!-- SKU -->
<Specifications ref="specifications-form" @checkGoodsInfo="checkGoodsInfo"></Specifications> <Specifications ref="specifications-form" @checkGoodsInfo="checkGoodsInfo"></Specifications>
<div style="margin-top: 40px;text-align: center;"> <div style="margin-top: 40px;text-align: center;">
...@@ -147,7 +148,15 @@ export default { ...@@ -147,7 +148,15 @@ export default {
specificationData: val.specificationData, specificationData: val.specificationData,
specsValueList: val.specificationData?.split(";~;"), specsValueList: val.specificationData?.split(";~;"),
type: val.type, type: val.type,
thirdPartyName: val.thirdPartyName,
thirdPartyCode: val.thirdPartyCode, thirdPartyCode: val.thirdPartyCode,
priceUnitType: val.priceUnitType,
priceUnitName: val.priceUnitName,
purchaseCost: val.purchaseCost,
operationCoefficient: val.operationCoefficient,
operationCost: val.operationCost,
applicableArea: val.applicableArea,
accessoryType: val.accessoryType,
upgradePrice: val.upgradePrice, upgradePrice: val.upgradePrice,
warningValue: val.warningValue, warningValue: val.warningValue,
warningValueMax: val.warningValueMax, warningValueMax: val.warningValueMax,
...@@ -164,6 +173,9 @@ export default { ...@@ -164,6 +173,9 @@ export default {
oldwarningValue: val.warningValue, oldwarningValue: val.warningValue,
oldwarningValueMax: val.warningValueMax, oldwarningValueMax: val.warningValueMax,
oldwarrantyPeriod: val.warrantyPeriod, oldwarrantyPeriod: val.warrantyPeriod,
oldpurchaseCost: val.purchaseCost,
oldoperationCoefficient: val.operationCoefficient,
oldoperationCost: val.operationCost,
olddjCost: val.djCost, olddjCost: val.djCost,
selectCarSerise: val?.carTypeConfigList?.map((v) => { selectCarSerise: val?.carTypeConfigList?.map((v) => {
return { return {
...@@ -221,6 +233,7 @@ export default { ...@@ -221,6 +233,7 @@ export default {
supplierCode: res.goodsInfo.supplierCode, supplierCode: res.goodsInfo.supplierCode,
merchantGoodsInfos: res?.merchantGoodsInfos, merchantGoodsInfos: res?.merchantGoodsInfos,
scrmFlag: res?.goodsInfo?.scrmFlag, scrmFlag: res?.goodsInfo?.scrmFlag,
accessoryType: res.goodsInfo?.accessoryType,
}; };
this.productFormData = deepClone({ ...res.goodsInfo, status: res?.status, oldconvertedValue: res.goodsInfo?.convertedValue, tempGoodsType, secondaryGoodsType: res.goodsInfo.secondaryGoodsType, thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType }) || {}; this.productFormData = deepClone({ ...res.goodsInfo, status: res?.status, oldconvertedValue: res.goodsInfo?.convertedValue, tempGoodsType, secondaryGoodsType: res.goodsInfo.secondaryGoodsType, thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType }) || {};
this.setUpdateGoodsInfo(objData); this.setUpdateGoodsInfo(objData);
...@@ -288,6 +301,7 @@ export default { ...@@ -288,6 +301,7 @@ export default {
maxPrice: val.maxPrice, maxPrice: val.maxPrice,
}); });
}); });
const isEquityOrExtend = this.equitySceneType?.includes(productFormData?.goodsType) || this.extendedPosiType?.includes(productFormData?.goodsType);
arr.push({ arr.push({
baseGoodsId: data.baseGoodsId, baseGoodsId: data.baseGoodsId,
goodsCode: data.goodsCode, goodsCode: data.goodsCode,
...@@ -295,10 +309,18 @@ export default { ...@@ -295,10 +309,18 @@ export default {
specificationData: item.specificationData, specificationData: item.specificationData,
specsValueList: [item.specificationData], specsValueList: [item.specificationData],
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : "", // 质保年限 仅膜类 warrantyPeriod: (this.membraneTypeList.includes(productFormData?.goodsType) || !isEquityOrExtend) ? item.warrantyPeriod : "", // 质保时间 膜类或非权益/延保类
position: productFormData?.goodsType === 1 ? item.position?.join(",") : [], // 部位 太阳膜 position: productFormData?.goodsType === 1 ? item.position?.join(",") : [], // 部位 太阳膜
type: item.type, type: item.type,
thirdPartyName: item.thirdPartyName,
thirdPartyCode: item.thirdPartyCode, thirdPartyCode: item.thirdPartyCode,
priceUnitType: item.priceUnitType,
priceUnitName: item.priceUnitName,
purchaseCost: item.purchaseCost,
operationCoefficient: item.operationCoefficient,
operationCost: item.operationCost,
applicableArea: item.applicableArea,
accessoryType: item.accessoryType,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : "", // 采购价 仅上架至采购商城 purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : "", // 采购价 仅上架至采购商城
warningValue: item.warningValue, warningValue: item.warningValue,
warningValueMax: item.warningValueMax, warningValueMax: item.warningValueMax,
...@@ -348,16 +370,25 @@ export default { ...@@ -348,16 +370,25 @@ export default {
}); });
}); });
if (item.statusFlag != 2) { if (item.statusFlag != 2) {
const isEquityOrExtend = this.equitySceneType?.includes(productFormData?.goodsType) || this.extendedPosiType?.includes(productFormData?.goodsType);
goodsSpecificationList.push({ goodsSpecificationList.push({
baseGoodsId: data.baseGoodsId, baseGoodsId: data.baseGoodsId,
goodsCode: data.goodsCode, goodsCode: data.goodsCode,
id: item.id, id: item.id,
specificationData, specificationData,
upgradePrice: item.upgradePrice, upgradePrice: item.upgradePrice,
warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : "", // 质保年限 仅膜类 warrantyPeriod: (this.membraneTypeList.includes(productFormData?.goodsType) || !isEquityOrExtend) ? item.warrantyPeriod : "", // 质保时间 膜类或非权益/延保类
position: (productFormData?.goodsType === 1 || (this.extendedPosiType.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`))) ? item.position?.join(",") : [], // 部位 太阳膜/延保类(供应方为第三方) position: (productFormData?.goodsType === 1 || (this.extendedPosiType.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`))) ? item.position?.join(",") : [], // 部位 太阳膜/延保类(供应方为第三方)
type: item.type, type: item.type,
thirdPartyName: item.thirdPartyName,
thirdPartyCode: item.thirdPartyCode, thirdPartyCode: item.thirdPartyCode,
priceUnitType: item.priceUnitType,
priceUnitName: item.priceUnitName,
purchaseCost: item.purchaseCost,
operationCoefficient: item.operationCoefficient,
operationCost: item.operationCost,
applicableArea: item.applicableArea,
accessoryType: item.accessoryType,
purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : "", // 采购价 仅上架至采购商城 purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : "", // 采购价 仅上架至采购商城
warningValue: item.warningValue, warningValue: item.warningValue,
warningValueMax: item.warningValueMax, warningValueMax: item.warningValueMax,
...@@ -433,9 +464,25 @@ export default { ...@@ -433,9 +464,25 @@ export default {
filterEmpty(data) { filterEmpty(data) {
return Array.isArray(data) ? data.length <= 0 : (data ?? "") === ""; return Array.isArray(data) ? data.length <= 0 : (data ?? "") === "";
}, },
// SPU 配件性质变更时同步到所有 SKU 行
handleAccessoryTypeChange(val) {
this.setUpdateGoodsInfo({ accessoryType: val });
const singleList = this.goodsInfoData.goodsSpecificationSingleList || [];
const multiList = this.goodsInfoData.goodsSpecificationList || [];
singleList.forEach((item) => {
item.accessoryType = val;
});
multiList.forEach((item) => {
item.accessoryType = val;
});
},
checkGoodsInfo(callback) { checkGoodsInfo(callback) {
// 校验SPU // 校验SPU
this.$refs["source-material-form"].$refs.d2GoodsProductForm.handleUp((productFormData) => { this.$refs["source-material-form"].$refs.d2GoodsProductForm.handleUp((productFormData) => {
// 提交前同步 SPU 配件性质到所有 SKU 行
if (productFormData?.accessoryType != null) {
this.handleAccessoryTypeChange(productFormData.accessoryType);
}
this.checkGoods(() => { this.checkGoods(() => {
callback(productFormData); callback(productFormData);
}); });
...@@ -467,6 +514,7 @@ export default { ...@@ -467,6 +514,7 @@ export default {
}); });
return document.getElementById("specificationDetailList").scrollIntoView(); return document.getElementById("specificationDetailList").scrollIntoView();
} }
const isEquityOrExtend = this.equitySceneType.includes(this.goodsInfoData.goodsType) || this.extendedPosiType.includes(this.goodsInfoData.goodsType);
const arr = confirmShopData.map((item) => { const arr = confirmShopData.map((item) => {
// 禁用的无需校验 // 禁用的无需校验
if (item.statusFlag == 2) if (item.statusFlag == 2)
...@@ -483,21 +531,33 @@ export default { ...@@ -483,21 +531,33 @@ export default {
if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类
item.warrantyPeriodEmpty = true; item.warrantyPeriodEmpty = true;
} }
// 非权益/延保类:商品编码、计价单位、采购成本、质保时间必填;配件性质从 SPU 同步,不单独校验;原厂件时运营系数/运营成本/适用区域不必填
if (!isEquityOrExtend) {
item.typeEmpty = true;
item.priceUnitTypeEmpty = true;
item.purchaseCostEmpty = true;
item.warrantyPeriodEmpty = true;
if (item.accessoryType !== 1) {
item.operationCoefficientEmpty = true;
item.operationCostEmpty = true;
item.applicableAreaEmpty = true;
}
}
return item; return item;
}); });
this.goodsInfoData.goodsSpecificationList = arr; this.goodsInfoData.goodsSpecificationList = arr;
this.goodsInfoData.goodsSpecificationSingleList = arr; this.goodsInfoData.goodsSpecificationSingleList = arr;
let specialList = []; let specialList = [];
if (this.goodsInfoData.goodsType == 1) { // 太阳膜 位置 质保 采购价 必填 if (this.goodsInfoData.goodsType == 1) { // 太阳膜 位置 质保 采购价 必填 + 新增字段(配件性质从 SPU 同步)
specialList = ["position", "purchasePrice", "warrantyPeriod"]; specialList = ["position", "purchasePrice", "warrantyPeriod", "type", "priceUnitType", "purchaseCost"];
} else if (this.extendedPosiType.includes(this.goodsInfoData.goodsType)) { // 延保类 采购价必填 } else if (this.extendedPosiType.includes(this.goodsInfoData.goodsType)) { // 延保类 采购价必填
specialList = ["purchasePrice"]; specialList = ["purchasePrice"];
} else if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 质保必填 采购价必填 } else if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 质保必填 采购价必填 + 新增字段
specialList = ["purchasePrice", "warrantyPeriod"]; specialList = ["purchasePrice", "warrantyPeriod", "type", "priceUnitType", "purchaseCost"];
} else if (this.equitySceneType.includes(this.goodsInfoData.goodsType)) { // 权益服务 服务项目必填 } else if (this.equitySceneType.includes(this.goodsInfoData.goodsType)) { // 权益服务 服务项目必填
specialList = !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`) ? ["serviceItemArr", "djCost", "purchasePrice"] : ["purchasePrice"]; specialList = !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`) ? ["serviceItemArr", "djCost", "purchasePrice"] : ["purchasePrice"];
} else { // 其余商品类型 采购价必填 } else { // 其余商品类型 采购价必填 + 新增必填字段
specialList = ["purchasePrice"]; specialList = ["purchasePrice", "type", "priceUnitType", "purchaseCost", "warrantyPeriod"];
} }
// 仅分发至单店时,隐藏采购价/卷,无需填写 // 仅分发至单店时,隐藏采购价/卷,无需填写
if (this.goodsInfoData.shoppingMallFlag == "0" && specialList.includes("purchasePrice")) if (this.goodsInfoData.shoppingMallFlag == "0" && specialList.includes("purchasePrice"))
...@@ -510,11 +570,19 @@ export default { ...@@ -510,11 +570,19 @@ export default {
if (this.goodsInfoData.specificationType == "2") if (this.goodsInfoData.specificationType == "2")
item.specificationData = item.specsValueList.join(";~;"); item.specificationData = item.specsValueList.join(";~;");
try { try {
requiredList.map((it) => { requiredList.forEach((it) => {
if (this.filterEmpty(item[it])) {
throw it;
}
});
// 非权益/延保类 且 配件性质为品牌件(2)时,运营系数/运营成本/适用区域必填
if (!isEquityOrExtend && item.accessoryType === 2) {
["operationCoefficient", "operationCost", "applicableArea"].forEach((it) => {
if (this.filterEmpty(item[it])) { if (this.filterEmpty(item[it])) {
throw it; throw it;
} }
}); });
}
} catch (error) { } catch (error) {
return document.getElementById("specificationDetailList").scrollIntoView(); return document.getElementById("specificationDetailList").scrollIntoView();
} }
......
...@@ -342,6 +342,26 @@ ...@@ -342,6 +342,26 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="领单确认时间"
prop="subOrderList"
width="160">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>{{ item.subElectronicDateStr || "-" }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="完成施工时间"
prop="subOrderList"
width="160">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>{{ item.completedTimeStr || "-" }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="技师" label="技师"
prop="subOrderList" prop="subOrderList"
width="200"> width="200">
...@@ -888,6 +908,13 @@ export default { ...@@ -888,6 +908,13 @@ export default {
pickerOptions: "rangePickerOptions", pickerOptions: "rangePickerOptions",
}, },
{ {
label: "完成施工时间",
name: "completedTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions",
},
{
label: "订单来源", label: "订单来源",
name: "sourceList", name: "sourceList",
type: "select", type: "select",
...@@ -1013,12 +1040,12 @@ export default { ...@@ -1013,12 +1040,12 @@ export default {
merchantId: "", merchantId: "",
orderTime: "", orderTime: "",
paySuccessDate: "", paySuccessDate: "",
completedTime: "",
constructionFlag: "", constructionFlag: "",
sourceList: "", sourceList: "",
channelType: "", channelType: "",
businessModel: "", businessModel: "",
subShopMerchantId: "", subShopMerchantId: "",
paySuccessDate: "",
provinceId: "", provinceId: "",
invoiceStatus: "", invoiceStatus: "",
salesType: "", salesType: "",
...@@ -1423,6 +1450,7 @@ export default { ...@@ -1423,6 +1450,7 @@ export default {
merchantId: "", merchantId: "",
orderTime: "", orderTime: "",
paySuccessDate: "", paySuccessDate: "",
completedTime: "",
constructionFlag: "", constructionFlag: "",
channelType: "", channelType: "",
businessModel: "", businessModel: "",
...@@ -1597,6 +1625,15 @@ export default { ...@@ -1597,6 +1625,15 @@ export default {
= Util.dateFormate(form.paySuccessDate[1], "YYYY-MM-DD") + " 23:59:59"; = Util.dateFormate(form.paySuccessDate[1], "YYYY-MM-DD") + " 23:59:59";
} }
if (form.completedTime && form.completedTime.length) {
params.completionBeginTime = Util.dateFormate(
form.completedTime[0],
"YYYY-MM-DD HH:mm:ss",
);
params.completionEndTime
= Util.dateFormate(form.completedTime[1], "YYYY-MM-DD") + " 23:59:59";
}
if (params.sourceList != "") { if (params.sourceList != "") {
// 处理d2-search 下拉选不支持绑定数组的问题 // 处理d2-search 下拉选不支持绑定数组的问题
params.sourceList params.sourceList
...@@ -1638,6 +1675,12 @@ export default { ...@@ -1638,6 +1675,12 @@ export default {
= this.positionTypeList?.filter( = this.positionTypeList?.filter(
subItem => val?.upgradeGoodsPosition == subItem.position, subItem => val?.upgradeGoodsPosition == subItem.position,
)[0]?.confName || "-"; )[0]?.confName || "-";
val.subElectronicDateStr = val.subElectronicDate
? Util.dateFormate(val.subElectronicDate, "YYYY-MM-DD HH:mm:ss")
: "";
val.completedTimeStr = val.completedTime
? Util.dateFormate(val.completedTime, "YYYY-MM-DD HH:mm:ss")
: "";
}); });
return item; return item;
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!