shj
2022-09-01 6f1c37bcfdff43fe3bb0336676b4654a25a20066
修改
已修改5个文件
275 ■■■■■ 文件已修改
src/views/accidentManagementSystem/accidentReport/component/openAdd.vue 239 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/accidentManagementSystem/accidentReport/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/accidentManagementSystem/workInjuryDeclaration/component/openAdd.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/accidentManagementSystem/workInjuryDeclaration/component/openEdit.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/accidentManagementSystem/workInjuryDeclaration/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/accidentManagementSystem/accidentReport/component/openAdd.vue
@@ -16,8 +16,7 @@
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="事故部门" placeholder="请选择" prop="accidentDepartmentId">
                            <!--<el-input v-model="ruleForm.accidentDepartmentName" class="input-with-select" />-->
                            <el-tree-select v-model="accidentDepartmentId" :disabled="true" :data="newTreeList"
                                            :props="propse" class="w100" placeholder="请选择" />
                            <el-tree-select v-model="accidentDepartmentId" :disabled="true" :data="newTreeList" :props="propse" class="w100" placeholder="请选择" />
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@@ -40,21 +39,21 @@
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="事故类别" prop="accidentType">
                            <el-select v-model="ruleForm.accidentType" :disabled="disabled" class="w100" placeholder="请选择">
                                <el-option label="人员伤亡事故" value="人员伤亡事故"></el-option>
                                <el-option label="火灾爆炸事故" value="火灾爆炸事故"></el-option>
                                <el-option label="危险品泄露事故" value="危险品泄露事故"></el-option>
                                <el-option label="设备事故" value="设备事故"></el-option>
                                <el-option label="工艺事故" value="工艺事故"></el-option>
                                <el-option label="人员伤亡事故" value="1"></el-option>
                                <el-option label="火灾爆炸事故" value="2"></el-option>
                                <el-option label="危险品泄露事故" value="3"></el-option>
                                <el-option label="设备事故" value="4"></el-option>
                                <el-option label="工艺事故" value="5"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="事故等级" prop="accidentGrade">
                            <el-select v-model="ruleForm.accidentGrade" :disabled="disabled" class="w100" placeholder="请选择">
                                <el-option label="一级" value="一级"></el-option>
                                <el-option label="二级" value="二级"></el-option>
                                <el-option label="三级" value="三级"></el-option>
                                <el-option label="四级" value="四级"></el-option>
                                <el-option label="一级" value="1"></el-option>
                                <el-option label="二级" value="2"></el-option>
                                <el-option label="三级" value="3"></el-option>
                                <el-option label="四级" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
@@ -98,10 +97,10 @@
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="事故级别" prop="accidentLevel">
                            <el-select v-model="ruleForm.accidentLevel" :disabled="disabled" class="w100" placeholder="请选择">
                                <el-option label="特大事故" value="特大事故"></el-option>
                                <el-option label="重大事故" value="重大事故"></el-option>
                                <el-option label="较大事故" value="较大事故"></el-option>
                                <el-option label="一般事故" value="一般事故"></el-option>
                                <el-option label="特大事故" value="1"></el-option>
                                <el-option label="重大事故" value="2"></el-option>
                                <el-option label="较大事故" value="3"></el-option>
                                <el-option label="一般事故" value="4"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
@@ -134,20 +133,29 @@
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="整改措施" prop="rectificationMeasures">
                            <el-input v-model="ruleForm.rectificationMeasures" :disabled="disabled"
                                      type="textarea" placeholder="请填写整改措施" maxlength="150"></el-input>
                            <el-input
                                v-model="ruleForm.rectificationMeasures"
                                :disabled="disabled"
                                type="textarea"
                                placeholder="请填写整改措施"
                                maxlength="150"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="事故处理" prop="accidentHandling">
                            <el-input v-model="ruleForm.accidentHandling" :disabled="disabled"
                                      type="textarea" placeholder="请填写事故处理" maxlength="150"></el-input>
                            <el-input
                                v-model="ruleForm.accidentHandling"
                                :disabled="disabled"
                                type="textarea"
                                placeholder="请填写事故处理"
                                maxlength="150"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="填写人" prop="fillInUserName">
                            <el-input v-model="ruleForm.fillInUserName" :disabled="true"
                                      placeholder="请选择" class="input-with-select">
                            <el-input v-model="ruleForm.fillInUserName" :disabled="true" placeholder="请选择" class="input-with-select">
                                <template #append>
                                    <el-button :icon="Search" @click="openUser" />
                                </template>
