su
su1124
2024-04-26 00212ed8e808fc7b76c04389224e65f27f074fb2
src/views/hosp/order/index.vue
@@ -412,7 +412,7 @@
    <el-dialog
      :title="title"
      :visible.sync="Projectopen"
      width="1500px"
      width="1100px"
      style="height: 860px"
      append-to-body
    >
@@ -426,7 +426,7 @@
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <div class="tab3">
            <div class="outside1">
              <el-tree
                class="filter-tree"
                v-loading="loading"
@@ -434,23 +434,22 @@
                :props="defaultProps"
                show-checkbox
                node-key="proId"
                @check-change="handleCurrentChecked"
                @check="handleCurrentChecked"
                :default-checked-keys="checkedkey"
                :filter-node-method="filterNode"
                ref="tree"
              >
              </el-tree>
            </div>
          </div>
        </el-col>
        <el-col :span="4">
        <el-col :span="5">
          <div
            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
          >
            项目列表
            明细项目列表
          </div>
          <div class="tab3">
            <div class="outside1">
              <el-tree
                class="filter-tree"
                v-loading="loading"
@@ -463,33 +462,24 @@
                :default-checked-keys="checkedListkey"
              >
              </el-tree>
            </div>
          </div>
        </el-col>
        <el-col :span="12">
        <el-col :span="11">
          <div class="grid-content bg-purple">
            <div style="text-align: center; margin-bottom: 10px">
            <div style="text-align: center; margin-bottom: 10px;margin-top: 10px">
              已选项目列表
            </div>
            <div
              style="
                padding: 0px 6px;
                border: 1px solid #e6ebf5;
                max-height: 420px;
                overflow: auto;
              "
            >
              <el-table
                :data="DataList"
                border
                style="width: 100%"
                height="250"
                height="400"  :span-method="objectSpanMethod"
              >
                <el-table-column prop="propinName" label="父项">
              <el-table-column prop="propinName" label="检查项目" >
                </el-table-column>
                <el-table-column prop="proName" label="项目" width="180">
                <el-table-column prop="proName" label="明细项目" width="260px">
                </el-table-column>
                <el-table-column prop="proPrice" label="原价">
                <el-table-column prop="proPrice" label="原价" width="56px">
                </el-table-column>
                <el-table-column
@@ -497,7 +487,7 @@
                  align="center"
                  fixed="right"
                  class-name="small-padding fixed-width"
                  width="80px"
                  width="50px"
                >
                  <template slot-scope="scope">
                    <el-button
@@ -505,7 +495,8 @@
                      type="text"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.row)"
                      >删除</el-button
                      title="删除"
                      ></el-button
                    >
                  </template>
                </el-table-column>
@@ -522,7 +513,6 @@
                  </el-collapse-item>
                </div>
              </el-collapse>
            </div>
            <template>
              <el-form :model="form">
                <el-form-item label="体检类型" prop="tjType">
@@ -593,7 +583,7 @@
    <el-dialog
      :title="title"
      :visible.sync="Projectopen1"
      width="1500px"
      width="1100px"
      style="height: 860px"
      append-to-body
    >
@@ -607,7 +597,7 @@
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <div class="tab3">
            <div class="outside1">
              <el-tree
                class="filter-tree"
                v-loading="loading"
@@ -621,14 +611,14 @@
                ref="tree"
              >
              </el-tree>
            </div>
          </div>
        </el-col>
        <el-col :span="4">
        <el-col :span="5">
          <div
            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
          >
            项目列表
          明细项目列表
          </div>
          <div class="tab3">
            <div class="outside1">
@@ -647,30 +637,23 @@
            </div>
          </div>
        </el-col>
        <el-col :span="12">
        <el-col :span="11">
          <div class="grid-content bg-purple">
            <div style="text-align: center; margin-bottom: 10px">
            <div style="text-align: center; margin-bottom: 10px;margin-top: 10px">
              已选项目列表
            </div>
            <div
              style="
                padding: 0px 6px;
                border: 1px solid #e6ebf5;
                max-height: 420px;
                overflow: auto;
              "
            >
              <el-table
                :data="DataList"
                border
                style="width: 100%"
                height="250"
                height="400"  :span-method="objectSpanMethod"
              >
                <el-table-column prop="propinName" label="检查项目">
              <el-table-column prop="propinName" label="检查项目" >
                </el-table-column>
                <el-table-column prop="proName" label="明细项目" width="180">
                <el-table-column prop="proName" label="明细项目" width="260px">
                </el-table-column>
                <el-table-column prop="proPrice" label="原价">
                <el-table-column prop="proPrice" label="原价" width="56px">
                </el-table-column>
                <el-table-column
@@ -678,7 +661,7 @@
                  align="center"
                  fixed="right"
                  class-name="small-padding fixed-width"
                  width="80px"
                  width="50px"
                >
                  <template slot-scope="scope">
                    <el-button
@@ -694,7 +677,7 @@
              <el-collapse v-model="activeName" accordion v-if="list1">
                <div>
                  <el-collapse-item title="请选择项目">
                    <el-table :data="DataList" border style="width: 100%">
                    <el-table :data="DataList" border style="width: 100%" height="400"  :span-method="objectSpanMethod">
                      <el-table-column prop="proName" label="项目" width="180">
                      </el-table-column>
                      <el-table-column prop="ordPrice" label="原价">
@@ -703,7 +686,7 @@
                  </el-collapse-item>
                </div>
              </el-collapse>
            </div>
            <template>
              <el-form :model="form">
                <el-form-item label="体检类型" prop="tjType">
@@ -880,6 +863,7 @@
      loading: true,
      // 选中数组
      ids: [],
      dataObj:{},
      // 非单个禁用
      single: true,
      // 非多个禁用
@@ -1287,11 +1271,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 +1278,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 +1287,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 +1306,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 +1339,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;
@@ -1390,6 +1363,28 @@
          });
        }
      });
    },
     //  // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 }
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      console.log(row, column, rowIndex, columnIndex)
      let fields = ["propinName"];
      let cellValue = row[column.property];
      if (cellValue && fields.includes(column.property)) {
        let prevRow = this.DataList[rowIndex - 1];
        let nextRow = this.DataList[rowIndex + 1];
        if (prevRow && prevRow[column.property] === cellValue) {
          return { rowspan: 0, colspan: 0 };
        } else {
          let countRowspan = 1;
          while (nextRow && nextRow[column.property] === cellValue) {
            nextRow = this.DataList[++countRowspan + rowIndex];
          }
          if (countRowspan > 1) {
            return { rowspan: countRowspan, colspan: 1 };
          }
        }
      }
    },
    // 收费按钮
@@ -1562,7 +1557,7 @@
// }
.outside {
  width: 700px;
  width: 500px;
  display: flex;
  margin-top: 8px;
}
@@ -1570,6 +1565,7 @@
.tab3 {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #d9d9d9;
}
.outside1 {