Browse Source

BUG修改

master
parent
commit
5d91c2951c
  1. 3
      src/utils/disposition/defaultButtons.ts
  2. 12
      src/views/eam/basic/item/index.vue
  3. 12
      src/views/eam/basic/item/item.data.ts
  4. 16
      src/views/eam/basic/location/location.data.ts
  5. 23
      src/views/eam/item/countRecord/countRecord.data.ts
  6. 39
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  7. 18
      src/views/eam/item/itemInLocation/itemInLocation.data.ts
  8. 14
      src/views/eam/item/itemOutLocation/itemOutLocation.data.ts

3
src/utils/disposition/defaultButtons.ts

@ -1094,7 +1094,7 @@ export function ItemInBtn(option:any) {
// 操作列表-到货转账内 // 操作列表-到货转账内
export function newTurnIn(option:any) { export function newTurnIn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
label: '到货转账内', label: '到货转账内',
name: 'newTurnIn', name: 'newTurnIn',
hide: false, hide: false,
type: 'primary', type: 'primary',
@ -1104,7 +1104,6 @@ export function newTurnIn(option:any) {
}) })
} }
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){
return { return {

12
src/views/eam/basic/item/index.vue

@ -184,16 +184,16 @@
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
var isHave = Item.allSchemas.formSchema.some(function (item) { 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 (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { if (data.minInventory && data.maxInventory && data.minInventory >= data.maxInventory) {
message.error('失效时间要大于生效时间') message.error('最高库存要大于最低库存')
return; return false;
} }
} }
if (data.activeTime == 0) data.activeTime = null; if (data.maxInventory == 0) data.maxInventory = null;
if (data.expireTime == 0) data.expireTime = null; if (data.minInventory == 0) data.minInventory = null;
if (formType === 'create') { if (formType === 'create') {
await ItemApi.createItem(data) await ItemApi.createItem(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

12
src/views/eam/basic/item/item.data.ts

@ -67,13 +67,15 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '单位', label: 'ABC分类',
field: 'uom', field: 'classification',
sort: 'custom', sort: 'custom',
isSearch: false, dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
table: { table: {
width: 110 width: 100
}, } ,
}, },
{ {
label: '供应商名称', label: '供应商名称',

16
src/views/eam/basic/location/location.data.ts

@ -61,21 +61,21 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '创建时间', label: '描述',
field: 'createTime', field: 'description',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: { table: {
width: 170 width: 150
}, },
}, },
{ {
label: '描述', label: '创建时间',
field: 'description', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: { table: {
width: 150 width: 170
}, },
}, },
{ {

23
src/views/eam/item/countRecord/countRecord.data.ts

@ -62,18 +62,25 @@ export const CountRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', isTable:false,
isForm: false,
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, detail: {
search: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', style: { width: '100%' },
type: 'daterange', type: 'datetime',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
} }
},
isForm: false,
}, },
{ {
label: '操作', label: '操作',

39
src/views/eam/item/itemAccounts/itemAccounts.data.ts

@ -18,10 +18,6 @@ export const ItemAccountsRules = reactive({
areaNumber: [required], areaNumber: [required],
type: [required], type: [required],
locationNumber: [required], locationNumber: [required],
// qty: [
// required,
// { validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
// ],
}) })
export const ItemAccounts = useCrudSchemas( export const ItemAccounts = useCrudSchemas(
@ -57,9 +53,9 @@ export const ItemAccounts = useCrudSchemas(
table: { table: {
width: 130 width: 130
}, },
form:{ form: {
componentProps:{ componentProps: {
disabled:true disabled: true
} }
}, },
isSearch: false isSearch: false
@ -93,7 +89,7 @@ export const ItemAccounts = useCrudSchemas(
field: 'areaName', field: 'areaName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,table: { isForm: false, table: {
width: 130 width: 130
}, },
}, },
@ -131,7 +127,7 @@ export const ItemAccounts = useCrudSchemas(
field: 'locationName', field: 'locationName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,table: { isForm: false, table: {
width: 130 width: 130
}, },
}, },
@ -143,7 +139,7 @@ export const ItemAccounts = useCrudSchemas(
width: '110', width: '110',
}, },
isDetail: false, isDetail: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_ : Recordable, __ : TableColumn, cellValue : number) => {
return typeLists.find((account) => account.value == cellValue)?.label return typeLists.find((account) => account.value == cellValue)?.label
}, },
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE, // dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
@ -180,9 +176,9 @@ export const ItemAccounts = useCrudSchemas(
table: { table: {
width: 110 width: 110
}, },
form:{ form: {
component: 'InputNumber', component: 'InputNumber',
componentProps:{ componentProps: {
min: 0,//最小值` min: 0,//最小值`
precision: 2//精度` precision: 2//精度`
} }
@ -193,6 +189,7 @@ export const ItemAccounts = useCrudSchemas(
field: 'uom', field: 'uom',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
table: { table: {
width: 110 width: 110
}, },
@ -202,6 +199,7 @@ export const ItemAccounts = useCrudSchemas(
field: 'specifications', field: 'specifications',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
table: { table: {
width: 110 width: 110
}, },
@ -213,15 +211,17 @@ export const ItemAccounts = useCrudSchemas(
dictType: DICT_TYPE.CLASSIFICATION, dictType: DICT_TYPE.CLASSIFICATION,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
isForm: false,
table: { table: {
width: 100 width: 100
} , },
}, },
{ {
label: '使用地点', label: '使用地点',
field: 'usePlace', field: 'usePlace',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
table: { table: {
width: 110 width: 110
}, },
@ -231,6 +231,7 @@ export const ItemAccounts = useCrudSchemas(
field: 'project', field: 'project',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm: false,
table: { table: {
width: 110 width: 110
}, },
@ -254,18 +255,6 @@ export const ItemAccounts = useCrudSchemas(
width: 180 width: 180
}, },
}, },
// {
// label: '是否账内库',
// field: 'isInAccount',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isSearch: false,
// isTable: true,
// sort: 'custom',
// table: {
// width: 130
// },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

18
src/views/eam/item/itemInLocation/itemInLocation.data.ts

@ -8,10 +8,7 @@ export const ItemInLocationRules = reactive({
number: [required], number: [required],
itemNumber: [required], itemNumber: [required],
locationNumber: [required], locationNumber: [required],
qty: [ qty: [required,],
required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
returner: [ returner: [
{ max: 50, message: '不得超过20个字符', trigger: 'blur' }, { max: 50, message: '不得超过20个字符', trigger: 'blur' },
], ],
@ -97,17 +94,18 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
label: '归还数量', label: '归还数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: false,
table: { table: {
width: 110 width: 110,
}, },
form:{ form: {
component: 'InputNumber', component: 'InputNumber',
componentProps:{ componentProps: {
min: 0,//最小值` min: 0,
precision: 2//精度` precision: 2
}
} }
}, },
},
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

14
src/views/eam/item/itemOutLocation/itemOutLocation.data.ts

@ -9,10 +9,7 @@ import { validateNumber } from '@/utils/validator'
export const ItemOutLocationRules = reactive({ export const ItemOutLocationRules = reactive({
// number: [required], // number: [required],
itemNumber: [required], itemNumber: [required],
qty: [ qty: [required],
required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
locationNumber: [required] locationNumber: [required]
}) })
@ -135,17 +132,18 @@ export const ItemOutLocation = useCrudSchemas(
label: '出库数量', label: '出库数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: false,
table: { table: {
width: 110 width: 110,
}, },
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, //最小值` min: 0,
precision: 2 //精度` precision: 2
}
} }
}, },
},
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

Loading…
Cancel
Save