forked from integrated_whb/integrated_whb_vue
BUG优化 人员类型不显示
parent
328200bfa6
commit
7c7f5fda26
|
@ -186,6 +186,7 @@ const data = reactive({
|
|||
const fnGetData = async () => {
|
||||
const resData = await getSafetyDrivingLogView({ WAYBILLREGISTRATION_ID });
|
||||
data.info = resData.pd;
|
||||
console.log(data.info);
|
||||
data.commitmentList = resData.commitmentList;
|
||||
};
|
||||
fnGetData();
|
||||
|
|
|
@ -0,0 +1,636 @@
|
|||
<template>
|
||||
<layout-card>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="data.form"
|
||||
:rules="rules"
|
||||
label-width="175px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-divider content-position="left">事故人员信息</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="事故人员" prop="USER_ID">
|
||||
<el-select v-model="data.form.USER_ID" placeholder="请选择事故人员">
|
||||
<el-option
|
||||
v-for="item in data.unitsList"
|
||||
:key="item.USER_ID"
|
||||
:label="item.NAME"
|
||||
:value="item.USER_ID"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="人员性别" prop="GENDER">
|
||||
<el-select v-model="data.form.GENDER" placeholder="请选择人员性别">
|
||||
<el-option label="男" :value="'1'" />
|
||||
<el-option label="女" :value="'0'" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="人员年龄" prop="AGE">
|
||||
<el-input v-model="data.form.AGE" placeholder="请输入人员年龄" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="文化水平" prop="EDUCATIONALLEVEL">
|
||||
<el-select
|
||||
v-model="data.form.EDUCATIONALLEVEL"
|
||||
placeholder="请选择文化水平"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in EDUCATIONALMENU"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="工作部门" prop="CORP_NAME">
|
||||
<el-input
|
||||
v-model="data.form.CORP_NAME"
|
||||
placeholder="请输入工作部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="员工工种" prop="JOBTYPE">
|
||||
<el-input
|
||||
v-model="data.form.JOBTYPE"
|
||||
placeholder="请输入员工工种"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="ENTRYDATE" label="入职日期">
|
||||
<el-date-picker
|
||||
v-model="data.form.ENTRYDATE"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-divider content-position="left">事故调查</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="ACCIDENTDATE" label="事故日期">
|
||||
<el-date-picker
|
||||
v-model="data.form.ACCIDENTDATE"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="事故位置" prop="ACCIDENTLOCATION">
|
||||
<el-input
|
||||
v-model="data.form.ACCIDENTLOCATION"
|
||||
placeholder="请输入事故位置"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="受伤部位" prop="INJUREDPART">
|
||||
<el-input
|
||||
v-model="data.form.INJUREDPART"
|
||||
placeholder="请输入受伤部位"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="持证情况" prop="CERTIFICATIONSTATUS">
|
||||
<el-input
|
||||
v-model="data.form.CERTIFICATIONSTATUS"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入持证情况"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="教育情况" prop="EDUCATIONSITUATION">
|
||||
<el-input
|
||||
v-model="data.form.EDUCATIONSITUATION"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入教育情况"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="故事描述" prop="ACCIDENTDESCRIPTION">
|
||||
<el-input
|
||||
v-model="data.form.ACCIDENTDESCRIPTION"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入故事描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="事故性质" prop="ACCIDENTNATURE">
|
||||
<el-select
|
||||
v-model="data.form.ACCIDENTNATURE"
|
||||
placeholder="请选择事故性质"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in ACCIDENTNATUREMENU"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="当事人" prop="PARTY">
|
||||
<el-input v-model="data.form.PARTY" placeholder="请输入当事人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="CONFIRMATIONTIME" label="确认时间">
|
||||
<el-date-picker
|
||||
v-model="data.form.CONFIRMATIONTIME"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-divider content-position="left">事故分析</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="故事分析" prop="ACCIDENTANALYSIS">
|
||||
<el-input
|
||||
v-model="data.form.ACCIDENTANALYSIS"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入故事分析"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="惩罚意见" prop="PUNISHMENTOPINION">
|
||||
<el-input
|
||||
v-model="data.form.PUNISHMENTOPINION"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入惩罚意见"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="责任人" prop="RESPONSIBLEPERSON">
|
||||
<el-input
|
||||
v-model="data.form.RESPONSIBLEPERSON"
|
||||
placeholder="请输入责任人"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="次要责任人" prop="SECONDARYRESPONSIBLEPERSON">
|
||||
<el-input
|
||||
v-model="data.form.SECONDARYRESPONSIBLEPERSON"
|
||||
placeholder="请输入次要责任人"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-divider content-position="left">整改措施</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="防范措施" prop="PREVENTIVEMEASURES">
|
||||
<el-input
|
||||
v-model="data.form.PREVENTIVEMEASURES"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入防范措施"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="完成情况" prop="COMPLETIONSTATUS">
|
||||
<el-input
|
||||
v-model="data.form.COMPLETIONSTATUS"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入完成情况"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item
|
||||
label="整改责任人"
|
||||
prop="RECTIFICATIONRESPONSIBLEPERSON"
|
||||
>
|
||||
<el-input
|
||||
v-model="data.form.RECTIFICATIONRESPONSIBLEPERSON"
|
||||
placeholder="请输入整改责任人"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="RECTIFICATIONTIME" label="整改时间">
|
||||
<el-date-picker
|
||||
v-model="data.form.RECTIFICATIONTIME"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="主管意见" prop="SUPERVISOROPINION">
|
||||
<el-input
|
||||
v-model="data.form.SUPERVISOROPINION"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入主管意见"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="主管领导" prop="SUPERVISORLEADER">
|
||||
<el-input
|
||||
v-model="data.form.SUPERVISORLEADER"
|
||||
placeholder="请输入主管领导"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="SUPERVISORCONFIRMATIONTIME" label="确认时间">
|
||||
<el-date-picker
|
||||
v-model="data.form.SUPERVISORCONFIRMATIONTIME"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="安监意见" prop="SAFETYSUPERVISIONOPINION">
|
||||
<el-input
|
||||
v-model="data.form.SAFETYSUPERVISIONOPINION"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入安监意见"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="安监部门" prop="SAFETYSUPERVISIONDEPARTMENT">
|
||||
<el-input
|
||||
v-model="data.form.SAFETYSUPERVISIONDEPARTMENT"
|
||||
placeholder="请输入安监部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item
|
||||
prop="SAFETYSUPERVISIONCONFIRMATIONTIME"
|
||||
label="确认时间"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="data.form.SAFETYSUPERVISIONCONFIRMATIONTIME"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="校验人" prop="INSPECTOR">
|
||||
<el-input
|
||||
v-model="data.form.INSPECTOR"
|
||||
placeholder="请输入校验人"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="INSPECTORCONFIRMATIONTIME" label="确认时间">
|
||||
<el-date-picker
|
||||
v-model="data.form.INSPECTORCONFIRMATIONTIME"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-divider content-position="left">事故认定</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="工伤等级" prop="WORKINJURYIDENTIFICATIONLEVEL">
|
||||
<el-input
|
||||
v-model="data.form.WORKINJURYIDENTIFICATIONLEVEL"
|
||||
placeholder="请输入工伤等级"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="事故记录人" prop="ACCIDENTRECORDPERSON">
|
||||
<el-input
|
||||
v-model="data.form.ACCIDENTRECORDPERSON"
|
||||
placeholder="请输入事故记录人"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="REGISTRATIONDATE" label="登记日期">
|
||||
<el-date-picker
|
||||
v-model="data.form.REGISTRATIONDATE"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="事故报告记录" prop="fileList">
|
||||
<layout-upload
|
||||
v-model:file-list="data.form.fileList"
|
||||
accept=".pdf"
|
||||
delete-to-server
|
||||
:limit="9"
|
||||
:size="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="事故报告记录" prop="ACCIDENTANALYSISRECORD">
|
||||
<layout-upload
|
||||
v-model:file-list="data.form.ACCIDENTANALYSISRECORD"
|
||||
accept=".pdf"
|
||||
delete-to-server
|
||||
:limit="9"
|
||||
:size="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="tc mt-10">
|
||||
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
||||
</div>
|
||||
</layout-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref, toRaw } from "vue";
|
||||
import { ACCIDENTNATUREMENU, EDUCATIONALMENU } from "@/assets/js/constant.js";
|
||||
import LayoutUpload from "@/components/upload/index.vue";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import {
|
||||
addAccidentInvestigationView,
|
||||
editAccidentInvestigation,
|
||||
infoAccidentInvestigation,
|
||||
} from "@/request/production_accident.js";
|
||||
import { addingPrefixFile } from "@/assets/js/utils.js";
|
||||
import { getPractitionerSelectList } from "@/request/user_practitioner.js";
|
||||
|
||||
// 获取路由实例
|
||||
const route = useRoute();
|
||||
// 通过路由查询参数来判断模式
|
||||
const isEditMode = ref(false);
|
||||
const ACCIDENTINVESTIGATION_ID = ref("");
|
||||
const formRef = ref(null);
|
||||
const rules = reactive({
|
||||
GENDER: [{ required: true, message: "请选择人员性别", trigger: "change" }],
|
||||
AGE: [{ required: true, message: "请输入人员年龄", trigger: "change" }],
|
||||
EDUCATIONALLEVEL: [
|
||||
{ required: true, message: "请选择文化水平", trigger: "change" },
|
||||
],
|
||||
DEPARTMENT: [{ required: true, message: "请输入工作部门", trigger: "blur" }],
|
||||
JOBTYPE: [{ required: true, message: "请输入员工工种", trigger: "change" }],
|
||||
ENTRYDATE: [{ required: true, message: "请选择入职日期", trigger: "change" }],
|
||||
ACCIDENTDATE: [
|
||||
{ required: true, message: "请选择事故日期", trigger: "change" },
|
||||
],
|
||||
ACCIDENTLOCATION: [
|
||||
{ required: true, message: "请输入事故位置", trigger: "blur" },
|
||||
],
|
||||
INJUREDPART: [{ required: true, message: "请输入受伤部位", trigger: "blur" }],
|
||||
CERTIFICATIONSTATUS: [
|
||||
{ required: true, message: "请输入持证情况", trigger: "blur" },
|
||||
],
|
||||
EDUCATIONSITUATION: [
|
||||
{ required: true, message: "请输入教育情况", trigger: "blur" },
|
||||
],
|
||||
ACCIDENTDESCRIPTION: [
|
||||
{ required: true, message: "请输入故事描述", trigger: "blur" },
|
||||
],
|
||||
ACCIDENTNATURE: [
|
||||
{ required: true, message: "请选择事故性质", trigger: "change" },
|
||||
],
|
||||
CONFIRMATIONTIME: [
|
||||
{ required: true, message: "请选择确认时间", trigger: "change" },
|
||||
],
|
||||
PARTY: [{ required: true, message: "请输入当事人", trigger: "change" }],
|
||||
ACCIDENTANALYSIS: [
|
||||
{ required: true, message: "请输入故事分析", trigger: "blur" },
|
||||
],
|
||||
PUNISHMENTOPINION: [
|
||||
{ required: true, message: "请输入惩罚意见", trigger: "blur" },
|
||||
],
|
||||
RESPONSIBLEPERSON: [
|
||||
{ required: true, message: "请输入责任人", trigger: "blur" },
|
||||
],
|
||||
SECONDARYRESPONSIBLEPERSON: [
|
||||
{ required: true, message: "请输入次要责任人", trigger: "blur" },
|
||||
],
|
||||
PREVENTIVEMEASURES: [
|
||||
{ required: true, message: "请输入防范措施", trigger: "blur" },
|
||||
],
|
||||
COMPLETIONSTATUS: [
|
||||
{ required: true, message: "请输入完成情况", trigger: "blur" },
|
||||
],
|
||||
RECTIFICATIONRESPONSIBLEPERSON: [
|
||||
{ required: true, message: "请输入整改责任人", trigger: "blur" },
|
||||
],
|
||||
RECTIFICATIONTIME: [
|
||||
{ required: true, message: "请选择整改时间", trigger: "change" },
|
||||
],
|
||||
SUPERVISOROPINION: [
|
||||
{ required: true, message: "请输入主管意见", trigger: "blur" },
|
||||
],
|
||||
SUPERVISORLEADER: [
|
||||
{ required: true, message: "请输入主管领导", trigger: "blur" },
|
||||
],
|
||||
SUPERVISORCONFIRMATIONTIME: [
|
||||
{ required: true, message: "请选择确认时间", trigger: "change" },
|
||||
],
|
||||
SAFETYSUPERVISIONOPINION: [
|
||||
{ required: true, message: "请输入安监意见", trigger: "blur" },
|
||||
],
|
||||
SAFETYSUPERVISIONDEPARTMENT: [
|
||||
{ required: true, message: "请输入安监部门", trigger: "blur" },
|
||||
],
|
||||
SAFETYSUPERVISIONCONFIRMATIONTIME: [
|
||||
{ required: true, message: "请选择确认时间", trigger: "change" },
|
||||
],
|
||||
INSPECTOR: [{ required: true, message: "请输入校验人", trigger: "blur" }],
|
||||
INSPECTORCONFIRMATIONTIME: [
|
||||
{ required: true, message: "请选择确认时间", trigger: "change" },
|
||||
],
|
||||
WORKINJURYIDENTIFICATIONLEVEL: [
|
||||
{ required: true, message: "请输入工伤等级", trigger: "blur" },
|
||||
],
|
||||
ACCIDENTRECORDPERSON: [
|
||||
{ required: true, message: "请输入事故记录人", trigger: "blur" },
|
||||
],
|
||||
REGISTRATIONDATE: [
|
||||
{ required: true, message: "请选择登记日期", trigger: "change" },
|
||||
],
|
||||
});
|
||||
|
||||
const data = reactive({
|
||||
form: {
|
||||
USER_ID: "",
|
||||
SEX: "",
|
||||
AGE: "",
|
||||
EDUCATIONALLEVEL: "",
|
||||
DEPARTMENT: "",
|
||||
JOBTYPE: "",
|
||||
ENTRYDATE: "",
|
||||
ACCIDENTDATE: "",
|
||||
ACCIDENTLOCATION: "",
|
||||
INJUREDPART: "",
|
||||
CERTIFICATIONSTATUS: "",
|
||||
EDUCATIONSITUATION: "",
|
||||
ACCIDENTDESCRIPTION: "",
|
||||
ACCIDENTNATURE: "",
|
||||
CONFIRMATIONTIME: "",
|
||||
ACCIDENTANALYSIS: "",
|
||||
PUNISHMENTOPINION: "",
|
||||
RESPONSIBLEPERSON: "",
|
||||
SECONDARYRESPONSIBLEPERSON: "",
|
||||
PREVENTIVEMEASURES: "",
|
||||
COMPLETIONSTATUS: "",
|
||||
RECTIFICATIONRESPONSIBLEPERSON: "",
|
||||
RECTIFICATIONTIME: "",
|
||||
SUPERVISOROPINION: "",
|
||||
SUPERVISORLEADER: "",
|
||||
SUPERVISORCONFIRMATIONTIME: "",
|
||||
SAFETYSUPERVISIONOPINION: "",
|
||||
PARTY: "",
|
||||
SAFETYSUPERVISIONDEPARTMENT: "",
|
||||
SAFETYSUPERVISIONCONFIRMATIONTIME: "",
|
||||
INSPECTOR: "",
|
||||
INSPECTORCONFIRMATIONTIME: "",
|
||||
WORKINJURYIDENTIFICATIONLEVEL: "",
|
||||
ACCIDENTRECORDPERSON: "",
|
||||
REGISTRATIONDATE: "",
|
||||
fileList: [],
|
||||
ACCIDENTANALYSISRECORD: [],
|
||||
},
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
isEditMode.value = route.query.mode === "edit";
|
||||
ACCIDENTINVESTIGATION_ID.value = route.query.ACCIDENTINVESTIGATION_ID || "";
|
||||
|
||||
if (isEditMode.value) {
|
||||
data.form.fileList = [];
|
||||
data.form.ACCIDENTANALYSISRECORD = [];
|
||||
}
|
||||
|
||||
if (isEditMode.value && ACCIDENTINVESTIGATION_ID.value) {
|
||||
fnGetData();
|
||||
}
|
||||
});
|
||||
|
||||
const fnGetData = async () => {
|
||||
const ACCIDENTINVESTIGATION_ID = route.query.ACCIDENTINVESTIGATION_ID;
|
||||
if (!ACCIDENTINVESTIGATION_ID) return;
|
||||
const resData = await infoAccidentInvestigation({ ACCIDENTINVESTIGATION_ID });
|
||||
data.form = resData.pd;
|
||||
data.form.USER_ID = resData.pd.CASUALTYNAME;
|
||||
data.form.fileList = addingPrefixFile(resData.pd.ACCIDENTANALYSISRECORD);
|
||||
data.form.ACCIDENTANALYSISRECORD = addingPrefixFile(
|
||||
resData.pd.ACCIDENTREPORTRECORD
|
||||
);
|
||||
};
|
||||
fnGetData();
|
||||
|
||||
const router = useRouter();
|
||||
const fnGetUnitsList = async () => {
|
||||
const resData = await getPractitionerSelectList({
|
||||
PARENT_ID: "0b62f92b0b624aab8e89a77304a64d5e",
|
||||
BIANMA: "TRAFFIC_EMPLOYMENT_DRIVE",
|
||||
});
|
||||
data.unitsList = resData.userList;
|
||||
};
|
||||
fnGetUnitsList();
|
||||
|
||||
const fnSubmit = async () => {
|
||||
await useFormValidate(formRef);
|
||||
|
||||
const rawForm = toRaw(data.form);
|
||||
const formData = new FormData();
|
||||
Object.keys(rawForm).forEach((key) => {
|
||||
const value = rawForm[key];
|
||||
formData.append(key, value);
|
||||
});
|
||||
|
||||
if (Array.isArray(data.form.fileList)) {
|
||||
data.form.fileList.forEach((file) => {
|
||||
if (file.raw) formData.append("FFILEONE", file.raw);
|
||||
});
|
||||
}
|
||||
|
||||
if (Array.isArray(data.form.ACCIDENTANALYSISRECORD)) {
|
||||
data.form.ACCIDENTANALYSISRECORD.forEach((file) => {
|
||||
if (file.raw) formData.append("FFILETWO", file.raw);
|
||||
});
|
||||
}
|
||||
|
||||
if (isEditMode.value && ACCIDENTINVESTIGATION_ID.value) {
|
||||
formData.append("ACCIDENTINVESTIGATION_ID", ACCIDENTINVESTIGATION_ID.value);
|
||||
await editAccidentInvestigation(formData);
|
||||
ElMessage.success("编辑成功");
|
||||
} else {
|
||||
await addAccidentInvestigationView(formData);
|
||||
ElMessage.success("添加成功");
|
||||
}
|
||||
|
||||
router.push("/mechanical_files/production_accident");
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.flexBox {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.addBtn {
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -145,7 +145,7 @@ const convertACCIDENTNATURE = (name) => {
|
|||
};
|
||||
const fnAddOrEdit = (ACCIDENTINVESTIGATION_ID, USER_ID) => {
|
||||
router.push({
|
||||
path: "/mechanical_files/production_accident/add",
|
||||
path: "/mechanical_files/production_accident/edit",
|
||||
query: {
|
||||
mode: "edit",
|
||||
ACCIDENTINVESTIGATION_ID,
|
||||
|
|
Loading…
Reference in New Issue