Browse Source

EAM ——> 巡检 点检 保养方案 增加分页

hella_online_20240829
gaojs 5 months ago
parent
commit
02aa3b162f
  1. 6
      src/api/eam/classTypeRole/index.ts
  2. 10
      src/api/eam/inspectionItemSelectSet/index.ts
  3. 12
      src/api/eam/maintenanceItemSelectSet/index.ts
  4. 11
      src/api/eam/spotCheckSelectSet/index.ts
  5. 36
      src/views/eam/basicInspectionOption/itemSelectSetForm.vue
  6. 31
      src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue
  7. 27
      src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue
  8. 54
      src/views/eam/classTypeRole/index.vue
  9. 2
      src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts
  10. 21
      src/views/eam/inspectionItem/inspectionItem.data.ts
  11. 2
      src/views/eam/item/index.vue
  12. 17
      src/views/eam/maintenanceItem/maintenanceItem.data.ts
  13. 6
      src/views/eam/maintenanceItemSelectSet/itemSelectSetForm.vue
  14. 21
      src/views/eam/spotCheckItem/spotCheckItem.data.ts

6
src/api/eam/classTypeRole/index.ts

@ -62,3 +62,9 @@ export const exportClassTypeRole = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/eam/basic/class-type-role/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: ClassTypeRoleVO) => {
return await request.post({ url: `/eam/basic/class-type-role/ables` , data })
}

10
src/api/eam/inspectionItemSelectSet/index.ts

