|
|
@ -2,29 +2,24 @@ |
|
|
|
<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-input v-model="formData.approveContent" type="textarea" :input-style="{height:'100px'}" maxlength="300" 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> |
|
|
@ -40,7 +35,6 @@ |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
import {ElInput} from "element-plus"; |
|
|
|
import * as EquipmentReportRepairRequestApi from "@/api/eam/equipmentReportRepairRequest"; |
|
|
|
import {audiEquipmentReportRepairOrder} from "@/api/eam/equipmentReportRepairRequest"; |
|
|
|
|
|
|
|
defineOptions({ name: 'TeamForm' }) |
|
|
|
|
|
|
@ -50,7 +44,7 @@ const message = useMessage() // 消息弹窗 |
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|
|
|
const formType = ref('') // 表单的类型:passed - 通过;noPassed - 不通过 |
|
|
|
const tags=ref([]) |
|
|
|
|
|
|
|
const inputValue = ref('') |
|
|
@ -62,22 +56,17 @@ const InputRef = ref<InstanceType<typeof ElInput>>() |
|
|
|
const formData = ref({ |
|
|
|
id:'', |
|
|
|
number:'', |
|
|
|
//approver: '', |
|
|
|
approveContent: '', |
|
|
|
approveTime: '', |
|
|
|
status:'', |
|
|
|
}) |
|
|
|
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' }, |
|
|
|
], |
|
|
|
// approveTime: [ |
|
|
|
// { required: true, message: '审核时间不能为空', trigger: 'blur' }, |
|
|
|
// ], |
|
|
|
}) |
|
|
|
const basicFormRef = ref() // 表单 Ref |
|
|
|
|
|
|
@ -85,7 +74,7 @@ const basicFormRef = ref() // 表单 Ref |
|
|
|
/** 初始化弹窗 */ |
|
|
|
const open = async (type: string, row?: object) => { |
|
|
|
dialogVisible.value = true |
|
|
|
dialogTitle.value = t('action.' + type) |
|
|
|
dialogTitle.value = t('编辑') |
|
|
|
formType.value = type |
|
|
|
//初始化数据 |
|
|
|
formData.value.id = row.id |
|
|
@ -95,16 +84,29 @@ 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.audiEquipmentReportRepairOrder(formData.value) |
|
|
|
dialogVisible.value = false |
|
|
|
|
|
|
|
if(formType.value == 'passed'){ |
|
|
|
formData.value.status = '3' |
|
|
|
//发送数据 |
|
|
|
await EquipmentReportRepairRequestApi.audiEquipmentReportRepairOrder(formData.value) |
|
|
|
dialogVisible.value = false |
|
|
|
}else if(formType.value == 'noPassed'){ |
|
|
|
formData.value.status = '4' |
|
|
|
//发送数据 |
|
|
|
await EquipmentReportRepairRequestApi.audiEquipmentReportRepairOrder(formData.value) |
|
|
|
dialogVisible.value = false |
|
|
|
}else{ |
|
|
|
console.log("error") |
|
|
|
} |
|
|
|
|
|
|
|
//把success函数传递到父页面 |
|
|
|
emit('success') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const handleClose=(val)=>{ |
|
|
|