| | |
| | | v-show="showSearch" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="体检号" prop="tjNum"> |
| | | <el-form-item label="体检号" prop="tjNumber"> |
| | | <el-input |
| | | ref="inputName" |
| | | v-model="queryParams.tjNum" |
| | | v-model="queryParams.tjNumber" |
| | | placeholder="请输入体检号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | |
| | | @input="radioChange" |
| | | style="margin: 10px 15px" |
| | | > |
| | | <el-radio-button label="1">未采样</el-radio-button> |
| | | <el-radio-button label="0">已采样</el-radio-button> |
| | | <el-radio-button label="1" :disabled="qiehuan && disabledId === 0">未采样</el-radio-button> |
| | | <el-radio-button label="0" :disabled="qiehuan && disabledId === 1">已采样</el-radio-button> |
| | | </el-radio-group> |
| | | </el-col> |
| | | <el-col |
| | |
| | | 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" |
| | | @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> |
| | |
| | | pageNum: 1, |
| | | pageSize: 20, |
| | | name: null, |
| | | tjNum: null, |
| | | tjNumber: null, |
| | | applicationTime: null, |
| | | isSignFor: null, |
| | | tjTime: null, |
| | |
| | | this.selectList[this.selectList.length - 1].isMerge === 1 |
| | | ); |
| | | }, |
| | | qiehuan() { |
| | | return ( |
| | | this.selectList.length > 0 |
| | | ); |
| | | }, |
| | | disabledId() { |
| | | return ( |
| | | this.tjStatus == "1" ? 1 : 0 |
| | | ); |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | 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 }; // 返回结果 |
| | | }, |
| | | |
| | |
| | | // 判断是否需要刷新右边表格 |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | this.fetchData(this.samplingList[0].cusId); |
| | | // this.fetchData(this.samplingList[0].tjNumber); |
| | | }); |
| | | } |
| | | this.total = response.data.total; |
| | |
| | | this.form = { |
| | | id: null, |
| | | samplingNumber: null, |
| | | cusId: null, |
| | | tjNumber: null, |
| | | applicationTime: null, |
| | | isSignFor: null, |
| | | tjTime: null, |
| | |
| | | updateTime: null, |
| | | deleted: null, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | hb() { |
| | | if (this.queryParams.tjNum != null) { |
| | | if (this.queryParams.tjNumber != null) { |
| | | this.handleQuery(); |
| | | } |
| | | }, |
| | |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.createTimeList = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // 单选框选中数据 |
| | |
| | | // 只有一个人被选中时进行操作 |
| | | if (selection.length === 1) { |
| | | const selectedPerson = selection[0]; // 获取选中的那个人 |
| | | const cusId = selectedPerson.cusId; // 假设cusId在选中的对象中 |
| | | const tjNumber = selectedPerson.tjNumber; |
| | | console.log(selectedPerson.tjNumber, 6363); |
| | | |
| | | this.fetchData(cusId); |
| | | this.fetchData(tjNumber); |
| | | } else { |
| | | // 如果选中多人,则取消选中 |
| | | if (selection.length > 1) { |
| | |
| | | this.selectedRows = selection; |
| | | }, |
| | | |
| | | fetchData(cusId) { |
| | | fetchData(tjNumber) { |
| | | this.loading = true; // 显示加载状态 |
| | | |
| | | getCusCyList(cusId, this.tjStatus) // 调用API获取数据 |
| | | getCusCyList(tjNumber, 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 = []; |
| | |
| | | |
| | | /** 点击补打条码按钮 **/ |
| | | async Collection() { |
| | | // console.log("selectList:", this.selectList); |
| | | const jyxh = this.selectList.map((item) => item.jyxh); |
| | | console.log("jyxh:", jyxh); |
| | | try { |
| | | // 请求接口并获取宽度值 |
| | | const widthResponse = await getTxmkd(); |
| | | const barcodeWidth = `${Number(widthResponse.msg)}%` || "70%"; // 获取宽度值,默认使用 70% |
| | | |
| | | const jyxh = this.selectList.map((item) => item.jyxh); |
| | | // const jyxh = this.selectList.map((item) => item.jyxh); |
| | | |
| | | await this.$nextTick(); // 确保 DOM 更新 |
| | | // await this.$nextTick(); // 确保 DOM 更新 |
| | | |
| | | jyxh.forEach((number, index) => { |
| | | const barcodeContent = number; // 确保 jyxh 是有效的 |
| | |
| | | } |
| | | }); |
| | | |
| | | await this.$nextTick(); // 确保条形码生成完成 |
| | | // await this.$nextTick(); |
| | | |
| | | const barcodeElements = jyxh.map((_, index) => |
| | | document.querySelector(`#barcode${index}`) |
| | |
| | | const newWindow = window.open("", "_blank", "width=800,height=600"); |
| | | const printContents = document.getElementById("printSection").innerHTML; |
| | | |
| | | console.log(printContents); |
| | | // console.log(printContents); |
| | | newWindow.document.write(` |
| | | <html> |
| | | <head> |
| | |
| | | // console.log(selection); |
| | | |
| | | this.selectList = selection; |
| | | console.log(this.selectList, 5555); |
| | | |
| | | this.ids = selection.map((item) => item.id); |
| | | }, |
| | |
| | | // 确认采样 |
| | | 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) => { |
| | | this.$modal.msgSuccess("采样成功"); |
| | | this.getList(); |
| | | if (res.code === 200) { |
| | | // this.$modal.msgSuccess("采样成功"); |
| | | |
| | | this.Collection(); |
| | | this.getList(); |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | // this.getList(); |
| | | }) |
| | | .catch((error) => { |
| | | this.$message.error("采样失败"); |
| | |
| | | |
| | | // 单选按钮 |
| | | radioChange(value) { |
| | | this.loading = true; |
| | | this.queryParams.isSignFor = value; |
| | | getList(this.queryParams).then((response) => { |
| | | if (response.data) { |
| | | if (response.data.list == null) { |
| | | |
| | | if (this.selectList.length > 0) { |
| | | alert("已选中后禁止切换"); |
| | | |
| | | } else { |
| | | console.log("切换"); |
| | | |
| | | this.loading = true; |
| | | this.queryParams.isSignFor = value; |
| | | getList(this.queryParams).then((response) => { |
| | | if (response.data) { |
| | | if (response.data.list == null) { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | this.loading = false; |
| | | if (this.samplingList.length != 0) { |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | }); |
| | | } else { |
| | | this.$refs.tb.clearSelection(); |
| | | } |
| | | } |
| | | this.total = response.data.total; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | this.loading = false; |
| | | if (this.samplingList.length != 0) { |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | }); |
| | | } else { |
| | | this.$refs.tb.clearSelection(); |
| | | } |
| | | } |
| | | this.total = response.data.total; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 } |