diff --git a/src/api/eam/basic/inspection/index.ts b/src/api/eam/basic/inspection/index.ts
index c1eaafb..d03b962 100644
--- a/src/api/eam/basic/inspection/index.ts
+++ b/src/api/eam/basic/inspection/index.ts
@@ -3,14 +3,14 @@ import request from '@/config/axios'
export interface DeviceMoldItemsVO {
name: string
deviceNumber: string
- type: "DEVICE"
+ type: string
status: string
siteId: string
available: string
concurrencyStamp: number
}
-// 查询项记录表(设备 模具 保养 维修 巡检点检)列表
+// 查询设备项记录表(设备 模具 保养 维修 巡检点检)列表
export const getDeviceMoldItemsPage = async (params) => {
params.type="DEVICE"
params.status="INSPECTION"
@@ -23,6 +23,19 @@ export const getDeviceMoldItemsPage = async (params) => {
}
}
+// 查询模具项记录表(设备 模具 保养 维修 巡检点检)列表
+export const getMoldItemsPage = async (params) => {
+ params.type="MOLD"
+ params.status="INSPECTION"
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/eam/device-mold-items/senior', data })
+ } else {
+ return await request.get({ url: `/eam/device-mold-items/page`, params })
+ }
+}
+
// 查询项记录表(设备 模具 保养 维修 巡检点检)详情
export const getDeviceMoldItems = async (id: number) => {
@@ -34,12 +47,19 @@ export const getNumber = async (params) => {
return await request.get({ url: `/eam/device-mold-items/getNumber`, params})
}
-// 新增项记录表(设备 模具 保养 维修 巡检点检)
+// 新增设备项记录表(设备 模具 保养 维修 巡检点检)
export const createDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
data.type="DEVICE"
data.status="INSPECTION"
return await request.post({ url: `/eam/device-mold-items/create`, data })
}
+//新增模具
+export const creatMoldItems = async (data: DeviceMoldItemsVO) => {
+ debugger
+ data.type="MOLD"
+ data.status="INSPECTION"
+ return await request.post({ url: `/eam/device-mold-items/create`, data })
+}
// 修改项记录表(设备 模具 保养 维修 巡检点检)
export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
@@ -48,6 +68,14 @@ export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
return await request.put({ url: `/eam/device-mold-items/update`, data })
}
+// 修改模具项记录表(设备 模具 保养 维修 巡检点检)
+export const updateMoldItems = async (data: DeviceMoldItemsVO) => {
+ debugger
+ data.type="MOLD"
+ data.status="INSPECTION"
+ return await request.put({ url: `/eam/device-mold-items/update`, data })
+}
+
// 删除项记录表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItems = async (id: number) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id })
diff --git a/src/api/eam/basic/moldInspection/index.ts b/src/api/eam/basic/moldInspection/index.ts
new file mode 100644
index 0000000..1e2d672
--- /dev/null
+++ b/src/api/eam/basic/moldInspection/index.ts
@@ -0,0 +1,63 @@
+import request from '@/config/axios'
+
+export interface DeviceMoldItemsVO {
+ name: string
+ deviceNumber: string
+ type: string
+ status: string
+ siteId: string
+ available: string
+ concurrencyStamp: number
+}
+
+
+// 查询模具项记录表(设备 模具 保养 维修 巡检点检)列表
+export const getMoldItemsPage = async (params) => {
+ params.type="MOLD"
+ params.status="INSPECTION"
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/eam/device-mold-items/senior', data })
+ } else {
+ return await request.get({ url: `/eam/device-mold-items/page`, params })
+ }
+}
+
+
+// 查询项记录表(设备 模具 保养 维修 巡检点检)详情
+export const getDeviceMoldItems = async (id: number) => {
+ return await request.get({ url: `/eam/device-mold-items/get?id=` + id })
+}
+
+// 查询供应商发票申请主详情
+export const getNumber = async (params) => {
+ return await request.get({ url: `/eam/device-mold-items/getNumber`, params})
+}
+
+//新增模具
+export const creatMoldItems = async (data: DeviceMoldItemsVO) => {
+ data.type="MOLD"
+ data.status="INSPECTION"
+ return await request.post({ url: `/eam/device-mold-items/create`, data })
+}
+
+
+// 修改模具项记录表(设备 模具 保养 维修 巡检点检)
+export const updateMoldItems = async (data: DeviceMoldItemsVO) => {
+ data.type="MOLD"
+ data.status="INSPECTION"
+ return await request.put({ url: `/eam/device-mold-items/update`, data })
+}
+
+// 删除项记录表(设备 模具 保养 维修 巡检点检)
+export const deleteDeviceMoldItems = async (id: number) => {
+ return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id })
+}
+
+// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel
+export const exportDeviceMoldItems = async (params) => {
+ return await request.download({ url: `/eam/device-mold-items/export-excel`, params })
+}
+
+
diff --git a/src/api/eam/mold/moldSpotInspectionRecordMain/index.ts b/src/api/eam/mold/moldSpotInspectionRecordMain/index.ts
new file mode 100644
index 0000000..580b20d
--- /dev/null
+++ b/src/api/eam/mold/moldSpotInspectionRecordMain/index.ts
@@ -0,0 +1,57 @@
+import request from '@/config/axios'
+
+export interface DeviceSpotInspectionRecordMainVO {
+ number: string
+ deviceNumber: string
+ describe: string
+ maintenance: number
+ maintenancePhone: string
+ status: string
+ type: string
+ siteId: string
+ available: string
+ approveOpinion?: string
+ concurrencyStamp: number
+}
+
+// 查询检修工单主列表
+export const getDeviceSpotInspectionRecordMainPage = async (params) => {
+ params.type = 'MOLD'
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/eam/device-spot-inspection-record-main/senior', data })
+ } else {
+ return await request.get({ url: `/eam/device-spot-inspection-record-main/page`, params })
+ }
+}
+
+// 查询检修工单主详情
+export const getDeviceSpotInspectionRecordMain = async (id: number) => {
+ return await request.get({ url: `/eam/device-spot-inspection-record-main/get?id=` + id })
+}
+
+// 新增检修工单主
+export const createDeviceSpotInspectionRecordMain = async (data: DeviceSpotInspectionRecordMainVO) => {
+ return await request.post({ url: `/eam/device-spot-inspection-record-main/create`, data })
+}
+
+// 修改检修工单主
+export const updateDeviceSpotInspectionRecordMain = async (data: DeviceSpotInspectionRecordMainVO) => {
+ return await request.put({ url: `/eam/device-spot-inspection-record-main/update`, data })
+}
+
+// 删除检修工单主
+export const deleteDeviceSpotInspectionRecordMain = async (id: number) => {
+ return await request.delete({ url: `/eam/device-spot-inspection-record-main/delete?id=` + id })
+}
+
+// 导出检修工单主 Excel
+export const exportDeviceSpotInspectionRecordMain = async (params) => {
+ return await request.download({ url: `/eam/device-spot-inspection-record-main/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/device-spot-inspection-record-main/get-import-template' })
+}
\ No newline at end of file
diff --git a/src/views/eam/basic/moldInspection/index.vue b/src/views/eam/basic/moldInspection/index.vue
new file mode 100644
index 0000000..c56563b
--- /dev/null
+++ b/src/views/eam/basic/moldInspection/index.vue
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/eam/basic/moldInspection/moldInspection.data.ts b/src/views/eam/basic/moldInspection/moldInspection.data.ts
new file mode 100644
index 0000000..5cfaf85
--- /dev/null
+++ b/src/views/eam/basic/moldInspection/moldInspection.data.ts
@@ -0,0 +1,166 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
+
+// 表单校验
+export const DeviceMoldItemsRules = reactive({
+ name: [required],
+ deviceNumber: [required],
+ type: [required],
+ status: [required],
+ concurrencyStamp: [required],
+})
+
+export const DeviceMOLD = useCrudSchemas(reactive([
+ {
+ label: '编号',
+ field: 'number',
+ sort: 'custom',
+ isForm: false,
+ table: {
+ width: 180,
+ fixed: 'left'
+ },
+ },
+ {
+ label: '名称',
+ field: 'name',
+ sort: 'custom',
+ },
+ {
+ label: '规格型号',
+ field: 'specification',
+ sort: 'custom',
+ },
+
+]))
+
+export const DeviceMoldItems = useCrudSchemas(reactive([
+ {
+ label: '巡检点检项',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ componentProps: {
+ type: 'textarea',
+ }
+ }
+ },
+ {
+ label: '类型',
+ field: 'type',
+ dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
+ dictClass: 'string',
+ sort: 'custom',
+ isSearch: false,
+ form: {
+ value: 'MOLD',
+ componentProps: {
+ disabled: true,
+ }
+ }
+ },
+ {
+ label: '模具编号',
+ field: 'deviceNumber',
+ sort: 'custom',
+ isSearch: false,
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择单号', // 输入框占位文本
+ searchField: 'number', // 查询弹窗赋值字段
+ searchTitle: '单号信息', // 查询弹窗标题
+ searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
+ searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
+ searchCondition: [
+ {
+ key: 'available',
+ value: "TRUE",
+ isMainValue: false
+ }, {
+ key: 'type',
+ value: 'type',
+ isMainValue: true
+ }
+ ]
+ }
+ }
+ },
+ {
+ label: '模具名称',
+ field: 'deviceName',
+ sort: 'custom',
+ isSearch: false,
+ isForm: false,
+ },
+ {
+ label: '项类型',
+ field: 'status',
+ dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
+ dictClass: 'string',
+ sort: 'custom',
+ isSearch: false,
+ form: {
+ component: 'Select',
+ value: 'INSPECTION',
+ componentProps: {
+ disabled: true
+ }
+ },
+ },
+
+ {
+ label: '模具部位',
+ field: 'equipmentParts',
+ sort: 'custom',
+ isSearch: true,
+ },
+
+ // {
+ // label: '是否可用',
+ // field: 'available',
+ // dictType: DICT_TYPE.TRUE_FALSE,
+ // dictClass: 'string',
+ // isSearch: false,
+ // isTable: true,
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // tableForm: {
+ // type: 'Select',
+ // inactiveValue: 'FALSE',
+ // disabled: true
+ // },
+ // form: {
+ // component: 'Switch',
+ // value: 'TRUE',
+ // componentProps: {
+ // inactiveValue: 'FALSE',
+ // activeValue: 'TRUE'
+ // }
+ // }
+ // },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ sort: 'custom',
+ formatter: dateFormatter,
+ isForm: false,
+ table: {
+ width: 170
+ },
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))
diff --git a/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts b/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
index edc5c5a..8e49eee 100644
--- a/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
+++ b/src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
@@ -182,7 +182,7 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive
+
+
+
{
tableColumns.value = val
@@ -224,28 +260,7 @@ const isShowMainButton = (row, val) => {
// 列表-操作按钮
const butttondata = (row) => {
return [
- defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑
- defaultButtons.acceptOrderBtn({
- hide: !(
- row.status == 'PENDING' &&
- userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker')
- )
- }), // 接单
- defaultButtons.turnOrderBtn({
- hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
- }), // 转办
- defaultButtons.repairBtn({
- hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
- }), // 维修
- defaultButtons.verifyOrderBtn({
- hide: !(
- row.status == 'COMPLETED' &&
- userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer')
- )
- }), // 验证
- defaultButtons.finishOrderBtn({
- hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
- }) // 完成
+ defaultButtons.approveBtn({ hide: !(row.status == 'COMPLETED' && judgeIfDeviceRole())}), // 审批
]
}
const onChange = (field, cur, item) => {
@@ -259,22 +274,9 @@ const onChange = (field, cur, item) => {
}
// 列表-操作按钮事件
const buttonTableClick = async (val, row) => {
- DeviceSpotInspectionRecordMain.allSchemas.formSchema.find(item => {
- return item.field == 'type'
- }).value = 'DEVICE'
- if (val == 'edit') {
- // 编辑
- openForm('update', row)
- DeviceSpotInspectionRecordMain.allSchemas.formSchema.find(item => {
- return item.field == 'number'
- }).componentProps.disabled = true
- } else if (val == 'delete') {
- // 删除
- handleDelete(row.id)
- } else if (val == 'acceptOrder') {
- acceptOrder(row)
- } else if (val == 'turnOrder') {
- openForm('turnOrder', row)
+ if (val == 'approve') {//审批
+ dialogVisible.value = true;
+ updateFormValue.value.id = row.id
}
}
@@ -504,6 +506,39 @@ function buttonControllFunction(row, val) {
return true
}
}
+const handleBeforeClose = async(done)=>{
+ done()
+}
+const onSubmit = async (status: string) => {
+ try {
+ const data: DeviceSpotInspectionRecordMainVO = {
+ approveOpinion: updateFormValue.value.approveOpinion,
+ status: status,
+ id:updateFormValue.value.id
+ };
+ await DeviceSpotInspectionRecordMainApi.updateDeviceSpotInspectionRecordMain(data);
+ message.success(t('common.updateSuccess'));
+ dialogVisible.value = false;
+ // Refresh the current list
+ getList();
+ } finally {
+ formRef.value.formLoading = false;
+ }
+}
+
+/**
+ * 判断是否为模具工程师
+ */
+ const judgeIfDeviceRole = () => {
+ const rolesOk = userStore.roles.find(item => {
+ return item == 'device_class_Engineer_role'
+ })
+ if (rolesOk != undefined && rolesOk != null) {
+ return true
+ } else {
+ return false
+ }
+}
/** 初始化 **/
onMounted(async () => {
diff --git a/src/views/eam/mold/moldSpotInspectionRecordMain/index.vue b/src/views/eam/mold/moldSpotInspectionRecordMain/index.vue
new file mode 100644
index 0000000..449b876
--- /dev/null
+++ b/src/views/eam/mold/moldSpotInspectionRecordMain/index.vue
@@ -0,0 +1,549 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/eam/mold/moldSpotInspectionRecordMain/moldSpotInspectionRecordMain.data.ts b/src/views/eam/mold/moldSpotInspectionRecordMain/moldSpotInspectionRecordMain.data.ts
new file mode 100644
index 0000000..797d16c
--- /dev/null
+++ b/src/views/eam/mold/moldSpotInspectionRecordMain/moldSpotInspectionRecordMain.data.ts
@@ -0,0 +1,263 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+import { selectAllFactoryArea } from '@/api/system/dept'
+import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
+import { useUserStore } from '@/store/modules/user'
+import { selecUserByType } from '@/api/system/dept'
+import { ItemSearchTable } from '../../basic/item/item.data'
+import * as ItemApi from '@/api/eam/basic/item'
+import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
+import * as UserApi from '@/api/system/user'
+import { fa } from 'element-plus/es/locale'
+// 邮箱账号的列表
+const factoryList = await selectAllFactoryArea()
+const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
+const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 })
+const userListAll = await UserApi.getSimpleUserList()
+const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
+const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE')
+const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
+const isConformList = [{
+ label:'是',
+ value:'TRUE'
+},{
+ label:'否',
+ value:'FALSE'
+}]
+// 表单校验
+export const DeviceSpotInspectionRecordMainRules = reactive({
+ deviceNumber: [required],
+ status: [required],
+ type: [required],
+ concurrencyStamp: [required],
+})
+
+export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive([
+ {
+ label: '巡检点检编号',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true,
+ table: {
+ width: '150',
+ fixed: 'left',
+ },
+ isForm: false,
+ },
+ {
+ label: '设备模具',
+ field: 'deviceNumber',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ isSearch: true,
+ api: () => DeviceAccountsApi.getDeviceAccountsNoPage({
+ isSearch: false
+ }),
+ formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
+ return deviceListNoPage.find((account) => account.number == cellValue)?.name
+ },
+ search:{
+ component: 'Select',
+ componentProps: {
+ options: deviceListNoPage,
+ optionsAlias: {
+ labelField: 'name',
+ valueField: 'number'
+ },
+ filterable: true,
+ },
+ },
+ form: {
+ component: 'Select',
+ componentProps: {
+ options: deviceList,
+ optionsAlias: {
+ labelField: 'name',
+ valueField: 'number'
+ },
+ filterable: true,
+ },
+ }
+ },
+ {
+ label: '维修人',
+ field: 'maintenance',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
+ return userListAll.find((account) => account.id == cellValue)?.nickname
+ },
+ isDetail:false,
+ form: {
+ component: 'Select',
+ api: () => userList,
+ componentProps: {
+ disabled: true,
+ optionsAlias: {
+ labelField: 'name',
+ valueField: 'id'
+ },
+ filterable: true,
+ },
+ }
+ },
+ {
+ label: '维修人',
+ field: 'maintenanceName',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ isForm:false,
+ isDetail:true,
+ isSearch:false,
+ isTable:false
+ },
+ {
+ label: '状态',
+ field: 'status',
+ sort: 'custom',
+ isSearch: true,
+ dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
+ dictClass: 'string',
+ table: {
+ width: 'c',
+ },
+ form: {
+ component: 'Select'
+ },
+ },
+ {
+ label: '类型',
+ field: 'type',
+ sort: 'custom',
+ table: {
+ width: 'getDeviceSpotInspectionRecordMainSenior',
+ },
+ formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
+ return deviceDeviceTypeList.find((account) => account.value == cellValue)?.label
+ },
+ isSearch: false,
+ isTable: false,
+ search: {
+ component: 'Select',
+ componentProps: {
+ options: deviceTypeList,
+ optionsAlias: {
+ labelField: 'label',
+ valueField: 'value'
+ },
+ filterable: true,
+ },
+ },
+ form: {
+ component: 'Select',
+ componentProps: {
+ options: deviceTypeList,
+ optionsAlias: {
+ labelField: 'label',
+ valueField: 'value'
+ },
+ filterable: true,
+ placeholder: "请选择设备"
+ }
+ },
+ detail:{
+ dictType:DICT_TYPE.APP_DEVICE_MOLD_TYPE
+ }
+ },
+ {
+ label: '描述',
+ field: 'describes',
+ sort: 'custom',
+ table: {
+ width: '300',
+ },
+ },
+ {
+ label: '审批意见',
+ field: 'approveOpinion',
+ sort: 'custom',
+ table: {
+ width: '300',
+ },
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ isTable: true,
+ isDetail:false,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))
+
+
+// 表单校验
+export const DeviceSpotInspectionRecordDetailRules = reactive({
+ number: [required],
+ concurrencyStamp: [required],
+ name: [required],
+ equipmentPosition: [required]
+})
+
+export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive([
+
+ {
+ label: '检修工单号',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true,
+ table: {
+ width: '300',
+ },
+ },
+ {
+ label: '是否符合',
+ field: 'isConform',
+ sort: 'custom',
+ isSearch: true,
+ table: {
+ width: 'auto',
+ },
+ formatter: (_: Recordable, __: TableColumn, cellValue: String) => {
+ return isConformList.find((account) => account.value == cellValue)?.label
+ },
+ },
+
+ {
+ label: '检查内容',
+ field: 'name',
+ sort: 'custom',
+ table: {
+ width: '300',
+ },
+ isSearch: true
+ },
+ {
+ label: '设备部位名称',
+ field: 'equipmentPosition',
+ sort: 'custom',
+ table: {
+ width: '300',
+ },
+ isSearch: true
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ isTable: true,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))