Browse Source

SBBJ-814巡检点检项配置

master
zhaoyiran 2 months ago
parent
commit
731e084b1c
  1. 69
      src/api/eam/basic/deviceInspectionConfig/index.ts
  2. 1
      src/api/eam/basic/deviceMaintenance/index.ts
  3. 69
      src/api/eam/basic/moldInspectionConfig/index.ts
  4. 396
      src/views/eam/basic/deviceInspectionConfig/deviceInspectionConfig.data.ts
  5. 407
      src/views/eam/basic/deviceInspectionConfig/index.vue
  6. 28
      src/views/eam/basic/deviceMaintenanceConfig/index.vue
  7. 70
      src/views/eam/basic/inspection/inspection.data.ts
  8. 407
      src/views/eam/basic/moldInspectionConfig/index.vue
  9. 396
      src/views/eam/basic/moldInspectionConfig/moldInspectionConfig.data.ts
  10. 145
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts
  11. 54
      src/views/eam/basic/moldMaintenanceConfig/index.vue

69
src/api/eam/basic/deviceInspectionConfig/index.ts

@ -0,0 +1,69 @@
import request from '@/config/axios'
export interface MoldMaintenanceConfigVO {
deviceNumber: string
maintenanceItemId: string
masterId: string
detailId: string
}
// 查询设备模具保养项配置列表
export const getMoldMaintenanceConfigPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-mold-maintenance-config/senior', data })
} else {
return await request.get({ url: `/eam/device-mold-maintenance-config/page`, params })
}
}
// 查询设备模具保养项配置详情
export const getMoldMaintenanceConfig = async (id: number) => {
return await request.get({ url: `/eam/device-mold-maintenance-config/get?id=` + id })
}
// 新增设备模具保养项配置
export const createMoldMaintenanceConfig = async (data: MoldMaintenanceConfigVO) => {
return await request.post({ url: `/eam/device-mold-maintenance-config/create`, data })
}
// 修改设备模具保养项配置
export const updateMoldMaintenanceConfig = async (data: MoldMaintenanceConfigVO) => {
return await request.put({ url: `/eam/device-mold-maintenance-config/update`, data })
}
// 删除设备模具保养项配置
export const deleteMoldMaintenanceConfig = async (id: number) => {
return await request.delete({ url: `/eam/device-mold-maintenance-config/delete?id=` + id })
}
// 导出设备模具保养项配置 Excel
export const exportMoldMaintenanceConfig = async (params) => {
return await request.download({ url: `/eam/device-mold-maintenance-config/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-mold-maintenance-config/get-import-template' })
}
export const getDeviceMoldItemsPage = async (params) => {
params.type="DEVICE"
params.status = "INSPECTION"
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-mold-maintenance-config/senior', data })
} else {
return await request.get({ url: `/eam/device-mold-maintenance-config/pageDetail`, params })
}
}
export const addMaintenanceItem = async (data: MoldMaintenanceConfigVO) => {
return await request.post({ url: `/eam/device-mold-maintenance-config/addMaintenanceItem`, data })
}
export const delMaintenanceItem = async (data: MoldMaintenanceConfigVO) => {
return await request.post({ url: `/eam/device-mold-maintenance-config/delMaintenanceItem`, data })
}

1
src/api/eam/basic/deviceMaintenance/index.ts

@ -23,7 +23,6 @@ export const getDeviceMoldItemsPage = async (params) => {
} }
} }
// 查询项记录表(设备 模具 保养 维修 巡检点检)详情 // 查询项记录表(设备 模具 保养 维修 巡检点检)详情
export const getDeviceMoldItems = async (id: number) => { export const getDeviceMoldItems = async (id: number) => {
return await request.get({ url: `/eam/device-mold-items/get?id=` + id }) return await request.get({ url: `/eam/device-mold-items/get?id=` + id })

69
src/api/eam/basic/moldInspectionConfig/index.ts

@ -0,0 +1,69 @@
import request from '@/config/axios'
export interface MoldMaintenanceConfigVO {
deviceNumber: string
maintenanceItemId: string
masterId: string
detailId: string
}
// 查询设备模具保养项配置列表
export const getMoldMaintenanceConfigPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-mold-maintenance-config/senior', data })
} else {
return await request.get({ url: `/eam/device-mold-maintenance-config/page`, params })
}
}
// 查询设备模具保养项配置详情
export const getMoldMaintenanceConfig = async (id: number) => {
return await request.get({ url: `/eam/device-mold-maintenance-config/get?id=` + id })
}
// 新增设备模具保养项配置
export const createMoldMaintenanceConfig = async (data: MoldMaintenanceConfigVO) => {
return await request.post({ url: `/eam/device-mold-maintenance-config/create`, data })
}
// 修改设备模具保养项配置
export const updateMoldMaintenanceConfig = async (data: MoldMaintenanceConfigVO) => {
return await request.put({ url: `/eam/device-mold-maintenance-config/update`, data })
}
// 删除设备模具保养项配置
export const deleteMoldMaintenanceConfig = async (id: number) => {
return await request.delete({ url: `/eam/device-mold-maintenance-config/delete?id=` + id })
}
// 导出设备模具保养项配置 Excel
export const exportMoldMaintenanceConfig = async (params) => {
return await request.download({ url: `/eam/device-mold-maintenance-config/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-mold-maintenance-config/get-import-template' })
}
export const getDeviceMoldItemsPage = 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-maintenance-config/senior', data })
} else {
return await request.get({ url: `/eam/device-mold-maintenance-config/pageDetail`, params })
}
}
export const addMaintenanceItem = async (data: MoldMaintenanceConfigVO) => {
return await request.post({ url: `/eam/device-mold-maintenance-config/addMaintenanceItem`, data })
}
export const delMaintenanceItem = async (data: MoldMaintenanceConfigVO) => {
return await request.post({ url: `/eam/device-mold-maintenance-config/delMaintenanceItem`, data })
}

