|
@@ -103,27 +103,28 @@
|
|
|
<el-button v-if="row.$cellEdit" size="small" icon="el-icon-search" @click="choice(row)"></el-button>
|
|
|
<span v-else>{{ row.priceCategoryNames }}</span>
|
|
|
</template>
|
|
|
- <template slot="invoiceWeight" slot-scope="{ row }">
|
|
|
+ <template slot="billWeight" slot-scope="{ row }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.invoiceWeight"
|
|
|
+ v-model="row.billWeight"
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
- @input="totalChange(row.invoiceWeight)"
|
|
|
+ @change="totalChange(row.billWeight)"
|
|
|
></el-input>
|
|
|
- <span v-else>{{ row.invoiceWeight }}</span>
|
|
|
+ <span v-else>{{ row.billWeight }}</span>
|
|
|
</template>
|
|
|
- <template slot="billWeight" slot-scope="{ row }">
|
|
|
+ <template slot="invoiceWeight" slot-scope="{ row }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.billWeight"
|
|
|
+ v-model="row.invoiceWeight"
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
- @input="totalChange(row.billWeight)"
|
|
|
+ @input="invoiceWeightChange(row)"
|
|
|
+ @change="totalChange(row.invoiceWeight)"
|
|
|
></el-input>
|
|
|
- <span v-else>{{ row.billWeight }}</span>
|
|
|
+ <span v-else>{{ row.invoiceWeight }}</span>
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
|
<el-input
|
|
@@ -145,7 +146,6 @@
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @input="quantityChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.actualQuantity }}</span>
|
|
|
</template>
|
|
@@ -369,9 +369,10 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '发票重量',
|
|
|
- prop: 'invoiceWeight',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '码单重量',
|
|
|
+ prop: 'billWeight',
|
|
|
disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
@@ -382,8 +383,8 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: '码单重量',
|
|
|
- prop: 'billWeight',
|
|
|
+ label: '发票重量',
|
|
|
+ prop: 'invoiceWeight',
|
|
|
disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
@@ -464,9 +465,7 @@ export default {
|
|
|
this.oldForm = Object.assign({},res.data.data);
|
|
|
this.receiptDisable = res.data.data.deliveryStatus === "已收货" ? true :false
|
|
|
this.configuration.disabled = this.receiptDisable
|
|
|
- if(this.form.companyName){
|
|
|
- this.configuration.dicData = this.form.companyName
|
|
|
- }
|
|
|
+ this.configuration.dicData = this.form.corpName
|
|
|
if(this.form.deliveryItemsList){
|
|
|
this.contactsData = this.form.deliveryItemsList
|
|
|
this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
@@ -508,7 +507,7 @@ export default {
|
|
|
methods: {
|
|
|
sumOrderNo(){
|
|
|
//拿到所有明细合同号 去重加逗号放到主表合同号
|
|
|
- const contractNumberList = this.contactsData.map(item =>{item.contractNumber})
|
|
|
+ const contractNumberList = this.contactsData.map(item =>{return item.contractNumber})
|
|
|
this.$set(this.form,'orderNo', Array.from(new Set(contractNumberList)).join(","))
|
|
|
},
|
|
|
//合计
|
|
@@ -525,8 +524,8 @@ export default {
|
|
|
}
|
|
|
return parseFloat(item.billWeight);
|
|
|
});
|
|
|
- this.form.invoiceWeight = invoiceList.reduce((n,m) => n + m)
|
|
|
- this.form.billWeight = billList.reduce((n,m) => n + m)
|
|
|
+ this.$set(this.form,"invoiceWeight",invoiceList.reduce((n,m) => n + m))
|
|
|
+ this.$set(this.form,"billWeight",billList.reduce((n,m) => n + m))
|
|
|
},
|
|
|
//提单号带出合同号
|
|
|
bingOut(row){
|
|
@@ -546,16 +545,16 @@ export default {
|
|
|
row.price = "";
|
|
|
row.contractAmount = 0
|
|
|
} else {
|
|
|
- row.contractAmount = _.multiply(row.actualQuantity,row.price).toFixed(2);
|
|
|
+ row.contractAmount = _.multiply(row.invoiceWeight,row.price).toFixed(2);
|
|
|
}
|
|
|
},
|
|
|
- //件数
|
|
|
- quantityChange(row) {
|
|
|
- if (!row.actualQuantity) {
|
|
|
- row.actualQuantity = "";
|
|
|
+ //码单重量
|
|
|
+ invoiceWeightChange(row) {
|
|
|
+ if (!row.invoiceWeight) {
|
|
|
+ row.invoiceWeight = "";
|
|
|
row.contractAmount = 0
|
|
|
} else {
|
|
|
- row.contractAmount = _.multiply(row.actualQuantity,row.price).toFixed(2);
|
|
|
+ row.contractAmount = _.multiply(row.invoiceWeight,row.price).toFixed(2);
|
|
|
}
|
|
|
},
|
|
|
//新增商品信息保存触发
|
|
@@ -613,10 +612,10 @@ export default {
|
|
|
return this.$message.error(`请输入第${i + 1}行的货物品种`);
|
|
|
}
|
|
|
if (this.contactsData[i].actualQuantity === "") {
|
|
|
- return this.$message.error(`请输入第${i + 1}行的件数`);
|
|
|
+ return this.$message.error(`请输入第${i + 1}行的数量`);
|
|
|
}
|
|
|
if (this.contactsData[i].actualQuantity == 0) {
|
|
|
- return this.$message.error(`请输入第${i + 1}行的件数`);
|
|
|
+ return this.$message.error(`请输入第${i + 1}行的数量不能为0`);
|
|
|
}
|
|
|
}
|
|
|
if (valid) {
|
|
@@ -632,7 +631,7 @@ export default {
|
|
|
this.form = res.data.data;
|
|
|
this.oldForm = Object.assign({},res.data.data);
|
|
|
this.receiptDisable = res.data.data.deliveryStatus === "已收货" ? true :false
|
|
|
- this.configuration.dicData = this.form.companyName
|
|
|
+ this.configuration.dicData = this.form.corpName
|
|
|
if(this.form.deliveryItemsList){
|
|
|
this.contactsData = this.form.deliveryItemsList
|
|
|
this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
@@ -704,7 +703,8 @@ export default {
|
|
|
item.actualQuantity = item.purchaseQuantity;
|
|
|
this.$refs.crudContact.rowCellAdd(item);
|
|
|
})
|
|
|
- this.sumOrderNo();
|
|
|
+ this.totalChange(); //计算码单 发票
|
|
|
+ this.sumOrderNo(); //合并合同号
|
|
|
this.procurementDialog = false;
|
|
|
},
|
|
|
//上传文件保存
|
|
@@ -853,7 +853,7 @@ export default {
|
|
|
if (inSave) {
|
|
|
this.$message.success("保存成功");
|
|
|
//关闭窗口
|
|
|
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
},
|
|
|
},
|