@@ -166,15 +174,20 @@
                            />
                        </el-form-item>
                    </el-col>
                      <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                        <el-form-item label="事故照片">
                            <uploaderImg :fileList="ruleForm.expressFileList" :disabled="true"></uploaderImg>
                        </el-form-item>
                      </el-col>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="相关人员笔录" prop="relevantPersonnelRecords">
                            <el-input v-model="ruleForm.relevantPersonnelRecords" :disabled="disabled"
                                      type="textarea" placeholder="请填写相关人员笔录" maxlength="150"></el-input>
                            <el-input
                                v-model="ruleForm.relevantPersonnelRecords"
                                :disabled="disabled"
                                type="textarea"
                                placeholder="请填写相关人员笔录"
                                maxlength="150"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@@ -187,14 +200,23 @@
                    </el-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                        <el-form-item label="事故分析会议纪要">
                            <uploaderFile :fileList="fileList" :systemName="'INCIDENT_MANAGE'" :disabled="disabled"
                                          @successUploader="successUploader"></uploaderFile>
                            <uploaderFile
                                :fileList="fileList"
                                :systemName="'INCIDENT_MANAGE'"
                                :disabled="disabled"
                                @successUploader="successUploader"
                            ></uploaderFile>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="其他材料" prop="otherMaterials">
                            <el-input v-model="ruleForm.otherMaterials" :disabled="disabled"
                                      type="textarea" placeholder="请填写其他材料" maxlength="150"></el-input>
                            <el-input
                                v-model="ruleForm.otherMaterials"
                                :disabled="disabled"
                                type="textarea"
                                placeholder="请填写其他材料"
                                maxlength="150"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
@@ -207,13 +229,13 @@
            </template>
        </el-dialog>
        <AccidentName @selectItem="onSelectItem" ref="Shows" />
        <DailogSearchUserManger @SearchUser="onUser" ref="userRef"  />
        <DailogSearchUserManger @SearchUser="onUser" ref="userRef" />
        <RegionsDialog ref="openRef" />
    </div>
