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