|
|
@@ -13,27 +13,30 @@
|
|
13
|
13
|
<el-table-column prop="maintenanceTime" label="维护保养时间" align="center" width="140" />
|
|
14
|
14
|
<el-table-column prop="fileName" label="附件上传" align="center" width="114">
|
|
15
|
15
|
<template #default="scope">
|
|
16
|
|
- <el-upload
|
|
17
|
|
- :disabled="props.type == 'look'"
|
|
18
|
|
- v-model:file-list="scope.row.filePartList"
|
|
19
|
|
- class="upload-demo"
|
|
20
|
|
- style="width: 100%"
|
|
21
|
|
- :action="fileUrl"
|
|
22
|
|
- :data="paramsData"
|
|
23
|
|
- :headers="myHeader"
|
|
24
|
|
- multiple
|
|
25
|
|
- :on-preview="handlePreview"
|
|
26
|
|
- :on-remove="handleRemove"
|
|
27
|
|
- :before-remove="beforeRemove"
|
|
28
|
|
- :on-success="(response, file, index) => getFileInfo(response, file, scope.$index)"
|
|
29
|
|
- :on-error="errorUpload"
|
|
30
|
|
- :before-upload="beforeUpload"
|
|
31
|
|
- :limit="1"
|
|
32
|
|
- :on-exceed="handleExceed"
|
|
33
|
|
- >
|
|
34
|
|
- <el-button v-if="props.type != 'look'" size="small" type="primary">选择文件</el-button>
|
|
35
|
|
- </el-upload>
|
|
36
|
|
- <!-- <span v-else>{{ scope.row.fileName }}</span> -->
|
|
|
16
|
+ <!-- <el-form-item v-if="props.type != 'look'" :prop="'materialMaintenanceStatuses.' + scope.$index + '.fileName'">
|
|
|
17
|
+ <el-upload
|
|
|
18
|
+ :disabled="props.type == 'look'"
|
|
|
19
|
+ v-model:file-list="scope.row.filePartList"
|
|
|
20
|
+ class="upload-demo"
|
|
|
21
|
+ style="width: 100%"
|
|
|
22
|
+ :action="fileUrl"
|
|
|
23
|
+ :data="paramsData"
|
|
|
24
|
+ :headers="myHeader"
|
|
|
25
|
+ multiple
|
|
|
26
|
+ :on-remove="handleRemove"
|
|
|
27
|
+ :before-remove="beforeRemove"
|
|
|
28
|
+ :on-success="(response, file, index) => getFileInfo(response, file, scope.$index)"
|
|
|
29
|
+ :on-error="errorUpload"
|
|
|
30
|
+ :before-upload="beforeUpload"
|
|
|
31
|
+ :limit="1"
|
|
|
32
|
+ :on-exceed="handleExceed"
|
|
|
33
|
+ >
|
|
|
34
|
+ <el-button v-if="props.type != 'look'" size="small" type="primary">选择文件</el-button>
|
|
|
35
|
+ </el-upload>
|
|
|
36
|
+ </el-form-item> -->
|
|
|
37
|
+ <p @click="handlePreview(scope.row.filePart)" style="cursor: pointer; color: #409eff">
|
|
|
38
|
+ {{ scope.row.fileName }}
|
|
|
39
|
+ </p>
|
|
37
|
40
|
</template>
|
|
38
|
41
|
</el-table-column>
|
|
39
|
42
|
</el-table>
|
|
|
@@ -53,6 +56,34 @@
|
|
53
|
56
|
{{ scope.row.status ? showCh(scope.row.status, maintenance_auditing_status) : scope.row.status }}
|
|
54
|
57
|
</template>
|
|
55
|
58
|
</el-table-column>
|
|
|
59
|
+ <el-table-column prop="fileName" label="附件" align="center">
|
|
|
60
|
+ <template #default="scope">
|
|
|
61
|
+ <!-- <el-form-item v-if="props.type != 'look'" :prop="'materialMaintenanceStatuses.' + scope.$index + '.fileName'">
|
|
|
62
|
+ <el-upload
|
|
|
63
|
+ :disabled="props.type == 'look'"
|
|
|
64
|
+ v-model:file-list="scope.row.filePartList"
|
|
|
65
|
+ class="upload-demo"
|
|
|
66
|
+ style="width: 100%"
|
|
|
67
|
+ :action="fileUrl"
|
|
|
68
|
+ :data="paramsData"
|
|
|
69
|
+ :headers="myHeader"
|
|
|
70
|
+ multiple
|
|
|
71
|
+ :on-remove="handleRemove"
|
|
|
72
|
+ :before-remove="beforeRemove"
|
|
|
73
|
+ :on-success="(response, file, index) => getFileInfo(response, file, scope.$index)"
|
|
|
74
|
+ :on-error="errorUpload"
|
|
|
75
|
+ :before-upload="beforeUpload"
|
|
|
76
|
+ :limit="1"
|
|
|
77
|
+ :on-exceed="handleExceed"
|
|
|
78
|
+ >
|
|
|
79
|
+ <el-button v-if="props.type != 'look'" size="small" type="primary">选择文件</el-button>
|
|
|
80
|
+ </el-upload>
|
|
|
81
|
+ </el-form-item> -->
|
|
|
82
|
+ <p @click="handlePreview(scope.row.filePart)" style="cursor: pointer; color: #409eff">
|
|
|
83
|
+ {{ scope.row.fileName }}
|
|
|
84
|
+ </p>
|
|
|
85
|
+ </template>
|
|
|
86
|
+ </el-table-column>
|
|
56
|
87
|
</el-table>
|
|
57
|
88
|
<el-row v-else>
|
|
58
|
89
|
<el-col :span="24" style="margin-top: 30px">
|
|
|
@@ -162,7 +193,10 @@ const lookData = () => {
|
|
162
|
193
|
entryDate: res.data.entryDate,
|
|
163
|
194
|
unitPrice: res.data.unitPrice
|
|
164
|
195
|
}));
|
|
165
|
|
- materialMaintenanceStatuses.value = res.data.materialMaintenanceStatuses;
|
|
|
196
|
+ materialMaintenanceStatuses.value = res.data.materialMaintenanceStatuses.map((item: any) => ({
|
|
|
197
|
+ ...item,
|
|
|
198
|
+ filePartList: [{ url: item.filePart, name: item.fileName }]
|
|
|
199
|
+ }));
|
|
166
|
200
|
}
|
|
167
|
201
|
});
|
|
168
|
202
|
};
|
|
|
@@ -227,8 +261,8 @@ const getFileInfo = (res: any, file: any) => {
|
|
227
|
261
|
const handleRemove = (file: any, uploadFiles: any) => {
|
|
228
|
262
|
console.log(file, uploadFiles);
|
|
229
|
263
|
};
|
|
230
|
|
-const handlePreview = (uploadFile: any) => {
|
|
231
|
|
- sysFile(uploadFile.url).then((res: any) => {
|
|
|
264
|
+const handlePreview = (url) => {
|
|
|
265
|
+ sysFile(url).then((res: any) => {
|
|
232
|
266
|
const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
|
|
233
|
267
|
const bFile = URL.createObjectURL(blob);
|
|
234
|
268
|
window.open(bFile);
|