ljlong_2630
8 months ago
149 changed files with 4631 additions and 1051 deletions
@ -0,0 +1,57 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface RelationMaintenancePlanItemVO { |
||||
|
id: number |
||||
|
planNumber: string |
||||
|
itemCode: string |
||||
|
itemName: string |
||||
|
isSelectd: boolean |
||||
|
departmentCode: string |
||||
|
remark: string |
||||
|
siteId: string |
||||
|
available: string |
||||
|
deletionTime: Date |
||||
|
deleterId: byte[] |
||||
|
concurrencyStamp: number |
||||
|
} |
||||
|
|
||||
|
// 查询保养计划表和保养项关系列表
|
||||
|
export const getRelationMaintenancePlanItemPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/eam/relation-maintenance-plan-item/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/eam/relation-maintenance-plan-item/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询保养计划表和保养项关系详情
|
||||
|
export const getRelationMaintenancePlanItem = async (id: number) => { |
||||
|
return await request.get({ url: `/eam/relation-maintenance-plan-item/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增保养计划表和保养项关系
|
||||
|
export const createRelationMaintenancePlanItem = async (data: RelationMaintenancePlanItemVO) => { |
||||
|
return await request.post({ url: `/eam/relation-maintenance-plan-item/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改保养计划表和保养项关系
|
||||
|
export const updateRelationMaintenancePlanItem = async (data: RelationMaintenancePlanItemVO) => { |
||||
|
return await request.put({ url: `/eam/relation-maintenance-plan-item/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除保养计划表和保养项关系
|
||||
|
export const deleteRelationMaintenancePlanItem = async (id: number) => { |
||||
|
return await request.delete({ url: `/eam/relation-maintenance-plan-item/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出保养计划表和保养项关系 Excel
|
||||
|
export const exportRelationMaintenancePlanItem = async (params) => { |
||||
|
return await request.download({ url: `/eam/relation-maintenance-plan-item/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/eam/relation-maintenance-plan-item/get-import-template' }) |
||||
|
} |
@ -0,0 +1,391 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="dialogVisible" :title="dialogTitle"> |
||||
|
<el-form |
||||
|
ref="basicFormRef" |
||||
|
v-loading="formLoading" |
||||
|
:model="formData" |
||||
|
:rules="formRules" |
||||
|
label-width="100px" |
||||
|
> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="方案编号" prop="code"> |
||||
|
<el-input v-model="formData.code" placeholder="方案编号" :disabled="isDisabled"/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="方案名称" prop="name"> |
||||
|
<el-input v-model="formData.name" placeholder="请输入方案名称" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="是否可修改" prop="isUpdated"> |
||||
|
<el-select v-model="formData.isUpdated" style="width: 200px"> |
||||
|
<el-option label="是" value="TRUE"></el-option> |
||||
|
<el-option label="否" value="FALSE"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="描述" prop="describing"> |
||||
|
<el-input v-model="formData.describing" placeholder="请输入描述" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="是否可用" prop="available"> |
||||
|
<el-select v-model="formData.available" style="width: 200px"> |
||||
|
<el-option label="是" value="TRUE"></el-option> |
||||
|
<el-option label="否" value="FALSE"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="备注" prop="remark"> |
||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="11"> |
||||
|
<el-form-item label="选择集ID" prop="selectId"> |
||||
|
<div class="tag-container flex gap-2"> |
||||
|
<el-tag v-for="ent in tags" :key="ent.selectId" closable :disable-transitions="false" @close="handleClose(ent.selectId)"> |
||||
|
{{ ent.selectId}} |
||||
|
</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"> |
||||
|
添加保养选择集 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<el-table :data="maintenanceItemData" style="width: 100%; height: 80%"> |
||||
|
<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> |
||||
|
</template> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
v-model="scope.row.isSelectd" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
active-text="是" |
||||
|
inactive-text="否" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<template #footer> |
||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
|
</template> |
||||
|
</Dialog> |
||||
|
|
||||
|
<!--添加巡检项弹窗--> |
||||
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
||||
|
|
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import * as BasicMaintenanceOptionApi from '@/api/eam/basicMaintenanceOption' |
||||
|
import request from "@/config/axios"; |
||||
|
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 { |
||||
|
BasicMaintenanceOptionVO, |
||||
|
createBasicMaintenanceOption, updateBasicMaintenanceOption |
||||
|
} from "@/api/eam/basicMaintenanceOption"; |
||||
|
|
||||
|
defineOptions({ name: 'TeamForm' }) |
||||
|
|
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
|
||||
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
|
const dialogTitle = ref('') // 弹窗的标题 |
||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
|
const tags=ref([]) |
||||
|
|
||||
|
const inputValue = ref('') |
||||
|
const inputVisible = ref(false) |
||||
|
const isDisabled = ref(false) |
||||
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
||||
|
//保养项相关参数 |
||||
|
const maintenanceItemData = ref([]) |
||||
|
|
||||
|
const itemData = ref({ |
||||
|
id: '', |
||||
|
content: '', |
||||
|
selectId:'' |
||||
|
}) |
||||
|
|
||||
|
const formData = ref({ |
||||
|
code: '', |
||||
|
name: '', |
||||
|
describing: '', |
||||
|
isUpdated: '', |
||||
|
remark: '', |
||||
|
available: '', |
||||
|
selectId: '', |
||||
|
optionItem:[] |
||||
|
}) |
||||
|
const formRules = reactive({ |
||||
|
code: [ |
||||
|
{ required: true, message: '方案编号不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
name: [ |
||||
|
{ required: true, message: '方案名称不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
isUpdated: [ |
||||
|
{ required: true, message: '不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
available: [ |
||||
|
{ required: true, message: '不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
remark: [ |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
}) |
||||
|
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); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** 弹窗相关参数 */ |
||||
|
const searchTableRef = ref(); |
||||
|
const _searchTableTitle = ref(); |
||||
|
const _searchTableAllSchemas = ref(); |
||||
|
const _searchTablePage = ref(); |
||||
|
const _formField = ref(); |
||||
|
const _searchField = ref(); |
||||
|
const _multiple = ref(); |
||||
|
const _type = ref(); |
||||
|
const _row = ref(); |
||||
|
const _searchCondition = ref({}) |
||||
|
|
||||
|
|
||||
|
const addItem = () =>{ |
||||
|
addItemCommon(true,'baoYangItem') |
||||
|
} |
||||
|
|
||||
|
/** 选择巡检项弹窗 */ |
||||
|
const addItemCommon = (multiple,field) => { |
||||
|
_searchCondition.value = {} |
||||
|
const filters: any[] = [] |
||||
|
filters.push({ |
||||
|
action: "==", |
||||
|
column: 'available', |
||||
|
value: 'TRUE' |
||||
|
}) |
||||
|
// 参数整理 |
||||
|
_searchCondition.value.isSearch = true |
||||
|
_searchCondition.value.filters = filters |
||||
|
_searchTableTitle.value = '选择保养项' |
||||
|
//_multiple.value = multiple |
||||
|
_formField.value = field |
||||
|
_searchField.value = field |
||||
|
_searchTablePage.value = maintenanceItemSelectSetApi.getBasicMaintenanceItemSelectSetPage |
||||
|
_searchTableAllSchemas.value = BasicMaintenanceItemSelectSet.allSchemas |
||||
|
openCommon() |
||||
|
} |
||||
|
|
||||
|
/** 弹窗选择之后 回调函数 添加选择集 */ |
||||
|
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); |
||||
|
if (!isExist) { |
||||
|
const newItem = {}; |
||||
|
newItem['itemCode'] = item.itemCode; |
||||
|
newItem['selectId'] = item.id; |
||||
|
tags.value = []; |
||||
|
tags.value.push(newItem); |
||||
|
} |
||||
|
itemsId = item.itemCode; |
||||
|
}); |
||||
|
//保养项赋值 |
||||
|
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}) |
||||
|
const newItem = {}; |
||||
|
newItem['itemCode'] = res.id; |
||||
|
newItem['itemName'] = res.name; |
||||
|
newItem['equipmentParts'] = res.equipmentParts; |
||||
|
newItem['isSelectd'] = true; |
||||
|
maintenanceItemData.value.push(newItem); |
||||
|
} |
||||
|
} finally { |
||||
|
formLoading.value = false; |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
/*打开弹窗*/ |
||||
|
const openCommon = () => { |
||||
|
searchTableRef.value.open( |
||||
|
_searchTableTitle.value, |
||||
|
_searchTableAllSchemas.value, |
||||
|
_searchTablePage.value, |
||||
|
_formField.value, |
||||
|
_searchField.value, |
||||
|
_multiple.value, |
||||
|
_type.value, |
||||
|
_row.value, |
||||
|
_searchCondition.value |
||||
|
) |
||||
|
} |
||||
|
/** 初始化弹窗 */ |
||||
|
const open = async (type: string, row?: object) => { |
||||
|
dialogVisible.value = true |
||||
|
dialogTitle.value = t('action.' + type) |
||||
|
formType.value = type |
||||
|
// 修改时,设置数据 |
||||
|
if (row) { |
||||
|
isDisabled.value = true; |
||||
|
formLoading.value = true |
||||
|
formData.value = row; |
||||
|
//添加保养选择集 |
||||
|
let item = (row.id.toString()).split(",") |
||||
|
try { |
||||
|
tags.value=[]; |
||||
|
for (var i = 0; i < item.length; i++) { |
||||
|
itemData.value = await request.get({ url: `/eam/basic-maintenance-option/get?id=` + item[i] }); |
||||
|
tags.value.push(itemData.value); |
||||
|
} |
||||
|
} finally { |
||||
|
formLoading.value = false |
||||
|
} |
||||
|
//添加保养项 |
||||
|
let res = await request.get({url: `/eam/relation-maintenance-option-item/getList?optionCode=` + row.code}) |
||||
|
try { |
||||
|
maintenanceItemData.value = []; |
||||
|
formLoading.value = true; |
||||
|
for (const item of res) { |
||||
|
const newItem = {}; |
||||
|
newItem['id'] = item.id; |
||||
|
newItem['itemCode'] = item.itemCode; |
||||
|
newItem['itemName'] = item.itemName; |
||||
|
newItem['isSelectd'] = item.isSelectd; |
||||
|
maintenanceItemData.value.push(newItem); |
||||
|
} |
||||
|
} finally { |
||||
|
formLoading.value = false; |
||||
|
} |
||||
|
} |
||||
|
// 新增时 |
||||
|
else { |
||||
|
resetForm() |
||||
|
isDisabled.value = false; |
||||
|
} |
||||
|
} |
||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
|
||||
|
/** 提交表单 */ |
||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
||||
|
const submitForm = async () => { |
||||
|
// 校验表单 |
||||
|
if (!basicFormRef) return |
||||
|
const valid = await basicFormRef.value.validate() |
||||
|
if (!valid) return |
||||
|
if (maintenanceItemData.value.length > 10 ){ |
||||
|
message.warning('保养项最多10个'); |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
//赋值 保养选择集ID |
||||
|
formData.value.selectId = tags.value[0].selectId |
||||
|
// 提交请求 |
||||
|
formLoading.value = true |
||||
|
//formData.value.members = JSON.stringify(tags.value) |
||||
|
try { |
||||
|
if (formType.value === 'create') { |
||||
|
for (var i = 0; i < maintenanceItemData.value.length; i++) { |
||||
|
maintenanceItemData.value[i].optionCode = formData.value.code |
||||
|
} |
||||
|
formData.value.optionItem = maintenanceItemData.value |
||||
|
//新增保养方案 及 方案与项关系 |
||||
|
await BasicMaintenanceOptionApi.createBasicMaintenanceOption(formData.value) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
for (var i = 0; i < maintenanceItemData.value.length; i++) { |
||||
|
maintenanceItemData.value[i].optionCode = formData.value.code |
||||
|
} |
||||
|
formData.value.optionItem = maintenanceItemData.value |
||||
|
console.log(formData.value) |
||||
|
await BasicMaintenanceOptionApi.updateBasicMaintenanceOption(formData.value) |
||||
|
message.success(t('common.updateSuccess')) |
||||
|
} |
||||
|
dialogVisible.value = false |
||||
|
// 发送操作成功的事件 |
||||
|
emit('success') |
||||
|
} finally { |
||||
|
formLoading.value = false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** 重置表单 */ |
||||
|
const resetForm = () => { |
||||
|
formData.value = { |
||||
|
code: '', |
||||
|
name: '', |
||||
|
describing: '', |
||||
|
isUpdated: '', |
||||
|
remark: '', |
||||
|
available: '', |
||||
|
selectId: '' |
||||
|
} |
||||
|
tags.value=[]; |
||||
|
maintenanceItemData.value = []; |
||||
|
basicFormRef.value?.resetFields() |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.tag-container { |
||||
|
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */ |
||||
|
border: 1px solid #ccc; /* 添加边框样式 */ |
||||
|
padding: 10px; /* 可根据需要调整容器内边距 */ |
||||
|
width: 950px; /* 设置固定宽度为 950px */ |
||||
|
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */ |
||||
|
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */ |
||||
|
overflow-wrap: break-word; /* 兼容性更好的写法 */ |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.input-with-button { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.input-with-button > .el-input { |
||||
|
flex: 1; |
||||
|
/*margin-right: 10px;*/ |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,216 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false"> |
||||
|
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="验证人" prop="verifyer"> |
||||
|
<el-input v-model="formData.verifyer" placeholder="请输入验证人" :disabled="isDisabled"/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="验证内容" prop="verifyContent"> |
||||
|
<el-input v-model="formData.verifyContent" placeholder="请输入验证内容" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="验证时间" prop="verifyTime"> |
||||
|
<el-date-picker |
||||
|
v-model="formData.verifyTime" |
||||
|
type="datetime" |
||||
|
value-format="x" |
||||
|
placeholder="选择验证时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')">确 定</el-button> |
||||
|
<el-button @click="handleClose('close')">取 消</el-button> |
||||
|
</template> |
||||
|
</Dialog> |
||||
|
|
||||
|
<!--添加巡检项弹窗--> |
||||
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
||||
|
|
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' |
||||
|
import { SearchTable } from '@/components/SearchTable' |
||||
|
import {ElInput} from "element-plus"; |
||||
|
|
||||
|
defineOptions({ name: 'TeamForm' }) |
||||
|
|
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
|
||||
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
|
const dialogTitle = ref('') // 弹窗的标题 |
||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
|
const tags=ref([]) |
||||
|
|
||||
|
const inputValue = ref('') |
||||
|
const inputVisible = ref(false) |
||||
|
const isDisabled = ref(false) |
||||
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
||||
|
|
||||
|
|
||||
|
const formData = ref({ |
||||
|
id:'', |
||||
|
number:'', |
||||
|
verifyer: '', |
||||
|
verifyContent: '', |
||||
|
verifyTime: '', |
||||
|
maintenancer: '', |
||||
|
maintenancePhone: '', |
||||
|
}) |
||||
|
const formRules = reactive({ |
||||
|
verifyer: [ |
||||
|
{ required: true, message: '验证人不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
verifyContent: [ |
||||
|
{ required: true, message: '验证内容不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
verifyTime: [ |
||||
|
{ required: true, message: '验证时间不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
maintenancer: [ |
||||
|
{ required: true, message: '保养人ID不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
maintenancePhone: [ |
||||
|
{ required: true, message: '保养人电话不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
}) |
||||
|
const basicFormRef = ref() // 表单 Ref |
||||
|
|
||||
|
// /** 弹窗相关参数 */ |
||||
|
// const searchTableRef = ref(); |
||||
|
// const _searchTableTitle = ref(); |
||||
|
// const _searchTableAllSchemas = ref(); |
||||
|
// const _searchTablePage = ref(); |
||||
|
// const _formField = ref(); |
||||
|
// const _searchField = ref(); |
||||
|
// const _multiple = ref(); |
||||
|
// const _type = ref(); |
||||
|
// const _row = ref(); |
||||
|
// const _searchCondition = ref({}) |
||||
|
// |
||||
|
// |
||||
|
// const addItem = () =>{ |
||||
|
// addItemCommon(true,'xunJianItem') |
||||
|
// } |
||||
|
// |
||||
|
// /** 选择巡检项弹窗 */ |
||||
|
// const addItemCommon = (multiple,field) => { |
||||
|
// _searchCondition.value = {} |
||||
|
// const filters: any[] = [] |
||||
|
// filters.push({ |
||||
|
// action: "==", |
||||
|
// column: 'available', |
||||
|
// value: 'TRUE' |
||||
|
// }) |
||||
|
// // 参数整理 |
||||
|
// _searchCondition.value.isSearch = true |
||||
|
// _searchCondition.value.filters = filters |
||||
|
// _searchTableTitle.value = '选择巡检项' |
||||
|
// _multiple.value = multiple |
||||
|
// _formField.value = field |
||||
|
// _searchField.value = field |
||||
|
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage |
||||
|
// _searchTableAllSchemas.value = InspectionItem.allSchemas |
||||
|
// openCommon() |
||||
|
// } |
||||
|
// |
||||
|
// /** 弹窗选择之后 回调函数 添加选择集 */ |
||||
|
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
||||
|
// nextTick?.(() => { |
||||
|
// if (formField === 'xunJianItem') { |
||||
|
// val.forEach(item => { |
||||
|
// const isExist = tags.value.some(tag => tag.content === item.content); |
||||
|
// if (!isExist){ |
||||
|
// const newItem = {}; |
||||
|
// newItem['content'] = item.content; |
||||
|
// newItem['id'] = item.id; |
||||
|
// tags.value.push(newItem); |
||||
|
// } |
||||
|
// }); |
||||
|
// } |
||||
|
// }) |
||||
|
// } |
||||
|
// /*打开弹窗*/ |
||||
|
// const openCommon = () => { |
||||
|
// searchTableRef.value.open( |
||||
|
// _searchTableTitle.value, |
||||
|
// _searchTableAllSchemas.value, |
||||
|
// _searchTablePage.value, |
||||
|
// _formField.value, |
||||
|
// _searchField.value, |
||||
|
// _multiple.value, |
||||
|
// _type.value, |
||||
|
// _row.value, |
||||
|
// _searchCondition.value |
||||
|
// ) |
||||
|
// } |
||||
|
/** 初始化弹窗 */ |
||||
|
const open = async (type: string, row?: object) => { |
||||
|
dialogVisible.value = true |
||||
|
dialogTitle.value = t('action.' + type) |
||||
|
formType.value = type |
||||
|
//初始化数据 |
||||
|
formData.value.id = row.id |
||||
|
formData.value.number = row.planNumber |
||||
|
} |
||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
|
||||
|
/** 提交表单 */ |
||||
|
const submitForm = async (val) => { |
||||
|
//把success函数传递到父页面 |
||||
|
emit('success',formData.value.id) |
||||
|
// 校验表单 |
||||
|
if (!basicFormRef) return |
||||
|
const valid = await basicFormRef.value.validate() |
||||
|
if (!valid) return |
||||
|
|
||||
|
//发送数据 |
||||
|
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) |
||||
|
dialogVisible.value = false |
||||
|
} |
||||
|
|
||||
|
const handleClose=(val)=>{ |
||||
|
dialogVisible.value = false |
||||
|
emit('close',val) |
||||
|
} |
||||
|
|
||||
|
// 传递给父类 |
||||
|
const emit = defineEmits(['close','success']) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.tag-container { |
||||
|
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */ |
||||
|
border: 1px solid #ccc; /* 添加边框样式 */ |
||||
|
padding: 10px; /* 可根据需要调整容器内边距 */ |
||||
|
width: 950px; /* 设置固定宽度为 950px */ |
||||
|
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */ |
||||
|
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */ |
||||
|
overflow-wrap: break-word; /* 兼容性更好的写法 */ |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.input-with-button { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.input-with-button > .el-input { |
||||
|
flex: 1; |
||||
|
/*margin-right: 10px;*/ |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,215 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false"> |
||||
|
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="保养人ID" prop="maintenancer"> |
||||
|
<el-input v-model="formData.maintenancer" placeholder="请输入保养人" :disabled="isDisabled"/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="保养人电话" prop="maintenancePhone"> |
||||
|
<el-input v-model="formData.maintenancePhone" placeholder="请输入保养人电话" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="保养开始时间" prop="startTime"> |
||||
|
<el-date-picker |
||||
|
v-model="formData.startTime" |
||||
|
type="datetime" |
||||
|
value-format="x" |
||||
|
placeholder="选择保养开始时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="保养结束时间" prop="endTime"> |
||||
|
<el-date-picker |
||||
|
v-model="formData.endTime" |
||||
|
type="datetime" |
||||
|
value-format="x" |
||||
|
placeholder="保养结束时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')">确 定</el-button> |
||||
|
<el-button @click="handleClose('close')">取 消</el-button> |
||||
|
</template> |
||||
|
</Dialog> |
||||
|
|
||||
|
<!--添加巡检项弹窗--> |
||||
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
||||
|
|
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' |
||||
|
import { SearchTable } from '@/components/SearchTable' |
||||
|
import {ElInput} from "element-plus"; |
||||
|
|
||||
|
defineOptions({ name: 'TeamForm' }) |
||||
|
|
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
|
||||
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
|
const dialogTitle = ref('') // 弹窗的标题 |
||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
|
const tags=ref([]) |
||||
|
|
||||
|
const inputValue = ref('') |
||||
|
const inputVisible = ref(false) |
||||
|
const isDisabled = ref(false) |
||||
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
||||
|
|
||||
|
|
||||
|
const formData = ref({ |
||||
|
id:'', |
||||
|
number:'', |
||||
|
maintenancer: '', |
||||
|
maintenancePhone: '', |
||||
|
startTime:'', |
||||
|
endTime:'', |
||||
|
}) |
||||
|
const formRules = reactive({ |
||||
|
maintenancer: [ |
||||
|
{ required: true, message: '保养人ID不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
maintenancePhone: [ |
||||
|
{ required: true, message: '保养人电话不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
}) |
||||
|
const basicFormRef = ref() // 表单 Ref |
||||
|
|
||||
|
// /** 弹窗相关参数 */ |
||||
|
// const searchTableRef = ref(); |
||||
|
// const _searchTableTitle = ref(); |
||||
|
// const _searchTableAllSchemas = ref(); |
||||
|
// const _searchTablePage = ref(); |
||||
|
// const _formField = ref(); |
||||
|
// const _searchField = ref(); |
||||
|
// const _multiple = ref(); |
||||
|
// const _type = ref(); |
||||
|
// const _row = ref(); |
||||
|
// const _searchCondition = ref({}) |
||||
|
// |
||||
|
// |
||||
|
// const addItem = () =>{ |
||||
|
// addItemCommon(true,'xunJianItem') |
||||
|
// } |
||||
|
// |
||||
|
// /** 选择巡检项弹窗 */ |
||||
|
// const addItemCommon = (multiple,field) => { |
||||
|
// _searchCondition.value = {} |
||||
|
// const filters: any[] = [] |
||||
|
// filters.push({ |
||||
|
// action: "==", |
||||
|
// column: 'available', |
||||
|
// value: 'TRUE' |
||||
|
// }) |
||||
|
// // 参数整理 |
||||
|
// _searchCondition.value.isSearch = true |
||||
|
// _searchCondition.value.filters = filters |
||||
|
// _searchTableTitle.value = '选择巡检项' |
||||
|
// _multiple.value = multiple |
||||
|
// _formField.value = field |
||||
|
// _searchField.value = field |
||||
|
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage |
||||
|
// _searchTableAllSchemas.value = InspectionItem.allSchemas |
||||
|
// openCommon() |
||||
|
// } |
||||
|
// |
||||
|
// /** 弹窗选择之后 回调函数 添加选择集 */ |
||||
|
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
||||
|
// nextTick?.(() => { |
||||
|
// if (formField === 'xunJianItem') { |
||||
|
// val.forEach(item => { |
||||
|
// const isExist = tags.value.some(tag => tag.content === item.content); |
||||
|
// if (!isExist){ |
||||
|
// const newItem = {}; |
||||
|
// newItem['content'] = item.content; |
||||
|
// newItem['id'] = item.id; |
||||
|
// tags.value.push(newItem); |
||||
|
// } |
||||
|
// }); |
||||
|
// } |
||||
|
// }) |
||||
|
// } |
||||
|
// /*打开弹窗*/ |
||||
|
// const openCommon = () => { |
||||
|
// searchTableRef.value.open( |
||||
|
// _searchTableTitle.value, |
||||
|
// _searchTableAllSchemas.value, |
||||
|
// _searchTablePage.value, |
||||
|
// _formField.value, |
||||
|
// _searchField.value, |
||||
|
// _multiple.value, |
||||
|
// _type.value, |
||||
|
// _row.value, |
||||
|
// _searchCondition.value |
||||
|
// ) |
||||
|
// } |
||||
|
/** 初始化弹窗 */ |
||||
|
const open = async (type: string, row?: object) => { |
||||
|
dialogVisible.value = true |
||||
|
dialogTitle.value = t('action.' + type) |
||||
|
formType.value = type |
||||
|
//初始化数据 |
||||
|
formData.value.id = row.id |
||||
|
formData.value.number = row.planNumber |
||||
|
} |
||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
|
||||
|
/** 提交表单 */ |
||||
|
const submitForm = async (val) => { |
||||
|
|
||||
|
//把success函数传递到父页面 |
||||
|
emit('success',formData.value.id) |
||||
|
// 校验表单 |
||||
|
if (!basicFormRef) return |
||||
|
const valid = await basicFormRef.value.validate() |
||||
|
if (!valid) return |
||||
|
|
||||
|
//发送数据 |
||||
|
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) |
||||
|
dialogVisible.value = false |
||||
|
} |
||||
|
|
||||
|
const handleClose=(val)=>{ |
||||
|
dialogVisible.value = false |
||||
|
emit('close',val) |
||||
|
} |
||||
|
|
||||
|
// 传递给父类 |
||||
|
const emit = defineEmits(['close','success']) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.tag-container { |
||||
|
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */ |
||||
|
border: 1px solid #ccc; /* 添加边框样式 */ |
||||
|
padding: 10px; /* 可根据需要调整容器内边距 */ |
||||
|
width: 950px; /* 设置固定宽度为 950px */ |
||||
|
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */ |
||||
|
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */ |
||||
|
overflow-wrap: break-word; /* 兼容性更好的写法 */ |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.input-with-button { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.input-with-button > .el-input { |
||||
|
flex: 1; |
||||
|
/*margin-right: 10px;*/ |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,141 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false"> |
||||
|
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="审核人" prop="approver"> |
||||
|
<el-input v-model="formData.approver" placeholder="请输入审核人" :disabled="isDisabled"/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="审核内容" prop="approveContent"> |
||||
|
<el-input v-model="formData.approveContent" placeholder="请输入审核内容" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="审核时间" prop="approveTime"> |
||||
|
<el-date-picker |
||||
|
v-model="formData.approveTime" |
||||
|
type="datetime" |
||||
|
value-format="x" |
||||
|
placeholder="选择审核时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')">确 定</el-button> |
||||
|
<el-button @click="handleClose('close')">取 消</el-button> |
||||
|
</template> |
||||
|
</Dialog> |
||||
|
|
||||
|
<!--添加巡检项弹窗--> |
||||
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
||||
|
|
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import { SearchTable } from '@/components/SearchTable' |
||||
|
import {ElInput} from "element-plus"; |
||||
|
import * as EquipmentReportRepairRequestApi from "@/api/eam/equipmentReportRepairRequest"; |
||||
|
|
||||
|
defineOptions({ name: 'TeamForm' }) |
||||
|
|
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
|
||||
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
|
const dialogTitle = ref('') // 弹窗的标题 |
||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
|
const tags=ref([]) |
||||
|
|
||||
|
const inputValue = ref('') |
||||
|
const inputVisible = ref(false) |
||||
|
const isDisabled = ref(false) |
||||
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
||||
|
|
||||
|
|
||||
|
const formData = ref({ |
||||
|
id:'', |
||||
|
number:'', |
||||
|
approver: '', |
||||
|
approveContent: '', |
||||
|
approveTime: '', |
||||
|
}) |
||||
|
const formRules = reactive({ |
||||
|
approver: [ |
||||
|
{ required: true, message: '审核人不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
approveContent: [ |
||||
|
{ required: true, message: '审核内容不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
approveTime: [ |
||||
|
{ required: true, message: '审核时间不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
}) |
||||
|
const basicFormRef = ref() // 表单 Ref |
||||
|
|
||||
|
|
||||
|
/** 初始化弹窗 */ |
||||
|
const open = async (type: string, row?: object) => { |
||||
|
dialogVisible.value = true |
||||
|
dialogTitle.value = t('action.' + type) |
||||
|
formType.value = type |
||||
|
//初始化数据 |
||||
|
formData.value.id = row.id |
||||
|
formData.value.number = row.number |
||||
|
} |
||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
|
||||
|
/** 提交表单 */ |
||||
|
const submitForm = async (val) => { |
||||
|
//把success函数传递到父页面 |
||||
|
emit('success',formData.value.id) |
||||
|
// 校验表单 |
||||
|
if (!basicFormRef) return |
||||
|
const valid = await basicFormRef.value.validate() |
||||
|
if (!valid) return |
||||
|
|
||||
|
//发送数据 |
||||
|
await EquipmentReportRepairRequestApi.updateEquipmentReportRepairRequest(formData.value) |
||||
|
dialogVisible.value = false |
||||
|
} |
||||
|
|
||||
|
const handleClose=(val)=>{ |
||||
|
dialogVisible.value = false |
||||
|
emit('close',val) |
||||
|
} |
||||
|
|
||||
|
// 传递给父类 |
||||
|
const emit = defineEmits(['close','success']) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.tag-container { |
||||
|
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */ |
||||
|
border: 1px solid #ccc; /* 添加边框样式 */ |
||||
|
padding: 10px; /* 可根据需要调整容器内边距 */ |
||||
|
width: 950px; /* 设置固定宽度为 950px */ |
||||
|
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */ |
||||
|
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */ |
||||
|
overflow-wrap: break-word; /* 兼容性更好的写法 */ |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.input-with-button { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.input-with-button > .el-input { |
||||
|
flex: 1; |
||||
|
/*margin-right: 10px;*/ |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,142 @@ |
|||||
|
<template> |
||||
|
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false"> |
||||
|
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="审核人" prop="approver"> |
||||
|
<el-input v-model="formData.approver" placeholder="请输入审核人" :disabled="isDisabled"/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="审核内容" prop="approveContent"> |
||||
|
<el-input v-model="formData.approveContent" placeholder="请输入审核内容" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="审核时间" prop="approveTime"> |
||||
|
<el-date-picker |
||||
|
v-model="formData.approveTime" |
||||
|
type="datetime" |
||||
|
value-format="x" |
||||
|
placeholder="选择审核时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')">确 定</el-button> |
||||
|
<el-button @click="handleClose('close')">取 消</el-button> |
||||
|
</template> |
||||
|
</Dialog> |
||||
|
|
||||
|
<!--添加巡检项弹窗--> |
||||
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
||||
|
|
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import * as MaintenanceApi from '@/api/eam/maintenance' |
||||
|
import { SearchTable } from '@/components/SearchTable' |
||||
|
import {ElInput} from "element-plus"; |
||||
|
import {updateMaintenanceAudi} from "@/api/eam/maintenance"; |
||||
|
|
||||
|
defineOptions({ name: 'TeamForm' }) |
||||
|
|
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
|
||||
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
|
const dialogTitle = ref('') // 弹窗的标题 |
||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
|
const tags=ref([]) |
||||
|
|
||||
|
const inputValue = ref('') |
||||
|
const inputVisible = ref(false) |
||||
|
const isDisabled = ref(false) |
||||
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
||||
|
|
||||
|
|
||||
|
const formData = ref({ |
||||
|
id:'', |
||||
|
number:'', |
||||
|
approver: '', |
||||
|
approveContent: '', |
||||
|
approveTime: '', |
||||
|
}) |
||||
|
const formRules = reactive({ |
||||
|
approver: [ |
||||
|
{ required: true, message: '审核人不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
approveContent: [ |
||||
|
{ required: true, message: '审核内容不能为空', trigger: 'blur' }, |
||||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
||||
|
], |
||||
|
approveTime: [ |
||||
|
{ required: true, message: '审核时间不能为空', trigger: 'blur' }, |
||||
|
], |
||||
|
}) |
||||
|
const basicFormRef = ref() // 表单 Ref |
||||
|
|
||||
|
|
||||
|
/** 初始化弹窗 */ |
||||
|
const open = async (type: string, row?: object) => { |
||||
|
dialogVisible.value = true |
||||
|
dialogTitle.value = t('action.' + type) |
||||
|
formType.value = type |
||||
|
//初始化数据 |
||||
|
formData.value.id = row.id |
||||
|
formData.value.number = row.number |
||||
|
} |
||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
|
||||
|
/** 提交表单 */ |
||||
|
const submitForm = async (val) => { |
||||
|
//把success函数传递到父页面 |
||||
|
emit('success',formData.value.id) |
||||
|
// 校验表单 |
||||
|
if (!basicFormRef) return |
||||
|
const valid = await basicFormRef.value.validate() |
||||
|
if (!valid) return |
||||
|
|
||||
|
//发送数据 |
||||
|
await MaintenanceApi.updateMaintenanceAudi(formData.value) |
||||
|
dialogVisible.value = false |
||||
|
} |
||||
|
|
||||
|
const handleClose=(val)=>{ |
||||
|
dialogVisible.value = false |
||||
|
emit('close',val) |
||||
|
} |
||||
|
|
||||
|
// 传递给父类 |
||||
|
const emit = defineEmits(['close','success']) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.tag-container { |
||||
|
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */ |
||||
|
border: 1px solid #ccc; /* 添加边框样式 */ |
||||
|
padding: 10px; /* 可根据需要调整容器内边距 */ |
||||
|
width: 950px; /* 设置固定宽度为 950px */ |
||||
|
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */ |
||||
|
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */ |
||||
|
overflow-wrap: break-word; /* 兼容性更好的写法 */ |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.input-with-button { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.input-with-button > .el-input { |
||||
|
flex: 1; |
||||
|
/*margin-right: 10px;*/ |
||||
|
} |
||||
|
|
||||
|
</style> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue