devicesmgt/sgzb-ui/src/views/scrapManage/forecastWaste/index.js

156 lines
7.2 KiB
JavaScript
Raw Normal View History

2024-04-18 17:58:05 +08:00
import {
getUnitInfoSelectApi,
listPartTypeApi,
} from '@/api/repairTest/repair'
import { getProjectList } from '@/api/claimAndRefund/receive'
let unitList = [] //单位下拉数据
let proList = [] //工程下拉数据
let typeList = [] //类型下拉数据
2024-04-20 17:03:23 +08:00
export const config = {
2024-04-18 17:58:05 +08:00
/* 预报废审核主页 列表参数 */
tableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
2024-04-22 11:24:44 +08:00
{ t_width: '', t_props: 'scrapNum', t_label: '预报废单号', },
{ t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source', },
{ t_width: '', t_props: 'repairNum', t_label: '单号', t_slot: 'code', },
{ t_width: '', t_props: 'unitName', t_label: '退料单位名称', },
{ t_width: '', t_props: 'projectName', t_label: '退料工程名称', },
{ t_width: '', t_props: 'itemType', t_label: '设备类型', },
{ t_width: '', t_props: 'createBy', t_label: '任务创建人', },
{ t_width: '', t_props: 'createTime', t_label: '任务创建时间', },
{ t_width: '', t_props: 'taskStatus', t_label: '审核状态', t_slot: 'type', },
{ t_width: '', t_props: '', t_label: '不通过原因', },
2024-04-18 17:58:05 +08:00
],
/* 预报废审核主页表单 查询参数 */
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ 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: 'laiyuan', f_type: 'sel', f_selList: [] },
2024-04-20 13:26:48 +08:00
{ f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [] },
2024-04-18 17:58:05 +08:00
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
/* 预报废审核弹框内 列表参数 */
previewTableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
2024-04-20 13:26:48 +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: 'status', t_label: '审批状态', t_slot: 't_type' },
2024-04-18 17:58:05 +08:00
{ t_width: '', t_props: '', t_label: '报废原因' },
{ t_width: '', t_props: '', t_label: '报废图片' },
2024-04-20 13:26:48 +08:00
{ t_width: '', t_props: 'remark', t_label: '备注' },
2024-04-18 17:58:05 +08:00
],
/* 预报废审核弹框表单 查询参数 */
previewFormLabel: [
{ f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' },
],
/* 预报废列表主页 列表参数 */
listingTableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
2024-04-23 10:21:21 +08:00
{ t_width: '', t_props: 'scrapNum', t_label: '报废单号' },
2024-04-18 17:58:05 +08:00
{ t_width: '', t_props: '', t_label: '报废类型' },
2024-04-23 10:21:21 +08:00
{ t_width: '', t_props: 'repairNum', t_label: '预报废单号' },
{ t_width: '', t_props: 'unitName', t_label: '退料单位名称' },
{ t_width: '', t_props: 'projectName', t_label: '退料工程名称' },
{ t_width: '', t_props: 'itemType', t_label: '机具类型' },
{ t_width: '', t_props: 'createBy', t_label: '任务创建人' },
{ t_width: '', t_props: 'createTime', t_label: '任务创建时间' },
{ t_width: '', t_props: 'taskStatus', t_label: '审核状态', t_slot: 'type' },
2024-04-18 17:58:05 +08:00
],
/* 预报废列表主页表单 查询参数 */
listingFormLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ 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: 'laiyuan', f_type: 'ipt', f_selList: [] },
{ f_label: '审批状态', f_model: 'shentype', f_type: 'sel', f_selList: [] },
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
{ f_label: '报废类型', f_model: 'shentype', f_type: 'sel', f_selList: [] },
],
/* 预报废列表查看弹框内 列表参数 */
2024-04-20 13:26:48 +08:00
listingPreviewTableProps: [
2024-04-18 17:58:05 +08:00
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '设备编码' },
{ t_width: '', t_props: '', t_label: '设备数量' },
{ t_width: '', t_props: '', t_label: '报废原因' },
{ t_width: '', t_props: '', t_label: '报废图片' },
{ t_width: '', t_props: '', t_label: '备注' },
],
2024-04-22 18:15:42 +08:00
/* 预报废列表页面驳回退料 列表参数 */
2024-04-20 17:03:23 +08:00
returnTableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '类型名称' },
{ t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '数量' },
{ t_width: '', t_props: '', t_label: '合格数量' },
{ t_width: '', t_props: '', t_label: '维修数量' },
{ t_width: '', t_props: '', t_label: '预报废数量' },
{ t_width: '', t_props: '', t_label: '状态' },
],
/* 预报废页面驳回退料 查询参数 */
returnFormLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '类型名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
{ f_label: '规格型号', f_model: 'backPro', f_type: 'sel', f_selList: [] },
],
2024-04-22 18:15:42 +08:00
/* 预报废页面驳回退料 查看弹框内列表参数 */
returnPreviewTableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '设备编码' },
{ t_width: '', t_props: '', t_label: '退料状态' },
],
2024-04-18 17:58:05 +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(() => {
})
}