| | |
| | | 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" |
| | | @click="Confirmreceipt" |
| | | :disabled="!selectList.length" |
| | | @click="Collection" |
| | | >采样打码</el-button |
| | | > |
| | | </el-col> |
| | |
| | | style="margin: 10px 15px" |
| | | v-show="samplingList.length > 0 && tjStatus == 0" |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | :disabled="!selectList.length" |
| | | @click="Collection" |
| | | <el-button type="primary" :disabled="!selectList.length" @click="buda" |
| | | >补打条码</el-button |
| | | > |
| | | <!-- @click="Collection" --> |
| | | <el-button type="primary" :disabled="!disabled" @click="Cancellation" |
| | | >撤销合并</el-button |
| | | > |
| | |
| | | </el-table> |
| | | </div> |
| | | <div style="width: 50%"> |
| | | <!-- v-if="this.rightTabShow" --> |
| | | <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 v-for="(item, index) in selectList" :key="index"> |
| | | <svg :id="'barcode' + index"></svg> |
| | | <div class="name">{{ item.proName }}</div> |
| | | <div class="name">{{ getTruncatedName(item.proName).truncated }}</div> |
| | | <div class="name1"> |
| | | {{ getTruncatedName(item.proName).remaining }} |
| | | </div> |
| | | <!-- <div class="name">{{ item.proName.slice(0, msg) }}</div> |
| | | <div class="name1"> |
| | | {{ item.proName.slice(msg) }} |
| | | </div> --> |
| | | <div class="last"> |
| | | <p>{{ item.cusName }}</p> |
| | | <div> |
| | |
| | | </div> |
| | | <div class="tj"> |
| | | <span>体检中心</span> |
| | | <span>{{ 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> |
| | |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 添加或修改体检采样管理对话框 --> |
| | | <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="申请时间" prop="applicationTime"> |
| | | <el-date-picker clearable v-model="form.applicationTime" type="date" value-format="yyyy-MM-dd" |
| | | placeholder="请选择申请时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="项目id父项" prop="proId"> |
| | | <el-input v-model="form.proId" placeholder="请输入项目id父项" /> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称" prop="proName"> |
| | | <el-input v-model="form.proName" placeholder="请输入项目名称" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> --> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | getCusCyList, |
| | | mergeCaiYang, |
| | | chexiaoCaiYang, |
| | | getTxmmccd, |
| | | getTxmkd, |
| | | } from "@/api/sampling/sampling"; |
| | | import { getNewDateList } from "@/api/hosp/order"; |
| | | import moment from "moment"; |
| | | import ItemVue from "../../../layout/components/Sidebar/Item.vue"; |
| | | |
| | | export default { |
| | | dicts: [ |
| | |
| | | name: "Sampling", |
| | | data() { |
| | | return { |
| | | msg: "", |
| | | getNumbr: null, |
| | | valueUrl: "ws://127.0.0.1:6789/websocket", |
| | | webSocket: null, |
| | | list: [], |
| | | selectList: [], |
| | | selectedRows: [], |
| | |
| | | ids: [], |
| | | // 绑定单选按钮 |
| | | tjStatus: "1", |
| | | dayinData: [], |
| | | jsonObj: {}, |
| | | |
| | | // 非单个禁用 |
| | | single: true, |
| | | // 非多个禁用 |
| | |
| | | pageNum: 1, |
| | | pageSize: 20, |
| | | name: null, |
| | | tjNum: null, |
| | | tjNumber: null, |
| | | applicationTime: null, |
| | | isSignFor: null, |
| | | tjTime: null, |
| | |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: {}, |
| | | // rightTabShow: false |
| | | }; |
| | | }, |
| | | created() { |
| | | // this.getNowTime(); |
| | | |
| | | getTxmmccd().then((res) => { |
| | | this.msg = Number(res.msg); |
| | | console.log(res, 444); |
| | | }); |
| | | this.getdate(); |
| | | }, |
| | | mounted() { |
| | |
| | | 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; |
| | | let remaining = |
| | | trimmedProName.length > number ? trimmedProName.slice(number) : ""; |
| | | |
| | | if (remaining.length > number) { |
| | | remaining = remaining.slice(0, number) + "..."; |
| | | } |
| | | return { truncated, remaining }; // 返回结果 |
| | | }, |
| | | |
| | | /* getTruncatedName(proName) { |
| | | const trimmedProName = proName.replace(/\s+/g, ""); // 去掉所有空格 |
| | | const truncated = |
| | | trimmedProName.length > 35 |
| | | ? trimmedProName.slice(0, 35) |
| | | : trimmedProName; |
| | | const remaining = |
| | | trimmedProName.length > 35 ? trimmedProName.slice(35) : ""; |
| | | return { truncated, remaining }; |
| | | }, */ |
| | | |
| | | // 示例的日期格式化方法 |
| | | formatDate(date) { |
| | | const options = { year: "numeric", month: "2-digit", day: "2-digit" }; |
| | | return new Date(date).toLocaleDateString(undefined, options); |
| | | }, |
| | | getdate() { |
| | | getNewDateList().then((res) => { |
| | | this.createTimeList = [ |
| | |
| | | return; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | console.log(this.samplingList, 888); |
| | | // console.log(this.samplingList, 888); |
| | | // 判断是否需要刷新右边表格 |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | this.fetchData(this.samplingList[0].cusId); |
| | | // this.fetchData(this.samplingList[0].tjNumber); |
| | | // ddddddddddddddd |
| | | // this.rightTabShow = true |
| | | }); |
| | | } |
| | | 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() { |
| | | // console.log(this.queryParams.tjNum); |
| | | 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; // 显示加载状态 |
| | | |
| | | console.log(this.tjStatus, 999); |
| | | |
| | | 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 = []; |
| | |
| | | }); |
| | | }, |
| | | |
| | | /* 点击合并按钮 */ |
| | | /* Merging() { |
| | | // 检查是否选中了数据 |
| | | if (this.selectedRows.length === 0) { |
| | | this.$message.error("至少选中一个人"); |
| | | return; |
| | | } |
| | | |
| | | if (this.selectList.length === 0) { |
| | | this.$message.error("请选择要合并项目"); |
| | | return; |
| | | } |
| | | |
| | | // 获取 tableList 第一行的 specimenTypeCode 作为基准 |
| | | const baseSpecimenTypeCode = this.selectList[0].specimenTypeCode; |
| | | |
| | | // 检查 specimenTypeCode 是否一致 |
| | | const canMergeBySpecimenTypeCode = this.selectList.every( |
| | | (row) => row.specimenTypeCode === baseSpecimenTypeCode |
| | | ); |
| | | |
| | | // 根据 canMergeBySpecimenTypeCode 判断是否合并 |
| | | if (canMergeBySpecimenTypeCode) { |
| | | this.$message.success("合并成功。"); |
| | | console.log("合并的行:", this.selectedRows); |
| | | } else { |
| | | this.$message.error("项目的 不一致,无法合并!"); |
| | | } |
| | | }, */ |
| | | /* 点击合并按钮 */ |
| | | Merging() { |
| | | // 检查是否选中了数据 |
| | |
| | | |
| | | mergeCaiYang(data).then((response) => { |
| | | this.$message.success("合并成功。"); |
| | | console.log("合并的行:", this.selectedRows); |
| | | // console.log("合并的行:", this.selectedRows); |
| | | // this.getList(); |
| | | this.fetchData(this.selectedRows[0].cusId); |
| | | this.fetchData(this.selectedRows[0].tjNumber); |
| | | }); |
| | | } else { |
| | | this.$message.error("标本类型不一致,无法合并!"); |
| | |
| | | return; |
| | | } |
| | | |
| | | console.log("撤销的已合并项目ID:", data); |
| | | // console.log("撤销的已合并项目ID:", data); |
| | | |
| | | // 调用撤销采样的接口 |
| | | chexiaoCaiYang(data) |
| | |
| | | this.$message.success("撤销成功!"); |
| | | // 刷新数据列表或进行其他操作 |
| | | // this.getList(); |
| | | this.fetchData(this.selectedRows[0].cusId); |
| | | this.fetchData(this.selectedRows[0].tjNumber); |
| | | } else { |
| | | this.$message.error(res.msg || "撤销失败,请重试!"); |
| | | } |
| | |
| | | .catch((error) => { |
| | | this.$message.error("请求失败,请重试!"); |
| | | }); |
| | | |
| | | // chexiaoCaiYang(data).then((res) => {}); |
| | | }, |
| | | |
| | | /** 点击补打条码按钮 **/ |
| | | Collection() { |
| | | async Collection() { |
| | | const jyxh = this.selectList.map((item) => item.jyxh); |
| | | // const selectedData = this.selectList.map((item) => ({ |
| | | // jyxh: item.jyxh, |
| | | // })); |
| | | console.log(this.selectList, 999); |
| | | // console.log(selectedData, 888); |
| | | console.log("jyxh:", jyxh); |
| | | try { |
| | | // 请求接口并获取宽度值 |
| | | const widthResponse = await getTxmkd(); |
| | | const barcodeWidth = `${Number(widthResponse.msg)}%` || "70%"; // 获取宽度值,默认使用 70% |
| | | |
| | | this.$nextTick(() => { |
| | | jyxh.forEach((number, index) => { |
| | | const barcodeContent = number; // 确保 jyxh 是有效的 |
| | | if (barcodeContent && barcodeContent !== "未提供体检号") { |
| | |
| | | console.log(`条形码内容无效: ${barcodeContent}`); // 调试输出 |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | this.$nextTick(() => { |
| | | const barcodeElement = document.querySelector("#barcode"); |
| | | // const barcodeElements = selectedData.map((_, index) => |
| | | // document.querySelector(`#barcode${index}`) |
| | | // ); |
| | | // await this.$nextTick(); |
| | | |
| | | if (barcodeElement) { |
| | | barcodeElement.forEach((element) => { |
| | | const barcodeElements = jyxh.map((_, index) => |
| | | document.querySelector(`#barcode${index}`) |
| | | ); |
| | | |
| | | if (barcodeElements) { |
| | | barcodeElements.forEach((element) => { |
| | | if (element) { |
| | | console.log(element.innerHTML); // 打印条形码的内容,看看是否生成成功 |
| | | } |
| | |
| | | } else { |
| | | console.log("条形码元素未找到"); |
| | | } |
| | | |
| | | const newWindow = window.open("", "_blank", "width=800,height=600"); |
| | | const printContents = document.getElementById("printSection").innerHTML; |
| | | |
| | | console.log(printContents); |
| | | newWindow.document.write(` |
| | | <html> |
| | | <html> |
| | | <head> |
| | | <title>Print Barcode</title> |
| | | <style> |
| | | @media print { |
| | | * { |
| | | margin: 0; |
| | | padding: 0; /* 重置所有元素的 margin 和 padding */ |
| | | box-sizing: border-box; /* 使内边距和边框包含在元素的总宽度和高度内 */ |
| | | } |
| | | body { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | .barcode-container { |
| | | width: 100%; /* 根据需要调整 */ |
| | | text-align: center; /* 确保条形码居中 */ |
| | | } |
| | | .name { |
| | | padding: 0; |
| | | margin: -5px auto 0; |
| | | padding-left: 20px; |
| | | font-size: 18px; |
| | | width: 90%; |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | white-space: normal; |
| | | } |
| | | * { |
| | | margin: 0; |
| | | padding: 0; /* 重置所有元素的 margin 和 padding */ |
| | | box-sizing: border-box; /* 使内边距和边框包含在元素的总宽度和高度内 */ |
| | | } |
| | | .name, .name1, .last, .tj, .last div span, .last p, .tj span { |
| | | font-family: Arial, sans-serif !important; /* 重新指定字体 */ |
| | | font-weight: bold !important; /* 强制加粗 */ |
| | | } |
| | | body { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | .barcode-container { |
| | | // width: 100%; /* 根据需要调整 */ |
| | | // text-align: center; /* 确保条形码居中 */ |
| | | } |
| | | .name, .name1 { |
| | | padding: 0; |
| | | font-size: 18px; |
| | | width: 70%; |
| | | font-family: "Arial Black", sans-serif; /* 设置黑体 */ |
| | | } |
| | | p { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | svg { |
| | | display: block; |
| | | width: ${barcodeWidth}; /* 使用从接口获取的宽度 */ |
| | | margin-left: 10mm; |
| | | height: auto; |
| | | margin-bottom: 0; |
| | | } |
| | | .last { |
| | | width: 66%; |
| | | display: flex; |
| | | font-size: 19px; |
| | | justify-content: space-between; |
| | | // font-weight: bold; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .last div span { |
| | | // font-weight: bold; |
| | | margin-left: 10px; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .last p { |
| | | // font-weight: bold; |
| | | margin-left: 1px; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | p { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | svg { |
| | | display: block; |
| | | width: 70%; |
| | | margin: 0 auto; |
| | | height: auto; |
| | | margin-bottom: 0; |
| | | } |
| | | .last { |
| | | width: 66%; |
| | | display: flex; |
| | | font-size: 19px; |
| | | margin-left: 20px; |
| | | justify-content: space-between; |
| | | } |
| | | .last div span{ |
| | | margin-left: 10px |
| | | } |
| | | .tj{ |
| | | width: 70%; |
| | | display: flex; |
| | | font-size: 19px; |
| | | margin-left: 10px; |
| | | justify-content: space-between; |
| | | } |
| | | .tj span{ |
| | | margin-left:10px; |
| | | } |
| | | margin-left: 1px; |
| | | // font-weight: bold; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .tj { |
| | | width: 70%; |
| | | display: flex; |
| | | font-size: 19px; |
| | | justify-content: space-between; |
| | | // font-weight: bold; |
| | | font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .tj span { |
| | | margin-left: 1px; |
| | | } |
| | | } |
| | | </style> |
| | | </head> |
| | | <body>${printContents}</body> |
| | | </html> |
| | | `); |
| | | `); |
| | | newWindow.document.close(); |
| | | newWindow.focus(); |
| | | newWindow.print(); |
| | | newWindow.close(); |
| | | }); |
| | | } catch (error) { |
| | | console.error("获取宽度时出错:", error); // 捕获错误 |
| | | } |
| | | }, |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | |
| | | }, |
| | | |
| | | handleChange(selection) { |
| | | console.log(selection); |
| | | |
| | | // console.log(selection); |
| | | |
| | | this.selectList = selection; |
| | | console.log(this.selectList, 9977); |
| | | var array = selection; |
| | | |
| | | this.ids = selection.map((item) => item.id); |
| | | this.ids = array.map((item) => item.id); |
| | | }, |
| | | buda() { |
| | | var websocket = null; |
| | | var url = this.valueUrl; |
| | | if ("WebSocket" in window) { |
| | | websocket = new WebSocket(url); |
| | | } else if ("MozWebSocket" in window) { |
| | | websocket = new MozWebSocket(url); |
| | | } |
| | | if (websocket == null) { |
| | | alert("创建WebSocket对象失败"); |
| | | } |
| | | websocket.onerror = function () { |
| | | alert("请检查读卡器连接是否正常"); |
| | | }; |
| | | websocket.onopen = () => { |
| | | this.websocket = websocket; |
| | | this.dayinData = this.selectList.map((item) => ({ |
| | | jyxh: item.jyxh, |
| | | proName: item.proName, |
| | | cusName: item.cusName, |
| | | cusSex: item.customer.cusSex, |
| | | age: item.customer.age, |
| | | cardId: item.cardId, |
| | | tjTime: item.createTime, |
| | | })); |
| | | console.log(this.dayinData, 2222); |
| | | |
| | | // 禁选 |
| | | // selectEnable(row, rowIndex) { |
| | | // if(row.isSignFor === "0"){ |
| | | // return false |
| | | // }else{ |
| | | // return true |
| | | // } |
| | | // }, |
| | | |
| | | // 确定按钮 |
| | | submitForm() {}, |
| | | // 连接设备 |
| | | this.jsonObj = { |
| | | type: "3", |
| | | array: { |
| | | data: this.dayinData, |
| | | }, |
| | | }; |
| | | var jStr = JSON.stringify(this.jsonObj); |
| | | this.websocket.send(jStr); |
| | | this.jsonObj = {}; |
| | | // this.dialogVisible = false; |
| | | }; |
| | | // this.getList(); |
| | | }, |
| | | |
| | | // 确认采样 |
| | | Confirmreceipt() { |
| | | let data = this.ids; |
| | | if (data.length === 0) { |
| | | // 如果没有已合并的项目,给出提示信息 |
| | | this.$message.error("没有已合并的项目可以撤销!"); |
| | | return; |
| | | } |
| | | confirmSampling(data).then((res) => { |
| | | this.$modal.msgSuccess("采样成功"); |
| | | this.getList(); |
| | | const loadingInstance = this.$loading({ |
| | | lock: true, // 锁定屏幕 |
| | | text: "加载中...", // 加载文本 |
| | | spinner: "el-icon-loading", // 自定义加载图标 |
| | | background: "rgba(255, 255, 255, 0.7)", // 背景颜色 |
| | | }); |
| | | confirmSampling(this.ids) |
| | | .then((res) => { |
| | | console.log(this.selectList, 2222); |
| | | |
| | | if (res.code === 200) { |
| | | // var websocket = null; |
| | | this.buda(); |
| | | |
| | | /* var url = this.valueUrl; |
| | | if ("WebSocket" in window) { |
| | | websocket = new WebSocket(url); |
| | | } else if ("MozWebSocket" in window) { |
| | | websocket = new MozWebSocket(url); |
| | | } |
| | | if (websocket == null) { |
| | | alert("创建WebSocket对象失败"); |
| | | } |
| | | websocket.onerror = function () { |
| | | alert("请检查读卡器连接是否正常"); |
| | | }; |
| | | websocket.onopen = () => { |
| | | this.websocket = websocket; |
| | | var list = this.selectList; |
| | | var data = list.map((item) => ({ |
| | | jyxh: item.jyxh, |
| | | proName: item.proName, |
| | | cusName: item.cusName, |
| | | cusSex: item.customer.cusSex, |
| | | age: item.customer.age, |
| | | cardId: item.cardId, |
| | | tjTime: item.createTime, |
| | | })); |
| | | |
| | | // 连接设备 |
| | | var jsonObj = { |
| | | type: "3", |
| | | array: { |
| | | data: data, |
| | | }, |
| | | }; |
| | | var jStr = JSON.stringify(jsonObj); |
| | | this.websocket.send(jStr); |
| | | var jsonObj = {}; |
| | | this.dialogVisible = false; |
| | | }; |
| | | websocket.onmessage = (event) => { |
| | | var resultObj = eval("(" + event.data + ")"); |
| | | console.log(resultObj, 9988); |
| | | }; */ |
| | | |
| | | // this.Collection(); |
| | | this.getList(); |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | // this.getList(); |
| | | }) |
| | | .catch((error) => { |
| | | // this.$message.error("采样失败"); |
| | | }) |
| | | .finally(() => { |
| | | loadingInstance.close(); |
| | | }); |
| | | }, |
| | | |
| | | // 单选按钮 |
| | |
| | | |
| | | .el-table .warning-row { |
| | | background-color: #e5f3ff !important; |
| | | /* font-weight: bold; */ |
| | | } |
| | | /* .last { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | justify-content: space-evenly; |
| | | background-color:aqua |
| | | } */ |
| | | /* .last p:nth-child(2) { |
| | | margin: 20px; |
| | | font-size: 16px; |
| | | } */ |
| | | </style> |