Admin
2022-09-21 999cab6fb3fc6d2a288d365da991351c5a396bf0
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>
@@ -81,7 +81,8 @@
               </el-col>
               <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                  <el-form-item label="相关附件">
                     <uploaderImg :fileList="fileList" :disabled="disabled"></uploaderImg>
                     <uploaderImg :fileList="fileList" :name="INCIDENT_MANAGE"
                               @successUploader="successUploader" :disabled="disabled"></uploaderImg>
                  </el-form-item>
               </el-col>
               <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@@ -184,10 +185,35 @@
               .then((res) => {
                  if (res.data.code == 200) {
                     ruleForm.value = res.data.data;
                     fileList.value = (res.data.data.fileList?res.data.data.fileList:[])
                     initFileListData()
                  }
               });
         }
      };
      const initFileListData = async () => {
         for(var a = 0;a<fileList.value.length;a++){
            await goalManagementApi()
                  .searchFile(fileList.value[a].fileName)
                  .then((res) => {
                     fileList.value[a].url = res.data
                  })
         }
      }
      // 上传成功组装数据
      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
      }
      //日期选择器
      const value1 = ref('');
      // 上传附件
@@ -241,6 +267,7 @@
      // 关闭弹窗
      const closeDialog = (formEl: FormInstance | undefined) => {
         formEl.resetFields();
         fileList.value=[]
         isShowDialog.value = false;
      };
      // 必填项提示
@@ -346,12 +373,14 @@
      };
      // 表单提交验证必填项
      const submitForm = async (title: string, formEl: FormInstance | undefined) => {
         if(!ruleForm.value.fileList){
            ruleForm.value.fileList = []
         }
         if (title == '新建工伤申报') {
            if (!formEl) return;
            await formEl.validate((valid, fields) => {
               if (valid) {
                  isShowDialog.value = false;
                  ruleForm.value.fileList=[]
                  delete ruleForm.value.accidentName
                  delete ruleForm.value.occurrenceTime
                  delete ruleForm.value.id
@@ -384,7 +413,6 @@
            await formEl.validate((valid, fields) => {
               if (valid) {
                  isShowDialog.value = false;
                  ruleForm.value.fileList=[]
                  delete ruleForm.value.accidentName
                  delete ruleForm.value.occurrenceTime
                  accidentManagementSystemApi()
@@ -491,7 +519,9 @@
         newTreeList,
         propse,
         closeDialog,
         uploaderImg
         uploaderImg,
         successUploader,
         initFileListData
      };
   },
});
@@ -500,10 +530,10 @@
.textarea {
   height: 168px !important;
}
.textarea ::v-deep .el-textarea__inner {
.textarea ::v-deep(.el-textarea__inner) {
   height: 168px !important;
}
::v-deep .el-table__cell {
::v-deep(.el-table__cell) {
   font-weight: 400;
}
.el-divider--horizontal {