@ -58,3 +58,13 @@ export const importTemplate = () => {
export const updateEnableCode = async (data: InspectionItemSelectSetVO) => {
return await request.post({ url: `/eam/basic/inspection-item-select-set/ables` , data })
}
// 查询巡检项选择集列表
export const getInspectionItemSelectSetList = async (params) => {
return await request.get({ url: `/eam/basic/inspection-item/getList`, params })
}
// 查询巡检方案项列表
export const getRalInspectionOptionItemList = async (params) => {
return await request.get({url: `/eam/relation-inspection-option-item/getList?optionCode=` + params})
}

12
src/api/eam/maintenanceItemSelectSet/index.ts

@ -56,5 +56,15 @@ export const importTemplate = () => {
// 启用 / 禁用
export const updateEnableCode = async (data: MaintenanceItemSelectSetVO) => {
return await request.post({ url: `/eam/basic/inspection-item-select-set/ables` , data })
return await request.post({ url: `/eam/basic/maintenance-item-select-set/ables` , data })
}
// 查询保养项选择集列表
export const getMaintenanceItemSelectSetList = async (params) => {
return await request.get({ url: `/eam/basic/maintenance-item/getList`, params })
}
// 查询保养方案项列表
export const getRalMaintenanceOptionItemList = async (params) => {
return await request.get({url: `/eam/relation-maintenance-option-item/getList?optionCode=` + params})
}

11
src/api/eam/spotCheckSelectSet/index.ts

@ -59,3 +59,14 @@ export const importTemplate = () => {
export const updateEnableCode = async (data: BasicSpotCheckSelectSetVO) => {
return await request.post({ url: `/eam/basic/spot-check-select-set/ables` , data })
}
// 查询点检项选择集列表
export const getSpotCheckSelectSetList = async (params) => {
return await request.get({ url: `/eam/basic/spot-check-item/getList`, params })
}
// 查询点检方案项列表
export const getRalSpotCheckOptionItemList = async (params) => {
return await request.get({url: `/eam/relation-spotCheck-option-item/getList?optionCode=` + params})
}

36
src/views/eam/basicInspectionOption/itemSelectSetForm.vue

@ -65,7 +65,7 @@
</el-col>
</el-row>
</el-form>
<el-table :data="inspectionItemData" style="width: 100%; height: 80%">
<el-table :data="inspectionItemData" style="width: 100%; height: 200px">
<el-table-column prop="itemCode" label="巡检项ID" />
<el-table-column prop="itemName" label="巡检名称" />
<el-table-column prop="isSelectd" label="" width="150" >
@ -83,15 +83,6 @@
</template>
</el-table-column>
</el-table>
<el-pagination
small
:page-size="3"
background
layout="prev, pager, next"
:total="5"
class="mt-4"
@current-change="handleGroupPageChange"
/>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
@ -109,6 +100,7 @@ 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 {ref} from "vue";
defineOptions({ name: 'TeamForm' })
@ -128,6 +120,7 @@ const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const inspectionItemData = ref([])
const itemsId = ref('')
const itemData = ref({
id: '',
@ -216,7 +209,6 @@ const addItemCommon = (multiple,field) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick?.(async () => {
if (formField === 'xunJianItem') {
let itemsId = '';
//ID
val.forEach(item => {
const isExist = tags.value.some(tag => tag.id === item.id);
@ -227,19 +219,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
itemsId.value = item.itemCode;
});
inspectionItemData.value = [];
let query = {
itemsId: itemsId.value
}
let res = await inspectionItemItemSelectSetApi.getInspectionItemSelectSetList(query)
//
try {
formLoading.value = true;
inspectionItemData.value = [];
for (const item of itemsId.split(",")) {
let res = await request.get({url: `/eam/basic/inspection-item/get?id=` + item})
console.log(res)
for (const item of res) {
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['itemCode'] = item.id;
newItem['itemName'] = item.name;
newItem['equipmentParts'] = item.equipmentParts;
newItem['isSelectd'] = true;
inspectionItemData.value.push(newItem);
}
@ -285,7 +280,7 @@ const open = async (type: string, row?: object) => {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-inspection-option-item/getList?optionCode=` + row.code})
let res = await inspectionItemItemSelectSetApi.getRalInspectionOptionItemList(row.code)
try {
inspectionItemData.value = [];
formLoading.value = true;
@ -320,7 +315,6 @@ const submitForm = async () => {
message.warning('巡检项最多10个');
return
}
// ID
formData.value.selectId = tags.value[0].selectId
//

31
src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue

@ -65,10 +65,9 @@
</el-col>
</el-row>
</el-form>
<el-table :data="maintenanceItemData" style="width: 100%; height: 80%">
<el-table :data="maintenanceItemData" style="width: 100%; height: 200px">
<el-table-column prop="itemCode" label="保养项ID" />
<el-table-column prop="itemName" label="保养名称" />
<!-- <el-table-column prop="equipmentParts" label="保养部位" />-->
<el-table-column prop="isSelectd" label="" width="150" >
<template #header>
<span>是否必选默认是</span>
@ -101,6 +100,11 @@ import { SearchTable } from '@/components/SearchTable'
import { BasicMaintenanceItemSelectSet} from "@/views/eam/maintenanceItemSelectSet/maintenanceItemSelectSet.data";
import * as maintenanceItemSelectSetApi from "@/api/eam/maintenanceItemSelectSet";
import {ElInput} from "element-plus";
import {ref} from "vue";
import {
getMaintenanceItemSelectSetList,
getRalMaintenanceOptionItemList
} from "@/api/eam/maintenanceItemSelectSet";
defineOptions({ name: 'TeamForm' })
@ -119,6 +123,7 @@ const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const maintenanceItemData = ref([])
const itemsId = ref('')
const itemData = ref({
id: '',
@ -159,8 +164,6 @@ const basicFormRef = ref() // 表单 Ref
/** 删除巡检项 */
const handleClose = (id: string) => {
console.log(id)
console.log(tags)
const index = tags.value.findIndex(tag => tag.selectId === id);
if (index !== -1) {
tags.value.splice(index, 1);
@ -209,7 +212,6 @@ const addItemCommon = (multiple,field) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick?.(async () => {
if (formField === 'baoYangItem') {
let itemsId = '';
//ID
val.forEach(item => {
const isExist = tags.value.some(tag => tag.id === item.id);
@ -220,18 +222,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
itemsId.value = item.itemCode;
});
maintenanceItemData.value = []
let query = {
itemsId: itemsId.value
}
let res = await maintenanceItemSelectSetApi.getMaintenanceItemSelectSetList(query);
//
try {
formLoading.value = true;
maintenanceItemData.value = [];
for (const item of itemsId.split(",")) {
let res = await request.get({url: `/eam/basic/maintenance-item/get?id=` + item})
for (const item of res) {
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['itemCode'] = item.id;
newItem['itemName'] = item.name;
newItem['equipmentParts'] = item.equipmentParts;
newItem['isSelectd'] = true;
maintenanceItemData.value.push(newItem);
}
@ -277,7 +282,7 @@ const open = async (type: string, row?: object) => {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-maintenance-option-item/getList?optionCode=` + row.code})
let res = await maintenanceItemSelectSetApi.getRalMaintenanceOptionItemList(row.code);
try {
maintenanceItemData.value = [];
formLoading.value = true;

27
src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue

@ -65,7 +65,7 @@
</el-col>
</el-row>
</el-form>
<el-table :data="spotCheckItemData" style="width: 100%; height: 80%">
<el-table :data="spotCheckItemData" style="width: 100%; height: 200px">
<el-table-column prop="itemCode" label="点检项ID" />
<el-table-column prop="itemName" label="点检名称" />
<el-table-column prop="isSelectd" label="" width="150" >
@ -100,6 +100,11 @@ import { BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheck
import * as SpotCheckSelectSetApi from "@/api/eam/spotCheckSelectSet";
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import {ElInput} from "element-plus";
import {
getRalSpotCheckOptionItemList,
getSpotCheckSelectSetList
} from "@/api/eam/spotCheckSelectSet";
import {ref} from "vue";
defineOptions({ name: 'TeamForm' })
@ -119,6 +124,7 @@ const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const spotCheckItemData = ref([])
const itemsId = ref('')
const itemData = ref({
id: '',
@ -209,7 +215,6 @@ const addItemCommon = (multiple,field) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick?.(async () => {
if (formField === 'dianJianItem') {
let itemsId = '';
//ID
val.forEach(item => {
const isExist = tags.value.some(tag => tag.id === item.id);
@ -220,18 +225,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
itemsId.value = item.itemCode;
});
spotCheckItemData.value = [];
let query = {
itemsId: itemsId.value
}
let res = await SpotCheckSelectSetApi.getSpotCheckSelectSetList(query);
//
try {
formLoading.value = true;
spotCheckItemData.value = [];
for (const item of itemsId.split(",")) {
let res = await request.get({url: `/eam/basic/spot-check-item/get?id=` + item})
for (const item of res) {
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['itemCode'] = item.id;
newItem['itemName'] = item.name;
newItem['equipmentParts'] = item.equipmentParts;
newItem['isSelectd'] = true;
spotCheckItemData.value.push(newItem);
}
@ -277,7 +286,7 @@ const open = async (type: string, row?: object) => {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-spotCheck-option-item/getList?optionCode=` + row.code})
let res = await SpotCheckSelectSetApi.getRalSpotCheckOptionItemList(row.code);
try {
spotCheckItemData.value = [];
formLoading.value = true;

54
src/views/eam/classTypeRole/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -69,6 +69,7 @@ import * as roleApi from '@/api/system/role'
import { Role } from '@/views/system/role/role.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as InspectionItemSelectSetApi from "@/api/eam/inspectionItemSelectSet";
defineOptions({ name: 'ClassTypeRole' })
@ -144,11 +145,23 @@ const buttonBaseClick = (val, item) => {
}
}
const isShowMainButton = (row,val) => {
if (val.indexOf(row.available) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:class-type-role:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:class-type-role:delete'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:class-type-role:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:class-type-role:update'}),
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:inspection-item:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
@ -156,6 +169,10 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
}
}
@ -215,6 +232,37 @@ const handleDelete = async (id: number) => {
} catch {}
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await ClassTypeRoleApi.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 ClassTypeRoleApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

2
src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts

@ -17,7 +17,7 @@ export const EquipmentManufacturerRules = reactive({
export const EquipmentManufacturer = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备厂商编号',
label: '生产商编号',
field: 'number',
sort: 'custom',
isSearch: true,

21
src/views/eam/inspectionItem/inspectionItem.data.ts

@ -11,17 +11,28 @@ deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
export const InspectionItemRules = reactive({
content: [required],
serialNumber: [required],
concurrencyStamp: [required],
type: [required],
name: [required],
})
export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '序号',
field: 'serialNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left',
form: {
component:'InputNumber'
@ -72,10 +83,10 @@ export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
isSearch: false,
isTableForm: false,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表

2
src/views/eam/item/index.vue

@ -174,7 +174,7 @@ const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'basic:item:update' }), //
// defaultButtons.chooseDeviceBtn({ hasPermi: 'basic:item:choose' }), //
defaultButtons.selectQrCodeBtn(null), //
//defaultButtons.selectQrCodeBtn(null), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'basic:item:delete' }), //
defaultButtons.viewBtn({ hide: !(row.filePathList != null && row.filePathList.length != 0) })
]

17
src/views/eam/maintenanceItem/maintenanceItem.data.ts

@ -10,16 +10,28 @@ deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
export const MaintenanceItemRules = reactive({
content: [required],
serialNumber: [required],
concurrencyStamp: [required]
name: [required],
})
export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '序号',
field: 'serialNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left',
form: {
component:'InputNumber'
@ -61,6 +73,7 @@ export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false,
isSearch: false,
isTableForm: false,
isForm: false,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表

6
src/views/eam/maintenanceItemSelectSet/itemSelectSetForm.vue

@ -25,7 +25,7 @@
<el-form-item label="保养项" prop="items">
<div class="tag-container flex gap-2">
<el-tag v-for="ent in tags" :key="ent.content" closable :disable-transitions="false" @close="handleClose(ent.id)">
{{ ent.content}}
{{ ent.name}}
</el-tag>
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"/>
<el-button v-else class="button-new-tag" size="small" @click="addItem">
@ -145,10 +145,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick?.(() => {
if (formField === 'baoYangItem') {
val.forEach(item => {
const isExist = tags.value.some(tag => tag.content === item.content);
const isExist = tags.value.some(tag => tag.name === item.name);
if (!isExist){
const newItem = {};
newItem['content'] = item.content;
newItem['name'] = item.name;
newItem['id'] = item.id;
tags.value.push(newItem);
}

21
src/views/eam/spotCheckItem/spotCheckItem.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { handleTreeToComponentOptions } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept'
const deptList = ref<Tree[]>([]) // 树形结构
@ -11,16 +10,28 @@ deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
export const SpotCheckItemRules = reactive({
content: [required],
serialNumber: [required],
concurrencyStamp: [required],
type: [required],
name: [required],
})
export const SpotCheckItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '序号',
field: 'serialNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left',
form: {
component:'InputNumber'
@ -65,10 +76,10 @@ export const SpotCheckItem = useCrudSchemas(reactive<CrudSchema[]>([
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
isSearch: false,
isTableForm: false,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表

Loading…
Cancel
Save