From 5488e982c709f5a634b9b7d78ffba142c7e10faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Thu, 23 Nov 2023 15:17:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=94=B6=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/productionreceiptJobMain/index.ts | 27 +++- .../productionreceiptJobMain/index.vue | 133 +++++++++++++----- 2 files changed, 121 insertions(+), 39 deletions(-) diff --git a/src/api/wms/productionreceiptJobMain/index.ts b/src/api/wms/productionreceiptJobMain/index.ts index 1095c3500..471ddba7c 100644 --- a/src/api/wms/productionreceiptJobMain/index.ts +++ b/src/api/wms/productionreceiptJobMain/index.ts @@ -74,10 +74,35 @@ export const deleteProductionreceiptJobMain = async (id: number) => { // 导出生产收料任务主 Excel export const exportProductionreceiptJobMain = async (params) => { - return await request.download({ url: `/wms/productionreceipt-job-main/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/productionreceipt-job-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/productionreceipt-job-main/export-excel`, params }) + } } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/productionreceipt-job-main/get-import-template' }) +} + +// 承接发料任务 +export const acceptIssueMain = async (id) => { + return await request.get({ url: `/wms/productionreceipt-job-main/accept?id=` + id }) +} + +// 放弃发料任务 +export const abandonIssueMain = async (id) => { + return await request.get({ url: `/wms/productionreceipt-job-main/abandon?id=` + id }) +} + +// 关闭发料任务 +export const closeIssueMain = async (id) => { + return await request.get({ url: `/wms/productionreceipt-job-main/close?id=` + id }) +} + +// 执行发料任务 +export const executeIssueMain = async (data) => { + return await request.put({ url: `/wms/productionreceipt-job-main/execute`, data}) } \ No newline at end of file diff --git a/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/index.vue b/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/index.vue index 8db883a4d..1157ed240 100644 --- a/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/index.vue +++ b/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/index.vue @@ -90,42 +90,19 @@ const updataTableColumns = (val) => { // 查询列表页面参数设置 const searchTableParams = ref([ -//{ -// formField: 'productItemCode', -// searchTableTitle: '物料信息', -// searchTableAllSchemas: Itembasic.allSchemas, -// searchTablePage: ItembasicApi.getItembasicPage -//} ]) // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { if (type == 'tableForm') { - // 明细查询页赋值 - //row[formField] = val[0][searchField] - //row['poLine'] = val[0]['poLine'] - //row['batch'] = val[0]['toBatch'] - //row['altBatch'] = val[0]['altBatch'] - //row['itemCode'] = val[0]['itemCode'] - //row['itemName'] = val[0]['itemName'] - //row['itemDesc1'] = val[0]['itemDesc1'] - //row['itemDesc2'] = val[0]['itemDesc2'] - //row['projectCode'] = val[0]['projectCode'] - //row['qty'] = val[0]['qty'] - //row['uom'] = val[0]['uom'] } else { const setV = {} setV[formField] = val[0][searchField] - //setV['ppNumber'] = val[0]['ppNumber'] - //setV['supplierCode'] = val[0]['supplierCode'] formRef.setValues(setV) } }) } -// 子表新增的时候选择表格之后需要会显得字段 -// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] -const Echo = [] const { tableObject, tableMethods } = useTable({ getListApi: ProductionreceiptJobMainApi.getProductionreceiptJobMainPage // 分页接口 @@ -140,14 +117,6 @@ const HeadButttondata = [ defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 - // { - // label: '自定义扩展按钮', - // name: 'zdy', - // hide: false, - // type: 'primary', - // icon: 'Select', - // color: '' - // }, ] // 头部按钮事件 @@ -177,20 +146,108 @@ const butttondata = (row) => { defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), // 关闭 defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 - // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 + defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainJobExe') { // 执行 - console.log('列表-操作按钮事件-执行') + let aaa = { + id: '1809190000221670786', + requestNumber: "REC4620231120-0001", + workShopCode: "222", + fromWarehouseCode: null, + toWarehouseCode: null, + requestTime: 1700449299000, + requestDueTime: 1700448320000, + status: "4", + expiredTime: null, + // updateTime: 1700551119000, + // updater: "1", + priority: null, + priorityIncrement: null, + departmentCode: "研发部门", + acceptUserId: "1", + acceptTime: 1700562156000, + completeUserName: null, + completeTime: null, + fromLocationTypes: "RAW,SEMI", + toLocationTypes: "WIP", + number: "JOB0620231121-0001", + businessType: "Issue", + remark: null, + createTime: 1700551119000, + creator: "1", + fromAreaCodes: "", + toAreaCodes: "", + useOnTheWayLocation: "TRUE", + autoComplete: "FALSE", + allowModifyLocation: "TRUE", + allowModifyQty: "TRUE", + allowBiggerQty: "TRUE", + allowSmallerQty: "TRUE", + allowModifyInventoryStatus: "TRUE", + allowContinuousScanning: "TRUE", + allowPartialComplete: "TRUE", + allowModifyPackingNumber: "FALSE", + allowModifyBatch: "FALSE", + subList: [{ + id: '1809190000965784282', + productionLineCode: "111", + workStationCode: "555", + inventoryStatus: "OK", + onTheWayLocationCode: null, + packingNumber: "12", + containerNumber: "001", + batch: "21", + fromLocationCode: "H03", + toLocationCode: "1", + itemCode: "item01", + itemName: "物品01", + itemDesc1: "", + itemDesc2: "", + stdPackQty: null, + stdPackUnit: null, + supplierQty: null, + supplierUom: null, + projectCode: "xm01", + qty: 50, + uom: "EA", + number: "JOB0620231121-0001", + remark: null, + createTime: 1700550582000, + creator: "1", + fromOwnerCode: null, + toOwnerCode: null, + // updateTime: 1700551119000, + // updater: "1", + recordLst: [{ + handleQty: 10, + toPackingNumber: '12', + toContainerNumber: '001', + toBatch: '21', + toInventoryStatus: 'OK', + toLocationCode: 'H03', + supplierCode: '31213', + },{ + handleQty: 22, + toPackingNumber: 'M20230421000005', + toContainerNumber: '001', + toBatch: '20230808', + toInventoryStatus: 'OK', + toLocationCode: 'SFG', + supplierCode: '31213', + }] + }] + } + ProductionreceiptJobMainApi.executeIssueMain(aaa) } else if (val == 'mainJobAba') { // 放弃 - console.log('列表-操作按钮事件-放弃') + ProductionreceiptJobMainApi.abandonIssueMain(row.id) } else if (val == 'mainJobClo') { // 关闭 - console.log('列表-操作按钮事件-关闭') + ProductionreceiptJobMainApi.closeIssueMain(row.id) } else if (val == 'mainJobAcc') { // 承接 - console.log('列表-操作按钮事件-承接') + ProductionreceiptJobMainApi.acceptIssueMain(row.id) } } @@ -208,8 +265,8 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await ProductionreceiptJobMainApi.exportProductionreceiptJobMain(setSearchParams) - download.excel(data, '生产收料任务主.xlsx') + const data = await ProductionreceiptJobMainApi.exportProductionreceiptJobMain(tableObject.params) + download.excel(data, '生产收料任务.xlsx') } catch { } finally { exportLoading.value = false