|
|
@@ -271,6 +271,50 @@
|
|
|
{{ scope.row.payStatus != 0 ? toFixedNum(scope.row.payableAmount) : '0.00' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-if="item.type == 18"
|
|
|
+ :prop="item.field"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ :label="item.label"
|
|
|
+ :width="item.width"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <el-popover
|
|
|
+ :title="scope.row.elderName"
|
|
|
+ :width="530"
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <el-tag :type="(!scope.row.otherFiles || scope.row.otherFiles == '') ? 'warning' : 'primary'">{{
|
|
|
+ (!scope.row.otherFiles || scope.row.otherFiles == '') ? '未上传' : '已上传'
|
|
|
+ }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <el-table :data="parsingJSON(scope.row.otherFiles)">
|
|
|
+ <el-table-column label="预览" width="80" align="center">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-image
|
|
|
+ v-if="isImageFile(row.fileUrl)"
|
|
|
+ :src="row.fileUrl"
|
|
|
+ :preview-src-list="[row.fileUrl]"
|
|
|
+ fit="cover"
|
|
|
+ style="width: 40px; height: 40px; cursor: pointer"
|
|
|
+ />
|
|
|
+ <Icon v-else icon="ep:document" style="font-size: 20px; color: #909399" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="150" property="fileName" label="附件名称" show-overflow-tooltip/>
|
|
|
+ <el-table-column width="180" property="createTime" label="创建时间" />
|
|
|
+ <el-table-column width="90" label="操作" align="center">
|
|
|
+ <template #default="{row}">
|
|
|
+ <el-button type="primary" link size="small" @click="handleDownload(row)">下载</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</template>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
@@ -405,6 +449,7 @@ import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
|
|
import { formatTime } from '@/utils'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import { useSettingStore } from '@/store/modules/setting'
|
|
|
+import {FileItem, isImageFile} from "@/components/UploadFile";
|
|
|
const userStore = useUserStore()
|
|
|
const settingStore = useSettingStore()
|
|
|
const radioId = ref() // 单选表格
|
|
|
@@ -502,6 +547,17 @@ const toFixedNum = (num: any) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const parsingJSON = (row) => {
|
|
|
+ if(!row || row==''){
|
|
|
+ return []
|
|
|
+ }else {
|
|
|
+ let json = JSON.parse(row)
|
|
|
+ console.log("JSON",json)
|
|
|
+ return json
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
const handleSelectable = (row) => {
|
|
|
if (props.disabledSelectedText) {
|
|
|
return row[props.disabledSelectedText] != 1
|
|
|
@@ -509,6 +565,23 @@ const handleSelectable = (row) => {
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+const handleDownload = (row: FileItem) => {
|
|
|
+ fetch(row.fileUrl)
|
|
|
+ .then((response) => response.blob())
|
|
|
+ .then((blob) => {
|
|
|
+ const url = URL.createObjectURL(blob)
|
|
|
+ const a = document.createElement('a')
|
|
|
+ a.href = url
|
|
|
+ a.download = row.fileName
|
|
|
+ document.body.appendChild(a)
|
|
|
+ a.click()
|
|
|
+ document.body.removeChild(a)
|
|
|
+ setTimeout(() => URL.revokeObjectURL(url), 100);
|
|
|
+ })
|
|
|
+ .catch((error) => console.error('下载失败:', error))
|
|
|
+}
|
|
|
+
|
|
|
const getDictLabelArr = (dictArr, field) => {
|
|
|
const dictLabelArr = getDictOptions(dictArr)
|
|
|
let fields = field.map((item) => item.mealName)
|