devicesmgt/sgzb-ui/src/views/scrapManage/scrap/disposition/config.js

110 lines
4.0 KiB
JavaScript
Raw Normal View History

import {
getUnitInfoSelectApi,
listPartTypeApi,
} from '@/api/repairTest/repair'
import { getProjectList } from '@/api/claimAndRefund/receive'
let unitList = []
let proList = []
let typeList = []
2024-04-22 18:15:42 +08:00
export const config = {
handleColShow: true, // 是否显示操作列
pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度
formLabel: [
{ f_label: '关键字', f_model: 'keyword', f_type: 'ipt' },
2024-04-22 18:15:42 +08:00
{ f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
{ f_label: '工程名称', f_model: 'backPro', f_type: 'sel', f_selList: [] },
{ f_label: '工机具类型', f_model: 'type', f_type: 'selCas', f_selList: [], optionProps: { value: 'id', } },
{ f_label: '报废单号', f_model: 'backCode', f_type: 'ipt', },
{
f_label: '处置状态', f_model: 'disposition', f_type: 'sel', f_selList: [
{ label: '未处置', value: 0 },
{ label: '已处置', value: 1 },
]
},
2024-04-22 18:15:42 +08:00
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
columnsList: [
2024-05-28 16:54:30 +08:00
// { t_width: '55px', t_props: '', t_label: '序号' },
2024-04-26 14:45:18 +08:00
{ t_props: 'scrapNum', t_label: '报废单号' },
{ t_props: '', t_label: '报废来源', t_slot: 'source' },
{ t_props: 'repairNum', t_label: '预报废单号' },
{ t_props: 'unitName', t_label: '退料单位名称' },
{ t_props: 'projectName', t_label: '退料工程名称' },
{ t_props: 'itemType', t_label: '机具类型' },
{ t_props: 'createBy', t_label: '任务创建人' },
{ t_props: 'createTime', t_label: '任务创建时间' },
{ t_props: '', t_label: '处置状态', t_slot: 'type' },
{ t_props: '', t_label: '附件信息', t_slot: 'file' },
2024-04-22 18:15:42 +08:00
],
}
export const dialogConfig = {
outerWidth: '70%',
outerTitle: '',
outerVisible: false,
innerWidth: '50%',
innerTitle: '',
innerVisible: false,
handleColShow: false, // 是否显示操作列
pageShow: false, // 是否显示分页组件
isSelShow: false,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
formLabel: [
{ f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' },
],
columnsList: [
2024-05-28 16:54:30 +08:00
// { t_width: '55px', t_props: '', t_label: '序号' },
2024-04-26 15:45:36 +08:00
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'remark', t_label: '报废原因' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' },
2024-04-22 18:15:42 +08:00
],
}
export const getSelList = () => {
new Promise(async (resolve) => {
const { data: unitRes } = await getUnitInfoSelectApi()
unitList = unitRes.map((e) => {
e.value = e.unitId
e.label = e.unitName
return e
})
const { data: proRes } = await getProjectList()
proList = proRes.map((e) => {
e.value = e.projectId
e.label = e.projectName
return e
})
const { data: typeRes } = await listPartTypeApi()
typeList = typeRes
resolve()
}).then(() => {
config.formLabel.map((item) => {
if (item.f_model === 'backUnit') {
item.f_selList = unitList
return item
}
if (item.f_model === 'backPro') {
item.f_selList = proList
return item
}
if (item.f_model === 'type') {
item.f_selList = typeList
return item
}
})
}).catch(() => {
})
}