盘带报废查看详情

This commit is contained in:
hongchao 2025-02-27 15:20:21 +08:00
parent e60a5b0f44
commit 0125a69ed5
1 changed files with 94 additions and 16 deletions

View File

@ -39,10 +39,8 @@
:limit="5" :limit="5"
list-type="picture-card" list-type="picture-card"
accept=".png, .jpg, .jpeg, .pdf" accept=".png, .jpg, .jpeg, .pdf"
:on-change="handleChangeBusinessList"
:class="{ disabledFbs: uploadDisabled }" :class="{ disabledFbs: uploadDisabled }"
:on-preview="picturePreviewFbs" :on-preview="picturePreviewFbs"
:on-remove="handleRemoveElectricianImgList"
> >
<!-- 文件格式下载图片格式预览 --> <!-- 文件格式下载图片格式预览 -->
<div slot="file" slot-scope="{ file }"> <div slot="file" slot-scope="{ file }">
@ -58,9 +56,6 @@
<span v-else class="el-upload-list__item-preview" @click="picturePreviewFbs(file)"> <span v-else class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
<i class="el-icon-zoom-in" /> <i class="el-icon-zoom-in" />
</span> </span>
<span class="el-upload-list__item-delete" @click="handleRemoveElectricianImgList(file)">
<i class="el-icon-delete" />
</span>
</span> </span>
</div> </div>
<i class="el-icon-plus avatar-uploader-icon"></i> <i class="el-icon-plus avatar-uploader-icon"></i>
@ -127,12 +122,18 @@
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
</el-table> </el-table>
<!-- 图片查看弹窗 -->
<el-dialog :visible.sync="dialogVisible" width="600px" height="600px">
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getScrapInfo } from '@/api/repairTest/inventoryScrap' import { getScrapInfo } from '@/api/repairTest/inventoryScrap'
import { downloadFile, downloadFileData } from '@/utils/download'
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
name: "QueryTools", name: "QueryTools",
@ -175,9 +176,28 @@ export default {
keyword: "", keyword: "",
bmFileInfos: [] bmFileInfos: []
}, },
urlTemp: '',
//
dialogImageUrl: '',
dialogVisible: false,
uploadKey: Date.now(),
//
// upload: {
// //
// headers: {Authorization: 'Bearer ' + getToken()},
// //
// url: process.env.VUE_APP_BASE_API + '/file/upload'
// },
uploadUrl: process.env.VUE_APP_BASE_API + '/system/user/imgUpLoad' //
}; };
}, },
computed: {}, computed: {
//1
uploadDisabled() {
return this.maForm.bmFileInfos && this.maForm.bmFileInfos.length <= 5
},
},
mounted() { mounted() {
this.taskId = this.queryTaskId; this.taskId = this.queryTaskId;
this.getTaskInfo(); this.getTaskInfo();
@ -205,18 +225,76 @@ export default {
}); });
}, },
/** 导出按钮操作 */ isImage(file) {
handleExport() { this.urlTemp = require('@/assets/file.png')
this.download( if (this.updataIf(file)) {
"/material/lease_apply_info/exportDetails", return false
{ id: this.id }, } else {
`盘点报废详情_${new Date().getTime()}.xlsx` return true
); }
}, },
// ,
updataIf(e) {
if (e.fileName) {
const parts = e.fileName.split('.')
const extension = parts.pop()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false
} else {
return true
}
} else {
const parts = e.name.split('.')
const extension = parts.pop()
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
return false
} else {
return true
}
}
},
//-
picturePreviewFbs(file) {
console.log("yyyyyyyyyy",file)
this.dialogImageUrl = file.url.replaceAll('#', '%23')
const parts = file.name.split('.')
const extension = parts.pop()
if (extension === 'pdf') {
const windowName = file.name
window.open(file.url, windowName)
} else {
this.dialogVisible = true
}
},
handleDownload(file) {
console.log(file)
if (file.status === 'ready') {
downloadFile({ fileName: file.name, fileData: file.raw, fileType: 'application/vnd.ms-excel;charset=utf-8' })
} else if (file.status === 'success') {
downloadFileData({ fileName: file.name, fileUrl: file.url })
// downloadFileData({ fileName: file.name,fileUrl:file.url })
}
},
/** 导出按钮操作 */
// handleExport() {
// this.download(
// "/material/lease_apply_info/exportDetails",
// { id: this.id },
// `_${new Date().getTime()}.xlsx`
// );
// },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep.disabledFbs {
.el-upload--picture-card {
display: none;
}
}
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important; width: 60px !important;
margin-bottom: 10px; margin-bottom: 10px;