Browse Source

生产总订单-增加子表必填校验

jingbb 10 months ago
parent
commit
9f3e2055c0
1 changed files with 17 additions and 6 deletions
  1. 17 6
      src/views/production/productionTotalOrder/modules/productDetails.vue

+ 17 - 6
src/views/production/productionTotalOrder/modules/productDetails.vue

@@ -24,6 +24,13 @@
                 <span slot="inventoryCodeTitle" class="form-table-heard">
                     料品编码
                 </span>
+                <span slot="quantityTitle" class="form-table-heard">
+                    成品主数量
+                </span>
+                <span slot="unQuantityTitle" class="form-table-heard">
+                    成品辅数量
+                </span>
+                
                 <template slot="billingType" slot-scope="text, record, index">
                     <a-form-model-item prop="billingType" class='sonItem'>
                         <a-select v-model="record.billingType"  style='width:100%'  >
@@ -48,12 +55,12 @@
                     </a-form-model-item>
                 </template> 
                 <template slot="quantity" slot-scope="text, record, index">
-                    <a-form-model-item prop="quantity" class='sonItem'>
+                    <a-form-model-item :prop="'dataSource.'+index+'.quantity'" class='sonItem' :rules="rules.quantity">
                         <a-input placeholder="请输入" v-model="record.quantity" ></a-input>
                      </a-form-model-item>
                 </template>
                 <template slot="unQuantity" slot-scope="text, record, index">
-                    <a-form-model-item prop="unQuantity" class='sonItem'>
+                    <a-form-model-item :prop="'dataSource.'+index+'.unQuantity'" class='sonItem' :rules="rules.unQuantity">
                         <a-input placeholder="请输入" v-model="record.unQuantity" ></a-input>
                      </a-form-model-item>
                 </template>
@@ -293,19 +300,21 @@
                     ellipsis: true,
                 },
                 {
-                    title: '成品主数量',
+                    // title: '成品主数量',
                     align:"center",
                     dataIndex: 'quantity',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'quantity' } 
+                    scopedSlots: { customRender: 'quantity' } ,
+                    slots:{title:'quantityTitle'},
 
                 },
                 {
-                    title: '成品辅数量',
+                    // title: '成品辅数量',
                     align:"center",
                     dataIndex: 'unQuantity',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'unQuantity' } 
+                    scopedSlots: { customRender: 'unQuantity' } ,
+                    slots:{title:'unQuantityTitle'},
                 },
                 {
                     title: '已入库成品数量',
@@ -532,6 +541,8 @@
             framesCount:{required:true,message:"不可为空"},
             leafCount:{required:true,message:"不可为空"},
             inventoryCode:{required:true,message:"不可为空"},
+            quantity:{required:true,message:"不可为空"},
+            unQuantity:{required:true,message:"不可为空"},
         },
       }
     },