| | |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="1000px" |
| | | width="1080px" |
| | | append-to-body |
| | | > |
| | | <h3 v-if="fList.proResult">检测项目 :{{ fList.project.proName }}</h3> |
| | | <h3 v-if="fList.proResult"> |
| | | 检测结果 :{{ fList.proResult }}{{ fList.project.proMetering }} |
| | | </h3> |
| | | <el-form |
| | | <!-- <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="病种名称" prop="bingzhong"> |
| | | > --> |
| | | <!-- <el-form-item label="病种名称" prop="bingzhong"> |
| | | <el-input |
| | | v-model="queryParams.bingzhong" |
| | | placeholder="请输入简称" |
| | |
| | | @click="handleQuery" |
| | | >搜索</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <h3 style="margin-left: 160px;">已选项目</h3> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item> |
| | | <h3 >{{ queryParams.proName || '暂无项目名称' }}</h3> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item> |
| | | <h3 style="margin-left: 160px">已选项目</h3> |
| | | </el-form-item> --> |
| | | <!-- </el-form> --> |
| | | <h2 style="text-align: center; margin-top: -30px"> |
| | | {{ queryParams.proName || "暂无项目名称" }} |
| | | </h2> |
| | | <div style="display: flex; width: 100%"> |
| | | <div style="width: 50%; margin-right: 30px"> |
| | | <div style="width: 50%; margin-right: 40px"> |
| | | <el-table |
| | | :data="dataList" |
| | | ref="multipleTable" |
| | |
| | | width="50px" |
| | | /> |
| | | <!-- <el-table-column label="规则" align="center" prop="ruleStr" /> --> |
| | | <el-table-column label="检查结论" align="center" prop="ruleStr" /> |
| | | <el-table-column label="检查所见" align="center" prop="yxbx" /> |
| | | <el-table-column label="检查结论" align="center" prop="ruleStr" /> |
| | | </el-table> |
| | | <div class="pag"> |
| | | <div class="pag1" style="margin-left: 600px"> |
| | | <div class="pag1" style="margin-left: 630px"> |
| | | <pagination |
| | | small |
| | | v-show="total > 0" |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="width: 100%; height: 610px"> |
| | | <div style="width: 100%; height: 600px"> |
| | | <!-- <h3 style="margin-top: -30px;">已选项目</h3> --> |
| | | <el-form |
| | | :model="form" |
| | | ref="queryForm" |
| | | size="small" |
| | | |
| | | label-width="68px" |
| | | :inline="true" |
| | | > |
| | | <!-- :inline="true" --> |
| | | <!-- :inline="true" --> |
| | | <!-- <el-form-item> |
| | | <el-input |
| | | type="textarea" |
| | |
| | | v-model="form.jcsj" |
| | | clearable |
| | | type="textarea" |
| | | :autosize="{ minRows: 8}" |
| | | :autosize="{ minRows: 8 }" |
| | | style="width: 380px" |
| | | /> |
| | | </el-form-item> |
| | |
| | | v-model="form.desc" |
| | | clearable |
| | | type="textarea" |
| | | :autosize="{ minRows: 8 }" |
| | | :autosize="{ minRows: 8 }" |
| | | style="width: 380px" |
| | | /> |
| | | </el-form-item> |
| | |
| | | checkStatus: { |
| | | type: String, |
| | | default: "0", |
| | | validator: value => ["0", "1"].includes(value) |
| | | validator: (value) => ["0", "1"].includes(value), |
| | | }, |
| | | proResult: { |
| | | type: String, |
| | | default: '' |
| | | default: "", |
| | | }, |
| | | conclusion: { |
| | | type: String, |
| | | default: '' |
| | | default: "", |
| | | }, |
| | | projectList: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | proSex: { |
| | | type: String, |
| | | default: "2" |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | // 弹出层标题 |
| | | title: "", |
| | | yxbx: "", |
| | | proName: "", |
| | | // lastDesc: "", |
| | | total: 0, |
| | | dataList: [], |
| | |
| | | queryParams: { |
| | | bingzhong: "", |
| | | bzPinyin: "", |
| | | proId: "", |
| | | proSex: "2", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }, |
| | |
| | | }, |
| | | watch: { |
| | | checkStatus(newValue) { |
| | | console.log( newValue,9988); |
| | | if (newValue === "1") { |
| | | this.updateData(this.proResult, this.conclusion); |
| | | } |
| | | }, |
| | | projectList: { |
| | | immediate: true, |
| | | deep: true, |
| | | handler(newVal) { |
| | | console.log("收到的项目数据:", newVal); |
| | | // 你可以在这里处理数据,比如保存到 data 或做逻辑判断 |
| | | if (newVal && newVal.length > 0) { |
| | | const firstProject = newVal[0]; // 你也可以遍历所有项目,看你业务需求 |
| | | this.queryParams.proId = firstProject.proId; // 假设项目中叫 id |
| | | this.proName = firstProject.proName; |
| | | } |
| | | }, |
| | | }, |
| | | proSex: { |
| | | handler(newVal) { |
| | | this.queryParams.proSex = newVal; |
| | | this.getList(); |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | mounted() {}, |
| | | |
| | | created() {}, |
| | | created() { |
| | | this.queryParams.proSex = this.proSex; |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | async getList() { |
| | | try { |
| | | this.loading = true; // 添加加载状态 |
| | | |
| | | const res = await getlist(this.queryParams); |
| | | this.dataList = res.rows; |
| | | this.total = res.total; |
| | | |
| | | |
| | | // 如果需要选中操作,将其封装为独立方法 |
| | | await this.handleAutoSelection(); |
| | | } catch (error) { |
| | | console.error('获取数据失败:', error); |
| | | this.$message.error('获取数据失败'); |
| | | console.error("获取数据失败:", error); |
| | | this.$message.error("获取数据失败"); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | |
| | | // 封装选中逻辑 |
| | | async handleAutoSelection() { |
| | | if (!this.fList?.rulesList?.length) return; |
| | | |
| | | |
| | | await this.$nextTick(); |
| | | this.dataList.forEach(item => { |
| | | const shouldSelect = this.fList.rulesList.some(rule => rule.aid === item.aid); |
| | | this.dataList.forEach((item) => { |
| | | const shouldSelect = this.fList.rulesList.some( |
| | | (rule) => rule.aid === item.aid |
| | | ); |
| | | if (shouldSelect) { |
| | | this.$refs.multipleTable?.toggleRowSelection(item, true); |
| | | } |
| | |
| | | |
| | | handleQuery() { |
| | | if (this.searchDebounce) clearTimeout(this.searchDebounce); |
| | | |
| | | |
| | | this.searchDebounce = setTimeout(() => { |
| | | this.queryParams.pageNum = 1; // 重置页码 |
| | | this.getList(); |
| | |
| | | }, |
| | | |
| | | handleSelectionChange(selection) { |
| | | this.list = selection; |
| | | // this.list = selection; |
| | | this.list = [...selection]; |
| | | this.updateFormContent(selection); |
| | | }, |
| | | |
| | | updateFormContent(selection) { |
| | | if (!selection.length) return; |
| | | |
| | | // 如果处于检查状态,使用传入的值 |
| | | if (this.checkStatus === "1") { |
| | | this.updateData(this.proResult, this.conclusion); |
| | |
| | | } |
| | | |
| | | // 重置表单内容 |
| | | this.form.desc = ''; |
| | | this.form.jcsj = ''; |
| | | this.form.desc = ""; |
| | | this.form.jcsj = ""; |
| | | |
| | | // 使用map和join替代forEach和字符串拼接 |
| | | this.form.desc = selection |
| | | .map(item => item.bingzhong || item.ruleStr) |
| | | .filter(Boolean) |
| | | .join(','); |
| | | |
| | | this.form.jcsj = selection |
| | | .map(item => item.yxbx) |
| | | .filter(Boolean) |
| | | .join(','); |
| | | if (selection.length > 0) { |
| | | this.form.desc = selection |
| | | .map((item) => item.bingzhong || item.ruleStr) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | |
| | | this.form.jcsj = selection |
| | | .map((item) => item.yxbx) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | } |
| | | }, |
| | | |
| | | handleOk() { |
| | | if (!this.form.desc && !this.form.jcsj) { |
| | | this.$message.warning('请选择数据'); |
| | | this.$message.warning("请选择数据"); |
| | | return; |
| | | } |
| | | |
| | |
| | | this.resetForm(); |
| | | this.open = false; |
| | | } catch (error) { |
| | | console.error('处理数据失败:', error); |
| | | this.$message.error('操作失败'); |
| | | console.error("处理数据失败:", error); |
| | | this.$message.error("操作失败"); |
| | | } |
| | | }, |
| | | |
| | | resetForm() { |
| | | this.form.desc = ''; |
| | | this.form.jcsj = ''; |
| | | this.form.desc = ""; |
| | | this.form.jcsj = ""; |
| | | this.list = []; |
| | | if (this.$refs.multipleTable) { |
| | | this.$refs.multipleTable.clearSelection(); |
| | |
| | | isCheckMode() { |
| | | return this.checkStatus === "1"; |
| | | }, |
| | | |
| | | |
| | | hasSelectedItems() { |
| | | return this.list.length > 0; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-dialog__body{ |
| | | .el-dialog__body { |
| | | padding: 10px 20px; |
| | | } |
| | | ::v-deep .el-dialog__footer { |