From 2cf95b174c85093cae61be347341a5ad3255f723 Mon Sep 17 00:00:00 2001 From: songguoqiang Date: Wed, 18 Jun 2025 18:46:48 +0800 Subject: [PATCH] =?UTF-8?q?YT-2772=EF=BC=9A=E8=A1=A5=E6=96=99=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=92=8C=E8=A1=A5=E6=96=99=E8=AE=B0=E5=BD=95=E4=B8=BB?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=AD=E9=83=A8=E9=97=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repleinsh/repleinshJobMain/index.vue | 6 ++- .../repleinshJobMain/repleinshJobMain.data.ts | 52 +++++++++++++++---- .../repleinsh/repleinshRecordMain/index.vue | 6 ++- .../repleinshRecordMain.data.ts | 52 +++++++++++++++---- .../repleinshRequestMain.data.ts | 19 +++++++ 5 files changed, 115 insertions(+), 20 deletions(-) diff --git a/src/views/wms/issueManage/repleinsh/repleinshJobMain/index.vue b/src/views/wms/issueManage/repleinsh/repleinshJobMain/index.vue index 021c4b9f2..a7a159cd1 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshJobMain/index.vue +++ b/src/views/wms/issueManage/repleinsh/repleinshJobMain/index.vue @@ -75,6 +75,7 @@ import * as RepleinshJobDetailApi from '@/api/wms/repleinshJobDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' const { loadStart, loadDone } = usePageLoading() // 补料任务主 defineOptions({ name: 'RepleinshJobMain' }) @@ -314,10 +315,13 @@ const buttonTableClick = async (val, row) => { buttonBaseClick('refresh',null) } } - +// 获取部门 用于详情 部门回显 +const { wsCache } = useCache() /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { + const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name + if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) detailRef.value.openDetail(row, titleName, titleValue,"jobRepleinshMain") } diff --git a/src/views/wms/issueManage/repleinsh/repleinshJobMain/repleinshJobMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshJobMain/repleinshJobMain.data.ts index edf65acf1..e111651d3 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshJobMain/repleinshJobMain.data.ts +++ b/src/views/wms/issueManage/repleinsh/repleinshJobMain/repleinshJobMain.data.ts @@ -1,6 +1,24 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' - +import * as getRequestsettingApi from '@/api/wms/requestsetting/index' +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize: 10, + pageNo: 1, + code: 'RepleinmentRequest', + businessTypeCode: 'Repleinment' +} +const data = await getRequestsettingApi.getRequestsettingPage(queryParams) +const requestsettingData = data?.list[0] || {} +// 获取当前操作人的部门 +import { useUserStore } from '@/store/modules/user' +import { TableColumn } from '@/types/table' +import { getLocationPageRepleinsh } from '@/api/wms/location' +const userStore = useUserStore() +const userDept = userStore.userSelfInfo.dept +// id 转str 否则form回显匹配不到 +userDept.id = userDept.id.toString() +const userDeptArray: any = [userDept] /** * @returns {Array} 补料任务主表 */ @@ -225,14 +243,30 @@ export const RepleinshJobMain = useCrudSchemas(reactive([ }, }, { - label: '部门', - field: 'departmentCode', - sort: 'custom', - table: { - width: 150 - }, - isTable: false, - }, + label: '部门', + field: 'departmentCode', + sort: 'custom', + isForm: false, + table: { + width: 150 + }, + isTable: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userDeptArray.find((account) => account.id == cellValue)?.name + }, + form: { + value: userDept.id, + component: 'Select', + api: () => userDeptArray, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + } + }, { label: '承接时间', field: 'acceptTime', diff --git a/src/views/wms/issueManage/repleinsh/repleinshRecordMain/index.vue b/src/views/wms/issueManage/repleinsh/repleinshRecordMain/index.vue index 014fc6f0c..d76786bc2 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRecordMain/index.vue +++ b/src/views/wms/issueManage/repleinsh/repleinshRecordMain/index.vue @@ -69,6 +69,7 @@ import * as RepleinshRecordDetailApi from '@/api/wms/repleinshRecordDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' const { loadStart, loadDone } = usePageLoading() // 补料记录主 defineOptions({ name: 'RepleinshRecordMain' }) @@ -139,10 +140,13 @@ const butttondata = (row,$index) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { } - +// 获取部门 用于详情 部门回显 +const { wsCache } = useCache() /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { + const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name + if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) detailRef.value.openDetail(row, titleName, titleValue,"record_repleinsh_main") } diff --git a/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts index 852be8c4a..df93c12c3 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts +++ b/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts @@ -1,6 +1,24 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' - +import * as getRequestsettingApi from '@/api/wms/requestsetting/index' +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize: 10, + pageNo: 1, + code: 'RepleinmentRequest', + businessTypeCode: 'Repleinment' +} +const data = await getRequestsettingApi.getRequestsettingPage(queryParams) +const requestsettingData = data?.list[0] || {} +// 获取当前操作人的部门 +import { useUserStore } from '@/store/modules/user' +import { TableColumn } from '@/types/table' +import { getLocationPageRepleinsh } from '@/api/wms/location' +const userStore = useUserStore() +const userDept = userStore.userSelfInfo.dept +// id 转str 否则form回显匹配不到 +userDept.id = userDept.id.toString() +const userDeptArray: any = [userDept] /** * @returns {Array} 补料记录主表 */ @@ -225,14 +243,30 @@ export const RepleinshRecordMain = useCrudSchemas(reactive([ }, }, { - label: '部门代码', - field: 'departmentCode', - sort: 'custom', - table: { - width: 150 - }, - isTable: false, - }, + label: '部门', + field: 'departmentCode', + sort: 'custom', + isForm: false, + table: { + width: 150 + }, + isTable: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userDeptArray.find((account) => account.id == cellValue)?.name + }, + form: { + value: userDept.id, + component: 'Select', + api: () => userDeptArray, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + } + }, { label: '接口类型', field: 'interfaceType', diff --git a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts index 8d0b13269..266b0e351 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts +++ b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts @@ -645,6 +645,7 @@ export const RepleinshRequestMainRules = reactive({ toAreaTypes: [{ required: true, message: '请选择到库区类型范围', trigger: 'change' }], departmentCode: [{ required: true, message: '请输入部门', trigger: 'blur' }], day: [{ required: true, message: '请选择日期时间', trigger: 'blur' }], + deliNo: [{ required: true, message: '请选择便次', trigger: 'blur' }], autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }], autoAgree: [{ required: true, message: '请选择是否自动通过', trigger: 'change' }], autoExecute: [{ required: true, message: '请选择是否自动执行', trigger: 'change' }], @@ -926,6 +927,24 @@ export const RepleinshRequestDetail = useCrudSchemas( }, isTable: true, }, + { + label: '来源库位', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + hiddenInMain: true, + sortSearchDefault: 1000, + // isSearch: true, + sortTableDefault: 1100, + isTableForm: false, + form: { + componentProps: { + disabled: true + } + } + }, { label: '目标库位', field: 'toLocationCode',