|
@ -1,27 +1,30 @@ |
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
import * as ConfigApi from '@/api/infra/config' |
|
|
|
|
|
const autoCodeSwitch = await ConfigApi.getConfigKey('sparePartCodeAutoSwitch') |
|
|
|
|
|
const autoSwitch = ref(false) |
|
|
|
|
|
if (autoCodeSwitch == 'TRUE') { |
|
|
|
|
|
autoSwitch.value = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const SparePartRules = reactive({ |
|
|
export const SparePartRules = reactive({ |
|
|
code: [required], |
|
|
code: [required], |
|
|
name: [required], |
|
|
name: [required], |
|
|
isOverall: [required], |
|
|
isOverall: [required], |
|
|
|
|
|
images: [required], |
|
|
uom: [required], |
|
|
uom: [required], |
|
|
concurrencyStamp: [required] |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '备件编号', |
|
|
label: 'id', |
|
|
|
|
|
field: 'id', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isSearch: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail:false, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '编号', |
|
|
field: 'code', |
|
|
field: 'code', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isForm: !autoSwitch.value, |
|
|
isForm: true, |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
fixed: 'left' |
|
|
fixed: 'left' |
|
|
}, |
|
|
}, |
|
@ -29,19 +32,19 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
label: '名称', |
|
|
label: '名称', |
|
|
field: 'name', |
|
|
field: 'name', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: true |
|
|
isSearch: true, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '品牌', |
|
|
label: '品牌', |
|
|
field: 'brand', |
|
|
field: 'brand', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: true, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '规格型号', |
|
|
label: '规格型号', |
|
|
field: 'specifications', |
|
|
field: 'specifications', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: true, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '是否全局', |
|
|
label: '是否全局', |
|
@ -59,22 +62,6 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
|
|
|
label: '是否存储', |
|
|
|
|
|
field: 'isConstant', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
|
|
isSearch: true, |
|
|
|
|
|
form: { |
|
|
|
|
|
component: 'Switch', |
|
|
|
|
|
value: 'TRUE', |
|
|
|
|
|
componentProps: { |
|
|
|
|
|
inactiveValue: 'FALSE', |
|
|
|
|
|
activeValue: 'TRUE' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
{ |
|
|
label: '科目', |
|
|
label: '科目', |
|
|
field: 'subject', |
|
|
field: 'subject', |
|
@ -90,13 +77,19 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
label: '科目代码', |
|
|
label: '科目代码', |
|
|
field: 'subjectCode', |
|
|
field: 'subjectCode', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: true, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '类别', |
|
|
label: '类别', |
|
|
field: 'category', |
|
|
field: 'type', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: true, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '图片', |
|
|
|
|
|
field: 'images', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isSearch: false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '区域', |
|
|
label: '区域', |
|
@ -104,7 +97,7 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
dictType: DICT_TYPE.REGION, |
|
|
dictType: DICT_TYPE.REGION, |
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
isSearch: false, |
|
|
isSearch: true, |
|
|
form: { |
|
|
form: { |
|
|
component: 'Select' |
|
|
component: 'Select' |
|
|
} |
|
|
} |
|
@ -121,71 +114,126 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '单位', |
|
|
label: '计量单位字典', |
|
|
field: 'uom', |
|
|
field: 'uom', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
dictType: DICT_TYPE.UOM, |
|
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
|
|
isSearch: true, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '单价', |
|
|
label: '单价', |
|
|
field: 'singlePrice', |
|
|
field: 'singlePrice', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: true, |
|
|
|
|
|
form: { |
|
|
|
|
|
component: 'InputNumber', |
|
|
|
|
|
value: 0 |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '库龄', |
|
|
label: '生产厂家字符', |
|
|
field: 'stockAge', |
|
|
field: 'manufacturer', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false, |
|
|
isSearch: true, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '库存下限', |
|
|
|
|
|
field: 'minInventory', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isSearch: true, |
|
|
form: { |
|
|
form: { |
|
|
component: 'InputNumber', |
|
|
component: 'InputNumber', |
|
|
value: 0 |
|
|
value: 0 |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '重采购点', |
|
|
label: '库存上限', |
|
|
field: 'reprocurement', |
|
|
field: 'maxInventory', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false, |
|
|
isSearch: true, |
|
|
form: { |
|
|
form: { |
|
|
component: 'InputNumber', |
|
|
component: 'InputNumber', |
|
|
value: 0 |
|
|
value: 0 |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '安全库存', |
|
|
label: '更换周期', |
|
|
field: 'safetyStock', |
|
|
field: 'replacementCycle', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false, |
|
|
isSearch: true, |
|
|
form: { |
|
|
form: { |
|
|
component: 'InputNumber', |
|
|
component: 'InputNumber', |
|
|
value: 0 |
|
|
value: 0 |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '存放位置描述', |
|
|
|
|
|
field: 'storageLocation', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isSearch: false, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '创建时间', |
|
|
|
|
|
field: 'createTime', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
formatter: dateFormatter, |
|
|
|
|
|
isSearch: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail: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: '成本中心', |
|
|
label: '部门id', |
|
|
field: 'cost', |
|
|
field: 'departmentCode', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail:false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '采购员', |
|
|
label: '备注', |
|
|
field: 'purchaser', |
|
|
field: 'remark', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isSearch: false, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '地点ID', |
|
|
|
|
|
field: 'siteId', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail:false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '财务', |
|
|
label: '是否可用默认TRUE', |
|
|
field: 'financer', |
|
|
field: 'available', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false |
|
|
isSearch: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail:false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '采购时间', |
|
|
label: '删除时间', |
|
|
field: 'purchaseTime', |
|
|
field: 'deletionTime', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
formatter: dateFormatter, |
|
|
formatter: dateFormatter, |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail:false, |
|
|
search: { |
|
|
search: { |
|
|
component: 'DatePicker', |
|
|
component: 'DatePicker', |
|
|
componentProps: { |
|
|
componentProps: { |
|
@ -200,57 +248,29 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
type: 'datetime', |
|
|
type: 'datetime', |
|
|
valueFormat: 'x' |
|
|
valueFormat: 'x' |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
|
|
|
label: '是否框架协议', |
|
|
|
|
|
field: 'isFramework', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
|
|
isSearch: true, |
|
|
|
|
|
form: { |
|
|
|
|
|
component: 'Switch', |
|
|
|
|
|
value: 'TRUE', |
|
|
|
|
|
componentProps: { |
|
|
|
|
|
inactiveValue: 'FALSE', |
|
|
|
|
|
activeValue: 'TRUE' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '是否以旧换新', |
|
|
label: '删除人id', |
|
|
field: 'isRadeIn', |
|
|
field: 'deleterId', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
isSearch: false, |
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
isTable: false, |
|
|
isSearch: true, |
|
|
isForm: false, |
|
|
form: { |
|
|
isDetail:false, |
|
|
component: 'Switch', |
|
|
|
|
|
value: 'TRUE', |
|
|
|
|
|
componentProps: { |
|
|
|
|
|
inactiveValue: 'FALSE', |
|
|
|
|
|
activeValue: 'TRUE' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '备注', |
|
|
|
|
|
field: 'remark', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isSearch: true |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '是否可用', |
|
|
label: '并发乐观锁', |
|
|
field: 'available', |
|
|
field: 'concurrencyStamp', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
|
|
isTable: true, |
|
|
|
|
|
isDetail: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isTableForm: false, |
|
|
isTable: false, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isDetail:false, |
|
|
|
|
|
form: { |
|
|
|
|
|
component: 'InputNumber', |
|
|
|
|
|
value: 0 |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '操作', |
|
|
label: '操作', |
|
|