qinxianzhangyao
2024-03-26 0303c170c6ff96ad5b2da77e54d6f9c8fd461470
qxtj
1个文件已修改
44 ■■■■■ 已修改文件
src/views/hosp/order/index.vue 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hosp/order/index.vue
@@ -880,6 +880,7 @@
      loading: true,
      // 选中数组
      ids: [],
      dataObj:{},
      // 非单个禁用
      single: true,
      // 非多个禁用
@@ -1287,11 +1288,6 @@
        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;
@@ -1299,8 +1295,7 @@
    },
    // 点击获取每个树节点
    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;
@@ -1309,13 +1304,13 @@
          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;
@@ -1328,34 +1323,23 @@
        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 = [];
        });
        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;
    },
    // 点击获取每个树节点
@@ -1372,6 +1356,12 @@
        });
      } 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;