@@ -1398,11 +1398,19 @@ export default {
{
title: '物资名称',
key: 'zichanmingcheng',
- width: 110,
+ width: 120,
render: (h, params) => {
return h('span', params.row.inventory ? params.row.inventory.zichanmingcheng : '-')
}
},
+ {
+ title: '入库批次-顺序号',
+ key: 'rukupici',
+ width: 160,
+ render: (h, params) => {
+ return h('span', params.row.inventory ? params.row.inventory.rukupici + '-' + params.row.inventory.shunxuhao : '-')
+ }
+ },
{
title: '物资型号',
key: 'guigexinghao',
@@ -1475,7 +1483,7 @@ export default {
{
title: '备注',
key: 'remark',
- width: 120,
+ // width: 120,
tooltip: true
}
],
@@ -2273,19 +2281,13 @@ export default {
this.previewUrl = ''
},
getPlanProgress(row) {
- // 根据状态值判断进度
- const status = row.status
- if (status === 0) {
- // 未开始
+ // 根据 material_infos_plan_links 数组中 status=1 的条数计算进度
+ if (!row.material_infos_plan_links || !Array.isArray(row.material_infos_plan_links) || row.material_infos_plan_links.length === 0) {
return 0
- } else if (status === 1) {
- // 进行中
- return 50
- } else if (status === 2) {
- // 已完成
- return 100
}
- return 0
+ const totalCount = row.material_infos_plan_links.length
+ const completedCount = row.material_infos_plan_links.filter(item => item.status === 1).length
+ return Math.round((completedCount / totalCount) * 100)
},
viewPlanDetail(row) {
this.planDetailModal.visible = true
@@ -2366,7 +2368,25 @@ export default {
const res = await getStocktakingPlanLinkList(qs.stringify(params))
if (res && res.list) {
- this.summaryModal.inventoryList = res.list.data || []
+ const list = res.list.data || []
+ // 对数据进行排序:盘点数量和原库存数量不同的排在前面
+ list.sort((a, b) => {
+ // 判断 a 是否不同
+ const aQuantity = a.check_num || '-'
+ const aOriginalQuantity = a.inventory?.chushishuliang
+ const aIsDifferent = (aOriginalQuantity == null || aOriginalQuantity === '') || (aOriginalQuantity != null && String(aQuantity) !== String(aOriginalQuantity))
+
+ // 判断 b 是否不同
+ const bQuantity = b.check_num || '-'
+ const bOriginalQuantity = b.inventory?.chushishuliang
+ const bIsDifferent = (bOriginalQuantity == null || bOriginalQuantity === '') || (bOriginalQuantity != null && String(bQuantity) !== String(bOriginalQuantity))
+
+ // 不同的排在前面(返回负数表示 a 排在前面,正数表示 b 排在前面)
+ if (aIsDifferent && !bIsDifferent) return -1
+ if (!aIsDifferent && bIsDifferent) return 1
+ return 0
+ })
+ this.summaryModal.inventoryList = list
}
} catch (e) {
this.$Message.error('获取盘点物资列表失败')
diff --git a/src/views/maintenance/maintenance_records.vue b/src/views/maintenance/maintenance_records.vue
index faafc09..2650832 100644
--- a/src/views/maintenance/maintenance_records.vue
+++ b/src/views/maintenance/maintenance_records.vue
@@ -34,14 +34,26 @@
-
+
+ 截止日期:
+
+ -
+
+
关键词:
-
+
+
+
+ 运维内容:
+
+
+
+
+
+
+
-
-
-
-
@@ -452,7 +464,10 @@ export default {
is_expire:'',
date_start: '',
date_end: '',
- keyword: ''
+ end_date_start:'',
+ end_date_end:'',
+ keyword: '',
+ content: ''
},
stats: {
total: 0,
@@ -703,13 +718,18 @@ export default {
value:this.select.status?this.select.status:(this.select.status===0?0:'')
},{
'key':'planned_maintenance_date',
- op:'eq',
- value:this.select.date_start?this.formatDate(this.select.date_start):''
+ op:'range',
+ value:this.select.date_start?this.formatDate(this.select.date_start)+','+this.formatDate(this.select.date_end):''
},{
- 'key':'maintenance_date',
- op:'eq',
- value:this.select.date_end?this.formatDate(this.select.date_end):''
- }],
+ 'key':'end_date',
+ op:'range',
+ value:this.select.end_date_start?this.formatDate(this.select.end_date_start)+','+this.formatDate(this.select.end_date_end):''
+ },{
+ 'key':'content',
+ op:'like',
+ value:this.select.content?this.select.content:''
+ }
+ ],
//
}
const res = await getOperationList(params)
@@ -1196,9 +1216,6 @@ export default {
"export_fields[status_text]" : "状态",
is_export:1,
// warehouse: this.select.warehouse,
- // status: this.select.status,
- // date_start: this.select.date_start,
- date_end: this.select.date_end,
keyword: this.select.keyword,
filter:[{
'key':'status',
@@ -1210,8 +1227,12 @@ export default {
value:this.select.date_start?this.formatDate(this.select.date_start):''
},{
'key':'maintenance_date',
- op:'eq',
- value:this.select.date_end?this.formatDate(this.select.date_end):''
+ op:'range',
+ value:this.select.end_date_start?this.formatDate(this.select.end_date_start)+','+this.formatDate(this.select.end_date_end):''
+ },{
+ 'key':'content',
+ op:'like',
+ value:this.select.content?this.select.content:''
}],
//
}