| | |
| | | </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"> |
| | |
| | | .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(''); |
| | | // 上传附件 |
| | |
| | | // 关闭弹窗 |
| | | const closeDialog = (formEl: FormInstance | undefined) => { |
| | | formEl.resetFields(); |
| | | fileList.value=[] |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 必填项提示 |
| | |
| | | }; |
| | | // 表单提交验证必填项 |
| | | 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 |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | ruleForm.value.fileList=[] |
| | | delete ruleForm.value.accidentName |
| | | delete ruleForm.value.occurrenceTime |
| | | accidentManagementSystemApi() |
| | |
| | | newTreeList, |
| | | propse, |
| | | closeDialog, |
| | | uploaderImg |
| | | uploaderImg, |
| | | successUploader, |
| | | initFileListData |
| | | }; |
| | | }, |
| | | }); |