jingbb 1 год назад
Родитель
Сommit
93adcb15b5

+ 177 - 0
src/views/production/Popup/inventoryTypePopup.vue

@@ -0,0 +1,177 @@
+<template>
+    <a-modal
+      title="存货列表"
+       width="60%"
+      :visible="visible"
+      :maskClosable="false"
+      switchFullscreen
+      @cancel="handleCancel"
+      @ok='handleOk'
+      >
+      <a-card :bordered="false" class="top" style="margin-bottom:1%;margin-top:1%">
+      <a-form-model ref="formRef">
+            <a-table
+            ref="table"
+            size="middle"
+            bordered
+            id='sonList1'
+            :columns="columns"
+            rowKey="rowIndex"
+            :dataSource="dataSource"
+            pagination="false"
+            :scroll="{ x: 800, y: 300 }"
+            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+            @change="handleTableChange"
+            >
+            </a-table>
+        </a-form-model>
+    </a-card >
+    </a-modal>
+  </template>
+  <script>
+  
+      import { FormTypes } from '@/utils/JEditableTableUtil'
+      import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
+      import moment from "moment"
+      import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
+      export default {
+        name: 'inventoryTypePopup',
+        mixins: [JEditableTableModelMixin],
+        components: {
+        },
+        data() {
+          return {
+            visible:false,
+            selectedRowKeys:[],
+            selectedRows:[],
+            dataSource:[],
+            record:{},
+            columns:[
+                {
+                    title: '#',
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    width: 60,
+                    align: "center",
+                    customRender:function (t, r, index) {
+                        return parseInt(index)+1;
+                    }
+                },
+                {
+                    title: '分类名称',
+                    align:"center",
+                    dataIndex: 'Name',
+                    ellipsis: true,
+                },
+                {
+                    title: '分类编码',
+                    align:"center",
+                    dataIndex: 'CombineName',
+                    ellipsis: true,
+                },
+            ]
+          }
+        },
+        created() {
+          
+        },
+        methods: {
+            handleCancel(){
+                this.visible=false
+                this.dataSource = [] 
+                this.selectedRowKeys = []
+                this.selectedRows = []
+            },
+            handleOk(){
+                if(this.selectedRowKeys.length!==1){
+                    this.$message.warning('请选择一条数据!')
+                }else{
+                    this.$emit('okData',this.selectedRows[0],this.record)
+                    this.handleCancel()
+                }
+            },
+            getData(){
+                getAction('/production/safetyStock/selectCategory').then(res=>{
+                        if(res){
+                          this.dataSource = res
+                        }else{
+                          this.$message.error(res.message);
+                          
+                        }
+                })
+            },
+            handleTableChange(pagination, filters, sorter) {
+               
+            },
+            onSelectChange(selectedRowKeys, selectionRows) {
+              this.selectedRowKeys = selectedRowKeys;
+              this.selectedRows = selectionRows;
+            },
+
+        }
+      }
+  </script>
+  
+  <style scoped lang="less">
+    /* @import '~@assets/less/common.less' */
+    /deep/.ant-input{
+        height:29px;
+    }
+    /deep/.ant-select-selection--single {
+        height: 29px;
+    }
+    /deep/.ant-select{
+        font-size: 12px;
+    }
+    /deep/.ant-form label{
+        font-size: 12px;
+    }
+    /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
+        margin-bottom:9px
+    }
+    /deep/.moddle>.ant-card-body{
+        padding-bottom:0px;
+        padding-top: 12px;
+    }
+    /deep/.top>.ant-card-body{
+        padding-bottom: 12px;
+        padding-top: 12px;
+    }
+    /deep/.ant-btn{
+        height:28px
+    }
+    /deep/.ant-modal-body{
+        padding-bottom: 0px;
+        padding-top: 0px;
+    }
+    // /deep/.ant-modal-body{
+    //     background: #f0f2f5;
+    // }
+    /deep/.ant-modal-content{
+        background: #f0f2f5;
+    }
+    /deep/.ant-card-body .table-operator {
+        margin-bottom: 0px;
+    }
+    /deep/.three>.ant-card-body{
+        padding-bottom:12px;
+        padding-top: 12px;
+    }
+    /deep/.bottom>.ant-card-body{
+        padding-bottom:0px;
+        padding-top: 12px;
+    }
+
+    /deep/.ant-calendar-picker{
+        min-width: 0px !important;  
+    }
+    /deep/.sonItem {
+        margin-bottom:0px !important
+    }
+    /deep/#sonList1>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-content>.ant-table-scroll>.ant-table-body>.ant-table-fixed>.ant-table-tbody > tr > td {
+        padding: 8px 8px !important;
+    }
+    /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
+        width: calc(100% + 9px);//减去滚动条的宽度
+    }
+  </style>

