From 00b5861d170a13d7d8b5b5a3a512ee8f102ac46d Mon Sep 17 00:00:00 2001 From: zhangli <2235006734@qq.com> Date: Tue, 24 Oct 2023 08:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E7=B4=A2=E8=B5=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 2 + src/store/modules/user.ts | 7 +- src/utils/disposition/tableColumns.ts | 81 +++++++++++++++++-- .../wms/purchaseclaimRequestMain/index.vue | 31 ++++++- 4 files changed, 104 insertions(+), 17 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 685595369..3e8e211eb 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -221,6 +221,8 @@ const searchTableSuccess = (formField,searchField, val) => { /** 打开弹窗 */ const open = async (type: string, row?: any) => { + + console.log(props.tableAllSchemas); dialogVisible.value = true dialogTitle.value = t('action.' + type) formType.value = type diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index aa450fbe8..2f54e5e4c 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -59,12 +59,7 @@ export const useUserStore = defineStore('admin-user', { if (!userInfo) { userInfo = await getInfo() } - this.userSelfInfo = await getUserProfile() - // userInfo = await getInfo() - console.log(4); - console.log(this.userSelfInfo); - console.log(4); - + this.userSelfInfo = await getUserProfile() this.permissions = userInfo.permissions this.roles = userInfo.roles this.user = userInfo.user diff --git a/src/utils/disposition/tableColumns.ts b/src/utils/disposition/tableColumns.ts index c7af9304c..d83b4a2d0 100644 --- a/src/utils/disposition/tableColumns.ts +++ b/src/utils/disposition/tableColumns.ts @@ -1,6 +1,8 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as getRequestsettingApi from '@/api/wms/requestsetting/index.ts' + +// 获取当前操作人的部门 import { useUserStore } from '@/store/modules/user' const userStore = useUserStore() const userDept = userStore.userSelfInfo.dept @@ -12,8 +14,7 @@ const queryParams = { code:'PurchaseClaimRequest' } const data = await getRequestsettingApi.getRequestsettingPage(queryParams) - const requestsetting = data[0] - + const requestsettingData =data?.list[0]||{} /** * @returns {Array} 基础物料信息 @@ -10680,7 +10681,10 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive([ isTable: true, form:{ component:'Switch', - value:true, + value:requestsettingData.autoCommit, + componentProps:{ + disabled:true, + } } }, { @@ -10689,7 +10693,14 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: true, - isTable: true + isTable: true, + form:{ + component:'Switch', + value:requestsettingData.autoAgree, + componentProps:{ + disabled:true, + } + } }, { label: '自动执行', @@ -10697,7 +10708,14 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: true, - isTable: true + isTable: true, + form:{ + component:'Switch', + value:requestsettingData.autoExecute, + componentProps:{ + disabled:true, + } + } }, { label: '跳过任务直接删生成记录', @@ -10705,7 +10723,14 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: false, - isTable: true + isTable: true, + form:{ + component:'Switch', + componentProps:{ + disabled:true, + value:requestsettingData.available, + } + } } ])) // 表单校验 @@ -10809,6 +10834,7 @@ export const PurchaseclaimRequestDetail = useCrudSchemas(reactive( { label: '创建者', field: 'creator', + isTableForm:false }, { label: '创建时间', @@ -10817,11 +10843,13 @@ export const PurchaseclaimRequestDetail = useCrudSchemas(reactive( formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' - } + }, + isTableForm:false }, { label: '最后更新者', field: 'updater', + isTableForm:false }, { label: '最后更新时间', @@ -10830,9 +10858,46 @@ export const PurchaseclaimRequestDetail = useCrudSchemas(reactive( formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' - } + }, + isTableForm:false }, ])) +// 表单校验 +export const PurchaseclaimRequestDetailRules = reactive({ + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + altBatch: [ + { required: true, message: '请输入替代批次', trigger: 'blur' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'change' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'change' } + ], + singlePrice: [ + { required: true, message: '请输入单价', trigger: 'change' } + ], + amount: [ + { required: true, message: '请输入金额', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'change' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'change' } + ], + projectCode: [ + { required: true, message: '请输入项目代码', trigger: 'change' } + ], + qty: [ + { required: true, message: '请输入数量', trigger: 'change' } + ], + uom: [ + { required: true, message: '请输入计量单位', trigger: 'change' } + ], +}) /** * @returns {Array} 采购索赔记录主表 diff --git a/src/views/wms/purchaseclaimRequestMain/index.vue b/src/views/wms/purchaseclaimRequestMain/index.vue index 36458e0b4..c396f21fa 100644 --- a/src/views/wms/purchaseclaimRequestMain/index.vue +++ b/src/views/wms/purchaseclaimRequestMain/index.vue @@ -1,3 +1,4 @@ +