add:图片预览

This commit is contained in:
zhangzq
2025-09-18 16:00:57 +08:00
parent 523f8e69b0
commit 6821240f1c
10 changed files with 133 additions and 14 deletions

View File

@@ -86,7 +86,11 @@
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" />
<el-table-column prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
<el-table-column prop="storagevehicle_code" label="载具号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row.vehicle_code)">{{ scope.row.storagevehicle_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="canuse_qty" label="可用数" :formatter="crud.formatNum3" :min-width="100" />
<el-table-column prop="frozen_qty" label="冻结数" :formatter="crud.formatNum3" :min-width="100" />
<el-table-column prop="qty_unit_name" label="计量单位" :min-width="flexWidth('qty_unit_name',crud.data,'计量单位')" />
@@ -98,6 +102,7 @@
</el-table>
<!--分页组件-->
<pagination />
<image-modal :visible.sync="showModal" :image-url="imageUrl" />
</div>
</div>
</template>
@@ -111,10 +116,11 @@ import pagination from '@crud/Pagination'
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import imageModal from './image'
export default {
name: 'Structivt',
components: { pagination, crudOperation, rrOperation },
components: { pagination, crudOperation, rrOperation, imageModal },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
@@ -133,6 +139,8 @@ export default {
data() {
return {
sects: [],
showModal: false,
imageUrl: '',
permission: {},
rules: {}
}
@@ -150,6 +158,14 @@ export default {
hand(value) {
this.crud.toQuery()
},
toView(vehicle) {
this.showModal = true
crudStructivt.imageLoad('110').then(response => {
const blob = new Blob([response]) // 尽可能根据响应头确定类型
this.imageUrl = URL.createObjectURL(blob)
}
)
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]

View File

@@ -86,4 +86,12 @@ export function unIvtLock(data) {
})
}
export default { add, edit, del, getStruct, getStructById, getUnits, save, excelImport, statusChange, ivtLock, unIvtLock }
export function imageLoad(name) {
return request({
url: '/api/Storattr/image/' + name,
method: 'get',
responseType: 'blob'
})
}
export default { add, edit, del, getStruct, imageLoad, getStructById, getUnits, save, excelImport, statusChange, ivtLock, unIvtLock }