From 8a3b6a903e998a173fafdd54d99c481b5d104bbc Mon Sep 17 00:00:00 2001 From: chenfang Date: Mon, 20 May 2024 15:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E9=99=8D=E7=BA=A7=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../relegateRecord/relegateRecordMain.data.ts | 142 +++++++++++++++++- 1 file changed, 136 insertions(+), 6 deletions(-) diff --git a/src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/relegateRecordMain.data.ts b/src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/relegateRecordMain.data.ts index 75fde5d10..87dc8e0dd 100644 --- a/src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/relegateRecordMain.data.ts +++ b/src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/relegateRecordMain.data.ts @@ -1,5 +1,11 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as DeptApi from '@/api/system/dept' +const deptList = ref([]) // 树形结构 + +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) // 表单校验 export const RelegateRecordMainRules = reactive({ @@ -15,12 +21,18 @@ export const RelegateRecordMain = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, + table: { + width: 180 + }, }, { label: '申请单号', field: 'requestNumber', sort: 'custom', isSearch: true, + table: { + width: 180 + }, }, { label: '执行时间', @@ -34,11 +46,28 @@ export const RelegateRecordMain = useCrudSchemas(reactive([ valueFormat: 'x' } }, + table: { + width: 200 + }, }, { label: '是否可用', field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: false, sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } }, { label: '申请时间', @@ -52,16 +81,35 @@ export const RelegateRecordMain = useCrudSchemas(reactive([ valueFormat: 'x' } }, + table: { + width: 200 + }, }, { label: '部门', field: 'departmentCode', sort: 'custom', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + // multiple: true, + } + } }, { label: '业务类型', field: 'businessType', sort: 'custom', + table: { + width: 150 + }, }, { label: '操作', @@ -73,8 +121,6 @@ export const RelegateRecordMain = useCrudSchemas(reactive([ } } ])) - - // 表单校验 export const RelegateRecordDetailRules = reactive({ itemCode: [required], @@ -93,91 +139,175 @@ export const RelegateRecordDetail = useCrudSchemas(reactive([ label: '物料代码', field: 'itemCode', sort: 'custom', - isSearch: true, + table: { + width: 180 + }, }, { label: '降级后物料代码', field: 'downItemCode', sort: 'custom', - isSearch: true, + table: { + width: 180 + }, }, { label: '计量单位', field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', sort: 'custom', + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } }, { label: '数量', field: 'qty', sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 6 + } }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 6 + } + }, { label: '库存状态', field: 'inventoryStatus', sort: 'custom', - form: { - component: 'Radio' + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + table: { + width: 150 }, + tableForm: { + type: 'Select' + }, + hiddenInMain: true, + isTableForm: false, + isForm: false, }, { label: '从批次', field: 'fromBatch', sort: 'custom', + table: { + width: 150 + }, }, { label: '从包装号', field: 'fromPackingNumber', sort: 'custom', + table: { + width: 180 + }, }, { label: '从库位代码', field: 'fromLocationCode', sort: 'custom', + table: { + width: 180 + }, }, { label: '从库区类型', field: 'fromAreaTypes', + dictType: DICT_TYPE.AREA_TYPE, + dictClass: 'string', + isTable:false, sort: 'custom', + table: { + width: 150 + }, + isForm: false, }, { label: '从库区代码', field: 'fromAreaCodes', sort: 'custom', + table: { + width: 150 + }, }, { label: '到包装号', field: 'toPackingNumber', sort: 'custom', + table: { + width: 180 + }, }, { label: '到批次', field: 'toBatch', sort: 'custom', + table: { + width: 150 + }, }, { label: '到库位代码', field: 'toLocationCode', sort: 'custom', + table: { + width: 180 + }, }, { label: '到仓库代码', field: 'toWarehouseCode', sort: 'custom', + table: { + width: 180 + }, }, { label: '到库区类型', field: 'toAreaTypes', + dictType: DICT_TYPE.AREA_TYPE, + dictClass: 'string', + isTable:false, sort: 'custom', + table: { + width: 150 + }, + isForm: false, }, { label: '到库区代码', field: 'toAreaCodes', sort: 'custom', + table: { + width: 150 + }, }, { label: '操作', field: 'action', isForm: false, + hiddenInMain:true, table: { width: 150, fixed: 'right'