From e56be6e04cc6bfd106a354a5419f8a86f31f4003 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期五, 30 五月 2025 17:28:04 +0800 Subject: [PATCH] 备件请购完成 --- src/views/eam/spare/EamSparePartsList.vue | 10 src/views/eam/spare/EamSparePartReceiveList.vue | 348 ++++++++++++++++-------- src/views/eam/spare/EamSparePartRequisitionList.vue | 268 +++++++++++++------ src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue | 151 ++++++++-- src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue | 7 5 files changed, 545 insertions(+), 239 deletions(-) diff --git a/src/views/eam/spare/EamSparePartReceiveList.vue b/src/views/eam/spare/EamSparePartReceiveList.vue index 07129f4..41f09c4 100644 --- a/src/views/eam/spare/EamSparePartReceiveList.vue +++ b/src/views/eam/spare/EamSparePartReceiveList.vue @@ -3,43 +3,106 @@ <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> - <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > <a-row :gutter="24"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > <a-form-item label="鍒犻櫎鏍囪"> - <a-input placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" v-model="queryParam.delFlag"></a-input> + <a-input + placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" + v-model="queryParam.delFlag" + ></a-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > <a-form-item label="棰嗙敤鍗曠紪鐮�"> - <a-input placeholder="璇疯緭鍏ラ鐢ㄥ崟缂栫爜" v-model="queryParam.receiveCode"></a-input> + <a-input + placeholder="璇疯緭鍏ラ鐢ㄥ崟缂栫爜" + v-model="queryParam.receiveCode" + ></a-input> </a-form-item> </a-col> - <template v-if="toggleSearchStatus"> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="棰嗙敤浜�"> - <a-input placeholder="璇疯緭鍏ラ鐢ㄤ汉" v-model="queryParam.receiveUser"></a-input> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="棰嗙敤浜嬬敱"> - <a-input placeholder="璇疯緭鍏ラ鐢ㄤ簨鐢�" v-model="queryParam.receiveReason"></a-input> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="棰嗙敤鐘舵��"> - <a-input placeholder="璇疯緭鍏ラ鐢ㄧ姸鎬�" v-model="queryParam.receiveStatus"></a-input> - </a-form-item> - </a-col> + <template v-if="toggleSearchStatus"> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="棰嗙敤浜�"> + <a-input + placeholder="璇疯緭鍏ラ鐢ㄤ汉" + v-model="queryParam.receiveUser" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="棰嗙敤浜嬬敱"> + <a-input + placeholder="璇疯緭鍏ラ鐢ㄤ簨鐢�" + v-model="queryParam.receiveReason" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="棰嗙敤鐘舵��"> + <a-input + placeholder="璇疯緭鍏ラ鐢ㄧ姸鎬�" + v-model="queryParam.receiveStatus" + ></a-input> + </a-form-item> + </a-col> </template> - <a-col :xl="6" :lg="7" :md="8" :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"> + <a-col + :xl="6" + :lg="7" + :md="8" + :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-icon :type="toggleSearchStatus ? 'up' : 'down'" /> </a> </span> </a-col> @@ -50,14 +113,35 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - <a-button type="primary" icon="download" @click="handleExportXls('澶囧搧澶囦欢棰嗙敤鍗�')">瀵煎嚭</a-button> - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> - <a-button type="primary" icon="import">瀵煎叆</a-button> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + <a-button + type="primary" + icon="download" + @click="handleExportXls('澶囧搧澶囦欢棰嗙敤鍗�')" + >瀵煎嚭</a-button> + <a-upload + name="file" + :showUploadList="false" + :multiple="false" + :headers="tokenHeader" + :action="importExcelUrl" + @change="handleImportExcel" + > + <a-button + type="primary" + icon="import" + >瀵煎叆</a-button> </a-upload> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + <a-menu-item + key="1" + @click="batchDel" + ><a-icon type="delete" />鍒犻櫎</a-menu-item> </a-menu> <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> </a-dropdown> @@ -65,9 +149,15 @@ <!-- table鍖哄煙-begin --> <div> - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + > <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� - <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> </div> <a-table @@ -81,9 +171,13 @@ :loading="loading" class="j-table-force-nowrap" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange"> + @change="handleTableChange" + > - <span slot="action" slot-scope="text, record"> + <span + slot="action" + slot-scope="text, record" + > <a @click="handleEdit(record)">缂栬緫</a> <a-divider type="vertical" /> @@ -91,7 +185,10 @@ <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> <a-menu slot="overlay"> <a-menu-item> - <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > <a>鍒犻櫎</a> </a-popconfirm> </a-menu-item> @@ -104,107 +201,110 @@ <!-- table鍖哄煙-end --> <!-- 琛ㄥ崟鍖哄煙 --> - <eamSparePartReceive-modal ref="modalForm" @ok="modalFormOk"></eamSparePartReceive-modal> + <eamSparePartReceive-modal + ref="modalForm" + @ok="modalFormOk" + ></eamSparePartReceive-modal> </a-card> </template> <script> - import '@assets/less/TableExpand.less' - import EamSparePartReceiveModal from './modules/EamSparePartReceiveModal.vue' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import '@assets/less/TableExpand.less' +import EamSparePartReceiveModal from './modules/EamSparePartReceiveModal.vue' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' - export default { - name: "EamSparePartReceiveList", - mixins:[JeecgListMixin], - components: { - EamSparePartReceiveModal - }, - data () { - return { - description: '澶囧搧澶囦欢棰嗙敤鍗曠鐞嗛〉闈�', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title: '鍒犻櫎鏍囪', - align:"center", - dataIndex: 'delFlag' - }, - { - title: '棰嗙敤鍗曠紪鐮�', - align:"center", - dataIndex: 'receiveCode' - }, - { - title: '棰嗙敤浜�', - align:"center", - dataIndex: 'receiveUser' - }, - { - title: '棰嗙敤浜嬬敱', - align:"center", - dataIndex: 'receiveReason' - }, - { - title: '棰嗙敤鐘舵��', - align:"center", - dataIndex: 'receiveStatus' - }, - { - title: '鏄惁闇�瑕佸綊杩�;鏄細瀛樺湪褰掕繕鍔ㄤ綔锛屽惁锛氱洿鎺ュ畬鎴�', - align:"center", - dataIndex: 'giveBackFlag' - }, - { - title: '瀹℃牳浜�', - align:"center", - dataIndex: 'approvalUser' - }, - { - title: '瀹℃牳鏃堕棿', - align:"center", - dataIndex: 'approvalTime' - }, - { - title: '澶囨敞', - align:"center", - dataIndex: 'remark' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - scopedSlots: { customRender: 'action' }, +export default { + name: "EamSparePartReceiveList", + mixins: [JeecgListMixin], + components: { + EamSparePartReceiveModal + }, + data() { + return { + description: '澶囧搧澶囦欢棰嗙敤鍗曠鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; } - ], - url: { - list: "/eam/eamSparePartReceive/list", - delete: "/eam/eamSparePartReceive/delete", - deleteBatch: "/eam/eamSparePartReceive/deleteBatch", - exportXlsUrl: "eam/eamSparePartReceive/exportXls", - importExcelUrl: "eam/eamSparePartReceive/importExcel", - }, + }, + { + title: '鍒犻櫎鏍囪', + align: "center", + dataIndex: 'delFlag' + }, + { + title: '棰嗙敤鍗曠紪鐮�', + align: "center", + dataIndex: 'receiveCode' + }, + { + title: '棰嗙敤浜�', + align: "center", + dataIndex: 'receiveUser' + }, + { + title: '棰嗙敤浜嬬敱', + align: "center", + dataIndex: 'receiveReason' + }, + { + title: '棰嗙敤鐘舵��', + align: "center", + dataIndex: 'receiveStatus' + }, + { + title: '鏄惁闇�瑕佸綊杩�;鏄細瀛樺湪褰掕繕鍔ㄤ綔锛屽惁锛氱洿鎺ュ畬鎴�', + align: "center", + dataIndex: 'giveBackFlag' + }, + { + title: '瀹℃牳浜�', + align: "center", + dataIndex: 'approvalUser' + }, + { + title: '瀹℃牳鏃堕棿', + align: "center", + dataIndex: 'approvalTime' + }, + { + title: '澶囨敞', + align: "center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/eam/eamSparePartReceive/list", + delete: "/eam/eamSparePartReceive/delete", + deleteBatch: "/eam/eamSparePartReceive/deleteBatch", + exportXlsUrl: "eam/eamSparePartReceive/exportXls", + importExcelUrl: "eam/eamSparePartReceive/importExcel", + }, } }, computed: { - importExcelUrl: function(){ + importExcelUrl: function () { return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; } }, - methods: { + methods: { - } } +} </script> <style scoped> - @import '~@assets/less/common.less'; +@import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/eam/spare/EamSparePartRequisitionList.vue b/src/views/eam/spare/EamSparePartRequisitionList.vue index 6f72a2d..4302e94 100644 --- a/src/views/eam/spare/EamSparePartRequisitionList.vue +++ b/src/views/eam/spare/EamSparePartRequisitionList.vue @@ -1,4 +1,4 @@ -<template> +<template > <a-row :gutter="10"> <a-col :md="leftColMd" @@ -99,7 +99,7 @@ type="primary" icon="plus" >鏂板</a-button> - <a-button + <!-- <a-button type="primary" icon="download" @click="handleExportXls('澶囦欢璇疯喘鍗�')" @@ -116,7 +116,7 @@ type="primary" icon="import" >瀵煎叆</a-button> - </a-upload> + </a-upload> --> </div> <!-- table鍖哄煙-begin --> @@ -151,17 +151,24 @@ slot="action" slot-scope="text, record" > - <a @click="handleOpen(record)">鏄庣粏</a> - <a-divider - v-if="record.requisitionStatus !== '3' && record.requisitionStatus !== '5'" - type="vertical" - /> - <a-dropdown v-if="record.requisitionStatus === '1' || record.requisitionStatus === '4'"> + <!-- <a @click="handleOpen(record)">鏄庣粏</a> --> + <!-- <a + v-if="record.requisitionStatus === '1'" + @click="handleConfirm(record)" + >鎻愪氦</a> --> + <a-popconfirm + v-if="record.requisitionStatus === '1'" + title="纭畾鎻愪氦鍚�?" + @confirm="() => handleConfirm(record)" + > <a>鎻愪氦</a> + </a-popconfirm> + <a-divider type="vertical" /> + <a-dropdown v-if="record.requisitionStatus === '1'"> <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> <a-menu slot="overlay"> - <a-menu-item> + <!-- <a-menu-item> <a @click="handleConfirm(record)">鎻愪氦</a> - </a-menu-item> + </a-menu-item> --> <a-menu-item> <a @click="handleEdit(record)">缂栬緫</a> </a-menu-item> @@ -175,10 +182,10 @@ </a-menu-item> </a-menu> </a-dropdown> - <a + <!-- <a v-if="record.requisitionStatus === '2'" @click="handleExamine(record)" - >瀹℃牳</a> + >瀹℃牳</a> --> </span> </a-table> @@ -191,10 +198,10 @@ @ok="modalFormOk" ></eamSparePartRequisition-modal> - <eamSparePartRequisitionExamine-modal + <!-- <eamSparePartRequisitionExamine-modal ref="modalExamine" @ok="modalFormOk2" - ></eamSparePartRequisitionExamine-modal> + ></eamSparePartRequisitionExamine-modal> --> </a-card> </a-col> @@ -203,15 +210,18 @@ :sm="24" v-if="this.rightColVal === 1" > - <a-card :bordered="false"> - <div style="text-align: right;"> + <a-card + title="澶囦欢璇疯喘鏄庣粏" + :bordered="false" + > + <div style="text-align: left;"> <a-icon type="close-circle" @click="hideSpareDetailList" /> </div> <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper"> + <!-- <div class="table-page-search-wrapper"> <a-form layout="inline"> <a-row :gutter="24"> <a-col @@ -238,10 +248,10 @@ </a-row> </a-form> - </div> + </div> --> <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div + <!-- <div class="table-operator" :md="24" :sm="24" @@ -283,9 +293,9 @@ <a-icon type="down" /> </a-button> </a-dropdown> - </div> + </div> --> - <!-- table鍖哄煙-begin --> + <!-- table鍖哄煙-begin <div> <div class="ant-alert ant-alert-info" @@ -296,47 +306,47 @@ style="margin-left: 24px" @click="onClearSelected2" >娓呯┖</a> - </div> + </div>--> - <a-table - style="height:500px" - ref="table2" - size="middle" - bordered - rowKey="id" - :columns="columns2" - :dataSource="dataSource2" - :pagination="iPagination2" - :loading="loading2" - class="j-table-force-nowrap" - :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" - @change="handleTableChange2" + <a-table + style="height:500px" + ref="table2" + size="middle" + bordered + rowKey="id" + :columns="columns2" + :dataSource="dataSource2" + :pagination="iPagination2" + :loading="loading2" + class="j-table-force-nowrap" + @change="handleTableChange2" + > + <!-- :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" --> + + <span + slot="action" + slot-scope="text, record" > + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a-popconfirm @click="handleEdit2(record)"> + <a>缂栬緫</a> + </a-popconfirm> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete2(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> - <span - slot="action" - slot-scope="text, record" - > - <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> - <a-menu slot="overlay"> - <a-menu-item> - <a-popconfirm @click="handleEdit2(record)"> - <a>缂栬緫</a> - </a-popconfirm> - <a-popconfirm - title="纭畾鍒犻櫎鍚�?" - @confirm="() => handleDelete2(record.id)" - > - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> + </a-table> - </a-table> - </div> <!-- table鍖哄煙-end --> </a-card> </a-col> @@ -347,7 +357,7 @@ <script> import '@assets/less/TableExpand.less' import EamSparePartRequisitionModal from './modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue' -import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue' +// import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { deleteAction, getAction, postAction } from '@api/manage' import { filterObj } from '@/utils/util' @@ -357,7 +367,7 @@ mixins: [JeecgListMixin], components: { EamSparePartRequisitionModal, - EamSparePartRequisitionExamineModal + // EamSparePartRequisitionExamineModal }, data() { return { @@ -415,6 +425,16 @@ // 琛ㄥご columns: [ { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { title: '璇疯喘鍗曞彿', align: "center", dataIndex: 'requisitionCode' @@ -454,21 +474,41 @@ // 瀛愯〃琛ㄥご columns2: [ { - title: '澶囧搧澶囦欢ID', + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '澶囧搧缂栫爜', align: "center", - dataIndex: 'partId' + dataIndex: 'partCode' + }, + { + title: '鍚嶇О', + align: "center", + dataIndex: 'partName' + }, + { + title: '鍨嬪彿', + align: "center", + dataIndex: 'partModel' }, { title: '璇疯喘鏁伴噺', align: "center", dataIndex: 'requisitionNum' }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align: "center", - scopedSlots: { customRender: 'action' }, - } + // { + // title: '鎿嶄綔', + // dataIndex: 'action', + // align: "center", + // scopedSlots: { customRender: 'action' }, + // } ], url: { list: "/eam/eamSparePartRequisition/list", @@ -490,17 +530,17 @@ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; }, leftColMd() { - return this.selectedRowKeys1.length === 0 ? 24 : 12 + return this.selectedRowKeys1.length === 0 ? 24 : 14 }, rightColMd() { - return this.selectedRowKeys1.length === 0 ? 0 : 12 + return this.selectedRowKeys1.length === 0 ? 0 : 10 } }, methods: { customRow(record) { return { on: { - dblclick: () => { + click: () => { this.handleOpen(record) } } @@ -530,6 +570,25 @@ this.onClearSelected2() this.loadData2() }, + + // handleAdd: function () { + // // if (this.spareRequisitionId === '') { + // // this.$message.error('璇烽�夋嫨涓�涓璐崟!') + // // } else { + // // this.$refs.modalForm2.roleDisabled = true + // this.$refs.sparePartRequisitionModalForm.title = '鏂板' + // this.$refs.sparePartRequisitionModalForm.add() + // // } + // }, + searchQuery: function () { + this.loadData(1) + this.dataSource2 = [] + }, + searchReset: function () { + this.queryParam = {} + this.loadData(1) + this.dataSource2 = [] + }, searchQuery2: function () { this.loadData2(1) }, @@ -549,6 +608,38 @@ onClearSelected2: function () { this.selectedRowKeys2 = [] this.selectionRows2 = [] + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + if (!params) { + return false; + } + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records || res.result; + if (res.result.total) { + this.ipagination.total = res.result.total; + } else { + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) }, loadData2: function (arg) { if (!this.url.list2) { @@ -661,26 +752,33 @@ this.selectionRows1 = [] }, handleConfirm(record) { + setTimeout(() => { + this.loading = true + }, 100); + if (!this.url.submit) { this.$message.error('璇疯缃畊rl.submit灞炴��!') return } var that = this - this.$confirm({ - title: '纭鎻愪氦', - content: '纭畾鎻愪氦鍚�?', - onOk: function () { - postAction(that.url.submit, record).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.loadData() - // that.onClearSelected1() - } else { - that.$message.warning(res.message) - } - }) + // this.$confirm({ + // title: '纭鎻愪氦', + // content: '纭畾鎻愪氦鍚�?', + // onOk: function () { + + postAction(that.url.submit, record).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData() + // that.onClearSelected1() + } else { + that.$message.warning(res.message) } + that.loading = false }) + // } + // }) + this.loading = false }, handleExamine: function (record) { this.$refs.modalExamine.examine(record); diff --git a/src/views/eam/spare/EamSparePartsList.vue b/src/views/eam/spare/EamSparePartsList.vue index 249bec8..267b852 100644 --- a/src/views/eam/spare/EamSparePartsList.vue +++ b/src/views/eam/spare/EamSparePartsList.vue @@ -234,6 +234,16 @@ // 琛ㄥご columns: [ { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { title: '澶囦欢缂栫爜', align: "center", dataIndex: 'partCode' diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue index c0781ad..13ab68f 100644 --- a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue +++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue @@ -1,20 +1,24 @@ <template> <j-modal :title="title" - :width="800" + :width="900" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen + centered + :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴" > - <a-spin :spinning="confirmLoading"> + <a-spin :spinning="spinning"> <a-form-model ref="form" :model="model" :rules="validatorRules" + :labelCol="labelCol" + :wrapperCol="wrapperCol" > <a-form-model-item :labelCol="labelCol" @@ -39,45 +43,118 @@ v-model="model.remark" /> </a-form-model-item> + <a-row :gutter="24"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;" + /> + </a-row> </a-form-model> </a-spin> </j-modal> </template> <script> -import { httpAction, getAction } from '@api/manage' -import moment from "moment" +import { getAction, httpAction } from '@/api/manage' +import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' +import { JVXETypes } from '@/components/jeecg/JVxeTable' export default { - name: "EamSparePartRequisitionModal", + name: 'EamSparePartIntoModal', + mixins: [JVxeTableModelMixin], + components: {}, data() { return { - title: "鎿嶄綔", + title: '鎿嶄綔', visible: false, model: {}, labelCol: { xs: { span: 24 }, - sm: { span: 5 }, + sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 }, + sm: { span: 15 } }, - confirmLoading: false, + spinning: false, + disabled: false, validatorRules: {}, url: { + //add: '/eam/eamSparePartInventory/add', + //edit: '/eam/eamSparePartInventory/edit', add: "/eam/eamSparePartRequisition/add", edit: "/eam/eamSparePartRequisition/edit", + getDetails: "/eam/eamSparePartRequisitionDetail/list", generateRequisitionCode: "sys/sysBusinessCodeRule/generateBusinessCodeSeq" }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: '澶囦欢', + key: 'partId', + type: JVXETypes.select, + width: '30%', + align: 'center', + dictCode: 'eam_spare_parts,part_name,id, del_flag!=\'1\'', + validateRules: [ + { required: true, message: '澶囦欢涓嶈兘涓虹┖锛�' } + ] + }, + // { + // title: '鎵规鍙�', + // key: 'batchNum', + // type: JVXETypes.input, + // width: '10%', + // align: 'center', + // validateRules: [ + // { required: true, message: '鎵规鍙蜂笉鑳戒负绌猴紒' } + // ] + // }, + { + title: '鏁伴噺', + key: 'requisitionNum', + type: JVXETypes.inputNumber, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '鏁伴噺涓嶈兘涓虹┖锛�' } + ] + }, + // { + // title: '鍑哄巶鏃ユ湡(鐢熶骇鏃ユ湡)', + // key: 'manufactureDate', + // type: JVXETypes.datetime, + // width: '16%', + // align: 'center', + // validateRules: [ + // { required: false, message: '鍑哄巶鏃ユ湡(鐢熶骇鏃ユ湡)涓嶈兘涓虹┖锛�' } + // ] + // }, + + ] + } } }, created() { }, methods: { add() { + const that = this + this.visible = true; let params = { businessCode: "SpareRequisitionCodeRule" } @@ -95,48 +172,64 @@ }, edit(record) { this.model = Object.assign({}, record); + this.detail.dataSource = record.sparePartRequisitionDetails this.visible = true; }, - close() { - this.$emit('close'); - this.visible = false; - this.$refs.form.clearValidate(); - }, - handleOk() { - const that = this; + + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } // 瑙﹀彂琛ㄥ崟楠岃瘉 this.$refs.form.validate(valid => { if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.sparePartRequisitionDetails = [...tableData] + that.model.removeDetailList = [...removeData] + + that.confirmLoading = that.spinning = true + let httpurl = '' + let method = '' if (!this.model.id) { - httpurl += this.url.add; - method = 'post'; + httpurl += this.url.add + method = 'post' } else { - httpurl += this.url.edit; - method = 'put'; + httpurl += this.url.edit + method = 'put' } httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { - that.$message.success(res.message); - that.$emit('ok'); + that.$message.success(res.message) + that.$emit('ok') + that.close() } else { - that.$message.warning(res.message); + that.$message.warning(res.message) } }).finally(() => { - that.confirmLoading = false; - that.close(); + that.confirmLoading = that.spinning = false }) } else { - return false; + return false } }) }, + + + handleCancel() { this.close() }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + } } } </script> diff --git a/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue b/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue index beb8f40..72dde2c 100644 --- a/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue +++ b/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue @@ -183,7 +183,10 @@ type="primary" icon="close" >鍙栨秷</a-button> - <a-button @click="submitForm">鎻愪氦</a-button> + <a-button + :loading="spinning" + @click="submitForm" + >鎻愪氦</a-button> </div> </a-form-model> </div> @@ -350,6 +353,7 @@ }, submitForm() { const that = this; + that.spinning = true if (!that.assignFileStream.status == null || that.assignFileStream.status === undefined) { this.$message.warning('璇烽�夋嫨瀹℃壒鐘舵�侊紒') return false; @@ -387,6 +391,7 @@ } }).finally(() => { that.confirmLoading = false; + that.spinning = false }) } -- Gitblit v1.9.3