Pārlūkot izejas kodu

商用工程信息单删除

zhouhao 2 gadi atpakaļ
vecāks
revīzija
d5ff682af4
1 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 11 1
      src/views/supply/engin/components/engin_form.vue

+ 11 - 1
src/views/supply/engin/components/engin_form.vue

@@ -844,7 +844,10 @@ export default {
 
       this.goodsList = this.goodsList.concat(this.rightGoodsList)
       this.goodsList.forEach(k => {
-        k.cid = ''
+        if (!k.cid) {
+          k.cid = ''
+
+        }
       })
       this.isShowGoodsDialog = false
       this.leftGoodsList = []
@@ -853,6 +856,8 @@ export default {
 
     // 删除产品
     deleteItem(index, row, id) {
+   
+      // id id存在就说明这个货品已经引用过了
       // if (this.listItem && this.examineStatus === 'OK' && id) {
       //   this.$errorMsg('已审核通过的型号不能删除')
       //   return
@@ -863,9 +868,12 @@ export default {
           itemId: row.id
         }).then(res => {
           this.goodsList.splice(index, 1)
+          this.$successMsg('引用货品删除成功')
         })
       } else {
         this.goodsList.splice(index, 1)
+        this.$successMsg('删除成功')
+
       }
     },
 
@@ -875,6 +883,7 @@ export default {
     },
 
     clickSubmitForm(type) {
+
       this.$refs.mainForm.validate(valid => {
         if (valid) {
           for (let i = 0; i < this.goodsList.length; i++) {
@@ -925,6 +934,7 @@ export default {
             fileNo: this.mainForm.fileNo,
             items: goodsList
           }
+          console.log(params);
           if (type === 1) {
             if (this.listItem) {
               params.enginInfoId = this.listItem.enginInfoId