Browse Source

EAM ——> 点检工单 状态流转 前后端

master_hella_20240701
gaojs 5 months ago
parent
commit
3bed166a0b
  1. 62
      src/api/eam/equipmentSpotCheckDetail/index.ts
  2. 24
      src/api/eam/equipmentSpotCheckMain/index.ts
  3. 57
      src/api/eam/relationSpotCheckPlanItem/index.ts
  4. 27
      src/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data.ts
  5. 57
      src/views/eam/equipmentInspectionMain/index.vue
  6. 26
      src/views/eam/equipmentMaintenanceMain/index.vue
  7. 257
      src/views/eam/equipmentSpotCheckDetail/equipmentSpotCheckDetail.data.ts
  8. 244
      src/views/eam/equipmentSpotCheckDetail/index.vue
  9. 1055
      src/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue
  10. 205
      src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts
  11. 144
      src/views/eam/equipmentSpotCheckMain/finishForm1.vue
  12. 151
      src/views/eam/equipmentSpotCheckMain/finishForm2.vue
  13. 326
      src/views/eam/equipmentSpotCheckMain/index.vue

62
src/api/eam/equipmentSpotCheckDetail/index.ts

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface EquipmentSpotCheckDetailVO {
id: number
number: string
masterId: number
completionTime: Date
uncompletedCause: string
result: string
name: string
content: string
equipmentParts: string
methods: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询点检工单子列表
export const getEquipmentSpotCheckDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-spot-check-detail/senior', data })
} else {
return await request.get({ url: `/eam/equipment-spot-check-detail/page`, params })
}
}
// 查询点检工单子详情
export const getEquipmentSpotCheckDetail = async (id: number) => {
return await request.get({ url: `/eam/equipment-spot-check-detail/get?id=` + id })
}
// 新增点检工单子
export const createEquipmentSpotCheckDetail = async (data: EquipmentSpotCheckDetailVO) => {
return await request.post({ url: `/eam/equipment-spot-check-detail/create`, data })
}
// 修改点检工单子
export const updateEquipmentSpotCheckDetail = async (data: EquipmentSpotCheckDetailVO) => {
return await request.put({ url: `/eam/equipment-spot-check-detail/update`, data })
}
// 删除点检工单子
export const deleteEquipmentSpotCheckDetail = async (id: number) => {
return await request.delete({ url: `/eam/equipment-spot-check-detail/delete?id=` + id })
}
// 导出点检工单子 Excel
export const exportEquipmentSpotCheckDetail = async (params) => {
return await request.download({ url: `/eam/equipment-spot-check-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-spot-check-detail/get-import-template' })
}

24
src/api/eam/equipmentSpotCheckMain/index.ts

@ -1,4 +1,5 @@
import request from '@/config/axios'
import {EquipmentInspectionMainVO} from "@/api/eam/equipmentInspectionMain";
export interface EquipmentSpotCheckMainVO {
id: number
@ -65,6 +66,11 @@ export const updateEquipmentSpotCheckMain = async (data: EquipmentSpotCheckMainV
return await request.put({ url: `/eam/equipment-spot-check-main/update`, data })
}
// 修改点检工单主
export const updateEquipmentSpotCheck = async (data: EquipmentSpotCheckMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-main/updateOrders`, data })
}
// 删除点检工单主
export const deleteEquipmentSpotCheckMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-spot-check-main/delete?id=` + id })
@ -78,4 +84,20 @@ export const exportEquipmentSpotCheckMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-spot-check-main/get-import-template' })
}
}
// 修改点检工单状态
export const updateEquipmentSpotCheckOrder = async (data: EquipmentSpotCheckMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-main/updateOrder`, data })
}
//完成点检工单
export const executeEquipmentSpotCheckOrder = async (data: EquipmentSpotCheckMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-main/execute`, data })
}
//验证不通过,打回点检工单
export const backEquipmentSpotCheckOrder = async (data: EquipmentSpotCheckMainVO) => {
return await request.post({ url: `/eam/equipment-spot-check-main/fallback`, data })
}

57
src/api/eam/relationSpotCheckPlanItem/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface RelationSpotCheckPlanItemVO {
id: number
planNumber: string
itemCode: string
itemName: string
isSelectd: boolean
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询点检计划表和巡检项关系列表
export const getRelationSpotCheckPlanItemPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/relation-spot-check-plan-item/senior', data })
} else {
return await request.get({ url: `/eam/relation-spot-check-plan-item/page`, params })
}
}
// 查询点检计划表和巡检项关系详情
export const getRelationSpotCheckPlanItem = async (id: number) => {
return await request.get({ url: `/eam/relation-spot-check-plan-item/get?id=` + id })
}
// 新增点检计划表和巡检项关系
export const createRelationSpotCheckPlanItem = async (data: RelationSpotCheckPlanItemVO) => {
return await request.post({ url: `/eam/relation-spot-check-plan-item/create`, data })
}
// 修改点检计划表和巡检项关系
export const updateRelationSpotCheckPlanItem = async (data: RelationSpotCheckPlanItemVO) => {
return await request.put({ url: `/eam/relation-spot-check-plan-item/update`, data })
}
// 删除点检计划表和巡检项关系
export const deleteRelationSpotCheckPlanItem = async (id: number) => {
return await request.delete({ url: `/eam/relation-spot-check-plan-item/delete?id=` + id })
}
// 导出点检计划表和巡检项关系 Excel
export const exportRelationSpotCheckPlanItem = async (params) => {
return await request.download({ url: `/eam/relation-spot-check-plan-item/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/relation-spot-check-plan-item/get-import-template' })
}

