|
|
@@ -124,8 +124,8 @@
|
|
124
|
124
|
:on-preview="handlePreview"
|
|
125
|
125
|
multiple
|
|
126
|
126
|
:on-remove="handleRemove"
|
|
127
|
|
- :before-remove="beforeRemove"
|
|
128
|
|
- :on-success="(response, file, index) => getFileInfo(response, file, scope.$index)"
|
|
|
127
|
+ :before-remove="(response:any, file:any, index:number) => beforeRemove(response, file, scope.$index)"
|
|
|
128
|
+ :on-success="(response:any, file:any, index:number) => getFileInfo(response, file, scope.$index)"
|
|
129
|
129
|
:on-error="errorUpload"
|
|
130
|
130
|
:before-upload="beforeUpload"
|
|
131
|
131
|
:limit="1"
|
|
|
@@ -166,28 +166,7 @@
|
|
166
|
166
|
</el-table-column>
|
|
167
|
167
|
<el-table-column prop="fileName" :label="props.type == 'look' ? '附件' : '附件上传'" align="center">
|
|
168
|
168
|
<template #default="scope">
|
|
169
|
|
- <el-form-item v-if="props.type != 'look'" :prop="'materialMaintenanceStatuses.' + scope.$index + '.fileName'">
|
|
170
|
|
- <el-upload
|
|
171
|
|
- :disabled="props.type == 'look'"
|
|
172
|
|
- v-model:file-list="scope.row.filePartList"
|
|
173
|
|
- class="upload-demo"
|
|
174
|
|
- style="width: 100%"
|
|
175
|
|
- :action="fileUrl"
|
|
176
|
|
- :data="paramsData"
|
|
177
|
|
- :headers="myHeader"
|
|
178
|
|
- multiple
|
|
179
|
|
- :on-remove="handleRemove"
|
|
180
|
|
- :before-remove="beforeRemove"
|
|
181
|
|
- :on-success="(response, file, index) => getFileInfo(response, file, scope.$index)"
|
|
182
|
|
- :on-error="errorUpload"
|
|
183
|
|
- :before-upload="beforeUpload"
|
|
184
|
|
- :limit="1"
|
|
185
|
|
- :on-exceed="handleExceed"
|
|
186
|
|
- >
|
|
187
|
|
- <el-button v-if="props.type != 'look'" size="small" type="primary">选择文件</el-button>
|
|
188
|
|
- </el-upload>
|
|
189
|
|
- </el-form-item>
|
|
190
|
|
- <p v-else @click="handlePreviewDetail(scope.row.filePart)" style="cursor: pointer; color: #409eff">
|
|
|
169
|
+ <p @click="handlePreviewDetail(scope.row.filePart)" style="cursor: pointer; color: #409eff">
|
|
191
|
170
|
{{ scope.row.fileName }}
|
|
192
|
171
|
</p>
|
|
193
|
172
|
</template>
|
|
|
@@ -457,11 +436,9 @@ const handlePreviewDetail = (url: string) => {
|
|
457
|
436
|
const handleExceed = (files: any, uploadFiles: any) => {
|
|
458
|
437
|
ElMessage.warning(`限制上传一个文件`);
|
|
459
|
438
|
};
|
|
460
|
|
-const beforeRemove = (uploadFile: any, uploadFiles: any) => {
|
|
461
|
|
- // return ElMessageBox.confirm(`确定移除 ${uploadFile.name} ?`).then(
|
|
462
|
|
- // () => true,
|
|
463
|
|
- // () => false
|
|
464
|
|
- // );
|
|
|
439
|
+const beforeRemove = (uploadFile: any, uploadFiles: any, index: number) => {
|
|
|
440
|
+ formData.tableData[index].filePart = "";
|
|
|
441
|
+ formData.tableData[index].fileName = "";
|
|
465
|
442
|
};
|
|
466
|
443
|
const errorUpload = (err: any, file: any, fileList: any) => {
|
|
467
|
444
|
ElMessage.error("文件上传失败,UploadAjaxError:" + JSON.parse(JSON.stringify(err)).status);
|