|
|
<template> <div style="display: flex"> <div style="display: flex; flex-wrap: wrap; height:100px;"> <div class="query"> <span>体检单位/次数:</span> <el-cascader v-model="patientRegister.query.customerOrgId" :options="patientRegister.customerOrgTreeAll" :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" placeholder="请选择单位" :show-all-levels="false" clearable size="small" @change="changeCustomerOrgId" style="width:180px;"> </el-cascader> <el-select v-model="patientRegister.query.customerOrgRegister" placeholder="次数" style="width: 60px" size="small" :disabled="patientRegister.query.customerOrgId == dict.personOrgId" @change="changeMedicalTimes" value-key="id"> <el-option v-for="item in customerOrg.customerOrgRegisterList" :key="item.id" :label="item.medicalTimes" :value="item" /> </el-select> </div> <div class="query"> <el-select v-model="patientRegister.query.dateType" placeholder="请选择" filterable clearable size="small" style="width: 100px"> <el-option label="登记日期" value="creationTime" /> <el-option label="体检日期" value="medicalStartDate" /> <el-option label="总检日期" value="summaryDate" /> </el-select> <el-date-picker v-model="patientRegister.query.dateRange" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" size="small" style="width: 240px"> </el-date-picker> </div> <div class="query"> <span>条码号:</span> <el-input placeholder="条码号" v-model="patientRegister.query.patientRegisterNo" size="small" clearable style="width: 150px" /> </div> <div class="query"> <span>档案号:</span> <el-input placeholder="档案号" v-model="patientRegister.query.patientNo" size="small" clearable style="width: 135px" /> </div> <div class="query"> <span>姓名:</span> <el-input placeholder="姓名" v-model="patientRegister.query.patientName" size="small" clearable style="width: 100px" /> </div> <div class="query"> <span>性别:</span> <el-select v-model="patientRegister.query.sex" placeholder="请选择" style="width: 80px" size="small"> <el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id" /> </el-select> </div> <div class="query"> <span>身份证号:</span> <el-input placeholder="身份证号" v-model="patientRegister.query.idCardNo" size="small" clearable style="width: 180px" /> </div> <div class="query"> <span>状态:</span> <el-select v-model="patientRegister.query.completeFlag" placeholder="请选择" clearable style="width: 80px" size="small"> <el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName" :value="item.id"> </el-option> </el-select> </div> </div> </div></template><script>import { mapState } from "vuex";import { getapi, postapi, putapi, deletapi } from "@/api/api";
export default { components: {}, props: ["orgEnable"], data() { return { dialogVisible: false,
pickerOptions: { shortcuts: [ { text: "最近一周", onClick(picker) { const end = new Date(); const start = new Date(); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); picker.$emit("pick", [start, end]); }, }, { text: "最近一个月", onClick(picker) { const end = new Date(); const start = new Date(); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); picker.$emit("pick", [start, end]); }, }, { text: "最近三个月", onClick(picker) { const end = new Date(); const start = new Date(); start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); picker.$emit("pick", [start, end]); }, }, ], }, }; },
created() { },
//挂载完成
mounted() { },
computed: { ...mapState(["window", "dict", "patientRegister", "customerOrg"]), }, methods: {
//选择单位
changeCustomerOrgId(v) { console.log(v) if (!v) { this.patientRegister.query.customerOrgRegister = null; return; }
let customerOrgId = v[0]; if (customerOrgId == this.dict.personOrgId) { this.patientRegister.query.customerOrgRegister = null; return; } getapi( `/api/app/customer-org-register/in-customer-org-id/${customerOrgId}` ).then((res) => { //console.log('res.data',res.data)
if (res.code != -1) { this.customerOrg.customerOrgRegisterList = res.data; if (res.data.length > 0) { this.patientRegister.query.customerOrgRegister = res.data[res.data.length - 1]; this.patientRegister.query.dateRange = [ res.data[res.data.length - 1].beginTime, res.data[res.data.length - 1].isComplete == 'N' ? new Date() : res.data[res.data.length - 1].endTime ] } } }); },
//选择单位体检次数是,更新起止日期
changeMedicalTimes(v){ this.patientRegister.query.customerOrgRegister = v; this.patientRegister.query.dateRange = [ v.beginTime, v.isComplete == 'N' ? new Date() : v.endTime ]; } },};</script><style scoped>.query { margin-left: 10px;}</style>
|