396
src/views/eam/basic/deviceInspectionConfig/deviceInspectionConfig.data.ts

@ -0,0 +1,396 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DeviceMoldItemsApi from '@/api/eam/basic/inspection'
import {DeviceMoldItems} from '@/views/eam/basic/inspection/inspection.data'
// 表单校验
export const DeviceInspectionConfigRules = reactive({
deviceNumber: [required],
})
const trueOrFalse = [
{
label: '是',
value: true
},
{
label: '否',
value: false
}
]
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
]))
export const DeviceInspection = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
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: "DEVICE",
isMainValue: false
}
]
}
}
},
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
},
{
label: '类型',
field: 'type',
isTable: false,
isForm: false,
isSearch: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const DeviceInspectionTwo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '巡检点检项',
field: 'name',
sort: 'custom',
isSearch: true,
// form: {
// componentProps: {
// type: 'textarea',
// }
// },
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
type: 'textarea',
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择设备保养项', // 输入框占位文本
searchField: 'name', // 查询弹窗赋值字段
searchTitle: '设备巡检点检项信息', // 查询弹窗标题
searchAllSchemas: DeviceMoldItems.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "DEVICE",
isMainValue: false
}
]
}
},
tableForm: {
multiple: true,
isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择设备保养项',
searchField: 'name',
searchTitle: '设备巡检点检项信息',
searchAllSchemas: DeviceMoldItems.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "DEVICE",
isMainValue: false
}
]
},
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
value: 'DEVICE',
componentProps: {
disabled: true,
}
}
},
{
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: 'numberNeedSwitch',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
{
label: '是否点检',
field: 'needInspection',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// export const DeviceInspectionTwo = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '保养内容12',
// field: 'name',
// sort: 'custom',
// isSearch: true,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择设备保养项', // 输入框占位文本
// searchField: 'name', // 查询弹窗赋值字段
// searchTitle: '设备保养项信息', // 查询弹窗标题
// searchAllSchemas: DeviceInspection.allSchemas, // 查询弹窗所需类
// searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }, {
// key: 'type',
// value: "DEVICE",
// isMainValue: false
// }
// ]
// }
// },
// tableForm: {
// multiple: true,
// isInpuFocusShow: false, // 开启查询弹窗
// disabled:true,
// searchListPlaceholder: '请选择设备保养项',
// searchField: 'name',
// searchTitle: '设备保养项信息',
// searchAllSchemas: DeviceInspection.allSchemas, // 查询弹窗所需类
// searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }, {
// key: 'type',
// value: "DEVICE",
// isMainValue: false
// }
// ]
// },
// },
// {
// label: '类型',
// field: 'type',
// dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
// dictClass: 'string',
// sort: 'custom',
// isSearch: false,
// form: {
// value: 'DEVICE',
// componentProps: {
// disabled: true,
// }
// },
// tableForm: {
// type:'Select',
// disabled: true,
// }
// },
// {
// label: '设备保养部位',
// field: 'equipmentParts',
// sort: 'custom',
// isSearch: true,
// tableForm: {
// disabled: true,
// }
// },
// {
// label: '项类型',
// field: 'status',
// dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
// dictClass: 'string',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'Select',
// value: 'MAINTAIN',
// componentProps: {
// disabled: true
// }
// },
// tableForm: {
// type: 'Select',
// disabled: true,
// }
// },
// {
// label: '人数',
// field: 'peoples',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150,
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// max: 100,
// precision: 0
// }
// },
// tableForm: {
// disabled: true,
// }
// },
// {
// label: '保养所需时间(分钟)',
// field: 'estimatedMinutes',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 200,
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 0
// }
// },
// tableForm: {
// disabled: true,
// }
// },
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
// ]))

407
src/views/eam/basic/deviceInspectionConfig/index.vue

@ -0,0 +1,407 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceInspection.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceInspection.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 #deviceNumber="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.deviceNumber)">
<span>{{ row.deviceNumber }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="name"
@success="getList"
:rules="DeviceInspectionConfigRules"
:formAllSchemas="DeviceInspection.allSchemas"
:tableAllSchemas="DeviceInspectionTwo.allSchemas"
:tableFormRules="DeviceInspectionConfigRules"
:tableData="tableData"
:apiUpdate="DeviceInspectionConfigApi.updateMoldMaintenanceConfig"
:apiCreate="DeviceInspectionConfigApi.createMoldMaintenanceConfig"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="DeviceInspection.allSchemas"
:detailAllSchemas="DeviceInspectionTwo.allSchemas"
:apiCreate="DeviceInspectionApi.createDeviceMoldItems"
:apiUpdate="DeviceInspectionApi.updateDeviceMoldItems"
:apiPage="DeviceInspectionConfigApi.getDeviceMoldItemsPage"
:apiDelete="DeviceInspectionApi.deleteDeviceMoldItems"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isNewFuction='true'
@openFormNewFuction="openFormNewFuction"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="true"
:isNewDetele="true"
@deteleNewFuction="deteleNewFuction"
/>
<!-- 详情 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/device/mold-maintenance-config/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceInspection, DeviceInspectionTwo, DeviceInspectionConfigRules } from './deviceInspectionConfig.data'
import * as DeviceInspectionConfigApi from '@/api/eam/basic/deviceInspectionConfig'
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 { SearchTable } from '@/components/SearchTable'
// import {DeviceMaintenance, DeviceMaintenanceTwo,DeviceMaintenanceRules} from '@/views/eam/basic/deviceInspectionConfig/deviceInspectionConfig.data'
import * as DeviceInspectionApi from '@/api/eam/basic/inspection'
// import { DeviceAccounts } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
// import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import {DeviceMoldItems} from '@/views/eam/basic/inspection/inspection.data'
defineOptions({ name: 'deviceInspectionConfig' })
/**
* tableForm方法
*/
const tableFormKeys = {}
DeviceInspection.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
let itemIndex = tableData.value.indexOf(item)
if(itemIndex>-1){
tableData.value.splice(itemIndex, 1)
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceInspection.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
if (formField == 'name') {
val = val.filter(item => !tableData.value.find(item1 => item1['id'] == item['id']))
if (val.length == 0) return
val.forEach(item => {
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...item }))
tableData.value.push(newRow)
})
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'deviceNumber') {
setV['deviceName'] = val[0].name
}
formRef.setValues(setV)
}
})
}
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
data.type = 'DEVICE'
data.status = 'INSPECTION'
formRef.value.formLoading = true
try {
if (formType === 'create') {
data.subList = tableData.value //
data.maintenanceItemId = data.subList.map(item=>item.id).join(',')
console.log(data)
await DeviceInspectionConfigApi.createMoldMaintenanceConfig(data)
message.success(t('common.createSuccess'))
} else {
console.log('data',data);
await DeviceInspectionConfigApi.updateMoldMaintenanceConfig(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
}
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'fromPackingNumber') {
setV['fromPackingNumber'] = val[0]['packingNumber']
setV['itemCode'] = val[0]['itemCode']
setV['fromBatch'] = val[0]['batch']
setV['toBatch'] = val[0]['batch']
setV['locationCode'] = val[0]['locationCode']
setV['fromQty'] = val[0]['qty']
setV['fromInventoryStatus'] = val[0]['inventoryStatus']
setV['uom'] = val[0]['uom']
} else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DeviceInspectionConfigApi.getMoldMaintenanceConfigPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldMaintenanceConfig:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldMaintenanceConfig: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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const masterId = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
masterId.value = row.id
detailRef.value.openDetail(row, titleName, titleValue, 'basicMoldMaintenanceConfig')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceInspectionConfigApi.deleteMoldMaintenanceConfig(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 DeviceInspectionConfigApi.exportMoldMaintenanceConfig(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() //
}
const searchTableRef = ref()
const openFormNewFuction = ()=>{
searchTableRef.value.open(
'选择设备巡检点检项',
DeviceMoldItems.allSchemas,
DeviceInspectionApi.getDeviceMoldItemsPage,
null,
DeviceMoldItems.allSchemas.searchSchema,
true,
null,
null,
null,
null,
null
// searchTableSelections.value
)
}
const submitItem = async (formType, data, val, tableList) => {
console.log('formType',formType)
console.log('data',data)
console.log('val',val)
console.log('tableList',tableList)
let maintenanceItemId = val.map(item=>item.id).join(',')
let data1 = {
maintenanceItemId : maintenanceItemId,
masterId : masterId.value
}
await DeviceInspectionConfigApi.addMaintenanceItem(data1)
message.success(t('common.createSuccess'))
await detailRef.value.getList()
searchTableRef.value.searchDialogVisible=false
}
const deteleNewFuction =async (row)=>{
console.log('row',row)
try {
//
await message.delConfirm()
//
let data1 = {
detailId : row.id,
masterId : masterId.value
}
await DeviceInspectionConfigApi.delMaintenanceItem(data1)
message.success(t('common.delSuccess'))
//
await detailRef.value.getList()
} catch {}
}
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
available: 'TRUE',
type: 'DEVICE',
status: 'INSPECTION'
}
getList()
importTemplateData.templateUrl = await DeviceInspectionConfigApi.importTemplate()
})
</script>
./deviceInspectionConfig.data

