From 8e6e8e57808ebf96eb6c2d51583ef33891c05c94 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期二, 20 五月 2025 14:39:46 +0800 Subject: [PATCH] 备件管理 界面修改 --- src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue | 324 +++++++++++++++++ /dev/null | 201 ---------- src/views/eam/spare/EamSparePartsList.vue | 384 +++++++++++++------ src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue | 194 ++++++++++ 4 files changed, 778 insertions(+), 325 deletions(-) diff --git a/src/views/eam/spare/EamSparePartInventoryList.vue b/src/views/eam/spare/EamSparePartInventoryList.vue deleted file mode 100644 index f80555d..0000000 --- a/src/views/eam/spare/EamSparePartInventoryList.vue +++ /dev/null @@ -1,200 +0,0 @@ -<template> - <a-card :bordered="false"> - - <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper"> - <a-form layout="inline" @keyup.enter.native="searchQuery"> - <a-row :gutter="24"> - - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="澶囧搧澶囦欢ID"> - <a-input placeholder="璇疯緭鍏ュ鍝佸浠禝D" v-model="queryParam.sparePartId"></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.batchNum"></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.inventory"></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.manufactureDate"></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.supplier"></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"> - {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} - <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> - </a> - </span> - </a-col> - - </a-row> - </a-form> - </div> - - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <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-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> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> - </div> - - <!-- table鍖哄煙-begin --> - <div> - <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> - </div> - - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - class="j-table-force-nowrap" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange"> - - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - - <a-divider type="vertical" /> - <a-dropdown> - <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>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - - </a-table> - </div> - <!-- table鍖哄煙-end --> - - <!-- 琛ㄥ崟鍖哄煙 --> - <eamSparePartInventory-modal ref="modalForm" @ok="modalFormOk"></eamSparePartInventory-modal> - </a-card> -</template> - -<script> - import '@assets/less/TableExpand.less' - import EamSparePartInventoryModal from './modules/EamSparePartInventoryModal.vue' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - - export default { - name: "EamSparePartInventoryList", - mixins:[JeecgListMixin], - components: { - EamSparePartInventoryModal - }, - data () { - return { - description: '澶囦欢搴撳瓨淇℃伅绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title: '澶囧搧澶囦欢ID', - align:"center", - dataIndex: 'sparePartId' - }, - { - title: '鎵规鍙�', - align:"center", - dataIndex: 'batchNum' - }, - { - title: '搴撳瓨鏁伴噺', - align:"center", - dataIndex: 'inventory' - }, - { - title: '鍑哄巶鏃ユ湡(鐢熶骇鏃ユ湡)', - align:"center", - dataIndex: 'manufactureDate' - }, - { - title: '渚涘簲鍟�', - align:"center", - dataIndex: 'supplier' - }, - { - title: '鎴鏈夋晥鏈�', - align:"center", - dataIndex: 'expirationOfValidity' - }, - { - title: '瀛樻斁浣嶇疆', - align:"center", - dataIndex: 'location' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - scopedSlots: { customRender: 'action' }, - } - ], - url: { - list: "/eam/eamSparePartInventory/list", - delete: "/eam/eamSparePartInventory/delete", - deleteBatch: "/eam/eamSparePartInventory/deleteBatch", - exportXlsUrl: "eam/eamSparePartInventory/exportXls", - importExcelUrl: "eam/eamSparePartInventory/importExcel", - }, - } - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - } - }, - methods: { - - } - } -</script> -<style scoped> - @import '~@assets/less/common.less'; -</style> \ No newline at end of file diff --git a/src/views/eam/spare/EamSparePartsList.vue b/src/views/eam/spare/EamSparePartsList.vue index 85ac3f2..e5f9d88 100644 --- a/src/views/eam/spare/EamSparePartsList.vue +++ b/src/views/eam/spare/EamSparePartsList.vue @@ -2,32 +2,88 @@ <a-card :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> <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="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="澶囦欢缂栫爜"> - <j-input placeholder="璇疯緭鍏ュ浠剁紪鐮�" v-model="queryParam.partCode"></j-input> - </a-form-item> - </a-col> - <a-col :xl="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="澶囦欢鍚嶇О"> - <j-input placeholder="璇疯緭鍏ュ浠跺悕绉�" v-model="queryParam.partName"></j-input> - </a-form-item> - </a-col> - <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > <a-form-item label="澶囦欢鍒嗙被"> - <j-input placeholder="璇疯緭鍏ュ浠跺垎绫�" v-model="queryParam.partCategory"></j-input> + <j-dict-select-tag + allow-clear + :disabled="false" + placeholder="璇烽�夋嫨澶囦欢鍒嗙被" + :triggerChange="true" + dictCode="spare_part_category" + v-model="queryParam.partCategory" + /> </a-form-item> </a-col> - <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="澶囦欢缂栫爜"> + <j-input + placeholder="璇疯緭鍏ュ浠剁紪鐮�" + v-model="queryParam.partCode" + ></j-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="澶囦欢鍚嶇О"> + <j-input + placeholder="璇疯緭鍏ュ浠跺悕绉�" + v-model="queryParam.partName" + ></j-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > <a-form-item label="澶囦欢鍨嬪彿"> - <j-input placeholder="璇疯緭鍏ュ浠跺瀷鍙�" v-model="queryParam.partModel"></j-input> + <j-input + placeholder="璇疯緭鍏ュ浠跺瀷鍙�" + v-model="queryParam.partModel" + ></j-input> </a-form-item> </a-col> - <a-col :xl="4" :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-col + :xl="4" + :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> </span> </a-col> @@ -37,24 +93,51 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <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> + </a-dropdown> --> </div> <!-- 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 @@ -67,10 +150,15 @@ :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange"> + :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' + :customRow='clickThenSelect' + @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" /> @@ -78,7 +166,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> @@ -87,116 +178,161 @@ </span> </a-table> + <a-tabs defaultActiveKey="1"> + <a-tab-pane + tab='搴撳瓨鏄庣粏' + key="1" + > + <div + class="table-operator" + style="margin:-16px" + > + <eamSpare-part-inventory-list :sparePartId='sparePartId' /> + </div> + </a-tab-pane> + </a-tabs> </div> <!-- table鍖哄煙-end --> - <!-- 琛ㄥ崟鍖哄煙 --> - <eamSpareParts-modal ref="modalForm" @ok="modalFormOk"></eamSpareParts-modal> + <eamSpareParts-modal + ref="modalForm" + @ok="modalFormOk" + ></eamSpareParts-modal> </a-card> </template> <script> import '@assets/less/TableExpand.less' -import EamSparePartsModal from './modules/EamSparePartsModal.vue' +import EamSparePartsModal from './modules/EamSpareParts/EamSparePartsModal.vue' +import EamSparePartInventoryList from './modules/EamSpareParts/EamSparePartInventoryList.vue' import { JeecgListMixin } from '@/mixins/JeecgListMixin' - export default { - name: "EamSparePartsList", - mixins:[JeecgListMixin], - components: { - EamSparePartsModal - }, - data () { - return { - description: '澶囧搧澶囦欢绠$悊绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '澶囦欢缂栫爜', - align:"center", - dataIndex: 'partCode' - }, - { - title: '澶囦欢鍚嶇О', - align:"center", - dataIndex: 'partName' - }, - { - title: '鍒嗙被', - align:"center", - dataIndex: 'partCategory' - }, - { - title: '鍨嬪彿', - align:"center", - dataIndex: 'partModel' - }, - { - title: '瑙勬牸', - align:"center", - dataIndex: 'partSpecification' - }, - { - title: '瀛樻斁浠撳簱', - align:"center", - dataIndex: 'storehouse' - }, - { - title: '鍒堕�犲晢', - align:"center", - dataIndex: 'manufacturingEnterprise' - }, - { - title: '鍗曚綅', - align:"center", - dataIndex: 'unit' - }, - { - title: '鏈夋晥鏈燂紙澶╋級', - align:"center", - dataIndex: 'periodOfValidity' - }, - { - title: '搴撳瓨涓婇檺鍊�', - align:"center", - dataIndex: 'inventoryMax' - }, - { - title: '搴撳瓨涓嬮檺鍊�', - align:"center", - dataIndex: 'inventoryMin' - }, - { - title: '搴撳瓨棰勮鍊�', - align:"center", - dataIndex: 'inventoryWarning' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - scopedSlots: { customRender: 'action' }, - } - ], - url: { - list: "/eam/eamSpareParts/list", - delete: "/eam/eamSpareParts/delete", - deleteBatch: "/eam/eamSpareParts/deleteBatch", - exportXlsUrl: "eam/eamSpareParts/exportXls", - importExcelUrl: "eam/eamSpareParts/importExcel", - }, +export default { + name: "EamSparePartsList", + mixins: [JeecgListMixin], + components: { + EamSparePartsModal, + EamSparePartInventoryList + }, + data() { + return { + description: '澶囧搧澶囦欢绠$悊椤甸潰', + sparePartId: '-1', + // 琛ㄥご + columns: [ + { + title: '澶囦欢缂栫爜', + align: "center", + dataIndex: 'partCode' + }, + { + title: '鍒嗙被', + align: "center", + dataIndex: 'partCategory_dictText' + }, + { + title: '澶囦欢鍚嶇О', + align: "center", + dataIndex: 'partName' + }, + { + title: '鍨嬪彿', + align: "center", + dataIndex: 'partModel' + }, + { + title: '瑙勬牸', + align: "center", + dataIndex: 'partSpecification' + }, + { + title: '瀛樻斁浠撳簱', + align: "center", + dataIndex: 'storehouse' + }, + { + title: '鍒堕�犲晢', + align: "center", + dataIndex: 'manufacturingEnterprise' + }, + { + title: '鍗曚綅', + align: "center", + dataIndex: 'unit' + }, + { + title: '鏈夋晥鏈燂紙澶╋級', + align: "center", + dataIndex: 'periodOfValidity' + }, + { + title: '搴撳瓨涓婇檺鍊�', + align: "center", + dataIndex: 'inventoryMax' + }, + { + title: '搴撳瓨涓嬮檺鍊�', + align: "center", + dataIndex: 'inventoryMin' + }, + { + title: '搴撳瓨棰勮鍊�', + align: "center", + dataIndex: 'inventoryWarning' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/eam/eamSpareParts/list", + delete: "/eam/eamSpareParts/delete", + deleteBatch: "/eam/eamSpareParts/deleteBatch", + exportXlsUrl: "eam/eamSpareParts/exportXls", + importExcelUrl: "eam/eamSpareParts/importExcel", + }, } }, computed: { - importExcelUrl: function(){ + importExcelUrl: function () { return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; } }, - methods: { - - } + methods: { + searchReset() { + this.queryParam = {} + this.onClearSelected() + this.loadData(1); + }, + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(','), [record]) + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = [] + this.selectionRows = [] + this.sparePartId = '-1' + }, + onSelectChange(selectedRowKeys, selectionRows) { + if (selectedRowKeys.length == 1) { + this.sparePartId = selectionRows[0]['id'] + } else { + this.sparePartId = '-1' + } + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + }, } +} </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/modules/EamSparePartInventoryModal.vue b/src/views/eam/spare/modules/EamSparePartInventoryModal.vue deleted file mode 100644 index a0dcd77..0000000 --- a/src/views/eam/spare/modules/EamSparePartInventoryModal.vue +++ /dev/null @@ -1,129 +0,0 @@ -<template> - <j-modal - :title="title" - :width="800" - :visible="visible" - :confirmLoading="confirmLoading" - switchFullscreen - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴"> - - <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> - - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sparePartId" label="澶囧搧澶囦欢ID"> - <a-input placeholder="璇疯緭鍏ュ鍝佸浠禝D" v-model="model.sparePartId" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNum" label="鎵规鍙�"> - <a-input placeholder="璇疯緭鍏ユ壒娆″彿" v-model="model.batchNum" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventory" label="搴撳瓨鏁伴噺"> - <a-input placeholder="璇疯緭鍏ュ簱瀛樻暟閲�" v-model="model.inventory" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufactureDate" label="鍑哄巶鏃ユ湡(鐢熶骇鏃ユ湡)"> - <a-input placeholder="璇疯緭鍏ュ嚭鍘傛棩鏈�(鐢熶骇鏃ユ湡)" v-model="model.manufactureDate" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplier" label="渚涘簲鍟�"> - <a-input placeholder="璇疯緭鍏ヤ緵搴斿晢" v-model="model.supplier" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expirationOfValidity" label="鎴鏈夋晥鏈�"> - <a-input placeholder="璇疯緭鍏ユ埅姝㈡湁鏁堟湡" v-model="model.expirationOfValidity" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="location" label="瀛樻斁浣嶇疆"> - <a-input placeholder="璇疯緭鍏ュ瓨鏀句綅缃�" v-model="model.location" /> - </a-form-model-item> - - </a-form-model> - </a-spin> - </j-modal> -</template> - -<script> - import { httpAction } from '@api/manage' - import moment from "moment" - - export default { - name: "EamSparePartInventoryModal", - data () { - return { - title:"鎿嶄綔", - visible: false, - model: {}, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - - confirmLoading: false, - validatorRules:{ - }, - url: { - add: "/eam/eamSparePartInventory/add", - edit: "/eam/eamSparePartInventory/edit", - }, - } - }, - created () { - }, - methods: { - add () { - //鍒濆鍖栭粯璁ゅ�� - this.edit({}); - }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; - }, - close () { - this.$emit('close'); - this.visible = false; - this.$refs.form.clearValidate(); - }, - handleOk () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - }else{ - return false; - } - }) - }, - handleCancel () { - this.close() - }, - - - } - } -</script> - -<style lang="less" scoped> - -</style> \ No newline at end of file diff --git a/src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue b/src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue new file mode 100644 index 0000000..edfc5b8 --- /dev/null +++ b/src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue @@ -0,0 +1,194 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + + </a-table> + </div> + + </a-card> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import Vue from 'vue' +import { getFileAccessHttpUrl } from '@/api/manage'; + +export default { + name: "EamSparePartInventoryList", + mixins: [JeecgListMixin], + components: { + Tooltip, + }, + props: { + sparePartId: { + type: String, + default: '-1', + required: false + } + }, + watch: { + sparePartId: { + immediate: true, + handler(val) { + if (!this.sparePartId) { + this.clearList() + } else { + this.queryParam['sparePartId'] = val; + this.loadData(1); + } + } + } + }, + data() { + return { + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + // { + // title: '澶囧搧澶囦欢ID', + // align: "center", + // dataIndex: 'sparePartId' + // }, + { + title: '鎵规鍙�', + align: "center", + dataIndex: 'batchNum' + }, + { + title: '搴撳瓨鏁伴噺', + align: "center", + dataIndex: 'inventory' + }, + { + title: '鍑哄巶鏃ユ湡(鐢熶骇鏃ユ湡)', + align: "center", + dataIndex: 'manufactureDate' + }, + { + title: '渚涘簲鍟�', + align: "center", + dataIndex: 'supplier' + }, + { + title: '鎴鏈夋晥鏈�', + align: "center", + dataIndex: 'expirationOfValidity' + }, + { + title: '瀛樻斁浣嶇疆', + align: "center", + dataIndex: 'location' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/eam/eamSparePartInventory/list", + delete: "/eam/eamSparePartInventory/delete", + deleteBatch: "/eam/eamSparePartInventory/deleteBatch", + exportXlsUrl: "eam/eamSparePartInventory/exportXls", + importExcelUrl: "eam/eamSparePartInventory/importExcel", + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 20, + pageSizeOptions: ['5', '10', '20', '50'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + } + }, + created() { + }, + computed: { + }, + methods: { + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + // this.originTargetKeys = []; + getAction(this.url.list, params).then((res) => { + if (res.success) { + // for (let i = 0; i < res.result.records.length; i++) { + // let r = res.result.records[i].upload; + // r.src = this.getSrc(res.result.records[i].upload); + // } + 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 + }) + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> diff --git a/src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue b/src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue new file mode 100644 index 0000000..b80a52f --- /dev/null +++ b/src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue @@ -0,0 +1,324 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + + <a-spin :spinning="confirmLoading"> + <a-form-model + ref="form" + :model="model" + :rules="validatorRules" + > + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="partCode" + label="澶囦欢缂栫爜" + > + <a-input + placeholder="澶囦欢缂栫爜鑷姩鐢熸垚" + v-model="model.partCode" + :disabled="true" + /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="partCategory" + label="澶囦欢鍒嗙被" + > + <!-- <a-input + placeholder="璇疯緭鍏ュ浠跺垎绫�" + v-model="model.partCategory" + /> --> + <j-dict-select-tag + allow-clear + :disabled="false" + placeholder="璇烽�夋嫨澶囦欢鍒嗙被" + :triggerChange="true" + dictCode="spare_part_category" + v-model="model.partCategory" + /> + </a-form-model-item> + </a-col> + + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="partName" + label="澶囦欢鍚嶇О" + > + <a-input + placeholder="璇疯緭鍏ュ浠跺悕绉�" + v-model="model.partName" + /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="partModel" + label="澶囦欢鍨嬪彿" + > + <a-input + placeholder="璇疯緭鍏ュ浠跺瀷鍙�" + v-model="model.partModel" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="partSpecification" + label="澶囦欢瑙勬牸" + > + <a-input + placeholder="璇疯緭鍏ュ浠惰鏍�" + v-model="model.partSpecification" + /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="storehouse" + label="瀛樻斁浠撳簱" + > + <a-input + placeholder="璇疯緭鍏ュ瓨鏀句粨搴�" + v-model="model.storehouse" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="unit" + label="璁¢噺鍗曚綅" + > + <a-input + placeholder="璇疯緭鍏ヨ閲忓崟浣�" + v-model="model.unit" + /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="manufacturingEnterprise" + label="鍒堕�犱紒涓�" + > + <a-input + placeholder="璇疯緭鍏ュ埗閫犱紒涓�" + v-model="model.manufacturingEnterprise" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="periodOfValidity" + label="鏈夋晥鏈�(澶�)" + > + <a-input-number + style="width: 100%" + :min="0" + :precision="0" + v-model="model.periodOfValidity" + /> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="inventoryWarning" + label="搴撳瓨棰勮鍊�" + > + <a-input-number + style="width: 100%" + :min="0" + v-model="model.inventoryWarning" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="inventoryMax" + label="鏈�澶у璐у簱瀛�" + > + <a-input-number + style="width: 100%" + :min="0" + v-model="model.inventoryMax" + /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="inventoryMin" + label="鏈�灏忓璐у簱瀛�" + > + <a-input-number + style="width: 100%" + :min="0" + v-model="model.inventoryMin" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item + :labelCol="{xs: { span: 24 }, sm: { span: 3 }}" + :wrapperCol="{xs: { span: 24 },sm: { span: 21 }}" + prop="remark" + label="澶囨敞" + > + <a-textarea + placeholder="璇疯緭鍏ュ娉�" + v-model="model.remark" + /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { getAction, httpAction } from '@api/manage' +import moment from "moment" + +export default { + name: "EamSparePartsModal", + data() { + return { + title: "鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 } + }, + + confirmLoading: false, + validatorRules: { + partName: [ + { required: true, message: '璇疯緭鍏ュ浠跺悕绉�' } + ] + }, + url: { + add: "/eam/eamSpareParts/add", + edit: "/eam/eamSpareParts/edit", + generateRequisitionCode: "sys/sysBusinessCodeRule/generateBusinessCodeSeq" + }, + } + }, + created() { + }, + methods: { + add() { + const that = this + let params = { + businessCode: "SparePartCodeRule" + } + getAction(that.url.generateRequisitionCode, params).then((res) => { + if (res.success) { + this.model = { + partCode: res.result + } + } else { + that.$message.warning(res.message); + } + }) + //鍒濆鍖栭粯璁ゅ�� + that.edit(this.model); + }, + edit(record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close() { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if (!this.model.id) { + httpurl += this.url.add; + method = 'post'; + } else { + httpurl += this.url.edit; + method = 'put'; + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } else { + return false; + } + }) + }, + handleCancel() { + this.close() + } + } +} +</script> + +<style lang="less" scoped> +</style> \ No newline at end of file diff --git a/src/views/eam/spare/modules/EamSparePartsModal.vue b/src/views/eam/spare/modules/EamSparePartsModal.vue deleted file mode 100644 index ce892d3..0000000 --- a/src/views/eam/spare/modules/EamSparePartsModal.vue +++ /dev/null @@ -1,201 +0,0 @@ -<template> - <j-modal - :title="title" - :width="800" - :visible="visible" - :confirmLoading="confirmLoading" - switchFullscreen - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴"> - - <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partCode" label="澶囦欢缂栫爜"> - <a-input placeholder="澶囦欢缂栫爜鑷姩鐢熸垚" v-model="model.partCode" :disabled="true" /> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName" label="澶囦欢鍚嶇О"> - <a-input placeholder="璇疯緭鍏ュ浠跺悕绉�" v-model="model.partName" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partCategory" label="澶囦欢鍒嗙被"> - <a-input placeholder="璇疯緭鍏ュ浠跺垎绫�" v-model="model.partCategory" /> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partModel" label="澶囦欢鍨嬪彿"> - <a-input placeholder="璇疯緭鍏ュ浠跺瀷鍙�" v-model="model.partModel" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partSpecification" label="澶囦欢瑙勬牸"> - <a-input placeholder="璇疯緭鍏ュ浠惰鏍�" v-model="model.partSpecification" /> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="storehouse" label="瀛樻斁浠撳簱"> - <a-input placeholder="璇疯緭鍏ュ瓨鏀句粨搴�" v-model="model.storehouse" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit" label="璁¢噺鍗曚綅"> - <a-input placeholder="璇疯緭鍏ヨ閲忓崟浣�" v-model="model.unit" /> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufacturingEnterprise" label="鍒堕�犱紒涓�"> - <a-input placeholder="璇疯緭鍏ュ埗閫犱紒涓�" v-model="model.manufacturingEnterprise" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="periodOfValidity" label="鏈夋晥鏈�(澶�)"> - <a-input-number style="width: 100%" :min="0" :precision="0" v-model="model.periodOfValidity"/> - </a-form-model-item> - </a-col> - - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryWarning" label="搴撳瓨棰勮鍊�"> - <a-input-number style="width: 100%" :min="0" v-model="model.inventoryWarning" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryMax" label="鏈�澶у璐у簱瀛�"> - <a-input-number style="width: 100%" :min="0" v-model="model.inventoryMax" /> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryMin" label="鏈�灏忓璐у簱瀛�"> - <a-input-number style="width: 100%" :min="0" v-model="model.inventoryMin" /> - </a-form-model-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-model-item :labelCol="{xs: { span: 24 }, sm: { span: 3 }}" :wrapperCol="{xs: { span: 24 },sm: { span: 21 }}" prop="remark" label="澶囨敞"> - <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" /> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </a-spin> - </j-modal> -</template> - -<script> -import { getAction, httpAction } from '@api/manage' - import moment from "moment" - - export default { - name: "EamSparePartsModal", - data () { - return { - title:"鎿嶄綔", - visible: false, - model: {}, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - }, - - confirmLoading: false, - validatorRules:{ - partName: [ - { required: true, message: '璇疯緭鍏ュ浠跺悕绉�' } - ] - }, - url: { - add: "/eam/eamSpareParts/add", - edit: "/eam/eamSpareParts/edit", - generateRequisitionCode: "sys/sysBusinessCodeRule/generateBusinessCodeSeq" - }, - } - }, - created () { - }, - methods: { - add () { - const that = this - let params = { - businessCode: "SparePartCodeRule" - } - getAction(that.url.generateRequisitionCode, params).then((res) => { - if (res.success) { - this.model = { - partCode: res.result - } - } else { - that.$message.warning(res.message); - } - }) - //鍒濆鍖栭粯璁ゅ�� - that.edit(this.model); - }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; - }, - close () { - this.$emit('close'); - this.visible = false; - this.$refs.form.clearValidate(); - }, - handleOk () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - }else{ - return false; - } - }) - }, - handleCancel () { - this.close() - } - } - } -</script> - -<style lang="less" scoped> - -</style> \ No newline at end of file -- Gitblit v1.9.3