jingbb 1 rok pred
rodič
commit
efd65b0c3c

+ 420 - 0
src/views/production/materialprocurement/materialProcurementList.vue

@@ -0,0 +1,420 @@
+<template>
+<div>
+    <a-card :bordered="false" class="top" style="margin-bottom:1%">
+  
+      <!-- 查询区域 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="searchQuery">
+          <a-row :gutter="24">
+            <a-col :md="4" :sm="24">
+              <a-form-item label="计划组织">
+                <a-input-search placeholder="请输入" v-model="queryParam.planOrg" @search="onSearch"></a-input-search>
+              </a-form-item>
+            </a-col>
+            <a-col  :md="4" :sm="24">
+              <a-form-item label="单据号">
+                <a-input placeholder="请输入" v-model="queryParam.orderCode"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+                <a-form-item label="单据日期">
+                <a-range-picker v-model="orderDate"  style="width: 100%;" @change="changeStartDate" />
+                  <!-- <a-date-picker showTime valueFormat="YYYY-MM-DD" format = "YYYY-MM-DD" v-model="queryParam.transferDate" style="width: 100%"/>            -->
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="单据状态">
+                  <a-select v-model="queryParam.state"  style='width:100%' >
+                    <a-select-option value='1'> 1</a-select-option>
+                   </a-select>
+                </a-form-item>
+              </a-col>
+            <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-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-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="项目编码">
+                  <a-input placeholder="请输入" v-model="queryParam.projectCode"></a-input>
+                </a-form-item>
+              </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-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="备注">
+                  <a-input placeholder="请输入" v-model="queryParam.remarks"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="加工单号">
+                  <a-input placeholder="请输入" v-model="queryParam.workNo"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="改单版本">
+                  <a-input placeholder="请输入" v-model="queryParam.version"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="来源">
+                  <a-input placeholder="请输入" v-model="queryParam.sourceInfo"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="业务类型">
+                  <a-select v-model="queryParam.type"  style='width:100%' >
+                    <a-select-option value='1'> 1</a-select-option>
+                   </a-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col  :md="4" :sm="24">
+              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+                <a @click="handleToggleSearch" style="margin-left: 8px">
+                  {{ toggleSearchStatus ? '收起' : '展开' }}
+                  <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                </a>
+              </span>
+            </a-col>
+  
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    
+    <a-card class="middle" style="margin-bottom:1%">
+      <!-- 操作按钮区域 -->
+      <div class="table-operator">
+        <a-button type="danger" size="small" @click='addList'>新增</a-button>
+        <a-button  size="small" @click='addEdit'>修改</a-button>
+        <a-button size="small" @click="delecteList">删除</a-button>
+        <a-button size="small">提交</a-button>
+        <a-button  size="small">审核</a-button>
+        <a-button  size="small">弃审</a-button>
+        <a-button   size="small">流程</a-button>
+        <a-button type="danger" size="small">输出</a-button>
+        <a-button type="danger" size="small">打印</a-button>
+      </div>
+  
+      <!-- table区域-begin -->
+      <div>  
+        <a-table
+          ref="table"
+          size="middle"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="dataSource"
+          :pagination="ipagination"
+          :scroll="{ x: 1500, y: 300 }"
+          :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+          @change="handleTableChange"
+          >
+  
+        </a-table>
+      </div>
+      <!-- table区域-end -->
+  
+    </a-card>
+    <materialProcurementAdd ref="materialProcurementAdd" @ok='getTableList'></materialProcurementAdd>
+</div>
+</template>
+  
+  <script>
+  
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+    import moment from 'dayjs'
+    import { httpAction ,getAction,postAction,putAction,deleteAction,downFile} from '@/api/manage'
+    import {queryDepartTreeList} from '@/api/api'
+    import materialProcurementAdd from './modules/materialProcurementAdd'
+    //---------workflow  by fhf end -------------
+    export default {
+      name: "AssetAllocationList",
+      mixins: [JeecgListMixin],
+      components: {
+        materialProcurementAdd,
+      },
+      data () {
+        return {
+          description: '资产调拨主表管理页面',
+          queryParam:{},
+          selectedRowKeys:[],
+          selectedRows:[],
+          documentData:[],
+          orderDate:[],
+          toggleSearchStatus:false,
+          dataSource:[ ],
+          ipagination:{
+            current: 1,
+            pageSize: 10,
+            pageSizeOptions: ['10', '20', '30'],
+            showTotal: (total, range) => {
+                return range[0] + '-' + range[1] + ' 共' + total + '条'
+            },
+            showQuickJumper: true,
+            showSizeChanger: true,
+            total: 0
+          },
+          // 表头
+          columns: [
+            {
+              title: '#',
+              dataIndex: '',
+              key: 'rowIndex',
+              width: 60,
+              align: "center",
+              customRender:function (t, r, index) {
+                return parseInt(index)+1;
+              }
+            },
+            {
+              title: '计划组织',
+              align:"center",
+              dataIndex: 'planOrg',
+              ellipsis: true,
+
+            },
+            {
+              title: '单据号',
+              align:"center",
+              dataIndex: 'orderCode',
+              ellipsis: true,
+
+            },
+            {
+              title: '单据日期',
+              align:"center",
+              dataIndex: 'orderDate',
+              ellipsis: true,
+
+            },
+            {
+              title: '单据状态',
+              align:"center",
+              dataIndex: 'state',
+              ellipsis: true,
+
+            },
+            {
+              title: '业务员',
+              align:"center",
+              dataIndex: 'salesperson',
+              ellipsis: true,
+
+            },
+            {
+              title: '计划部门',
+              align:"center",
+              dataIndex: 'planDept',
+              ellipsis: true,
+
+            },
+            {
+              title: '项目编码',
+              align:"center",
+              dataIndex: 'projectCode',
+              ellipsis: true,
+
+            },
+            {
+              title: '备注',
+              align:"center",
+              dataIndex: 'remarks',
+              ellipsis: true,
+
+            },
+            {
+              title: '加工单号',
+              align:"center",
+              dataIndex: 'workNo',
+              ellipsis: true,
+
+            },
+            {
+              title: '改单版本',
+              align:"center",
+              dataIndex: 'version',
+              ellipsis: true,
+
+            },
+            {
+              title: '来源',
+              align:"center",
+              dataIndex: 'sourceInfo',
+              ellipsis: true,
+
+            },
+            {
+              title: '业务类型',
+              align:"center",
+              dataIndex: 'type',
+              ellipsis: true,
+
+            },
+            {
+              title: '制单人',
+              align:"center",
+              dataIndex: 'createBy',
+              ellipsis: true,
+
+            },
+            {
+              title: '审批人',
+              align:"center",
+              dataIndex: 'reviewer',
+              ellipsis: true,
+            },
+          ],
+             // ---------workflow  by fhf start -------------
+          serviceName: 'assetAllocationService',
+          // ---------workflow  by fhf end -------------
+          }
+        },
+        computed: {
+        },
+  
+      created () {
+        this.getTableList()
+       },
+      methods: {
+        getTableList(){
+          getAction('/materialRequisition/madeMaterialRequisition/list',this.queryParam).then(res=>{
+                    if(res.success){
+                       this.dataSource =res.result.records
+                       this.ipagination = {
+                            total: res.result.total,
+                            current: res.result.current,
+                            pageSize: res.result.size
+                        }
+                    }else{
+                      this.$message.error(res.message);
+                    }
+                })
+        },
+        searchQuery(){
+          this.queryParam.pageNo=1
+          this.getTableList()
+        },
+        //单据日期
+        changeStartDate(data){
+          this.orderDate = data
+          this.queryParam.orderDate_begin = data.length==2?moment(data[0]).format('YYYY-MM-DD'):''
+          this.queryParam.orderDate_end = data.length==2?moment(data[1]).format('YYYY-MM-DD'):''
+        },
+        onSearch(){
+        },
+        searchReset(){
+            this.queryParam={}
+            this.orderDate = []
+            this.getTableList()
+        },
+        addList(){
+            this.$refs.materialProcurementAdd.visible=true
+            this.$refs.materialProcurementAdd.defaultMethod='add'
+        },
+        addEdit(){
+          if(this.selectedRowKeys.length==0){
+            this.$message.warning('请选择数据!')
+          }else if(this.selectedRowKeys.length>1){
+            this.$message.warning('请选择一条数据!')
+          }else{
+            this.$refs.materialProcurementAdd.visible=true
+            this.$refs.materialProcurementAdd.defaultMethod='edit'
+            this.$refs.materialProcurementAdd.visible=true
+            //获取主表信息
+            this.$refs.materialProcurementAdd.getMainData(this.selectedRowKeys[0])
+          }
+        },
+        delecteList(){
+          if(this.selectedRowKeys.length==0){
+            this.$manage.warning('请选择数据')
+          }else if(this.selectedRowKeys.length==1){
+            deleteAction('/materialRequisition/madeMaterialRequisition/delete', {id: this.selectedRowKeys[0]}).then((res) => {
+                  if (res.success) {
+                    this.$message.success('删除成功!');
+                    this.getTableList()
+                  } else {
+                      this.$message.error(res.message);
+                  }
+                });
+          }else{
+            var ids =  this.selectedRowKeys.toString()
+            deleteAction('/materialRequisition/madeMaterialRequisition/deleteBatch', {ids: ids}).then((res) => {
+                  if (res.success) {
+                    this.$message.success('删除成功!');
+                    this.getTableList()
+                  } else {
+                      that.$message.error(res.message);
+                  }
+                });
+          }
+        },
+        onSelectChange(selectedRowKeys, selectionRows) {
+          this.selectedRowKeys = selectedRowKeys;
+          this.selectedRows = selectionRows;
+        },
+        handleTableChange(pagination, filters, sorter) {
+            this.queryParam.pageNo = pagination.current
+            this.queryParam.pageSize = pagination.pageSize
+            this.getTableList()
+        },
+    }
+}
+  </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/.top>.ant-card-body{
+        padding-bottom:0px;
+        padding-top: 12px;
+    }
+    /deep/.ant-btn{
+        height:28px
+    }
+    /deep/.ant-table-thead > tr > th{
+        padding: 6px 8px !important;
+    }
+    /deep/ .ant-table-tbody > tr > td{
+        padding: 6px 8px !important;
+    }
+    /deep/ .ant-table{
+        font-size:12px
+    }
+    /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
+        width: calc(100% + 9px);//减去滚动条的宽度
+    }
+    /deep/.middle>.ant-card-body{
+        padding-bottom:2px;
+        padding-top:14px;
+    }
+    /deep/.ant-select-sm .ant-select-selection__rendered{
+        line-height: 27px;
+    }
+  </style>

