From c70ffa07e49c0711b79156f00f80b1883d07450f Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期二, 15 四月 2025 10:44:35 +0800 Subject: [PATCH] 11 --- src/views/reservation/reservations/index.vue | 235 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 139 insertions(+), 96 deletions(-) diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue index 5d3052d..a9cb9a9 100644 --- a/src/views/reservation/reservations/index.vue +++ b/src/views/reservation/reservations/index.vue @@ -857,9 +857,19 @@ " > <el-table :data="tableData1" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180" align="center"> + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + align="center" + > </el-table-column> - <el-table-column prop="proType" label="鎬у埆" width="50" align="center"> + <el-table-column + prop="proType" + label="鎬у埆" + width="50" + align="center" + > <template slot-scope="scope"> <template v-if="isAll(scope.row.proType)"> 鍏ㄩ儴 @@ -873,7 +883,11 @@ </template> </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦" align="center"> + <el-table-column + prop="ordPrice" + label="搴旀敹閲戦" + align="center" + > </el-table-column> <el-table-column label="鎶樻墸" width="160px" align="center"> <template slot-scope="scope"> @@ -887,14 +901,22 @@ :step="0.1" :max="10" :min="0" - :disabled="true" + :disabled="true" > </el-input-number> </template> </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦" align="center"> + <el-table-column + prop="nowPrice" + label="瀹炴敹閲戦" + align="center" + > </el-table-column> - <el-table-column prop="proCheckMethod" label="鏄惁绌鸿吂" align="center"> + <el-table-column + prop="proCheckMethod" + label="鏄惁绌鸿吂" + align="center" + > <template slot-scope="scope"> <dict-tag :options="dict.type.sys_yes_no" @@ -1079,7 +1101,7 @@ </div> </el-col> </el-row> - + <el-dialog title="瀵兼鍗曢瑙�" :visible.sync="dialogVisibles" @@ -1097,7 +1119,6 @@ </div> </template> </el-drawer> - <el-dialog title="PDF 棰勮" @@ -1137,7 +1158,7 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer2"> - <el-button type="primary" @click="submitType" >纭� 瀹�</el-button> + <el-button type="primary" @click="submitType">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> </div> </el-dialog> @@ -1611,9 +1632,19 @@ " > <el-table :data="tableData1" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180" align="center"> + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + align="center" + > </el-table-column> - <el-table-column prop="proType" label="鎬у埆" width="50" align="center"> + <el-table-column + prop="proType" + label="鎬у埆" + width="50" + align="center" + > <template slot-scope="scope"> <template v-if="isAll(scope.row.proType)"> 鍏ㄩ儴 @@ -1627,7 +1658,11 @@ </template> </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦" align="center"> + <el-table-column + prop="ordPrice" + label="搴旀敹閲戦" + align="center" + > </el-table-column> <el-table-column label="鎶樻墸" width="160px" align="center"> <template slot-scope="scope"> @@ -1641,14 +1676,22 @@ :step="0.1" :max="10" :min="0" - :disabled="true" + :disabled="true" > </el-input-number> </template> </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦" align="center"> + <el-table-column + prop="nowPrice" + label="瀹炴敹閲戦" + align="center" + > </el-table-column> - <el-table-column prop="proCheckMethod" label="鏄惁绌鸿吂" align="center"> + <el-table-column + prop="proCheckMethod" + label="鏄惁绌鸿吂" + align="center" + > <template slot-scope="scope"> <dict-tag :options="dict.type.sys_yes_no" @@ -1853,10 +1896,9 @@ </template> <script> -import { addComp, - addPlOrderAndDetail } from "@/api/system/comp"; +import { addComp, addPlOrderAndDetail } from "@/api/system/comp"; import Big from "big.js"; -import { Loading } from 'element-ui'; +import { Loading } from "element-ui"; import { listReservation, gettjCancel, @@ -1934,7 +1976,7 @@ url: "", open2: false, forms: { - tjCategory:"12" + tjCategory: "12", }, dialogVisible: false, /** 鐓х浉鏈哄脊绐楁ā鍧�-start */ @@ -1993,7 +2035,7 @@ // 鏄惁鏄剧ず寮瑰嚭灞� pacId: "", - cusIds:[], + cusIds: [], // 缁撴灉 result: "", proIds: [], @@ -2682,104 +2724,107 @@ this.open2 = true; }, - submitType() { // let cusIds = []; // this.selectList.forEach((item) => { // cusIds.push(item.idCard); // }); - let loadingInstance1 = Loading.service({ fullscreen: true,text:"绛惧埌涓�" }); + let loadingInstance1 = Loading.service({ + fullscreen: true, + text: "绛惧埌涓�", + }); let data = { cusIds: this.cusIds, tjCategory: this.forms.tjCategory, }; this.open2 = false; addPlOrderAndDetail(data).then((res) => { - if(res.code == 200){ + if (res.code == 200) { this.open2 = false; - this.$modal.msgSuccess("绛惧埌鎴愬姛"); - if (res.file) { - let base64 = res.file; - this.base64ToBlob({ - b64data: base64, - contentType: "application/pdf", - }).then((res) => { - this.dialogVisible = true; - // 杞悗鍚庣殑blob瀵硅薄 - try { - this.url = res.preview; - } catch (error) { - this.url = window.webkitURL.createObjectURL(res.preview); + this.$modal.msgSuccess("绛惧埌鎴愬姛"); + if (res.file) { + let base64 = res.file; + this.base64ToBlob({ + b64data: base64, + contentType: "application/pdf", + }).then((res) => { + this.dialogVisible = true; + // 杞悗鍚庣殑blob瀵硅薄 + try { + this.url = res.preview; + } catch (error) { + this.url = window.webkitURL.createObjectURL(res.preview); + } + }); + } else { + let _this = this; + this.$nextTick(() => { + // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + loadingInstance1.close(); + }); + var websocket = null; + var url = _this.valueUrls; + if ("WebSocket" in window) { + websocket = new WebSocket(url); + } else if ("MozWebSocket" in window) { + websocket = new MozWebSocket(url); + } else { } - }); - }else{ - let _this = this; - this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� - loadingInstance1.close(); -}); - var websocket = null; - var url = _this.valueUrls; - if ("WebSocket" in window) { - websocket = new WebSocket(url); - } else if ("MozWebSocket" in window) { - websocket = new MozWebSocket(url); - } else { - } - if (websocket == null) { - alert("11111"); - } - websocket.onopen = function () { - try { - // 杩炴帴璁惧 - var jsonObjs = { - type: 4, - data: res, - }; - var jStrs = JSON.stringify(jsonObjs); - websocket.send(jStrs); - } catch (err) { - var tryTime = 0; - // 閲嶈瘯10娆★紝姣忔涔嬮棿闂撮殧3绉� - if (tryTime < 1) { - var t1 = setTimeout(function () { - tryTime++; + if (websocket == null) { + alert("11111"); + } + websocket.onopen = function () { + console.log('res',res); + + try { + // 杩炴帴璁惧 var jsonObjs = { type: 4, data: res, }; var jStrs = JSON.stringify(jsonObjs); websocket.send(jStrs); - }, 1 * 1000); - } else { - console.error("閲嶈繛澶辫触."); - } - } - }; - websocket.onclose = function () { - alert("杩炴帴鍏抽棴"); - }; - websocket.onmessage = function (event) { - var resultObj = JSON.parse(event.data); - _this.cardreader = false; - }; + } catch (err) { + var tryTime = 0; + // 閲嶈瘯10娆★紝姣忔涔嬮棿闂撮殧3绉� + if (tryTime < 1) { + var t1 = setTimeout(function () { + tryTime++; + var jsonObjs = { + type: 4, + data: res, + }; + var jStrs = JSON.stringify(jsonObjs); + websocket.send(jStrs); + }, 1 * 1000); + } else { + console.error("閲嶈繛澶辫触."); + } + } + }; + websocket.onclose = function () { + alert("杩炴帴鍏抽棴"); + }; + websocket.onmessage = function (event) { + var resultObj = JSON.parse(event.data); + _this.cardreader = false; + }; - //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉� - websocket.onerror = function () { - alert("璇锋鏌ヨ繛鎺ユ槸鍚︽甯�"); - }; - - - this.getList() - } - }else{ - this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉� + websocket.onerror = function () { + alert("璇锋鏌ヨ繛鎺ユ槸鍚︽甯�"); + }; + + this.getList(); + } + } else { + this.$nextTick(() => { + // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� loadingInstance1.close(); -}); + }); } - }); }, - base64ToBlob({ b64data = "", contentType = "", sliceSize = 512 } = {}) { return new Promise((resolve, reject) => { @@ -3206,8 +3251,6 @@ height: 700px; overflow: hidden; } - - #printIframe::-webkit-scrollbar { width: 6px; -- Gitblit v1.8.0