| | |
| | | @input="radioChange" |
| | | style="margin: 10px 15px" |
| | | > |
| | | <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-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 |
| | |
| | | <el-button type="primary" :disabled="!disabled" @click="Cancellation" |
| | | >撤销合并</el-button |
| | | > |
| | | <el-button type="primary" @click="Confirmreceipt">采样打码</el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click="Confirmreceipt" |
| | | :disabled="!selectList.length" |
| | | >采样打码</el-button |
| | | > |
| | | </el-col> |
| | | <el-col |
| | | :span="12" |
| | | 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%"> |
| | | <!-- :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"--> |
| | | <!-- v-if="this.rightTabShow" --> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="tableList" |
| | |
| | | /> |
| | | </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> |
| | | |
| | |
| | | return { |
| | | msg: "", |
| | | getNumbr: null, |
| | | valueUrl: "ws://127.0.0.1:6789/websocket", |
| | | webSocket: null, |
| | | list: [], |
| | | selectList: [], |
| | | selectedRows: [], |
| | |
| | | ids: [], |
| | | // 绑定单选按钮 |
| | | tjStatus: "1", |
| | | dayinData: [], |
| | | jsonObj: {}, |
| | | |
| | | // 非单个禁用 |
| | | single: true, |
| | | // 非多个禁用 |
| | |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: {}, |
| | | // rightTabShow: false |
| | | }; |
| | | }, |
| | | created() { |
| | | // this.getNowTime(); |
| | | getTxmmccd().then((res) => { |
| | | this.msg = Number(res.msg); |
| | | console.log(res, 444); |
| | | }); |
| | | this.getdate(); |
| | | }, |
| | |
| | | ); |
| | | }, |
| | | qiehuan() { |
| | | return ( |
| | | this.selectList.length > 0 |
| | | ); |
| | | return this.selectList.length > 0; |
| | | }, |
| | | disabledId() { |
| | | return ( |
| | | this.tjStatus == "1" ? 1 : 0 |
| | | ); |
| | | return this.tjStatus == "1" ? 1 : 0; |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | getTruncatedName(proName) { |
| | | // 去掉所有空格 |
| | | const trimmedProName = proName.replace(/\s+/g, ""); |
| | |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | // this.fetchData(this.samplingList[0].tjNumber); |
| | | // ddddddddddddddd |
| | | // this.rightTabShow = true |
| | | }); |
| | | } |
| | | this.total = response.data.total; |
| | |
| | | // 只有一个人被选中时进行操作 |
| | | if (selection.length === 1) { |
| | | const selectedPerson = selection[0]; // 获取选中的那个人 |
| | | const tjNumber = selectedPerson.tjNumber; |
| | | const tjNumber = selectedPerson.tjNumber; |
| | | console.log(selectedPerson.tjNumber, 6363); |
| | | |
| | | this.fetchData(tjNumber); |
| | |
| | | this.$message.success("合并成功。"); |
| | | // console.log("合并的行:", this.selectedRows); |
| | | // this.getList(); |
| | | this.fetchData(this.selectedRows[0].cusId); |
| | | this.fetchData(this.selectedRows[0].tjNumber); |
| | | }); |
| | | } else { |
| | | this.$message.error("标本类型不一致,无法合并!"); |
| | |
| | | this.$message.success("撤销成功!"); |
| | | // 刷新数据列表或进行其他操作 |
| | | // this.getList(); |
| | | this.fetchData(this.selectedRows[0].cusId); |
| | | this.fetchData(this.selectedRows[0].tjNumber); |
| | | } else { |
| | | this.$message.error(res.msg || "撤销失败,请重试!"); |
| | | } |
| | |
| | | |
| | | /** 点击补打条码按钮 **/ |
| | | async Collection() { |
| | | // console.log("selectList:", this.selectList); |
| | | const jyxh = this.selectList.map((item) => item.jyxh); |
| | | console.log("jyxh:", 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); |
| | | |
| | | // await this.$nextTick(); // 确保 DOM 更新 |
| | | |
| | | jyxh.forEach((number, index) => { |
| | | const barcodeContent = number; // 确保 jyxh 是有效的 |
| | |
| | | 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> |
| | |
| | | } |
| | | .last p { |
| | | // font-weight: bold; |
| | | margin-left: 10px; |
| | | margin-left: 1px; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | p { |
| | | margin-left: 10px; |
| | | margin-left: 1px; |
| | | // font-weight: bold; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | |
| | | font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .tj span { |
| | | margin-left: 10px; |
| | | margin-left: 1px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | // console.log(selection); |
| | | |
| | | this.selectList = selection; |
| | | console.log(this.selectList, 5555); |
| | | 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; |
| | | console.log(this.ids, 999); |
| | | |
| | | const loadingInstance = this.$loading({ |
| | | lock: true, // 锁定屏幕 |
| | | text: "加载中...", // 加载文本 |
| | |
| | | }); |
| | | confirmSampling(this.ids) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | // this.$modal.msgSuccess("采样成功"); |
| | | console.log(this.selectList, 2222); |
| | | |
| | | this.Collection(); |
| | | 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("采样失败"); |
| | | // this.$message.error("采样失败"); |
| | | }) |
| | | .finally(() => { |
| | | loadingInstance.close(); |
| | |
| | | |
| | | // 单选按钮 |
| | | radioChange(value) { |
| | | |
| | | 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.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; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 } |