add: 添加物料图片显示
This commit is contained in:
@@ -268,7 +268,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogVisible1" title="物料图片">
|
||||
<img :src="imageUrl" alt="物料图片" style="max-width: 100%;">
|
||||
<img :src="materialFile" alt="物料图片" style="max-width: 100%;">
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
title="创建任务"
|
||||
@@ -332,7 +332,7 @@
|
||||
content="点击查看图片"
|
||||
placement="top"
|
||||
>
|
||||
<div @click="showImage(scope.row.material_id)">
|
||||
<div @click="showImage(scope.row.group_id)">
|
||||
{{ scope.row.material_id }}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
@@ -469,7 +469,8 @@ export default {
|
||||
vehicle_code: '',
|
||||
point_code1: ''
|
||||
},
|
||||
errGif: errGif
|
||||
errGif: errGif,
|
||||
materialFile: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -482,9 +483,12 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
showImage(materialId) {
|
||||
console.log('Clicked material_id:', materialId)
|
||||
showImage(groupId) {
|
||||
this.dialogVisible1 = true
|
||||
crudSchBaseVehiclematerialgroup.selectMaterialFile(groupId).then(res => {
|
||||
console.log(res.data)
|
||||
this.materialFile = res
|
||||
})
|
||||
// 在这里处理点击逻辑,例如弹出图片、显示详情等
|
||||
},
|
||||
getWorkShopList() { // 获取车间列表
|
||||
@@ -557,6 +561,7 @@ export default {
|
||||
if (valid) {
|
||||
crudSchBaseVehiclematerialgroup.createTask(this.newTask).then(res => {
|
||||
console.log(res)
|
||||
this.$notify({ type: 'success', message: '任务创建成功!' })
|
||||
this.dialogVisible = false // 只在成功后关闭对话框
|
||||
}).catch(error => {
|
||||
console.error('任务创建失败:', error)
|
||||
|
||||
@@ -48,4 +48,11 @@ export function createTask(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getGroup, selectByVehicle, createTask }
|
||||
export function selectMaterialFile(groupId) {
|
||||
return request({
|
||||
url: 'api/schBaseVehiclematerialgroup/selectMaterialFile?groupId=' + groupId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getGroup, selectByVehicle, createTask, selectMaterialFile }
|
||||
|
||||
Reference in New Issue
Block a user