| | |
| | | </template> |
| | | |
| | | <!-- 点击弹出框 --> |
| | | <el-drawer custom-class="tanchu" |
| | | :visible.sync="drawer" |
| | | :before-close="handleClose" |
| | | :with-header="false" |
| | | size="100%" |
| | | :show-close="true"> |
| | | <div class="top"> |
| | | <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;" cellspacing="4"> |
| | | <caption style="background-color: #f8f8f9; font-size: 18px"> |
| | | {{ tableAll.cusName }}的体检资料 |
| | | </caption> |
| | | <el-drawer custom-class="tanchu" :visible.sync="drawer" :before-close="handleClose" :with-header="false" size="100%" |
| | | :show-close="true"> |
| | | <div class="top"> |
| | | <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;" |
| | | cellspacing="4"> |
| | | <caption style="background-color: #f8f8f9; font-size: 18px"> |
| | | {{ tableAll.cusName }}的体检资料 |
| | | </caption> |
| | | <tr style=" |
| | | border: 1px solid #dfe6ec; |
| | | border-collapse: collapse; |
| | |
| | | <!-- 动态建议组 --> |
| | | <div v-for="(advice, index) in newItem.map" :key="index" class="advice-group"> |
| | | <el-form-item label="建议标题" :prop="'map.' + index + '.bt'"> |
| | | <el-input v-model="advice.bt" placeholder="请输入建议标题" clearable></el-input> |
| | | <el-input v-model="advice.bt" placeholder="请输入建议标题" clearable @focus="tan"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="建议内容" :prop="'map.' + index + '.nr'"> |
| | | <el-input v-model="advice.nr" type="textarea" rows="3" placeholder="请输入建议内容" resize="none"></el-input> |
| | | <el-input v-model="advice.nr" type="textarea" rows="3" placeholder="请输入建议内容" resize="none" @focus="tan"></el-input> |
| | | </el-form-item> |
| | | <el-button v-if="index > 0" type="danger" size="small" @click="removeAdvice(index)" |
| | | style="margin-left: 100px; margin-bottom: 10px;">删除</el-button> |
| | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addNewDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitNewItem">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="快捷建议选择" :visible.sync="showjianyi" width="1000px" class="custom-dialog"> |
| | | <!-- 添加筛选下拉框 --> |
| | | <div style="margin-bottom: 15px;"> |
| | | <el-form :inline="true"> |
| | | <el-form-item label="科室"> |
| | | <el-select v-model="queryParams1.ks" placeholder="请选择或输入科室" clearable filterable allow-create |
| | | style="width: 200px" @change="filterAdvices(true)"> |
| | | <el-option v-for="dept in deptList" :key="dept" :label="dept" :value="dept" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <el-table :data="advicerulesList" ref="adviceTable" border highlight-current-row |
| | | @current-change="handleCurrentChangeAdvice" style="max-height: 400px; overflow-y: auto;"> |
| | | <el-table-column label="科室" prop="ks" width="100" align="center" /> |
| | | <el-table-column label="建议名称" prop="jymc" align="center" /> |
| | | <el-table-column label="建议内容" prop="jynr" align="center" /> |
| | | </el-table> |
| | | |
| | | |
| | | |
| | | <!-- 分页组件 --> |
| | | <pagination v-show="total1 > 0" :total="total1" :page.sync="queryParams1.pageNum" |
| | | :limit.sync="queryParams1.pageSize" @pagination="filterAdvices(false)" /> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="showjianyi = false">取消</el-button> |
| | | <el-button type="primary" @click="applySelectedAdvice" :disabled="!selectedAdvice">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <Packages ref="bbb" :baogao="baogao" /> |
| | |
| | | import { getconfigKey } from "@/api/login"; |
| | | import moment from "moment"; |
| | | import { get } from "sortablejs"; |
| | | |
| | | import { |
| | | listAdvicerules, |
| | | } from "@/api/hosp/advicerules"; |
| | | export default { |
| | | components: { |
| | | ViewPdf, |
| | |
| | | name: "checkAll", |
| | | data() { |
| | | return { |
| | | deptList: [], // 去重后的科室列表 |
| | | selectedAdvice: null, |
| | | activeAdviceIndex: 0, |
| | | advicerulesList: [], |
| | | showjianyi: false, |
| | | addNewDialogVisible: false, |
| | | newItem: { |
| | | parentName: '', // 项目分类,对应模板中的 parentName |
| | |
| | | tjCategory: undefined, |
| | | payType: undefined, |
| | | }, |
| | | total1: 0, |
| | | queryParams1: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | ks: '' |
| | | }, |
| | | status1: 0, // 0展示异常1展示项目情况 |
| | | viewportHeight: 0, |
| | | expends: [], |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | handleCurrentChangeAdvice(currentRow) { |
| | | this.selectedAdvice = currentRow; // 存储选中的建议项 |
| | | }, |
| | | applySelectedAdvice() { |
| | | if (this.selectedAdvice) { |
| | | this.$set(this.newItem.map, this.activeAdviceIndex, { |
| | | bt: this.selectedAdvice.jymc, // 建议名称赋值给标题 |
| | | nr: this.selectedAdvice.jynr // 建议内容赋值给内容 |
| | | }); |
| | | this.showjianyi = false; // 关闭弹窗 |
| | | this.selectedAdvice = null; // 清空选中项 |
| | | } else { |
| | | this.$message.warning('请先选择一条建议'); |
| | | } |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | console.log(selection); |
| | | |
| | | }, |
| | | tan(event) { |
| | | this.activeAdviceIndex = event.target.closest('.advice-group') |
| | | ? Array.from(event.target.closest('.el-form').querySelectorAll('.advice-group')) |
| | | .indexOf(event.target.closest('.advice-group')) |
| | | : 0; // 获取当前建议组的索引 |
| | | |
| | | // 确保 projectCategories 已加载 |
| | | if (!this.projectCategories || this.projectCategories.length === 0) { |
| | | cSWebGetPro(this.tjNumber).then((res) => { |
| | | if (res.data && Array.isArray(res.data)) { |
| | | this.projectCategories = res.data; |
| | | // 提取去重后的科室列表 |
| | | this.deptList = [...new Set(this.projectCategories.map(item => item.deptName))].filter(Boolean); |
| | | } else { |
| | | this.$message.warning('未获取到项目分类数据'); |
| | | this.projectCategories = []; |
| | | this.deptList = []; |
| | | } |
| | | }).catch((error) => { |
| | | console.error('获取项目分类失败:', error); |
| | | this.$message.error('获取项目分类失败'); |
| | | this.projectCategories = []; |
| | | this.deptList = []; |
| | | }); |
| | | } else { |
| | | // 如果 projectCategories 已加载,直接更新 deptList |
| | | this.deptList = [...new Set(this.projectCategories.map(item => item.deptName))].filter(Boolean); |
| | | } |
| | | |
| | | // 重置分页参数 |
| | | this.queryParams1.pageNum = 1; |
| | | this.queryParams1.pageSize = 10; |
| | | |
| | | // 加载快捷建议列表 |
| | | this.filterAdvices(); |
| | | this.showjianyi = true; |
| | | }, |
| | | |
| | | // 下拉框筛选快捷建议(包含分页逻辑) |
| | | filterAdvices(resetPage = false) { |
| | | if (resetPage) { |
| | | this.queryParams1.pageNum = 1; // 切换科室时重置页码为 1 |
| | | } |
| | | listAdvicerules(this.queryParams1).then((response) => { |
| | | this.advicerulesList = response.rows; |
| | | this.total1 = response.total; |
| | | }).catch((error) => { |
| | | console.error('筛选快捷建议失败:', error); |
| | | this.$message.error('筛选快捷建议失败'); |
| | | }); |
| | | }, |
| | | submitNewItem() { |
| | | const data = { |
| | | tjh: this.tableAll.tjNumber, // 体检号,从 tableAll 中获取 |
| | |
| | | }, |
| | | |
| | | handleCategoryChange(value) { |
| | | |
| | | const selectedCategory = this.projectCategories.find(item => item.proName === value); |
| | | console.log(this.projectCategories, selectedCategory); |
| | | this.queryParams1.ks = selectedCategory.deptName || ''; |
| | | if (value) { |
| | | this.newItem.jcxm = value; // 将选择的项目分类赋值给检测项目 |
| | | } |
| | |
| | | shanchu({ |
| | | id: row.orderDetailId, |
| | | }).then((res) => { |
| | | console.log(res); |
| | | // 找到要删除项所在的父级数组 |
| | | const parentItem = this.yichangList.find(item => |
| | | item.sone.some(soneItem => soneItem.proId === row.proId) |
| | | ); |
| | | if (res.code === 200) { // 添加成功响应检查 |
| | | // 找到要删除项所在的父级数组 |
| | | const parentItem = this.yichangList.find(item => |
| | | item.sone.some(soneItem => soneItem.proId === row.proId) |
| | | ); |
| | | |
| | | if (parentItem) { |
| | | // 从父级的 sone 数组中删除该项 |
| | | const index = parentItem.sone.findIndex(item => item.proId === row.proId); |
| | | if (index > -1) { |
| | | parentItem.sone.splice(index, 1); |
| | | if (parentItem) { |
| | | // 从父级的 sone 数组中删除该项 |
| | | const index = parentItem.sone.findIndex(item => item.proId === row.proId); |
| | | if (index > -1) { |
| | | parentItem.sone.splice(index, 1); |
| | | |
| | | // 如果删除后 sone 数组为空,则删除整个父级项 |
| | | if (parentItem.sone.length === 0) { |
| | | const parentIndex = this.yichangList.indexOf(parentItem); |
| | | if (parentIndex > -1) { |
| | | this.yichangList.splice(parentIndex, 1); |
| | | // 如果删除后 sone 数组为空,则删除整个父级项 |
| | | if (parentItem.sone.length === 0) { |
| | | const parentIndex = this.yichangList.indexOf(parentItem); |
| | | if (parentIndex > -1) { |
| | | this.yichangList.splice(parentIndex, 1); |
| | | } |
| | | } |
| | | |
| | | // 更新 expends 数组 |
| | | this.getExpends(); |
| | | |
| | | this.$message.success('删除成功'); |
| | | |
| | | // 自动更新异常结果数据 |
| | | this.yichangjieguo(); |
| | | } |
| | | |
| | | // 更新 expends 数组 |
| | | this.getExpends(); |
| | | |
| | | this.$message.success('删除成功'); |
| | | } |
| | | } else { |
| | | this.$message.error('删除失败'); |
| | | } |
| | | }) |
| | | |
| | | }).catch((error) => { |
| | | console.error('删除失败:', error); |
| | | this.$message.error('删除操作失败'); |
| | | }); |
| | | }, |
| | | getConfigKey() { |
| | | getconfigKey("sfkqtwbg").then((res) => { |
| | |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | /* 确保分页器整体居中 */ |
| | | align-items: center; |
| | | /* 垂直居中 */ |
| | | margin-top: 15px; |
| | | /* 与表格的间距 */ |
| | | } |
| | | |
| | | .pag1 { |
| | | width: 30%; |
| | | width: auto; |
| | | /* 移除固定宽度,让分页器根据内容自适应 */ |
| | | min-width: 300px; |
| | | /* 设置最小宽度,确保分页器不会太窄 */ |
| | | text-align: center; |
| | | /* 确保分页器内部元素居中 */ |
| | | } |
| | | |
| | | .dialog-footers { |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | .dialog-pager { |
| | | display: flex; |
| | | justify-content: center; |
| | | /* 水平居中 */ |
| | | align-items: center; |
| | | /* 垂直居中 */ |
| | | margin-top: 15px; |
| | | /* 与表格的间距 */ |
| | | padding: 0 20px; |
| | | /* 增加内边距,避免过于贴边 */ |
| | | box-sizing: border-box; |
| | | /* 确保内边距不影响宽度 */ |
| | | } |
| | | |
| | | // .dialog-pager-inner { |
| | | // width: auto; /* 自适应宽度 */ |
| | | // min-width: 300px; /* 设置最小宽度,确保分页器不会太窄 */ |
| | | // text-align: center; /* 确保分页器内部元素居中 */ |
| | | // }</style> |