Browse Source

项目档案弹窗

jingbb 1 year ago
parent
commit
51564db8ae

+ 202 - 0
src/views/production/Popup/projectPopup.vue

@@ -0,0 +1,202 @@
+<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='sonList'
+            :columns="columns"
+            rowKey="rowIndex"
+            :dataSource="dataSource"
+            :pagination="pagination"
+            :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: 'projectPopup',
+        mixins: [JEditableTableModelMixin],
+        components: {
+        },
+        data() {
+          return {
+            visible:false,
+            selectedRowKeys:[],
+            selectedRows:[],
+            dataSource:[],
+            pagination:{
+                current: 1,
+                pageSize: 5,
+                pageSizeOptions: ['5', '10', '20'],
+                showTotal: (total, range) => {
+                    return range[0] + "-" + range[1] + " 共" + total + "条"
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0
+            },
+            queryParam:{
+                pageNo:1
+            },
+            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: 'Code',
+                    ellipsis: true,
+                },
+                {
+                    title: 'ID',
+                    align:"center",
+                    dataIndex: 'ID',
+                    ellipsis: true,
+                },
+            ]
+          }
+        },
+        created() {
+          
+        },
+        methods: {
+            handleCancel(){
+                this.visible=false
+                this.dataSource = [] 
+            },
+            handleOk(){
+                if(this.selectedRowKeys.length!==1){
+                    this.$message.warning('请选择一条数据!')
+                }else{
+                    this.$emit('okData',this.selectedRows[0])
+                    this.handleCancel()
+                }
+            },
+            getData(){
+                getAction('/production/safetyStock/selectProject',this.queryParam).then(res=>{
+                        if(res.success){
+                            debugger
+                          this.dataSource = res.result.records
+                          this.pagination = {
+                            total: res.result.total,
+                            current: res.result.current,
+                            pageSize: res.result.size
+                          }
+                        }else{
+                          this.$message.error(res.message);
+                          
+                        }
+                })
+            },
+            handleTableChange(pagination, filters, sorter) {
+                this.queryParam.pageNo = pagination.current
+                this.queryParam.pageSize = pagination.pageSize
+                this.getData()
+            },
+            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/#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-table-fixed-header .ant-table-scroll .ant-table-header{
+        width: calc(100% + 9px);//减去滚动条的宽度
+    }
+  </style>

+ 13 - 2
src/views/production/materialprocurement/materialProcurementList.vue

@@ -51,7 +51,7 @@
               </a-col>
               <a-col :md="4" :sm="24">
                 <a-form-item label="项目">
-                  <a-input-search placeholder="请输入" v-model="queryParam.project" @search="onSearch"></a-input-search>
+                  <a-input-search placeholder="请输入" v-model="queryParam.project" @search="onSearchProject"></a-input-search>
                 </a-form-item>
               </a-col>
               <a-col :md="4" :sm="24">
@@ -138,6 +138,7 @@
     </a-card>
     <materialProcurementAdd ref="materialProcurementAdd" @ok='getTableList'></materialProcurementAdd>
     <materialProcurementDetail ref="materialProcurementDetail" ></materialProcurementDetail>
+    <projectPopup ref="projectPopup" @okData="okData"></projectPopup>
 </div>
 </template>
   
@@ -150,6 +151,7 @@
     import materialProcurementAdd from './modules/materialProcurementAdd'
     import materialProcurementDetail from './modules/materialProcurementDetail'
     import alertModal from '../../../plugins/modal'
+    import projectPopup from '../Popup/projectPopup'
     import { Message } from "element-ui";
     //---------workflow  by fhf end -------------
     export default {
@@ -157,7 +159,8 @@
       mixins: [JeecgListMixin],
       components: {
         materialProcurementAdd,
-        materialProcurementDetail
+        materialProcurementDetail,
+        projectPopup
       },
       data () {
         return {
@@ -576,6 +579,14 @@
          }
         })
       },
+      onSearchProject(){
+        this.$refs.projectPopup.visible = true
+        this.$refs.projectPopup.getData()
+      },
+      okData(data){
+        this.$set(this.queryParam,'projectCode',data.Code)
+        this.$set(this.queryParam,'project',data.Name)
+      },
       //请购单
       synchronizationData(){
         this.$confirm({