|
|
@ -12,10 +12,11 @@ export const ItemAccountsRules = reactive({ |
|
|
|
itemNumber: [required], |
|
|
|
areaNumber: [required], |
|
|
|
locationNumber: [required], |
|
|
|
concurrencyStamp: [required], |
|
|
|
concurrencyStamp: [required] |
|
|
|
}) |
|
|
|
|
|
|
|
export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
export const ItemAccounts = useCrudSchemas( |
|
|
|
reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '备件编号', |
|
|
|
field: 'itemNumber', |
|
|
@ -71,27 +72,29 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
searchTitle: '备件', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: LocationApi.getLocationNoInAccountPage, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{ |
|
|
|
searchCondition: [ |
|
|
|
{ |
|
|
|
key: 'areaNumber', |
|
|
|
value: 'areaNumber', |
|
|
|
message: '请选择库区编号!', |
|
|
|
isMainValue: true, // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用
|
|
|
|
},{ |
|
|
|
key: 'isInAccount', |
|
|
|
value: 'isInAccountWill', |
|
|
|
isMainValue: true // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用
|
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'itemNumber', |
|
|
|
value: 'itemNumber', |
|
|
|
message: '请选择备件编号!', |
|
|
|
isMainValue: true, // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用
|
|
|
|
isMainValue: true // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用
|
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'isInAccount', |
|
|
|
value: "ALL", |
|
|
|
value: 'ALL', |
|
|
|
isMainValue: false |
|
|
|
}, ] |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
|
|
|
|
label: '是否账内预期值', |
|
|
|
field: 'isInAccountWill', |
|
|
|
sort: 'custom', |
|
|
@ -99,7 +102,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
isForm: false, |
|
|
|
isSearch: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false, |
|
|
|
isTableForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '备件名称', |
|
|
@ -109,7 +112,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
width: 110 |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
|
isSearch: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '规格', |
|
|
@ -120,7 +123,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '(账内或账外)库存数量', |
|
|
@ -128,7 +131,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 110 |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '库存总数', |
|
|
@ -137,7 +140,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
isForm: false, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '已申请库存数量', |
|
|
@ -146,7 +149,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
isForm: false, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '可申请库存数量', |
|
|
@ -155,7 +158,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
isForm: false, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '单价', |
|
|
@ -166,13 +169,13 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '总价', |
|
|
|
field: 'totalPrice', |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否账内库', |
|
|
@ -210,7 +213,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
isTable: true, |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 110, |
|
|
|
width: 110 |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'Select', |
|
|
@ -243,7 +246,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
@ -256,7 +259,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '单位', |
|
|
@ -274,7 +277,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '类别', |
|
|
@ -292,7 +295,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '备件分类', |
|
|
@ -310,7 +313,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '区域', |
|
|
@ -328,7 +331,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
// {
|
|
|
|
// label: '单价',
|
|
|
@ -340,14 +343,14 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
field: 'reprocurement', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 110, |
|
|
|
width: 110 |
|
|
|
}, |
|
|
|
isForm: true, |
|
|
|
form: { |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '安全库存', |
|
|
@ -355,7 +358,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
isForm: true, |
|
|
|
table: { |
|
|
|
width: 110, |
|
|
|
width: 110 |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
@ -363,35 +366,35 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '成本中心', |
|
|
|
field: 'cost', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 110, |
|
|
|
width: 110 |
|
|
|
}, |
|
|
|
isForm: true, |
|
|
|
form: { |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '采购员', |
|
|
|
field: 'purchaser', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 100, |
|
|
|
width: 100 |
|
|
|
}, |
|
|
|
isForm: true, |
|
|
|
form: { |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '财务', |
|
|
@ -402,7 +405,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否以旧换新', |
|
|
@ -438,7 +441,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
isForm: false, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '批次', |
|
|
@ -450,7 +453,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '库龄', |
|
|
@ -458,23 +461,23 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
formatter: (row: Recordable, column: TableColumn, cellValue: any) => { |
|
|
|
if (!row.batchDate) { |
|
|
|
return '未知'; // 如果 purchaseTime 为 null 或 undefined,返回 '未知'
|
|
|
|
return '未知' // 如果 purchaseTime 为 null 或 undefined,返回 '未知'
|
|
|
|
} |
|
|
|
|
|
|
|
const purchaseTime = new Date(row.batchDate); // 获取采购时间
|
|
|
|
const purchaseTime = new Date(row.batchDate) // 获取采购时间
|
|
|
|
if (isNaN(purchaseTime.getTime())) { |
|
|
|
return '未知'; // 如果 purchaseTime 不是有效日期,返回 '未知'
|
|
|
|
return '未知' // 如果 purchaseTime 不是有效日期,返回 '未知'
|
|
|
|
} |
|
|
|
|
|
|
|
const currentTime = new Date(); // 当前时间
|
|
|
|
const ageInMilliseconds = currentTime.getTime() - purchaseTime.getTime(); // 时间差(毫秒)
|
|
|
|
const ageInDays = Math.floor(ageInMilliseconds / (1000 * 60 * 60 * 24)); // 转换为天数
|
|
|
|
return `${ageInDays} 天`; // 返回计算结果
|
|
|
|
const currentTime = new Date() // 当前时间
|
|
|
|
const ageInMilliseconds = currentTime.getTime() - purchaseTime.getTime() // 时间差(毫秒)
|
|
|
|
const ageInDays = Math.floor(ageInMilliseconds / (1000 * 60 * 60 * 24)) // 转换为天数
|
|
|
|
return `${ageInDays} 天` // 返回计算结果
|
|
|
|
}, |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否框架协议', |
|
|
@ -537,4 +540,5 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
fixed: 'right' |
|
|
|
} |
|
|
|
} |
|
|
|
])) |
|
|
|
]) |
|
|
|
) |
|
|
|