| | |
| | | size="small" |
| | | :inline="true" |
| | | label-width="68px" |
| | | @submit.native.prevent |
| | | > |
| | | <el-form-item label="体检号" prop="reportDoctorCode"> |
| | | <el-input |
| | |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | style="width: 170px" |
| | | @input="onInput" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="姓名" prop="name"> |
| | | <!-- <el-form-item label="姓名" prop="name"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | | placeholder="请输入姓名" |
| | |
| | | :data="exaLists" |
| | | v-loading="loading" |
| | | border |
| | | max-height="350" |
| | | height="350" |
| | | @current-change="handleCurrentChange" |
| | | @selection-change="handleSelectionChange" |
| | | :row-class-name="tableRowClassName" |
| | |
| | | align="center" |
| | | label="选择" |
| | | width="40" |
| | | |
| | | > |
| | | <!-- :selectable="isSelectable" --> |
| | | <!-- :selectable="isSelectable" --> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="姓名" align="center" prop="name" width="80px" /> |
| | |
| | | align="center" |
| | | prop="examinationDate" |
| | | width="150px" |
| | | :formatter="formatDate" |
| | | /> |
| | | |
| | | <el-table-column label="门诊号" align="center" prop="mzh" width="140px" /> |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | |
| | | handleDateChange(val){ |
| | | onInput(val) { |
| | | this.inputVal = val.replace(/\s+/g, ""); // 清除所有空格 |
| | | }, |
| | | handleDateChange(val) { |
| | | if (val && val.length === 2) { |
| | | this.queryParams.start = val[0]; // 设置开始时间 |
| | | this.queryParams.end = val[1]; // 设置结束时间 |
| | | this.queryParams.end = val[1]; // 设置结束时间 |
| | | } else { |
| | | this.queryParams.start = null; |
| | | this.queryParams.end = null; |
| | | } |
| | | console.log('Query Params:', this.queryParams); |
| | | |
| | | console.log("Query Params:", this.queryParams); |
| | | }, |
| | | isSelectable(row) { |
| | | return !!row.mzh; |
| | | }, |
| | | // isSelectable(row) { |
| | | // return !!row.mzh; |
| | | // }, |
| | | tableRowClassName({ row }) { |
| | | return !row.mzh ? "row-disabled" : ""; |
| | | }, |
| | | formatDate(row) { |
| | | if (!row.examinationDate) return ""; |
| | | |
| | | // 使用 moment 解析指定格式的日期字符串 |
| | | const date = moment(row.examinationDate, "MM DD YYYY hh:mmA"); |
| | | |
| | | if (!date.isValid()) return "无效日期"; |
| | | |
| | | // 格式化为所需格式 |
| | | return date.format("YYYY-MM-DD HH:mm"); |
| | | }, |
| | | |
| | | handleSelectionChange(val) { |
| | |
| | | |
| | | this.selectedFirstTable = selectedRow; |
| | | console.log("当前选中的行数据:", this.selectedFirstTable); |
| | | this.fetchRightTableData(selectedRow); |
| | | const code = this.queryParams.tjNum; |
| | | if (!code) { |
| | | this.$message.warning("体检号不能为空!"); |
| | | return; // 直接返回,避免继续执行请求 |
| | | } |
| | | this.loading = true; |
| | | getRightList(code).then((response) => { |
| | | this.checkList = response.data; |
| | | this.loading = false; |
| | | }); |
| | | // this.fetchRightTableData(selectedRow); |
| | | } else { |
| | | this.selectedFirstTable = null; |
| | | this.checkList = []; |
| | |
| | | if (res.code == 200) { |
| | | this.loading = false; |
| | | this.exaLists = res.data; |
| | | this.code = this.exaLists.mzh; |
| | | // this.code = this.exaLists.mzh; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | |
| | | this.clearTimeSet = null; |
| | | this.$modal.closeLoading(); |
| | | // this.$modal.error("操作失败,请稍后重试"); |
| | | }) |
| | | }); |
| | | }, |
| | | }, |
| | | }; |