Browse Source

生产总订单-修改按钮弹窗数据源/增加弹窗必填校验

jingbb 11 months ago
parent
commit
1cfdfc7f0d

+ 14 - 13
src/views/production/productionTotalOrder/modules/KSOutbound.vue

@@ -37,7 +37,7 @@
                     
                     <template slot="boxFreight" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.boxFreight'" class='sonItem' :rules="rules.boxFreight">
-                            <a-input placeholder="请输入" v-model="record.boxFreight" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.boxFreight"  style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                     <span slot="fanFreightTitle" class="form-table-heard">
@@ -45,17 +45,17 @@
                     </span>
                     <template slot="fanFreight" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.fanFreight'" class='sonItem' :rules="rules.fanFreight">
-                            <a-input placeholder="请输入" v-model="record.fanFreight" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.fanFreight" style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                     <template slot="executeOutLeafNow" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.executeOutLeafNow'" class='sonItem' :rules="rules.executeOutLeafNow">
-                            <a-input placeholder="请输入" v-model="record.executeOutLeafNow" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.executeOutLeafNow" style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                     <template slot="executeOutFramesNow" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.executeOutFramesNow'" class='sonItem' :rules="rules.executeOutFramesNow">
-                            <a-input placeholder="请输入" v-model="record.executeOutFramesNow" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.executeOutFramesNow" style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                 </a-table>
@@ -131,7 +131,7 @@
                     ellipsis: true,
                 },
                 {
-                    // title: '成品入库数量',
+                    // title: '框运费',
                     align:"center",
                     dataIndex: 'boxFreight',
                     ellipsis: true,
@@ -139,7 +139,7 @@
                     slots:{title:'boxFreightTitle'},
                 },
                 {
-                    // title: '成品入库数量',
+                    // title: '扇运费',
                     align:"center",
                     dataIndex: 'fanFreight',
                     ellipsis: true,
@@ -377,6 +377,8 @@
           rules:{
             // boxFreight:{required:true,message:"不可为空"},
             // fanFreight:{required:true,message:"不可为空"},
+            // executeOutLeafNow:{required:true,message:"不可为空"},
+            // executeOutFramesNowTitle:{required:true,message:"不可为空"},
         },
       }
     },
