Browse Source

线上问题:预生产收货记录和制品回收记录导出,调用公用方法区分type

hella_online_20240924
tengxiaofei 2 months ago
parent
commit
87e3f8bf35
  1. 14
      src/api/wms/productreceiptRecordMain/index.ts
  2. 13
      src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue
  3. 12
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/index.vue

14
src/api/wms/productreceiptRecordMain/index.ts

@ -86,14 +86,14 @@ export const deleteProductreceiptRecordMain = async (id: number) => {
// 导出制品收货记录主 Excel // 导出制品收货记录主 Excel
export const exportProductreceiptRecordMain = async (params) => { export const exportProductreceiptRecordMain = async (params) => {
params.type = 'predict' // params.type = 'predict'
if (params.isSearch) { if (params.isSearch) {
const cmd = { // const cmd = {
'column':'type', // 'column':'type',
'action':'==', // 'action':'==',
'value':'predict' // 'value':'predict'
} // }
params.filters.push(cmd) // params.filters.push(cmd)
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.downloadPost({ url: '/wms/productreceipt-record-main/export-excel-senior', data }) return await request.downloadPost({ url: '/wms/productreceipt-record-main/export-excel-senior', data })

13
src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue

@ -339,6 +339,19 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
debugger
tableObject.params.type = 'predict'
if (tableObject.params.isSearch){
const cmd = {
'column':'type',
'action':'==',
'value':'predict'
}
if (!Array.isArray(tableObject.params.filters)) {
tableObject.params.filters = [];
}
tableObject.params.filters.push(cmd)
}
const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(tableObject.params) const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {

12
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/index.vue

@ -201,6 +201,18 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
tableObject.params.type = 'scrap'
if (tableObject.params.isSearch){
const cmd = {
'column':'type',
'action':'==',
'value':'scrap'
}
if (!Array.isArray(tableObject.params.filters)) {
tableObject.params.filters = [];
}
tableObject.params.filters.push(cmd)
}
const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(tableObject.params) const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {

Loading…
Cancel
Save