|
@@ -2843,7 +2843,6 @@ export default {
|
|
|
if (this.policyDataTwo.length > 0 || this.goodsListPolicy.length > 0 || this.buyAndGiveList.length >0) {
|
|
if (this.policyDataTwo.length > 0 || this.goodsListPolicy.length > 0 || this.buyAndGiveList.length >0) {
|
|
|
buyFree = this.deepClone((this.policyDataTwo.concat(this.goodsListPolicy)).concat(this.buyAndGiveList))
|
|
buyFree = this.deepClone((this.policyDataTwo.concat(this.goodsListPolicy)).concat(this.buyAndGiveList))
|
|
|
}
|
|
}
|
|
|
- console.log(buyFree)
|
|
|
|
|
for (let item in list) {
|
|
for (let item in list) {
|
|
|
if (this.policyData.length > 0 || this.buyAndGiveList > 0) {
|
|
if (this.policyData.length > 0 || this.buyAndGiveList > 0) {
|
|
|
if (!list[item].specialOffer) {
|
|
if (!list[item].specialOffer) {
|
|
@@ -2880,6 +2879,7 @@ export default {
|
|
|
this.$set(buyFree[item], 'price', '0')
|
|
this.$set(buyFree[item], 'price', '0')
|
|
|
this.$set(buyFree[item], 'orderQuantity', list[item].salesVolume)
|
|
this.$set(buyFree[item], 'orderQuantity', list[item].salesVolume)
|
|
|
this.$set(buyFree[item], 'itemType', list[item].typeno)
|
|
this.$set(buyFree[item], 'itemType', list[item].typeno)
|
|
|
|
|
+ this.$set(list[item], 'goodType', 0)
|
|
|
}
|
|
}
|
|
|
selectGoodsNum({
|
|
selectGoodsNum({
|
|
|
goodsId: list[item].itemId,
|
|
goodsId: list[item].itemId,
|
|
@@ -2890,7 +2890,7 @@ export default {
|
|
|
if (listLength != 0) {
|
|
if (listLength != 0) {
|
|
|
this.$set(buyFree[item], 'storageQuantity', res.data.data)
|
|
this.$set(buyFree[item], 'storageQuantity', res.data.data)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ this.$set(list[item], 'goodType', 0)
|
|
|
this.$set(list[item], 'itemType', list[item].typeno)
|
|
this.$set(list[item], 'itemType', list[item].typeno)
|
|
|
this.$set(list[item], 'actualQuantity', 0)
|
|
this.$set(list[item], 'actualQuantity', 0)
|
|
|
this.$set(list[item], 'orderQuantity', list[item].orderQuantity? list[item].orderQuantity: 0)
|
|
this.$set(list[item], 'orderQuantity', list[item].orderQuantity? list[item].orderQuantity: 0)
|
|
@@ -2918,6 +2918,7 @@ export default {
|
|
|
this.$set(buyFree[item], 'integralMultiples', 0)
|
|
this.$set(buyFree[item], 'integralMultiples', 0)
|
|
|
this.$set(buyFree[item], 'integral', 0)
|
|
this.$set(buyFree[item], 'integral', 0)
|
|
|
this.$set(buyFree[item], 'shopQuality', 0)
|
|
this.$set(buyFree[item], 'shopQuality', 0)
|
|
|
|
|
+ this.$set(buyFree[item], 'goodType', 0)
|
|
|
this.maxGoodsNum++
|
|
this.maxGoodsNum++
|
|
|
delete buyFree[item].id
|
|
delete buyFree[item].id
|
|
|
delete buyFree[item].pid
|
|
delete buyFree[item].pid
|
|
@@ -3152,13 +3153,13 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
//修改提交触发
|
|
//修改提交触发
|
|
|
- editCustomer(isBack = false, type,other) {
|
|
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
|
|
|
|
+ async editCustomer(isBack = false, type,other) {
|
|
|
|
|
+ this.$refs["form"].validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- const length = this.goodsActives === 'gift'? this.contactsData.length: this.goodsShowData.length
|
|
|
|
|
- const length1 = this.goodsActives === 'goods'? this.giftData: this.goodsShowData
|
|
|
|
|
- for (let i = 0;i < length;i++) {
|
|
|
|
|
- const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData;
|
|
|
|
|
|
|
+ const length = this.goodsActives === 'gift' ? this.contactsData.length : this.goodsShowData.length
|
|
|
|
|
+ const length1 = this.goodsActives === 'goods' ? this.giftData : this.goodsShowData
|
|
|
|
|
+ for (let i = 0; i < length; i++) {
|
|
|
|
|
+ const data = this.goodsActives === 'gift' ? this.contactsData : this.goodsShowData;
|
|
|
if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
|
|
if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
|
|
|
return this.$message.error('商品信息第' + (Number(i) + 1) + '行订货数量大于库存数量')
|
|
return this.$message.error('商品信息第' + (Number(i) + 1) + '行订货数量大于库存数量')
|
|
|
}
|
|
}
|
|
@@ -3186,12 +3187,11 @@ export default {
|
|
|
// inputMold判断是商品还是政策 商品 0 特价 1 买赠2,isSpecial 0正常 1特价
|
|
// inputMold判断是商品还是政策 商品 0 特价 1 买赠2,isSpecial 0正常 1特价
|
|
|
goodsData.filter(item => item.inputMold === 1 && item.isSpecial === 1).forEach(item => specialNum += Number(item.orderQuantity));
|
|
goodsData.filter(item => item.inputMold === 1 && item.isSpecial === 1).forEach(item => specialNum += Number(item.orderQuantity));
|
|
|
goodsData.filter(item => Number(item.size) >= 17).forEach(item => sizeNum += Number(item.orderQuantity));
|
|
goodsData.filter(item => Number(item.size) >= 17).forEach(item => sizeNum += Number(item.orderQuantity));
|
|
|
- this.$set(this.form, 'specialOfferOf', allNum == 0? '0.00': (specialNum / allNum * 100).toFixed(2));
|
|
|
|
|
-
|
|
|
|
|
- this.$set(this.form, 'largeScale', allNum == 0? '0.00': (sizeNum / allNum * 100).toFixed(2));
|
|
|
|
|
|
|
+ this.$set(this.form, 'specialOfferOf', allNum == 0 ? '0.00' : (specialNum / allNum * 100).toFixed(2));
|
|
|
|
|
+ this.$set(this.form, 'largeScale', allNum == 0 ? '0.00' : (sizeNum / allNum * 100).toFixed(2));
|
|
|
for (let item in this.goodsData) {
|
|
for (let item in this.goodsData) {
|
|
|
if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
|
|
if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
|
|
|
- return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
|
|
|
|
|
|
|
+ return this.$message.error('商品信息第' + (parseInt(item) + 1) + '行订货数量不能超过库存')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.form.orderFeesList = this.$refs.feeInfo.submitData()
|
|
this.form.orderFeesList = this.$refs.feeInfo.submitData()
|
|
@@ -3204,8 +3204,8 @@ export default {
|
|
|
return this.$message.error('费用明细未有包装费')
|
|
return this.$message.error('费用明细未有包装费')
|
|
|
}
|
|
}
|
|
|
// 产生返利、本次使用返利为空 默认为0
|
|
// 产生返利、本次使用返利为空 默认为0
|
|
|
- this.form.createProfit = this.form.createProfit? this.form.createProfit: 0
|
|
|
|
|
- this.form.thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
|
|
|
|
|
|
|
+ this.form.createProfit = this.form.createProfit ? this.form.createProfit : 0
|
|
|
|
|
+ this.form.thisUsedProfit = this.form.thisUsedProfit ? this.form.thisUsedProfit : 0
|
|
|
// 计算毛利额
|
|
// 计算毛利额
|
|
|
this.$set(this.form, 'orderAmount', 0)
|
|
this.$set(this.form, 'orderAmount', 0)
|
|
|
// 成本价
|
|
// 成本价
|
|
@@ -3216,6 +3216,7 @@ export default {
|
|
|
// 销售金额
|
|
// 销售金额
|
|
|
this.form.orderAmount = 0;
|
|
this.form.orderAmount = 0;
|
|
|
// 计算销售金额
|
|
// 计算销售金额
|
|
|
|
|
+ console.log(this.form.orderItemsList)
|
|
|
this.form.orderItemsList.forEach(item => {
|
|
this.form.orderItemsList.forEach(item => {
|
|
|
if (item.goodType == 0) {
|
|
if (item.goodType == 0) {
|
|
|
if (item.purchaseAmount) {
|
|
if (item.purchaseAmount) {
|
|
@@ -3224,7 +3225,6 @@ export default {
|
|
|
this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
|
|
this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- this.computedCost()
|
|
|
|
|
// 判断订货数量不能小于等于0
|
|
// 判断订货数量不能小于等于0
|
|
|
for (let item in this.form.orderItemsList) {
|
|
for (let item in this.form.orderItemsList) {
|
|
|
if (Number(this.form.orderItemsList[item].orderQuantity) <= 0) {
|
|
if (Number(this.form.orderItemsList[item].orderQuantity) <= 0) {
|
|
@@ -3240,9 +3240,10 @@ export default {
|
|
|
// 如果有id解锁,没有跳过
|
|
// 如果有id解锁,没有跳过
|
|
|
// this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
|
|
// this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
|
|
|
this.saveLoading = true
|
|
this.saveLoading = true
|
|
|
|
|
+ await this.computedCost()
|
|
|
typeSave(this.form).then(res => {
|
|
typeSave(this.form).then(res => {
|
|
|
// this.$set(this.detailData, 'seeDisabled', true);
|
|
// this.$set(this.detailData, 'seeDisabled', true);
|
|
|
- if (!other){
|
|
|
|
|
|
|
+ if (!other) {
|
|
|
this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
}
|
|
}
|
|
|
if (isBack) {
|
|
if (isBack) {
|
|
@@ -3251,7 +3252,7 @@ export default {
|
|
|
this.leaveDetailsKey(this.$route.name)
|
|
this.leaveDetailsKey(this.$route.name)
|
|
|
} else {
|
|
} else {
|
|
|
this.saveActives = ''
|
|
this.saveActives = ''
|
|
|
- this.queryData(res.data.data.id,false,other)
|
|
|
|
|
|
|
+ this.queryData(res.data.data.id, false, other)
|
|
|
}
|
|
}
|
|
|
if (type == '发货') {
|
|
if (type == '发货') {
|
|
|
let lsit = []
|
|
let lsit = []
|
|
@@ -3267,7 +3268,7 @@ export default {
|
|
|
this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: "/businessManagement/deliveryNotice/index",
|
|
path: "/businessManagement/deliveryNotice/index",
|
|
|
- query: {form: JSON.stringify(res.data.data),pageType: "Generate",},
|
|
|
|
|
|
|
+ query: {form: JSON.stringify(res.data.data), pageType: "Generate",},
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
} else if (type == '采购') {
|
|
} else if (type == '采购') {
|
|
@@ -3288,7 +3289,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
} else if (type == '收费') {
|
|
} else if (type == '收费') {
|
|
|
- this.beforeBillData(true,type)
|
|
|
|
|
|
|
+ this.beforeBillData(true, type)
|
|
|
this.applySettlementDialog = true;
|
|
this.applySettlementDialog = true;
|
|
|
}
|
|
}
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
@@ -3538,7 +3539,16 @@ export default {
|
|
|
cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
|
|
cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
|
|
|
cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
|
|
cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ }else {{
|
|
|
|
|
+ this.goodsShowData.forEach(e => {
|
|
|
|
|
+ amountSum = _.add(amountSum, Number(e.amount));
|
|
|
|
|
+ orderQuantitySum = _.add(orderQuantitySum, Number(e.orderQuantity));
|
|
|
|
|
+ actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
|
|
|
|
|
+ integralSum = _.add(integralSum, Number(e.integral));
|
|
|
|
|
+ cartonWeight = _.add(cartonWeight, Number(e.cartonWeight));
|
|
|
|
|
+ cntrVolumn = _.add(cntrVolumn, Number(e.cntrVolumn));
|
|
|
|
|
+ })
|
|
|
|
|
+ }}
|
|
|
// 订货数量合计
|
|
// 订货数量合计
|
|
|
if (item.property == "orderQuantity") {
|
|
if (item.property == "orderQuantity") {
|
|
|
sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(0) : "0";
|
|
sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(0) : "0";
|