diff --git a/src/api/wms/productreceiptRecordMain/index.ts b/src/api/wms/productreceiptRecordMain/index.ts index 0fe298f8c..ed7e0d8a3 100644 --- a/src/api/wms/productreceiptRecordMain/index.ts +++ b/src/api/wms/productreceiptRecordMain/index.ts @@ -138,3 +138,13 @@ export const createInspectRequest = async (number:string) => { export const handleRecoveryProductreceiptRecord = async (data: ProductreceiptRecordMainVO) => { return await request.put({ url: `/wms/productreceipt-record-main/handleRecovery`, data }) } + +// 接收隔离收货 +export const receive = (id) => { + return request.put({ url: '/wms/productreceipt-record-main/receive?id=' + id }) +} + +// 拒收隔离收货 +export const refuse = (id) => { + return request.put({ url: '/wms/productreceipt-record-main/refuse?id=' + id }) +} \ No newline at end of file diff --git a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue index 9dd2e490f..e47416124 100644 --- a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue @@ -259,7 +259,7 @@ const butttondata = (row,$index) => { return [] } return [ - defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:inventoryinit-request-main:close'}), // 关闭 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:inventoryinit-request-main:close'}), // 关闭 defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:inventoryinit-request-main:reAdd'}), //重新添加 defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventoryinit-request-main:submit'}), // 提交审批 defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventoryinit-request-main:refused'}), // 驳回 diff --git a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/index.vue b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/index.vue index be0ca8bfa..dc906afd0 100644 --- a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/index.vue +++ b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/index.vue @@ -171,18 +171,95 @@ const buttonBaseClick = (val, item) => { } } +// 根据状态返回该按钮是否显示 +const isShowMainButton = (row,val) => { + if (val.indexOf(row.receiveStatus) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 const butttondata = (row,$index) => { const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 if(findIndex>-1&&findIndex<$index){ return [] } - return [] + return [ + { + label: '拒收', + name: 'mainJobRefusal', + hide: isShowMainButton(row, ['0']), + type: 'primary', + icon: '', + color: '', + hasPermi: '', + link: true // 文本展现按钮 + }, + { + label: '接收', + name: 'mainJobRecept', + hide: isShowMainButton(row, ['0']), + type: 'primary', + icon: '', + color: '', + hasPermi: '', + link: true // 文本展现按钮 + } + ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + if(val == 'mainJobRefusal'){ + // 拒收 + handleRefusal(row) + }else if(val == 'mainJobRecept'){ + // 接收 + handleRecept(row) + } } + + +// 拒收 +const handleRefusal = async (row) => { + try { + loadStart() + // 接口 + ProductreceiptRecordMainApi.refuse(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + buttonBaseClick('refresh',null) + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } catch { + } finally { + loadDone() + } +} +// 接收 +const handleRecept = async (row) => { + try { + loadStart() + // 接口 + ProductreceiptRecordMainApi.receive(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + buttonBaseClick('refresh',null) + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } catch { + } finally { + loadDone() + } +} + + // 获取部门 用于详情 部门回显 const { wsCache } = useCache() /** 详情操作 */ diff --git a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/productreceiptscrapRecordMain.data.ts b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/productreceiptscrapRecordMain.data.ts index 1f13ef026..b719a51d3 100644 --- a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/productreceiptscrapRecordMain.data.ts +++ b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/productreceiptscrapRecordMain.data.ts @@ -19,6 +19,7 @@ export const ProductreceiptRecordMain = useCrudSchemas(reactive([ label: '申请单号', field: 'requestNumber', sort: 'custom', + sortTableDefault:996, table: { width: 180 }, @@ -28,6 +29,7 @@ export const ProductreceiptRecordMain = useCrudSchemas(reactive([ label: '任务单号', field: 'jobNumber', sort: 'custom', + sortTableDefault:997, table: { width: 180 }, @@ -395,6 +397,18 @@ export const ProductreceiptRecordMainRules = reactive({ * @returns {Array} 制品收货记录子表 */ export const ProductreceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '接收状态', + field: 'receiveStatus', + sort: 'custom', + dictType: DICT_TYPE.RECEIVE_STATUS, + dictClass: 'string', + sortTableDefault:998, + isTable: true, + table: { + width: 150 + }, + }, { label: '生产线代码', field: 'productionlineCode', @@ -730,7 +744,6 @@ export const ProductreceiptRecordDetail = useCrudSchemas(reactive( width: 150, fixed: 'right' }, - hiddenInMain:true, isTableForm:false, } ]))