28
src/views/eam/basic/deviceMaintenanceConfig/index.vue

@ -167,6 +167,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const submitForm = async (formType, submitData) => { const submitForm = async (formType, submitData) => {
let data = {...submitData} let data = {...submitData}
data.type = 'DEVICE' data.type = 'DEVICE'
data.status = 'MAINTAIN'
formRef.value.formLoading = true formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {
@ -280,30 +281,6 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row) formRef.value.open(type, row)
} }
// // form
// const formsSuccess = async (formType,data) => {
// var isHave =MoldMaintenanceConfig.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;
// data.type = 'DEVICE'
// if (formType === 'create') {
// await MoldMaintenanceConfigApi.createMoldMaintenanceConfig(data)
// message.success(t('common.createSuccess'))
// } else {
// await MoldMaintenanceConfigApi.updateMoldMaintenanceConfig(data)
// message.success(t('common.updateSuccess'))
// }
// basicFormRef.value.dialogVisible = false
// getList()
// }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
@ -419,7 +396,8 @@ const deteleNewFuction =async (row)=>{
onMounted(async () => { onMounted(async () => {
tableObject.params = { tableObject.params = {
available: 'TRUE', available: 'TRUE',
type: 'DEVICE' type: 'DEVICE',
status: 'MAINTAIN'
} }
getList() getList()
importTemplateData.templateUrl = await MoldMaintenanceConfigApi.importTemplate() importTemplateData.templateUrl = await MoldMaintenanceConfigApi.importTemplate()

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

@ -72,41 +72,41 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{ // {
label: '设备编号', // label: '设备编号',
field: 'deviceNumber', // field: 'deviceNumber',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
isSearchList: true, // 开启查询弹窗 // isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择单号', // 输入框占位文本 // searchListPlaceholder: '请选择单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 // searchField: 'number', // 查询弹窗赋值字段
searchTitle: '单号信息', // 查询弹窗标题 // searchTitle: '单号信息', // 查询弹窗标题
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 // searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 // searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [ // searchCondition: [
{ // {
key: 'available', // key: 'available',
value: "TRUE", // value: "TRUE",
isMainValue: false // isMainValue: false
}, { // }, {
key: 'type', // key: 'type',
value: 'type', // value: 'type',
isMainValue: true // isMainValue: true
} // }
] // ]
} // }
} // }
}, // },
{ // {
label: '设备名称', // label: '设备名称',
field: 'deviceName', // field: 'deviceName',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
isForm: false, // isForm: false,
}, // },
{ {
label: '项类型', label: '项类型',
field: 'status', field: 'status',

407
src/views/eam/basic/moldInspectionConfig/index.vue

@ -0,0 +1,407 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceInspection.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceInspection.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 #deviceNumber="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.deviceNumber)">
<span>{{ row.deviceNumber }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="name"
@success="getList"
:rules="DeviceInspectionConfigRules"
:formAllSchemas="DeviceInspection.allSchemas"
:tableAllSchemas="DeviceInspectionTwo.allSchemas"
:tableFormRules="DeviceInspectionConfigRules"
:tableData="tableData"
:apiUpdate="DeviceInspectionConfigApi.updateMoldMaintenanceConfig"
:apiCreate="DeviceInspectionConfigApi.createMoldMaintenanceConfig"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="DeviceInspection.allSchemas"
:detailAllSchemas="DeviceInspectionTwo.allSchemas"
:apiCreate="DeviceInspectionApi.createDeviceMoldItems"
:apiUpdate="DeviceInspectionApi.updateDeviceMoldItems"
:apiPage="DeviceInspectionConfigApi.getDeviceMoldItemsPage"
:apiDelete="DeviceInspectionApi.deleteDeviceMoldItems"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isNewFuction='true'
@openFormNewFuction="openFormNewFuction"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="true"
:isNewDetele="true"
@deteleNewFuction="deteleNewFuction"
/>
<!-- 详情 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/device/mold-maintenance-config/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceInspection, DeviceInspectionTwo, DeviceInspectionConfigRules } from './moldInspectionConfig.data'
import * as DeviceInspectionConfigApi from '@/api/eam/basic/moldInspectionConfig'
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 { SearchTable } from '@/components/SearchTable'
// import {DeviceMaintenance, DeviceMaintenanceTwo,DeviceMaintenanceRules} from '@/views/eam/basic/deviceInspectionConfig/deviceInspectionConfig.data'
import * as DeviceInspectionApi from '@/api/eam/basic/inspection'
// import { DeviceAccounts } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
// import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import {DeviceMoldItems} from '@/views/eam/basic/inspection/inspection.data'
defineOptions({ name: 'moldInspectionConfig' })
/**
* tableForm方法
*/
const tableFormKeys = {}
DeviceInspection.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
let itemIndex = tableData.value.indexOf(item)
if(itemIndex>-1){
tableData.value.splice(itemIndex, 1)
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceInspection.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
if (formField == 'name') {
val = val.filter(item => !tableData.value.find(item1 => item1['id'] == item['id']))
if (val.length == 0) return
val.forEach(item => {
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...item }))
tableData.value.push(newRow)
})
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'deviceNumber') {
setV['deviceName'] = val[0].name
}
formRef.setValues(setV)
}
})
}
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
data.type = 'MOLD'
data.status = 'INSPECTION'
formRef.value.formLoading = true
try {
if (formType === 'create') {
data.subList = tableData.value //
data.maintenanceItemId = data.subList.map(item=>item.id).join(',')
console.log(data)
await DeviceInspectionConfigApi.createMoldMaintenanceConfig(data)
message.success(t('common.createSuccess'))
} else {
console.log('data',data);
await DeviceInspectionConfigApi.updateMoldMaintenanceConfig(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
}
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'fromPackingNumber') {
setV['fromPackingNumber'] = val[0]['packingNumber']
setV['itemCode'] = val[0]['itemCode']
setV['fromBatch'] = val[0]['batch']
setV['toBatch'] = val[0]['batch']
setV['locationCode'] = val[0]['locationCode']
setV['fromQty'] = val[0]['qty']
setV['fromInventoryStatus'] = val[0]['inventoryStatus']
setV['uom'] = val[0]['uom']
} else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DeviceInspectionConfigApi.getMoldMaintenanceConfigPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:moldMaintenanceConfig:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:moldMaintenanceConfig: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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const masterId = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
masterId.value = row.id
detailRef.value.openDetail(row, titleName, titleValue, 'basicMoldMaintenanceConfig')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceInspectionConfigApi.deleteMoldMaintenanceConfig(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 DeviceInspectionConfigApi.exportMoldMaintenanceConfig(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() //
}
const searchTableRef = ref()
const openFormNewFuction = ()=>{
searchTableRef.value.open(
'选择模具巡检点检项',
DeviceMoldItems.allSchemas,
DeviceInspectionApi.getMoldItemsPage,
null,
DeviceMoldItems.allSchemas.searchSchema,
true,
null,
null,
null,
null,
null
// searchTableSelections.value
)
}
const submitItem = async (formType, data, val, tableList) => {
console.log('formType',formType)
console.log('data',data)
console.log('val',val)
console.log('tableList',tableList)
let maintenanceItemId = val.map(item=>item.id).join(',')
let data1 = {
maintenanceItemId : maintenanceItemId,
masterId : masterId.value
}
await DeviceInspectionConfigApi.addMaintenanceItem(data1)
message.success(t('common.createSuccess'))
await detailRef.value.getList()
searchTableRef.value.searchDialogVisible=false
}
const deteleNewFuction =async (row)=>{
console.log('row',row)
try {
//
await message.delConfirm()
//
let data1 = {
detailId : row.id,
masterId : masterId.value
}
await DeviceInspectionConfigApi.delMaintenanceItem(data1)
message.success(t('common.delSuccess'))
//
await detailRef.value.getList()
} catch {}
}
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
available: 'TRUE',
type: 'MOLD',
status: 'INSPECTION'
}
getList()
importTemplateData.templateUrl = await DeviceInspectionConfigApi.importTemplate()
})
</script>
./deviceInspectionConfig.data./moldInspectionConfig.data

