|
|
|
|
@ -244,6 +244,7 @@ export default {
|
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
cycleOptions: [
|
|
|
|
|
{ value: '0.5', label: '每半月' },
|
|
|
|
|
{ value: '1', label: '每月' },
|
|
|
|
|
{ value: '3', label: '每季度' },
|
|
|
|
|
{ value: '6', label: '每半年' },
|
|
|
|
|
@ -264,10 +265,10 @@ export default {
|
|
|
|
|
{ label: '起始日期设定', prop: 'start_standard', minWidth: 160, formatter: row => this.startStandardOptions.find(opt => opt.value == row.start_standard)?.label || row.start_standard },
|
|
|
|
|
// { label: '生成计划时机(天)', prop: 'advance_days', minWidth: 120 },
|
|
|
|
|
// { label: '生成计划时机(天)', prop: 'advance_days', minWidth: 120 },
|
|
|
|
|
{
|
|
|
|
|
label: '已用于物资数',
|
|
|
|
|
prop: 'equipment_maintain_config_material_infos',
|
|
|
|
|
minWidth: 120,
|
|
|
|
|
{
|
|
|
|
|
label: '已用于物资数',
|
|
|
|
|
prop: 'equipment_maintain_config_material_infos',
|
|
|
|
|
minWidth: 120,
|
|
|
|
|
formatter: row => row.equipment_maintain_config_material_infos ? row.equipment_maintain_config_material_infos.length : 0
|
|
|
|
|
},
|
|
|
|
|
{ label: '未完成时下次计划', prop: 'next_plan_type', minWidth: 160, formatter: row => this.nextPlanOptions.find(opt => opt.value == row.next_plan_type)?.label || row.next_plan_type }
|
|
|
|
|
@ -324,7 +325,7 @@ export default {
|
|
|
|
|
if (!relations || relations.length === 0) {
|
|
|
|
|
return h('span', '-')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果有多个规则,每行显示一个
|
|
|
|
|
if (relations.length === 1) {
|
|
|
|
|
const rule = relations[0]
|
|
|
|
|
@ -677,7 +678,7 @@ export default {
|
|
|
|
|
// 'filter[1][op]': 'eq',
|
|
|
|
|
// 'filter[1][value]': '一物一码'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果选择了分类,添加分类筛选
|
|
|
|
|
if (this.associateFenlei) {
|
|
|
|
|
data['filter[1][key]'] = 'fenlei'
|
|
|
|
|
@ -811,7 +812,7 @@ export default {
|
|
|
|
|
if (this.selectionTimer) {
|
|
|
|
|
clearTimeout(this.selectionTimer)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.selectionTimer = setTimeout(() => {
|
|
|
|
|
this.selectedItems = selection
|
|
|
|
|
this.hasSelectedItems = selection.length > 0
|
|
|
|
|
@ -822,11 +823,11 @@ export default {
|
|
|
|
|
this.$message.warning('请先选择需要关联的物资')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.isAssociating = true
|
|
|
|
|
try {
|
|
|
|
|
let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量添加选中的物资
|
|
|
|
|
this.selectedItems.forEach(item => {
|
|
|
|
|
const existingIndex = equipment_maintain_config_material_infos.findIndex(
|
|
|
|
|
@ -839,12 +840,12 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await saveMaintainConfig({
|
|
|
|
|
id: this.currentRule.id,
|
|
|
|
|
equipment_maintain_config_material_infos: equipment_maintain_config_material_infos
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$message.success(`批量关联成功,共关联 ${this.selectedItems.length} 项物资`)
|
|
|
|
|
this.selectedItems = []
|
|
|
|
|
this.hasSelectedItems = false
|
|
|
|
|
@ -861,11 +862,11 @@ export default {
|
|
|
|
|
this.$message.warning('请先选择需要取消关联的物资')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.isDisassociating = true
|
|
|
|
|
try {
|
|
|
|
|
let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量移除选中的物资
|
|
|
|
|
this.selectedItems.forEach(item => {
|
|
|
|
|
const existingIndex = equipment_maintain_config_material_infos.findIndex(
|
|
|
|
|
@ -875,12 +876,12 @@ export default {
|
|
|
|
|
equipment_maintain_config_material_infos.splice(existingIndex, 1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await saveMaintainConfig({
|
|
|
|
|
id: this.currentRule.id,
|
|
|
|
|
equipment_maintain_config_material_infos: equipment_maintain_config_material_infos
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$message.success(`批量取消关联成功,共取消关联 ${this.selectedItems.length} 项物资`)
|
|
|
|
|
this.selectedItems = []
|
|
|
|
|
this.hasSelectedItems = false
|
|
|
|
|
|