| | |
| | | } |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | ElMessageBox.confirm( |
| | | '该操作将永久删除此文件内容,是否继续?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(async() => { |
| | | let path = '' |
| | | if(type == '证件照'){ |
| | | path = state.form.electronicPhoto |
| | | }else{ |
| | | path = file.name |
| | | } |
| | | const res = await delPic({path: path}) |
| | | if(res.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件已删除' |
| | | }) |
| | | state.hasDeleteFile = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if(file && file.status == 'success') { |
| | | ElMessageBox.confirm( |
| | | '该操作将永久删除此文件内容,是否继续?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(async () => { |
| | | let path = '' |
| | | if (type == '证件照') { |
| | | path = state.form.electronicPhoto |
| | | } else { |
| | | path = file.name |
| | | } |
| | | const res = await delPic({path: path}) |
| | | if (res.code == 200) { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件已删除' |
| | | }) |
| | | state.hasDeleteFile = true |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const onSubmit = async (formEl)=> { |