+ 769 - 0
src/views/production/materialprocurement/modules/materialProcurementAdd.vue

@@ -0,0 +1,769 @@
+<template>
+    <a-modal
+      :title="defaultMethod=='add'?'新增':'编辑'"
+       width="80%"
+      :visible="visible"
+      :maskClosable="false"
+      switchFullscreen
+      @cancel="handleCancel"
+      @ok='handleOk'
+      >
+      <a-card :bordered="false" class="top" style="margin-bottom:1%;margin-top:1%" :loading = 'loading'>
+        <div class="table-operator">
+        <a-button type="danger" size="small"  @click="addList">增行</a-button>
+        <a-button size="small" @click="delectRow">删行</a-button>
+      </div>
+      </a-card >
+      <a-card :bordered="false" class="moddle" style="margin-bottom:1%" :loading = 'loading'>
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="计划组织">
+                            <a-input-search placeholder="请输入" v-model="form.planOrg" @search="onSearch"></a-input-search>
+                        </a-form-item>
+                    </a-col>
+                    <a-col  :md="4" :sm="24">
+                        <a-form-item label="单据号">
+                            <a-input placeholder="请输入" v-model="form.orderCode"></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="单据日期">
+                            <a-date-picker showTime valueFormat="YYYY-MM-DD" format = "YYYY-MM-DD" v-model="form.orderDate"/>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="单据状态">
+                            <a-select v-model="form.state"  style='width:100%' >
+                                <a-select-option value='1'> 1</a-select-option>
+                            </a-select>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="业务员">
+                            <a-input-search placeholder="请输入" v-model="form.salesperson"  @search="onSearch"></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"></a-input-search>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="项目编码">
+                            <a-input placeholder="请输入" v-model="form.projectCode"></a-input>
+                        </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"></a-input-search>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="备注">
+                            <a-input placeholder="请输入" v-model="form.remarks"></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="加工单号">
+                            <a-input placeholder="请输入" v-model="form.workNo"></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="改单版本">
+                            <a-input placeholder="请输入" v-model="form.version"></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="来源">
+                            <a-input placeholder="请输入" v-model="form.sourceInfo"></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="业务类型">
+                            <a-select v-model="form.type"  style='width:100%' >
+                                <a-select-option value='1'> 1</a-select-option>
+                            </a-select>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </div>
+     </a-card>
+     <a-card :bordered="false" class="three" style="margin-bottom:1%" :loading = 'loading'>
+       <a-form-model ref="formRef">
+        <a-table
+          ref="table"
+          size="middle"
+          bordered
+          id='sonList'
+          :columns="columns"
+           rowKey="rowNo"
+          :dataSource="dataSource"
+          :pagination="false"
+          :scroll="{ x: 4500, y: 300 }"
+          :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+          @change="handleTableChange"
+          >
+            <template slot="batch" slot-scope="text, record, index">
+                <a-form-model-item prop="batch" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.batch"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="projectCode" slot-scope="text, record, index">
+                <a-form-model-item prop="projectCode" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.projectCode"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="projectName" slot-scope="text, record, index">
+                <a-form-model-item prop="projectName" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.projectName"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="inventoryName" slot-scope="text, record, index">
+                <a-form-model-item prop="inventoryName" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.inventoryName"></a-input>
+                </a-form-model-item>
+            </template> 
+            <template slot="inventoryCode" slot-scope="text, record, index">
+                <a-form-model-item prop="inventoryCode" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.inventoryCode"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="unit" slot-scope="text, record, index">
+                <a-form-model-item prop="unit" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.unit"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="quantity" slot-scope="text, record, index">
+                <a-form-model-item prop="quantity" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.quantity"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="rate" slot-scope="text, record, index">
+                <a-form-model-item prop="rate" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.rate"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="auxiliaryUnit" slot-scope="text, record, index">
+                <a-form-model-item prop="auxiliaryUnit" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.auxiliaryUnit"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="unQuantity" slot-scope="text, record, index">
+                <a-form-model-item prop="unQuantity" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.unQuantity"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="specs" slot-scope="text, record, index">
+                <a-form-model-item prop="specs" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.specs"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="model" slot-scope="text, record, index">
+                <a-form-model-item prop="model" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.model"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="color" slot-scope="text, record, index">
+                <a-form-model-item prop="color" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.color"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="fixedLength" slot-scope="text, record, index">
+                <a-form-model-item prop="fixedLength" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.fixedLength"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="alloy" slot-scope="text, record, index">
+                <a-form-model-item prop="alloy" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.alloy"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="standard" slot-scope="text, record, index">
+                <a-form-model-item prop="standard" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.standard"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="windowNo" slot-scope="text, record, index">
+                <a-form-model-item prop="windowNo" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.stanwindowNodard"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="meterWeight" slot-scope="text, record, index">
+                <a-form-model-item prop="meterWeight" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.meterWeight"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="decorationLength" slot-scope="text, record, index">
+                <a-form-model-item prop="decorationLength" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.decorationLength"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="exclusiveZone" slot-scope="text, record, index">
+                <a-form-model-item prop="exclusiveZone" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.exclusiveZone"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="configuration" slot-scope="text, record, index">
+                <a-form-model-item prop="configuration" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.configuration"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="widthLength" slot-scope="text, record, index">
+                <a-form-model-item prop="widthLength" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.widthLength"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="height" slot-scope="text, record, index">
+                <a-form-model-item prop="height" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.height"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="buildingNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="buildingNumber" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.buildingNumber"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="framesTang" slot-scope="text, record, index">
+                <a-form-model-item prop="framesTang" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.framesTang"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="framesCount" slot-scope="text, record, index">
+                <a-form-model-item prop="framesCount" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.framesCount"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="leafCount" slot-scope="text, record, index">
+                <a-form-model-item prop="leafCount" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.leafCount"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="semiClass" slot-scope="text, record, index">
+                <a-form-model-item prop="semiClass" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.semiClass"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="area" slot-scope="text, record, index">
+                <a-form-model-item prop="area" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.area"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="cuttingLength" slot-scope="text, record, index">
+                <a-form-model-item prop="cuttingLength" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.cuttingLength"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="cuttingLeftDown" slot-scope="text, record, index">
+                <a-form-model-item prop="cuttingLeftDown" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.cuttingLeftDown"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="cuttingRightTop" slot-scope="text, record, index">
+                <a-form-model-item prop="cuttingRightTop" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.cuttingRightTop"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="remarks" slot-scope="text, record, index">
+                <a-form-model-item prop="remarks" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.remarks"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="series" slot-scope="text, record, index">
+                <a-form-model-item prop="series" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.series"></a-input>
+                </a-form-model-item>
+            </template>
+            <template slot="glassNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="glassNumber" class='sonItem'>
+                    <a-input placeholder="请输入" v-model="record.glassNumber"></a-input>
+                </a-form-model-item>
+            </template>
+        </a-table>
+       </a-form-model">
+    </a-card>
+     <a-card :bordered="false" class="bottom" style="margin-bottom:1%">
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="制单人">
+                            <a-input placeholder="请输入" v-model="form1.createBy" disabled></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col  :md="4" :sm="24">
+                        <a-form-item label="制单日期">
+                            <a-date-picker showTime valueFormat="YYYY-MM-DD" format = "YYYY-MM-DD" v-model="form1.createTime" disabled/>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="审批人">
+                            <a-input placeholder="请输入" v-model="form1.reviewer" disabled></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="审批日期">
+                            <a-date-picker showTime valueFormat="YYYY-MM-DD" format = "YYYY-MM-DD" v-model="form1.reviewerTime" disabled/>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="最后修改人">
+                            <a-input placeholder="请输入" v-model="form1.updateBy" disabled></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="4" :sm="24">
+                        <a-form-item label="最后修改时间">
+                            <a-date-picker showTime valueFormat="YYYY-MM-DD" format = "YYYY-MM-DD" v-model="form1.updateTime" disabled/>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+         </div>
+    </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: 'AssetAllocationDetailForm',
+        mixins: [JEditableTableModelMixin],
+        components: {
+        },
+        data() {
+          return {
+            visible:false,
+            form:{},
+            form1:{},
+            defaultMethod:'add',
+            dataSource:[],
+            loading:false,
+            // ipagination:{},
+            selectedRowKeys:[],
+            selectedRows:[],
+            columns: [
+                {
+                    title: '#',
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    width: 60,
+                    align: "center",
+                    customRender:function (t, r, index) {
+                        return parseInt(index)+1;
+                    }
+                },
+                {
+                    title: '批次',
+                    align:"center",
+                    dataIndex: 'batch',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'batch' } 
+                },
+                {
+                    title: '项目编码',
+                    align:"center",
+                    dataIndex: 'projectCode',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'projectCode' } 
+                },
+                {
+                    title: '项目名称',
+                    align:"center",
+                    dataIndex: 'projectName',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'projectName' } 
+                },
+                {
+                    title: '存货名称',
+                    align:"center",
+                    dataIndex: 'inventoryName',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'inventoryName' } 
+                },
+                {
+                    title: '存货编码',
+                    align:"center",
+                    dataIndex: 'inventoryCode',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'inventoryCode' } 
+
+                },
+                {
+                    title: '计量单位',
+                    align:"center",
+                    dataIndex: 'unit',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'unit' } 
+
+                },
+                {
+                    title: '主数量',
+                    align:"center",
+                    dataIndex: 'quantity',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'quantity' } 
+
+                },
+                {
+                    title: '换算率',
+                    align:"center",
+                    dataIndex: 'rate',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'rate' } 
+
+                },
+                {
+                    title: '辅计量单位',
+                    align:"center",
+                    dataIndex: 'auxiliaryUnit',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'auxiliaryUnit' } 
+                },
+                {
+                    title: '辅数量',
+                    align:"center",
+                    dataIndex: 'unQuantity',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'unQuantity' } 
+                },
+                {
+                    title: '规格',
+                    align:"center",
+                    dataIndex: 'specs',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'specs' } 
+                },
+                {
+                    title: '型号',
+                    align:"center",
+                    dataIndex: 'model',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'model' } 
+                },
+                {
+                    title: '颜色',
+                    align:"center",
+                    dataIndex: 'color',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'color' } 
+                },
+                {
+                    title: '定尺',
+                    align:"center",
+                    dataIndex: 'fixedLength',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'fixedLength' } 
+                },
+                {
+                    title: '合金',
+                    align:"center",
+                    dataIndex: 'alloy',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'alloy' } 
+                },
+                {
+                    title: '标准',
+                    align:"center",
+                    dataIndex: 'standard',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'standard' } 
+                },
+                {
+                    title: '窗号',
+                    align:"center",
+                    dataIndex: 'windowNo',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'windowNo' } 
+
+                },
+                {   
+                    title: '米重',
+                    align:"center",
+                    dataIndex: 'meterWeight',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'meterWeight' } 
+                },
+                {
+                    title: '装饰面周长',
+                    align:"center",
+                    dataIndex: 'decorationLength',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'decorationLength' } 
+                },
+                {   
+                    title: '专用区',
+                    align:"center",
+                    dataIndex: 'exclusiveZone',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'exclusiveZone' } 
+                },
+                {
+                    title: '配置',
+                    align:"center",
+                    dataIndex: 'configuration',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'configuration' } 
+                },
+                {
+                    title: '宽度/长度',
+                    align:"center",
+                    dataIndex: 'widthLength',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'widthLength' } 
+                },
+                {
+                    title: '高度',
+                    align:"center",
+                    dataIndex: 'height',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'height' } 
+                },
+                {
+                    title: '楼号楼层',
+                    align:"center",
+                    dataIndex: 'buildingNumber',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'buildingNumber' } 
+                },
+                {
+                    title: '樘数',
+                    align:"center",
+                    dataIndex: 'framesTang',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'framesTang' } 
+                },
+                {
+                    title: '框统计',
+                    align:"center",
+                    dataIndex: 'framesCount',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'framesCount' } 
+                },
+                {
+                    title: '扇统计',
+                    align:"center",
+                    dataIndex: 'leafCount',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'leafCount' } 
+                 },
+                {
+                    title: '半成品分类',
+                    align:"center",
+                    dataIndex: 'semiClass',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'semiClass' } 
+                },
+                {
+                    title: '面积',
+                    align:"center",
+                    dataIndex: 'area',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'area' } 
+                },
+                {
+                    title: '切割长度',
+                    align:"center",
+                    dataIndex: 'cuttingLength',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'cuttingLength' } 
+                },
+                {
+                    title: '切割角度左下',
+                    align:"center",
+                    dataIndex: 'cuttingLeftDown',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'cuttingLeftDown' } 
+                },
+                {
+                    title: '切割角度右上',
+                    align:"center",
+                    dataIndex: 'cuttingRightTop',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'cuttingRightTop' } 
+                },
+                {
+                    title: '备注',
+                    align:"center",
+                    dataIndex: 'remarks',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'remarks' } 
+                },
+                {
+                    title: '系列',
+                    align:"center",
+                    dataIndex: 'series',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'series' } 
+                },
+                {
+                    title: '玻璃编号',
+                    align:"center",
+                    dataIndex: 'glassNumber',
+                    ellipsis: true,
+                    scopedSlots: { customRender: 'glassNumber' } 
+                },
+          ],
+          }
+        },
+        created() {
+          
+        },
+        methods: {
+            handleCancel(){
+                this.visible=false
+                this.defaultMethod='add'
+                this.dataSource = [] 
+                this.form={}
+                this.form1={}
+            },
+            handleOk(){
+                var mergedObj = this.form
+                mergedObj.madeMaterialRequisitionDetailList = this.dataSource
+                debugger
+                this.loading = true
+                if(this.defaultMethod=='add'){
+                    postAction('/materialRequisition/madeMaterialRequisition/add', mergedObj).then((res) => {
+                        if (res.success) {
+                            this.$message.success('添加成功!');
+                            this.handleCancel()
+                            this.$emit('ok')
+                        } else {
+                            this.$message.error(res.message);
+                        }
+                    }).finally(() => {
+                            this.loading = false
+                    })
+                }else{
+                    postAction('/materialRequisition/madeMaterialRequisition/edit', mergedObj).then((res) => {
+                        if (res.success) {
+                            this.$message.success('编辑成功!');
+                            this.handleCancel()
+                            this.$emit('ok')
+                        } else {
+                            this.$message.error(res.message);
+                        }
+                    }).finally(() => {
+                            this.loading = false
+                    })
+                }
+            },
+            onSelectChange(selectedRowKeys, selectionRows) {
+                this.selectedRowKeys = selectedRowKeys;
+                this.selectedRows = selectionRows;
+            },
+            handleTableChange(){
+
+            },
+            onSearch(){
+               
+            },
+            //获取主表信息
+            getMainData(id){
+                getAction('/materialRequisition/madeMaterialRequisition/queryById',{id:id}).then(res=>{
+                    if(res.success){
+                       this.form=res.result
+                       this.form1=res.result
+                       this.getSonData(this.form.id)
+                    }else{
+                      this.$message.error(res.message);
+                    }
+                })
+            },
+            //获取子表信息
+            getSonData(id){
+                getAction('/materialRequisition/madeMaterialRequisition/querymadeMaterialRequisitionDetailByMainId',{id:id}).then(res=>{
+                    if(res.success){
+                       this.dataSource =res.result
+                       this.dataSource.map((item,index)=>{
+                        item.rowNo =index+1
+                       })
+                       
+                    }else{
+                      this.$message.error(res.message);
+                    }
+                })
+            },
+            addList(){
+                this.dataSource.unshift({rowNo: this.dataSource.length+1})
+                console.log(this.dataSource);
+                debugger
+            },
+            delectRow(){
+                if( this.selectedRowKeys.length==0){
+                    this.$message.warning('请勾选子表数据!')
+                }else{
+                    this.selectedRowKeys.map(event=>{
+                        this.dataSource =  this.dataSource.filter( (x)=> {return x.rowNo !== event});
+                    })
+                }
+            },
+
+        }
+      }
+  </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:0px;
+        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;
+    }
+  </style>

