landydb 2 сар өмнө
parent
commit
ed634872a2

+ 20 - 14
src/views/modules/production/plan-submit.vue

@@ -34,11 +34,6 @@
         :data="dataForm.proProductList"
         border
         v-loading="dataListLoading"
-        @expand-change="handleExpandChange" 
-        :expand-row-keys="expandedRowKeys" 
-        :load="loadingData" 
-        row-key="productId"
-        lazy
         style="width: 100%;">
         <el-table-column
           label="序号"
@@ -71,7 +66,6 @@
           label="版本号">
         </el-table-column>
         <el-table-column
-          prop="attachList2"
           header-align="center"
           align="center"
           min-width="140"
@@ -163,9 +157,9 @@
           :show-tooltip-when-overflow="true"
           label="计划数量">
           <template slot-scope="scope">
-            <!-- <el-form-item :prop="'proProductList.' + scope.$index + '.planCnt'" :rules="dataRule.planCnt" label-width="0">
+            <el-form-item :prop="'proProductList.' + scope.$index + '.planCnt'" :rules="dataRule.planCnt" label-width="0">
               <el-input v-model="scope.row.planCnt" style="width:80px" :disabled="disabled" @input="scope.row.planCnt = scope.row.planCnt.replace(/[^\d]/g, '')"/>
-            </el-form-item> -->
+            </el-form-item>
           </template>
         </el-table-column>
         <el-table-column
@@ -263,10 +257,15 @@ export default {
         method: 'get'
       }).then(({data}) => {
         if (data && data.code === '200') {
+          this.dataForm = data.data
           data.data.proProductList.map(item => {
-            item.hasChildren = item.proProductList != null && item.proProductList.length > 0
+            if(item.proProductList != null && item.proProductList.length > 0){
+              item.proProductList.map(item2 => {
+                this.dataForm.proProductList.push(item2)
+              })
+            }
           })
-          this.dataForm = data.data
+          
           console.log(this.dataForm)
         } else {
           this.$message.error(data.msg)
@@ -285,11 +284,18 @@ export default {
     dataFormSubmit () {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
+          
           let data = {
             orderCode: this.dataForm.orderCode,
             proProductList: this.dataForm.proProductList
           }
 
+          let index = this.dataForm.proProductList.findIndex(item => item.isTechnology == null)
+          if(index > -1){
+            this.$message.error("请勾选 工艺")
+            return
+          }
+
           console.log('data', data)
 
           this.$http({
@@ -327,11 +333,11 @@ export default {
     },
     loadingData(row, treeNode, resolve) {
       console.log('loadingData')
-      // if (!this.treeMap.has(row.productId)) {
-      //   this.treeMap.set(row.productId, { row, treeNode, resolve })
-      // }
+      if (!this.treeMap.has(row.productId)) {
+        this.treeMap.set(row.productId, { row, treeNode, resolve })
+      }
 
-      // row.children = row.proProductList
+      row.children = row.proProductList
       resolve(row.proProductList)
     },
   }