| | |
| | | :data="packagedataList" |
| | | node-key="proId" |
| | | :props="defaultpackProps" |
| | | :filter-node-method="filterpackage" |
| | | @check-change="handlePackageChecked" |
| | | :default-checked-keys="checkedListkey1" |
| | | :render-content="renderContent" |
| | | > |
| | | </el-tree> |
| | |
| | | treedataList: [], |
| | | checkedkey: [], |
| | | checkedListkey: [], |
| | | checkedListkey1: [], |
| | | defaultProps: { |
| | | children: [], |
| | | label: "proName", |
| | |
| | | } |
| | | } |
| | | _this.form.cusAddr = resultObj.data.addres; |
| | | |
| | | |
| | | _this.cardreader = false; |
| | | }; |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | | }); |
| | |
| | | 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) => { |
| | |
| | | }); |
| | | }); |
| | | } |
| | | // 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 = { |
| | |
| | | }; |
| | | 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; |
| | | getProSonDxList(proId).then((res) => { |
| | | 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; |
| | |
| | | } |
| | | }); |
| | | } 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 }) { |
| | |
| | | // 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) => { |