fix:修改设备告警 能源告警字段 对接 能碳告警

This commit is contained in:
zhaohy
2024-07-24 15:13:50 +08:00
parent 9134cf4ac3
commit 9637a6f13b
10 changed files with 93 additions and 59 deletions

View File

@@ -64,7 +64,7 @@
const visible = ref(false);
const showEdit = ref(true);
const infoObject = ref({});
const equipmentAlarm = ref({});
const energyAlarm = ref({});
const stateOptions = ref();
const logList = ref([]);
const config = ref({
@@ -73,19 +73,19 @@
});
const handleClose = () => {
showEdit.value = true;
equipmentAlarm.value = {};
energyAlarm.value = {};
infoObject.value = {};
visible.value = false;
};
const btnClick = () => {
delete infoObject.value.createTime;
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
if (equipmentAlarm.value.createWorkOrder === 0) {
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
if (energyAlarm.value.createWorkOrder === 0) {
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
if (res.msg === 'success') {
NsMessage.success('操作成功');
showEdit.value = true;
equipmentAlarm.value = {};
energyAlarm.value = {};
infoObject.value = {};
visible.value = false;
emit('logAdd', null);
@@ -96,14 +96,14 @@
//修改状态
const changeShowEdit = () => {
// 未生成工单
if (equipmentAlarm.value.createWorkOrder === 0) {
if (energyAlarm.value.createWorkOrder === 0) {
showEdit.value = !showEdit.value;
}
};
const toggle = async (data) => {
equipmentAlarm.value = { ...data };
energyAlarm.value = { ...data };
visible.value = true;
if (equipmentAlarm.value.createWorkOrder === 1) {
if (energyAlarm.value.createWorkOrder === 1) {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
@@ -121,8 +121,8 @@
}
console.log(data, 'data');
await http
.post(energyAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
alarmEquipmentLogId: data.id,
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
alarmEnergyConsumptionLogId: data.id,
})
.then((res) => {
if (res.msg === 'success') {
@@ -149,7 +149,7 @@
infoObject,
changeShowEdit,
showEdit,
equipmentAlarm,
energyAlarm,
stateOptions,
btnClick,
visible,