Bläddra i källkod

生产总订单-档案弹窗

jingbb 1 år sedan
förälder
incheckning
cd155536ef

+ 29 - 10
src/views/production/productionTotalOrder/modules/material.vue

@@ -39,7 +39,7 @@
                 </template> 
                 <template slot="inventoryCode" slot-scope="text, record, index">
                     <a-form-model-item prop="inventoryCode" class='sonItem'>
-                        <a-input placeholder="请输入" v-model="record.inventoryCode" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
+                        <a-input-search placeholder="请输入" v-model="record.inventoryCode" @search="onSearchInven(record)" readOnly ></a-input-search>
                     </a-form-model-item>
                 </template>
                 <template slot="inventoryName" slot-scope="text, record, index">
@@ -209,12 +209,14 @@
                 </template>
             </a-table>
         </a-form-model>
+        <inventoryPopup ref="inventoryPopup" @okData="okDataInvent"></inventoryPopup>
     </div>
   </template>
   
   <script>
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import JEllipsis from '@/components/jeecg/JEllipsis'
+  import inventoryPopup from '../../Popup/inventoryPopup.vue'
   import moment from 'moment'
   export default {
     name: 'material', //  Tabs 详情
@@ -222,6 +224,7 @@
     components: {
       JEllipsis,
       moment,
+      inventoryPopup
     },
     data() {
       return {
@@ -253,14 +256,14 @@
                     align:"center",
                     dataIndex: 'projectCode',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'projectCode' } 
+                    // scopedSlots: { customRender: 'projectCode' } 
                 },
                 {
                     title: '项目名称',
                     align:"center",
                     dataIndex: 'projectName',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'projectName' } 
+                    // scopedSlots: { customRender: 'projectName' } 
                 },
                 {
                     title: '批次',
@@ -282,7 +285,7 @@
                     align:"center",
                     dataIndex: 'inventoryName',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'inventoryName' } 
+                    // scopedSlots: { customRender: 'inventoryName' } 
 
                 },
                 {
@@ -290,7 +293,7 @@
                     align:"center",
                     dataIndex: 'unit',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'unit' } 
+                    // scopedSlots: { customRender: 'unit' } 
 
                 },
                 {
@@ -306,7 +309,7 @@
                     align:"center",
                     dataIndex: 'auxiliaryUnit',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'auxiliaryUnit' } 
+                    // scopedSlots: { customRender: 'auxiliaryUnit' } 
                 },
                 {
                     title: '辅数量',
@@ -334,7 +337,7 @@
                     align:"center",
                     dataIndex: 'specs',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'specs' } 
+                    // scopedSlots: { customRender: 'specs' } 
                 },
                 {
                     title: '型号',
@@ -533,8 +536,8 @@
             this.selectedRowKeys = selectedRowKeys;
             this.selectedRows = selectionRows;
         },
