| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" title="新建设备检测" width="50%" draggable> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="检测人" size="default"> |
| | | <el-input v-model="form.name" placeholder="请填写检测人" /> |
| | | <el-input v-model="form.testPersonId"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="检测日期" size="default"> |
| | | <el-date-picker v-model="form.date1" type="date" placeholder="选择日期时间" style="width: 100%" /> |
| | | <el-date-picker v-model="form.testDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择日期时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="检测人单位" size="default"> |
| | | <el-select v-model="form.region" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="Zone one" value="shanghai" /> |
| | | <el-option label="Zone two" value="beijing" /> |
| | | <el-select v-model="form.testPersonDepartmentId" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="xxx单位1" value="1" /> |
| | | <el-option label="xxx单位2" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="检测内容" size="default"> |
| | | <el-input v-model="form.name" placeholder="请填写检测内容" /> |
| | | <el-input v-model="form.testMemo" placeholder="请填写检测内容" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="检测结果" size="default"> |
| | | <el-select v-model="form.region" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="Zone one" value="shanghai" /> |
| | | <el-option label="Zone two" value="beijing" /> |
| | | <el-select v-model="form.testResult" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="成功" value="1" /> |
| | | <el-option label="失败" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="检测状态" size="default"> |
| | | <el-input v-model="form.name" placeholder="请填写检测状态" /> |
| | | <el-input v-model="form.testStatus" placeholder="请填写检测状态" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">继续添加</el-button> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | <!-- <el-button type="primary" @click="dialogVisible = false" size="default">继续添加</el-button> --> |
| | | <el-button @click="resetForm" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <DailogSearchUser ref="Show"></DailogSearchUser> |
| | | <DailogSearchUser ref="Show" @SearchUser="User"></DailogSearchUser> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser }, |
| | | setup() { |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | setup(props, { emit }) { |
| | | const form = ref({ |
| | | testPersonId: '', |
| | | testDate: '', |
| | | testPersonDepartmentId: '', |
| | | testMemo: '', |
| | | testResult: '', |
| | | testStatus: '', |
| | | }); |
| | | // 开启弹窗 |
| | | const titles = ref(); |
| | | const disabled = ref(false); |
| | | const dialogVisible = ref(false); |
| | | const openDailog = () => { |
| | | const openDailog = (title: string, data: any) => { |
| | | dialogVisible.value = true; |
| | | titles.value = `${title}设备检测`; |
| | | if (title == '查看') { |
| | | disabled.value = true; |
| | | form.value = data; |
| | | } else { |
| | | disabled.value = false; |
| | | } |
| | | }; |
| | | // 开启用户弹窗 |
| | | const Show = ref(); |
| | | const openUser = () => { |
| | | Show.value.openDailog(); |
| | | }; |
| | | const User = (val: any) => { |
| | | form.value.testPersonId = val.uid; |
| | | }; |
| | | // 提交 |
| | | const submitForm = () => { |
| | | dialogVisible.value = false; |
| | | emit('onDelect', form.value); |
| | | form.value = { |
| | | testPersonId: '', |
| | | testDate: '', |
| | | testPersonDepartmentId: '', |
| | | testMemo: '', |
| | | testResult: '', |
| | | testStatus: '', |
| | | }; |
| | | }; |
| | | // 取消 |
| | | const resetForm = () => { |
| | | dialogVisible.value = false; |
| | | form.value = { |
| | | testPersonId: '', |
| | | testDate: '', |
| | | testPersonDepartmentId: '', |
| | | testMemo: '', |
| | | testResult: '', |
| | | testStatus: '', |
| | | }; |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | |
| | | }; |
| | | return { |
| | | form, |
| | | titles, |
| | | User, |
| | | disabled, |
| | | dialogVisible, |
| | | openDailog, |
| | | submitForm, |
| | | resetForm, |
| | | Show, |
| | | openUser, |
| | | Search, |