Browse Source

[SBBJ-1224]查询自己

master
zengqinyuan 6 days ago
parent
commit
29d6cd0940
  1. 862
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

862
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -3,479 +3,515 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data' import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator' import { getUserListAll } from '@/api/system/user'
import Detail from '@/views/bpm/oa/leave/detail.vue'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ItemApplyMain = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '领用编号', {
field: 'number', label: '领用编号',
sort: 'custom', field: 'number',
isForm: false, sort: 'custom',
isSearch: true, isForm: false,
table: { isSearch: true,
width: 180, table: {
fixed: 'left' width: 180,
fixed: 'left'
}
}, },
}, {
{ label: '申领人',
label: '申领人', field: 'applyId',
field: 'applyId', sort: 'custom',
sort: 'custom', isForm: false,
isForm: false, hiddenSearchHigh: true,
isSearch: false, isSearch: true,
}, search: {
show: true,
{ component: 'Select',
label: '审批人', api: () => getUserListAll(),
field: 'approveId', componentProps: {
sort: 'custom', optionsAlias: {
isForm: false, labelField: 'nickname',
isSearch: false, valueField: 'id'
}, },
{ filterable: true
label: '出库人', }
field: 'outId', }
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '是否已审批',
field: 'isApprove',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: false,
table: {
width: 150
}, },
tableForm: {
type: 'Select', {
disabled: false label: '审批人',
} field: 'approveId',
}, hiddenSearchHigh: true,
{ sort: 'custom',
label: '状态', isForm: false,
field: 'status', isSearch: true,
sort: 'custom', search: {
dictType: DICT_TYPE.ITEM_APPLY_STATUS, show: true,
dictClass: 'string', component: 'Select',
isSearch: true, api: () => getUserListAll(),
isTable: true, componentProps: {
isForm: false, optionsAlias: {
table: { labelField: 'nickname',
width: 150 valueField: 'id'
}, },
tableForm: { filterable: true
type: 'Select', }
disabled: false }
} },
}, {
{ label: '出库人',
label: '申请主题', field: 'outId',
field: 'name', hiddenSearchHigh: true,
sort: 'custom', sort: 'custom',
}, isForm: false,
{ isSearch: true,
label: '成本中心', search: {
field: 'costCenter', show: true,
sort: 'custom', component: 'Select',
dictType: DICT_TYPE.CENTER_SUBJECT_MAP_DEPT, api: () => getUserListAll(),
}, componentProps: {
{ optionsAlias: {
label: '创建者', labelField: 'nickname',
field: 'creator', valueField: 'id'
hiddenSearchHigh: true, },
sort: 'custom', filterable: true
isForm: false, }
isSearch: false }
},
{
label: '是否已审批',
field: 'isApprove',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: false,
table: {
width: 150
}, },
{ tableForm: {
label: '创建时间', type: 'Select',
field: 'createTime', disabled: false
hiddenSearchHigh: true, }
formatter: dateFormatter, },
detail: { {
dateFormat: 'YYYY-MM-DD HH:mm:ss' label: '状态',
}, field: 'status',
sort: 'custom', sort: 'custom',
isTable: true, dictType: DICT_TYPE.ITEM_APPLY_STATUS,
form: { dictClass: 'string',
component: 'DatePicker', isSearch: true,
componentProps: { isTable: true,
style: { width: '100%' }, isForm: false,
type: 'datetime', table: {
dateFormat: 'YYYY-MM-DD HH:mm:ss', width: 150
valueFormat: 'x' },
} tableForm: {
}, type: 'Select',
isForm: false, disabled: false
isSearch: true, }
search: { },
component: 'DatePicker', {
componentProps: { label: '申请主题',
valueFormat: 'YYYY-MM-DD HH:mm:ss', field: 'name',
type: 'daterange', sort: 'custom'
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] },
} {
label: '成本中心',
field: 'costCenter',
sort: 'custom',
dictType: DICT_TYPE.CENTER_SUBJECT_MAP_DEPT
},
{
label: '创建者',
field: 'creator',
hiddenSearchHigh: true,
sort: 'custom',
isForm: false,
isSearch: false
},
{
label: '创建时间',
field: 'createTime',
hiddenSearchHigh: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
} }
}, },
isForm: false,
isSearch: true,
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')]
}
}
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false, isDetail: false,
isForm: false, isForm: false,
table: { table: {
width: 200, width: 200,
fixed: 'right' fixed: 'right'
}
} }
} ])
])) )
//表单校验 //表单校验
export const ItemApplyMainRules = reactive({ export const ItemApplyMainRules = reactive({
name: [ name: [{ required: true, message: '请填写描述', trigger: 'change' }],
{ required: true, message: '请填写描述', trigger: 'change' } remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
], available: [{ required: true, message: '请选择是否可用', trigger: 'change' }],
remark: [ costCenter: [{ required: true, message: '请填写描述', trigger: 'change' }]
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
costCenter:[
{ required: true, message: '请填写描述', trigger: 'change' }
],
}) })
export const DeviceMOLD = useCrudSchemas(
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([ reactive<CrudSchema[]>([
{ {
label: '编号', label: '编号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
table: { table: {
width: 180, width: 180,
fixed: 'left' fixed: 'left'
}
}, },
}, {
{ label: '名称',
label: '名称', field: 'name',
field: 'name', sort: 'custom'
sort: 'custom', },
}, {
{ label: '规格型号',
label: '规格型号', field: 'specification',
field: 'specification', sort: 'custom'
sort: 'custom', }
}, ])
)
]))
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const ItemApplyDetail = useCrudSchemas(
{ reactive<CrudSchema[]>([
label: '备件编号', {
field: 'itemNumber', label: '备件编号',
sort: 'custom', field: 'itemNumber',
isSearch: true, sort: 'custom',
tableForm: { isSearch: true,
isInpuFocusShow: true, tableForm: {
searchListPlaceholder: '请选择备件编号', isInpuFocusShow: true,
searchField: 'number',
searchTitle: '备件信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择备件编号', searchListPlaceholder: '请选择备件编号',
searchField: 'number', searchField: 'number',
searchTitle: '备件信息', searchTitle: '备件信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [
key: 'available', {
value: 'TRUE', key: 'available',
isMainValue: false value: 'TRUE',
},] isMainValue: false
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '备件信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
} }
}
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isTable: true,
table: {
width: 150
}, },
isTableForm: true, {
tableForm: { label: '备件名称',
disabled: true field: 'name',
} sort: 'custom',
}, isTable: true,
{ table: {
label: '类型', width: 150
field: 'type', },
sort: 'custom', isTableForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, tableForm: {
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
},
isTableForm: true,
},
{
label: '规格型号',
field: 'specifications',
sort: 'custom',
isTable: true,
table: {
width: 150
},
isTableForm: true,
form: {
componentProps: {
disabled: true disabled: true
} }
}, },
tableForm: { {
disabled: true label: '类型',
} field: 'type',
}, sort: 'custom',
{ dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
label: '设备/模具编号', dictClass: 'string',
field: 'deviceNumber', isSearch: true,
sort: 'custom', isTable: true,
isSearch: true, table: {
tableForm: { width: 150
isInpuFocusShow: true, },
searchListPlaceholder: '请选择单号', tableForm: {
searchField: 'number', type: 'Select',
searchTitle: '单号信息', disabled: false
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 },
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 isTableForm: true
searchCondition: [{ },
key: 'available', {
value: "TRUE", label: '规格型号',
isMainValue: false field: 'specifications',
}, { sort: 'custom',
key: 'type', isTable: true,
value: "type", table: {
isMainValue: true width: 150
},
isTableForm: true,
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
} }
]
}, },
form: { {
// labelMessage: '信息提示说明!!!', label: '设备/模具编号',
componentProps: { field: 'deviceNumber',
isSearchList: true, sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择单号', searchListPlaceholder: '请选择单号',
searchField: 'number', searchField: 'number',
searchTitle: '单号信息', searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [
key: 'available', {
value: "TRUE", key: 'available',
isMainValue: false value: 'TRUE',
}, { isMainValue: false
key: 'type', },
value: "type", {
isMainValue: true key: 'type',
}] value: 'type',
isMainValue: true
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择单号',
searchField: 'number',
searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
value: 'type',
isMainValue: true
}
]
}
} }
}
},
{
label: '申领数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'InputNumber', label: '申领数量',
componentProps: { field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0, min: 0,
precision: 2 precision: 2
} }
}, },
tableForm: { {
type: 'InputNumber', label: '(库内或库外)库存数量',
min: 0, field: 'currentQty',
precision: 2 sort: 'custom',
} table: {
}, width: 150
{ },
label: '(库内或库外)库存数量', form: {
field: 'currentQty', component: 'InputNumber',
sort: 'custom', componentProps: {
table: { disabled: true,
width: 150 min: 0,
}, precision: 2
form: { }
component: 'InputNumber', },
componentProps: { tableForm: {
disabled: true, disabled: true,
type: 'InputNumber',
min: 0, min: 0,
precision: 2 precision: 2
} }
}, },
tableForm: { {
disabled: true, label: '库存总数',
type: 'InputNumber', field: 'totalStockQty',
min: 0, sort: 'custom',
precision: 2 table: {
}, width: 150
}, },
{ isForm: false,
label: '库存总数', tableForm: {
field: 'totalStockQty', disabled: true,
sort: 'custom', type: 'InputNumber',
table: { min: 0,
width: 150 precision: 2
}, },
isForm: false, isTable: false
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
},
isTable:false,
},
{
label: '可申请库存数量',
field: 'availableQty',
sort: 'custom',
table: {
width: 150
},
isForm: false,
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
},
isTable:false,
},
{
label: '已出库数量',
field: 'requestQty',
sort: 'custom',
table: {
width: 150
}, },
isForm: false, {
tableForm: { label: '可申请库存数量',
disabled: true, field: 'availableQty',
type: 'InputNumber', sort: 'custom',
min: 0, table: {
precision: 2 width: 150
},
isForm: false,
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
},
isTable: false
}, },
}, {
label: '已出库数量',
field: 'requestQty',
sort: 'custom',
table: {
width: 150
},
isForm: false,
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
}
}
// { // {
// label: '是否账内库', // label: '是否账内库',
// field: 'isInAccount', // field: 'isInAccount',
// sort: 'custom', // sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // dictClass: 'string',
// isSearch: true, // isSearch: true,
// isTable: true, // isTable: true,
// table: { // table: {
// width: 150 // width: 150
// }, // },
// tableForm: { // tableForm: {
// type: 'Select', // type: 'Select',
// disabled: true // disabled: true
// }, // },
// form: { // form: {
// componentProps: { // componentProps: {
// disabled: true, // disabled: true,
// } // }
// }, // },
// }, // },
// { // {
// label: '是否可用', // label: '是否可用',
// field: 'available', // field: 'available',
// sort: 'custom', // sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // dictClass: 'string',
// isSearch: true, // isSearch: true,
// isTable: true, // isTable: true,
// table: { // table: {
// width: 150 // width: 150
// }, // },
// tableForm: { // tableForm: {
// type: 'Select', // type: 'Select',
// disabled: true // disabled: true
// } // }
// }, // },
// { // {
// label: '备注', // label: '备注',
// field: 'remark', // field: 'remark',
// table: { // table: {
// width: 150 // width: 150
// }, // },
// }, // },
// { // {
// label: '操作', // label: '操作',
// field: 'action', // field: 'action',
// isDetail: false, // isDetail: false,
// isForm: false, // isForm: false,
// table: { // table: {
// width: 150, // width: 150,
// fixed: 'right' // fixed: 'right'
// }, // },
// isTableForm: false, // isTableForm: false,
// } // }
])) ])
)
//表单校验 //表单校验
export const ItemApplyDetailRules = reactive({ export const ItemApplyDetailRules = reactive({
itemNumber: [ itemNumber: [{ required: true, message: '请选择备件编号', trigger: 'change' }],
{ required: true, message: '请选择备件编号', trigger: 'change' }
],
// type: [ // type: [
// { required: true, message: '请选择类型', trigger: 'change' } // { required: true, message: '请选择类型', trigger: 'change' }
// ], // ],
// deviceNumber: [ // deviceNumber: [
// { required: true, message: '请选择设备模具编号', trigger: 'change' } // { required: true, message: '请选择设备模具编号', trigger: 'change' }
// ], // ],
qty: [ qty: [{ required: true, message: '请输入申领数量', trigger: 'change' }],
{ required: true, message: '请输入申领数量', trigger: 'change' } available: [{ required: true, message: '请选择是否可用', trigger: 'change' }]
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
}) })

Loading…
Cancel
Save