From b977b7e4b46d14ee407f4d8f07b4c818b19b87be Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期四, 05 十二月 2024 12:28:29 +0800 Subject: [PATCH] lkk-12-05 --- src/views/system/tijian/index.vue | 168 +++++++++++++++++++++++++------------------------------ 1 files changed, 76 insertions(+), 92 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index f84b262..65631ab 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -574,6 +574,9 @@ :data="packagedataList" node-key="proId" :props="defaultpackProps" + :filter-node-method="filterpackage" + @check-change="handlePackageChecked" + :default-checked-keys="checkedListkey1" :render-content="renderContent" > </el-tree> @@ -1593,6 +1596,7 @@ treedataList: [], checkedkey: [], checkedListkey: [], + checkedListkey1: [], defaultProps: { children: [], label: "proName", @@ -1615,10 +1619,11 @@ pacName: null, pacRemark: null, }, - valueUrl: "ws://127.0.0.1:18890", + // valueUrl: "ws://127.0.0.1:18890", + valueUrl: "ws://127.0.0.1:6789/websocket", valueUrls: "ws://127.0.0.1:6789/websocket", // valueUrls: "ws://"+getIp() +":6789/websocket", - WebSocket: null, + webSocket: null, // 韬唤璇侀渶瑕� // socket: null, // value: 1, @@ -1648,12 +1653,13 @@ // 琛ㄥ崟鍙傛暟 // 琛ㄥ崟鍙傛暟 + obj: {}, form: { cusIdcard: "", - tjType: "2", + tjType: "3", cusSex: 1, cusNational: "1", - cusMarryStatus: "1", + cusMarryStatus: "5", idType: "1", ageUnit: "0", }, @@ -1685,6 +1691,10 @@ this.startTimer(); this.getList1(); // this.getData(); + }, + mounted(){ + console.log(this.dict.type.dict_user_marry,555); + }, methods: { @@ -2192,7 +2202,7 @@ this.discount = this.form.discount; } if (this.form.tjType === null) { - this.form.tjType = "2"; + this.form.tjType = "3"; } if (this.form.reservationId != null) { if (this.form.groupingId) { @@ -2275,6 +2285,7 @@ } else { let configKey = "getInfoFromSqlData"; getconfigKey(configKey).then((res) => { + console.log(res); if (res.code == 200) { if (res.msg == "N") { var websocket = null; @@ -2301,16 +2312,17 @@ this.websocket = websocket; // 杩炴帴璁惧 var jsonObj = { - name: "connect", + // name: "connect", + type: "1", }; var jStr = JSON.stringify(jsonObj); this.websocket.send(jStr); alert("璇锋斁韬唤璇佸啀鐐圭‘璁�"); var jsonObj = { - name: "readCert", + // name: "readCert", }; - var jStr = JSON.stringify(jsonObj); - this.websocket.send(jStr); + // var jStr = JSON.stringify(jsonObj); + // this.websocket.send(jStr); this.dialogVisible = false; }; @@ -2318,6 +2330,7 @@ websocket.onmessage = function (event) { var resultObj = eval("(" + event.data + ")"); //resultFlag涓�0浠h〃璇诲崱鎴愬姛 + if ( resultObj.name == "readCard" || resultObj.name == "readCert" || @@ -2505,7 +2518,7 @@ } } _this.form.cusAddr = resultObj.data.addres; - + _this.cardreader = false; }; @@ -2578,13 +2591,13 @@ websocket.onmessage = function (event) { var resultObj = JSON.parse(event.data); _this.form.cusName = resultObj.data.name; - - if( resultObj.data.nation == "姹夋棌"){ - _this.form.cusNational ="1"; + + if (resultObj.data.nation == "姹夋棌") { + _this.form.cusNational = "1"; } - if(resultObj.data.gender == "鐢�"){ + if (resultObj.data.gender == "鐢�") { _this.form.cusSex = 0; - }else{ + } else { _this.form.cusSex = 1; } _this.form.cusBrithday = resultObj.data.birthday; @@ -2915,33 +2928,6 @@ getZhList().then((response) => { if (response.data) { this.packageList = response.data; - // this.checkedkeys.push(this.packageList[0].id); - // let datas = { - // zhId: this.packageList[0].id, - // }; - // getlistByZhId(datas).then((res) => { - // this.packagedataList = res.data.tjProjectList; - // for (var i = 0; i < this.packagedataList.length; i++) { - // let proId = this.packagedataList[i].proId; - // getProSonDxList(proId).then((res) => { - // this.TreedataList = res.data.list; - // this.TreedataList.forEach((item) => { - // this.DataLists.push(item); - // if (this.DataLists.length >= 1) { - // this.marryalls = 0; - // this.DataLists.forEach((item1) => { - // this.marryalls += item1.proPrice; - // this.packagedataList.forEach((item3) => { - // if (item1.proParentId == item3.proId) { - // item1.propinName = item3.proName; - // } - // }); - // }); - // } - // }); - // }); - // } - // }); } this.loading = false; }); @@ -2959,6 +2945,8 @@ this.loading = true; getProParentIdDxList().then((response) => { this.Treedata = response.data.list; + console.log(response, 77788); + if (this.tableData[0]) { this.tableData[0].tjProjectList.forEach((selectionitem) => { this.Treedata.forEach((item) => { @@ -2968,40 +2956,12 @@ }); }); } - // if (this.DataLists.length != 0) { - // this.DataLists.forEach((selectionitem) => { - // this.Treedata.forEach((item) => { - // if (selectionitem.propinName == item.proName) { - // item.disabled = true; - // } - // }); - // }); - // } - // this.checkedkey.push(this.Treedata[0].proId); - // let proId = this.Treedata[0].proId; - // getProSonDxList(proId).then((res) => { - // this.TreedataList = res.data.list; - // this.TreedataList.forEach((item) => { - // this.checkedListkey.push(item.proId); - // this.DataList.push(item); - // this.DataList.forEach((item) => { - // item.propinName = this.Treedata[0].proName; - // }); - // }); - // this.TotalPrice1 = 0; - // this.marryall = 0; - // if (this.DataList.length != 0) { - // this.list1 = false; - // this.DataList.forEach((item) => { - // this.TotalPrice1 = item.proPrice + this.TotalPrice1; - // this.marryall += item.proPrice; - // }); - // } - // }); this.loading = false; }); }, + handlepackage(data, checked, checkedNodes) { + this.dataObj = data; if (checked.checkedNodes.length != 0) { this.$refs.treas.setCheckedKeys([data.id]); let datas = { @@ -3009,16 +2969,27 @@ }; getlistByZhId(datas).then((res) => { this.packagedataList = res.data.tjProjectList; + console.log(this.packagedataList, 1122); + this.DataLists = []; + this.checkedListkey1 = []; for (var i = 0; i < this.packagedataList.length; i++) { let proId = this.packagedataList[i].proId; + this.checkedListkey1.push(proId); + // this.DataLists.push(this.packagedataList[i]); getProSonDxList(proId).then((res) => { this.TreedataList = res.data.list; + console.log(this.TreedataList, 888); + this.TreedataList.forEach((item) => { + // this.checkedListkey1.push(item.proId); + this.DataLists.push(item); + // console.log(this.DataLists,556644); if (this.DataLists.length >= 1) { this.marryalls = 0; this.DataLists.forEach((item1) => { this.marryalls += item1.proPrice; + this.packagedataList.forEach((item3) => { if (item1.proParentId == item3.proId) { item1.propinName = item3.proName; @@ -3031,25 +3002,12 @@ } }); } else if (checked.checkedNodes.length == 0) { - // for (var i = 0; i < data.tjProjectList.length; i++) { - // let proId = data.tjProjectList[i].proId; - // getProSonDxList(proId).then((res) => { - // this.TreedataList = res.data.list; - // this.TreedataList.forEach((item) => { - // this.DataLists.forEach((item1, index) => { - // if (item.proId == item1.proId) { - // this.DataLists.splice(index, 1); - // } - // }); - // }); - // this.marryalls = 0 - // if(this.DataLists.length != 0){ - // this.DataLists.forEach((item1, index) => { - // this.marryalls += item1.proPrice; - // }) - // } - // }); - // } + this.DataLists = []; + this.marryalls = 0; // 娓呴浂鎬讳环 + this.checkedListkey1 = []; + + // 浣犲彲浠ュ湪姝ゅ鏍规嵁闇�瑕佽繘琛屽叾浠栨搷浣滐紝濡傛洿鏂� UI + console.log("鍙栨秷閫変腑锛屾暟鎹凡娓呯┖锛屾�讳环宸查噸缃�"); } }, objectspanmethod({ row, column, rowIndex, columnIndex }) { @@ -3082,17 +3040,43 @@ // return [rowspan, 1]; // } }, - + handlePackageChecked(data, checked, checkedNodes) { + if (checked == false) { + this.DataLists.forEach((item, index) => { + if (item.proId == data.proId) { + this.DataLists.splice(index, 1); + this.marryalls = 0; // 閲嶇疆鍚堣閲戦 + this.DataLists.forEach((item1) => { + this.marryalls += item1.proPrice; // 閲嶆柊璁$畻鍚堣閲戦 + }); + } + }); + } else if (checked == true) { + this.DataLists.push(data); // 娣诲姞鏁版嵁鍒板凡閫夊垪琛� + this.DataLists.forEach((item1) => { + if (item1.proParentId == this.dataObj.proId) { + item1.propinName = this.dataObj.proName; // 璁剧疆鐖剁骇鍚嶇О + } + }); + // this.spliceData(); + this.marryalls = 0; // 閲嶇疆鍚堣閲戦 + this.DataLists.forEach((item1) => { + this.marryalls += item1.proPrice; // 閲嶆柊璁$畻鍚堣閲戦 + }); + } + }, // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐� handleCurrentChecked(data, checked, checkedNodes) { this.dataObj = data; if (checked.checkedNodes.length != 0) { this.$refs.tree.setCheckedKeys([data.proId]); + let proId = data.proId; getProSonDxList(proId).then((res) => { this.TreedataList = res.data.list; this.TreedataList.forEach((item) => { this.checkedListkey.push(item.proId); + this.DataList.push(item); this.spliceData(); this.DataList.forEach((item1) => { -- Gitblit v1.8.0