Commit 4eaf4bb540ae5d0b9b7ad137f65851385c8a25b4
1 parent
87c5e612
库存状态提示中文
Showing
2 changed files
with
42 additions
and
3 deletions
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerDetailModal.vue
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentDetailCombineModal.vue
... | ... | @@ -52,6 +52,12 @@ |
52 | 52 | <span slot="action" slot-scope="text, record"> |
53 | 53 | <a-button @click="combine(record)" type="primary">配盘</a-button> |
54 | 54 | </span> |
55 | + | |
56 | + <span slot="inventoryStatus" slot-scope="inventoryStatus"> | |
57 | + <a-tag :key="inventoryStatus" color="blue" :color="getStatusColor(inventoryStatus)"> | |
58 | + {{ solutionInvStatus(inventoryStatus) }} | |
59 | + </a-tag> | |
60 | + </span> | |
55 | 61 | </a-table> |
56 | 62 | </div> |
57 | 63 | </j-modal> |
... | ... | @@ -61,7 +67,7 @@ |
61 | 67 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
62 | 68 | import { httpAction } from '@/api/manage' |
63 | 69 | import { validateDuplicateValue } from '@/utils/util' |
64 | -import { searchMaterialByCode, getInventoryFromShipmentDetail } from '@/api/api' | |
70 | +import {searchMaterialByCode, getInventoryFromShipmentDetail, ajaxGetDictItems} from '@/api/api' | |
65 | 71 | import { listShipmentByShipmentDetailId, combination } from '@/api/api' |
66 | 72 | import { filterObj } from '@/utils/util' |
67 | 73 | import { deleteAction, getAction, downFile, getFileAccessHttpUrl } from '@/api/manage' |
... | ... | @@ -97,6 +103,7 @@ export default { |
97 | 103 | /* 数据源 */ |
98 | 104 | dataSource: [], |
99 | 105 | queryParam: {}, |
106 | + invStatus:[], | |
100 | 107 | combineParam: {}, |
101 | 108 | shipmentParam: {}, |
102 | 109 | visible: false, |
... | ... | @@ -161,8 +168,10 @@ export default { |
161 | 168 | }, |
162 | 169 | { |
163 | 170 | title: '库存状态', |
171 | + dataIndex: 'inventoryStatus', | |
164 | 172 | align: 'center', |
165 | - dataIndex: 'inventoryStatus' | |
173 | + width: 96, | |
174 | + scopedSlots: {customRender: 'inventoryStatus'} | |
166 | 175 | }, |
167 | 176 | { |
168 | 177 | title: '批次', |
... | ... | @@ -201,11 +210,19 @@ export default { |
201 | 210 | //备份model原始值 |
202 | 211 | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
203 | 212 | this.searchMaterial() |
213 | + this.loadFrom(); | |
204 | 214 | }, |
205 | 215 | methods: { |
216 | + loadFrom(){ | |
217 | + ajaxGetDictItems('inventory_status').then((res) => { | |
218 | + if (res.success) { | |
219 | + this.invStatus = res.result | |
220 | + } | |
221 | + }) | |
222 | + }, | |
206 | 223 | getSuperFieldList() { |
207 | 224 | let fieldList = [] |
208 | - fieldList.push({ type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status' }) | |
225 | + fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态',dictCode:'inventory_status'}) | |
209 | 226 | this.superFieldList = fieldList |
210 | 227 | }, |
211 | 228 | add() { |
... | ... | @@ -260,6 +277,16 @@ export default { |
260 | 277 | // }); |
261 | 278 | this.searchQuery() |
262 | 279 | }, |
280 | + solutionInvStatus(value) { | |
281 | + var actions = [] | |
282 | + Object.keys(this.invStatus).some(key => { | |
283 | + if (this.invStatus[key].value == '' + value) { | |
284 | + actions.push(this.invStatus[key].text) | |
285 | + return true | |
286 | + } | |
287 | + }) | |
288 | + return actions.join('') | |
289 | + }, | |
263 | 290 | searchQuery() { |
264 | 291 | this.loadData(1) |
265 | 292 | // 点击查询清空列表选中行 |
... | ... | @@ -355,6 +382,16 @@ export default { |
355 | 382 | handleCancel() { |
356 | 383 | this.close() |
357 | 384 | }, |
385 | + getStatusColor(status) { | |
386 | + const colors = { | |
387 | + 'good ': 'green', | |
388 | + 'defective': 'red', | |
389 | + 'discussed ': 'grey', | |
390 | + 'scrap': 'purple', | |
391 | + default: 'blue' | |
392 | + }; | |
393 | + return colors[status] || colors.default; | |
394 | + }, | |
358 | 395 | searchMaterial() { |
359 | 396 | const that = this |
360 | 397 | that.querySource.materialCode = that.model.materialCode |
... | ... |