diff --git a/src/api/wms/customerreturnRecordMain/index.ts b/src/api/wms/customerreturnRecordMain/index.ts index 7dc032395..4da111669 100644 --- a/src/api/wms/customerreturnRecordMain/index.ts +++ b/src/api/wms/customerreturnRecordMain/index.ts @@ -78,4 +78,14 @@ export const exportCustomerreturnRecordMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/customerreturn-record-main/get-import-template' }) +} + +// 接收隔离收货 +export const receive = (id) => { + return request.put({ url: '/wms/customerreturn-record-main/receive?id=' + id }) +} + +// 拒收隔离收货 +export const refuse = (id) => { + return request.put({ url: '/wms/customerreturn-record-main/refuse?id=' + id }) } \ No newline at end of file diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/customerreturnRecordMain.data.ts b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/customerreturnRecordMain.data.ts index f11e49080..2cabe6c31 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/customerreturnRecordMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/customerreturnRecordMain.data.ts @@ -26,6 +26,7 @@ export const CustomerreturnRecordMain = useCrudSchemas( table: { width: 180 }, + sortTableDefault:996, isTable: true, isSearch: true }, @@ -33,6 +34,7 @@ export const CustomerreturnRecordMain = useCrudSchemas( label: '任务单号', field: 'jobNumber', sort: 'custom', + sortTableDefault:997, table: { width: 180 }, @@ -536,6 +538,18 @@ export const CustomerreturnRecordDetail = useCrudSchemas(reactive( // width: 150 // }, // }, + { + label: '接收状态', + field: 'receiveStatus', + sort: 'custom', + dictType: DICT_TYPE.RECEIVE_STATUS, + dictClass: 'string', + sortTableDefault:998, + isTable: true, + table: { + width: 150 + }, + }, { label: '物料代码', field: 'itemCode', @@ -895,8 +909,17 @@ export const CustomerreturnRecordDetail = useCrudSchemas(reactive( width: 150 }, isTable: false, - }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 180, + fixed: 'right' + }, + } ])) //表单校验 diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/index.vue b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/index.vue index 0543f330c..a4a8136da 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/index.vue @@ -130,13 +130,43 @@ 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 [] }else{ - return [defaultButtons.mainListDocumentPrintBtn(null),] // 标签打印 + return [ + defaultButtons.mainListDocumentPrintBtn(null), + { + 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 // 文本展现按钮 + }] // 标签打印 } } @@ -144,8 +174,52 @@ const butttondata = (row,$index) => { const buttonTableClick = async (val, row) => { if (val == 'documentPrint') { // 标签打印 handlePoint(row) + }else if(val == 'mainJobRefusal'){ + // 拒收 + handleRefusal(row) + }else if(val == 'mainJobRecept'){ + // 接收 + handleRecept(row) } } + +// 拒收 +const handleRefusal = async (row) => { + try { + loadStart() + // 接口 + CustomerreturnRecordMainApi.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() + // 接口 + CustomerreturnRecordMainApi.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() /** 详情操作 */