Browse Source

EAM ——> 点检计划 巡检计划 状态流转

master_hella_20240701
gaojs 6 months ago
parent
commit
6ef0ac6a58
  1. 91
      src/api/eam/planInspection/index.ts
  2. 91
      src/api/eam/planSpotCheck/index.ts
  3. 2
      src/utils/dict.ts
  4. 1
      src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts
  5. 6
      src/views/eam/maintenance/audiForm.vue
  6. 143
      src/views/eam/planInspection/audiForm.vue
  7. 419
      src/views/eam/planInspection/index.vue
  8. 395
      src/views/eam/planInspection/planInspection.data.ts
  9. 143
      src/views/eam/planSpotCheck/audiForm.vue
  10. 422
      src/views/eam/planSpotCheck/index.vue
  11. 394
      src/views/eam/planSpotCheck/planSpotCheck.data.ts

91
src/api/eam/planInspection/index.ts

@ -0,0 +1,91 @@
import request from '@/config/axios'
import {MaintenanceVO} from "@/api/eam/maintenance";
export interface PlanInspectionVO {
id: number
number: string
name: string
equipmentCode: string
type: string
optionCode: string
cycle: string
startTime: Date
endTime: Date
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: 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 getPlanInspectionPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/plan-inspection/senior', data })
} else {
return await request.get({ url: `/eam/plan-inspection/page`, params })
}
}
// 查询巡检计划详情
export const getPlanInspection = async (id: number) => {
return await request.get({ url: `/eam/plan-inspection/get?id=` + id })
}
// 新增巡检计划
export const createPlanInspection = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/create`, data })
}
// 修改巡检计划
export const updatePlanInspection = async (data: PlanInspectionVO) => {
return await request.put({ url: `/eam/plan-inspection/update`, data })
}
// 修改巡检计划-审核
export const updateInspectionPlanAudi = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/updateAudi`, data })
}
// 删除巡检计划
export const deletePlanInspection = async (id: number) => {
return await request.delete({ url: `/eam/plan-inspection/delete?id=` + id })
}
// 导出巡检计划 Excel
export const exportPlanInspection = async (params) => {
return await request.download({ url: `/eam/plan-inspection/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/plan-inspection/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/ables` , data })
}
// 修改计划状态
export const updateInspectionPlan = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/updatePlan`, data })
}

91
src/api/eam/planSpotCheck/index.ts

@ -0,0 +1,91 @@
import request from '@/config/axios'
import {PlanInspectionVO} from "@/api/eam/planInspection";
export interface PlanSpotCheckVO {
id: number
number: string
name: string
equipmentCode: string
type: string
optionCode: string
cycle: string
startTime: Date
endTime: Date
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: 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 getPlanSpotCheckPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/plan-spot-check/senior', data })
} else {
return await request.get({ url: `/eam/plan-spot-check/page`, params })
}
}
// 查询点检计划详情
export const getPlanSpotCheck = async (id: number) => {
return await request.get({ url: `/eam/plan-spot-check/get?id=` + id })
}
// 新增点检计划
export const createPlanSpotCheck = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/create`, data })
}
// 修改点检计划
export const updatePlanSpotCheck = async (data: PlanSpotCheckVO) => {
return await request.put({ url: `/eam/plan-spot-check/update`, data })
}
// 修改巡检计划-审核
export const updateSpotCheckPlanAudi = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/updateAudi`, data })
}
// 删除点检计划
export const deletePlanSpotCheck = async (id: number) => {
return await request.delete({ url: `/eam/plan-spot-check/delete?id=` + id })
}
// 导出点检计划 Excel
export const exportPlanSpotCheck = async (params) => {
return await request.download({ url: `/eam/plan-spot-check/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/plan-spot-check/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/ables` , data })
}
// 修改计划状态
export const updateSpotCheckPlan = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/updatePlan`, data })
}

2
src/utils/dict.ts

