| | |
| | | loading: true, |
| | | // 选中数组 |
| | | ids: [], |
| | | dataObj:{}, |
| | | // 非单个禁用 |
| | | single: true, |
| | | // 非多个禁用 |
| | |
| | | cusPhone: this.cusPhone, |
| | | cusSex: this.cusSex, |
| | | }; |
| | | // if (row.tjType) { |
| | | // this.form.tjType = parseInt(row.tjType); |
| | | // } else { |
| | | // this.form.tjType = 0; |
| | | // } |
| | | /** 查询部门下拉树结构 */ |
| | | this.getDataList(); |
| | | this.Projectopen1 = true; |
| | |
| | | }, |
| | | // 点击获取每个树节点 |
| | | handleCurrentChecked(data, checked, checkedNodes) { |
| | | console.log(data, checked, checkedNodes); |
| | | console.log(this.DataList,22222); |
| | | this.dataObj = data |
| | | if (checked.checkedNodes.length != 0) { |
| | | this.$refs.tree.setCheckedKeys([data.proId]); |
| | | let proId = data.proId; |
| | |
| | | this.TreedataList.forEach((item) => { |
| | | this.checkedListkey.push(item.proId); |
| | | this.DataList.push(item); |
| | | this.spliceData(); |
| | | this.DataList.forEach((item1) => { |
| | | if (item1.proParentId == data.proId) { |
| | | item1.propinName = data.proName; |
| | | } |
| | | }); |
| | | }); |
| | | this.spliceData(this.DataList); |
| | | this.TotalPrice1 = 0; |
| | | if (this.DataList.length != 0) { |
| | | this.list1 = false; |
| | |
| | | let proId = data.proId; |
| | | getProSonDxList(proId).then((res) => { |
| | | this.TreedataList = res.data.list; |
| | | this.DataList.forEach((item, index) => { |
| | | this.TreedataList.forEach((item1) => { |
| | | if (item.proId == item1.proId) { |
| | | this.DataList.splice(index, this.TreedataList.length); |
| | | this.TotalPrice1 = 0; |
| | | this.DataList.forEach((item1) => { |
| | | this.TotalPrice1 = item1.proPrice + this.TotalPrice1; |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | this.checkedListkey = []; |
| | | console.log(this.DataList,1111) |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | |
| | | spliceData(row) { |
| | | for (var i = 0; i < row.length; i++) { |
| | | for (var j = i + 1; j < row.length; j++) { |
| | | if (row[i].proId == row[j].proId) { |
| | | spliceData() { |
| | | for (var i = 0; i < this.DataList.length; i++) { |
| | | for (var j = i + 1; j < this.DataList.length; j++) { |
| | | if (this.DataList[i].proId == this.DataList[j].proId) { |
| | | //如果第一个等于第二个,splice方法删除第二个 |
| | | row.splice(j, 1); |
| | | this.DataList.splice(j, 1); |
| | | j--; |
| | | } |
| | | } |
| | | } |
| | | return row; |
| | | return this.DataList; |
| | | }, |
| | | |
| | | // 点击获取每个树节点 |
| | |
| | | }); |
| | | } else if (checked == true) { |
| | | this.DataList.push(data); |
| | | this.DataList.forEach((item1) => { |
| | | if (item1.proParentId == this.dataObj.proId) { |
| | | item1.propinName = this.dataObj.proName; |
| | | } |
| | | }); |
| | | this.spliceData() |
| | | this.TotalPrice1 = 0; |
| | | this.DataList.forEach((item1) => { |
| | | this.TotalPrice1 = item1.proPrice + this.TotalPrice1; |