<template>
|
<el-dialog :fullscreen="full" v-model="dialogVisible" :title="titles" width="50%" draggable>
|
<el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
|
<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.takecareMemo" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="11" :offset="2">
|
<el-form-item label="保养负责人" size="default">
|
<el-input v-model="form.leadingPersonId">
|
<template #append> <el-button :icon="Search" @click="openUser" /> </template
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="11">
|
<el-form-item label="保养日期" size="default">
|
<el-date-picker v-model="form.takecareDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" style="width: 100%" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="11" :offset="2">
|
<el-form-item label="保养负责人单位" size="default">
|
<el-select v-model="form.leadingPersonDepartmentId" 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-row>
|
</el-form>
|
<template #footer>
|
<span class="dialog-footer">
|
<!-- <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" @SearchUser="User"></DailogSearchUser>
|
</template>
|
<script lang="ts">
|
import { defineComponent, ref, reactive } from 'vue';
|
import { Search, FullScreen } from '@element-plus/icons-vue';
|
import DailogSearchUser from '/@/components/DailogSearchUser/index.vue';
|
export default defineComponent({
|
components: { DailogSearchUser },
|
setup(props, { emit }) {
|
const form = ref({
|
takecareMemo: '',
|
leadingPersonId: '',
|
takecareDate: '',
|
leadingPersonDepartmentId: '',
|
});
|
// 开启弹窗
|
const titles=ref()
|
const disabled=ref(false)
|
const dialogVisible = ref(false);
|
const openDailog = (title:string,data:any) => {
|
dialogVisible.value = true;
|
titles.value=`${title}仪器仪表`
|
if(title=='查看'){
|
disabled.value=true
|
form.value=data
|
}else if(title == '修改'){
|
disabled.value=false
|
form.value=data
|
}
|
};
|
// 开启用户弹窗
|
const Show = ref();
|
const openUser = () => {
|
Show.value.openDailog();
|
};
|
const User = (val: any) => {
|
form.value.leadingPersonId = val.uid;
|
};
|
// 提交
|
const submitForm = () => {
|
dialogVisible.value = false;
|
emit('onMain', form.value);
|
form.value = {
|
takecareMemo: '',
|
leadingPersonId: '',
|
takecareDate: '',
|
leadingPersonDepartmentId: '',
|
};
|
};
|
// 取消
|
const resetForm = () => {
|
dialogVisible.value = false;
|
form.value = {
|
takecareMemo: '',
|
leadingPersonId: '',
|
takecareDate: '',
|
leadingPersonDepartmentId: '',
|
};
|
};
|
//全屏
|
const full = ref(false);
|
const toggleFullscreen = () => {
|
if (full.value == false) {
|
full.value = true;
|
} else {
|
full.value = false;
|
}
|
};
|
return {
|
disabled,
|
titles,
|
submitForm,
|
resetForm,
|
form,
|
User,
|
dialogVisible,
|
openDailog,
|
Show,
|
openUser,
|
Search,
|
full,
|
toggleFullscreen,
|
FullScreen,
|
};
|
},
|
});
|
</script>
|
<style scoped>
|
.el-row {
|
padding: 0 0 20px 0;
|
}
|
</style>
|