| | |
| | | v-if="samplingList.length > 0 && tjStatus == 1" |
| | | > |
| | | <el-button type="primary" @click="Merging">合并项目</el-button> |
| | | <el-button |
| | | <!-- <el-button |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | style="margin: 0 15px" |
| | | v-hasPermi="['hosp:detail:add']" |
| | | @click="Confirmreceipt" |
| | | >确认采样</el-button |
| | | > |
| | | > --> |
| | | <el-button type="primary" :disabled="!disabled" @click="Cancellation" |
| | | >撤销合并</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | :disabled="!selectList.length" |
| | | @click="Collection" |
| | | >采样打码</el-button |
| | | > |
| | | <el-button type="primary" @click="Confirmreceipt">采样打码</el-button> |
| | | </el-col> |
| | | <el-col |
| | | :span="12" |
| | |
| | | </el-table> |
| | | </div> |
| | | <div style="width: 50%"> |
| | | <!-- :default-sort="{ prop: 'specimenType', order: 'ascending' }" :default-sort="{ prop: 'specimenType', order: 'ascending' }" |
| | | @sort-change="handleSortChange" |
| | | :span-method="objectSpanMethod" |
| | | @selection-change="handleChange" ref="tab1" |
| | | :row-class-name="tableRowClassName"--> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="tableList" |
| | | :span-method="objectSpanMethod" |
| | | @sort-change="handleSortChange" |
| | | @selection-change="handleChange" |
| | | border |
| | | height="520px" |
| | | :span-method="objectSpanMethod" |
| | | ref="tab1" |
| | | :row-class-name="tableRowClassName" |
| | | border |
| | | height="520px" |
| | | > |
| | | <el-table-column type="selection" width="40" align="center" /> |
| | | <!-- :selectable="selectEnable" --> |
| | |
| | | </div> |
| | | <div class="tj"> |
| | | <span>体检中心</span> |
| | | <span>{{ item.cardId.substring(0, 14) }}</span> |
| | | <!-- <span>{{ item.cardId ? item.cardId.substring(0, 14) : '' }}</span> --> |
| | | <!-- <span>{{ item.cardId.slice(0, 14) }}</span> --> |
| | | <!-- <span>{{ item.cardId }}</span> --> |
| | | <span>{{ item.cardId ? item.cardId.substring(0, 14) : "" }}</span> |
| | | </div> |
| | | <div class="tj"> |
| | | <span>{{ item.jyxh }}</span> |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | handleSortChange({ prop, order }) { |
| | | if (order === null) return; // 无排序时不处理 |
| | | |
| | | this.tableList.sort((a, b) => { |
| | | // 如果标本类型相同,继续按照采样编号排序 |
| | | if (a.jyxh !== b.jyxh) { |
| | | return order === "ascending" ? a.jyxh - b.jyxh : b.jyxh - a.jyxh; |
| | | } |
| | | |
| | | return 0; |
| | | }); |
| | | }, |
| | | getTruncatedName(proName) { |
| | | // 去掉所有空格 |
| | | const trimmedProName = proName.replace(/\s+/g, ""); |
| | | |
| | | const number = this.msg; |
| | | |
| | | const truncated = |
| | | trimmedProName.length > number |
| | | ? trimmedProName.slice(0, number) |
| | | : trimmedProName; |
| | | const remaining = |
| | | let remaining = |
| | | trimmedProName.length > number ? trimmedProName.slice(number) : ""; |
| | | |
| | | if (remaining.length > number) { |
| | | remaining = remaining.slice(0, number) + "..."; |
| | | } |
| | | return { truncated, remaining }; // 返回结果 |
| | | }, |
| | | |
| | |
| | | getCusCyList(cusId, this.tjStatus) // 调用API获取数据 |
| | | .then((response) => { |
| | | if (response.data) { |
| | | console.log(response, 2525); |
| | | |
| | | this.tableList = response.data; // 确认 list 存在后再进行赋值 |
| | | // console.log(this.tableList, 123); |
| | | } else { |
| | | // 如果没有数据或 list 为空,清空表格并提示 |
| | | this.tableList = []; |
| | |
| | | // 确认采样 |
| | | Confirmreceipt() { |
| | | let data = this.ids; |
| | | if (data.length === 0) { |
| | | // 如果没有已合并的项目,给出提示信息 |
| | | this.$message.error("没有已合并的项目可以撤销!"); |
| | | return; |
| | | } |
| | | console.log(this.ids, 999); |
| | | |
| | | const loadingInstance = this.$loading({ |
| | | lock: true, // 锁定屏幕 |
| | | text: "加载中...", // 加载文本 |
| | | spinner: "el-icon-loading", // 自定义加载图标 |
| | | background: "rgba(255, 255, 255, 0.7)", // 背景颜色 |
| | | }); |
| | | confirmSampling(data) |
| | | confirmSampling(this.ids) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$modal.msgSuccess("采样成功"); |
| | | this.getList(); |
| | | this.Collection(); |
| | | }else{ |
| | | this.$message.error(res.msg) |
| | | } |
| | | // this.getList(); |
| | | }) |
| | | .catch((error) => { |
| | | this.$message.error("采样失败"); |
| | | this.$message.error(res.msg); |
| | | }) |
| | | .finally(() => { |
| | | loadingInstance.close(); |