|
@@ -678,7 +678,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '应收未收款',
|
|
|
- prop: 'accountsReceivable',//无
|
|
|
+ prop: 'balanceAmount',//无
|
|
|
disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
@@ -865,6 +865,7 @@ export default {
|
|
|
{
|
|
|
label: '销售订单号',
|
|
|
prop: 'orderNo',
|
|
|
+ disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -1107,7 +1108,11 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
this.oldForm = Object.assign({}, this.form)
|
|
|
+ this.oldGoodsList = []
|
|
|
+ this.oldFeesList = []
|
|
|
+ this.oldUploadList = []
|
|
|
this.oldGoodsList = this.oldGoodsList.concat(this.contactsData)
|
|
|
+ console.log(this.oldGoodsList)
|
|
|
this.oldFeesList = this.oldFeesList.concat(this.advantageProjectData)
|
|
|
this.oldUploadList = this.oldUploadList.concat(this.bankOfDepositData)
|
|
|
if (isCopy) {
|
|
@@ -1584,7 +1589,6 @@ export default {
|
|
|
},
|
|
|
//修改提交触发
|
|
|
editCustomer(isBack = false) {
|
|
|
- console.log(this.form)
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
for (let item in this.contactsData) {
|
|
@@ -1594,18 +1598,26 @@ export default {
|
|
|
}
|
|
|
// 计算毛利额
|
|
|
this.$set(this.form, 'grossProfit', 0)
|
|
|
+ this.$set(this.form, 'orderAmount', 0)
|
|
|
this.contactsData.forEach(item => {
|
|
|
this.form.grossProfit += Number(item.amount)
|
|
|
+ this.form.orderAmount += Number(item.amount)
|
|
|
})
|
|
|
+ if (this.form.orderAmount && this.form.overPayment) {
|
|
|
+ this.form.debitAmount = Number(this.form.orderAmount) - Number(this.form.overPayment)
|
|
|
+ }
|
|
|
+ if (this.form.orderAmount && this.form.settlmentAmount) {
|
|
|
+ this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
|
|
|
+ }
|
|
|
// 计算毛利率
|
|
|
// if (this.form.orderAmount) {
|
|
|
// this.form.grossProfitRate = ((Number(this.form.grossProfit) / Number(this.form.orderAmount)) * 100).toFixed(2)
|
|
|
// }
|
|
|
// 计算应收账款
|
|
|
- this.$set(this.form, 'debitAmount', 0)
|
|
|
- this.contactsData.forEach(item => {
|
|
|
- this.form.debitAmount += Number(item.amount)
|
|
|
- })
|
|
|
+ // this.$set(this.form, 'debitAmount', 0)
|
|
|
+ // this.contactsData.forEach(item => {
|
|
|
+ // this.form.debitAmount += Number(item.amount)
|
|
|
+ // })
|
|
|
//商品信息
|
|
|
this.form.orderItemsList = this.contactsData
|
|
|
this.form.orderFeesList = this.advantageProjectData
|
|
@@ -1632,17 +1644,17 @@ export default {
|
|
|
},
|
|
|
// 计算应收未收款
|
|
|
computedCost() {
|
|
|
- // 应收预付款
|
|
|
- let advancePayment = 0;
|
|
|
+ // 销售金额
|
|
|
+ let orderAmount = 0;
|
|
|
// 已收款
|
|
|
let settlmentAmount = 0;
|
|
|
- if (this.form.advancePayment) {
|
|
|
- advancePayment = this.form.advancePayment
|
|
|
+ if (this.form.orderAmount) {
|
|
|
+ orderAmount = this.form.orderAmount
|
|
|
}
|
|
|
if (this.form.settlmentAmount) {
|
|
|
settlmentAmount = this.form.settlmentAmount
|
|
|
}
|
|
|
- this.$set(this.form, "accountsReceivable", Number(advancePayment) - Number(settlmentAmount)).toFixed(2);
|
|
|
+ this.$set(this.form, "balanceAmount", (Number(orderAmount) - Number(settlmentAmount)).toFixed(2));
|
|
|
},
|
|
|
quantityChange(row) {
|
|
|
if (!row.orderQuantity) {
|
|
@@ -1661,6 +1673,10 @@ export default {
|
|
|
},
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
+ console.log(contrastObj(this.form, this.oldForm))
|
|
|
+ console.log(contrastList(this.contactsData, this.oldGoodsList))
|
|
|
+ console.log(contrastList(this.advantageProjectData, this.oldFeesList))
|
|
|
+ console.log(contrastList(this.bankOfDepositData, this.oldUploadList))
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
|
contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
contrastList(this.advantageProjectData, this.oldFeesList) ||
|