@@ -391,17 +393,16 @@
             this.selectedRows = selectionRows;
         },
         handleOk(){
-            var idExistence = 'yes'
-            //判断有没有未保存数据
+            var mandatoryField  = '1'
             this.selectedRows.map(item=>{
-                if(!item.id||item.id==''){
-                    idExistence = 'no'
-                }
+                if(!item.boxFreight||!item.fanFreight||!item.executeOutLeafNow||!item.executeOutFramesNow){
+                    mandatoryField = '0'
+                }                
             })
             if(this.selectedRows.length==0){
                 this.$message.warning('请勾选数据')
-            }else if(idExistence=='no'){
-                this.$message.warning('请先保存成品明细')
+            }else if(mandatoryField=='0'){
+                this.$message.warning('请输入框运费、扇运费、本次执行扇数量、本次执行框数量')
             }else{
                 this.loading =true
                 postAction('/productionOrder/madeProductionOrders/outMadeProductionOrdersOutList', {madeProductionOrdersInList:this.selectedRows}).then((res) => {

+ 9 - 9
src/views/production/productionTotalOrder/modules/KSWarehousing.vue

@@ -32,12 +32,12 @@
                     </span>
                     <template slot="executeOutLeafNow" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.executeOutLeafNow'" class='sonItem' :rules="rules.executeOutLeafNow">
-                            <a-input placeholder="请输入" v-model="record.executeOutLeafNow" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.executeOutLeafNow" style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                     <template slot="executeOutFramesNow" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.executeOutFramesNow'" class='sonItem' :rules="rules.executeOutFramesNow">
-                            <a-input placeholder="请输入" v-model="record.executeOutFramesNow" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.executeOutFramesNow" style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                 </a-table>
@@ -65,6 +65,7 @@
             dataSource:[],
         },
         loading:false,
+        rules:[],
         columns: [
                 {
                     title: '#',
@@ -349,17 +350,16 @@
     created() {},
     methods: {
         handleOk(){
-            var idExistence = 'yes'
-            //判断有没有未保存数据
+            var mandatoryField  = '1'
             this.selectedRows.map(item=>{
-                if(!item.id||item.id==''){
-                    idExistence = 'no'
-                }
+                if(!item.executeOutLeafNow||!item.executeOutFramesNow){
+                    mandatoryField = '0'
+                }                
             })
             if(this.selectedRows.length==0){
                 this.$message.warning('请勾选数据')
-            }else if(idExistence=='no'){
-                this.$message.warning('请先保存成品明细')
+            }else if(mandatoryField=='0'){
+                this.$message.warning('请输入本次执行扇数量、本次执行框数量')
             }else{
                 this.loading =true
                 postAction('/productionOrder/madeProductionOrders/inMadeProductionOrdersOutList', {madeProductionOrdersInList:this.selectedRows}).then((res) => {

+ 9 - 9
src/views/production/productionTotalOrder/modules/materiaWaring.vue

@@ -29,7 +29,7 @@
                     </span>
                     <template slot="nowExecutionQuan" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.nowExecutionQuan'" class='sonItem' :rules="rules.nowExecutionQuan">
-                            <a-input placeholder="请输入" v-model="record.nowExecutionQuan" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.nowExecutionQuan"  style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                     <span slot="nowAuxiliaryQuanTitle" class="form-table-heard">
@@ -37,7 +37,7 @@
                     </span>
                     <template slot="nowAuxiliaryQuan" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.nowAuxiliaryQuan'" class='sonItem' :rules="rules.nowAuxiliaryQuan">
-                            <a-input placeholder="请输入" v-model="record.nowAuxiliaryQuan" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.nowAuxiliaryQuan"  style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                 </a-table>
@@ -64,6 +64,7 @@
         form:{
             dataSource:[],
         },
+        rules:[],
         loading:false,
         columns: [
                 {
@@ -338,17 +339,16 @@
     created() {},
     methods: {
         handleOk(){
-            var idExistence = 'yes'
-            //判断有没有未保存数据
+            var mandatoryField  = '1'
             this.selectedRows.map(item=>{
-                if(!item.id||item.id==''){
-                    idExistence = 'no'
-                }
+                if(!item.nowExecutionQuan||!item.nowAuxiliaryQuan){
+                    mandatoryField = '0'
+                }                
             })
             if(this.selectedRows.length==0){
                 this.$message.warning('请勾选数据')
-            }else if(idExistence=='no'){
-                this.$message.warning('请先保存材料明细')
+            }else if(mandatoryField=='0'){
+                this.$message.warning('请输入本次执行主数量、本次执行辅数量')
             }else{
                 this.loading =true
                 postAction('/productionOrder/madeProductionOrders/syNcMadeProductionOrdersMaterialList', {madeProductionOrdersMaterialList:this.selectedRows}).then((res) => {

+ 10 - 15
src/views/production/productionTotalOrder/modules/productWarehousModel.vue

@@ -29,7 +29,7 @@
                     </span>
                     <template slot="productInQuantity" slot-scope="text, record, index">
                         <a-form-model-item :prop="'dataSource.'+index+'.productInQuantity'" class='sonItem' :rules="rules.productInQuantity">
-                            <a-input placeholder="请输入" v-model="record.productInQuantity" ></a-input>
+                            <a-input-number placeholder="请输入" v-model="record.productInQuantity" style="width: 100%;"></a-input-number>
                         </a-form-model-item>
                     </template> 
                 </a-table>
@@ -324,9 +324,9 @@
                 },
           ],
           visible:false,
-        //   rules:{
-        //     productInQuantity:{required:true,message:"不可为空"},
-        // },
+          rules:{
+            // productInQuantity:{required:true,message:"不可为空"},
+        },
       }
     },
      props: {
@@ -340,21 +340,16 @@
             this.selectedRows = selectionRows;
         },
         handleOk(){
-            // this.$refs.formRef.validate(success => {
-            //     if (success) {
-            //     }
-            // })
-            var idExistence = 'yes'
-            //判断有没有未保存数据
+            var mandatoryField  = '1'
             this.selectedRows.map(item=>{
-                if(!item.id||item.id==''){
-                    idExistence = 'no'
-                }
+                if(!item.productInQuantity){
+                    mandatoryField = '0'
+                }                
             })
             if(this.selectedRows.length==0){
                 this.$message.warning('请勾选数据')
-            }else if(idExistence=='no'){
-                this.$message.warning('请先保存成品明细')
+            }else if(mandatoryField=='0'){
+                this.$message.warning('请输入成品入库数量')
             }else{
                 postAction('/productionOrder/madeProductionOrders/syNcIn', {madeProductionOrdersFinishedList:this.selectedRows}).then((res) => {
                     if (res.success) {

+ 10 - 17
src/views/production/productionTotalOrder/modules/productionTotalOrderAdd.vue

@@ -98,19 +98,6 @@
             <a-button size="small" @click="KSOutbound" :disabled="activeKey!=='finishProduct'||defaultMethod=='add'">框/扇出库</a-button>
             <a-button size="small" @click="sendOrReceive('in')" :disabled="activeKey!=='SurplusMaterials'||defaultMethod=='add'">杂发</a-button>
             <a-button size="small" @click="sendOrReceive('out')" :disabled="activeKey!=='SurplusMaterials'||defaultMethod=='add'">杂收</a-button>
-            <!-- <a-dropdown>
-                <a-button size="small"> 委外 <a-icon type="down" /> </a-button>
-                <a-menu slot="overlay" >
-                    <a-menu-item ><a @click="changeChose('生产出入库页签')">生产出入库页签</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('选择委外材料明细')">选择委外材料明细</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('修改入库颜色')">修改入库颜色</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('修改出库颜色')">修改出库颜色</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('委外增行')">委外增行</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('委外拆分行')">委外拆分行</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('委外删行')">委外删行</a></a-menu-item>
-                    <a-menu-item ><a @click="changeChose('委外保存')">委外保存</a></a-menu-item>
-                </a-menu>
-            </a-dropdown> -->
        </div>
        <a-tabs v-model="activeKey" @change="handleChangeTabs">
             <a-tab-pane tab="成品明细" :key="refKeys[0]" :forceRender="true">
@@ -200,6 +187,8 @@
               ],
             },
             dataSource:[],
+            originalProductDeatil:[],//保存为增行钱的成品明细列表
+            originalMaterial:[],//保存为增行钱的材料明细列表
             loading:false,
             // ipagination:{},
             selectedRowKeys:[],
@@ -292,8 +281,10 @@
             //获取子表信息
             getProductData(id){
                 //成品明细
+                this.originalProductDeatil = []//保存为增行钱的成品明细列表
                 getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersFinishedByMainId',{id:id}).then(res=>{
                     if(res.success){
+                        this.originalProductDeatil = Array.from(res.result)
                         this.$refs.productDetails.form.dataSource =res.result
                         this.$refs.productDetails.planOrg=this.form.pkOrg
                         this.$refs.productDetails.form.dataSource.map((item,index)=>{
@@ -308,8 +299,10 @@
             //获取子表信息
             getMaterialData(id){
                 //材料明细
+                this.originalMaterial = []//保存为增行钱的材料明细列表
                 getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersMaterialByMainId',{id:id}).then(res=>{
                     if(res.success){
+                        this.originalMaterial  = Array.from(res.result)
                         this.$refs.material.form.dataSource =res.result
                         this.$refs.material.planOrg=this.form.pkOrg
                         this.$refs.material.form.dataSource.map((item,index)=>{
@@ -454,22 +447,22 @@
             //成品入库
             productWarehous(){
                 this.$refs.productWarehousModel.visible = true
-                this.$refs.productWarehousModel.form.dataSource = this.$refs.productDetails.form.dataSource
+                this.$refs.productWarehousModel.form.dataSource = this.originalProductDeatil
             },
              //打开框/扇入库弹窗
             KSWarehousing(){
                 this.$refs.KSWarehousing.visible = true
-                this.$refs.KSWarehousing.form.dataSource = this.$refs.productDetails.form.dataSource
+                this.$refs.KSWarehousing.form.dataSource = this.originalProductDeatil
             },
             //打开框/扇出库弹窗
             KSOutbound(){
                 this.$refs.KSOutbound.visible = true
-                this.$refs.KSOutbound.form.dataSource = this.$refs.productDetails.form.dataSource
+                this.$refs.KSOutbound.form.dataSource = this.originalProductDeatil
             },
             //打开材料入库弹窗
             materiaWarehous(){
                 this.$refs.materiaWaring.visible = true
-                this.$refs.materiaWaring.form.dataSource = this.$refs.material.form.dataSource
+                this.$refs.materiaWaring.form.dataSource = this.originalMaterial
             },
             //成品入库,框/扇入库,框/扇出库执行完接口重新获取成品明细,和入库暂存列表
             RefreshList(data){