+ 231 - 0
src/views/production/safetyStock/modules/safetyStockListAdd.vue

@@ -0,0 +1,231 @@
+<template>
+    <a-modal
+      :title="(defaultMethod == 'add')?'新增':'编辑'"
+       width="60%"
+      :visible="visible"
+      :maskClosable="false"
+      switchFullscreen
+      @cancel="handleCancel"
+      @ok='handleOK'
+      >
+      <a-card :bordered="false" class="moddle" style="margin-bottom:1%" :loading = 'loading'>
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+              <a-row :gutter="24">
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="存货编码" prop='inventoryCode'>
+                    <a-input-search placeholder="请输入" v-model="form.inventoryCode" @search="onSearch"></a-input-search>
+                  </a-form-item>
+                </a-col>
+                <a-col  :md="8" :sm="24">
+                  <a-form-item label="存货名称" prop='inventoryName'>
+                    <a-input placeholder="请输入" v-model="form.inventoryName"></a-input>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                    <a-form-item label="颜色" prop='color'>
+                        <a-input-search placeholder="请输入" v-model="form.color" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24" >
+                    <a-form-item label="定尺" prop='fixedLength'>
+                        <a-input-search placeholder="请输入" v-model="form.fixedLength" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="合金" prop='alloy'>
+                      <a-input-search placeholder="请输入" v-model="form.alloy" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="标准" prop='standard'>
+                    <a-input-search placeholder="请输入" v-model="form.standard" @search="onSearch"></a-input-search>
+                  </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="规格" prop='model'>
+                      <a-input placeholder="请输入" v-model="form.specs"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="型号" prop='model'>
+                      <a-input-search placeholder="请输入" v-model="form.model" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="安全库存" prop='safetyStock'>
+                      <a-input-number  :default-value="0"  v-model="form.safetyStock"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="最高库存" prop='maxStock'>
+                      <a-input-number  :default-value="0"  v-model="form.maxStock"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="起订点" prop='startingPoint'>
+                      <a-input-number  :default-value="0"  v-model="form.startingPoint"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="辅单位" prop='auxiliaryUnit'>
+                      <a-input placeholder="请输入" v-model="form.auxiliaryUnit"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="单位" prop='unit'>
+                        <a-input placeholder="请输入" v-model="form.unit"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="按辅计量计算" prop='isAuxiliaryUnit'>
+                      <a-select v-model="form.isAuxiliaryUnit"  style='width:100%' >
+                                <a-select-option value='是'> 是</a-select-option>
+                                <a-select-option value='否'> 否</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>  
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="米重" prop='meterWeight'>
+                        <a-input placeholder="请输入" v-model="form.meterWeight"></a-input>
+                    </a-form-item>
+                  </a-col> 
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="窗号" prop='windowNo'>
+                        <a-input placeholder="请输入" v-model="form.windowNo"></a-input>
+                    </a-form-item>
+                  </a-col>  
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="装饰面周长" prop='decorationLength'>
+                        <a-input placeholder="请输入" v-model="form.decorationLength"></a-input>
+                    </a-form-item>
+                  </a-col> 
+                  <a-col :md="8" :sm="24">
+                    <a-form-item label="专用区" prop='exclusiveZone'>
+                        <a-input placeholder="请输入" v-model="form.exclusiveZone"></a-input>
+                    </a-form-item>
+                  </a-col>    
+              </a-row>
+            </a-form>
+        </div>
+     </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: 'safetyStockListAdd',
+        mixins: [JEditableTableModelMixin],
+        components: {
+        },
+        data() {
+          return {
+            visible:false,
+            form:{},
+            loading:false,
+            defaultMethod:'add',
+          }
+        },
+        created() {
+          
+        },
+        methods: {
+            handleCancel(){
+                this.form = {}
+                this.visible=false
+                this.defaultMethod='add'
+            },
+            handleOK(){
+              this.loading = true
+              if(this.defaultMethod=='add'){
+                postAction('/production/safetyStock/add', this.form).then((res) => {
+                  if (res.success) {
+                    this.$message.success('添加成功!');
+                    this.handleCancel()
+                    this.$emit('ok')
+                  } else {
+                    this.$message.error(res.message);
+                  }
+                }).finally(() => {
+                  this.loading = false
+                })
+              }else{
+                putAction('/production/safetyStock/edit', this.form).then((res) => {
+                  if (res.success) {
+                    this.$message.success('编辑成功!');
+                    this.handleCancel()
+                    this.$emit('ok')
+                  } else {
+                    this.$message.error(res.message);
+                  }
+                }).finally(() => {
+                  this.loading = false
+                })
+              }
+              
+            },
+            getEditData(id){
+              getAction('/production/safetyStock/queryById',{id:id}).then((res) => {
+                  if (res.success) {
+                   this.form = res.result
+                  } else {
+                    this.$message.error(res.message);
+                  }
+                })
+            },
+            onSelectChange(selectedRowKeys, selectionRows) {
+                this.selectedRowKeys = selectedRowKeys;
+            },
+            onSearch(){
+            },
+
+        }
+      }
+  </script>
+  
+  <style scoped lang="less">
+    /* @import '~@assets/less/common.less' */
+    /deep/.ant-input{
+        height:29px;
+    }
+    /deep/.ant-input-number{
+      height:29px;
+      width:100%
+    }
+    /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/.ant-btn{
+        height:28px
+    }
+    /deep/.ant-modal-body{
+        padding-bottom: 0px;
+        // padding-top: 0px;
+    }
+    /deep/.ant-modal-content{
+        background: #f0f2f5;
+    }
+    /deep/.ant-card-body .table-operator {
+        margin-bottom: 0px;
+    }
+    /deep/.ant-calendar-picker{
+        min-width: 0px !important;  
+    }
+  </style>