27
src/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data.ts

@ -109,18 +109,21 @@ export const EquipmentInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
// {
// label: '巡检内容',
// field: 'content',
// sort: 'custom',
// isSearch: true,
// form: {
// componentProps: {
// type:"textarea",
// maxlength:"100"
// }
// }
// },
{
label: '巡检内容',
field: 'content',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
componentProps: {
type:"textarea",
maxlength:"100"
}
}
},
{
label: '创建时间',
field: 'createTime',

57
src/views/eam/equipmentInspectionMain/index.vue

@ -94,11 +94,6 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
import * as EquipmentMaintenanceMainApi from "@/api/eam/equipmentMaintenanceMain";
import {
executeEquipmentInspectionOrder,
updateEquipmentInspectionOrder
} from "@/api/eam/equipmentInspectionMain";
defineOptions({ name: 'EquipmentInspectionMain' })
@ -135,8 +130,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentInspectionMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentInspectionMain:import'}), //
//defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentInspectionMain:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentInspectionMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentInspectionMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -183,16 +178,24 @@ const isShowStatusButton = (row,val) => {
}
}
const isShowEditStatusButton = (row) => {
if (row.status == "3" || row.status == "4") {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListValidateBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:equipmentMaintenanceMain:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:equipmentMaintenanceMain:update'}),
defaultButtons.mainListEditBtn({hide: isShowEditStatusButton(row),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentInspectionMain:update'}), //
defaultButtons.mainListValidateBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentInspectionMain:update'}), //
//defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:equipmentInspectionMain:update'}),
//defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:equipmentInspectionMain:update'}),
]
}
@ -223,6 +226,32 @@ const handleMainFefresh = async()=>{
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
EquipmentInspectionMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'number'){
item.componentProps.disabled = false
}
if(item.field == 'planNumber'){
item.componentProps.disabled = false
}
if(item.field == 'status'){
item.value = '3';
item.componentProps.disabled = true
}
})
}else{
EquipmentInspectionMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'number'){
item.componentProps.disabled = true
}
if(item.field == 'planNumber'){
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row)
}

26
src/views/eam/equipmentMaintenanceMain/index.vue

@ -186,10 +186,18 @@ const isShowStatusButton = (row,val) => {
}
}
const isShowEditStatusButton = (row) => {
if (row.status == "3" || row.status == "4") {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListEditBtn({hide: isShowEditStatusButton(row),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentMaintenanceMain:update'}), //
@ -227,13 +235,25 @@ const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
EquipmentMaintenanceMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.value = '0';
if(item.field == 'number'){
item.componentProps.disabled = false
}
if(item.field == 'planNumber'){
item.componentProps.disabled = false
}
if(item.field == 'status'){
item.value = '3';
item.componentProps.disabled = true
}
})
}else{
EquipmentMaintenanceMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'number'){
item.componentProps.disabled = true
}
if(item.field == 'planNumber'){
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.componentProps.disabled = true
}

257
src/views/eam/equipmentSpotCheckDetail/equipmentSpotCheckDetail.data.ts

@ -0,0 +1,257 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItemApi from "@/api/eam/relationSpotCheckPlanItem"
import {
RelationSpotCheckPlanItem
} from "@/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data";
// 表单校验
export const EquipmentSpotCheckDetailRules = reactive({
number: [required],
masterId: [required],
name: [required],
uncompletedCause:[{
required:false ,
message:'该项为必填项',
tagger:['blur','change']
}],
result: [
{
required:false ,
message:'该项为必填项',
tagger:['blur']
}],
})
export const EquipmentSpotCheckDetail = 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: 'completionTime',
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: '未完成原因',
field: 'uncompletedCause',
sort: 'custom',
isSearch: true,
},
{
label: '结果枚举',
field: 'result',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.IS_COMPLETED,
dictClass: 'string'
},
{
label: '点检项名称',
field: 'name',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择 非必选点检项',
searchTitle: '非必选点检项信息', // 查询弹窗标题
searchAllSchemas: RelationSpotCheckPlanItem.allSchemas, // 查询弹窗所需类
searchField: 'itemName', // 查询弹窗赋值字段
searchPage: ItemApi.getRelationSpotCheckPlanItemPage, // 查询弹窗所需分页方法
searchCondition: []
}
}
},
{
label: '点检内容自动带出',
field: 'content',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
},
},
{
label: '点检部位自动带出',
field: 'equipmentParts',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '点检方法自动带出',
field: 'methods',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
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: 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'
}
}
]))

