|
|
@ -2,26 +2,9 @@ |
|
|
|
<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-input v-model="formData.verifyContent" type="textarea" :input-style="{height:'100px'}" maxlength="300" placeholder="请输入验证内容" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -40,6 +23,7 @@ |
|
|
|
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain' |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
import {ElInput} from "element-plus"; |
|
|
|
import {verifyEquipmentMaintenanceMain} from "@/api/eam/equipmentMaintenanceMain"; |
|
|
|
|
|
|
|
defineOptions({ name: 'TeamForm' }) |
|
|
|
|
|
|
@ -61,93 +45,18 @@ const InputRef = ref<InstanceType<typeof ElInput>>() |
|
|
|
const formData = ref({ |
|
|
|
id:'', |
|
|
|
number:'', |
|
|
|
verifyer: '', |
|
|
|
verifyContent: '', |
|
|
|
verifyTime: '', |
|
|
|
status:'' |
|
|
|
}) |
|
|
|
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' }, |
|
|
|
], |
|
|
|
}) |
|
|
|
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 |
|
|
@ -167,8 +76,10 @@ const submitForm = async (val) => { |
|
|
|
const valid = await basicFormRef.value.validate() |
|
|
|
if (!valid) return |
|
|
|
|
|
|
|
formData.value.status = '7' |
|
|
|
|
|
|
|
//发送数据 |
|
|
|
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) |
|
|
|
await EquipmentMaintenanceMainApi.verifyEquipmentMaintenanceMain(formData.value) |
|
|
|
//把success函数传递到父页面 |
|
|
|
emit('success',formData.value.id) |
|
|
|
dialogVisible.value = false |
|
|
|