肖超群
authored
about a year ago
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
},
data() {
return {
zoneList: [],
zoneOptions: [],
companyList: [],
firstLoad:0,
description: '库存详情管理页面',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'物料编码',
align:"center",
dataIndex: 'materialCode'
},
{
title:'物料名称',
align:"center",
dataIndex: 'materialName'
},
{
title:'物料规格',
align:"center",
dataIndex: 'materialSpec'
},
{
title:'物料单位',
align:"center",
dataIndex: 'materialUnit'
},
{
title:'单据数量',
align:"center",
dataIndex: 'qty'
},
{
title:'合格数量',
align:"center",
dataIndex: 'qualityfiedQty'
},
{
title:'不合格数量',
align:"center",
dataIndex: 'unqualityfiedQty'
},
{
title:'不合格原因',
align:"center",
dataIndex: 'remark'
},
// {
// title:'批次',
// align:"center",
// dataIndex: 'batch'
// },
// {
// title:'批号',
// align:"center",
// dataIndex: 'lot'
// },
// {
// title:'项目号',
// align:"center",
// dataIndex: 'project'
// },
// {
// title:'单据状态',
// align:"center",
// dataIndex: 'status_dictText'
// },
// {
// title:'上游单号',
// align:"center",
// dataIndex: 'referCode'
// },
// {
// title:'上游行号',
// align:"center",
// dataIndex: 'referLineNum'
// },
{
title:'创建人',
align:"center",
dataIndex: 'createBy'
},
{
title:'创建日期',
align:"center",
dataIndex: 'createTime'
},
{
title:'更新人',
align:"center",
dataIndex: 'updateBy'
},
{
title:'更新日期',
align:"center",
dataIndex: 'updateTime'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/receipt/qualityDetail/list',
delete: '/receipt/qualityDetail/delete',
deleteBatch: '/receipt/qualityDetail/deleteBatch',
exportXlsUrl: '/receipt/qualityDetail/exportXls',
importExcelUrl: 'receipt/qualityDetail/importExcel',
},
dictOptions: {},
superFieldList: [],
selectRecord: [],
}
},
created() {
this.loadFrom()
this.getSuperFieldList()
},
mounted() {
if(this.firstLoad == 0) {
this.firstLoad = 1;
return;
}
//页面没加载完,此时methods里的方法找不到,使用定时器模拟点击
let timeSearch=setInterval(()=>{
let eleSearch= document.getElementById("search");
if (eleSearch!=null){
//调用成功,清除定时器
clearInterval(timeSearch)
eleSearch.click();
}
},200)
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
},
methods: {
getStatusColor(status) {
const colors = {
'良品': 'green',
'报废品': 'purple',
'待确认 ': 'grey',
'次品': 'red',
'锁定': 'red',
'冻结': 'red',
default: 'blue'
};
return colors[status] || colors.default;
},
loadFrom() {
getZoneList().then((res) => {
if (res.success) {
this.zoneList = res.result
//延迟半秒执行,避免组件未加载完,数据已经加载完
setTimeout(() => {
//slice可以在数组的任何位置进行删除/添加操作
this.zoneOptions.splice(0, 1);
for (let i = 0; i < res.result.length; i++) {
this.zoneOptions.push({value: res.result[i].code, text: res.result[i].name})
}
}, 500)
}
});
getCompanyList().then(res => {
if (res.success) {
this.companyList = res.result
}
})
},
initDictConfig() {
},
getSuperFieldList() {
let fieldList = []
fieldList.push({type: 'string', value: 'companyCode', text: '货主', dictCode: ''})
fieldList.push({type: 'string', value: 'zoneCode', text: '库区', dictCode: ''})
fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''})
fieldList.push({type: 'string', value: 'locationCode', text: '库位编码', dictCode: ''})
fieldList.push({type: 'string', value: 'materialCode', text: '物料编码', dictCode: ''})
fieldList.push({type: 'string', value: 'materialName', text: '物料名称', dictCode: ''})
fieldList.push({type: 'string', value: 'materialSpec', text: '物料规格', dictCode: ''})
fieldList.push({type: 'string', value: 'materialUnit', text: '物料单位', dictCode: ''})
fieldList.push({type: 'BigDecimal', value: 'qty', text: '数量', dictCode: ''})
fieldList.push({type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: ''})
fieldList.push({type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status'})
fieldList.push({type: 'int', value: 'enable', text: '可用状态', dictCode: 'inventory_enable'})
fieldList.push({type: 'string', value: 'batch', text: '批次', dictCode: ''})
// fieldList.push({type:'string',value:'sn',text:'序列号',dictCode:''})
fieldList.push({type: 'datetime', value: 'receiptDate', text: '入库日期'})
fieldList.push({type: 'int', value: 'inventoryAge', text: '库龄(天)', dictCode: ''})
fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''})
fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'})
fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''})
fieldList.push({type: 'datetime', value: 'updateTime', text: '更新日期'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>