master
lion 4 months ago
parent a8bbdde89c
commit bb09cd7dac

@ -244,6 +244,7 @@ export default {
total: 0, total: 0,
list: [], list: [],
cycleOptions: [ cycleOptions: [
{ value: '0.5', label: '每半月' },
{ value: '1', label: '每月' }, { value: '1', label: '每月' },
{ value: '3', label: '每季度' }, { value: '3', label: '每季度' },
{ value: '6', 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: '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: 'advance_days', minWidth: 120 }, // { label: '()', prop: 'advance_days', minWidth: 120 },
{ {
label: '已用于物资数', label: '已用于物资数',
prop: 'equipment_maintain_config_material_infos', prop: 'equipment_maintain_config_material_infos',
minWidth: 120, minWidth: 120,
formatter: row => row.equipment_maintain_config_material_infos ? row.equipment_maintain_config_material_infos.length : 0 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 } { 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) { if (!relations || relations.length === 0) {
return h('span', '-') return h('span', '-')
} }
// //
if (relations.length === 1) { if (relations.length === 1) {
const rule = relations[0] const rule = relations[0]
@ -677,7 +678,7 @@ export default {
// 'filter[1][op]': 'eq', // 'filter[1][op]': 'eq',
// 'filter[1][value]': '' // 'filter[1][value]': ''
} }
// //
if (this.associateFenlei) { if (this.associateFenlei) {
data['filter[1][key]'] = 'fenlei' data['filter[1][key]'] = 'fenlei'
@ -811,7 +812,7 @@ export default {
if (this.selectionTimer) { if (this.selectionTimer) {
clearTimeout(this.selectionTimer) clearTimeout(this.selectionTimer)
} }
this.selectionTimer = setTimeout(() => { this.selectionTimer = setTimeout(() => {
this.selectedItems = selection this.selectedItems = selection
this.hasSelectedItems = selection.length > 0 this.hasSelectedItems = selection.length > 0
@ -822,11 +823,11 @@ export default {
this.$message.warning('请先选择需要关联的物资') this.$message.warning('请先选择需要关联的物资')
return return
} }
this.isAssociating = true this.isAssociating = true
try { try {
let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])] let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])]
// //
this.selectedItems.forEach(item => { this.selectedItems.forEach(item => {
const existingIndex = equipment_maintain_config_material_infos.findIndex( const existingIndex = equipment_maintain_config_material_infos.findIndex(
@ -839,12 +840,12 @@ export default {
}) })
} }
}) })
await saveMaintainConfig({ await saveMaintainConfig({
id: this.currentRule.id, id: this.currentRule.id,
equipment_maintain_config_material_infos: equipment_maintain_config_material_infos equipment_maintain_config_material_infos: equipment_maintain_config_material_infos
}) })
this.$message.success(`批量关联成功,共关联 ${this.selectedItems.length} 项物资`) this.$message.success(`批量关联成功,共关联 ${this.selectedItems.length} 项物资`)
this.selectedItems = [] this.selectedItems = []
this.hasSelectedItems = false this.hasSelectedItems = false
@ -861,11 +862,11 @@ export default {
this.$message.warning('请先选择需要取消关联的物资') this.$message.warning('请先选择需要取消关联的物资')
return return
} }
this.isDisassociating = true this.isDisassociating = true
try { try {
let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])] let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])]
// //
this.selectedItems.forEach(item => { this.selectedItems.forEach(item => {
const existingIndex = equipment_maintain_config_material_infos.findIndex( const existingIndex = equipment_maintain_config_material_infos.findIndex(
@ -875,12 +876,12 @@ export default {
equipment_maintain_config_material_infos.splice(existingIndex, 1) equipment_maintain_config_material_infos.splice(existingIndex, 1)
} }
}) })
await saveMaintainConfig({ await saveMaintainConfig({
id: this.currentRule.id, id: this.currentRule.id,
equipment_maintain_config_material_infos: equipment_maintain_config_material_infos equipment_maintain_config_material_infos: equipment_maintain_config_material_infos
}) })
this.$message.success(`批量取消关联成功,共取消关联 ${this.selectedItems.length} 项物资`) this.$message.success(`批量取消关联成功,共取消关联 ${this.selectedItems.length} 项物资`)
this.selectedItems = [] this.selectedItems = []
this.hasSelectedItems = false this.hasSelectedItems = false

Loading…
Cancel
Save