隐患清单排查状态变更

pull/1/head
dearlin 2024-02-04 11:42:56 +08:00
parent ecf918bc38
commit 2dfe2e9ee7
3 changed files with 78 additions and 55 deletions

View File

@ -2,6 +2,11 @@
<el-dialog v-model="visible" title="检查照片" :on-close="fnClose">
<el-form ref="formRef" :model="form" label-width="100px">
<el-row>
<el-col v-if="writeresults" :span="24">
<el-form-item label="检查结果" prop="CHECK_RESULT">
<el-input v-model="form.CHECK_RESULT" placeholder="请输入检查结果" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="检查照片" prop="file">
<layout-upload
@ -46,8 +51,18 @@ const props = defineProps({
required: true,
default: "",
},
writeresults: {
type: Boolean,
required: false,
default: false,
},
index: {
type: Number,
required: false,
default: 0,
},
});
const emits = defineEmits(["update:visible", "update:form"]);
const emits = defineEmits(["update:visible", "update:form", "submit"]);
const { visible, form } = useVModels(props, emits);
const formRef = ref(null);
const fnClose = () => {
@ -65,6 +80,7 @@ const fnSubmit = debounce(
formData.append("FOREIGN_KEY", props.id);
formData.append("TYPE", 14);
await setUploadImg(formData);
emits("submit", form.value.CHECK_RESULT, props.index);
fnClose();
ElMessage.success("保存成功");
},

View File

@ -97,7 +97,7 @@ const fnSubmit = debounce(
if (props.hiddenType === "unqualified") {
if (!props.longitude && !props.latitude) {
ElMessage.error("正在获取当前位置中,请等待");
return;
// return;
}
params = {
...params,
@ -144,7 +144,7 @@ const fnSubmit = debounce(
if (form.value.rectifyImgs[i].raw)
await fnUploadImage(currentHiddenId, form.value.rectifyImgs[i].raw, 4);
}
emits("submit", currentHiddenId);
emits("submit", currentHiddenId, form.value.HIDDENDESCR);
ElMessage.success("保存成功");
fnClose();
},

View File

@ -44,16 +44,8 @@
<el-table-column prop="CHECK_RESULT" label="检查结果" />
<el-table-column label="操作" width="280">
<template v-slot="{ row, $index }">
<el-radio-group
v-if="data.canDoCheck"
:disabled="row.HASHIDDEN > 0"
v-model="row.ISNORMAL"
>
<el-radio
:label="0"
:disabled="!data.canDoCheck"
@click.prevent="fnQualified($index, row)"
>
<el-radio-group :disabled="row.HASHIDDEN > 0" v-model="row.ISNORMAL">
<el-radio :label="0" @click.prevent="fnQualified($index, row)">
合格
<el-tooltip
content="注意:补录时,不允许添加隐患"
@ -63,18 +55,10 @@
<el-icon><warning-filled /></el-icon>
</el-tooltip>
</el-radio>
<el-radio
:label="1"
:disabled="entrance === 'supplementaryRecording'"
@click.prevent="fnUnqualified($index, row)"
>
<el-radio :label="1" @click.prevent="fnUnqualified($index, row)">
不合格
</el-radio>
<el-radio
:label="2"
:disabled="entrance === 'supplementaryRecording'"
@click.prevent="fnNotInvolved($index, row)"
>
<el-radio :label="2" @click.prevent="fnNotInvolved($index, row)">
不涉及
</el-radio>
</el-radio-group>
@ -83,15 +67,9 @@
</layout-table>
<el-divider content-position="left">其他隐患</el-divider>
<div class="tr mb-10">
<el-button
v-if="data.canDoCheck"
type="primary"
@click="fnAddOrEditOtherHidden({}, 'add')"
:disabled="entrance === 'supplementaryRecording'"
>
<el-button type="primary" @click="fnAddOrEditOtherHidden({}, 'add')">
添加
</el-button>
<el-button disabled v-else type="primary">添加</el-button>
</div>
<layout-table :data="otherHiddenList" :show-pagination="false">
<el-table-column label="序号" width="70" type="index" />
@ -100,7 +78,6 @@
<template v-slot="{ row }">
<el-button
type="primary"
:disabled="data.canDoCheck"
text
link
@click="fnAddOrEditOtherHidden(row, 'edit')"
@ -109,7 +86,6 @@
</el-button>
<el-button
type="primary"
:disabled="data.canDoCheck"
text
link
@click="fnDeleteOtherHidden(row.HIDDEN_ID)"
@ -228,26 +204,27 @@
</el-row>
</el-form>
<div class="tc mt-10">
<el-button :disabled="!data.canDoCheck" type="primary" @click="fnSubmit"
>保存</el-button
>
<el-button type="primary" @click="fnSubmit"></el-button>
</div>
<qualified
v-model:visible="data.qualifiedDialog.visible"
v-model:form="data.qualifiedDialog.form"
:id="data.qualifiedDialog.RECORDITEM_ID"
:index="data.qualifiedDialog.index"
:writeresults="data.qualifiedDialog.writeresults"
@submit="fnResultsSubmit"
/>
<un-qualified
v-model:visible="data.unQualifiedDialog.visible"
v-model:form="data.unQualifiedDialog.form"
:list-manager-id="ID"
:type="data.unQualifiedDialog.type"
:hidden-type="data.unQualifiedDialog.hiddenType"
:info="{ ...data.unQualifiedDialog.info, ...info.value }"
:longitude="data.longitude"
:latitude="data.latitude"
@submit="fnHiddenSubmit"
/>
<!-- <un-qualified-->
<!-- v-model:visible="data.unQualifiedDialog.visible"-->
<!-- v-model:form="data.unQualifiedDialog.form"-->
<!-- :type="data.unQualifiedDialog.type"-->
<!-- :hidden-type="data.unQualifiedDialog.hiddenType"-->
<!-- :custom-id="CUSTOM_ID"-->
<!-- :info="{ ...data.unQualifiedDialog.info, ...info.value }"-->
<!-- :longitude="data.longitude"-->
<!-- :latitude="data.latitude"-->
<!-- @submit="fnHiddenSubmit"-->
<!-- />-->
</layout-card>
</template>
@ -264,6 +241,8 @@ import {
import { useRoute, useRouter } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import LayoutDepartment from "@/components/department/index.vue";
import UnQualified from "./components/un_qualified.vue";
import {
addingPrefixToFile,
getFileSuffix,
@ -298,8 +277,6 @@ const info = ref({});
const data = reactive({
longitude: 0,
latitude: 0,
//
canDoCheck: true,
form: {
CHECK_TIME: "",
REASON: "",
@ -307,6 +284,8 @@ const data = reactive({
},
qualifiedDialog: {
visible: false,
writeresults: false,
index: 0,
RECORDITEM_ID: "",
form: { file: [] },
},
@ -338,11 +317,8 @@ const { list: inspectionList } = useListData(getCheckStandardManagementView, {
usePagination: false,
callbackFn: (list, resData) => {
for (let i = 0; i < list.length; i++) {
if (list[i].HASHIDDEN <= 0) list[i].ISNORMAL = 0;
if (list[i].ELECTRONIC_FENCE_ID) {
//
data.canDoCheck = false;
}
list[i].CHECK_RESULT = "不涉及";
if (list[i].HASHIDDEN <= 0) list[i].ISNORMAL = 2;
}
info.value = resData.pd;
},
@ -368,6 +344,24 @@ onMounted(() => {
data.latitude = r.latitude;
});
});
const fnResultsSubmit = (CHECK_RESULT, index) => {
inspectionList.value[index].CHECK_RESULT = CHECK_RESULT;
};
const fnHiddenSubmit = (currentHiddenId, HIDDENDESCR) => {
const { hiddenType, index } = data.unQualifiedDialog;
if (hiddenType === "unqualified") {
inspectionList.value[index].ISNORMAL = 1;
inspectionList.value[index].HIDDEN_ID = currentHiddenId;
inspectionList.value[index].CHECK_RESULT = HIDDENDESCR;
inspectionList.value[index].CHECK_UNQUALIFIED = HIDDENDESCR;
nextTick();
}
if (hiddenType === "otherHidden") {
fnGetOtherHidden();
}
};
const fnDisabledDate = (time) => {
if (DATEEND && DATESTART)
return (
@ -376,10 +370,20 @@ const fnDisabledDate = (time) => {
);
else return false;
};
//
const fnQualified = async (index, row) => {
row.CHECK_RESULT = row.CHECK_QUALIFIED;
if (row.HASHIDDEN > 0) return;
// OPERATION_TYPE 1 2
if (row.OPERATION_TYPE === 1) {
row.CHECK_RESULT = row.CHECK_QUALIFIED;
data.qualifiedDialog.writeresults = false;
} else {
data.qualifiedDialog.writeresults = true;
data.qualifiedDialog.form.CHECK_RESULT =
row.CHECK_RESULT !== "不涉及" ? row.CHECK_RESULT : "";
}
data.qualifiedDialog.visible = true;
data.qualifiedDialog.index = index;
await nextTick();
data.qualifiedDialog.RECORDITEM_ID = row.RECORDITEM_ID;
if (row.ISNORMAL === 1) fnRemoveUnqualified(index);
@ -392,16 +396,18 @@ const fnQualified = async (index, row) => {
}
inspectionList.value[index].ISNORMAL = 0;
};
//
const fnNotInvolved = (index, row) => {
if (row.HASHIDDEN > 0 || props.entrance === "supplementaryRecording") return;
fnRemoveUnqualified(index);
inspectionList.value[index].ISNORMAL = 2;
row.CHECK_RESULT = "不涉及";
};
const fnRemoveUnqualified = (index) => {
inspectionList.value[index].HIDDEN_ID = "";
};
const fnUnqualified = async (index, row) => {
if (row.HASHIDDEN > 0 || props.entrance === "supplementaryRecording") return;
if (row.HASHIDDEN > 0) return;
data.unQualifiedDialog.visible = true;
await nextTick();
if (
@ -414,6 +420,7 @@ const fnUnqualified = async (index, row) => {
await fnGetHiddenDangerView(inspectionList.value[index].HIDDEN_ID);
}
data.unQualifiedDialog.info = row;
data.unQualifiedDialog.form.HIDDENDESCR = row.CHECK_UNQUALIFIED;
data.unQualifiedDialog.index = index;
data.unQualifiedDialog.hiddenType = "unqualified";
};