244
src/views/eam/equipmentSpotCheckDetail/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentSpotCheckDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentSpotCheckDetail.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="EquipmentSpotCheckDetailRules"
:formAllSchemas="EquipmentSpotCheckDetail.allSchemas"
:apiUpdate="EquipmentSpotCheckDetailApi.updateEquipmentSpotCheckDetail"
:apiCreate="EquipmentSpotCheckDetailApi.createEquipmentSpotCheckDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentSpotCheckDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-spot-check-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentSpotCheckDetail,EquipmentSpotCheckDetailRules } from './equipmentSpotCheckDetail.data'
import * as EquipmentSpotCheckDetailApi from '@/api/eam/equipmentSpotCheckDetail'
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: 'EquipmentSpotCheckDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentSpotCheckDetail.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: EquipmentSpotCheckDetailApi.getEquipmentSpotCheckDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentSpotCheckDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentSpotCheckDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentSpotCheckDetail: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:equipmentSpotCheckDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentSpotCheckDetail: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 =EquipmentSpotCheckDetail.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 EquipmentSpotCheckDetailApi.createEquipmentSpotCheckDetail(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentSpotCheckDetailApi.updateEquipmentSpotCheckDetail(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, 'basicEquipmentSpotCheckDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentSpotCheckDetailApi.deleteEquipmentSpotCheckDetail(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 EquipmentSpotCheckDetailApi.exportEquipmentSpotCheckDetail(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 EquipmentSpotCheckDetailApi.importTemplate()
})
</script>

1055
src/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue

File diff suppressed because it is too large

205
src/views/eam/equipmentSpotCheckMain/equipmentSpotCheckMain.data.ts

