diff --git a/src/api/eam/basicSpotCheckOption/index.ts b/src/api/eam/basicSpotCheckOption/index.ts new file mode 100644 index 000000000..5b7d2d409 --- /dev/null +++ b/src/api/eam/basicSpotCheckOption/index.ts @@ -0,0 +1,63 @@ +import request from '@/config/axios' + +export interface BasicSpotCheckOptionVO { + id: number + code: string + name: string + selectId: number + describing: string + isUpdated: boolean + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询点检方案列表 +export const getBasicSpotCheckOptionPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic-spotCheck-option/senior', data }) + } else { + return await request.get({ url: `/eam/basic-spotCheck-option/page`, params }) + } +} + +// 查询点检方案详情 +export const getBasicSpotCheckOption = async (id: number) => { + return await request.get({ url: `/eam/basic-spotCheck-option/get?id=` + id }) +} + +// 新增点检方案 +export const createBasicSpotCheckOption = async (data: BasicSpotCheckOptionVO) => { + return await request.post({ url: `/eam/basic-spotCheck-option/create`, data }) +} + +// 修改点检方案 +export const updateBasicSpotCheckOption = async (data: BasicSpotCheckOptionVO) => { + return await request.put({ url: `/eam/basic-spotCheck-option/update`, data }) +} + +// 删除点检方案 +export const deleteBasicSpotCheckOption = async (id: number) => { + return await request.delete({ url: `/eam/basic-spotCheck-option/delete?id=` + id }) +} + +// 导出点检方案 Excel +export const exportBasicSpotCheckOption = async (params) => { + return await request.download({ url: `/eam/basic-spotCheck-option/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic-spotCheck-option/get-import-template' }) +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: BasicSpotCheckOptionVO) => { + return await request.post({ url: `/eam/basic-spotCheck-option/ables` , data }) +} diff --git a/src/api/eam/inspectionItem/index.ts b/src/api/eam/inspectionItem/index.ts index 86b606728..ddf8cf80f 100644 --- a/src/api/eam/inspectionItem/index.ts +++ b/src/api/eam/inspectionItem/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import {InspectionItemSelectSetVO} from "@/api/eam/inspectionItemSelectSet"; export interface InspectionItemVO { id: number @@ -59,4 +60,10 @@ export const exportInspectionItem = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/basic/inspection-item/get-import-template' }) -} \ No newline at end of file +} + + +// 启用 / 禁用 +export const updateEnableCode = async (data: InspectionItemVO) => { + return await request.post({ url: `/eam/basic/inspection-item/ables` , data }) +} diff --git a/src/views/eam/basicInspectionOption/itemSelectSetForm.vue b/src/views/eam/basicInspectionOption/itemSelectSetForm.vue index 0aed31571..357c89e66 100644 --- a/src/views/eam/basicInspectionOption/itemSelectSetForm.vue +++ b/src/views/eam/basicInspectionOption/itemSelectSetForm.vue @@ -83,6 +83,15 @@ + 确 定 取 消 @@ -100,10 +109,6 @@ import { SearchTable } from '@/components/SearchTable' import { InspectionItemSelectSet} from "@/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data"; import * as inspectionItemItemSelectSetApi from "@/api/eam/inspectionItemSelectSet"; import {ElInput} from "element-plus"; -import { - createBasicInspectionOption, - updateBasicInspectionOption -} from "@/api/eam/basicInspectionOption"; defineOptions({ name: 'TeamForm' }) diff --git a/src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue b/src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue index 7b9018259..884691790 100644 --- a/src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue +++ b/src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue @@ -315,6 +315,7 @@ const submitForm = async () => { //赋值 保养选择集ID formData.value.selectId = tags.value[0].selectId + console.log(formData.value) // 提交请求 formLoading.value = true //formData.value.members = JSON.stringify(tags.value) diff --git a/src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts b/src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts new file mode 100644 index 000000000..3bfc01c37 --- /dev/null +++ b/src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts @@ -0,0 +1,201 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as ItemApi from "@/api/eam/spotCheckSelectSet"; +import {BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheckSelectSet.data"; +import {getBasicSpotCheckSelectSetPage} from "@/api/eam/spotCheckSelectSet"; + +// 表单校验 +export const BasicSpotCheckOptionRules = reactive({ + code: [required], + selectId: [required], +}) + +export const BasicSpotCheckOption = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '编号', + field: 'code', + sort: 'custom', + isSearch: true, + }, + { + label: '方案名称', + field: 'name', + sort: 'custom', + isSearch: true, + }, + { + label: '选择集ID', + field: 'selectId', + sort: 'custom', + isDetail: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchTitle: '点检选择集信息', // 查询弹窗标题 + searchAllSchemas: BasicSpotCheckSelectSet.allSchemas, // 查询弹窗所需类 + searchField: 'id', // 查询弹窗赋值字段 + searchPage: ItemApi.getBasicSpotCheckSelectSetPage, // 查询弹窗所需分页方法 + multiple:true, + searchCondition: [{ + key: 'available', + value: 'TRUE', + action: '==', + isSearch: true, + isMainValue: false + }] + } + } + }, + { + label: '描述', + field: 'describing', + sort: 'custom', + isSearch: true, + }, + { + label: '项是否可修改', + field: 'isUpdated', + sort: 'custom', + dictType: DICT_TYPE.IS_UPDATED, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: true, + isDetail: false, + isSearch: true, + isTableForm: false, + isForm: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + // { + // label: '保养项', + // field: 'type', + // sort: 'custom', + // isSearch: true, + // }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '部门id', + field: 'departmentCode', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: true, + isDetail: false, + isSearch: false, + 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' + } + } +])) diff --git a/src/views/eam/basicSpotCheckOption/index.vue b/src/views/eam/basicSpotCheckOption/index.vue new file mode 100644 index 000000000..b4bd13352 --- /dev/null +++ b/src/views/eam/basicSpotCheckOption/index.vue @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + {{ row.code }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue b/src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue new file mode 100644 index 000000000..8791031d3 --- /dev/null +++ b/src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ ent.selectId}} + + + + 添加点检选择集 + + + + + + + + + + + + 是否必选(默认是) + + + + + + + + 确 定 + 取 消 + + + + + + + + + + diff --git a/src/views/eam/inspectionItem/index.vue b/src/views/eam/inspectionItem/index.vue index 8e95cb776..256e1bbe2 100644 --- a/src/views/eam/inspectionItem/index.vue +++ b/src/views/eam/inspectionItem/index.vue @@ -65,6 +65,7 @@ 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 * as InspectionItemSelectSetApi from "@/api/eam/inspectionItemSelectSet"; defineOptions({ name: 'InspectionItem' }) @@ -253,11 +254,20 @@ const searchFormClick = (searchData) => { } const handleEnable = (row,enable) =>{ - message.confirm(t('您确定'+(enable=='TRUE'?'启用':'禁用')+'该项吗, 是否继续?')).then(() => { - row.available = enable - InspectionItemApi.updateInspectionItem(row).then(res => { + message.confirm(t('您确定'+(enable=='TRUE'?'启用':'禁用')+'该项吗, 是否继续?')).then(async () => { + try { + const params = ref({ + id: '', + available: '', + }) + params.value.id = row.id + params.value.available = 'TRUE' + await InspectionItemApi.updateEnableCode(params.value) message.success(t('common.updateSuccess')) - }) + // 刷新列表 + await getList() + } catch { + } }) } diff --git a/src/views/eam/spotCheckItem/spotCheckItem.data.ts b/src/views/eam/spotCheckItem/spotCheckItem.data.ts index a04484032..51edbbba5 100644 --- a/src/views/eam/spotCheckItem/spotCheckItem.data.ts +++ b/src/views/eam/spotCheckItem/spotCheckItem.data.ts @@ -26,6 +26,12 @@ export const SpotCheckItem = useCrudSchemas(reactive([ component:'InputNumber' }, }, + { + label: '点检名称', + field: 'name', + sort: 'custom', + isSearch: true + }, { label: '点检内容', field: 'content',