Browse Source

修复bug并新需求开发

master
ljlong_2630 4 months ago
parent
commit
5fbf02c8e1
  1. 10
      src/api/eam/basic/inspection/index.ts
  2. 60
      src/api/eam/basic/repairRelation/index.ts
  3. 4
      src/api/eam/device/deviceAccounts/index.ts
  4. 5
      src/api/eam/device/deviceMaintenanceMain/index.ts
  5. 54
      src/api/eam/device/problemSharingPlatform/index.ts
  6. 4
      src/api/eam/mold/moldAccounts/index.ts
  7. 1
      src/components/Form/src/Form.vue
  8. 2
      src/components/TableForm/src/TableForm.vue
  9. 4
      src/utils/dict.ts
  10. 25
      src/views/eam/basic/inspection/inspection.data.ts
  11. 25
      src/views/eam/basic/moldInspection/moldInspection.data.ts
  12. 12
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  13. 17
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  14. 1
      src/views/eam/device/deviceSpotInspectionRecordMain/index.vue
  15. 175
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  16. 58
      src/views/eam/device/deviceinspectionjob/index.vue
  17. 40
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  18. 89
      src/views/eam/device/devicemaintenancejob/index.vue
  19. 244
      src/views/eam/device/problemSharingPlatform/index.vue
  20. 104
      src/views/eam/device/problemSharingPlatform/problemSharingPlatform.data.ts
  21. 13
      src/views/eam/mold/moldRepair/moldRepair.data.ts
  22. 1
      src/views/eam/mold/moldSpotInspectionRecordMain/index.vue
  23. 9
      src/views/eam/mold/moldSpotInspectionRecordMain/moldSpotInspectionRecordMain.data.ts
  24. 60
      src/views/eam/mold/moldinspectionjob/index.vue
  25. 176
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  26. 94
      src/views/eam/mold/moldmaintenancejob/index.vue

10
src/api/eam/basic/inspection/index.ts

