95 changed files with 5442 additions and 816 deletions
@ -0,0 +1,59 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface EquipmentRepairJobDetailVO { |
|||
id: number |
|||
number: string |
|||
masterId: number |
|||
describing: string |
|||
faultCause: string |
|||
workOut: string |
|||
maintenances: string |
|||
departmentCode: string |
|||
remark: string |
|||
siteId: string |
|||
available: string |
|||
deletionTime: Date |
|||
deleterId: byte[] |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询维修工单子列表
|
|||
export const getEquipmentRepairJobDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/equipment-repair-job-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/equipment-repair-job-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询维修工单子详情
|
|||
export const getEquipmentRepairJobDetail = async (id: number) => { |
|||
return await request.get({ url: `/eam/equipment-repair-job-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增维修工单子
|
|||
export const createEquipmentRepairJobDetail = async (data: EquipmentRepairJobDetailVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改维修工单子
|
|||
export const updateEquipmentRepairJobDetail = async (data: EquipmentRepairJobDetailVO) => { |
|||
return await request.put({ url: `/eam/equipment-repair-job-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除维修工单子
|
|||
export const deleteEquipmentRepairJobDetail = async (id: number) => { |
|||
return await request.delete({ url: `/eam/equipment-repair-job-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出维修工单子 Excel
|
|||
export const exportEquipmentRepairJobDetail = async (params) => { |
|||
return await request.download({ url: `/eam/equipment-repair-job-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/equipment-repair-job-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,93 @@ |
|||
import request from '@/config/axios' |
|||
import {EquipmentReportRepairRequestVO} from "@/api/eam/equipmentReportRepairRequest"; |
|||
|
|||
export interface EquipmentRepairJobMainVO { |
|||
id: number |
|||
number: string |
|||
type: string |
|||
repairNumber: string |
|||
sources: string |
|||
maintenanceDesc: string |
|||
urgency: string |
|||
level: string |
|||
equipmentCode: string |
|||
shutDown: boolean |
|||
startTime: Date |
|||
endTime: Date |
|||
totalMinutes: number |
|||
verifyer: number |
|||
verifyContent: string |
|||
verifyTime: Date |
|||
maintenancer: number |
|||
maintenancePhone: string |
|||
completeResult: string |
|||
completionTime: Date |
|||
maintenanceTime: Date |
|||
repairTime: Date |
|||
repairer: number |
|||
faultType: string |
|||
status: string |
|||
autoOrder: string |
|||
autoPerform: string |
|||
autoVerify: string |
|||
directCreateRecord: string |
|||
classType: string |
|||
factoryAreaCode: string |
|||
workshopCode: string |
|||
lineCode: string |
|||
processCode: string |
|||
workstationCode: string |
|||
departmentCode: string |
|||
remark: string |
|||
siteId: string |
|||
available: string |
|||
deletionTime: Date |
|||
deleterId: byte[] |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询维修工单主列表
|
|||
export const getEquipmentRepairJobMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/equipment-repair-job-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/equipment-repair-job-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询维修工单主详情
|
|||
export const getEquipmentRepairJobMain = async (id: number) => { |
|||
return await request.get({ url: `/eam/equipment-repair-job-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增维修工单主
|
|||
export const createEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-main/create`, data }) |
|||
} |
|||
|
|||
// 修改维修工单主
|
|||
export const updateEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.put({ url: `/eam/equipment-repair-job-main/update`, data }) |
|||
} |
|||
|
|||
// 删除维修工单主
|
|||
export const deleteEquipmentRepairJobMain = async (id: number) => { |
|||
return await request.delete({ url: `/eam/equipment-repair-job-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出维修工单主 Excel
|
|||
export const exportEquipmentRepairJobMain = async (params) => { |
|||
return await request.download({ url: `/eam/equipment-repair-job-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/equipment-repair-job-main/get-import-template' }) |
|||
} |
|||
|
|||
// 修改维修工单状态
|
|||
export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) |
|||
} |
@ -0,0 +1,145 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const EquipmentRepairJobDetailRules = reactive({ |
|||
number: [required], |
|||
masterId: [required], |
|||
concurrencyStamp: [required], |
|||
}) |
|||
|
|||
export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '维修工单号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '主表id', |
|||
field: 'masterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障描述', |
|||
field: 'describing', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '故障原因关联基础数据', |
|||
field: 'faultCause', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '解决措施', |
|||
field: 'workOut', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '维修人员字符串多个', |
|||
field: 'maintenances', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
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')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '部门id', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="EquipmentRepairJobDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="EquipmentRepairJobDetail.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="EquipmentRepairJobDetailRules" |
|||
:formAllSchemas="EquipmentRepairJobDetail.allSchemas" |
|||
:apiUpdate="EquipmentRepairJobDetailApi.updateEquipmentRepairJobDetail" |
|||
:apiCreate="EquipmentRepairJobDetailApi.createEquipmentRepairJobDetail" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentRepairJobDetail.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/eam/equipment-repair-job-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { EquipmentRepairJobDetail,EquipmentRepairJobDetailRules } from './equipmentRepairJobDetail.data' |
|||
import * as EquipmentRepairJobDetailApi from '@/api/eam/equipmentRepairJobDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
import Detail from '@/components/Detail/src/Detail.vue' |
|||
|
|||
defineOptions({ name: 'EquipmentRepairJobDetail' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(EquipmentRepairJobDetail.allSchemas.tableColumns) |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: EquipmentRepairJobDetailApi.getEquipmentRepairJobDetailPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentRepairJobDetail:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentRepairJobDetail:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentRepairJobDetail:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentRepairJobDetail:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentRepairJobDetail:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
var isHave =EquipmentRepairJobDetail.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === 'expireTime'; |
|||
}); |
|||
if(isHave){ |
|||
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|||
message.error('失效时间要大于生效时间') |
|||
return; |
|||
} |
|||
} |
|||
if(data.activeTime==0)data.activeTime = null; |
|||
if(data.expireTime==0)data.expireTime = null; |
|||
if (formType === 'create') { |
|||
await EquipmentRepairJobDetailApi.createEquipmentRepairJobDetail(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await EquipmentRepairJobDetailApi.updateEquipmentRepairJobDetail(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairJobDetail') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await EquipmentRepairJobDetailApi.deleteEquipmentRepairJobDetail(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await EquipmentRepairJobDetailApi.exportEquipmentRepairJobDetail(tableObject.params) |
|||
download.excel(data, '维修工单子.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '维修工单子导入模版.xlsx' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await EquipmentRepairJobDetailApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
File diff suppressed because it is too large
@ -0,0 +1,668 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; |
|||
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; |
|||
import {BasicFaultCause} from "@/views/eam/basicFaultCause/basicFaultCause.data"; |
|||
import * as ItemApi from "@/api/eam/basicFaultCause"; |
|||
import {getBasicFaultCausePage} from "@/api/eam/basicFaultCause"; |
|||
|
|||
// 表单校验
|
|||
export const EquipmentRepairJobMainRules = reactive({ |
|||
number: [required], |
|||
type: [required], |
|||
sources: [required], |
|||
urgency: [required], |
|||
level: [required], |
|||
equipmentCode: [required], |
|||
totalMinutes: [required], |
|||
faultType: [required], |
|||
status: [required], |
|||
}) |
|||
|
|||
export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '维修工单号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '设备类别', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.DEVICE_TYPE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '报修工单号', |
|||
field: 'repairNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '来源字典', |
|||
field: 'sources', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES, |
|||
dictClass: 'string', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '维修描述', |
|||
field: 'maintenanceDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '紧急程度', |
|||
field: 'urgency', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_MAINTENANCE_URGENCY, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '维修级别', |
|||
field: 'level', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_MAINTENANCE_LEVEL, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '设备编号', |
|||
field: 'equipmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: true, |
|||
form: { |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchTitle: '设备信息', // 查询弹窗标题
|
|||
searchListPlaceholder: '请选择 设备编号', // 输入框占位文本
|
|||
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
|
|||
multiple:true, |
|||
searchCondition: [{ |
|||
key: 'status', |
|||
value: 'NORMAL', |
|||
action: '==', |
|||
isSearch: true, |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否停机', |
|||
field: 'shutDown', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'Radio' |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修开始时间', |
|||
field: 'startTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: 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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '维修结束时间', |
|||
field: 'endTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: 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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '维修时长', |
|||
field: 'totalMinutes', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '验证人', |
|||
field: 'verifyer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '验证内容', |
|||
field: 'verifyContent', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '验证时间', |
|||
field: 'verifyTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: 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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '执行人', |
|||
field: 'maintenancer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '维修人联系电话', |
|||
field: 'maintenancePhone', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '结果', |
|||
field: 'completeResult', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '完成时间', |
|||
field: 'completionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: 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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '执行时间', |
|||
field: 'maintenanceTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: 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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '报修时间', |
|||
field: 'repairTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: 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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '报修人', |
|||
field: 'repairer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '故障类型', |
|||
field: 'faultType', |
|||
dictType: DICT_TYPE.FAILURE_REASON, |
|||
dictClass: 'string', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '流程状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_REPAIR_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
// {
|
|||
// label: '自动接单',
|
|||
// field: 'autoOrder',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '自动执行',
|
|||
// field: 'autoPerform',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '自动验证',
|
|||
// field: 'autoVerify',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '直接生成记录', |
|||
field: 'directCreateRecord', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '班组类型', |
|||
field: 'classType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
// {
|
|||
// label: '所属厂区编号',
|
|||
// field: 'factoryAreaCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '车间编号', |
|||
field: 'workshopCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
// {
|
|||
// label: '产线编号',
|
|||
// field: 'lineCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '工序编号',
|
|||
// field: 'processCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '工位编号',
|
|||
// field: 'workstationCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
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')] |
|||
} |
|||
}, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '部门id', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
|||
|
|||
// 表单校验
|
|||
export const EquipmentRepairJobDetailRules = reactive({ |
|||
number: [required], |
|||
masterId: [required], |
|||
concurrencyStamp: [required], |
|||
}) |
|||
|
|||
export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '维修工单号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form:{ |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '主表id', |
|||
field: 'masterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form:{ |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障描述', |
|||
field: 'describing', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '故障原因', |
|||
field: 'faultCause', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择 故障原因', |
|||
searchTitle: '故障原因', // 查询弹窗标题
|
|||
searchAllSchemas: BasicFaultCause.allSchemas, // 查询弹窗所需类
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchPage: ItemApi.getBasicFaultCausePage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
action: '==', |
|||
isSearch: true, |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '解决措施', |
|||
field: 'workOut', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '维修人员字符串多个', |
|||
field: 'maintenances', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
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: true, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,320 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="EquipmentRepairJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="EquipmentRepairJobMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="EquipmentRepairJobMainRules" |
|||
:formAllSchemas="EquipmentRepairJobMain.allSchemas" |
|||
:apiUpdate="EquipmentRepairJobMainApi.updateEquipmentRepairJobMain" |
|||
:apiCreate="EquipmentRepairJobMainApi.createEquipmentRepairJobMain" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="EquipmentRepairJobMain.allSchemas" |
|||
:detailAllSchemas="EquipmentRepairJobDetail.allSchemas" |
|||
:detailAllSchemasRules="EquipmentRepairJobDetailRules" |
|||
:apiPage="EquipmentRepairJobDetailApi.getEquipmentRepairJobDetailPage" |
|||
:apiCreate="EquipmentRepairJobDetailApi.createEquipmentRepairJobDetail" |
|||
:apiUpdate="EquipmentRepairJobDetailApi.updateEquipmentRepairJobDetail" |
|||
:apiDelete="EquipmentRepairJobDetailApi.deleteEquipmentRepairJobDetail" |
|||
:detailButtonIsShowAdd=statusBtn |
|||
:detailButtonIsShowEdit=statusBtn |
|||
:detailButtonIsShowDelete=statusBtn |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/eam/equipment-repair-job-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { EquipmentRepairJobMain,EquipmentRepairJobMainRules,EquipmentRepairJobDetail,EquipmentRepairJobDetailRules } from './equipmentRepairJobMain.data' |
|||
import * as EquipmentRepairJobMainApi from '@/api/eam/equipmentRepairJobMain' |
|||
import * as EquipmentRepairJobDetailApi from '@/api/eam/equipmentRepairJobDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue' |
|||
|
|||
defineOptions({ name: 'EquipmentRepairJobMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(EquipmentRepairJobMain.allSchemas.tableColumns) |
|||
const statusBtn = ref(false); |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: EquipmentRepairJobMainApi.getEquipmentRepairJobMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentRepairJobMain:create'}), // 新增 |
|||
//defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentRepairJobMain:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentRepairJobMain:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
const isShowStatusButton = (row,val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return[ |
|||
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentRepairJobMain:update'}), // 编辑 |
|||
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 接单 |
|||
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 执行 |
|||
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //完成 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} else if (val == 'receive') { // 接单 |
|||
handleReceive(row.id) |
|||
} else if (val == 'execute') { // 执行 |
|||
handleExecute(row.id) |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
var isHave =EquipmentRepairJobMain.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === 'expireTime'; |
|||
}); |
|||
if(isHave){ |
|||
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|||
message.error('失效时间要大于生效时间') |
|||
return; |
|||
} |
|||
} |
|||
if(data.activeTime==0)data.activeTime = null; |
|||
if(data.expireTime==0)data.expireTime = null; |
|||
if (formType === 'create') { |
|||
await EquipmentRepairJobMainApi.createEquipmentRepairJobMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
if('5' === row.status){ |
|||
statusBtn.value=true |
|||
}else { |
|||
statusBtn.value=false |
|||
} |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairJobMain') |
|||
} |
|||
|
|||
/** 接单按钮操作 */ |
|||
const handleReceive = async (id: number) => { |
|||
try { |
|||
// 中止的二次确认 |
|||
await message.delConfirm('是否接单?'); |
|||
const params = ref({ |
|||
id: '', |
|||
status:'', |
|||
}) |
|||
params.value.id = id |
|||
params.value.status = '4' |
|||
// 发起删除 |
|||
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) |
|||
message.success(t('接单成功')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 执行按钮操作 */ |
|||
const handleExecute = async (id: number) => { |
|||
try { |
|||
// 二次确认 |
|||
await message.delConfirm('是否执行所选中任务?'); |
|||
const params = ref({ |
|||
id: '', |
|||
status:'', |
|||
}) |
|||
params.value.id = id |
|||
params.value.status = '5' |
|||
// 发起 |
|||
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) |
|||
message.success(t('执行成功')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await EquipmentRepairJobMainApi.deleteEquipmentRepairJobMain(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await EquipmentRepairJobMainApi.exportEquipmentRepairJobMain(tableObject.params) |
|||
download.excel(data, '维修工单主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '维修工单主导入模版.xlsx' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await EquipmentRepairJobMainApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,141 @@ |
|||
<template> |
|||
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false"> |
|||
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="审核人" prop="approver"> |
|||
<el-input v-model="formData.approver" placeholder="请输入审核人" :disabled="isDisabled"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="审核内容" prop="approveContent"> |
|||
<el-input v-model="formData.approveContent" placeholder="请输入审核内容" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="审核时间" prop="approveTime"> |
|||
<el-date-picker |
|||
v-model="formData.approveTime" |
|||
type="datetime" |
|||
value-format="x" |
|||
placeholder="选择审核时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<template #footer> |
|||
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')">确 定</el-button> |
|||
<el-button @click="handleClose('close')">取 消</el-button> |
|||
</template> |
|||
</Dialog> |
|||
|
|||
<!--添加巡检项弹窗--> |
|||
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
|||
|
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { SearchTable } from '@/components/SearchTable' |
|||
import {ElInput} from "element-plus"; |
|||
import * as EquipmentReportRepairRequestApi from "@/api/eam/equipmentReportRepairRequest"; |
|||
|
|||
defineOptions({ name: 'TeamForm' }) |
|||
|
|||
const { t } = useI18n() // 国际化 |
|||
const message = useMessage() // 消息弹窗 |
|||
|
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const dialogTitle = ref('') // 弹窗的标题 |
|||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|||
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|||
const tags=ref([]) |
|||
|
|||
const inputValue = ref('') |
|||
const inputVisible = ref(false) |
|||
const isDisabled = ref(false) |
|||
const InputRef = ref<InstanceType<typeof ElInput>>() |
|||
|
|||
|
|||
const formData = ref({ |
|||
id:'', |
|||
number:'', |
|||
approver: '', |
|||
approveContent: '', |
|||
approveTime: '', |
|||
}) |
|||
const formRules = reactive({ |
|||
approver: [ |
|||
{ required: true, message: '审核人不能为空', trigger: 'blur' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
approveContent: [ |
|||
{ required: true, message: '审核内容不能为空', trigger: 'blur' }, |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
approveTime: [ |
|||
{ required: true, message: '审核时间不能为空', trigger: 'blur' }, |
|||
], |
|||
}) |
|||
const basicFormRef = ref() // 表单 Ref |
|||
|
|||
|
|||
/** 初始化弹窗 */ |
|||
const open = async (type: string, row?: object) => { |
|||
dialogVisible.value = true |
|||
dialogTitle.value = t('action.' + type) |
|||
formType.value = type |
|||
//初始化数据 |
|||
formData.value.id = row.id |
|||
formData.value.number = row.number |
|||
} |
|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
/** 提交表单 */ |
|||
const submitForm = async (val) => { |
|||
//把success函数传递到父页面 |
|||
emit('success',formData.value.id) |
|||
// 校验表单 |
|||
if (!basicFormRef) return |
|||
const valid = await basicFormRef.value.validate() |
|||
if (!valid) return |
|||
|
|||
//发送数据 |
|||
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairRequest(formData.value) |
|||
dialogVisible.value = false |
|||
} |
|||
|
|||
const handleClose=(val)=>{ |
|||
dialogVisible.value = false |
|||
emit('close',val) |
|||
} |
|||
|
|||
// 传递给父类 |
|||
const emit = defineEmits(['close','success']) |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
.tag-container { |
|||
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */ |
|||
border: 1px solid #ccc; /* 添加边框样式 */ |
|||
padding: 10px; /* 可根据需要调整容器内边距 */ |
|||
width: 950px; /* 设置固定宽度为 950px */ |
|||
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */ |
|||
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */ |
|||
overflow-wrap: break-word; /* 兼容性更好的写法 */ |
|||
flex-wrap: wrap; |
|||
} |
|||
.input-with-button { |
|||
display: flex; |
|||
align-items: center; |
|||
width: 100%; |
|||
} |
|||
|
|||
.input-with-button > .el-input { |
|||
flex: 1; |
|||
/*margin-right: 10px;*/ |
|||
} |
|||
|
|||
</style> |
@ -0,0 +1,510 @@ |
|||
<!-- 供应商首页 --> |
|||
<template> |
|||
<div class="one-row"> |
|||
<div class="data"> |
|||
<div class="data-item"> |
|||
<div class="small-title">{{ t('home.number_orders') }}</div> |
|||
<div class="small-data"> |
|||
<div class="small-data-item small-data-item1"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.openPurchaseCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{ t('home.number_open') }}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon1.png" alt="" class="img" /> |
|||
</div> |
|||
<div class="small-data-item small-data-item2 ml-14px"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.allPurchaseCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{ t('home.number_total_order') }}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon5.png" alt="" class="img" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="data-item ml-14px"> |
|||
<div class="small-title">{{t('home.number_planned_shipments')}}</div> |
|||
<div class="small-data"> |
|||
<div class="small-data-item small-data-item3"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.openPurchasePlanCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_open_plans')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon6.png" alt="" class="img" /> |
|||
</div> |
|||
<div class="small-data-item small-data-item4 ml-14px"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.allPurchasePlanCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_all_plans')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon3.png" alt="" class="img" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="data-item ml-14px"> |
|||
<div class="small-title">{{t('home.number_invoices')}}</div> |
|||
<div class="small-data"> |
|||
<div class="small-data-item small-data-item5"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.notTakeSupplierdeliverCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_unreceived_orders')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon4.png" alt="" class="img" /> |
|||
</div> |
|||
<div class="small-data-item small-data-item6 ml-14px"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.takeSupplierdeliverCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_orders_received')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon2.png" alt="" class="img" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="two-row mt-14px"> |
|||
<div class="data1 w-[65%]"> |
|||
<div class="title">{{t('home.invoice_trend_month')}}</div> |
|||
<Echart :options="lineOptions" :height="280" :key="lineIndex" /> |
|||
</div> |
|||
<div class="data1 w-[35%] ml-14px"> |
|||
<div class="title">{{t('home.TOP10_parts_shipped_month')}}</div> |
|||
<Echart :options="pieOptions" :height="280" :key="lineIndex" /> |
|||
</div> |
|||
</div> |
|||
<div class="two-row mt-14px"> |
|||
<div class="data1 w-[47.3%]"> |
|||
<div class="title">{{t('home.latest_news')}}</div> |
|||
<el-table :data="notaicList" style="width: 100%" stripe height="240px"> |
|||
<el-table-column :label="t('home.number')" align="center" prop="id" /> |
|||
<el-table-column :label="t('home.user_type')" align="center" prop="userType"> |
|||
<template #default="scope"> |
|||
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('home.user_number')" align="center" prop="userId" width="80" /> |
|||
<el-table-column :label="t('home.template_coding')" align="center" prop="templateCode" width="80" /> |
|||
<el-table-column :label="t('home.sender_number')" align="center" prop="templateNickname" width="180" /> |
|||
<el-table-column |
|||
:label="t('home.template_content')" |
|||
align="center" |
|||
prop="templateContent" |
|||
width="200" |
|||
show-overflow-tooltip |
|||
/> |
|||
<el-table-column |
|||
:label="t('home.template_parameters')" |
|||
align="center" |
|||
prop="templateParams" |
|||
width="180" |
|||
show-overflow-tooltip |
|||
> |
|||
<template #default="scope"> {{ scope.row.templateParams }}</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('home.template_type')" align="center" prop="templateType" width="120"> |
|||
<template #default="scope"> |
|||
<dict-tag |
|||
:type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" |
|||
:value="scope.row.templateType" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('home.read')" align="center" prop="readStatus" width="100"> |
|||
<template #default="scope"> |
|||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.readStatus" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
:label="t('home.read_time')" |
|||
align="center" |
|||
prop="readTime" |
|||
width="180" |
|||
:formatter="dateFormatter" |
|||
/> |
|||
<el-table-column |
|||
:label="t('home.create_time')" |
|||
align="center" |
|||
prop="createTime" |
|||
width="180" |
|||
:formatter="dateFormatter" |
|||
/> |
|||
<!-- <el-table-column label="操作" align="center" fixed="right" width="120"> |
|||
<template #default="scope"> |
|||
<el-button link type="primary" @click="openDetail(scope.row)" v-hasPermi="['system:notify-message:query']"> |
|||
<Icon icon="ep:document-copy" /> |
|||
详情 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> --> |
|||
</el-table> |
|||
</div> |
|||
<div class="data1 w-[47.3%]"> |
|||
<div class="title">{{ t('home.latest_deduction_details')}}</div> |
|||
<el-table :data="tableData" style="width: 100%" stripe height="240px"> |
|||
<el-table-column prop="title" :label="t('home.title')" /> |
|||
<el-table-column prop="name" :label="t('home.publisher')" /> |
|||
<el-table-column prop="date" :label="t('home.publish_date')" /> |
|||
</el-table> |
|||
</div> |
|||
</div> |
|||
<div class="two-row mt-14px"> |
|||
<div class="data1 w-[47.3%]"> |
|||
<!-- 本月退货明细 --> |
|||
<div class="title">{{t('home.month_return_detials')}}</div> |
|||
<el-table |
|||
:data="purchasereturnRecordMonth" |
|||
style="width: 100%" |
|||
stripe |
|||
height="240px" |
|||
> |
|||
<el-table-column prop="number" :label="t('home.document_number')" width="180" /> |
|||
<el-table-column prop="fromPackingNumber" :label="t('home.source_package_number')" width="180" /> |
|||
<el-table-column prop="toPackingNumber" :label="t('home.destination_package_number')" width="180" /> |
|||
<el-table-column prop="fromContainerNumber" :label="t('home.source_appliance_number')" width="120" /> |
|||
<el-table-column prop="toContainerNumber" :label="t('home.destination_appliance_number')" width="120" /> |
|||
<el-table-column prop="fromBatch" :label="t('home.source_batch')" width="120" /> |
|||
<el-table-column prop="toBatch" :label="t('home.destination_batch')" width="120" /> |
|||
<el-table-column prop="altBatch" :label="t('home.replace_batch')" width="120" /> |
|||
<el-table-column prop="fromLocationCode" :label="t('home.source_location_code')" width="120" /> |
|||
<el-table-column prop="toLocationCode" :label="t('home.destination_location_code')" width="120" /> |
|||
<el-table-column prop="fromLocationGroupCode" :label="t('home.source_location_group_code')" width="120" /> |
|||
<el-table-column prop="toLocationGroupCode" :label="t('home.destination_location_group_code')" width="120" /> |
|||
<el-table-column prop="fromAreaCode" :label="t('home.source_location_area_code')" width="120" /> |
|||
<el-table-column prop="toAreaCode" :label="t('home.destination_location_area_code')" width="120" /> |
|||
<el-table-column prop="fromOwnerCode" :label="t('home.source_shipper_code')" width="120" /> |
|||
<el-table-column prop="toOwnerCode" :label="t('home.destination_shipper_code')" width="120" /> |
|||
<el-table-column prop="inventoryStatus" :label="t('home.inventory_state')" width="120"> |
|||
<template #default="scope"> |
|||
{{ formatter(scope.row.inventoryStatus,DICT_TYPE.INVENTORY_STATUS) }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="poNumber" :label="t('home.order_number')" width="120" /> |
|||
<el-table-column prop="poline" :label="t('home.order_line')" width="120" /> |
|||
<el-table-column prop="reason" :label="t('home.cause')" width="120" /> |
|||
<el-table-column prop="singlePrice" :label="t('home.unit_price')" width="120" /> |
|||
<el-table-column prop="amount" :label="t('home.money')" width="120" /> |
|||
<el-table-column prop="itemCode" :label="t('home.material_code')" width="160" /> |
|||
<el-table-column prop="itemName" :label="t('home.material_name')" width="120" /> |
|||
<el-table-column prop="itemDesc1" :label="t('home.material_description1')" width="120" /> |
|||
<el-table-column prop="itemDesc2" :label="t('home.material_description2')" width="120" /> |
|||
<el-table-column prop="qty" :label="t('home.amount')" width="120" /> |
|||
<el-table-column prop="uom" :label="t('home.measuring_unit')" width="120"> |
|||
<template #default="scope"> |
|||
{{ formatter(scope.row.uom,DICT_TYPE.UOM) }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="projectCode" :label="t('home.item_code')" width="120" /> |
|||
<el-table-column prop="remark" :label="t('home.comment')" width="120" /> |
|||
<el-table-column prop="createTime" :label="t('home.create_time')" width="170"> |
|||
<template #default="scope"> |
|||
<span>{{ formatDate(scope.row.createTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="creator" :label="t('home.creater')" width="120" /> |
|||
</el-table> |
|||
<el-pagination style="margin-top:10px" |
|||
v-model:current-page="currentPage_purchasereturn" |
|||
v-model:page-size="pageSize_purchasereturn" |
|||
:page-sizes="[10, 20, 30, 50, 100]" |
|||
:small="true" |
|||
:background="false" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
:total="total_purchasereturn" |
|||
@size-change="getPurchasereturnRecordMonth" |
|||
@current-change="getPurchasereturnRecordMonth" |
|||
/> |
|||
</div> |
|||
<div class="data1 w-[47.3%]"> |
|||
<!-- 本月索赔明细 --> |
|||
<div class="title">{{t('home.claim_details_month')}}</div> |
|||
<el-table |
|||
:data="purchaseclaimRecordMonth" |
|||
style="width: 100%" |
|||
stripe |
|||
height="240px" |
|||
> |
|||
<el-table-column prop="number" :label="t('home.document_number')" width="180" /> |
|||
<el-table-column prop="fromBatch" :label="t('home.batch')" width="120" /> |
|||
<el-table-column prop="poNumber" :label="t('home.order_number')" width="120" /> |
|||
<el-table-column prop="poline" :label="t('home.order_line')" width="120" /> |
|||
<el-table-column prop="reason" :label="t('home.cause')" width="120" /> |
|||
<el-table-column prop="singlePrice" :label="t('home.unit_price')" width="120" /> |
|||
<el-table-column prop="amount" :label="t('home.money')" width="120" /> |
|||
<el-table-column prop="code" label="代码" width="160" /> |
|||
<el-table-column prop="createTime" :label="t('home.create_time')" width="170"> |
|||
<template #default="scope"> |
|||
<span>{{ formatDate(scope.row.createTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="creator" :label="t('home.creater')" width="120" /> |
|||
</el-table> |
|||
<el-pagination style="margin-top:10px" |
|||
v-model:current-page="currentPage_purchaseclaim" |
|||
v-model:page-size="pageSize_purchaseclaim" |
|||
:page-sizes="[10, 20, 30, 50, 100]" |
|||
:small="true" |
|||
:background="false" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
:total="total_purchaseclaim" |
|||
@size-change="getPurchaseclaimRecordMonth" |
|||
@current-change="getPurchaseclaimRecordMonth" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { set } from 'lodash-es' |
|||
import { EChartsOption } from 'echarts' |
|||
import { lineOptions, pieOptions } from '../echarts-data' |
|||
import { formatDate,dateFormatter } from '@/utils/formatTime' |
|||
|
|||
import * as NotifyMessageApi from '@/api/system/notify/message' |
|||
import * as IndexApi from '@/api/home' |
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
const { t } = useI18n() |
|||
const tableData = [ |
|||
{ |
|||
date: '2016-05-03', |
|||
name: 'Tom', |
|||
title: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-02', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-04', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-01', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-01', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-01', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
} |
|||
] |
|||
const supplierData = ref() |
|||
const lineIndex = ref(0) |
|||
// 本月发货单趋势 |
|||
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption |
|||
const getInvoiceCharts = async () => { |
|||
set( |
|||
lineOptionsData, |
|||
'xAxis.data', |
|||
supplierData.value.supplierdeliverMonthCount.map((v) => v.date) |
|||
) |
|||
set(lineOptionsData, 'legend.data', [t('home.invoice_trend_month')]) |
|||
set(lineOptionsData, 'series', [ |
|||
{ |
|||
name: t('home.invoice_trend_month'), |
|||
smooth: true, |
|||
type: 'line', |
|||
itemStyle: {}, |
|||
animationDuration: 2800, |
|||
animationEasing: 'quadraticOut', |
|||
data: supplierData.value.supplierdeliverMonthCount.map((v) => v.count) |
|||
} |
|||
]) |
|||
lineIndex.value++ |
|||
} |
|||
//本月发货零件TOP10 |
|||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption |
|||
const getPartTOPCharts = async () => { |
|||
const data = [ |
|||
{ value: 335, name: 'analysis.directAccess' }, |
|||
{ value: 310, name: 'analysis.mailMarketing' }, |
|||
{ value: 234, name: 'analysis.allianceAdvertising' }, |
|||
{ value: 135, name: 'analysis.videoAdvertising' }, |
|||
{ value: 1548, name: 'analysis.searchEngines' } |
|||
] |
|||
console.log(supplierData.value.supplierdeliverItemMonthTop) |
|||
set( |
|||
pieOptionsData, |
|||
'legend.data', |
|||
supplierData.value.supplierdeliverItemMonthTop.map((v) => v.itemCode) |
|||
) |
|||
pieOptionsData!.series![0].data = supplierData.value.supplierdeliverItemMonthTop.map((v) => { |
|||
return { |
|||
name: v.itemCode, |
|||
value: v.qty |
|||
} |
|||
}) |
|||
lineIndex.value++ |
|||
} |
|||
// 获取供应商数据 |
|||
const getSupplierData = async () => { |
|||
IndexApi.getSupplierData().then((res) => { |
|||
supplierData.value = res |
|||
getInvoiceCharts() |
|||
getPartTOPCharts() |
|||
}) |
|||
} |
|||
// 最新消息 |
|||
const notaicList = ref([]) // 列表的数据 |
|||
const queryParams = reactive({ |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
userType: undefined, |
|||
userId: undefined, |
|||
templateCode: undefined, |
|||
templateType: undefined, |
|||
createTime: [] |
|||
}) |
|||
/** 查询列表 */ |
|||
const getList = async () => { |
|||
try { |
|||
const data = await NotifyMessageApi.getNotifyMessagePage(queryParams) |
|||
notaicList.value = data.list |
|||
} finally { |
|||
} |
|||
} |
|||
const formatter = (type,dict) => { |
|||
let str = getStrDictOptions(dict).filter((item) => type == item.value)[0]?.label |
|||
return str |
|||
} |
|||
|
|||
// 本月退货明细 |
|||
const currentPage_purchasereturn = ref(1) |
|||
const pageSize_purchasereturn = ref(10) |
|||
const total_purchasereturn= ref(100) |
|||
const purchasereturnRecordMonth = ref([]) |
|||
const getPurchasereturnRecordMonth = ()=>{ |
|||
IndexApi.getPurchasereturnRecordMonth({ |
|||
pageNo: currentPage_purchasereturn.value, |
|||
pageSize: pageSize_purchasereturn.value |
|||
}).then((res) => { |
|||
console.log('getPurchasereturnRecordMonth',res) |
|||
purchasereturnRecordMonth.value = res.list |
|||
total_purchasereturn.value = res.total |
|||
}) |
|||
} |
|||
// 本月索赔明细 |
|||
const currentPage_purchaseclaim = ref(1) |
|||
const pageSize_purchaseclaim = ref(10) |
|||
const total_purchaseclaim= ref(100) |
|||
const purchaseclaimRecordMonth = ref([]) |
|||
const getPurchaseclaimRecordMonth = ()=>{ |
|||
IndexApi.getPurchaseclaimRecordMonth({ |
|||
pageNo: currentPage_purchaseclaim.value, |
|||
pageSize: pageSize_purchaseclaim.value |
|||
}).then((res) => { |
|||
console.log('getPurchaseclaimRecordMonth',res) |
|||
purchaseclaimRecordMonth.value = res.list |
|||
total_purchaseclaim.value = res.total |
|||
}) |
|||
} |
|||
onMounted( () => { |
|||
getSupplierData() |
|||
getList() |
|||
// 本月索赔明细 |
|||
Promise.all([getPurchaseclaimRecordMonth(),getPurchasereturnRecordMonth()]) |
|||
}) |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
.title { |
|||
padding-bottom: 10px; |
|||
border-bottom: 1px solid #dedede; |
|||
position: relative; |
|||
padding-left: 10px; |
|||
&::after { |
|||
content: ''; |
|||
position: absolute; |
|||
width: 4px; |
|||
height: 16px; |
|||
background: #3c7adf; |
|||
left: 0px; |
|||
top: 3px; |
|||
border-radius: 8px; |
|||
} |
|||
} |
|||
.data { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
.data-item { |
|||
width: calc(100% / 3); |
|||
padding: 10px 0px; |
|||
background: white; |
|||
.small-title { |
|||
padding: 0px 14px 10px; |
|||
} |
|||
.small-data { |
|||
display: flex; |
|||
align-content: center; |
|||
justify-content: space-between; |
|||
padding: 0px 14px; |
|||
.small-data-item { |
|||
width: 50%; |
|||
height: 70px; |
|||
display: flex; |
|||
align-items: center; |
|||
border-radius: 6px; |
|||
color: white; |
|||
padding: 0px 20px; |
|||
.small-data-item-txt { |
|||
flex: 1; |
|||
div { |
|||
&:nth-child(1) { |
|||
font-size: 20px; |
|||
span { |
|||
font-size: 12px; |
|||
padding-left: 6px; |
|||
} |
|||
} |
|||
&:nth-child(2) { |
|||
font-size: 12px; |
|||
} |
|||
} |
|||
} |
|||
.img { |
|||
width: 30px; |
|||
opacity: 0.5; |
|||
} |
|||
} |
|||
.small-data-item1 { |
|||
background: linear-gradient(to left, #fd817d, #fcad80); |
|||
} |
|||
.small-data-item2 { |
|||
background: linear-gradient(to left, #46c6fa, #336bfe); |
|||
} |
|||
.small-data-item3 { |
|||
background: linear-gradient(to left, #96a6cc, #595f82); |
|||
} |
|||
.small-data-item4 { |
|||
background: linear-gradient(to left, #08dcd5, #46e2bb); |
|||
} |
|||
.small-data-item5 { |
|||
background: linear-gradient(to left, #f4c46b, #ffb313); |
|||
} |
|||
.small-data-item6 { |
|||
background: linear-gradient(to left, #6eccf8, #02acfd); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.two-row { |
|||
display: flex; |
|||
align-content: center; |
|||
justify-content: space-between; |
|||
.data1 { |
|||
background: white; |
|||
padding: 14px; |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue