|
@@ -315,7 +315,7 @@
|
|
|
<el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip />
|
|
|
<el-table-column align="center" label="操作" width="100" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" @click="deleteItem(scope.$index, scope.row,scope.row.cid)">删除</el-button>
|
|
|
+ <el-button type="text" @click="deleteItem(scope.$index, scope.row, scope.row.cid)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -549,18 +549,17 @@ export default {
|
|
|
return JSON.parse(localStorage.getItem('supply_user')).isCustomer
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- goodsList:{
|
|
|
- deep:true,
|
|
|
- immediate:true,
|
|
|
- handler(val,oval){
|
|
|
+ watch: {
|
|
|
+ goodsList: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val, oval) {
|
|
|
val.forEach(item => {
|
|
|
- item.myTotalAmount = (item.price || 0) * (item.qty || 0)
|
|
|
- item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty', 'hasSendQty']
|
|
|
- item.sums2 = ['myTotalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
|
|
|
- })
|
|
|
+ item.myTotalAmount = (item.price || 0) * (item.qty || 0)
|
|
|
+ item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty', 'hasSendQty']
|
|
|
+ item.sums2 = ['myTotalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -860,9 +859,11 @@ export default {
|
|
|
|
|
|
this.goodsList = this.goodsList.concat(this.rightGoodsList)
|
|
|
this.goodsList.forEach(k => {
|
|
|
+ if (k.qty) {
|
|
|
+ k.qty = 1
|
|
|
+ }
|
|
|
if (!k.cid) {
|
|
|
k.cid = ''
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
this.isShowGoodsDialog = false
|
|
@@ -872,7 +873,6 @@ export default {
|
|
|
|
|
|
// 删除产品
|
|
|
deleteItem(index, row, id) {
|
|
|
-
|
|
|
// id id存在就说明这个货品已经引用过了
|
|
|
// if (this.listItem && this.examineStatus === 'OK' && id) {
|
|
|
// this.$errorMsg('已审核通过的型号不能删除')
|
|
@@ -889,7 +889,6 @@ export default {
|
|
|
} else {
|
|
|
this.goodsList.splice(index, 1)
|
|
|
this.$successMsg('删除成功')
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -899,7 +898,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
clickSubmitForm(type) {
|
|
|
-
|
|
|
this.$refs.mainForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
for (let i = 0; i < this.goodsList.length; i++) {
|
|
@@ -907,7 +905,7 @@ export default {
|
|
|
this.$errorMsg('请选择销售类型')
|
|
|
return
|
|
|
}
|
|
|
- if (Number(this.goodsList[i].qty) < 0) {
|
|
|
+ if (!this.goodsList[i].qty || Number(this.goodsList[i].qty) < 0) {
|
|
|
this.$errorMsg('数量不能小于0')
|
|
|
return
|
|
|
}
|
|
@@ -950,7 +948,7 @@ export default {
|
|
|
fileNo: this.mainForm.fileNo,
|
|
|
items: goodsList
|
|
|
}
|
|
|
- console.log(params);
|
|
|
+ console.log(params)
|
|
|
if (type === 1) {
|
|
|
if (this.listItem) {
|
|
|
params.enginInfoId = this.listItem.enginInfoId
|