From e17811c1d7b1e6318af32a366d23bd586750b6d2 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期三, 27 十一月 2024 11:32:48 +0800 Subject: [PATCH] 2024 11 27 --- src/views/reservation/reservations/index.vue | 819 +++++++++++++++++++++++++++++++++------------------------- 1 files changed, 469 insertions(+), 350 deletions(-) diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue index b3b4a1c..dca5707 100644 --- a/src/views/reservation/reservations/index.vue +++ b/src/views/reservation/reservations/index.vue @@ -81,7 +81,7 @@ > </el-form-item> </el-form> - <el-row :gutter="10" class="mb8"> + <el-row :gutter="10" style="margin: 10px 15px"> <el-col :span="1.5"> <el-button type="primary" @@ -91,6 +91,16 @@ @click="batch" v-hasPermi="['reservation:reservation:remove']" >鎾ら攢棰勭害</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" + size="mini" + :disabled="single" + @click="receipt" + v-hasPermi="['reservation:reservation:remove']" + >琛ユ墦灏忕エ</el-button > </el-col> <right-toolbar @@ -106,6 +116,7 @@ @selection-change="handleSelectionChange" :default-sort="{ prop: 'reservationTime', order: 'descending' }" highlight-current-row + style="margin-left: 15px" > <el-table-column type="selection" @@ -132,6 +143,7 @@ <template slot-scope="scope"> <span v-if="scope.row.sex == '0'">鐢�</span> <span v-if="scope.row.sex == '1'">濂�</span> + <span v-if="scope.row.sex == '2'">鏈煡</span> </template> </el-table-column> <el-table-column @@ -166,20 +178,7 @@ width="110px" :show-overflow-tooltip="true" /> - <el-table-column - label="閭" - align="center" - prop="email" - :show-overflow-tooltip="true" - width="160px" - /> - <el-table-column - label="鍦板潃" - align="center" - prop="address" - :show-overflow-tooltip="true" - width="160px" - /> + <el-table-column label="棰勭害鏃堕棿" align="center" @@ -198,7 +197,11 @@ prop="tjType" width="80px" :show-overflow-tooltip="true" - /> + > + <template slot-scope="scope"> + <dict-tag :options="dict.type.dict_team" :value="scope.row.tjType" /> + </template> + </el-table-column> <el-table-column label="濠氬Щ" align="center" @@ -246,6 +249,20 @@ align="center" prop="company" :show-overflow-tooltip="true" + /> + <el-table-column + label="閭" + align="center" + prop="email" + :show-overflow-tooltip="true" + width="160px" + /> + <el-table-column + label="鍦板潃" + align="center" + prop="address" + :show-overflow-tooltip="true" + width="160px" /> <el-table-column label="鎿嶄綔" align="center" width="90px" fixed="right"> <template slot-scope="scope"> @@ -414,7 +431,7 @@ </el-form-item> <el-form-item label="浣撴绫诲埆" prop="tjCategory"> <el-select - style="width: 150px" + style="width: 140px" v-model="formIn.tjCategory" placeholder="璇烽�夋嫨浣撴绫诲埆" > @@ -594,31 +611,20 @@ <el-tab-pane label="鍗曢」"> <div class="tab3"> <div class="tab2"> - <el-tree - :data="data" - show-checkbox - node-key="proId" - :props="defaultProps" - @check-change="handleCurrentChecked" - > - </el-tree> + <v-tree-transfer + :treeData="treedataList" + :defaultProps="{ + children: 'tjProjectList', + label: 'proName', + }" + :defaultKeys="defaultKeys" + @changeKeys="changeCategoryKeys" + :key="datekey" + ></v-tree-transfer> + <!-- <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" + @check-change="handleCurrentChecked"> + </el-tree>--> </div> - <!-- <el-button - style=" - width: 20px; - height: 100px; - margin-left: 10px; - margin-top: 20%; - font-size: 10px; - " - type="primary" - size="mini" - @click="submit" - ><i - style="font-size: 18px" - class="el-icon-d-arrow-right" - ></i - ></el-button> --> </div> </el-tab-pane> </el-tabs> @@ -653,7 +659,7 @@ <el-form-item label="搴旀敹閲戦"> <el-input placeholder="搴旀敹閲戦" - :value="TotalPrice1 + '.00'" + :value="TotalPrice1" disabled style="width: 160px" ></el-input> @@ -677,6 +683,7 @@ placeholder="瀹炴敹閲戦" v-model="TotalPrice" style="width: 120px" + disabled ></el-input> </el-form-item> @@ -720,9 +727,9 @@ item.parentName + " (搴旀敹閲戦:" + item.ordPrice + - ".00鍏� / 瀹炴敹閲戦:" + + " / 瀹炴敹閲戦:" + item.nowPrice + - ".00鍏�)" + "鍏�)" }} </template> <el-table @@ -739,12 +746,8 @@ </el-table-column> <el-table-column prop="ordPrice" label="搴旀敹閲戦"> </el-table-column> - <el-table-column - prop="nowPrice" - label="瀹炴敹閲戦" - > + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> </el-table-column> - </el-table> </el-collapse-item> </div> @@ -766,17 +769,24 @@ style="width: 100%" height="250" > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -786,17 +796,24 @@ <div> <el-collapse-item title="璇烽�夋嫨椤圭洰"> <el-table :data="list" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -823,6 +840,43 @@ </div> </template> </el-drawer> + + <div + style=" + position: absolute; + bottom: 100px; + left: 500px; + width: 700px; + display: none; + " + > + <div id="printBill"> + <div style="font-size: 13px; color: #000000"> + <div style="width: 48%; margin-top: 10px">濮撳悕锛歿{ fmobj.name }}</div> + <div style="width: 48%; margin-top: 10px"> + 鎬у埆锛歿{ fmobj.sex === 0 ? "鐢�" : "濂�" }} + </div> + <div style="width: 48%; margin-top: 10px">鐢佃瘽:{{ fmobj.phoe }}</div> + <div style="width: 48%; margin-top: 10px"> + 鏃ユ湡:{{ fmobj.reservationTime }} + </div> + <div style="width: 58%; margin-top: 10px">濂楅锛歿{ pacName }}</div> + <div style="width: 100%; margin-top: 10px">娓╅Θ鎻愮ず锛�</div> + <div style="width: 100%">1銆侀噰琛�锛岃吂閮ㄥ僵瓒呮鏌ュ悗鏂瑰彲鐢ㄩ銆�</div> + <div style="width: 100%"> + 2銆佽繎鏈熻嫢鏈夌敓鑲茶鍒掑強鏈垚骞翠汉锛屼笉瀹滆繘琛岃兏鐗囥�佸弻鑳介瀵嗗害绛夋斁灏勬鏌ャ�� + </div> + <div style="width: 100%"> + 3銆佹��瀛曟垨鍙兘宸插彈瀛曠殑濂冲+锛岃繕搴旈伩鍏嶅绉戙�佹斁灏勭鍙婇槾寮忚秴澹版鏌ャ�� + </div> + <div style="width: 100%">4銆佺粡鏈熷コ鎬т笉瀹滆繘琛屽绉戝強灏垮父瑙勬鏌ャ��</div> + <div style="width: 100%"> + 5銆佽嫢鎮ㄥ湪绛夊緟妫�鏌ヨ繃绋嬩腑鏈夌枒闂紝璇峰強鏃惰仈绯诲妫�鎶ゅ+銆� + </div> + <div style="width: 100%">6銆佷綋妫�缁撴潫鍚庤灏嗗妫�鍗曚氦杩樿嚦鍓嶅彴銆�</div> + </div> + </div> + </div> <!-- 淇敼棰勭害鐧昏淇℃伅瀵硅瘽妗� --> <el-drawer title="棰勭害淇℃伅缁存姢" :visible.sync="drawer" size="55%"> @@ -1024,9 +1078,7 @@ style="width: 190px" /> </el-form-item> - <el-button type="primary" @click="taocan = true" size="mini" - >閫夋嫨濂楅</el-button - > + <!-- <el-button type="primary" @click="Package" size="mini">閫夋嫨濂楅</el-button> --> </el-form> </div> @@ -1095,6 +1147,12 @@ label="濂楅鍚嶇О" align="center" prop="pacName" + width="120px" + /> + <el-table-column + label="濂楅浠锋牸" + align="center" + prop="price" width="120px" /> <el-table-column @@ -1185,7 +1243,7 @@ <el-form-item label="搴旀敹閲戦"> <el-input placeholder="搴旀敹閲戦" - :value="TotalPrice1 + '.00'" + :value="TotalPrice1" disabled style="width: 160px" ></el-input> @@ -1218,7 +1276,7 @@ @click="submitPrice" :disabled="confirm" size="mini" - >绛惧埌鐧昏</el-button + >棰勭害淇敼</el-button > </el-form-item> <!-- </el-form> --> @@ -1262,17 +1320,24 @@ style="width: 100%" height="270" > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -1294,17 +1359,24 @@ style="width: 100%" height="250" > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -1314,17 +1386,24 @@ <div> <el-collapse-item title="璇烽�夋嫨椤圭洰"> <el-table :data="list" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -1360,22 +1439,23 @@ gettjCancel, tjReappoint, tjCancelTj, + getReservation, } from "@/api/reservation/reservation"; import printJS from "print-js"; import { deptTreeSelect, projectGetList, - getOrder, - getCusIdcard, getPackageListName, getaddtTransition, getTransitionList, - getGuide, - getaddTj, } from "@/api/system/tijian"; import { getCompany, queryCompany } from "@/api/team/tuanti"; import user from "@/store/modules/user"; +import VTreeTransfer from "../../system/tijian/TreeTransfer.vue"; export default { + components: { + VTreeTransfer, + }, name: "Reservation", dicts: [ "dict_user_national", @@ -1391,8 +1471,19 @@ "dict_ageunit", ], data() { + let checkPhoneNum = (rule, value, callback) => { + console.log(value); + let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/); + if (value == "" && value == undefined && !value) { + return callback(""); + } else if (value != undefined && value != "") { + return callback(); + } else if (!patter.test(value)) { + return callback(""); + } + }; return { - isfalse:false, + isfalse: false, tijiao1: true, index: 0, proIds: "", @@ -1404,6 +1495,7 @@ }, }, taocan: false, + defaultKeys: [], value1: "", pacName: "", hides: false, @@ -1423,6 +1515,8 @@ thisCancas: null, thisContext: null, thisVideo: null, + datekey: Date.now(), + treedataList: [], list: [], activeName: "1", // 閬僵灞� @@ -1512,26 +1606,29 @@ cusIsvip: null, }, formIn: {}, + fmobj: {}, // 琛ㄥ崟鏍¢獙 rules: { - cusName: [{ required: true, message: "濮撳悕涓嶈兘涓虹┖", trigger: "blur" }], + cusName: [ + { required: true, validator: checkPhoneNum, trigger: "blur" }, + ], cusSex: [ - { required: true, message: "鎬у埆涓嶈兘涓虹┖", trigger: "change" }, + { required: true, validator: checkPhoneNum, trigger: "change" }, ], cusBrithday: [ - { required: true, message: "鍑虹敓鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: checkPhoneNum, trigger: "blur" }, ], // cusAddr: [ // { required: true, message: "鐜板眳浣忓湴鍧�涓嶈兘涓虹┖", trigger: "blur" }, // ], cusPhone: [ - { required: true, message: "鑱旂郴鐢佃瘽涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: checkPhoneNum, trigger: "blur" }, ], reservationTime: [ - { required: true, message: "棰勭害鏃ユ湡涓嶈兘涓虹┖", trigger: "change" }, + { required: true, validator: checkPhoneNum, trigger: "change" }, ], timeRegion: [ - { required: true, message: "鏃堕棿涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: checkPhoneNum, trigger: "blur" }, ], }, options: [ @@ -1585,21 +1682,21 @@ name: [ { required: true, - message: "濮撳悕涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], idCard: [ { required: true, - message: "韬唤璇佸彿涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], phoe: [ { required: true, - message: "鑱旂郴鐢佃瘽涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], @@ -1625,30 +1722,6 @@ // response.rows.forEach((item, index) => // {item.newID =(this.queryParams.pageNum - 1) * this.queryParams.pageSize +index +1; // }); - this.reservationList.forEach((item) => { - if (item.tjType === "2") { - item.tjType = "涓汉"; - } else { - item.tjType = "鍥㈤槦"; - } - if (item.tjCategory === "01") { - item.tjCategory = "鍋ュ悍浣撴"; - } else if (item.tjCategory === "02") { - item.tjCategory = "鑱屼笟鐥呬綋妫�"; - } else if (item.tjCategory === "03") { - item.tjCategory = "鍏崼浣撴"; - } else if (item.tjCategory === "04") { - item.tjCategory = "鍏ヨ亴浣撴"; - } else if (item.tjCategory === "05") { - item.tjCategory = "鍏姟鍛樹綋妫�"; - } else if (item.tjCategory === "06") { - item.tjCategory = "鍖讳繚浣撴"; - } else if (item.tjCategory === "07") { - item.tjCategory = "濠氭"; - } else if (item.tjCategory === "09") { - item.tjCategory = "鍑哄叆澧冧綋妫�"; - } - }); this.total = response.total; this.loading = false; }); @@ -1723,6 +1796,10 @@ }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { + selection.forEach((item) => { + this.fmobj = item; + }); + console.log(this.fmobj); this.ids = selection.map((item) => item.id); this.single = selection.length !== 1; this.multiple = !selection.length; @@ -1737,8 +1814,10 @@ /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { + console.log(row); this.title = "淇敼浣撴棰勭害"; this.formIn = row; + this.form.tjType = this.formIn.tjType; if (this.formIn.timeRegion === 0) { this.formIn.timeRegion = "8:00-9:00"; } @@ -1753,66 +1832,75 @@ } if (this.formIn.isExpire === 2) { this.drawer = true; - this.discount = this.formIn.discount; + if (this.formIn.discount != null) { + this.discount = this.formIn.discount; + } + //鍏ㄩ儴濂楅 if (this.formIn.sex != null) { let cusSex = this.formIn.sex; deptTreeSelect(cusSex).then((response) => { this.newpacName = response.rows; - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$refs.tb.toggleRowSelection(item3, true); - throw Error(); - } - }); - }); - }); + // this.newpacName.forEach((item3) => { + // this.tableData1.forEach((item4) => { + // item4.list.forEach((item6) => { + // if (item6.pacName === item3.pacName) { + // this.$refs.tb.toggleRowSelection(item3, true); + // throw Error(); + // } + // }); + // }); + // }); this.loading = false; }); } else { deptTreeSelect().then((response) => { this.newpacName = response.rows; - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); - }); - throw Error(); - } - }); - }); - }); + // this.newpacName.forEach((item3) => { + // this.tableData1.forEach((item4) => { + // item4.list.forEach((item6) => { + // if (item6.pacName === item3.pacName) { + // this.$nextTick(() => { + // this.$refs.tb.toggleRowSelection(item3, true); + // }); + // throw Error(); + // } + // }); + // }); + // }); this.loading = false; }); } - let cusId = this.formIn.idCard; + let id = this.formIn.id; this.list1 = true; (this.tableData1 = []), (this.newpacName = []), - getTransitionList(cusId).then((response) => { + getReservation(id).then((response) => { if (response.data) { - this.tableData1 = response.data; - if (this.tableData1.length != 0) { - this.TotalPrice1 = 0; - this.tableData1.forEach((item) => { - this.TotalPrice1 += item.nowPrice; - this.TotalPrice = ( - this.TotalPrice1 * - (this.discount / 10) - ).toFixed(2); - if (item.pacName === null) { - item.pacName = "鍗曢」"; + let cusId = response.data.idCard; + getTransitionList(cusId).then((response) => { + if (response.data) { + this.tableData1 = response.data; + if (this.tableData1.length != 0) { + this.TotalPrice1 = 0; + this.tableData1.forEach((item) => { + this.TotalPrice1 += item.nowPrice; + console.log(this.discount); + this.TotalPrice = ( + this.TotalPrice1 * + (this.discount / 10) + ).toFixed(2); + if (item.pacName === null) { + item.pacName = "鍗曢」"; + } + }); + this.list1 = false; + this.list3 = true; + } else { + this.list1 = true; } - }); - this.list1 = false; - this.list3 = true; - } else { - this.list1 = true; - } + } + }); } else { this.tableData1 = []; this.list3 = false; @@ -1820,15 +1908,19 @@ } }); - /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.data = response.data; - this.dXData = response.data; - return; - }); + // /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ + // projectGetList().then((response) => { + // this.treedataList = response.data.list; + // this.dXData = response.data.list; + // return; + // }); } else { this.$message.warning("宸茶繃鏈熻閲嶆柊棰勭害"); } + }, + changeCategoryKeys(val) { + this.proIds = []; + this.proIds = val; }, /** 淇敼璇︾粏鎸夐挳鎿嶄綔 */ handleUpdate1(row) { @@ -1846,91 +1938,103 @@ if (row.timeRegion === 3) { this.formIn.timeRegion = "11:00-12:00"; } - if (this.formIn.isExpire === 1) { - this.tijiao1 = false; - } - this.drawer1 = true; + if (this.formIn.isExpire === 1) { + this.tijiao1 = false; + } + this.drawer1 = true; + if (this.formIn.discount != null) { this.discount = this.formIn.discount; - //鍏ㄩ儴濂楅 - if (this.formIn.sex != null) { - let cusSex = this.formIn.sex; - deptTreeSelect(cusSex).then((response) => { - this.newpacName = response.rows; - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); - }); - throw Error(); - } - }); + } + //鍏ㄩ儴濂楅 + if (this.formIn.sex != null) { + let cusSex = this.formIn.sex; + deptTreeSelect(cusSex).then((response) => { + this.newpacName = response.rows; + this.newpacName.forEach((item3) => { + this.tableData1.forEach((item4) => { + item4.list.forEach((item6) => { + if (item6.pacName === item3.pacName) { + this.$nextTick(() => { + this.$refs.tb.toggleRowSelection(item3, true); + }); + throw Error(); + } }); }); - this.loading = false; }); - } else { - deptTreeSelect().then((response) => { - this.newpacName = response.rows; - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); - }); - throw Error(); - } - }); + this.loading = false; + }); + } else { + deptTreeSelect().then((response) => { + this.newpacName = response.rows; + this.newpacName.forEach((item3) => { + this.tableData1.forEach((item4) => { + item4.list.forEach((item6) => { + if (item6.pacName === item3.pacName) { + this.$nextTick(() => { + this.$refs.tb.toggleRowSelection(item3, true); + }); + throw Error(); + } }); }); - this.loading = false; }); - } - let cusId = this.formIn.idCard; - this.list1 = true; - (this.tableData1 = []), - (this.newpacName = []), - getTransitionList(cusId).then((response) => { - if (response.data) { - this.tableData1 = response.data; - if (this.tableData1.length != 0) { - this.TotalPrice1 = 0; - this.tableData1.forEach((item) => { - this.TotalPrice1 += item.nowPrice; - this.TotalPrice = ( - this.TotalPrice1 * - (this.discount / 10) - ).toFixed(2); - if (item.pacName === null) { - item.pacName = "鍗曢」"; - } - }); - this.list1 = false; - this.list3 = true; + this.loading = false; + }); + } + let id = this.formIn.id; + this.list1 = true; + (this.tableData1 = []), + (this.newpacName = []), + getReservation(id).then((response) => { + if (response.data) { + let cusId = response.data.idCard; + getTransitionList(cusId).then((response) => { + if (response.data) { + this.tableData1 = response.data; + if (this.tableData1.length != 0) { + this.TotalPrice1 = 0; + this.tableData1.forEach((item) => { + this.TotalPrice1 += item.nowPrice; + this.TotalPrice = ( + this.TotalPrice1 * + (this.discount / 10) + ).toFixed(2); + if (item.pacName === null) { + item.pacName = "鍗曢」"; + } + }); + this.list1 = false; + this.list3 = true; + } else { + this.list1 = true; + } } else { + this.tableData1 = []; + this.list3 = false; this.list1 = true; } - } else { - this.tableData1 = []; - this.list3 = false; - this.list1 = true; - } - }); - - /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.data = response.data; - this.dXData = response.data; - return; + }); + } }); + + /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ + projectGetList().then((response) => { + this.treedataList = response.data.list; + this.dXData = response.data.list; + return; + }); }, // 鎶樻墸 numberChange(currentValue, oldValue) { this.discount = currentValue; this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2); + }, + + Package() { + this.taocan = true; + this.datekey = Date.now(); }, /** 鎼滅储鎿嶄綔 */ @@ -1961,9 +2065,9 @@ this.multiple = !selection.length; if (selection[0]) { this.DataList = []; - this.data = JSON.parse(JSON.stringify(this.dXData)); + this.treedataList = JSON.parse(JSON.stringify(this.dXData)); selection[0].tjProjectList.forEach((selectionitem) => { - this.data.forEach((item) => { + this.treedataList.forEach((item) => { if (selectionitem.proName == item.proName) { item.disabled = true; item.tjProjectList = []; @@ -1987,7 +2091,7 @@ }); }); } else { - this.data = JSON.parse(JSON.stringify(this.dXData)); + this.treedataList = JSON.parse(JSON.stringify(this.dXData)); return; } }, @@ -2007,6 +2111,20 @@ } else { this.proIds = []; } + }, + + receipt() { + setTimeout(function () { + const style = "@media print { @page{margin:0 10mm,size:4mm 6mm;}};"; //鎵撳嵃鏃跺幓鎺夌湁椤电湁灏� + printJS({ + printable: "printBill", // 鏍囩鍏冪礌id + type: "html", + header: "", + targetStyles: ["*"], + scanStyles: false, //鎵撳嵃蹇呴』鍔犱笂锛屼笉鐒堕〉闈笂鐨刢ss鏍峰紡鏃犳晥 + style, + }); + }, 100); }, // 椤圭洰鎻愪氦 @@ -2070,91 +2188,91 @@ // 鏈�鍚庢彁浜ゆ寜閽� submitPrice() { let _this = this; - if (_this.tableData1.length > 0) { - if (this.tableData[0]) { - var pacId = this.tableData[0].pacId; - } - // let copeWith = this.TotalPrice1; - // let paidIn = this.TotalPrice; - // let discount = this.discount; - // this.tjFlowingWater = { copeWith, paidIn, discount }; - if (this.formIn.timeRegion === "8:00-9:00") { - this.formIn.timeRegion = 0; - } - if (this.formIn.timeRegion === "9:00-10:00") { - this.formIn.timeRegion = 1; - } - if (this.formIn.timeRegion === "10:00-11:00") { - this.formIn.timeRegion = 2; - } - if (this.formIn.timeRegion === "11:00-12:00") { - this.formIn.timeRegion = 3; - } - let data; - if (pacId) { - data = { - id: this.formIn.id, - isExpire: this.formIn.isExpire, - address: this.formIn.address, - company: this.formIn.company, - department: this.formIn.department, - discount: this.discount, - email: this.formIn.email, - idCard: this.formIn.idCard, - marriage: this.formIn.marriage, - name: this.formIn.name, - nation: this.formIn.nation, - pacId, - phoe: this.formIn.cusPhone, - reservationTime: this.formIn.reservationTime, - sex: this.formIn.sex, - timeRegion: this.formIn.timeRegion, - tjCategory: this.formIn.tjCategory, - // tjFlowingWater: this.tjFlowingWater, - tjType: this.formIn.tjType, - idType: this.formIn.idType, - age: this.formIn.age, - ageUnit: this.formIn.ageUnit, - career: this.formIn.career, - }; - } else { - data = { - id: this.formIn.id, - isExpire: this.formIn.isExpire, - address: this.formIn.address, - company: this.formIn.company, - department: this.formIn.department, - discount: this.discount, - email: this.formIn.email, - idCard: this.formIn.idCard, - marriage: this.formIn.marriage, - name: this.formIn.name, - nation: this.formIn.nation, - pacId, - phoe: this.formIn.phoe, - reservationTime: this.formIn.reservationTime, - sex: this.formIn.sex, - timeRegion: this.formIn.timeRegion, - tjCategory: this.formIn.tjCategory, - // tjFlowingWater: this.tjFlowingWater, - tjType: this.formIn.tjType, - idType: this.formIn.idType, - age: this.formIn.age, - ageUnit: this.formIn.ageUnit, - career: this.formIn.career, - }; - } - tjReappoint(data).then((res) => { - if (res.code === 200) { - this.$modal.msgSuccess("鐧昏鎴愬姛"); - } - _this.drawer = false; - }); - this.getList(); - this.$tab.refreshPage(); - } else { - this.$message.warning("璇烽�夋嫨鎮ㄨ浣撴鐨勫唴瀹�"); + // if (_this.tableData1.length > 0) { + if (this.tableData[0]) { + var pacId = this.tableData[0].pacId; } + // let copeWith = this.TotalPrice1; + // let paidIn = this.TotalPrice; + // let discount = this.discount; + // this.tjFlowingWater = { copeWith, paidIn, discount }; + if (this.formIn.timeRegion === "8:00-9:00") { + this.formIn.timeRegion = 0; + } + if (this.formIn.timeRegion === "9:00-10:00") { + this.formIn.timeRegion = 1; + } + if (this.formIn.timeRegion === "10:00-11:00") { + this.formIn.timeRegion = 2; + } + if (this.formIn.timeRegion === "11:00-12:00") { + this.formIn.timeRegion = 3; + } + let data; + if (pacId) { + data = { + id: this.formIn.id, + isExpire: this.formIn.isExpire, + address: this.formIn.address, + company: this.formIn.company, + department: this.formIn.department, + discount: this.discount, + email: this.formIn.email, + idCard: this.formIn.idCard, + marriage: this.formIn.marriage, + name: this.formIn.name, + nation: this.formIn.nation, + pacId, + phoe: this.formIn.cusPhone, + reservationTime: this.formIn.reservationTime, + sex: this.formIn.sex, + timeRegion: this.formIn.timeRegion, + tjCategory: this.formIn.tjCategory, + // tjFlowingWater: this.tjFlowingWater, + tjType: this.formIn.tjType, + idType: this.formIn.idType, + age: this.formIn.age, + ageUnit: this.formIn.ageUnit, + career: this.formIn.career, + }; + } else { + data = { + id: this.formIn.id, + isExpire: this.formIn.isExpire, + address: this.formIn.address, + company: this.formIn.company, + department: this.formIn.department, + discount: this.discount, + email: this.formIn.email, + idCard: this.formIn.idCard, + marriage: this.formIn.marriage, + name: this.formIn.name, + nation: this.formIn.nation, + pacId, + phoe: this.formIn.phoe, + reservationTime: this.formIn.reservationTime, + sex: this.formIn.sex, + timeRegion: this.formIn.timeRegion, + tjCategory: this.formIn.tjCategory, + // tjFlowingWater: this.tjFlowingWater, + tjType: this.formIn.tjType, + idType: this.formIn.idType, + age: this.formIn.age, + ageUnit: this.formIn.ageUnit, + career: this.formIn.career, + }; + } + tjReappoint(data).then((res) => { + if (res.code === 200) { + this.$modal.msgSuccess("棰勭害鎴愬姛"); + } + _this.drawer = false; + }); + this.getList(); + this.$tab.refreshPage(); + // } else { + // this.$message.warning("璇烽�夋嫨鎮ㄨ浣撴鐨勫唴瀹�"); + // } }, // 鏈�鍚庢彁浜ゆ寜閽� submitPrice1() { @@ -2398,6 +2516,7 @@ width: 300px; height: 300px; } + .tj1 { width: 230px; display: flex; -- Gitblit v1.8.0