diff --git a/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts b/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts index b15436d33..14153366b 100644 --- a/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts +++ b/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts @@ -45,7 +45,25 @@ export const ContainerMainRequest = useCrudSchemas(reactive([ table: { width: 100 }, - },{ + }, { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isForm: false, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { label: '类型', field: 'type', sort: 'custom', @@ -55,6 +73,11 @@ export const ContainerMainRequest = useCrudSchemas(reactive([ isTable: true, table: { width: 120 + }, + form:{ + componentProps:{ + disabled: true, + } } }, { @@ -308,6 +331,16 @@ export const ContainerDetailRequest = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + disabled: true, + type: 'Select' + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled: true, + } + } }, { label: '目标库位代码', @@ -337,17 +370,61 @@ export const ContainerDetailRequest = useCrudSchemas(reactive([ } }, { - label: '数量', - field: 'qty', + label: '从库存状态', + field: 'fromInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + disabled: true, + type: 'Select' + }, + }, + { + label: '到库存状态', + field: 'toInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + type: 'Select' + }, + }, + // { + // label: '从数量', + // field: 'fromQty', + // sort: 'custom', + // tableForm: { + // disabled: true, + // }, + // }, + { + label: '到数量', + field: 'toQty', sort: 'custom', }, { label: '计量单位', field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, sort: 'custom', table: { - width: 120 + width: 150 }, + tableForm:{ + disabled: true, + type: 'Select' + } }, { label: '备注', diff --git a/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue b/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue index e2b234ab2..9d28c0abc 100644 --- a/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue +++ b/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue @@ -34,7 +34,7 @@ @@ -90,7 +90,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' -defineOptions({ name: 'ContainerMainRequest' }) +defineOptions({ name: 'ContainerManage' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -110,38 +110,54 @@ const { tableObject, tableMethods } = useTable({ /** * */ - if ( routeName.value == 'scrapContainerMainRequest') { + if ( routeName.value == 'ScrapContainerManage') { tableObject.params = { type:'SCRAP' } - // toLocationCode.value = "SCRAP_CONTAIN" + ContainerMainRequest.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'type'){ + item.value = "SCRAP" + }}); + ContainerDetailRequest.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'toInventoryStatus'){ + item.value = "SCRAP" + } + }); businessType.value = 'ScrapContainerManage' importFileName.value = '器具报废申请' -} else if ( routeName.value == 'returnContainerMain') { +} else if ( routeName.value == 'ReturnContainerManage') { tableObject.params = { type:'RETURN' } - // fromLocationCode.value = null - // toLocationCode.value = "NULL_CONTAIN" + ContainerMainRequest.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'type'){ + item.value = "RETURN" + }}); businessType.value = 'ReturnContainerManage' importFileName.value = '器具返回申请' -} else if ( routeName.value == 'moveContainerMainRequest') { +} else if ( routeName.value == 'MoveContainerManage') { tableObject.params = { type:'MOVE' } - // fromLocationCode.value = null - // toLocationCode.value = null + ContainerMainRequest.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'type'){ + item.value = "MOVE" + }}); businessType.value = 'MoveContainerManage' + importFileName.value = '器具转移申请' -} else if ( routeName.value == 'deliverContainerMainRequest') { +} else if ( routeName.value == 'DeliverContainerManage') { tableObject.params = { type: 'DELIVER', } - // fromLocationCode.value = null - // toLocationCode.value = null - businessType.value = 'DeliverContainerMainRequest' - importFileName.value = '器具发运申请' -} else if( routeName.value == 'containerMainRequest'){ + //主表字段赋值 + ContainerMainRequest.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'type'){ + item.value = "DELIVER" + }}); + businessType.value = 'DeliverContainerManage' + importFileName.value = '器具管理申请' +} else if( routeName.value == 'ContainerManage'){ businessType.value = 'ContainerManage' importFileName.value = '器具管理申请' } @@ -153,8 +169,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => nextTick(() => { if (type == 'tableForm') { if(formField == 'containerNumber') { - row['containerNumber'] = val[0]['code'] + row['containerNumber'] = val[0]['itemCode'] row['uom'] = val[0]['uom'] + row['fromLocationCode'] = val[0]['locationCode'] + row['fromInventoryStatus'] = val[0]['inventoryStatus'] }else if(formField == 'toLocationCode'){ row['toLocationCode'] = val[0]['code'] }else { @@ -172,8 +190,10 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { nextTick(() => { const setV = {} if(formField == 'containerNumber') { - setV['containerNumber'] = val[0]['itemCode'] - setV['fromLocationNumber'] = val[0]['locationNumber'] + setV['containerNumber'] = val[0]['code'] + setV['uom'] = val[0]['uom'] + }else if(formField == 'toLocationCode'){ + setV['toLocationCode'] = val[0]['code'] }else { setV[formField] = val[0][searchField] } @@ -307,7 +327,73 @@ const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['ma // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - if (val == 'edit') { // 编辑 + if (val == 'mainClose') { // 关闭 + await message.confirm('确认要关闭吗?') + tableObject.loading = true + ContainerMainRequestApi.close(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'mainReAdd') { // 重新添加 + await message.confirm('确认要重新添加吗?') + tableObject.loading = true + ContainerMainRequestApi.reAdd(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'mainSubmit') { // 提交审批 + await message.confirm('确认要提交审批吗?') + tableObject.loading = true + ContainerMainRequestApi.submit(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'mainTurnDown') { // 驳回 + await message.confirm('确认要驳回吗?') + tableObject.loading = true + ContainerMainRequestApi.refused(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'mainApprove') { // 审批通过 + await message.confirm('确认要审批通过吗?') + tableObject.loading = true + ContainerMainRequestApi.agree(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'mainHandle') { // 处理 + await message.confirm('确认要处理吗?') + tableObject.loading = true + ContainerMainRequestApi.handle(row.masterId).then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) @@ -347,14 +433,15 @@ const flag = ref() const submitForm = async (formType,data) => { data.subList = tableData.value // 拼接子表数据参数 data.subList.forEach(item => { - if(item.qty == 0){ + if(item.toQty == 0){ message.error(`到数量不能为0!`) flag.value = true return; - } + } }) try { if (formType === 'create') { + data.businessType = businessType.value await ContainerMainRequestApi.createContainerMainRequest(data) message.success(t('common.createSuccess')) } else { diff --git a/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue b/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue index 43462be56..534c99432 100644 --- a/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue +++ b/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue @@ -90,7 +90,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' -defineOptions({ name: 'initialContainerMainRequest' }) +defineOptions({ name: 'InitialContainerManage' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -109,11 +109,15 @@ const { tableObject, tableMethods } = useTable({ /** * */ - if ( routeName.value == 'initialContainerMainRequest') { + if ( routeName.value == 'InitialContainerManage') { tableObject.params = { - type:'INITIAL' + type:'INITIAL', } - businessType.value = 'InitialContainerManageRequest' + ContainerMainRequest.allSchemas.formSchema.forEach(item=>{ + if(item.field == 'type'){ + item.value = "INITIAL" + }}); + businessType.value = 'InitialContainerManage' importFileName.value = '器具初始化申请' } @@ -126,6 +130,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => if(formField == 'containerNumber') { row['containerNumber'] = val[0]['code'] row['uom'] = val[0]['uom'] + row['toInventoryStatus'] = 'OK' }else if(formField == 'toLocationCode'){ row['toLocationCode'] = val[0]['code'] }else { diff --git a/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts b/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts index e1f6cfe03..d7385bc01 100644 --- a/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts +++ b/src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts @@ -32,7 +32,6 @@ const queryParams = { // 获取当前操作人的部门 import { useUserStore } from '@/store/modules/user' -import { ItemBasic } from '@/utils/disposition/formFields' const userStore = useUserStore() const userDept = userStore.userSelfInfo.dept // id 转str 否则form回显匹配不到 @@ -63,7 +62,6 @@ export const ContainerMainRequest = useCrudSchemas(reactive([ width: 150 }, form: { - value: '1', componentProps: { disabled: true } @@ -79,6 +77,11 @@ export const ContainerMainRequest = useCrudSchemas(reactive([ isTable: true, table: { width: 120 + }, + form:{ + componentProps:{ + disabled: true, + } } }, {