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. 38
      src/views/eam/basicInspectionOption/itemSelectSetForm.vue
  6. 31
      src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue
  7. 27
      src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue
  8. 58
      src/views/eam/classTypeRole/index.vue
  9. 2
      src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts
  10. 23
      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. 23
      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 = () => { export const importTemplate = () => {
return request.download({ url: '/eam/basic/class-type-role/get-import-template' }) 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) => { export const updateEnableCode = async (data: InspectionItemSelectSetVO) => {
return await request.post({ url: `/eam/basic/inspection-item-select-set/ables` , data }) 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) => { 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) => { export const updateEnableCode = async (data: BasicSpotCheckSelectSetVO) => {
return await request.post({ url: `/eam/basic/spot-check-select-set/ables` , data }) 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})
}

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

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

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

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

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

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

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

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -69,6 +69,7 @@ import * as roleApi from '@/api/system/role'
import { Role } from '@/views/system/role/role.data' import { Role } from '@/views/system/role/role.data'
import * as WorkshopApi from '@/api/wms/workshop' import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as InspectionItemSelectSetApi from "@/api/eam/inspectionItemSelectSet";
defineOptions({ name: 'ClassTypeRole' }) 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) => {
defaultButtons.mainListEditBtn({hasPermi:'eam:class-type-role:update'}), // return [
defaultButtons.mainListDeleteBtn({hasPermi:'eam:class-type-role:delete'}), // defaultButtons.mainListEditBtn({hasPermi:'eam:class-type-role:update'}), //
] 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) => { const buttonTableClick = async (val, row) => {
@ -156,6 +169,10 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) 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 {} } 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 exportLoading = ref(false) //
const handleExport = async () => { 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[]>([ export const EquipmentManufacturer = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '设备厂商编号', label: '生产商编号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,

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

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

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

@ -174,7 +174,7 @@ const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hasPermi: 'basic:item:update' }), // defaultButtons.mainListEditBtn({ hasPermi: 'basic:item:update' }), //
// defaultButtons.chooseDeviceBtn({ hasPermi: 'basic:item:choose' }), // // defaultButtons.chooseDeviceBtn({ hasPermi: 'basic:item:choose' }), //
defaultButtons.selectQrCodeBtn(null), // //defaultButtons.selectQrCodeBtn(null), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'basic:item:delete' }), // defaultButtons.mainListDeleteBtn({ hasPermi: 'basic:item:delete' }), //
defaultButtons.viewBtn({ hide: !(row.filePathList != null && row.filePathList.length != 0) }) 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({ export const MaintenanceItemRules = reactive({
content: [required], content: [required],
serialNumber: [required], serialNumber: [required],
concurrencyStamp: [required] name: [required],
}) })
export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([ export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{ {
label: '序号', label: '序号',
field: 'serialNumber', field: 'serialNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
fixed: 'left', fixed: 'left',
form: { form: {
component:'InputNumber' component:'InputNumber'
@ -61,6 +73,7 @@ export const MaintenanceItem = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false, isDetail: false,
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
isForm: false,
form: { form: {
component: 'TreeSelect', component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表 componentProps: { // 假设deptList是部门数据列表

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

@ -25,7 +25,7 @@
<el-form-item label="保养项" prop="items"> <el-form-item label="保养项" prop="items">
<div class="tag-container flex gap-2"> <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)"> <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-tag>
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"/> <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"> <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?.(() => { nextTick?.(() => {
if (formField === 'baoYangItem') { if (formField === 'baoYangItem') {
val.forEach(item => { 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){ if (!isExist){
const newItem = {}; const newItem = {};
newItem['content'] = item.content; newItem['name'] = item.name;
newItem['id'] = item.id; newItem['id'] = item.id;
tags.value.push(newItem); tags.value.push(newItem);
} }

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

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

Loading…
Cancel
Save