Commit 474d0900 authored by liuzhaoh's avatar liuzhaoh

处理原因分析字段添加

parent d5a0e74b
......@@ -140,6 +140,14 @@
popper-class="date-picker-popper"
/>
</el-form-item>
<el-form-item label="原因分类" prop="reasonCategory">
<el-select v-model="equSubmitInfo.reasonCategory" style="width: 220px;">
<el-option v-for="item in reasonCategoryList" :key="item.key" :value="item.key" :label="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="原因描述" prop="reasonDescription" style="padding-left: 10px;">
<el-input v-model="equSubmitInfo.reasonDescription" type="textarea" style="width: 220px;"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -161,6 +169,7 @@ import CommonTable from "@/components/commonTable/index.vue";
import { useRoute, useRouter } from "vue-router";
import { getDataFun, postDataJSON } from "@/request/method.js";
import moment from "moment";
import { ElMessage } from "element-plus";
const router = useRouter();
const route = useRoute();
......@@ -244,6 +253,7 @@ const rules = {
message: "请填写结束时间",
},
],
reasonCategory: [{ required: true, message: "请选择原因分类", trigger: "blur" }],
};
const tableData = reactive({
......@@ -341,6 +351,8 @@ const equSubmitInfo = ref({
noAlarm: "0",
startTime: "",
endTime: "",
reasonCategory: "", // 原因分类
reasonDescription: "", // 原因描述
});
const equPending = async (formEl) => {
......@@ -359,6 +371,8 @@ const equPending = async (formEl) => {
"YYYY-MM-DD HH:mm:ss"
)
: "",
reasonCategory: equSubmitInfo.value.reasonCategory, // 原因分类
reasonDescription: equSubmitInfo.value.reasonDescription, // 原因描述
};
await formEl.validate((valid, fields) => {
if (valid) {
......@@ -367,12 +381,30 @@ const equPending = async (formEl) => {
equDialog.value = false;
getAlarmList();
}
});
ElMessage.success(res && res.data);
}).catch((err) => {
ElMessage.error(res && res.data);
})
;
} else {
}
});
};
// 原因分类
const reasonCategoryList = ref([])
const getReasonCategoryList = () => {
const url = '/alarm/reasonCategoryEnumList'
const params = {}
getDataFun(url, params).then(res => {
if (res && res.code == 1) {
reasonCategoryList.value = res.data
}
}).catch(err => {
})
}
onMounted(async () => {
if (route.query) {
const { deviceName, suspendStartTime, suspendEndTime, suspendFlag } =
......@@ -393,6 +425,7 @@ onMounted(async () => {
getTypeList();
getAlarmList();
getReasonCategoryList();
});
onBeforeUnmount(() => {});
......
......@@ -86,7 +86,7 @@ const router = useRouter();
const formInline = ref({
projectId: "",
deviceType: "",
reasonCategory: "",
reasonCategory: -1,
});
const currentPage = ref(1);
......@@ -207,15 +207,20 @@ const getTypeList = () => {
};
const reasonList = reactive({
list: [],
list: [
{ value: "全部", key: -1 },
],
});
const getReasonList = () => {
const url = "/alarm/reasonCategoryEnumList";
return getDataFun(url, "").then((res) => {
if (res && res.data) {
reasonList.list = res.data || [];
reasonList.list.push(...res.data);
}
}).catch(err => {
reasonList.list = [{ value: "全部", key: null }];
throw err;
});
};
......@@ -239,7 +244,7 @@ const pageRef = ref(null);
const onReset = () => {
formInline.value = {
deviceType: "",
reasonCategory: "",
reasonCategory: -1,
projectId: "",
};
currentPage.value = 1;
......@@ -253,7 +258,7 @@ const getManagementList = () => {
const url = "/alarm/getSuspendDeviceListPage";
const params = {
deviceType: formInline.value.deviceType,
reasonCategory: formInline.value.reasonCategory,
reasonCategory: formInline.value.reasonCategory == -1 ? null : formInline.value.reasonCategory,
projectId: formInline.value.projectId,
pageNo: currentPage.value,
pageSize: pageSize.value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment