diff --git a/src/api/wms/countRequestMain/index.ts b/src/api/wms/countRequestMain/index.ts index 7c47d57c4..1205ae708 100644 --- a/src/api/wms/countRequestMain/index.ts +++ b/src/api/wms/countRequestMain/index.ts @@ -92,3 +92,17 @@ export const refused = async (id) => { export const handle = async (id) => { return await request.put({ url: `/wms/count-request-main/handle?id=` + id }) } + +//重盘 +export const reCount = async (data) => { + return await request.put({ url: `/wms/count-request-main/reCount`,data}) +} + +//监盘 +export const superviseCount = async (data) => { + return await request.put({ url: `/wms/count-request-main/supervise`,data}) +} +//生成盘点调整申请 +export const generateCountadjustRequest = async (id) => { + return await request.put({ url: `/wms/count-request-main/generateCountadjustRequest?id=` + id }) +} \ No newline at end of file diff --git a/src/components/SearchTableCount/index.ts b/src/components/SearchTableCount/index.ts new file mode 100644 index 000000000..a43f93a28 --- /dev/null +++ b/src/components/SearchTableCount/index.ts @@ -0,0 +1,3 @@ +import SearchTableCount from './src/SearchTableCount.vue' + +export { SearchTableCount } diff --git a/src/components/SearchTableCount/src/SearchTableCount.vue b/src/components/SearchTableCount/src/SearchTableCount.vue new file mode 100644 index 000000000..d49c81f67 --- /dev/null +++ b/src/components/SearchTableCount/src/SearchTableCount.vue @@ -0,0 +1,222 @@ + + + \ No newline at end of file diff --git a/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts b/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts index 2bc04a40b..1c84daf25 100644 --- a/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts +++ b/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts @@ -252,6 +252,7 @@ export const CountRecordMain = useCrudSchemas(reactive([ field: 'action', isDetail: false, isForm: false, + isTable: false, table: { width: 180, fixed: 'right' diff --git a/src/views/wms/countManage/count/countRequestMain/index.vue b/src/views/wms/countManage/count/countRequestMain/index.vue index 729415fe3..923456649 100644 --- a/src/views/wms/countManage/count/countRequestMain/index.vue +++ b/src/views/wms/countManage/count/countRequestMain/index.vue @@ -90,9 +90,9 @@ :mode="2" /> - @@ -107,7 +107,7 @@ import { import * as CountRequestMainApi from '@/api/wms/countRequestMain' import * as CountRequestDetailApi from '@/api/wms/countRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import { SearchTable } from '@/components/SearchTable' +import { SearchTableCount } from '@/components/SearchTableCount' // 盘点申请 defineOptions({ name: 'CountRequestMain' }) @@ -160,6 +160,34 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => } }) } +// 重盘和监盘点击去确定的时候返回 +const searchTableSuccessCount = (formField, searchField, val, type,row,count) => { + nextTick(() => { + if (formField == 'reCount') { + // 重盘 + if(type == 3){ + row.subList = val + } + row.type = type + CountRequestMainApi.reCount(row).then((res)=>{ + message.success('重盘成功') + getList() + }) + } else { + // 监盘 + if(type == 2){ + row.subList = val + }else if(type == 1){ + row.count = count + } + row.type = type + CountRequestMainApi.superviseCount(row).then((res)=>{ + message.success('监盘成功') + getList() + }) + } + }) +} // 子表新增的时候选择表格之后需要会显得字段 // const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] const Echo = [] @@ -231,6 +259,15 @@ const isShowReCountMainButton = (row, val) => { return true } } +// 根据状态返回该按钮是否显示 +const isShowGenerateMainButton = (row, val) => { + if (row.countAdjustStatus == 2) { + return false + } else { + return true + } +} + const searchTableRef = ref() // 列表-操作按钮 @@ -271,7 +308,11 @@ const butttondata = (row) => { defaultButtons.mainSuperviseCountBtn({ hide: isShowReCountMainButton(row, ['1']), hasPermi: 'wms:count-request-main:supervise' - }) // 监盘 + }), // 监盘 + defaultButtons.mainCountAdjustRequesttBtn({ + hide: isShowGenerateMainButton(row, ['1']), + hasPermi: 'wms:count-request-main:generate' + }) // 生成盘点调整 ] } @@ -346,25 +387,38 @@ const buttonTableClick = async (val, row) => { }) } else if (val == 'mainReCount') { // 重盘 - // CountRequestMainApi.handle(row.id).then(() => { - // message.success(t('处理成功')) - // getList() - // }).catch(err => { - // console.log(err) - // }) - console.log(CountRequestDetail.allSchemas) - console.log(CountRequestDetailApi.getCountRequestDetailPage) - console.log('formField','') - console.log('formField','') - searchTableRef.value.open('盘点申请明细',CountRequestDetail.allSchemas,CountRequestDetailApi.getCountRequestDetailPage,'','','','',row,{masterId:row.id}) + const radioList = ref([{ + label:1, + title:'全部' + },{ + label:2, + title:'差异' + },{ + label:3, + title:'选择' + }]) + searchTableRef.value.open('盘点申请明细',CountRequestDetail.allSchemas,CountRequestDetailApi.getCountRequestDetailPage,'reCount','',true,'',row,{masterId:row.id},'',radioList.value) } else if (val == 'mainSuperviseCount') { // 监盘 - // CountRequestMainApi.handle(row.id).then(() => { - // message.success(t('处理成功')) - // getList() - // }).catch(err => { - // console.log(err) - // }) + const radioList = ref([{ + label:1, + title:'数量' + },{ + label:2, + title:'选择' + }]) + searchTableRef.value.open('盘点申请明细',CountRequestDetail.allSchemas,CountRequestDetailApi.getCountRequestDetailPage,'superviseCount','',true,'',row,{masterId:row.id},'',radioList.value) + } else if (val == 'countAdjustRequest') { + // 生成盘点调整申请 + await message.confirm('确认要生成盘点调整申请吗?') + CountRequestMainApi.generateCountadjustRequest(row.id) + .then(() => { + message.success(t('已生成盘点调整申请')) + getList() + }) + .catch((err) => { + console.log(err) + }) } else if (val == 'edit') { // 编辑 openForm('update', row) @@ -381,66 +435,6 @@ const openForm = async (type: string, row?: number) => { formRef.value.open(type, row) } -/** 关闭按钮操作 */ -const handleClose = async (id: number) => { - try { - await message.confirm(t('common.confirmColse')) - await CountRequestMainApi.closeCountRequestMain(id) - message.success(t('common.closeSuccess')) - await getList() - } catch {} -} - -/** 重新添加按钮操作 */ -const handleReAdd = async (id: number) => { - try { - await message.confirm(t('common.confirmReAdd')) - await CountRequestMainApi.reAddCountRequestMain(id) - message.success(t('common.reAddSuccess')) - await getList() - } catch {} -} - -/** 审批通过按钮操作 */ -const handleAgree = async (id: number) => { - try { - await message.confirm(t('common.confirmAgree')) - await CountRequestMainApi.agreeCountRequestMain(id) - message.success(t('common.agreeSuccess')) - await getList() - } catch {} -} - -/** 审批驳回按钮操作 */ -const handleRefused = async (id: number) => { - try { - await message.confirm(t('common.confirmRefused')) - await CountRequestMainApi.refusedCountRequestMain(id) - message.success(t('common.refusedSuccess')) - await getList() - } catch {} -} - -/** 处理按钮操作 */ -const handleHandle = async (id: number) => { - try { - await message.confirm(t('common.confirmHandle')) - await CountRequestMainApi.handleCountRequestMain(id) - message.success(t('common.handleSuccess')) - await getList() - } catch {} -} - -/** 提交按钮操作 */ -const handleSubmit = async (id: number) => { - try { - await message.confirm(t('common.confirmSubmit')) - await CountRequestMainApi.submitCountRequestMain(id) - message.success(t('common.submitSuccess')) - await getList() - } catch {} -} - /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => {