|
@@ -651,6 +651,7 @@ const updatePackageRemark = (val, index) => {
|
|
|
};
|
|
|
const clickDelete = (index) => {
|
|
|
formData.data.orderSkuList.splice(index, 1);
|
|
|
+ getShippingPackage();
|
|
|
};
|
|
|
const updateValue = (val) => {
|
|
|
formData.data.remark = val;
|
|
@@ -788,14 +789,10 @@ const selectPackingFittings = (data) => {
|
|
|
}
|
|
|
ElMessage({ message: "添加成功", type: "success" });
|
|
|
};
|
|
|
-const changeQuantity = (index) => {
|
|
|
+const changeQuantity = (index, status) => {
|
|
|
if (formData.data.orderSkuList[index].quantity) {
|
|
|
proxy
|
|
|
- .post("/orderInfo/getSkuSpecPrice", {
|
|
|
- skuSpecId: formData.data.orderSkuList[index].skuSpecId,
|
|
|
- quantity: formData.data.orderSkuList[index].quantity,
|
|
|
- random: proxy.random(),
|
|
|
- })
|
|
|
+ .post("/orderInfo/getSkuSpecPrice", { skuSpecId: formData.data.orderSkuList[index].skuSpecId, quantity: formData.data.orderSkuList[index].quantity })
|
|
|
.then((res) => {
|
|
|
if (formData.data.orderSkuList[index].printType == 2 && res.customProcessingFee) {
|
|
|
formData.data.orderSkuList[index].customProcessingFee = Number(Math.round(res.customProcessingFee * 2 * 100) / 100);
|
|
@@ -803,12 +800,42 @@ const changeQuantity = (index) => {
|
|
|
formData.data.orderSkuList[index].customProcessingFee = res.customProcessingFee;
|
|
|
}
|
|
|
formData.data.orderSkuList[index].customProcessingType = res.customProcessingType;
|
|
|
- formData.data.orderSkuList[index].deliveryMaterialsFee = res.deliveryMaterialsFee;
|
|
|
formData.data.orderSkuList[index].lssueFee = res.lssueFee;
|
|
|
formData.data.orderSkuList[index].packingLabor = res.packingLabor;
|
|
|
formData.data.orderSkuList[index].managementFee = res.managementFee;
|
|
|
formData.data.orderSkuList[index].unitPrice = res.unitPrice;
|
|
|
});
|
|
|
+ if (status) {
|
|
|
+ getShippingPackage();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+const getShippingPackage = () => {
|
|
|
+ let skuSpecList = formData.data.orderSkuList.filter((item) => item.quantity && item.quantity > 0);
|
|
|
+ if (skuSpecList && skuSpecList.length > 0) {
|
|
|
+ skuSpecList = skuSpecList.map((item) => {
|
|
|
+ return {
|
|
|
+ skuSpecId: item.skuSpecId,
|
|
|
+ quantity: item.quantity,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ proxy.post("/orderInfo/getSkuSpecPackageBomList", { skuSpecList: skuSpecList }).then((res) => {
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ formData.data.orderPackageBomList = res.map((item) => {
|
|
|
+ return {
|
|
|
+ bomSpecId: item.bomSpecId,
|
|
|
+ code: item.bomSpecCode,
|
|
|
+ name: item.bomSpecName,
|
|
|
+ internalSellingPrice: item.internalSellingPrice,
|
|
|
+ quantity: item.quantity,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.orderPackageBomList = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.orderPackageBomList = [];
|
|
|
}
|
|
|
};
|
|
|
const cellStyleName = ({ column, columnIndex }) => {
|
|
@@ -1104,8 +1131,21 @@ const computeDeliveryMaterialsFee = () => {
|
|
|
}
|
|
|
return money;
|
|
|
};
|
|
|
+const computeMaterialsFeeAll = () => {
|
|
|
+ let money = 0;
|
|
|
+ if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.orderPackageBomList.length; i++) {
|
|
|
+ if (formData.data.orderPackageBomList[i].internalSellingPrice && formData.data.orderPackageBomList[i].quantity) {
|
|
|
+ money = Number(
|
|
|
+ Math.round((money + formData.data.orderPackageBomList[i].internalSellingPrice * formData.data.orderPackageBomList[i].quantity) * 100) / 100
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return money;
|
|
|
+};
|
|
|
const computeSingleDeliveryMaterialsFee = (index) => {
|
|
|
- let money = computeDeliveryMaterialsFee();
|
|
|
+ let money = computeMaterialsFeeAll();
|
|
|
let list = formData.data.orderSkuList.filter((item) => item.quantity > 0);
|
|
|
let num = 0;
|
|
|
let singlePrice = 0;
|