@ -69,7 +69,6 @@ export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
// 修改模具项记录表(设备 模具 保养 维修 巡检点检) // 修改模具项记录表(设备 模具 保养 维修 巡检点检)
export const updateMoldItems = async (data: DeviceMoldItemsVO) => { export const updateMoldItems = async (data: DeviceMoldItemsVO) => {
debugger
data.type="MOLD" data.type="MOLD"
data.status="INSPECTION" data.status="INSPECTION"
return await request.put({ url: `/eam/device-mold-items/update`, data }) return await request.put({ url: `/eam/device-mold-items/update`, data })
@ -85,4 +84,13 @@ export const exportDeviceMoldItems = async (params) => {
return await request.download({ url: `/eam/device-mold-items/export-excel`, params }) return await request.download({ url: `/eam/device-mold-items/export-excel`, params })
} }
// 查询模具项记录表(设备 模具 保养 维修 巡检点检)列表
export const getListByNumber = async (number: string) => {
return await request.get({ url: `/eam/device-mold-items/getListByNumber?number=` + number })
}
// 查询模具项记录表(设备 模具 保养 维修 巡检点检)列表
export const getAllByNumber = async (number: string) => {
return await request.get({ url: `/eam/device-mold-items/getAllByNumber?number=` + number })
}

60
src/api/eam/basic/repairRelation/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface RepairRelationVO {
id: number
repairNumber: number
spotInspectionId: number
siteId: string
available: string
concurrencyStamp: number
}
// 查询点检项和报修工单关系列表
export const getRepairRelationPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/repair-relation/senior', data })
} else {
return await request.get({ url: `/inspection/repair-relation/page`, params })
}
}
// 查询点检项和报修工单关系详情
export const getRepairRelation = async (id: number) => {
return await request.get({ url: `/inspection/repair-relation/get?id=` + id })
}
// 新增点检项和报修工单关系
export const createRepairRelation = async (data: RepairRelationVO) => {
return await request.post({ url: `/inspection/repair-relation/create`, data })
}
// 修改点检项和报修工单关系
export const updateRepairRelation = async (data: RepairRelationVO) => {
return await request.put({ url: `/inspection/repair-relation/update`, data })
}
// 删除点检项和报修工单关系
export const deleteRepairRelation = async (id: number) => {
return await request.delete({ url: `/inspection/repair-relation/delete?id=` + id })
}
// 删除点检项和报修工单关系
export const deleteBatchByIds = async (ids: number[]) => {
return await request.delete({ url: `/inspection/repair-relation/deleteBatchByIds?ids=` + ids })
}
// 导出点检项和报修工单关系 Excel
export const exportRepairRelation = async (params) => {
return await request.download({ url: `/inspection/repair-relation/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/inspection/repair-relation/get-import-template' })
}
// 查询点检项和报修工单关系详情
export const getRepairRelationNoPage = async (params) => {
return await request.get({ url: `/inspection/repair-relation/noPage`,params })
}

4
src/api/eam/device/deviceAccounts/index.ts

@ -61,8 +61,8 @@ export const importTemplate = () => {
// 查询设备台账列表 // 查询设备台账列表
export const getDeviceAccountsNoPage = async (params) => { export const getDeviceAccountsNoPage = async (data: DeviceAccountsVO) => {
return await request.get({ url: `/eam/device-accounts/selectData`, params }) return await request.post({ url: `/eam/device-accounts/dataScopeNoPage`, data })
} }

5
src/api/eam/device/deviceMaintenanceMain/index.ts

@ -27,6 +27,11 @@ export const getDeviceMaintenanceMainPage = async (params) => {
} }
} }
// 查询设备维修工单主列表
export const getDeviceMaintenanceMainPageNew = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/page`, params })
}
// 查询维修工单主详情 // 查询维修工单主详情
export const getDeviceMaintenanceMain = async (id: number) => { export const getDeviceMaintenanceMain = async (id: number) => {
return await request.get({ url: `/eam/device-maintenance-job-main/get?id=` + id }) return await request.get({ url: `/eam/device-maintenance-job-main/get?id=` + id })

54
src/api/eam/device/problemSharingPlatform/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface ProblemSharingPlatformVO {
id: number
number: string
questionName: string
questionDescription: string
questionType: string
siteId: string
available: string
concurrencyStamp: number
deptId: number
}
// 查询问题分享平台列表
export const getProblemSharingPlatformPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/question/sharing-platform/senior', data })
} else {
return await request.get({ url: `/question/sharing-platform/page`, params })
}
}
// 查询问题分享平台详情
export const getProblemSharingPlatform = async (id: number) => {
return await request.get({ url: `/question/sharing-platform/get?id=` + id })
}
// 新增问题分享平台
export const createProblemSharingPlatform = async (data: ProblemSharingPlatformVO) => {
return await request.post({ url: `/question/sharing-platform/create`, data })
}
// 修改问题分享平台
export const updateProblemSharingPlatform = async (data: ProblemSharingPlatformVO) => {
return await request.put({ url: `/question/sharing-platform/update`, data })
}
// 删除问题分享平台
export const deleteProblemSharingPlatform = async (id: number) => {
return await request.delete({ url: `/question/sharing-platform/delete?id=` + id })
}
// 导出问题分享平台 Excel
export const exportProblemSharingPlatform = async (params) => {
return await request.download({ url: `/question/sharing-platform/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/question/sharing-platform/get-import-template' })
}

4
src/api/eam/mold/moldAccounts/index.ts

@ -61,8 +61,8 @@ export const importTemplate = () => {
// 查询模具台账列表 // 查询模具台账列表
export const getMoldAccountsNoPage = async (params) => { export const getMoldAccountsNoPage = async (data: MoldAccountsVO) => {
return await request.get({ url: `/eam/mold-accounts/selectData`, params }) return await request.post({ url: `/eam/mold-accounts/dataScopeNoPage`, data })
} }

1
src/components/Form/src/Form.vue

@ -232,7 +232,6 @@ export default defineComponent({
const formItemSlotsSearchList: Recordable = setFormItemSlots(slots, item.field) const formItemSlotsSearchList: Recordable = setFormItemSlots(slots, item.field)
if (item?.componentProps?.isSearchList) { if (item?.componentProps?.isSearchList) {
if(item?.componentProps?.multiple){ if(item?.componentProps?.multiple){
formItemSlotsSearchList[item.field] = () => { formItemSlotsSearchList[item.field] = () => {
return ( return (
<> <>

2
src/components/TableForm/src/TableForm.vue

@ -19,7 +19,7 @@
v-if="isShowReduceButton" v-if="isShowReduceButton"
v-slot="{ row, $index }" v-slot="{ row, $index }"
> >
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;margin-top: -16px;" @click="handleDeleteTable (row, $index)" /> <Icon v-if="!row.hiddenTheReduceButton" icon="ep:remove" color="#757575" size="26" style="cursor: pointer;margin-top: -16px;" @click="handleDeleteTable (row, $index)" />
</el-table-column> </el-table-column>
<!-- 多选 --> <!-- 多选 -->
<el-table-column <el-table-column

4
src/utils/dict.ts

@ -307,6 +307,6 @@ export enum DICT_TYPE {
FACTORY_TYPE = 'factory_type',//厂区类别 FACTORY_TYPE = 'factory_type',//厂区类别
EQUIPMENT_INDEX_NAME = 'equipment_index_name',//设备年度目标指标名称分类字段 EQUIPMENT_INDEX_NAME = 'equipment_index_name',//设备年度目标指标名称分类字段
SPECIAL_DEPT_ROLE = 'special_dept_role', SPECIAL_DEPT_ROLE = 'special_dept_role',
MOLD_ACCOUNT_CATEGORY = 'mold_account_category'//模具台账类型 MOLD_ACCOUNT_CATEGORY = 'mold_account_category',//模具台账类型
ORDER_SOURCE_TYPE = 'order_source_type', //工单来源类型
} }

25
src/views/eam/basic/inspection/inspection.data.ts

@ -11,6 +11,17 @@ export const DeviceMoldItemsRules = reactive({
concurrencyStamp: [required], concurrencyStamp: [required],
}) })
const trueOrFalse = [
{
label: '是',
value: true
},
{
label: '否',
value: false
}
]
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '编号', label: '编号',
@ -119,6 +130,20 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
}, },
{
label: '记录是否必填',
field: 'numberNeedSwitch',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
// { // {
// label: '是否可用', // label: '是否可用',
// field: 'available', // field: 'available',

25
src/views/eam/basic/moldInspection/moldInspection.data.ts

@ -11,6 +11,17 @@ export const DeviceMoldItemsRules = reactive({
concurrencyStamp: [required], concurrencyStamp: [required],
}) })
const trueOrFalse = [
{
label: '是',
value: true
},
{
label: '否',
value: false
}
]
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '编号', label: '编号',
@ -119,6 +130,20 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
}, },
{
label: '记录是否必填',
field: 'numberNeedSwitch',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
// { // {
// label: '是否可用', // label: '是否可用',
// field: 'available', // field: 'available',

12
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -151,6 +151,18 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
}, },
} }
}, },
{
label: '工单来源',
field: 'orderSourceType',
sort: 'custom',
isSearch: false,
isForm: false,
dictType: DICT_TYPE.ORDER_SOURCE_TYPE,
dictClass: 'string',
table: {
width: '150',
},
},
{ {
label: '报修人电话', label: '报修人电话',
field: 'declarerPhone', field: 'declarerPhone',

17
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -187,13 +187,6 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
}, },
}, },
{ {
label: '审批意见',
field: 'approveOpinion',
sort: 'custom',
table: {
width: '300',
},
},{
label: '点检时间', label: '点检时间',
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
@ -266,6 +259,16 @@ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSche
}, },
isSearch: true isSearch: true
}, },
{
label: '巡检点检记录',
field: 'records',
sort: 'custom',
table: {
width: '300',
},
isSearch: false
},
{ {
label: '设备部位名称', label: '设备部位名称',
field: 'equipmentPosition', field: 'equipmentPosition',

1
src/views/eam/device/deviceSpotInspectionRecordMain/index.vue

@ -138,6 +138,7 @@ import { DeviceSpotInspectionRecordMainVO } from '@/api/eam/device/deviceSpotIns
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as DeviceMoldItemsApi from '@/api/eam/basic/inspection'
defineOptions({ name: 'DeviceSpotInspectionRecordMain' }) defineOptions({ name: 'DeviceSpotInspectionRecordMain' })
const message = useMessage() // const message = useMessage() //

175
src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts

@ -9,6 +9,9 @@ import * as ItemApi from '@/api/eam/basic/item'
import { validateHanset, validateNum, validateNum100 } from '@/utils/validator' import { validateHanset, validateNum, validateNum100 } from '@/utils/validator'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import {
DeviceMaintenanceMain,
} from '../devicemaintenancejob/deviceMaintenanceMain.data'
const userStore = useUserStore() const userStore = useUserStore()
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
@ -60,7 +63,6 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
isSearch: false, isSearch: false,
api: () => repairList,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => { // formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return repairList.find((account) => account.number == cellValue)?.name // return repairList.find((account) => account.number == cellValue)?.name
// }, // },
@ -69,22 +71,43 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
api: () => repairList, api: () => repairList,
componentProps: { componentProps: {
optionsAlias: { optionsAlias: {
labelField: 'number', labelField: 'describes',
valueField: 'number' valueField: 'number'
}, },
filterable: true, filterable: true,
} }
}, },
// form: {
// component: 'Select',
// api: () => repairList,
// componentProps: {
// optionsAlias: {
// labelField: 'describes',
// valueField: 'number'
// },
// filterable: true,
// },
// }
form: { form: {
component: 'Select',
api: () => repairList,
componentProps: { componentProps: {
optionsAlias: { isSearchList: true, // 开启查询弹窗
labelField: 'number', searchListPlaceholder: '请选择备件', // 输入框占位文本
valueField: 'number' searchField: 'number', // 查询弹窗赋值字段
}, searchTitle: '备件', // 查询弹窗标题
filterable: true, searchAllSchemas: DeviceMaintenanceMain.allSchemas, // 查询弹窗所需类
}, searchPage: DeviceMaintenanceMainApi.getDeviceMaintenanceMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'type',
value: 'DEVICE',
message: '请选择设备模具编号!',
isMainValue: false
},{
key: 'result',
value: 'TEMPORARILY',
message: '请选择设备模具编号!',
isMainValue: false
}]
}
} }
}, },
{ {
@ -285,6 +308,24 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
filterable: true, filterable: true,
}, },
}, },
{
label: '工单来源类型',
field: 'sourceType',
sort: 'custom',
table: {
width: '150',
},
dictType: DICT_TYPE.ORDER_SOURCE_TYPE,
dictClass: 'string',
form: {
value: '0',
component: 'Select',
componentProps: {
disabled: true,
placeholder: "请选择工单来源类型"
},
},
},
// { // {
// label: '创建时间', // label: '创建时间',
// field: 'createTime', // field: 'createTime',
@ -654,3 +695,117 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false, isTableForm: false,
} }
])) ]))
// 表单校验
export const DeviceInspectionAddDetailRules = reactive({
chargePeoples: [
required,
],
peoples: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' },
{ validator: validateNum100, message: '预估人数不得超出100', trigger: 'blur' },
],
estimatedMinutes: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' },
],
number: [required],
status: [required],
actualMinutes: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' },
],
maintenance: [required],
uncompleted: [
{ required: true, message: '该项为必填项', trigger: 'blur' }
],
})
export const DeviceInspectionAddDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '检修内容',
field: 'name',
sort: 'custom',
isSearch: true,
form: {
component: 'Input',
componentProps: {
type:'textarea'
}
},
},
{
label: '责任人',
field: 'chargePeoples',
sort: 'custom',
table: {
width: '150',
},
tableForm: {
type: 'Select',
initOptions: dutyUserList,
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
},
formatter: (_: Recordable, __: TableColumn, cellValue) => {
const cellValueList = cellValue?.split(',');
return userListAll
.filter(item => cellValueList.includes(item.id.toString()))
.map(item => item.nickname)
.join(',');
},
form: {
component: 'Select',
api: () => dutyUserList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择责任人",
multiple: true,
},
}
},
{
label: '预计分钟',
field: 'estimatedMinutes',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
form: {
component: 'Input',
},
},
{
label: '预估人数',
field: 'peoples',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
form: {
component: 'InputNumber',
},
isTable: true,
tableForm: {
type: 'InputNumber',
},
},
]))

58
src/views/eam/device/deviceinspectionjob/index.vue

@ -44,13 +44,12 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="true" :isBusiness="true"
@onChange="onChange" @onChange="onChange"
:tableAllSchemas="DeviceInspectionDetail.allSchemas" :tableAllSchemas="DeviceInspectionAddDetail.allSchemas"
:tableFormRules="DeviceInspectionDetailRules" :tableFormRules="DeviceInspectionAddDetailRules"
:tableData="tableData" :tableData="tableData"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@submitForm="submitForm" @submitForm="submitForm"
:isSearchTableItem="true"
@formSelectChange="formSelectChange" @formSelectChange="formSelectChange"
/> />
@ -113,7 +112,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { DeviceInspectionDetail, DeviceInspectionDetailRules, DeviceInspectionMain, DeviceInspectionMainRules } from './deviceInspectionMain.data' import { DeviceInspectionDetail, DeviceInspectionDetailRules, DeviceInspectionMain, DeviceInspectionMainRules, DeviceInspectionAddDetailRules, DeviceInspectionAddDetail } from './deviceInspectionMain.data'
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain'
import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail' import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -123,6 +122,7 @@ import * as UserApi from '@/api/system/user'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import * as RepairRelationApi from '@/api/eam/basic/repairRelation'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -162,10 +162,33 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
row['itemNumbers'] = val row['itemNumbers'] = val
} }
} else { } else {
// const setV = {} const setV = {}
// setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
// setV['supplierCode'] = val[0]['code'] formRef.setValues(setV)
// formRef.setValues(setV) if(formField == 'maintenanceNumber'){
const maintenanceRecord = val[0];
basicFormRef.value.formRef.formModel.deviceNumber = maintenanceRecord.deviceNumber
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(maintenanceRecord.factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
if(maintenanceRecord.sourceType == '1'){
basicFormRef.value.formRef.formModel.sourceType = '1'
RepairRelationApi.getRepairRelationNoPage({repairNumber:maintenanceRecord.number}).then(res => {
if (res != null) {
res.forEach(item=>{
tableFormKeys['name'] = item.spotInspectionName
tableFormKeys['hiddenTheReduceButton'] = true
tableFormKeys['disabled_name'] = true
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
tableFormKeys['name'] = undefined
tableFormKeys['hiddenTheReduceButton'] = undefined
tableFormKeys['disabled_name'] = undefined
})
}
})
}else{
basicFormRef.value.formRef.formModel.sourceType = '0'
}
}
} }
}) })
} }
@ -448,6 +471,25 @@ const onChange = (field, cur, item) => {
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
// basicFormRef.value.formRef.formModel.maintenancePhone = String(userStore?.getUser?.mobile) // basicFormRef.value.formRef.formModel.maintenancePhone = String(userStore?.getUser?.mobile)
const itemObj = item.componentProps.options.find(element => element.number == cur)
if(itemObj.sourceType == '1'){
basicFormRef.value.formRef.formModel.sourceType = '1'
RepairRelationApi.getRepairRelationNoPage({repairNumber:cur}).then(res => {
if (res != null) {
res.forEach(item=>{
tableFormKeys['name'] = item.spotInspectionName
tableFormKeys['hiddenTheReduceButton'] = true
tableFormKeys['disabled_name'] = true
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
tableFormKeys['name'] = undefined
tableFormKeys['hiddenTheReduceButton'] = undefined
tableFormKeys['disabled_name'] = undefined
})
}
})
}else{
basicFormRef.value.formRef.formModel.sourceType = '0'
}
} }
} }

40
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -28,7 +28,7 @@ export const DeviceMaintenanceMainRules = reactive({
faultType: [required], faultType: [required],
describes: [ describes: [
required, required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, // { max: 200, message: '不得超过200个字符', trigger: 'blur' },
], ],
}) })
@ -101,6 +101,18 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
isTable: false, isTable: false,
isTableForm: false, isTableForm: false,
}, },
{
label: '工单来源',
field: 'sourceType',
sort: 'custom',
dictType: DICT_TYPE.ORDER_SOURCE_TYPE,
dictClass: 'string',
isSearch: false,
isForm: false,
table: {
width: '150',
},
},
{ {
label: '厂区', label: '厂区',
field: 'factoryAreaNumber', field: 'factoryAreaNumber',
@ -614,19 +626,19 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenances', field: 'maintenances',
sort: 'custom', sort: 'custom',
isDetail: false, isDetail: false,
// formatter: (_: Recordable, __: TableColumn, cellValue) => { formatter: (_: Recordable, __: TableColumn, cellValue) => {
// let cellValueList = [] let cellValueList = []
// if (Array.isArray(cellValue)) { if (Array.isArray(cellValue)) {
// cellValueList = cellValue cellValueList = cellValue
// } else { } else {
// cellValueList = cellValue ? cellValue.split(',') : []; cellValueList = cellValue ? cellValue.split(',') : [];
// } }
// // const cellValueList = cellValue ? cellValue.split(',') : []; // const cellValueList = cellValue ? cellValue.split(',') : [];
// return userListAll return userListAll
// .filter(item => cellValueList.includes(item.id.toString())) .filter(item => cellValueList.includes(item.id.toString()))
// .map(item => item.nickname) .map(item => item.nickname)
// .join(','); .join(',');
// }, },
isTable: true, isTable: true,
tableForm: { tableForm: {
type: 'Select', type: 'Select',

89
src/views/eam/device/devicemaintenancejob/index.vue

@ -136,8 +136,22 @@
:vLoading="tempDialogLoading" :vLoading="tempDialogLoading"
> >
<div style="text-align: center;"> <div class="form-item">
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox> <label class="form-label">完成方式</label>
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary" @change="tempChange">临时措施</el-checkbox>
</div>
<div v-if="isTemporaryShow" class="form-item">
<label class="form-label">点检问题完成项</label>
<el-checkbox-group v-model="selectedOptions" class="checkbox-group">
<el-checkbox
v-for="option in options"
:key="option.value"
:label="option.value"
class="checkbox-item"
>
<span class="checkbox-label">{{ option.label }}</span>
</el-checkbox>
</el-checkbox-group>
</div> </div>
<template #footer> <template #footer>
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">取消</el-button>
@ -237,6 +251,8 @@ import { emit } from 'process'
import { verify } from 'crypto' import { verify } from 'crypto'
import { watch } from 'vue'; import { watch } from 'vue';
import dayjs from 'dayjs' import dayjs from 'dayjs'
import * as RepairRelationApi from '@/api/eam/basic/repairRelation'
import * as InspectionApi from '@/api/eam/basic/inspection'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
defineOptions({ name: 'DeviceMaintenanceMain' }) defineOptions({ name: 'DeviceMaintenanceMain' })
@ -281,6 +297,9 @@ const openRowValue = ref()
const formLoading = ref(false) const formLoading = ref(false)
const tempDialogLoading = ref(false) const tempDialogLoading = ref(false)
const confirmDialogLoading = ref(false) const confirmDialogLoading = ref(false)
const selectedOptions = ref([])
const options = ref([])
const isTemporaryShow = ref(false)
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -883,10 +902,16 @@ function confirmFinish(row) {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
result:isTemporary.value && isTemporary.value != ''?'TEMPORARILY':'COMPLETED', result:isTemporary.value?'TEMPORARILY':'COMPLETED',
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
} }
DeviceMaintenanceMainApi.finishOrder(param).then(res => { DeviceMaintenanceMainApi.finishOrder(param).then(res => {
if(!isTemporary.value) {
selectedOptions.value = options.value.map(option=>option.value)
}
if(selectedOptions.value.length>0){
RepairRelationApi.deleteBatchByIds(selectedOptions.value)
}
tempDialogLoading.value = false tempDialogLoading.value = false
getList() getList()
showTempIdeaRefView.value = false; showTempIdeaRefView.value = false;
@ -1188,6 +1213,30 @@ const getActorClass = () => {
} }
const tempChange = (checked, event) => {
if (checked) {
const tempParams = {
deviceNumber: tempIdeaRefViewData.value.deviceNumber,
type: tempIdeaRefViewData.value.type,
repairNumber: tempIdeaRefViewData.value.number,
};
RepairRelationApi.getRepairRelationNoPage(tempParams).then(res => {
options.value = res.map(element => {
return {
value: element.id,
label: element.spotInspectionName
};
})
if(options.value.length > 0){
isTemporaryShow.value = true;
}else{
isTemporaryShow.value =false;
}
});
}else{
isTemporaryShow.value = false
}
};
// const judgeIfDeviceRole = () => { // const judgeIfDeviceRole = () => {
// const rolesOk = userStore.roles.find(item => { // const rolesOk = userStore.roles.find(item => {
// return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' // return item == 'device_class_worker_role' || item == 'device_class_Engineer_role'
@ -1232,3 +1281,37 @@ onMounted(async () => {
importTemplateData.templateUrl = await DeviceMaintenanceMainApi.importTemplate() importTemplateData.templateUrl = await DeviceMaintenanceMainApi.importTemplate()
}) })
</script> </script>
<style scoped lang="scss">
.form-item {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.form-label {
align-self: flex-start;
margin-bottom: 5px;
}
.checkbox-group {
display: flex;
flex-wrap: wrap;
justify-content: center; /* 内容居中 */
vertical-align: middle;
}
.checkbox-item {
margin: 10px;
vertical-align: middle;
}
.checkbox-label {
display: inline-block;
max-width: 150px; /* 根据需要调整 */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

244
src/views/eam/device/problemSharingPlatform/index.vue

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

104
src/views/eam/device/problemSharingPlatform/problemSharingPlatform.data.ts

@ -0,0 +1,104 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ProblemSharingPlatformRules = reactive({
number: [required],
questionName: [required],
questionType: [required],
questionDescription: [required],
concurrencyStamp: [required],
deptId: [required]
})
export const ProblemSharingPlatform = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: true,
fixed: 'left',
isForm: false,
},
{
label: '问题名称',
field: 'questionName',
sort: 'custom',
isSearch: true
},
{
label: '问题类型',
field: 'questionType',
sort: 'custom',
isSearch: true,
dictClass: 'string',
dictType: 'problem_type',
form: {
component: 'Select',
}
},
{
label: '问题描述',
field: 'questionDescription',
sort: 'custom',
isSearch: true,
form: {
component: 'Input',
colProps: {
span: 24,
},
componentProps: {
type: 'textarea',
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
{
label: '图片',
field: 'uploadImgs',
isForm: true,
isTable: false,
form: {
component: 'UploadImgs',
componentProps: {
limit:3,
}
}
},
{
label: '文档',
field: 'uploadFiles',
isForm: true,
isTable: false,
form: {
component: 'UploadFile',
componentProps: {
limit:3,
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

13
src/views/eam/mold/moldRepair/moldRepair.data.ts

@ -152,7 +152,18 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
}, },
} }
}, },
{
label: '工单来源',
field: 'orderSourceType',
sort: 'custom',
dictType: DICT_TYPE.ORDER_SOURCE_TYPE,
dictClass: 'string',
isSearch: false,
isForm: false,
table: {
width: '150',
},
},
{ {
label: '报修人电话', label: '报修人电话',
field: 'declarerPhone', field: 'declarerPhone',

1
src/views/eam/mold/moldSpotInspectionRecordMain/index.vue

@ -137,6 +137,7 @@ import * as DeviceSpotInspectionRecordDetailApi from '@/api/eam/device/deviceSpo
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as DeviceMoldItemsApi from '@/api/eam/basic/moldInspection'
defineOptions({ name: 'MoldSpotInspectionRecordMain' }) defineOptions({ name: 'MoldSpotInspectionRecordMain' })
const message = useMessage() // const message = useMessage() //

9
src/views/eam/mold/moldSpotInspectionRecordMain/moldSpotInspectionRecordMain.data.ts

@ -259,6 +259,15 @@ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSche
}, },
isSearch: true isSearch: true
}, },
{
label: '巡检点检记录',
field: 'records',
sort: 'custom',
table: {
width: '300',
},
isSearch: false
},
{ {
label: '设备部位名称', label: '设备部位名称',
field: 'equipmentPosition', field: 'equipmentPosition',

60
src/views/eam/mold/moldinspectionjob/index.vue

@ -44,13 +44,13 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="true" :isBusiness="true"
@onChange="onChange" @onChange="onChange"
:tableAllSchemas="MoldInspectionDetail.allSchemas" :isShowReduceButton="isShowReduceButton"
:tableFormRules="MoldInspectionDetailRules" :tableAllSchemas="MoldInspectionAddDetail.allSchemas"
:tableFormRules="MoldInspectionAddDetailRules"
:tableData="tableData" :tableData="tableData"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@submitForm="submitForm" @submitForm="submitForm"
:isSearchTableItem="true"
@formSelectChange="formSelectChange" @formSelectChange="formSelectChange"
/> />
@ -113,7 +113,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { MoldInspectionDetail, MoldInspectionDetailRules, MoldInspectionMain, MoldInspectionMainRules } from './moldInspectionMain.data' import { MoldInspectionDetail, MoldInspectionDetailRules, MoldInspectionMain, MoldInspectionMainRules, MoldInspectionAddDetailRules, MoldInspectionAddDetail } from './moldInspectionMain.data'
import * as MoldInspectionMainApi from '@/api/eam/mold/moldInspectionMain' import * as MoldInspectionMainApi from '@/api/eam/mold/moldInspectionMain'
import * as MoldInspectionDetailApi from '@/api/eam/mold/moldInspectionDetail' import * as MoldInspectionDetailApi from '@/api/eam/mold/moldInspectionDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -124,6 +124,7 @@ import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDet
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain'
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain'
import * as RepairRelationApi from '@/api/eam/basic/repairRelation'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { import {
MoldMaintenanceMain, MoldMaintenanceMain,
@ -172,10 +173,33 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
row['itemNumbers'] = val row['itemNumbers'] = val
} }
} else { } else {
// const setV = {} const setV = {}
// setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
// setV['supplierCode'] = val[0]['code'] formRef.setValues(setV)
// formRef.setValues(setV) if(formField == 'maintenanceNumber'){
const maintenanceRecord = val[0];
basicFormRef.value.formRef.formModel.deviceNumber = maintenanceRecord.deviceNumber
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(maintenanceRecord.factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
if(maintenanceRecord.sourceType == '1'){
basicFormRef.value.formRef.formModel.sourceType = '1'
RepairRelationApi.getRepairRelationNoPage({repairNumber:maintenanceRecord.number}).then(res => {
if (res != null) {
res.forEach(item=>{
tableFormKeys['name'] = item.spotInspectionName
tableFormKeys['hiddenTheReduceButton'] = true
tableFormKeys['disabled_name'] = true
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
tableFormKeys['name'] = undefined
tableFormKeys['hiddenTheReduceButton'] = undefined
tableFormKeys['disabled_name'] = undefined
})
}
})
}else{
basicFormRef.value.formRef.formModel.sourceType = '0'
}
}
} }
}) })
} }
@ -446,9 +470,29 @@ const onChange = (field, cur, item) => {
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
basicFormRef.value.formRef.formModel.maintenanceNumber = '' basicFormRef.value.formRef.formModel.maintenanceNumber = ''
} else if (field == 'maintenanceNumber') { } else if (field == 'maintenanceNumber') {
tableData.value = []
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber
basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
const itemObj = item.componentProps.options.find(element => element.number == cur)
if(itemObj.sourceType == '1'){
basicFormRef.value.formRef.formModel.sourceType = '1'
RepairRelationApi.getRepairRelationNoPage({repairNumber:cur}).then(res => {
if (res != null) {
res.forEach(item=>{
tableFormKeys['name'] = item.spotInspectionName
tableFormKeys['hiddenTheReduceButton'] = true
tableFormKeys['disabled_name'] = true
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
tableFormKeys['name'] = undefined
tableFormKeys['hiddenTheReduceButton'] = undefined
tableFormKeys['disabled_name'] = undefined
})
}else{
basicFormRef.value.formRef.formModel.sourceType = '0'
}
})
}
} }
} }

176
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -9,6 +9,9 @@ import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { validateHanset, validateNum, validateNum100 } from '@/utils/validator' import { validateHanset, validateNum, validateNum100 } from '@/utils/validator'
import {
MoldMaintenanceMain,
} from '../moldmaintenancejob/moldMaintenanceMain.data'
const userStore = useUserStore() const userStore = useUserStore()
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
@ -71,22 +74,43 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
api: () => repairList, api: () => repairList,
componentProps: { componentProps: {
optionsAlias: { optionsAlias: {
labelField: 'number', labelField: 'describes',
valueField: 'number' valueField: 'number'
}, },
filterable: true, filterable: true,
} }
}, },
// form: {
// component: 'Select',
// api: () => repairList,
// componentProps: {
// optionsAlias: {
// labelField: 'describes',
// valueField: 'number'
// },
// filterable: true,
// },
// }
form: { form: {
component: 'Select',
api: () => repairList,
componentProps: { componentProps: {
optionsAlias: { isSearchList: true, // 开启查询弹窗
labelField: 'number', searchListPlaceholder: '请选择备件', // 输入框占位文本
valueField: 'number' searchField: 'number', // 查询弹窗赋值字段
}, searchTitle: '备件', // 查询弹窗标题
filterable: true, searchAllSchemas: MoldMaintenanceMain.allSchemas, // 查询弹窗所需类
}, searchPage: MoldMaintenanceMainApi.getMoldMaintenanceMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'type',
value: 'MOLD',
message: '请选择设备模具编号!',
isMainValue: false
},{
key: 'result',
value: 'TEMPORARILY',
message: '请选择设备模具编号!',
isMainValue: false
}]
}
} }
}, },
{ {
@ -280,6 +304,18 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '工单来源',
field: 'sourceType',
sort: 'custom',
dictType: DICT_TYPE.ORDER_SOURCE_TYPE,
dictClass: 'string',
isSearch: false,
isForm: false,
table: {
width: '150',
},
},
// { // {
// label: '创建时间', // label: '创建时间',
// field: 'createTime', // field: 'createTime',
@ -647,3 +683,125 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false, isTableForm: false,
} }
])) ]))
// 表单校验
export const MoldInspectionAddDetailRules = reactive({
chargePeoples:[
required,
],
peoples: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' },
{ validator: validateNum100, message: '预估人数不得超出100', trigger: 'blur' },
],
estimatedMinutes:[
required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}
],
number: [required],
actualMinutes: [
required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}
],
maintenance: [required],
})
export const MoldInspectionAddDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '检修编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: false,
isTableForm: false,
},
{
label: '内容',
field: 'name',
sort: 'custom',
isSearch: true,
form: {
component: 'Input',
componentProps: {
type:'textarea'
}
},
},
{
label: '责任人',
field: 'chargePeoples',
sort: 'custom',
table: {
width: '150',
},
tableForm: {
type: 'Select',
initOptions: dutyUserList,
multiple:true,
collapseTags:true,
collapseTagsTooltip:true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
const cellValueList = cellValue ? cellValue.split(',') : [];
return userListAll
.filter(item => cellValueList.includes(item.id.toString()))
.map(item => item.nickname)
.join(',');
},
form: {
component: 'Select',
api: () => dutyUserList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择责任人",
multiple: true,
},
}
},
{
label: '预计分钟',
field: 'estimatedMinutes',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
form: {
component: 'Input',
},
},
{
label: '人数',
field: 'peoples',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
form: {
component: 'InputNumber',
},
isTable: true,
tableForm: {
type: 'InputNumber',
},
},
]))

94
src/views/eam/mold/moldmaintenancejob/index.vue

@ -133,9 +133,24 @@
:closeOnClickModal="true" :closeOnClickModal="true"
:title="tempIdeaRefViewTitle" :title="tempIdeaRefViewTitle"
:vLoading="tempDialogLoading" :vLoading="tempDialogLoading"
> >
<div style="text-align: center;"> <div class="form-item">
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox> <label class="form-label">是否临时措施</label>
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary" @change="tempChange">临时措施</el-checkbox>
</div>
<div v-if="isTemporaryShow" class="form-item">
<label class="form-label">选择已完成检查项</label>
<el-checkbox-group v-model="selectedOptions" class="checkbox-group">
<el-checkbox
v-for="option in options"
:key="option.value"
:label="option.value"
class="checkbox-item"
>
<span class="checkbox-label">{{ option.label }}</span>
</el-checkbox>
</el-checkbox-group>
</div> </div>
<template #footer> <template #footer>
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">取消</el-button>
@ -143,6 +158,7 @@
</template> </template>
</Dialog> </Dialog>
<Dialog <Dialog
ref="confirmDialog" ref="confirmDialog"
title="确认意见" title="确认意见"
@ -231,6 +247,8 @@ import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { selectAllFactoryArea } from '@/api/system/dept' import { selectAllFactoryArea } from '@/api/system/dept'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import * as RepairRelationApi from '@/api/eam/basic/repairRelation'
import * as InspectionApi from '@/api/eam/basic/inspection'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD')
defineOptions({ name: 'MoldMaintenanceMain' }) defineOptions({ name: 'MoldMaintenanceMain' })
@ -268,6 +286,9 @@ const openRowValue = ref()
const formLoading = ref(false) const formLoading = ref(false)
const tempDialogLoading = ref(false) const tempDialogLoading = ref(false)
const confirmDialogLoading = ref(false) const confirmDialogLoading = ref(false)
const selectedOptions = ref([])
const options = ref([])
const isTemporaryShow = ref(false)
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns)
@ -647,6 +668,12 @@ function confirmFinish(row) {
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
} }
MoldMaintenanceMainApi.finishOrder(param).then(res => { MoldMaintenanceMainApi.finishOrder(param).then(res => {
if(!isTemporary.value) {
selectedOptions.value = options.value.map(option=>option.value)
}
if(selectedOptions.value.length>0){
RepairRelationApi.deleteBatchByIds(selectedOptions.value)
}
tempDialogLoading.value = false tempDialogLoading.value = false
getList() getList()
showTempIdeaRefView.value = false; showTempIdeaRefView.value = false;
@ -706,6 +733,9 @@ function confirmSubmit() {
content: confirmFormValue.value.confirmContent, content: confirmFormValue.value.confirmContent,
} }
MoldMaintenanceMainApi.confirmOrder(param).then(res => { MoldMaintenanceMainApi.confirmOrder(param).then(res => {
if(selectedOptions.value.length>0){
RepairRelationApi.deleteBatchByIds(selectedOptions.value)
}
confirmDialogLoading.value = false confirmDialogLoading.value = false
confirmDialogVisible.value = false confirmDialogVisible.value = false
getList() getList()
@ -1197,9 +1227,69 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
return false; return false;
} }
const tempChange = (checked, event) => {
if (checked) {
const tempParams = {
deviceNumber: tempIdeaRefViewData.value.deviceNumber,
type: tempIdeaRefViewData.value.type,
repairNumber: tempIdeaRefViewData.value.number,
};
RepairRelationApi.getRepairRelationNoPage(tempParams).then(res => {
options.value = res.map(element => {
return {
value: element.id,
label: element.spotInspectionName
};
})
if(options.value.length>0){
isTemporaryShow.value = true
}else{
isTemporaryShow.value = false
}
});
}else{
isTemporaryShow.value = false
}
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await MoldMaintenanceMainApi.importTemplate() importTemplateData.templateUrl = await MoldMaintenanceMainApi.importTemplate()
}) })
</script> </script>
<style scoped lang="scss">
.form-item {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.form-label {
align-self: flex-start;
margin-bottom: 5px;
}
.checkbox-group {
display: flex;
flex-wrap: wrap;
justify-content: center; /* 内容居中 */
}
.checkbox-item {
margin: 10px;
}
.checkbox-label {
display: inline-block;
max-width: 150px; /* 根据需要调整 */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

Loading…
Cancel
Save