-        addList(){
-            this.dataSource.unshift({rowNo: this.dataSource.length+1})
+        addList(projectCode,projectName){
+            this.dataSource.unshift({rowNo: this.dataSource.length+1,projectCode:projectCode,projectName:projectName})
         },
         delectRow(){
             if( this.selectedRowKeys.length==0){
@@ -606,7 +609,23 @@
                 record.unQuantity = ''
                 this.$message.warning('辅数量不可小于已执行辅数量!')
             }
-        }
+        },
+        onSearchInven(record){
+            if(this.allowEdit=='no'&&!record.newRow){
+                this.$message.warning('不可编辑!')
+            }else{
+                this.$refs.inventoryPopup.visible = true
+                this.$refs.inventoryPopup.getData()
+                this.$refs.inventoryPopup.record=record
+            }
+        },
+        okDataInvent(data,recoerd){
+            this.$set(recoerd,'inventoryCode',data.Code)
+            this.$set(recoerd,'inventoryName',data.Name)
+            this.$set(recoerd,'specs',data.SPECS)
+            this.$set(recoerd,'unit',data.unit)
+            this.$set(recoerd,'auxiliaryUnit',data.auxiliaryUnit )
+        },
     },
   
     computed: {

+ 28 - 9
src/views/production/productionTotalOrder/modules/productDetails.vue

@@ -36,7 +36,7 @@
                 </template> 
                 <template slot="inventoryCode" slot-scope="text, record, index">
                     <a-form-model-item prop="inventoryCode" class='sonItem'>
-                        <a-input placeholder="请输入" v-model="record.inventoryCode" :disabled="allowEdit=='no'"></a-input>
+                        <a-input-search placeholder="请输入" v-model="record.inventoryCode" @search="onSearchInven(record)" readOnly></a-input-search>
                     </a-form-model-item>
                 </template>
                 <template slot="inventoryName" slot-scope="text, record, index">
@@ -206,12 +206,14 @@
                 </template>
             </a-table>
         </a-form-model>
+        <inventoryPopup ref="inventoryPopup" @okData="okDataInvent"></inventoryPopup>
     </div>
   </template>
   
   <script>
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import JEllipsis from '@/components/jeecg/JEllipsis'
+  import inventoryPopup from '../../Popup/inventoryPopup.vue'
   import moment from 'moment'
   export default {
     name: 'productDetails', //  Tabs 详情
@@ -219,6 +221,7 @@
     components: {
       JEllipsis,
       moment,
+      inventoryPopup,
     },
     data() {
       return {
@@ -249,14 +252,14 @@
                     align:"center",
                     dataIndex: 'projectCode',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'projectCode' } 
+                    // scopedSlots: { customRender: 'projectCode' } 
                 },
                 {
                     title: '项目名称',
                     align:"center",
                     dataIndex: 'projectName',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'projectName' } 
+                    // scopedSlots: { customRender: 'projectName' } 
                 },
                 {
                     title: '批次',
@@ -278,7 +281,7 @@
                     align:"center",
                     dataIndex: 'inventoryName',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'inventoryName' } 
+                    // scopedSlots: { customRender: 'inventoryName' } 
 
                 },
                 {
@@ -286,7 +289,7 @@
                     align:"center",
                     dataIndex: 'unit',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'unit' } 
+                    // scopedSlots: { customRender: 'unit' } 
 
                 },
                 {
@@ -302,7 +305,7 @@
                     align:"center",
                     dataIndex: 'auxiliaryUnit',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'auxiliaryUnit' } 
+                    // scopedSlots: { customRender: 'auxiliaryUnit' } 
                 },
                 {
                     title: '辅数量',
@@ -344,7 +347,7 @@
                     align:"center",
                     dataIndex: 'specs',
                     ellipsis: true,
-                    scopedSlots: { customRender: 'specs' } 
+                    // scopedSlots: { customRender: 'specs' } 
                 },
                 {
                     title: '型号',
@@ -522,8 +525,24 @@
             this.selectedRowKeys = selectedRowKeys;
             this.selectedRows = selectionRows;
         },