@ -354,6 +354,8 @@ export enum DICT_TYPE {
REPAIR_LEVEL = 'repair_level', //维修级别 REPAIR_LEVEL = 'repair_level', //维修级别
IS_COMPLETED = 'is_completed', //是否完成 IS_COMPLETED = 'is_completed', //是否完成
MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期 MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期
INSPECTION_CYCLE ='inspection_cycle', // 巡检周期
SPOTCHECK_CYCLE ='spotcheck_cycle', // 巡检周期
EAM_ORDER_STATUS = 'eam_order_status',// 工单状态 EAM_ORDER_STATUS = 'eam_order_status',// 工单状态
TOOL_CLASS = 'tool_class', //工装类型 TOOL_CLASS = 'tool_class', //工装类型
TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型 TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型

1
src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts

@ -2,7 +2,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as ItemApi from "@/api/eam/spotCheckSelectSet"; import * as ItemApi from "@/api/eam/spotCheckSelectSet";
import {BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheckSelectSet.data"; import {BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheckSelectSet.data";
import {getBasicSpotCheckSelectSetPage} from "@/api/eam/spotCheckSelectSet";
// 表单校验 // 表单校验
export const BasicSpotCheckOptionRules = reactive({ export const BasicSpotCheckOptionRules = reactive({

6
src/views/eam/maintenance/audiForm.vue

@ -95,8 +95,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */ /** 提交表单 */
const submitForm = async (val) => { const submitForm = async (val) => {
//success
emit('success',formData.value.id)
// //
if (!basicFormRef) return if (!basicFormRef) return
const valid = await basicFormRef.value.validate() const valid = await basicFormRef.value.validate()
@ -104,6 +103,9 @@ const submitForm = async (val) => {
// //
await MaintenanceApi.updateMaintenanceAudi(formData.value) await MaintenanceApi.updateMaintenanceAudi(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false dialogVisible.value = false
} }

143
src/views/eam/planInspection/audiForm.vue

@ -0,0 +1,143 @@
<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 * as PlanInspectionApi from '@/api/eam/planInspection'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
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:'',
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) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await PlanInspectionApi.updateInspectionPlanAudi(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>

419
src/views/eam/planInspection/index.vue

@ -0,0 +1,419 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PlanInspection.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PlanInspection.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="PlanInspectionRules"
:formAllSchemas="PlanInspection.allSchemas"
:apiUpdate="PlanInspectionApi.updatePlanInspection"
:apiCreate="PlanInspectionApi.createPlanInspection"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PlanInspection.allSchemas" />
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/plan-inspection/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PlanInspection,PlanInspectionRules } from './planInspection.data'
import * as PlanInspectionApi from '@/api/eam/planInspection'
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 {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";
import AudiForm from '@/views/eam/planInspection/audiForm.vue'
defineOptions({ name: 'PlanInspection' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PlanInspection.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: PlanInspectionApi.getPlanInspectionPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:planInspection:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:planInspection:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:planInspection: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 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 butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:planInspection:update'}), //
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row,['0']),hasPermi:'eam:planInspection:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:planInspection:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:planInspection:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:planInspection:update'}),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
} else if (val == 'auditing') { //
handleAuditing(row.id)
} else if (val == 'finish') { //
handleFinish(row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
PlanInspection.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}else{
PlanInspection.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PlanInspection.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 PlanInspectionApi.createPlanInspection(data)
message.success(t('common.createSuccess'))
} else {
await PlanInspectionApi.updatePlanInspection(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, 'basicPlanInspection')
}
//
const handleFinish = async (row) => {
message.confirmAudi(t('')).then(async () => {
//
audiFormRef.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 PlanInspectionApi.updateInspectionPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
}
})
}
//
const audiFormRef = ref()
const handleAuditing = async (id: number) => {
await message.delConfirm('是否审核所选中工单?');
const params = ref({
id: '',
status:'',
})
params.value.id = id
params.value.status = '3'
await PlanInspectionApi.updateInspectionPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await PlanInspectionApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 禁用 */
const handleDisable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'FALSE'
await PlanInspectionApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PlanInspectionApi.deletePlanInspection(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
PlanInspection.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'){
PlanInspection.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PlanInspectionApi.exportPlanInspection(tableObject.params)
download.excel(data, '巡检计划.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//audiForm
const getClosed=(val)=> {
nextTick?.(() => {
getList()
})
}
//audiForm
const getData=(val)=> {
nextTick?.(async () => {
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '4'
await PlanInspectionApi.updateInspectionPlan(params.value)
message.success(t('计划已流转'))
//
await getList()
} catch {}
}
)
}
/** 导入 */
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()
})
</script>

395
src/views/eam/planInspection/planInspection.data.ts

@ -0,0 +1,395 @@
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 * as BasicInspectionApi from "@/api/eam/basicInspectionOption";
import {BasicInspectionOption} from "@/views/eam/basicInspectionOption/basicInspectionOption.data";
import {getBasicInspectionOptionPage} from "@/api/eam/basicInspectionOption";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import * as WorkshopApi from "@/api/wms/workshop";
// 表单校验
export const PlanInspectionRules = reactive({
number: [required],
name: [required],
equipmentCode: [required],
optionCode: [required],
cycle: [required],
startTime: [required],
endTime: [required],
})
export const PlanInspection = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '计划编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
isDetail:true,
},
{
label: '计划名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '设备类别',
field: 'type',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
},
{
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: 'optionCode',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '巡检方案信息', // 查询弹窗标题
searchListPlaceholder: '请选择巡检方案', // 输入框占位文本
searchAllSchemas: BasicInspectionOption.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: BasicInspectionApi.getBasicInspectionOptionPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '计划类型',
field: 'cycle',
dictType: DICT_TYPE.INSPECTION_CYCLE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
},
{
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: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.EAM_PLAN_STATUS,
dictClass: 'string',
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
},
{
label: '审核时间',
field: 'approveTime',
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: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: false,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '车间', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工序编号',
field: 'processCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工位编号',
field: 'workstationCode',
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: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: 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'
}
}
]))

143
src/views/eam/planSpotCheck/audiForm.vue

@ -0,0 +1,143 @@
<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 * as SpotCheckApi from '@/api/eam/planSpotCheck'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
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:'',
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) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await SpotCheckApi.updateSpotCheckPlanAudi(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>

422
src/views/eam/planSpotCheck/index.vue

@ -0,0 +1,422 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PlanSpotCheck.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PlanSpotCheck.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="PlanSpotCheckRules"
:formAllSchemas="PlanSpotCheck.allSchemas"
:apiUpdate="PlanSpotCheckApi.updatePlanSpotCheck"
:apiCreate="PlanSpotCheckApi.createPlanSpotCheck"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PlanSpotCheck.allSchemas" />
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/plan-spot-check/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PlanSpotCheck,PlanSpotCheckRules } from './planSpotCheck.data'
import * as PlanSpotCheckApi from '@/api/eam/planSpotCheck'
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 {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";
import AudiForm from '@/views/eam/planSpotCheck/audiForm.vue'
import {updateSpotCheckPlan} from "@/api/eam/planSpotCheck";
defineOptions({ name: 'PlanSpotCheck' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PlanSpotCheck.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: PlanSpotCheckApi.getPlanSpotCheckPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:planSpotCheck:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:planSpotCheck:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:planSpotCheck: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 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 butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:planSpotCheck:update'}), //
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row,['0']),hasPermi:'eam:planSpotCheck:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:planSpotCheck:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:planSpotCheck:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:planSpotCheck:update'}),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
} else if (val == 'auditing') { //
handleAuditing(row.id)
} else if (val == 'finish') { //
handleFinish(row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
PlanSpotCheck.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}else{
PlanSpotCheck.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PlanSpotCheck.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 PlanSpotCheckApi.createPlanSpotCheck(data)
message.success(t('common.createSuccess'))
} else {
await PlanSpotCheckApi.updatePlanSpotCheck(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, 'basicPlanSpotCheck')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PlanSpotCheckApi.deletePlanSpotCheck(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
//
const handleFinish = async (row) => {
message.confirmAudi(t('')).then(async () => {
//
audiFormRef.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 PlanSpotCheckApi.updateSpotCheckPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
}
})
}
//
const audiFormRef = ref()
const handleAuditing = async (id: number) => {
await message.delConfirm('是否审核所选中工单?');
try {
const params = ref({
id: '',
status:'',
})
params.value.id = id
params.value.status = '3'
await PlanSpotCheckApi.updateSpotCheckPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await PlanSpotCheckApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 禁用 */
const handleDisable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'FALSE'
await PlanSpotCheckApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
PlanSpotCheck.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'){
PlanSpotCheck.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
}
//audiForm
const getClosed=(val)=> {
nextTick?.(() => {
getList()
})
}
//audiForm
const getData=(val)=> {
nextTick?.(async () => {
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '4'
await PlanSpotCheckApi.updateSpotCheckPlan(params.value)
message.success(t('计划已流转'))
//
await getList()
} catch {}
}
)
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PlanSpotCheckApi.exportPlanSpotCheck(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()
})
</script>

394
src/views/eam/planSpotCheck/planSpotCheck.data.ts

@ -0,0 +1,394 @@
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 * as SpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import {BasicSpotCheckOption} from "@/views/eam/basicSpotCheckOption/basicSpotCheckOption.data";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import * as WorkshopApi from "@/api/wms/workshop";
// 表单校验
export const PlanSpotCheckRules = reactive({
number: [required],
name: [required],
equipmentCode: [required],
optionCode: [required],
cycle: [required],
startTime: [required],
endTime: [required],
})
export const PlanSpotCheck = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '计划编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
isDetail:true,
},
{
label: '计划名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '设备类别',
field: 'type',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
},
{
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: 'optionCode',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '点检方案信息', // 查询弹窗标题
searchListPlaceholder: '请选择点检方案', // 输入框占位文本
searchAllSchemas: BasicSpotCheckOption.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: SpotCheckOptionApi.getBasicSpotCheckOptionPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '计划类型',
field: 'cycle',
dictType: DICT_TYPE.SPOTCHECK_CYCLE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
},
{
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: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.EAM_PLAN_STATUS,
dictClass: 'string',
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
},
{
label: '审核时间',
field: 'approveTime',
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: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: false,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '车间', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工序编号',
field: 'processCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工位编号',
field: 'workstationCode',
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: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: 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'
}
}
]))
Loading…
Cancel
Save