396
src/views/eam/basic/moldInspectionConfig/moldInspectionConfig.data.ts

@ -0,0 +1,396 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DeviceMoldItemsApi from '@/api/eam/basic/inspection'
import {DeviceMoldItems} from '@/views/eam/basic/inspection/inspection.data'
// 表单校验
export const DeviceInspectionConfigRules = reactive({
deviceNumber: [required],
})
const trueOrFalse = [
{
label: '是',
value: true
},
{
label: '否',
value: false
}
]
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
]))
export const DeviceInspection = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
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: "MOLD",
isMainValue: false
}
]
}
}
},
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
},
},
{
label: '类型',
field: 'type',
isTable: false,
isForm: false,
isSearch: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const DeviceInspectionTwo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '巡检点检项',
field: 'name',
sort: 'custom',
isSearch: true,
// form: {
// componentProps: {
// type: 'textarea',
// }
// },
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
type: 'textarea',
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择模具保养项', // 输入框占位文本
searchField: 'name', // 查询弹窗赋值字段
searchTitle: '模具巡检点检项信息', // 查询弹窗标题
searchAllSchemas: DeviceMoldItems.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getMoldItemsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "MOLD",
isMainValue: false
}
]
}
},
tableForm: {
multiple: true,
isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择模具保养项',
searchField: 'name',
searchTitle: '模具巡检点检项信息',
searchAllSchemas: DeviceMoldItems.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getMoldItemsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "MOLD",
isMainValue: false
}
]
},
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
value: 'MOLD',
componentProps: {
disabled: true,
}
}
},
{
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: 'numberNeedSwitch',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
{
label: '是否点检',
field: 'needInspection',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// export const DeviceInspectionTwo = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '保养内容12',
// field: 'name',
// sort: 'custom',
// isSearch: true,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择设备保养项', // 输入框占位文本
// searchField: 'name', // 查询弹窗赋值字段
// searchTitle: '设备保养项信息', // 查询弹窗标题
// searchAllSchemas: DeviceInspection.allSchemas, // 查询弹窗所需类
// searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }, {
// key: 'type',
// value: "MOLD",
// isMainValue: false
// }
// ]
// }
// },
// tableForm: {
// multiple: true,
// isInpuFocusShow: false, // 开启查询弹窗
// disabled:true,
// searchListPlaceholder: '请选择设备保养项',
// searchField: 'name',
// searchTitle: '设备保养项信息',
// searchAllSchemas: DeviceInspection.allSchemas, // 查询弹窗所需类
// searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }, {
// key: 'type',
// value: "MOLD",
// isMainValue: false
// }
// ]
// },
// },
// {
// label: '类型',
// field: 'type',
// dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
// dictClass: 'string',
// sort: 'custom',
// isSearch: false,
// form: {
// value: 'MOLD',
// componentProps: {
// disabled: true,
// }
// },
// tableForm: {
// type:'Select',
// disabled: true,
// }
// },
// {
// label: '设备保养部位',
// field: 'equipmentParts',
// sort: 'custom',
// isSearch: true,
// tableForm: {
// disabled: true,
// }
// },
// {
// label: '项类型',
// field: 'status',
// dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
// dictClass: 'string',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'Select',
// value: 'MAINTAIN',
// componentProps: {
// disabled: true
// }
// },
// tableForm: {
// type: 'Select',
// disabled: true,
// }
// },
// {
// label: '人数',
// field: 'peoples',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150,
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// max: 100,
// precision: 0
// }
// },
// tableForm: {
// disabled: true,
// }
// },
// {
// label: '保养所需时间(分钟)',
// field: 'estimatedMinutes',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 200,
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 0
// }
// },
// tableForm: {
// disabled: true,
// }
// },
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
// ]))

145
src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

@ -229,3 +229,148 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))
export const MoldMaintenanceTwo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '保养内容',
field: 'name',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择模具保养项', // 输入框占位文本
searchField: 'name', // 查询弹窗赋值字段
searchTitle: '模具保养项信息', // 查询弹窗标题
searchAllSchemas: MoldMaintenance.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "MOLD",
isMainValue: false
}
]
}
},
tableForm: {
multiple: true,
isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择设备保养项',
searchField: 'name',
searchTitle: '模具保养项信息',
searchAllSchemas: MoldMaintenance.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getDeviceMoldItemsPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "MOLD",
isMainValue: false
}
]
},
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
value: 'MOLD',
componentProps: {
disabled: true,
}
},
tableForm: {
type:'Select',
disabled: true,
}
},
{
label: '设备保养部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true,
}
},
{
label: '项类型',
field: 'status',
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select',
value: 'MAINTAIN',
componentProps: {
disabled: true
}
},
tableForm: {
type: 'Select',
disabled: true,
}
},
{
label: '人数',
field: 'peoples',
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
max: 100,
precision: 0
}
},
tableForm: {
disabled: true,
}
},
{
label: '保养所需时间(分钟)',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: false,
table: {
width: 200,
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 0
}
},
tableForm: {
disabled: true,
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

54
src/views/eam/basic/moldMaintenanceConfig/index.vue

@ -46,8 +46,8 @@
@success="getList" @success="getList"
:rules="MoldMaintenanceConfigRules" :rules="MoldMaintenanceConfigRules"
:formAllSchemas="MoldMaintenanceConfig.allSchemas" :formAllSchemas="MoldMaintenanceConfig.allSchemas"
:tableAllSchemas="DeviceMaintenanceTwo.allSchemas" :tableAllSchemas="MoldMaintenanceTwo.allSchemas"
:tableFormRules="DeviceMaintenanceRules" :tableFormRules="MoldMaintenanceRules"
:tableData="tableData" :tableData="tableData"
:apiUpdate="MoldMaintenanceConfigApi.updateMoldMaintenanceConfig" :apiUpdate="MoldMaintenanceConfigApi.updateMoldMaintenanceConfig"
:apiCreate="MoldMaintenanceConfigApi.createMoldMaintenanceConfig" :apiCreate="MoldMaintenanceConfigApi.createMoldMaintenanceConfig"
@ -65,11 +65,11 @@
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="MoldMaintenanceConfig.allSchemas" :allSchemas="MoldMaintenanceConfig.allSchemas"
:detailAllSchemas="DeviceMaintenanceTwo.allSchemas" :detailAllSchemas="MoldMaintenanceTwo.allSchemas"
:apiCreate="DeviceMaintenanceApi.createDeviceMoldItems" :apiCreate="MoldMaintenanceApi.createDeviceMoldItems"
:apiUpdate="DeviceMaintenanceApi.updateDeviceMoldItems" :apiUpdate="MoldMaintenanceApi.updateDeviceMoldItems"
:apiPage="MoldMaintenanceConfigApi.getDeviceMoldItemsPage" :apiPage="MoldMaintenanceConfigApi.getDeviceMoldItemsPage"
:apiDelete="DeviceMaintenanceApi.deleteDeviceMoldItems" :apiDelete="MoldMaintenanceApi.deleteDeviceMoldItems"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isNewFuction='true' :isNewFuction='true'
@openFormNewFuction="openFormNewFuction" @openFormNewFuction="openFormNewFuction"
@ -96,8 +96,8 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import {DeviceMaintenance, DeviceMaintenanceTwo,DeviceMaintenanceRules} from '@/views/eam/basic/deviceMaintenance/deviceMaintenance.data' import {MoldMaintenance, MoldMaintenanceTwo,MoldMaintenanceRules} from '@/views/eam/basic/moldMaintenance/moldMaintenance.data'
import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance' import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance'
// import { DeviceAccounts } from '@/views/eam/device/deviceAccounts/deviceAccounts.data' // import { DeviceAccounts } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
// import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' // import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
@ -107,7 +107,7 @@ defineOptions({ name: 'MoldMaintenanceConfig' })
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
DeviceMaintenance.allSchemas.tableFormColumns.forEach(item => { MoldMaintenance.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
@ -167,6 +167,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const submitForm = async (formType, submitData) => { const submitForm = async (formType, submitData) => {
let data = {...submitData} let data = {...submitData}
data.type = 'MOLD' data.type = 'MOLD'
data.status = 'MAINTAIN'
formRef.value.formLoading = true formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {
@ -280,30 +281,6 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row) formRef.value.open(type, row)
} }
// // form
// const formsSuccess = async (formType,data) => {
// var isHave =MoldMaintenanceConfig.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;
// data.type = 'DEVICE'
// if (formType === 'create') {
// await MoldMaintenanceConfigApi.createMoldMaintenanceConfig(data)
// message.success(t('common.createSuccess'))
// } else {
// await MoldMaintenanceConfigApi.updateMoldMaintenanceConfig(data)
// message.success(t('common.updateSuccess'))
// }
// basicFormRef.value.dialogVisible = false
// getList()
// }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
@ -369,11 +346,11 @@ const searchFormClick = (searchData) => {
const searchTableRef = ref() const searchTableRef = ref()
const openFormNewFuction = ()=>{ const openFormNewFuction = ()=>{
searchTableRef.value.open( searchTableRef.value.open(
'选择设备保养项', '选择模具保养项',
DeviceMaintenance.allSchemas, MoldMaintenance.allSchemas,
DeviceMaintenanceApi.getDeviceMoldItemsPage, MoldMaintenanceApi.getDeviceMoldItemsPage,
null, null,
DeviceMaintenance.allSchemas.searchSchema, MoldMaintenance.allSchemas.searchSchema,
true, true,
null, null,
null, null,
@ -419,7 +396,8 @@ const deteleNewFuction =async (row)=>{
onMounted(async () => { onMounted(async () => {
tableObject.params = { tableObject.params = {
available: 'TRUE', available: 'TRUE',
type: 'MOLD' type: 'MOLD',
status: 'MAINTAIN'
} }
getList() getList()
importTemplateData.templateUrl = await MoldMaintenanceConfigApi.importTemplate() importTemplateData.templateUrl = await MoldMaintenanceConfigApi.importTemplate()

Loading…
Cancel
Save