From e5d626e1f5445e4358f17f9c9cac1122ef0af9cd Mon Sep 17 00:00:00 2001 From: 陈翱 <1121324153@qq.com> Date: Mon, 7 Aug 2023 16:31:20 +0800 Subject: [PATCH] 入库组盘页面,库存状态显示字典值 --- ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue index 827cd36..800c250 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue @@ -29,6 +29,12 @@ <a-button type="primary" @click="selectContainer(record)">选取容器</a-button> </span> + <span slot="inventoryStatus" slot-scope="inventoryStatus"> + <a-tag :key="inventoryStatus" color="blue" :color="getStatusColor(inventoryStatus)"> + {{ solutionInvStatus(inventoryStatus) }} + </a-tag> + </span> + </a-table> <select-inv-container-header ref="selectContainerForm" v-on:getContainer="getContainerCode"></select-inv-container-header> </j-modal> @@ -42,7 +48,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' import { validateDuplicateValue } from '@/utils/util' import { searchMaterialByCode } from '@/api/api' -import { listReceiveByReceiptId } from '@/api/api' +import { listReceiveByReceiptId,ajaxGetDictItems } from '@/api/api' import SelectInvContainerHeader from "./SelectInvContainerHeader"; export default { @@ -63,6 +69,7 @@ export default { materialList: {}, querySource: {}, dataSource: [], + invStatus:[], model: {}, labelCol: { xs: { span: 24 }, @@ -89,7 +96,8 @@ export default { title: '库存状态', dataIndex: 'inventoryStatus', align: 'center', - width: 96 + width: 96, + scopedSlots: {customRender: 'inventoryStatus'} }, { title: '批次', @@ -134,14 +142,42 @@ export default { // this.searchReceive() this.getSuperFieldList() // this.modelDefault = JSON.parse(JSON.stringify(this.model)) + this.loadFrom(); }, methods: { + loadFrom(){ + ajaxGetDictItems('inventory_status').then((res) => { + if (res.success) { + this.invStatus = res.result + } + }) + }, + getStatusColor(status) { + const colors = { + 'good ': 'green', + 'defective': 'red', + 'discussed ': 'grey', + 'scrap': 'purple', + default: 'blue' + }; + return colors[status] || colors.default; + }, getContainerCode(e){ this.$nextTick(function (){ let record={containerCode: e} this.model = Object.assign({}, record) }) }, + solutionInvStatus(value) { + var actions = [] + Object.keys(this.invStatus).some(key => { + if (this.invStatus[key].value == '' + value) { + actions.push(this.invStatus[key].text) + return true + } + }) + return actions.join('') + }, // add() { // this.edit(this.modelDefault) // this.model.inventoryStatus = 'good' -- libgit2 0.22.2