Browse Source

生产总订单-杂发/杂收

jingbb 11 months ago
parent
commit
68b44179ef

+ 28 - 0
src/views/production/productionTotalOrder/modules/SurplusMaterials.vue

@@ -176,6 +176,7 @@
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import JEllipsis from '@/components/jeecg/JEllipsis'
   import inventoryPopup from '../../Popup/inventoryPopup.vue'
+  import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
   import moment from 'moment'
   export default {
     name: 'SurplusMaterials', //  Tabs 详情
@@ -508,6 +509,33 @@
             this.$set(recoerd,'auxiliaryUnit',data.auxiliaryUnit )
             this.$set(recoerd,'inventory',data.ID )
         },
+        sendOrReceive(data){
+            var idExistence = 'yes',
+            idArr = []
+            //判断有没有增行但没保存数据
+            this.selectedRows.map(item=>{
+                if(!item.id||item.id==''){
+                    idExistence = 'no'
+                }else{
+                    idArr.push(item.id)
+                }
+            })
+            if(this.selectedRowKeys.length==0){
+                this.$message.warning('请选择余料管理')
+            }else if(idExistence=='no'){
+                this.$message.warning('请先保存余料管理')
+            }else{
+                getAction('/productionOrder/madeProductionOrders/queryMadeProductionOrdersOutByMainId', {id:idArr.join(','),type:data}).then((res) => {
+                    if (res.success) {
+                        this.$emit('ok','1')
+                        this.$message.success('执行成功');
+                    } else {
+                        this.$emit('ok','2')
+                        this.$message.error(res.message);
+                    }
+                })
+            }
+        }
     },
   
     computed: {

+ 24 - 63
src/views/production/productionTotalOrder/modules/productionTotalOrderAdd.vue

@@ -117,13 +117,13 @@
                <productDetails ref="productDetails"></productDetails>
             </a-tab-pane>
             <a-tab-pane tab="材料明细" :key="refKeys[1]" :forceRender="true">
-               <material ref="material" @changeEdit = 'changeEdit' @clearn="clearnExecute"></material>
+               <material ref="material"  @clearn="clearnExecute"></material>
             </a-tab-pane>
             <a-tab-pane tab="入库暂存" :key="refKeys[2]" :forceRender="true">
                 <TemporaryStorage ref='TemporaryStorage'></TemporaryStorage>
             </a-tab-pane>
             <a-tab-pane tab="余料管理" :key="refKeys[3]" :forceRender="true">
-                <SurplusMaterials ref='SurplusMaterials' @ok="handleCancel"></SurplusMaterials>
+                <SurplusMaterials ref='SurplusMaterials' @ok="closeModel"></SurplusMaterials>
             </a-tab-pane>
         </a-tabs>
        
@@ -224,42 +224,6 @@
                 this.selectedRows = []
                 this.$emit('ok')
             },
-            // changeChose(prop){
-            //     if(prop=='选择委外材料明细'){
-            //         this.$refs.material.allowEditMaterial ='yes'
-            //         this.activeKey = 'material'
-            //     }else if(prop == '修改入库颜色'){
-            //         this.$refs.SurplusMaterials.allowEditColor ='yes'
-            //         this.activeKey = 'SurplusMaterials'
-            //     }else if(prop == '修改出库颜色'){
-            //         this.$refs.TemporaryStorage.allowEditColor ='yes'
-            //         this.activeKey = 'TemporaryStorage'
-            //     }else if(prop == '委外增行'){
-            //         this.$refs.material.addMaterial()
-            //         this.activeKey = 'material'
-            //     }else if(prop =='委外拆分行'){
-            //         this.$refs.material.copyRow()
-            //         this.activeKey = 'material'
-            //     }else if(prop =='委外删行'){
-            //         this.$refs.material.delecteCopyRow()
-            //         this.activeKey = 'material'
-            //     }else if(prop =='委外保存'){
-            //         this.changeEdit()
-            //     }else if(prop=='生产出入库页签'){
-            //         this.generateList()
-            //     }
-            // },
-            generateList(){
-                getAction('/productionOrder/madeProductionOrders/createTabs',{id:this.form.id}).then(res=>{
-                    if(res.success){
-                       this.$message.success('执行成功!');
-                       this.getTemporaryStorageData(this.form.id)
-                       this.getSurplusMaterialsData(this.form.id)
-                    }else{
-                      this.$message.error(res.message);
-                    }
-                })
-            },
             handleOk(){
                 this.$refs.form.validate(success => {
                     if (success) {
@@ -310,31 +274,6 @@
                         }             
                     }
                 })
