From 7282d4b49f4577c6807a78bdd6e705feb2fe0e2c Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期四, 14 八月 2025 20:47:04 +0800 Subject: [PATCH] art: 线边库管理,物料台账相关代码修改 --- src/views/base/WarehouseList.vue | 119 +++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 67 insertions(+), 52 deletions(-) diff --git a/src/views/base/WarehouseList.vue b/src/views/base/WarehouseList.vue index 38dde11..510079e 100644 --- a/src/views/base/WarehouseList.vue +++ b/src/views/base/WarehouseList.vue @@ -11,18 +11,18 @@ <a-row :gutter="30"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="浠撳簱缂栧彿"> + <a-form-item label="绾胯竟搴撶紪鍙�"> <j-input - placeholder="璇疯緭鍏ヤ粨搴撶紪鍙锋绱�" + placeholder="璇疯緭鍏ョ嚎杈瑰簱缂栧彿妫�绱�" v-model="queryParam.warehouseCode" ></j-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="浠撳簱鍚嶇О"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="绾胯竟搴撳悕绉�"> <j-input - placeholder="璇疯緭鍏ヤ粨搴撳悕绉版绱�" + placeholder="璇疯緭鍏ョ嚎杈瑰簱鍚嶇О妫�绱�" v-model="queryParam.warehouseName" ></j-input> </a-form-item> @@ -44,7 +44,8 @@ @click="handleAdd" type="primary" icon="plus" - >鏂板</a-button> + >鏂板 + </a-button> </div> <!-- table鍖哄煙-begin --> @@ -60,6 +61,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" + @change="handleTableChange" > <!--鐘舵�佹爮涓�у睍绀�--> <span @@ -89,8 +91,8 @@ > <a href="javascript:;" - @click="handleDetail(record)" - >璇︽儏</a> + @click="handleEdit(record)" + >缂栬緫</a> <a-divider type="vertical" /> <a-dropdown> @@ -98,19 +100,10 @@ <a-icon type="down" /> </a> <a-menu slot="overlay"> - <a-menu-item v-if="record.warehouseStatus==1"> - <a @click="handleEdit(record)">缂栬緫</a> - </a-menu-item> <a-menu-item> - <a-popconfirm - title="纭畾鍒犻櫎鍚�?" - @confirm="() => handleDelete(record.id)" - > - <a>鍒犻櫎</a> - </a-popconfirm> - + <a @click="handleDetail(record)">璇︽儏</a> </a-menu-item> - <a-menu-item v-if="record.warehouseStatus == 0"> + <a-menu-item v-if="record.warehouseStatus == 0"> <a-popconfirm title="纭畾鍚敤鍚�?" @confirm="() => handleActive(record.id)" @@ -126,6 +119,16 @@ <a>绂佺敤</a> </a-popconfirm> </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + + </a-menu-item> + </a-menu> </a-dropdown> </span> @@ -146,7 +149,7 @@ //鎸夐渶寮曞叆 缁勪欢 import WarehouseModel from './modules/warehouse/WarehouseModel' -import { deleteAction, requestPut, getAction } from '@/api/manage' +import { getAction, requestPut } from '@/api/manage' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import JEllipsis from '@/components/jeecg/JEllipsis' import JInput from '@/components/jeecg/JInput' @@ -157,7 +160,7 @@ components: { WarehouseModel, JEllipsis, - JInput, + JInput }, data() { return { @@ -165,12 +168,19 @@ /* 鍒嗛〉鍙傛暟 */ ipagination: { current: 1, - pageSize: 5, - pageSizeOptions: ['5', '10', '20'], + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' }, + showQuickJumper: true, + showSizeChanger: true, total: 0 + }, + /* 鎺掑簭鍙傛暟 */ + isorter:{ + column: 'warehouseCode', + order: 'asc', }, // 琛ㄥご columns: [ @@ -179,19 +189,19 @@ dataIndex: '', key: 'rowIndex', width: 60, - align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } }, { title: '绾胯竟搴撶紪鍙�', - align: "center", + align: 'center', dataIndex: 'warehouseCode' }, { title: '绾胯竟搴撳悕绉�', - align: "center", + align: 'center', dataIndex: 'warehouseName' }, { @@ -204,7 +214,7 @@ title: '鐘舵��', align: 'center', scopedSlots: { - customRender: 'status', + customRender: 'status' }, dataIndex: 'warehouseStatus' }, @@ -213,78 +223,83 @@ title: '鎿嶄綔', dataIndex: 'action', align: 'center', - scopedSlots: { customRender: 'action' }, + scopedSlots: { customRender: 'action' } } ], url: { list: '/base/lineSideWarehouse/list', delete: '/base/lineSideWarehouse/delete', - active: '/base/lineSideWarehouse/active', - }, + active: '/base/lineSideWarehouse/active' + } } }, mounted() { - + }, methods: { loadData(arg) { if (arg === 1) { - this.ipagination.current = 1; + this.ipagination.current = 1 } - var params = this.getQueryParams();//鏌ヨ鏉′欢 - this.loading = true; + var params = this.getQueryParams()//鏌ヨ鏉′欢 + this.loading = true getAction(this.url.list, params).then((res) => { if (res.success) { - this.dataSource = res.result.records; - this.ipagination.total = res.result.total; + this.dataSource = res.result.records + this.ipagination.total = res.result.total } if (res.code === 510) { this.$message.warning(res.message) } - this.loading = false; + this.loading = false }) }, //绂佺敤鐘舵�佹牱寮� tableRowClass(record, index) { - if (record.warehouseStatus != "1") { - return "frozenRowClass"; + if (record.warehouseStatus != '1') { + return 'frozenRowClass' } - return ""; + return '' }, //鍚敤绂佺敤 handleActive(id) { if (!this.url.active) { - this.$message.error("璇疯缃畊rl.active!") + this.$message.error('璇疯缃畊rl.active!') return } - let that = this; + let that = this requestPut(that.url.active, {}, { id: id }).then((res) => { if (res.success) { - that.$message.success(res.message); - that.loadData(); + that.$message.success(res.message) + that.loadData() } else { - that.$message.warning(res.message); + that.$message.warning(res.message) } - }); - }, - }, + }) + } + } } </script> <style lang="less" scoped> @import '~@assets/less/common.less'; + .frozenRowClass { color: #c9c9c9; } + .success { color: green; } + .error { color: red; } + .fontweight { font-weight: bold; } + .ant-card-body .table-operator { margin-bottom: 18px; } @@ -298,7 +313,7 @@ margin: 0 5px; } -/deep/.ant-btn-danger { +/deep/ .ant-btn-danger { background-color: #ffffff; } -- Gitblit v1.9.3