Browse Source

补料申请

master
陈薪名 1 year ago
parent
commit
e3bf19bb6d
  1. 36
      src/api/wms/repleinshRequestMain/index.ts
  2. 12
      src/views/wms/issueManage/issue/issueRequestMain/index.vue
  3. 84
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue

36
src/api/wms/repleinshRequestMain/index.ts

@ -57,10 +57,46 @@ export const deleteRepleinshRequestMain = async (id: number) => {
// 导出补料申请主 Excel
export const exportRepleinshRequestMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/repleinsh-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/repleinsh-request-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/repleinsh-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/repleinsh-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/repleinsh-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/repleinsh-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/repleinsh-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/repleinsh-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/repleinsh-request-main/handle?id=' + id })
}

12
src/views/wms/issueManage/issue/issueRequestMain/index.vue

@ -172,12 +172,12 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:issue-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:issue-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:issue-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:issue-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:issue-request-main:handle'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:issue-request-main:update'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:issue-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:issue-request-main:delete'}), //
]

84
src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue

@ -67,7 +67,6 @@
:apiUpdate="RepleinshRequestDetailApi.updateRepleinshRequestDetail"
:apiPage="RepleinshRequestDetailApi.getRepleinshRequestDetailPage"
:apiDelete="RepleinshRequestDetailApi.deleteRepleinshRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
@ -104,21 +103,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
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)
}
})
@ -132,10 +119,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: RepleinshRequestMainApi.getRepleinshRequestMainPage //
})
@ -145,7 +128,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:repleinsh-request-main:create'}), //
defaultButtons.defaultAddBtn({hasPermi:'wms:repleinsh-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:repleinsh-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:repleinsh-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
@ -189,13 +172,14 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:repleinsh-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:repleinsh-request-main:delete'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:repleinsh-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:repleinsh-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:repleinsh-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:repleinsh-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:repleinsh-request-main:handle'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:repleinsh-request-main:update'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:repleinsh-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:repleinsh-request-main:delete'}), //
]
}
@ -204,15 +188,51 @@ const butttondata = (row) => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
await message.confirm('确认要关闭吗?')
RepleinshRequestMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
await message.confirm('确认要重新添加吗?')
RepleinshRequestMainApi.reAdd(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
await message.confirm('确认要重新添加吗?')
RepleinshRequestMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
await message.confirm('确认要重新添加吗?')
RepleinshRequestMainApi.refused(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
RepleinshRequestMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainHandle') { //
RepleinshRequestMainApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
@ -255,7 +275,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await RepleinshRequestMainApi.exportRepleinshRequestMain(setSearchParams)
download.excel(data, '补料申请.xlsx')
download.excel(data, '补料申请.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -308,7 +328,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '补料申请导入模版.xlsx'
templateTitle: '补料申请导入模版.xlsx'
})
//

Loading…
Cancel
Save