</template>
<script lang="ts">
import { reactive, ref, defineComponent,onMounted } from 'vue';
import { reactive, ref, defineComponent, onMounted } from 'vue';
import type { UploadUserFile, FormInstance, FormRules } from 'element-plus';
import { ElMessage } from 'element-plus';
@@ -234,7 +256,7 @@
        DailogSearchUserManger,
        RegionsDialog,
        uploaderImg,
        uploaderFile
        uploaderFile,
    },
    setup(props, { emit }) {
        const isShowDialog = ref(false);
@@ -242,7 +264,7 @@
        const ruleFormRef = ref<FormInstance>();
        //定义表单
        const ruleForm = ref({
            accidentExpressId:'',
            accidentExpressId: '',
            accidentType: '',
            accidentGrade: '',
@@ -259,32 +281,32 @@
            rectificationMeasures: '',
            accidentHandling: '',
            fillInUserUid: '',
            fillInUserName:'',
            fillInUserName: '',
            fillInTime: '',
            relevantPersonnelRecords: '',
            otherMaterials: '',
            fileList: [],
            status:''
            status: '',
        });
        const titles = ref();
        const disabled = ref();
        const statusDisabled = ref(true)
        const statusDisabled = ref(true);
        // 上传附件
        const fileList = ref([]);
        // 打开弹窗
        const openDialog = (title: string, id: number, type: boolean,statusDisabledFlag:string) => {
        const openDialog = (title: string, id: number, type: boolean, statusDisabledFlag: string) => {
            isShowDialog.value = true;
            titles.value = title;
            disabled.value = type;
            if(statusDisabledFlag.value=='first'){
                ruleForm.value.status = 1
            }else if(statusDisabledFlag.value=='second'){
                ruleForm.value.status = 2
            if (statusDisabledFlag.value == 'first') {
                ruleForm.value.status = 1;
            } else if (statusDisabledFlag.value == 'second') {
                ruleForm.value.status = 2;
            }
            if (title == '修改事故报告') {
                statusDisabled.value = false
            }else {
                statusDisabled.value = true
                statusDisabled.value = false;
            } else {
                statusDisabled.value = true;
            }
            if (title == '查看事故报告' || title == '修改事故报告') {
                accidentManagementSystemApi()
@@ -292,50 +314,48 @@
                    .then((res) => {
                        if (res.data.code == 200) {
                            ruleForm.value = res.data.data;
                            accidentName.value = res.data.data.accidentName
                            accidentDepartmentId.value = res.data.data.accidentDepartmentId
                            occurrencePlace.value = res.data.data.occurrencePlace
                            occurrenceTime.value = res.data.data.occurrenceTime
                            fileList.value = (res.data.data.fileList?res.data.data.fileList:[])
                            initFileListData()
                            accidentName.value = res.data.data.accidentName;
                            accidentDepartmentId.value = res.data.data.accidentDepartmentId;
                            occurrencePlace.value = res.data.data.occurrencePlace;
                            occurrenceTime.value = res.data.data.occurrenceTime;
                            fileList.value = res.data.data.fileList ? res.data.data.fileList : [];
                            initFileListData();
                        }
                    });
            }
        };
        const initFileListData = async () => {
            //事故照片
            if(ruleForm.value.expressFileList){
                for(var a = 0;a<ruleForm.value.expressFileList.length;a++){
            if (ruleForm.value.expressFileList) {
                for (var a = 0; a < ruleForm.value.expressFileList.length; a++) {
                    await goalManagementApi()
                            .searchFile(ruleForm.value.expressFileList[a].fileName)
                            .then((res) => {
                                ruleForm.value.expressFileList[a].url = res.data
                                console.log('ruleForm',ruleForm)
                            })
                        .searchFile(ruleForm.value.expressFileList[a].fileName)
                        .then((res) => {
                            ruleForm.value.expressFileList[a].url = res.data;
                            console.log('ruleForm', ruleForm);
                        });
                }
            }else {
                ruleForm.value.expressFileList = []
            } else {
                ruleForm.value.expressFileList = [];
            }
            // 事故分析会议纪要
            for(var a = 0;a<fileList.value.length;a++){
                fileList.value[a].name = fileList.value[a].fileName
            for (var a = 0; a < fileList.value.length; a++) {
                fileList.value[a].name = fileList.value[a].fileName;
            }
        }
        };
        // 上传成功组装数据
        const successUploader = (list) =>{
            fileList.value = list
            const formFileList = []
            for(var a = 0;a<fileList.value.length;a++){
                formFileList.push(
                        {
                            fileName:fileList.value[a].fileName,
                            fileUrl:''
                        }
                )
        const successUploader = (list) => {
            fileList.value = list;
            const formFileList = [];
            for (var a = 0; a < fileList.value.length; a++) {
                formFileList.push({
                    fileName: fileList.value[a].fileName,
                    fileUrl: '',
                });
            }
            ruleForm.value.fileList = formFileList
        }
            ruleForm.value.fileList = formFileList;
        };
        // 取消
        const onCancel = (formEl: FormInstance | undefined) => {
            resetForm(formEl);
@@ -347,8 +367,7 @@
        const treeSelect = ref();
        //定义树形下拉框
        const responsibleDepartment = ref();
        const data = [
        ];
        const data = [];
        // 必填项提示
        const rules = reactive<FormRules>({
            accidentExpressId: [
@@ -444,27 +463,27 @@
                },
            ],
        });
        const accidentDepartmentId = ref()
        const occurrencePlace = ref()
        const occurrenceTime = ref()
        const accidentName = ref()
        const accidentDepartmentId = ref();
        const occurrencePlace = ref();
        const occurrenceTime = ref();
        const accidentName = ref();
        //事故快报回填
        const onSelectItem = (item: any) => {
            console.log('item', item[0]);
            ruleForm.value.accidentExpressId = item[0].id
            accidentName.value = item[0].accidentName
            accidentDepartmentId.value = item[0].accidentDepartmentId
            occurrencePlace.value = item[0].occurrencePlace
            occurrenceTime.value = item[0].occurrenceTime
            ruleForm.value.accidentExpressId = item[0].id;
            accidentName.value = item[0].accidentName;
            accidentDepartmentId.value = item[0].accidentDepartmentId;
            occurrencePlace.value = item[0].occurrencePlace;
            occurrenceTime.value = item[0].occurrenceTime;
        };
        // 表单提交验证必填项
        const submitForm = async (title: string, formEl: FormInstance | undefined) => {
            delete ruleForm.value.accidentName
            delete ruleForm.value.accidentDepartmentId
            delete ruleForm.value.occurrencePlace
            delete ruleForm.value.occurrenceTime
            if(!ruleForm.value.fileList){
                ruleForm.value.fileList = []
            delete ruleForm.value.accidentName;
            delete ruleForm.value.accidentDepartmentId;
            delete ruleForm.value.occurrencePlace;
            delete ruleForm.value.occurrenceTime;
            if (!ruleForm.value.fileList) {
                ruleForm.value.fileList = [];
            }
            if (title == '新建事故报告') {
                if (!formEl) return;
@@ -527,7 +546,7 @@
                });
                formEl.resetFields();
                ruleForm.value = {
                    accidentExpressId:'',
                    accidentExpressId: '',
                    accidentType: '',
                    accidentGrade: '',
@@ -544,12 +563,12 @@
                    rectificationMeasures: '',
                    accidentHandling: '',
                    fillInUserUid: '',
                    fillInUserName:'',
                    fillInUserName: '',
                    fillInTime: '',
                    relevantPersonnelRecords: '',
                    otherMaterials: '',
                    fileList: [],
                    status:''
                    status: '',
                };
            }
        };
@@ -559,12 +578,12 @@
            if (!formEl) return;
            formEl.resetFields();
            // ruleForm.value.accidentExpressId = item[0].id
            ruleForm.value = {}
            fileList.value = []
            accidentName.value = ''
            accidentDepartmentId.value = ''
            occurrencePlace.value = ''
            occurrenceTime.value = ''
            ruleForm.value = {};
            fileList.value = [];
            accidentName.value = '';
            accidentDepartmentId.value = '';
            occurrencePlace.value = '';
            occurrenceTime.value = '';
        };
        const handleChange = (val: number) => {
            console.log(val);
@@ -597,15 +616,15 @@
        //得到部门树
        const department = async () => {
            await goalManagementApi()
                    .getTreedepartment()
                    .then((res) => {
                        if (res.data.code == 200) {
                            data.value = res.data.data;
                            getTreeList(res.data.data, newTreeList);
                        } else {
                            ElMessage.error(res.data.msg);
                        }
                    });
                .getTreedepartment()
                .then((res) => {
                    if (res.data.code == 200) {
                        data.value = res.data.data;
                        getTreeList(res.data.data, newTreeList);
                    } else {
                        ElMessage.error(res.data.msg);
                    }
                });
        };
        // 递归树状数据且修改字段名
        const getTreeList = (treeList, newTreeList) => {
@@ -674,7 +693,7 @@
            occurrenceTime,
            accidentName,
            successUploader,
            initFileListData
            initFileListData,
        };
    },
});
src/views/accidentManagementSystem/accidentReport/index.vue
@@ -56,8 +56,23 @@
            />
            <el-table-column prop="accidentName" label="事故名称" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="deptName" label="事故部门" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="accidentType" label="事故类别" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="accidentGrade" label="事故等级" show-overflow-tooltip sortable></el-table-column>
            <el-table-column label="事故类别" show-overflow-tooltip sortable>
              <template #default="scope">
              <span v-if="scope.row.accidentType==1">人员伤亡事故</span>
              <span v-if="scope.row.accidentType==2">火灾爆炸事故</span>
              <span v-if="scope.row.accidentType==3">危险品泄露事故</span>
              <span v-if="scope.row.accidentType==4">设备事故</span>
              <span v-if="scope.row.accidentType==5">工艺事故</span>
              </template>
            </el-table-column>
            <el-table-column  label="事故等级" show-overflow-tooltip sortable>
              <template #default="scope">
              <span v-if="scope.row.accidentGrade==1">一级</span>
              <span v-if="scope.row.accidentGrade==2">二级</span>
              <span v-if="scope.row.accidentGrade==3">三级</span>
              <span v-if="scope.row.accidentGrade==4">四级</span>
              </template>
            </el-table-column>
            <el-table-column prop="occurrencePlace" label="发生地点" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="occurrenceTime" label="发生时间" show-overflow-tooltip sortable></el-table-column>
            <el-table-column label="操作" width="260" align="center" fixed="right">
src/views/accidentManagementSystem/workInjuryDeclaration/component/openAdd.vue
@@ -47,8 +47,8 @@
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                        <el-form-item label="工伤类型" prop="workInjuryType">
                            <el-select v-model="ruleForm.workInjuryType" :disabled="disabled" class="w100" placeholder="请选择">
                                <el-option label="轻微伤" value="轻微伤"></el-option>
                                <el-option label="轻伤" value="轻伤"></el-option>
                                <el-option label="轻微伤" value="1"></el-option>
                                <el-option label="轻伤" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
src/views/accidentManagementSystem/workInjuryDeclaration/component/openEdit.vue
@@ -46,8 +46,8 @@
          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="事故原因" prop="teamLevel">
              <el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择">
                <el-option label="人的不安全行为" value="admin"></el-option>
                <el-option label="物的不安全状态" value="common"></el-option>
                <el-option label="人的不安全行为" value="1"></el-option>
                <el-option label="物的不安全状态" value="2"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
src/views/accidentManagementSystem/workInjuryDeclaration/index.vue
@@ -58,7 +58,12 @@
                <el-table-column prop="declareUserName" label="申报人名称" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="deptName" label="申报人部门" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="accidentName" label="事故名称" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="workInjuryType" label="工商类型" show-overflow-tooltip sortable></el-table-column>
                <el-table-column  label="工伤类型" show-overflow-tooltip sortable>
                    <template #default="scope">
                    <span v-if="scope.row.workInjuryType==1">轻微伤</span>
                    <span v-if="scope.row.workInjuryType==2">轻伤</span>
                    </template>
                </el-table-column>
                <el-table-column prop="declareDate" label="申报日期" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="visitHospital" label="就诊医院" show-overflow-tooltip sortable></el-table-column>
                <el-table-column label="操作" width="260" align="center" fixed="right">
@@ -328,7 +333,7 @@
            total,
            onMyAdd,
            onSelectItem,
            deletAll
            deletAll,
        };
    },
});