-        addList(){
-            this.dataSource.unshift({rowNo: this.dataSource.length+1})
+        addList(projectCode,projectName){
+            this.dataSource.unshift({rowNo: this.dataSource.length+1,projectCode:projectCode,projectName:projectName})
+        },
+        onSearchInven(record){
+            if(this.allowEdit=='no'){
+                this.$message.warning('不可编辑!')
+            }else{
+                this.$refs.inventoryPopup.visible = true
+                this.$refs.inventoryPopup.getData()
+                this.$refs.inventoryPopup.record=record
+            }
+        },
+        okDataInvent(data,recoerd){
+            this.$set(recoerd,'inventoryCode',data.Code)
+            this.$set(recoerd,'inventoryName',data.Name)
+            this.$set(recoerd,'specs',data.SPECS)
+            this.$set(recoerd,'unit',data.unit)
+            this.$set(recoerd,'auxiliaryUnit',data.auxiliaryUnit )
         },
         delectRow(){
             if( this.selectedRowKeys.length==0){

+ 76 - 11
src/views/production/productionTotalOrder/modules/productionTotalOrderAdd.vue

@@ -18,7 +18,7 @@
                 <a-row :gutter="24">
                     <a-col :md="4" :sm="24">
                         <a-form-item label="生产组织">
-                            <a-input-search placeholder="请输入" v-model="form.productionOrg" @search="onSearch" :disabled="allowEdit=='no'"></a-input-search>
+                            <a-input-search placeholder="请输入" v-model="form.productionOrg"  @search="onSearchProductionOrg" readOnly></a-input-search>
                         </a-form-item>
                     </a-col>
                     <a-col  :md="4" :sm="24">
@@ -41,17 +41,17 @@
                     </a-col>
                     <a-col :md="4" :sm="24">
                         <a-form-item label="业务员">
-                            <a-input placeholder="请输入" v-model="form.salesperson" :disabled="allowEdit=='no'"></a-input>
+                            <a-input-search placeholder="请输入" v-model="form.salesperson" @search="onSearchPerson" readOnly ></a-input-search>
                         </a-form-item>
                     </a-col>
                     <a-col :md="4" :sm="24">
                         <a-form-item label="计划部门">
-                            <a-input-search placeholder="请输入" v-model="form.planDept" @search="onSearch" :disabled="allowEdit=='no'"></a-input-search>
+                            <a-input-search placeholder="请输入" v-model="form.planDept" @search="onSearchPlanDept" readOnly></a-input-search>
                         </a-form-item>
                     </a-col>
                     <a-col :md="4" :sm="24">
                         <a-form-item label="项目">
-                            <a-input-search placeholder="请输入" v-model="form.project" @search="onSearch" :disabled="allowEdit=='no'"></a-input-search>
+                            <a-input-search placeholder="请输入" v-model="form.projectName" @search="onSearchProject" readOnly></a-input-search>
                         </a-form-item>
                     </a-col>
                     <a-col :md="4" :sm="24">
@@ -84,7 +84,7 @@
                     </a-col>
                     <a-col :md="4" :sm="24">
                         <a-form-item label="项目编码" >
-                            <a-input placeholder="请输入" v-model="form.projectCode" :disabled="allowEdit=='no'"></a-input>
+                            <a-input placeholder="请输入" v-model="form.projectCode" disabled></a-input>
                         </a-form-item>
                     </a-col>
                     <a-col :md="4" :sm="24">
@@ -142,6 +142,10 @@
         </a-tabs>
        
     </a-card>
+    <organizationPopup ref="organizationPopup" @okData="okDataOrganization"></organizationPopup>
+    <OperatorsPopup ref="OperatorsPopup" @okData="okDataOperators"></OperatorsPopup>
+    <deparmentPopup ref="deparmentPopup" @okData="okDataDeparment"></deparmentPopup>
+    <projectPopup ref="projectPopup" @okData="okData"></projectPopup>
     </a-modal>
   </template>
   <script>
@@ -154,6 +158,10 @@
       import Warehousing from './Warehousing'
       import moment from "moment"
       import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
+      import organizationPopup from '../../Popup/organizationPopup.vue'
+      import OperatorsPopup from '../../Popup/OperatorsPopup.vue'
+      import deparmentPopup from '../../Popup/deparmentPopup.vue'
+      import projectPopup from '../../Popup/projectPopup'
       export default {
         name: 'materialProcurementAdd',
         mixins: [JEditableTableModelMixin],
@@ -161,7 +169,11 @@
             productDetails,
             material,
             Outbound,
-            Warehousing
+            Warehousing,
+            organizationPopup,
+            OperatorsPopup,
+            deparmentPopup,
+            projectPopup
         },
         data() {
           return {
@@ -246,8 +258,8 @@
                     postAction('/productionOrder/madeProductionOrders/add', madeProductionOrdersPage).then((res) => {
                         if (res.success) {
                             this.$message.success('添加成功!');
-                            this.handleCancel()
                             this.$emit('ok')
+                            this.handleCancel()
                         } else {
                             this.$message.error(res.message);
                         }
@@ -257,8 +269,8 @@
                 }else{
                     postAction('/productionOrder/madeProductionOrders/edit', madeProductionOrdersPage).then((res) => {
                         if (res.success) {
-                            this.handleCancel()
                             this.$emit('ok')
+                            this.handleCancel()
                             this.$message.success('编辑成功!');
                         } else {
                             this.$message.error(res.message);
@@ -353,6 +365,50 @@
                     }
                 })
             },
+            onSearchProductionOrg(){ 
+                if(this.allowEdit=='no'){
+                    this.$message.warning('不可编辑!')
+                }else{
+                    this.$refs.organizationPopup.visible = true
+                    this.$refs.organizationPopup.getData()
+                }
+            },
+            onSearchPerson(){
+                if(this.allowEdit=='no'){
+                    this.$message.warning('不可编辑!')
+                }else{
+                    this.$refs.OperatorsPopup.visible = true
+                    this.$refs.OperatorsPopup.getData()
+                }
+            },
+            onSearchPlanDept(){
+                if(this.allowEdit=='no'){
+                    this.$message.warning('不可编辑!')
+                }else{
+                    this.$refs.deparmentPopup.visible = true
+                    this.$refs.deparmentPopup.getData()
+                }
+            },
+            okData(data){
+                this.$set(this.form,'projectCode',data.Code)
+                this.$set(this.form,'projectName',data.Name)
+                this.$refs.productDetails.dataSource.map((item,index)=>{
+                    item.projectCode = data.Code
+                    item.projectName = data.Name
+                })
+                this.$refs.material.dataSource.map((item,index)=>{
+                    item.projectCode = data.Code
+                    item.projectName = data.Name
+                })
+            },
+            onSearchProject(){
+                if(this.allowEdit=='no'){
+                    this.$message.warning('不可编辑!')
+                }else{
+                    this.$refs.projectPopup.visible = true
+                    this.$refs.projectPopup.getData()
+                }
+            },
             //获取子表信息
             getWarehousingData(id){
                 //委外入库
@@ -370,9 +426,9 @@
             },
             addList(){
                 if(this.activeKey=='finishProduct'){
-                    this.$refs.productDetails.addList()
+                    this.$refs.productDetails.addList(this.form.projectCode,this.form.projectName)
                 }else if(this.activeKey=='material'){
-                    this.$refs.material.addList()
+                    this.$refs.material.addList(this.form.projectCode,this.form.projectName)
                 }
                 // else if(this.activeKey=='Outbound'){
                 //     this.$refs.Outbound.addList()
@@ -394,7 +450,16 @@
             },
             clearnExecute(){
                 this.execute = ''
-            }
+            },
+            okDataOrganization(data){
+                this.$set(this.form,'productionOrg',data.Name)
+            },
+            okDataOperators(data){
+                this.$set(this.form,'salesperson',data.Name)
+            },
+            okDataDeparment(data){
+                this.$set(this.form,'planDept',data.Name)
+            },
 
         }
       }

+ 3 - 3
src/views/production/productionTotalOrder/productionTotalOrderList.vue

@@ -8,7 +8,7 @@
               <a-row :gutter="24">
                 <a-col :md="4" :sm="24">
                   <a-form-item label="生产组织">
-                    <a-input-search placeholder="请输入" v-model="queryParam.productionOrg" @search="onSearch"></a-input-search>
+                    <a-input placeholder="请输入" v-model="queryParam.productionOrg" ></a-input>
                   </a-form-item>
                 </a-col>
                 <a-col  :md="4" :sm="24">
@@ -32,12 +32,12 @@
                 <template v-if="toggleSearchStatus">
                   <a-col :md="4" :sm="24">
                     <a-form-item label="业务员">
-                      <a-input-search placeholder="请输入" v-model="queryParam.salesperson" @search="onSearch"></a-input-search>
+                      <a-input placeholder="请输入" v-model="queryParam.salesperson"></a-input>
                     </a-form-item>
                   </a-col>
                   <a-col :md="4" :sm="24">
                     <a-form-item label="计划部门">
-                    <a-input-search placeholder="请输入" v-model="queryParam.planDept" @search="onSearch"></a-input-search>
+                    <a-input placeholder="请输入" v-model="queryParam.planDept" ></a-input>
                   </a-form-item>
                   </a-col>
                   <a-col :md="4" :sm="24">