-            },
-            changeEdit(){
-                var madeProductionOrdersPage = this.form
-                madeProductionOrdersPage.madeProductionOrdersFinishedList = this.$refs.productDetails.form.dataSource
-                madeProductionOrdersPage.madeProductionOrdersMaterialList = this.$refs.material.form.dataSource
-                madeProductionOrdersPage.madeProductionOrdersInList = this.$refs.TemporaryStorage.dataSource
-                madeProductionOrdersPage.madeProductionOrdersOutList = this.$refs.SurplusMaterials.form.dataSource
-                postAction('/productionOrder/madeProductionOrders/editChild', madeProductionOrdersPage).then((res) => {
-                        if (res.success) {
-                            console.log(res.message);
-                            this.$refs.productDetails.form.dataSource = madeProductionOrdersPage.madeProductionOrdersFinishedList
-                            this.$refs.material.form.dataSource = madeProductionOrdersPage.madeProductionOrdersMaterialList
-                            this.$refs.TemporaryStorage.dataSource = madeProductionOrdersPage.madeProductionOrdersOutList
-                            this.$refs.SurplusMaterials.form.dataSource= madeProductionOrdersPage.madeProductionOrdersInList
-                        } else {
-                            this.$message.error(res.message);
-                        }
-                    }).finally(() => {
-                    })
-            },
-            handleTableChange(){
-
-            },
-            onSearch(){
-               
             },
             //获取主表信息
             getMainData(id){
@@ -413,10 +352,12 @@
                     }
                 })
             },
+            //查询生产组织
             onSearchProductionOrg(){ 
                     this.$refs.organizationPopup.visible = true
                     this.$refs.organizationPopup.getData()
             },
+            //查询业务员
             onSearchPerson(){
                 if(this.form.orgName&&this.form.orgName!==''){
                     this.$refs.OperatorsPopup.visible = true
@@ -425,6 +366,7 @@
                     this.$message.warning('请选择生产组织!')
                 }
             },
+            //查询部门
             onSearchPlanDept(){
                 if(this.form.orgName&&this.form.orgName!==''){
                     this.$refs.deparmentPopup.visible = true
@@ -433,6 +375,7 @@
                     this.$message.warning('请选择生产组织!')
                 }
             },
+            //选择项目
             okData(data){
                 this.$set(this.form,'projectCode',data.Code)
                 this.$set(this.form,'projectName',data.Name)
@@ -456,6 +399,7 @@
                     this.$refs.form.clearValidate(['projectCode']);
                 }
             },
+            //查询生产组织
             onSearchProject(){
                     if(this.form.orgName&&this.form.orgName!==''){
                         this.$refs.projectPopup.visible = true
@@ -485,6 +429,7 @@
             clearnExecute(){
                 this.execute = ''
             },
+            //选择组织
             okDataOrganization(data){
                 this.$set(this.form,'orgName',data.Name)
                 this.$set(this.form,'orgCode',data.Code)
@@ -496,10 +441,12 @@
                     this.$refs.form.clearValidate(['orgName']);
                 }
             },
+            //选择业务员
             okDataOperators(data){
                 this.$set(this.form,'salesperson',data.Name)
                 this.$set(this.form,'salespersonId',data.ID)
             },
+            //选择部门
             okDataDeparment(data){
                 this.$set(this.form,'planDept',data.Name)
                 this.$set(this.form,'planDeptId',data.ID)
@@ -509,29 +456,43 @@
                 this.$refs.productWarehousModel.visible = true
                 this.$refs.productWarehousModel.form.dataSource = this.$refs.productDetails.form.dataSource
             },
+             //打开框/扇入库弹窗
             KSWarehousing(){
                 this.$refs.KSWarehousing.visible = true
                 this.$refs.KSWarehousing.form.dataSource = this.$refs.productDetails.form.dataSource
             },
+            //打开框/扇出库弹窗
             KSOutbound(){
                 this.$refs.KSOutbound.visible = true
                 this.$refs.KSOutbound.form.dataSource = this.$refs.productDetails.form.dataSource
             },
+            //打开材料入库弹窗
             materiaWarehous(){
                 this.$refs.materiaWaring.visible = true
                 this.$refs.materiaWaring.form.dataSource = this.$refs.material.form.dataSource
             },
+            //成品入库,框/扇入库,框/扇出库执行完接口重新获取成品明细,和入库暂存列表
             RefreshList(data){
                 this.getProductData(this.form.id)
                 if(data!=='product'){
                     this.getTemporaryStorageData(this.form.id)
                 }
             },
+            //触发杂发杂收接口
             sendOrReceive(data){
+                this.loading = true
                  this.$refs.SurplusMaterials.sendOrReceive(data)
             },
+            //材料入库后重新获取材料明细列表
             RefreshMateriaList(){
                 this.getMaterialData(this.form.id)
+            },
+            //杂发杂收接口执行结果
+            closeModel(data){
+                this.loading = false
+                if(data=='1'){
+                    this.handleCancel()
+                }
             }
         }
       }