From e3cf5d32f26c65cb04839b76762a2ec6603d5540 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期四, 24 七月 2025 15:28:07 +0800
Subject: [PATCH] 库位货架管理完善表单校验及问题处理
---
src/views/eam/spare/EamSparePartsList.vue | 417 ++++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 295 insertions(+), 122 deletions(-)
diff --git a/src/views/eam/spare/EamSparePartsList.vue b/src/views/eam/spare/EamSparePartsList.vue
index 85ac3f2..267b852 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,57 @@
<!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
<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
+ @click="handleInto"
+ 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 +156,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 +172,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 +184,192 @@
</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>
+
+ <eamSpare-part-into-modal
+ ref="intoModalForm"
+ @ok="modalFormOk"
+ ></eamSpare-part-into-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 EamSparePartIntoModal from './modules/EamSpareParts/EamSparePartIntoModal.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' },
+export default {
+ name: "EamSparePartsList",
+ mixins: [JeecgListMixin],
+ components: {
+ EamSparePartsModal,
+ EamSparePartInventoryList,
+ EamSparePartIntoModal
+ },
+ data() {
+ return {
+ description: '澶囧搧澶囦欢绠$悊椤甸潰',
+ sparePartId: '-1',
+ // 琛ㄥご
+ columns: [
+ {
+ title: '#',
+ dataIndex: '',
+ key: 'rowIndex',
+ width: 60,
+ align: 'center',
+ customRender: function (t, r, index) {
+ return parseInt(index) + 1
}
- ],
- url: {
- list: "/eam/eamSpareParts/list",
- delete: "/eam/eamSpareParts/delete",
- deleteBatch: "/eam/eamSpareParts/deleteBatch",
- exportXlsUrl: "eam/eamSpareParts/exportXls",
- importExcelUrl: "eam/eamSpareParts/importExcel",
- },
+ },
+ {
+ 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: '搴撳瓨鎬绘暟',
+ align: "center",
+ dataIndex: 'totalQuantity'
+ },
+ {
+ 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: {
- }
+ handleInto() {
+ this.$refs.intoModalForm.add();
+ this.$refs.intoModalForm.title = "鍏ュ簱";
+ },
+ searchReset() {
+ this.queryParam = {}
+ this.onClearSelected()
+ this.loadData(1);
+ },
+ searchQuery() {
+ 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
--
Gitblit v1.9.3