liqianyi 2 лет назад
Родитель
Сommit
9c440ae4dd
1 измененных файлов с 6 добавлено и 36 удалено
  1. 6 36
      src/views/modules/warehouse/stock-order-inbound.vue

+ 6 - 36
src/views/modules/warehouse/stock-order-inbound.vue

@@ -145,7 +145,6 @@
         this.$emit('onChose')
       },
       async init (id, display, dataForm) {
-        // console.log(dataForm)
         this.display = display
         this.id = id || 0
         this.visible = true
@@ -176,32 +175,9 @@
       addOne (item) {
         this.dataList.push({...item,
           buttonType: item ? (item.buttonType ? '1' : '0') : '0',
-          // id: item ? item.id : '',
           amount: item ? item.amount : 0,
-          // applicant: item ? item.applicant : '',
-          // approver: item ? item.approver : '',
-          // unitName: item ? item.unitName : '',
-          // specifications: item ? item.specifications : '',
-          // batchNumber: item ? item.batchNumber : '',
-          // cnt: item ? item.cnt : '',
-          // categoryName: item ? item.categoryName : '',
-          // materialId: item ? item.materialId : '',
-          // materialName: item ? item.materialName : '',
-          // notes: item ? item.notes : '',
-          // orgId: item ? item.orgId : '',
-          // price: item ? item.price : '',
-          // recordType: item ? item.recordType : '',
-          // source: item ? item.source : '',
           state: item ? item.state : 0,
-          // templateItemPlanId: item ? item.templateItemPlanId : '',
-          // usage: item ? item.usage : '',
-          // userId: item ? item.userId : '',
-          // orgName: item ? item.orgName : '',
-          // unitNeedChange: item ? item.unitNeedChange : '',
-          // conversionName: item ? item.conversionName : '',
           sourceCategory: item ? item.sourceCategory : '2'
-          // materialTypeId: item ? item.materialTypeId : '',
-          // tableId: item ? item.tableId : null
         })
       },
       removeOne (index) {
@@ -215,27 +191,21 @@
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
             let postData = []
+            for (let i = 0; i < this.dataList.length; i++) {
+              if (!this.dataList[i].batchNumber) {
+                this.$message.warning('批次号不能为空')
+                return
+              }
+            }
             this.dataList.forEach((item) => {
               postData.push({...item,
-                // amount: item.amount,
                 applicant: this.dataForm.userId,
-                // approver: item.approver,
-                // batchNumber: item.batchNumber,
-                // cnt: item.cnt,
-                // materialId: item.materialId,
                 materialName: item.materialName ? item.materialName : item.materialId,
                 materialTypeId: item.materialTypeId ? item.materialTypeId : item.cateId,
-                // notes: item.notes,
                 orgId: this.$store.state.user.orgId,
-                // price: item.price,
                 recordCode: this.dataForm.recordCode,
                 recordType: this.dataForm.recordType,
-                // source: item.source,
-                // specifications: item.specifications,
-                // unitName: item.unitName,
-                // unitNeedChange: item.unitNeedChange,
                 userId: this.$store.state.user.id
-                // sourceCategory: item.sourceCategory
               })
             })
             inboundBatch(postData).then(({data}) => {