Browse Source

检验批量删除文件

wms3.0_pda
lijuncheng 10 months ago
parent
commit
5af52b9d26
  1. 13
      api/request2.js
  2. 22
      pages/inspect/job/inspectDetail.vue
  3. 23
      pages/inspect/job/inspectFullDetail.vue

13
api/request2.js

@ -3550,6 +3550,19 @@ export function deleteFileById(id) {
}); });
} }
/**
* 删除文件(多个文件)
* @param {*}
*
*/
export function deleteFileByTable(tableName, tableId) {
return request({
url: baseApi + "/infra/file/deleteByTable?tableName=" + tableName + "&tableId=" + tableId,
method: "delete",
data: {},
});
}
/** /**
* 获取文件列表 * 获取文件列表

22
pages/inspect/job/inspectDetail.vue

@ -40,8 +40,8 @@
cancleTakeInspectJob, cancleTakeInspectJob,
getInspectJobDetail, getInspectJobDetail,
inspectJobSubmit, inspectJobSubmit,
deleteFileById, getFileList,
getFileList deleteFileByTable
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -147,25 +147,15 @@
}, },
methods: { methods: {
deleteFileById(id) { deleteFileByTable(id) {
deleteFileById(id).then(res => { debugger
deleteFileByTable("jobInspectDetail", id).then(res=>{
})
},
getFileList(id) {
getFileList("jobInspectDetail", id).then(res => {
if (res.data) {
res.data.forEach(res => {
this.deleteFileById(res.id)
})
}
}) })
}, },
clearPicList(subList) { clearPicList(subList) {
subList.forEach(item => { subList.forEach(item => {
this.getFileList(item.id) this.deleteFileByTable(item.id)
}) })
}, },

23
pages/inspect/job/inspectFullDetail.vue

@ -41,7 +41,8 @@
getInspectJobDetail, getInspectJobDetail,
inspectJobSubmit, inspectJobSubmit,
deleteFileById, deleteFileById,
getFileList getFileList,
deleteFileByTable
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -151,27 +152,17 @@
}, },
methods: { methods: {
deleteFileById(id) { deleteFileByTable(id) {
deleteFileById(id).then(res => { deleteFileByTable("jobInspectDetail", id).then(res=>{
}) })
}, },
getFileList(id) {
getFileList("jobInspectDetail", id).then(res => {
if (res.data) {
res.data.forEach(res => {
this.deleteFileById(res.id)
})
}
})
},
clearPicList(subList) { clearPicList(subList) {
subList.forEach(item => { subList.forEach(item => {
this.getFileList(item.id) this.deleteFileByTable(item.id)
}) })
}, },
// //
receive(callback) { receive(callback) {
uni.showLoading({ uni.showLoading({

Loading…
Cancel
Save