|
|
@ -11,7 +11,7 @@ |
|
|
|
<a-tabs> |
|
|
|
<a-tab-pane key="1" tab="更新状态"> |
|
|
|
<div style="width: 100%; padding: 24px"> |
|
|
|
<a-form ref="formRef" :model="infoObject"> |
|
|
|
<a-form ref="formRef" :model="infoObject" :rules="rules"> |
|
|
|
<a-form-item ref="state" label="当前状态" name="state"> |
|
|
|
<a-select |
|
|
|
v-model:value="infoObject.state" |
|
|
@ -67,17 +67,38 @@ |
|
|
|
const energyAlarm = ref({}); |
|
|
|
const stateOptions = ref(); |
|
|
|
const logList = ref([]); |
|
|
|
const formRef = ref(); |
|
|
|
const config = ref({ |
|
|
|
size: logList.value.length, |
|
|
|
dataSource: logList.value, |
|
|
|
}); |
|
|
|
// 表单校验 |
|
|
|
const rules = { |
|
|
|
remarks: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: '请输入备注', |
|
|
|
trigger: 'change', |
|
|
|
validator: (rules, remarks, cbfn) => { |
|
|
|
if (remarks && remarks.trim() !== '') { |
|
|
|
cbfn(); |
|
|
|
} else { |
|
|
|
cbfn('备注不能为空'); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
state: [{ required: true, message: '请选择当前状态', trigger: 'change' }], |
|
|
|
}; |
|
|
|
const handleClose = () => { |
|
|
|
showEdit.value = true; |
|
|
|
energyAlarm.value = {}; |
|
|
|
infoObject.value = {}; |
|
|
|
visible.value = false; |
|
|
|
config.value.dataSource = []; |
|
|
|
}; |
|
|
|
const btnClick = () => { |
|
|
|
formRef.value.validate().then(() => { |
|
|
|
delete infoObject.value.createTime; |
|
|
|
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id; |
|
|
|
if (energyAlarm.value.createWorkOrder === 0) { |
|
|
@ -92,6 +113,7 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
//修改状态 |
|
|
|
const changeShowEdit = () => { |
|
|
@ -119,7 +141,6 @@ |
|
|
|
{ value: 5, label: '已关闭' }, |
|
|
|
]; |
|
|
|
} |
|
|
|
console.log(data, 'data'); |
|
|
|
await http |
|
|
|
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, { |
|
|
|
alarmEnergyConsumptionLogId: data.id, |
|
|
@ -149,6 +170,8 @@ |
|
|
|
infoObject, |
|
|
|
changeShowEdit, |
|
|
|
showEdit, |
|
|
|
rules, |
|
|
|
formRef, |
|
|
|
energyAlarm, |
|
|
|
stateOptions, |
|
|
|
btnClick, |
|
|
|