+ 494 - 0
src/views/production/safetyStock/safetyStockList.vue

@@ -0,0 +1,494 @@
+<template>
+    <div>
+        <a-card :bordered="false" class="top" style="margin-bottom:1%;margin-top:1%">
+      
+          <!-- 查询区域 -->
+          <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+              <a-row :gutter="24">
+                <a-col :md="4" :sm="24">
+                  <a-form-item label="存货编码">
+                    <a-input-search placeholder="请输入" v-model="queryParam.inventoryCode" @search="onSearch"></a-input-search>
+                  </a-form-item>
+                </a-col>
+                <a-col  :md="4" :sm="24">
+                  <a-form-item label="存货名称">
+                    <a-input placeholder="请输入" v-model="queryParam.inventoryName"></a-input>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="4" :sm="24">
+                    <a-form-item label="颜色">
+                        <a-input-search placeholder="请输入" v-model="queryParam.color" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="定尺">
+                        <a-input-search placeholder="请输入" v-model="queryParam.fixedLength" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                <template v-if="toggleSearchStatus">
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="合金">
+                      <a-input-search placeholder="请输入" v-model="queryParam.alloy" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="标准">
+                    <a-input-search placeholder="请输入" v-model="queryParam.standard" @search="onSearch"></a-input-search>
+                  </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="规格">
+                      <a-input placeholder="请输入" v-model="queryParam.specs"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="型号">
+                      <a-input-search placeholder="请输入" v-model="queryParam.model" @search="onSearch"></a-input-search>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="安全库存">
+                      <a-input placeholder="请输入" v-model="queryParam.safetyStock"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="最高库存">
+                      <a-input placeholder="请输入" v-model="queryParam.maxStock"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="起订点">
+                      <a-input placeholder="请输入" v-model="queryParam.startingPoint"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="辅单位">
+                      <a-input placeholder="请输入" v-model="queryParam.auxiliaryUnit"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="单位">
+                        <a-input placeholder="请输入" v-model="queryParam.unit"></a-input>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="按辅计量计算" prop='isAuxiliaryUnit'>
+                      <a-select v-model="queryParam.isAuxiliaryUnit"  style='width:100%' >
+                                <a-select-option value='是'> 是</a-select-option>
+                                <a-select-option value='否'> 否</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>  
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="米重" prop='meterWeight'>
+                        <a-input placeholder="请输入" v-model="queryParam.meterWeight"></a-input>
+                    </a-form-item>
+                  </a-col> 
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="窗号" prop='windowNo'>
+                        <a-input placeholder="请输入" v-model="queryParam.windowNo"></a-input>
+                    </a-form-item>
+                  </a-col>  
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="装饰面周长" prop='decorationLength'>
+                        <a-input placeholder="请输入" v-model="queryParam.decorationLength"></a-input>
+                    </a-form-item>
+                  </a-col> 
+                  <a-col :md="4" :sm="24">
+                    <a-form-item label="专用区" prop='exclusiveZone'>
+                        <a-input placeholder="请输入" v-model="queryParam.exclusiveZone"></a-input>
+                    </a-form-item>
+                  </a-col>
+                </template>
+                <a-col  :md="4" :sm="24">
+                  <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                    <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                    <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+                    <a @click="handleToggleSearch" style="margin-left: 8px">
+                      {{ toggleSearchStatus ? '收起' : '展开' }}
+                      <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                    </a>
+                  </span>
+                </a-col>
+      
+              </a-row>
+            </a-form>
+          </div>
+        </a-card>
+        
+        <a-card class="middle" style="margin-bottom:1%">
+          <!-- 操作按钮区域 -->
+          <div class="table-operator">
+            <a-button  type="danger" size="small" @click='addList'>新增</a-button>
+            <a-button  size="small" @click='editList'>修改</a-button>
+            <a-button size="small" @click='delectList'>删除</a-button>
+            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl">
+               <a-button  size="small">导入</a-button>
+            </a-upload>
+            <a-button size="small" @click="exportList('安全库存列表')">导出</a-button>
+          </div>
+      
+          <!-- table区域-begin -->
+          <div>  
+            <a-table
+              ref="table"
+              size="middle"
+              bordered
+              rowKey="id"
+              :columns="columns"
+              :dataSource="dataSource"
+              :pagination="ipagination"
+              :scroll="{ x: 2500, y: 300 }"
+              :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+              @change="handleTableChange"
+              >
+      
+            </a-table>
+          </div>
+          <!-- table区域-end -->
+      
+        </a-card>
+        <safetyStockListAdd ref="safetyStockListAdd" @ok='getTableList'></safetyStockListAdd>
+    </div>
+    </template>
+      
+      <script>
+      
+        import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+        import moment from 'dayjs'
+        import { httpAction ,getAction,postAction,putAction,deleteAction,downFile} from '@/api/manage'
+        import {queryDepartTreeList} from '@/api/api'
+        import safetyStockListAdd from './modules/safetyStockListAdd'
+        //---------workflow  by fhf end -------------
+        export default {
+          name: "SafetyStockList",
+          mixins: [JeecgListMixin],
+          components: {
+            safetyStockListAdd
+          },
+          data () {
+            return {
+              description: '安全库存列表页面',
+              queryParam:{},
+              selectedRowKeys:[],
+              selectedRow:[],
+              documentData:[],
+              toggleSearchStatus:false,
+              dataSource:[{}],
+              ipagination:{
+                current: 1,
+                pageSize: 10,
+                pageSizeOptions: ['10', '20', '30'],
+                showTotal: (total, range) => {
+                    return range[0] + '-' + range[1] + ' 共' + total + '条'
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0
+              },
+              // 表头
+              columns: [
+                {
+                  title: '#',
+                  dataIndex: '',
+                  key: 'rowIndex',
+                  width: 60,
+                  align: "center",
+                  customRender:function (t, r, index) {
+                    return parseInt(index)+1;
+                  }
+                },
+                {
+                  title: '存货编码',
+                  align:"center",
+                  dataIndex: 'inventoryCode',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '存货名称',
+                  align:"center",
+                  dataIndex: 'inventoryName',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '颜色',
+                  align:"center",
+                  dataIndex: 'color',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '定尺',
+                  align:"center",
+                  dataIndex: 'fixedLength',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '合金',
+                  align:"center",
+                  dataIndex: 'alloy',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '标准',
+                  align:"center",
+                  dataIndex: 'standard',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '规格',
+                  align:"center",
+                  dataIndex: 'specs',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '型号',
+                  align:"center",
+                  dataIndex: 'model',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '安全库存',
+                  align:"center",
+                  dataIndex: 'safetyStock',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '最高库存',
+                  align:"center",
+                  dataIndex: 'maxStock',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '起订点',
+                  align:"center",
+                  dataIndex: 'startingPoint',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '辅单位',
+                  align:"center",
+                  dataIndex: 'auxiliaryUnit',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '单位',
+                  align:"center",
+                  dataIndex: 'unit',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '按辅计量计算',
+                  align:"center",
+                  dataIndex: 'isAuxiliaryUnit',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '米重',
+                  align:"center",
+                  dataIndex: 'meterWeight',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '窗号',
+                  align:"center",
+                  dataIndex: 'windowNo',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '装饰面周长',
+                  align:"center",
+                  dataIndex: 'decorationLength',
+                  ellipsis: true,
+    
+                },
+                {
+                  title: '专用区',
+                  align:"center",
+                  dataIndex: 'exclusiveZone',
+                  ellipsis: true,
+    
+                },
+              ],
+              url: {
+                    list: "/production/safetyStock/list",
+              },
+              importExcelUrl:'/production/safetyStock/importExcel',
+                 // ---------workflow  by fhf start -------------
+              serviceName: 'assetAllocationService',
+              // ---------workflow  by fhf end -------------
+              }
+            },      
+           created () {
+            this.getTableList()
+           },
+           computed: {
+              importExcelUrl: function(){
+                  return `${window._CONFIG['domianURL']}/${this.importExcelUrl}`;
+              },
+           },
+          methods: {
+            getTableList(){
+                getAction('/production/safetyStock/list',this.queryParam).then(res=>{
+                    if(res.success){
+                       this.dataSource =res.result.records
+                       this.ipagination = {
+                            total: res.result.total,
+                            current: res.result.current,
+                            pageSize: res.result.size
+                        }
+                    }else{
+                      this.$message.error(res.message);
+                    }
+                })
+            },
+            //单据日期
+            changeStartDate(){
+    
+            },
+            onSearch(){
+            //   this.$refs.materialProcurementSearch.visible = true
+            },
+            exportList(fileName){
+              downFile('/production/safetyStock/exportXls', this.queryParam).then(data => {
+                if (!data) {
+                  this.$message.warning('文件下载失败')
+                  return
+                }
+                if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                  window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
+                } else {
+                  let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+                  let link = document.createElement('a')
+                  link.style.display = 'none'
+                  link.href = url
+                  link.setAttribute('download', fileName + '.xlsx')
+                  document.body.appendChild(link)
+                  link.click()
+                  document.body.removeChild(link) // 下载完成移除元素
+                  window.URL.revokeObjectURL(url) // 释放掉blob对象
+                }
+              })
+            },
+            searchReset(){
+                this.queryParam={}
+                this.getTableList()
+            },
+            searchQuery(){
+              this.queryParam.pageNo = '1'
+                this.getTableList()
+            },
+            addList(){
+                this.$refs.safetyStockListAdd.visible=true
+                this.$refs.safetyStockListAdd.defaultMethod='add'
+            },
+            editList(){
+              if(this.selectedRowKeys.length==0){
+                this.$message.warning('请勾选数据!')
+              }else if(this.selectedRowKeys.length>1){
+                this.$message.warning('只可勾选一条数据')
+              }else{
+                this.$refs.safetyStockListAdd.visible=true
+                this.$refs.safetyStockListAdd.defaultMethod='edit'
+                this.$refs.safetyStockListAdd.getEditData(this.selectedRowKeys[0])
+              }
+            },
+            delectList(){
+              if(this.selectedRowKeys.length==0){
+                this.$message.warning('请勾选数据!')
+              }else if(this.selectedRowKeys.length>1){
+                var ids =  this.selectedRowKeys.toString()
+                var that = this
+                deleteAction('/production/safetyStock/deleteBatch', {ids: ids}).then((res) => {
+                  if (res.success) {
+                    this.$message.success('删除成功!');
+                    this.getTableList()
+                  } else {
+                      that.$message.error(res.message);
+                  }
+                });
+              }else{
+                deleteAction('/production/safetyStock/delete', {id: this.selectedRowKeys[0]}).then((res) => {
+                  if (res.success) {
+                    this.$message.success('删除成功!');
+                    this.getTableList()
+                  } else {
+                      that.$message.error(res.message);
+                  }
+                });
+              }
+            },
+            onSelectChange(selectedRowKeys, selectionRows) {
+              this.selectedRowKeys = selectedRowKeys;
+              this.selectedRow = selectionRows;
+            },
+            handleTableChange(pagination, filters, sorter) {
+                // console.log('当前页信息>>>>',pagination)
+                this.queryParam.pageNo = pagination.current
+                this.queryParam.pageSize = pagination.pageSize
+                this.getTableList()
+            },
+        }
+    }
+      </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/.top>.ant-card-body{
+            padding-bottom:0px;
+            padding-top: 12px;
+        }
+        /deep/.ant-btn{
+            height:28px
+        }
+        /deep/.ant-table-thead > tr > th{
+            padding: 6px 8px !important;
+        }
+        /deep/ .ant-table-tbody > tr > td{
+            padding: 6px 8px !important;
+        }
+        /deep/ .ant-table{
+            font-size:12px
+        }
+        /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
+            width: calc(100% + 9px);//减去滚动条的宽度
+        }
+        /deep/.middle>.ant-card-body{
+            padding-bottom:14px;
+            padding-top:14px;
+        }
+        /deep/.ant-select-sm .ant-select-selection__rendered{
+            line-height: 27px;
+        }
+      </style>