137 lines
3.7 KiB
Vue
137 lines
3.7 KiB
Vue
<template>
|
|
<div>
|
|
<el-dialog v-model="visible" :title="title" :width="500" :close-on-click-modal="false" :draggable="true"
|
|
@close="cancel">
|
|
<el-form ref="formRef" :model="formValue" label-width="100px">
|
|
<!-- 用户代号 -->
|
|
<el-form-item label="用户代号:">
|
|
<el-input v-model="formValue.yhdh" :disabled="labelShow" placeholder="用户代号" />
|
|
</el-form-item>
|
|
|
|
<!-- 用户姓名 -->
|
|
<el-form-item label="用户姓名:">
|
|
<el-input v-model="formValue.userName" :disabled="labelShow" placeholder="用户姓名" />
|
|
</el-form-item>
|
|
|
|
<!-- 密码输入 -->
|
|
<el-form-item label="密码:" prop="mm" :rules="[{ required: true, message: '请输入密码', trigger: 'blur' }]">
|
|
<el-input ref="passwordRef" v-model="formValue.mm" type="password" placeholder="请输入密码"
|
|
@keyup.enter="handleConfirm" />
|
|
</el-form-item>
|
|
|
|
<!-- 操作选项 -->
|
|
<el-form-item label="" v-if="labelShow">
|
|
<el-radio-group v-model="formValue.type" @change="handleRadioChange">
|
|
<el-radio :label="1">仅修改当前标本</el-radio>
|
|
<el-radio :label="2">修改当天所有未审核并且无核对医生的标本</el-radio>
|
|
<el-radio :label="3"><span style="color: #f00;">修改当天所有未审核标本(将覆盖原有的核对医生)</span></el-radio>
|
|
<el-radio :label="4">
|
|
<el-row :gutter="5">
|
|
<el-col :span="8">指定样本号区间</el-col>
|
|
<template v-if="formValue.type == 4">
|
|
<el-col :span="8"> <el-input v-model="formValue.ybh1" size="small" /></el-col>
|
|
<el-col :span="8"><el-input v-model="formValue.ybh2" size="small" /></el-col>
|
|
</template>
|
|
</el-row>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<template #footer>
|
|
<div class="dialog-footer ">
|
|
<el-button type="primary" @click="handleConfirm"> 确定 </el-button>
|
|
<el-button @click="cancel"> 取消 </el-button>
|
|
</div>
|
|
</template>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { checkYsUser } from '@/api/liswork/work/LisWork'
|
|
const props = defineProps({
|
|
formValue: {
|
|
type: Object,
|
|
default: {
|
|
yhdh: '',
|
|
userName: '',
|
|
mm: '',
|
|
type: 1,
|
|
zdmc: '',
|
|
ybh1: '',
|
|
ybh2: '',
|
|
}
|
|
},
|
|
|
|
labPatKey: {
|
|
type: Object,
|
|
default: () => { }
|
|
},
|
|
labelShow: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
title: {
|
|
type: String,
|
|
default: '请输入审核人员密码...'
|
|
}
|
|
});
|
|
const visible = ref(false);
|
|
// 表单数据
|
|
|
|
|
|
const formRef = ref();
|
|
const passwordRef = ref();
|
|
const open = () => {
|
|
visible.value = true
|
|
nextTick(() => {
|
|
// formRef.value.clearValidate('mm');
|
|
// passwordRef.value.focus();
|
|
});
|
|
}
|
|
|
|
const emit = defineEmits(["confirm", "cancel",]);
|
|
// 处理确定按钮点击
|
|
const handleConfirm = async () => {
|
|
if (!formRef.value) return;
|
|
|
|
// 表单验证
|
|
const valid = await formRef.value.validate();
|
|
if (valid) {
|
|
console.log('Form is valid', props.formValue);
|
|
|
|
checkYsUser({ ...props.labPatKey, ...props.formValue, }).then((res: any) => {
|
|
if (res.code == 0) {
|
|
emit('confirm', props.formValue)
|
|
visible.value = false
|
|
}
|
|
})
|
|
|
|
}
|
|
};
|
|
|
|
// 处理取消按钮点击
|
|
const cancel = () => {
|
|
formRef.value?.resetFields();
|
|
visible.value = false
|
|
emit('cancel',)
|
|
};
|
|
|
|
|
|
|
|
const handleRadioChange = () => {
|
|
if (props.formValue.type == 4) {
|
|
props.formValue.ybh1 = ''
|
|
props.formValue.ybh2 = ''
|
|
}
|
|
}
|
|
|
|
defineExpose({
|
|
open,
|
|
cancel
|
|
})
|
|
</script>
|
|
|
|
<style scoped></style> |