+ 24 - 3
src/views/production/mrp/modules/MRPEdit.vue

@@ -80,8 +80,8 @@
      <a-card :bordered="false" class="three" style="margin-bottom:1%" :loading = 'loading'>
        <div class="table-operator">
             <a-button type="danger" size="small"  @click="updataProRequirment" v-if="form.type=='工装'">更新采购需求</a-button>
-            <a-button  size="small">生成采购单</a-button>
-            <a-button  size="small">生成转库单</a-button>
+            <a-button  size="small" @click="generatePurchaseOrder">生成采购单</a-button>
+            <a-button  size="small" @click="generatetRansferOrder">生成转库单</a-button>
        </div>
        <a-tabs v-model="activeKey" @change="handleChangeTabs">
             <a-tab-pane tab="需求" :key="refKeys[0]" :forceRender="true">
@@ -314,7 +314,28 @@
                 })
             },
             updataProRequirment(){
-
+                this.$confirm({
+                    title: '确认更新采购需求',
+                    content: '是否更新采购需求?',
+                    onOk:  ()=> {
+                    }
+                })
+            },
+            generatePurchaseOrder(){
+                this.$confirm({
+                    title: '确认生成采购单',
+                    content: '是否生成采购单?',
+                    onOk:  ()=> {
+                    }
+                })
+            },
+            generatetRansferOrder(){
+                this.$confirm({
+                    title: '确认生成转库单',
+                    content: '是否生成转库单?',
+                    onOk:  ()=> {
+                    }
+                })
             }
 
         }

+ 70 - 15
src/views/production/mrp/modules/operation.vue

@@ -4,42 +4,45 @@
        width="35%"
       :visible="visible"
       :maskClosable="false"
+      destroyOnClose
       switchFullscreen
       @cancel="handleCancel"
       @ok='handleOk'
       >
       <a-card :bordered="false" class="top" style="margin-bottom:1%;margin-top:1%" :loading = 'loading'>
         <div class="table-page-search-wrapper">
-            <a-form layout="inline" @keyup.enter.native="searchQuery">
+            <a-form-model layout="inline" :model="form" :rules="rules"  ref="form">
                 <a-row :gutter="24">
                     <a-col :md="24" :sm="24">
-                        <a-form-item label="业务类型">
-                            <a-select v-model="form.type"  style='width:100%' >
+                        <a-form-model-item label="业务类型" prop="type">
+                            <a-select v-model="form.type"  style='width:100%' @change="changeType">
                                 <a-select-option value='家装'>家装</a-select-option>
                                 <a-select-option value='工装'>工装</a-select-option>
                             </a-select>
-                        </a-form-item>
+                        </a-form-model-item>
                     </a-col>
                     <a-col  :md="24" :sm="24">
