From 5d91c2951c917358852543efa8e777e070cf55d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Sat, 11 May 2024 17:31:54 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/disposition/defaultButtons.ts | 3 +- src/views/eam/basic/item/index.vue | 12 +- src/views/eam/basic/item/item.data.ts | 12 +- src/views/eam/basic/location/location.data.ts | 16 +-- .../eam/item/countRecord/countRecord.data.ts | 39 ++--- .../item/itemAccounts/itemAccounts.data.ts | 133 ++++++++---------- .../itemInLocation/itemInLocation.data.ts | 18 ++- .../itemOutLocation/itemOutLocation.data.ts | 14 +- 8 files changed, 120 insertions(+), 127 deletions(-) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 3a66246..f2594d8 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -1094,7 +1094,7 @@ export function ItemInBtn(option:any) { // 操作列表-到货转账内 export function newTurnIn(option:any) { return __defaultBtnOption(option,{ - label: '到货转账内', + label: '新到货转账内', name: 'newTurnIn', hide: false, type: 'primary', @@ -1104,7 +1104,6 @@ export function newTurnIn(option:any) { }) } - // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/eam/basic/item/index.vue b/src/views/eam/basic/item/index.vue index afddda8..1ee33fa 100644 --- a/src/views/eam/basic/item/index.vue +++ b/src/views/eam/basic/item/index.vue @@ -184,16 +184,16 @@ // form表单提交 const formsSuccess = async (formType, data) => { var isHave = Item.allSchemas.formSchema.some(function (item) { - return item.field === 'activeTime' || item.field === 'expireTime'; + return item.field === 'maxInventory' || item.field === 'minInventory'; }); if (isHave) { - if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { - message.error('失效时间要大于生效时间') - return; + if (data.minInventory && data.maxInventory && data.minInventory >= data.maxInventory) { + message.error('最高库存要大于最低库存') + return false; } } - if (data.activeTime == 0) data.activeTime = null; - if (data.expireTime == 0) data.expireTime = null; + if (data.maxInventory == 0) data.maxInventory = null; + if (data.minInventory == 0) data.minInventory = null; if (formType === 'create') { await ItemApi.createItem(data) message.success(t('common.createSuccess')) diff --git a/src/views/eam/basic/item/item.data.ts b/src/views/eam/basic/item/item.data.ts index 2b5ee0c..2ff59aa 100644 --- a/src/views/eam/basic/item/item.data.ts +++ b/src/views/eam/basic/item/item.data.ts @@ -67,13 +67,15 @@ export const Item = useCrudSchemas(reactive([ }, }, { - label: '单位', - field: 'uom', + label: 'ABC分类', + field: 'classification', sort: 'custom', - isSearch: false, + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, table: { - width: 110 - }, + width: 100 + } , }, { label: '供应商名称', diff --git a/src/views/eam/basic/location/location.data.ts b/src/views/eam/basic/location/location.data.ts index 3660ec4..220fbbe 100644 --- a/src/views/eam/basic/location/location.data.ts +++ b/src/views/eam/basic/location/location.data.ts @@ -61,21 +61,21 @@ export const Location = useCrudSchemas(reactive([ } }, { - label: '创建时间', - field: 'createTime', + label: '描述', + field: 'description', sort: 'custom', - formatter: dateFormatter, - isForm: false, table: { - width: 170 + width: 150 }, }, { - label: '描述', - field: 'description', + label: '创建时间', + field: 'createTime', sort: 'custom', + formatter: dateFormatter, + isForm: false, table: { - width: 150 + width: 170 }, }, { diff --git a/src/views/eam/item/countRecord/countRecord.data.ts b/src/views/eam/item/countRecord/countRecord.data.ts index c6d5c31..3acf698 100644 --- a/src/views/eam/item/countRecord/countRecord.data.ts +++ b/src/views/eam/item/countRecord/countRecord.data.ts @@ -59,22 +59,29 @@ export const CountRecordMain = useCrudSchemas(reactive([ type: 'Select' } }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] - } - }, - isForm: false, - }, + { + label: '创建时间', + field: 'createTime', + isTable:false, + isForm: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + } + }, { label: '操作', field: 'action', diff --git a/src/views/eam/item/itemAccounts/itemAccounts.data.ts b/src/views/eam/item/itemAccounts/itemAccounts.data.ts index 2640cc8..ad58165 100644 --- a/src/views/eam/item/itemAccounts/itemAccounts.data.ts +++ b/src/views/eam/item/itemAccounts/itemAccounts.data.ts @@ -18,10 +18,6 @@ export const ItemAccountsRules = reactive({ areaNumber: [required], type: [required], locationNumber: [required], - // qty: [ - // required, - // { validator: validateNumber, message: '数量不能等于0', trigger: 'blur' }, - // ], }) export const ItemAccounts = useCrudSchemas( @@ -57,9 +53,9 @@ export const ItemAccounts = useCrudSchemas( table: { width: 130 }, - form:{ - componentProps:{ - disabled:true + form: { + componentProps: { + disabled: true } }, isSearch: false @@ -93,7 +89,7 @@ export const ItemAccounts = useCrudSchemas( field: 'areaName', sort: 'custom', isSearch: false, - isForm:false,table: { + isForm: false, table: { width: 130 }, }, @@ -131,7 +127,7 @@ export const ItemAccounts = useCrudSchemas( field: 'locationName', sort: 'custom', isSearch: false, - isForm:false,table: { + isForm: false, table: { width: 130 }, }, @@ -143,7 +139,7 @@ export const ItemAccounts = useCrudSchemas( width: '110', }, isDetail: false, - formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + formatter: (_ : Recordable, __ : TableColumn, cellValue : number) => { return typeLists.find((account) => account.value == cellValue)?.label }, // dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE, @@ -172,7 +168,7 @@ export const ItemAccounts = useCrudSchemas( placeholder: "请选择类型" } }, - }, + }, { label: '库存数量', field: 'qty', @@ -180,61 +176,66 @@ export const ItemAccounts = useCrudSchemas( table: { width: 110 }, - form:{ + form: { component: 'InputNumber', - componentProps:{ + componentProps: { min: 0,//最小值` precision: 2//精度` } } }, - { - label: '单位', - field: 'uom', - sort: 'custom', - isSearch: false, - table: { - width: 110 - }, - }, - { - label: '规格型号', - field: 'specifications', - sort: 'custom', - isSearch: false, - table: { - width: 110 - }, - }, - { - label: 'ABC分类', - field: 'classification', - sort: 'custom', - dictType: DICT_TYPE.CLASSIFICATION, - dictClass: 'string', - isTable: true, - table: { - width: 100 - } , - }, - { - label: '使用地点', - field: 'usePlace', - sort: 'custom', - isSearch: false, - table: { - width: 110 - }, - }, - { - label: '项目', - field: 'project', - sort: 'custom', - isSearch: false, - table: { - width: 110 - }, - }, + { + label: '单位', + field: 'uom', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110 + }, + }, + { + label: '规格型号', + field: 'specifications', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110 + }, + }, + { + label: 'ABC分类', + field: 'classification', + sort: 'custom', + dictType: DICT_TYPE.CLASSIFICATION, + dictClass: 'string', + isTable: true, + isForm: false, + table: { + width: 100 + }, + }, + { + label: '使用地点', + field: 'usePlace', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110 + }, + }, + { + label: '项目', + field: 'project', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 110 + }, + }, { label: '创建时间', field: 'createTime', @@ -254,18 +255,6 @@ export const ItemAccounts = useCrudSchemas( width: 180 }, }, - // { - // label: '是否账内库', - // field: 'isInAccount', - // dictType: DICT_TYPE.TRUE_FALSE, - // dictClass: 'string', - // isSearch: false, - // isTable: true, - // sort: 'custom', - // table: { - // width: 130 - // }, - { label: '操作', field: 'action', diff --git a/src/views/eam/item/itemInLocation/itemInLocation.data.ts b/src/views/eam/item/itemInLocation/itemInLocation.data.ts index ceee92b..0af606a 100644 --- a/src/views/eam/item/itemInLocation/itemInLocation.data.ts +++ b/src/views/eam/item/itemInLocation/itemInLocation.data.ts @@ -8,10 +8,7 @@ export const ItemInLocationRules = reactive({ number: [required], itemNumber: [required], locationNumber: [required], - qty: [ - required, - { validator: validateNumber, message: '数量不能等于0', trigger: 'blur' }, - ], + qty: [required,], returner: [ { max: 50, message: '不得超过20个字符', trigger: 'blur' }, ], @@ -97,16 +94,17 @@ export const ItemInLocation = useCrudSchemas(reactive([ label: '归还数量', field: 'qty', sort: 'custom', + isSearch: false, table: { - width: 110 + width: 110, }, - form:{ + form: { component: 'InputNumber', - componentProps:{ - min: 0,//最小值` - precision: 2//精度` + componentProps: { + min: 0, + precision: 2 } - } + }, }, { label: '创建时间', diff --git a/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts b/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts index c8c2bc8..1dfdc4c 100644 --- a/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts +++ b/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts @@ -9,10 +9,7 @@ import { validateNumber } from '@/utils/validator' export const ItemOutLocationRules = reactive({ // number: [required], itemNumber: [required], - qty: [ - required, - { validator: validateNumber, message: '数量不能等于0', trigger: 'blur' }, - ], + qty: [required], locationNumber: [required] }) @@ -135,16 +132,17 @@ export const ItemOutLocation = useCrudSchemas( label: '出库数量', field: 'qty', sort: 'custom', + isSearch: false, table: { - width: 110 + width: 110, }, form: { component: 'InputNumber', componentProps: { - min: 0, //最小值` - precision: 2 //精度` + min: 0, + precision: 2 } - } + }, }, { label: '创建时间',