@ -2,6 +2,8 @@ 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 {BasicFaultType} from "@/views/eam/basicFaultType/basicFaultType.data";
import * as BasicFaultTypeApi from "@/api/eam/basicFaultType";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import * as WorkshopApi from "@/api/wms/workshop";
@ -25,11 +27,19 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
isDetail:false,
},
{
label: '工单编号',
label: '点检工单',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '来源字典',
field: 'sources',
sort: 'custom',
dictType: DICT_TYPE.EAM_SPOTCHECK_SOURCES,
dictClass: 'string',
isSearch: false,
},
{
label: '点检描述',
field: 'describing',
@ -74,7 +84,7 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
},
{
label: '计划工单号',
label: '点检计划工单号',
field: 'planNumber',
sort: 'custom',
isSearch: true,
@ -171,16 +181,32 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '故障类型枚举',
field: 'faultType',
sort: 'custom',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string',
isSearch: true,
isSearch: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择故障类型', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '故障类型信息', // 查询弹窗标题
searchAllSchemas: BasicFaultType.allSchemas, // 查询弹窗所需类
searchPage: BasicFaultTypeApi.getBasicFaultTypePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '验证内容',
@ -215,10 +241,12 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenancer',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '点检人电话',
field: 'maintenancePhone',
sort: 'custom',
isSearch: false,
},
{
label: '完成时间',
@ -318,13 +346,16 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '班组类型',
field: 'classType',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '车间编号',
@ -404,6 +435,160 @@ export const EquipmentSpotCheckMain = useCrudSchemas(reactive<CrudSchema[]>([
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'
}
}
]))
export const RelationSpotCheckPlanItemRules = reactive({
planNumber: [required],
itemCode: [required],
itemName: [required],
concurrencyStamp: [required],
})
export const RelationSpotCheckPlanItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '计划编号',
field: 'planNumber',
sort: 'custom',
isSearch: true,
},
{
label: '项编号',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '项名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
},
{
label: '是否必选',
field: 'isSelectd',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.FALSE_OR_TRUE,
dictClass: 'string',
},
{
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',

144
src/views/eam/equipmentSpotCheckMain/finishForm1.vue

@ -0,0 +1,144 @@
<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="verifyer">
<el-input v-model="formData.verifyer" placeholder="请输入验证人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="验证内容" prop="verifyContent">
<el-input v-model="formData.verifyContent" type="textarea" :input-style="{height:'100px'}" maxlength="300" placeholder="请输入验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="验证时间" prop="verifyTime">
<el-date-picker
v-model="formData.verifyTime"
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 * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain'
import * as EquipmentInspectionMainApi from '@/api/eam/equipmentInspectionMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentSpotCheckMainApi from "@/api/eam/equipmentSpotCheckMain";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
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:'',
verifyer: '',
verifyContent: '',
verifyTime: '',
})
const formRules = reactive({
verifyer: [
{ required: true, message: '验证人不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyContent: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTime: [
{ 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.planNumber
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentSpotCheckMainApi.updateEquipmentSpotCheckMain(formData.value)
//success
emit('success',formData.value.id)
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>

151
src/views/eam/equipmentSpotCheckMain/finishForm2.vue

@ -0,0 +1,151 @@
<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="巡检人ID" prop="maintenancer">
<el-input v-model="formData.maintenancer" placeholder="请输入巡检人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检人电话" prop="maintenancePhone">
<el-input v-model="formData.maintenancePhone" placeholder="请输入巡检人电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="巡检开始时间" prop="startTime">
<el-date-picker
v-model="formData.startTime"
type="datetime"
value-format="x"
placeholder="选择巡检开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检结束时间" prop="endTime">
<el-date-picker
v-model="formData.endTime"
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 * as EquipmentInspectionMainApi from '@/api/eam/equipmentInspectionMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentSpotCheckMainApi from "@/api/eam/equipmentSpotCheckMain";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
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:'',
maintenancer: '',
maintenancePhone: '',
startTime:'',
endTime:'',
})
const formRules = reactive({
maintenancer: [
{ required: true, message: '巡检人ID不能为空', trigger: 'blur' },
],
maintenancePhone: [
{ 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.planNumber
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentSpotCheckMainApi.updateEquipmentSpotCheck(formData.value);
//success
emit('success',formData.value.id)
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>

326
src/views/eam/equipmentSpotCheckMain/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -48,10 +48,30 @@
:apiCreate="EquipmentSpotCheckMainApi.createEquipmentSpotCheckMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<FinishForm1 ref="finishForm1Ref" @success="getData1" @close="getClosed1"/>
<FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentSpotCheckMain.allSchemas" />
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="EquipmentSpotCheckMain.allSchemas"
:detailAllSchemasRules="EquipmentSpotCheckDetailRules"
:detailAllSchemas="EquipmentSpotCheckDetail.allSchemas"
:apiPage="EquipmentSpotCheckDetailApi.getEquipmentSpotCheckDetailPage"
:apiCreate="EquipmentSpotCheckDetailApi.createEquipmentSpotCheckDetail"
:apiUpdate="EquipmentSpotCheckDetailApi.updateEquipmentSpotCheckDetail"
:apiDelete="EquipmentSpotCheckDetailApi.deleteEquipmentSpotCheckDetail"
:detailButtonIsShowAdd=statusBtn
:detailButtonIsShowEdit=statusBtn
:detailButtonIsShowDelete=statusBtn
@handleMainFefresh="handleMainFefresh"
@searchTableSuccessDetail="searchTableSuccessDetail"
@detailBasicFormOnChange="detailBasicFormOnChange"
:key="count"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-spot-check-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -60,11 +80,23 @@
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentSpotCheckMain,EquipmentSpotCheckMainRules } from './equipmentSpotCheckMain.data'
import { EquipmentSpotCheckDetail,EquipmentSpotCheckDetailRules } from '../equipmentSpotCheckDetail/equipmentSpotCheckDetail.data'
import * as EquipmentSpotCheckMainApi from '@/api/eam/equipmentSpotCheckMain'
import * as EquipmentSpotCheckDetailApi from '@/api/eam/equipmentSpotCheckDetail'
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'
import Detail from '@/views/eam/equipmentSpotCheckMain/SpotCheckOrderDetail.vue'
import FinishForm1 from '@/views/eam/equipmentSpotCheckMain/finishForm1.vue'
import FinishForm2 from '@/views/eam/equipmentSpotCheckMain/finishForm2.vue'
import {
EquipmentInspectionDetail,
EquipmentInspectionDetailRules
} from "@/views/eam/equipmentInspectionDetail/equipmentInspectionDetail.data";
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
defineOptions({ name: 'EquipmentSpotCheckMain' })
@ -75,6 +107,7 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentSpotCheckMain.allSchemas.tableColumns)
const statusBtn = ref(false);
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -99,8 +132,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentSpotCheckMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentSpotCheckMain:import'}), //
//defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentSpotCheckMain:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentSpotCheckMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -131,11 +163,43 @@ const buttonBaseClick = (val, item) => {
}
}
const isShowMainButton = (row,val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
const isShowStatusButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
const isShowEditStatusButton = (row) => {
if (row.status == "3" || row.status == "4") {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentSpotCheckMain:delete'}), //
]
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide: isShowEditStatusButton(row),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
defaultButtons.mainListValidateBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentSpotCheckMain:update'}), //
//defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:equipmentSpotCheckMain:update'}),
//defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:equipmentSpotCheckMain:update'}),
]
}
// -
const buttonTableClick = async (val, row) => {
@ -143,12 +207,53 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'receive') { //
handleReceive(row.id)
} else if (val == 'execute') { //
handleExecute(row.id)
} else if (val == 'finish') { //
handleFinish(row)
} else if (val == 'validate') { //
handleValidate(row)
}
}
let count = ref(0)
const handleMainFefresh = async()=>{
count.value++
getList()
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
EquipmentSpotCheckMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'number'){
item.componentProps.disabled = false
}
if(item.field == 'planNumber'){
item.componentProps.disabled = false
}
if(item.field == 'status'){
item.value = '3';
item.componentProps.disabled = true
}
})
}else{
EquipmentSpotCheckMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'number'){
item.componentProps.disabled = true
}
if(item.field == 'planNumber'){
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row)
}
@ -176,9 +281,32 @@ const formsSuccess = async (formType,data) => {
getList()
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
let result = '';
for (var i = 0; i < val.length; i++) {
result += val[i].itemName + ',';
}
if(result.endsWith(',')){
result = result.substring(0,result.length -1)
}
setV[formField] = result;
formRef.setValues(setV)
})
}
/** 详情操作 */
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, 'basicEquipmentSpotCheckMain')
}
@ -195,6 +323,186 @@ const handleDelete = async (id: number) => {
} catch {}
}
/** 领取按钮操作 */
const handleReceive = async (id: number) => {
try {
//
await message.delConfirm('是否接单?');
const params = ref({
id: '',
status:'',
})
params.value.id = id
params.value.status = '4'
//
await EquipmentSpotCheckMainApi.updateEquipmentSpotCheckOrder(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 EquipmentSpotCheckMainApi.updateEquipmentSpotCheckOrder(params.value)
message.success(t('执行成功'))
//
await getList()
} catch {}
}
/** 完成按钮操作 */
const finishForm2Ref = ref()
const handleFinish = async (row) => {
//
await message.delConfirm('是否完成所选中工单?');
//
finishForm2Ref.value.open('update', row);
}
/** 验证按钮操作 */
const finishForm1Ref = ref()
const handleValidate = async (row) => {
await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => {
//
//
finishForm1Ref.value.open('update', row);
}).catch (async (action: Action) => {
if(action === 'cancel'){
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '5'
await EquipmentSpotCheckMainApi.backEquipmentSpotCheckOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}
})
}
const detailBasicFormOnChange = (field, item) => {
//
if(field == 'result' && item == '1'){
EquipmentSpotCheckDetail.allSchemas.formSchema.forEach((items) => {
if (items.field == 'uncompletedCause') {
EquipmentInspectionDetailRules.uncompletedCause[0].required = true
}
})
}
//
if(field == 'result' && item == '0'){
EquipmentSpotCheckDetail.allSchemas.formSchema.forEach((items) => {
if (items.field == 'uncompletedCause') {
EquipmentInspectionDetailRules.uncompletedCause[0].required = false
detailRef.value.formRef.formRef.setValues({
uncompletedCause:''
})
}
})
}
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
EquipmentSpotCheckMain.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
//
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage
}
})
}
//
if(field == 'type' && item == 'EQUIPMENT'){
EquipmentSpotCheckMain.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
console.log(basicFormRef.value.formRef)
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
}
//finishForm1
const getClosed1=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm1
const getData1=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentSpotCheckMainApi.updateEquipmentSpotCheckOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
}
//finishForm2
const getClosed2=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm2
const getData2=(val)=> {
nextTick?.(async () => {
console.log(val)
const params = ref({
id: '',
status: '',
})
params.value.id = val
params.value.status = '5'
//
await EquipmentSpotCheckMainApi.executeEquipmentSpotCheckOrder(params.value)
//message.success(t(''))
//
await getList()
})
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

Loading…
Cancel
Save