-                        <a-form-item label="项目名称">
-                            <a-input-search placeholder="请输入" v-model="form.planOrg" @search="onSearch"></a-input-search>
-                        </a-form-item>
+                        <a-form-model-item label="项目名称" prop="projectName" >
+                            <a-input-search placeholder="请输入" v-model="form.projectName" @search="onSearchProject"></a-input-search>
+                        </a-form-model-item>
                     </a-col>
                     <a-col :md="24" :sm="24">
-                        <a-form-item label="工单号">
-                            <a-input-search placeholder="请输入" v-model="form.planOrg" @search="onSearch"></a-input-search>
-                        </a-form-item>
+                        <a-form-model-item label="工单号" prop="workNo">
+                            <a-input-search placeholder="请输入" v-model="form.workNo" @search="onSearch"></a-input-search>
+                        </a-form-model-item>
                     </a-col>
                     <a-col :md="24" :sm="24">
-                        <a-form-item label="存货分类">
-                            <a-input-search placeholder="请输入" v-model="form.planOrg" @search="onSearch"></a-input-search>
-                        </a-form-item>
+                        <a-form-model-item label="存货分类" prop="inventoryType">
+                            <a-input-search placeholder="请输入" v-model="form.inventoryType" @search="onSearchType"></a-input-search>
+                        </a-form-model-item>
                     </a-col>
    
                 </a-row>
-            </a-form>
+            </a-form-model>
         </div>
      </a-card>
+     <projectPopup ref="projectPopup" @okData="okData"></projectPopup>
+     <inventoryTypePopup ref="inventoryTypePopup" @okData="okDataType"></inventoryTypePopup>
     </a-modal>
   </template>
   <script>
@@ -48,10 +51,14 @@
       import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
       import moment from "moment"
       import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
+      import projectPopup from '../../Popup/projectPopup'
+      import inventoryTypePopup from '../../Popup/inventoryTypePopup'
       export default {
         name: 'operation',
         mixins: [JEditableTableModelMixin],
         components: {
+            projectPopup,
+            inventoryTypePopup
         },
         data() {
           return {
@@ -59,6 +66,20 @@
             form:{},
             form1:{},
             loading:false,
+            rules:{
+                type: [
+                    { required: true, trigger: 'change' },
+                ],
+                projectName: [
+                    { required: false, trigger: 'change' },
+                ],
+                workNo: [
+                    { required: false, trigger: 'change' },
+                ],
+                inventoryType: [
+                    { required: false, trigger: 'change' },
+                ],
+            },
             // ipagination:{},
             selectedRowKeys:[],
             selectedRows:[],
@@ -76,11 +97,41 @@
                 this.form1={}
             },
             handleOk(){
+                this.$refs.form.validate(success => {
+	              if (success) {
+
+                  }
+                })
             },
             onSearch(){
                
             },
-
+            onSearchProject(){
+                this.$refs.projectPopup.visible = true
+                this.$refs.projectPopup.getData()
+            },
+            onSearchType(){
+                this.$refs.inventoryTypePopup.visible = true
+                this.$refs.inventoryTypePopup.getData()
+            },
+            okData(data){
+                this.$set(this.form,'projectName',data.Name)
+                this.$set(this.form,'project',data.ID)
+            },
+            okDataType(data){
+                this.$set(this.form,'inventoryType',data.Name)
+            },
+            changeType(prop){
+                if(prop=='家装'){
+                    this.rules.inventoryType[0].required = true
+                    this.rules.projectName[0].required = false
+                    this.rules.workNo[0].required = false
+                }else{
+                    this.rules.projectName[0].required = true
+                    this.rules.workNo[0].required = true
+                    this.rules.inventoryType[0].required = false
+                }
+            }
         }
       }
   </script>
@@ -144,4 +195,8 @@
     /deep/#sonList>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-content>.ant-table-scroll>.ant-table-body>.ant-table-fixed>.ant-table-tbody > tr > td {
         padding: 0px 8px !important;
     }
+    // 表单校验隐藏提示文字
+    /deep/.ant-form-explain{
+      display:none
+    }
   </style>