|
@@ -751,12 +751,13 @@ export default {
|
|
|
this.$set(item, "inventoryNumber", item.storageQuantity)
|
|
|
this.$set(item, "srcId", item.id)
|
|
|
this.$set(item, "deliveryAmount", item.amount)
|
|
|
- this.$set(item, "actualQuantity", (Number(item.purchaseQuantity) - Number(item.actualQuantity)))
|
|
|
+ this.$set(item, "purchaseQuantity", Number(item.orderQuantity))
|
|
|
+ this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
|
|
|
// 入库数量和入库金额的比例
|
|
|
- this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
|
|
|
- this.form.deliveryAmount += Number(item.deliveryAmount)
|
|
|
- this.form.totalQuantity += Number(item.actualQuantity)
|
|
|
- this.form.purchaseAmount += Number(item.deliveryAmount)
|
|
|
+ this.$set(item, 'scale', Number(item.deliveryAmount / item.actualQuantity))
|
|
|
+ this.form.deliveryAmount = Number(this.form.deliveryAmount) + Number(item.deliveryAmount)
|
|
|
+ this.form.totalQuantity = Number(this.form.totalQuantity) + Number(item.actualQuantity)
|
|
|
+ this.form.purchaseAmount = Number(this.form.purchaseAmount) + Number(item.deliveryAmount)
|
|
|
this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
|
|
|
this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
|
|
|
delete item.id
|
|
@@ -857,9 +858,9 @@ export default {
|
|
|
},
|
|
|
// 入库数量变化时调用
|
|
|
actualQuantityChange(row) {
|
|
|
- if (row.scale) {
|
|
|
- row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
|
|
|
- }
|
|
|
+ // if (row.scale) {
|
|
|
+ // row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
|
|
|
+ // }
|
|
|
},
|
|
|
// 类别变换时触发
|
|
|
warehouseTreeChange(id) {
|
|
@@ -1206,23 +1207,36 @@ export default {
|
|
|
if (this.contactsData.length == 0) {
|
|
|
return this.$message.error('商品信息为空')
|
|
|
}
|
|
|
- for (let item in this.contactsData) {
|
|
|
- if (!this.contactsData[item].id) {
|
|
|
- return this.$message.error('有商品未保存,请先保存')
|
|
|
+ if (contrastObj(this.form, this.oldForm) ||
|
|
|
+ contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
+ contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
|
+ contrastList(this.bankOfDepositData, this.oldUploadList)
|
|
|
+ ) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.editCustomer(false)
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.info('已取消')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //商品信息
|
|
|
+ this.form.deliveryItemsList = this.contactsData
|
|
|
+ this.form.deliveryFeesList = this.advantageProjectData
|
|
|
+ this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
+ if (typeof this.form.corpsTypeId == 'object') {
|
|
|
+ this.form.corpsTypeId = this.form.corpsTypeId.join(",")
|
|
|
}
|
|
|
+ this.pageLoading = true
|
|
|
+ sendInGoods(this.form).then(res => {
|
|
|
+ this.$message.success('收货成功')
|
|
|
+ this.queryData(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
- //商品信息
|
|
|
- this.form.deliveryItemsList = this.contactsData
|
|
|
- this.form.deliveryFeesList = this.advantageProjectData
|
|
|
- this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
- if (typeof this.form.corpsTypeId == 'object') {
|
|
|
- this.form.corpsTypeId = this.form.corpsTypeId.join(",")
|
|
|
- }
|
|
|
- sendInGoods(this.form).then(res => {
|
|
|
- console.log(res)
|
|
|
- this.$message.success('收货成功')
|
|
|
- this.queryData(res.data.data.id)
|
|
|
- })
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
@@ -1256,9 +1270,9 @@ export default {
|
|
|
this.form.totalQuantity = 0
|
|
|
this.form.purchaseAmount = 0
|
|
|
this.contactsData.forEach(item => {
|
|
|
- this.form.deliveryAmount += Number(item.deliveryAmount)
|
|
|
- this.form.totalQuantity += Number(item.actualQuantity)
|
|
|
- this.form.purchaseAmount += Number(item.deliveryAmount)
|
|
|
+ this.form.deliveryAmount = Number(this.form.deliveryAmount) + Number(item.deliveryAmount)
|
|
|
+ this.form.totalQuantity = Number(this.form.totalQuantity) + Number(item.actualQuantity)
|
|
|
+ this.form.purchaseAmount = Number(this.form.purchaseAmount) + Number(item.deliveryAmount)
|
|
|
this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
|
|
|
this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
|
|
|
})
|