su
su1124
2024-06-24 0c2c35139886532e938ea304254a339bd22cbd41
src/views/system/tijian/index.vue
@@ -334,7 +334,6 @@
              </el-col>
            </el-row>
          </el-form>
          <el-row v-show="top">
            <el-col :span="19">
@@ -424,15 +423,17 @@
    <el-dialog
      title="选择套餐"
      :visible.sync="taocan"
      width="50%"
      width="70%"
      height="700px"
      :close-on-click-modal="false"
    >
      <el-tabs
        type="border-card"
        style="height: 560px; margin: 0 10px; width: 100%"
        v-model="activeNames"
        @tab-click="handleClick"
      >
        <el-tab-pane label="套餐">
        <el-tab-pane label="套餐" name="first">
          <el-form
            :model="queryParam"
            ref="queryForm"
@@ -474,7 +475,6 @@
                @selection-change="handleSelectionChange"
                height="450px"
                ref="tb"
                style="width: 850px"
              >
                <el-table-column
                  type="selection"
@@ -525,7 +525,7 @@
              ></el-button> -->
          </div>
        </el-tab-pane>
        <el-tab-pane label="单项">
        <el-tab-pane label="单项" name="second">
          <div class="tab8">
            <!-- <div class="tab7">
              <v-tree-transfer
@@ -550,7 +550,9 @@
                >
                  项目列表
                </div>
                <el-input placeholder="输入关键字进行过滤" v-model="filterText">
                <!-- @input="gaibian" -->
                <el-input placeholder="输入关键字进行过滤"
                 v-model="filterText">
                </el-input>
                <div class="tab3">
                  <el-tree
@@ -564,6 +566,7 @@
                    :default-checked-keys="checkedkey"
                    :filter-node-method="filterNode"
                    ref="tree"
                    :render-content="renderContent"
                  >
                  </el-tree>
                </div>
@@ -589,6 +592,7 @@
                    show-checkbox
                    @check-change="handleCurrentChecked1"
                    :default-checked-keys="checkedListkey"
                    :render-content="renderContent"
                  >
                  </el-tree>
                </div>
@@ -614,12 +618,15 @@
                    <el-table-column prop="propinName" label="检查项目">
                    </el-table-column>
                    <el-table-column
                      prop="proPrice"
                      label="原价"
                      width="56px"
                    ></el-table-column>
                    <el-table-column
                      prop="proName"
                      label="明细项目"
                      width="260px"
                    >
                    </el-table-column>
                    <el-table-column prop="proPrice" label="原价" width="56px">
                    </el-table-column>
                    <el-table-column
@@ -640,7 +647,8 @@
                      </template>
                    </el-table-column>
                  </el-table>
                  <el-collapse v-model="activeName" accordion v-if="list1">
                  <h3 style="font-weight: bold;">合计:{{ marryall }}元</h3>
                  <!-- <el-collapse v-model="activeName" accordion v-if="list1">
                    <div>
                      <el-collapse-item title="请选择项目">
                        <el-table
@@ -661,7 +669,7 @@
                        </el-table>
                      </el-collapse-item>
                    </div>
                  </el-collapse>
                  </el-collapse> -->
                </div>
              </el-col>
            </el-row>
@@ -909,6 +917,12 @@
                      "元)"
                    }}
                  </template>
                  <el-button
                    type="primary"
                    @click="candelete(item)"
                    style="margin: 5px"
                    >删 除</el-button
                  >
                  <el-table
                    :data="item.list"
                    border
@@ -1267,6 +1281,7 @@
  getaddtTransition,
  getTransitionList,
  getByTeamNo,
  delTbBycusCardIdAndProId,
  getLoadFile,
  getIsRequired,
  getconfigKey,
@@ -1298,6 +1313,7 @@
  },
  data() {
    return {
      pname:"",
      filterText: "",
      proIdList: [],
      tableDatas: [],
@@ -1306,6 +1322,7 @@
      table: false,
      HistoryList: {},
      index: 0,
      names:"",
      dictType: [
        {
          value: 0,
@@ -1317,6 +1334,7 @@
        },
      ],
      isNow: 1,
      marryall: 0,
      treeId: [],
      treeList: [],
      defaultKeys: [],
@@ -1334,7 +1352,7 @@
      hospName: "",
      currentDate: "",
      currentTime: "",
      tjCategory: "",
      tjCategory: "12",
      formIn: {
        tjPro: "体检费",
      },
@@ -1421,6 +1439,7 @@
      proIds: [],
      // 显示搜索条件
      showSearch: true,
      activeNames: "first",
      // 树状形状
      Treedata: [],
      TreedataList: [],
@@ -1541,6 +1560,11 @@
    filterNode(value, data) {
      if (!value) return true;
      return data.proName.indexOf(value) !== -1;
      // if(value == data.proName){
      //   return data.proName.indexOf(value) !== -1;
      // }else{
      //   return data.proEngName.indexOf(value) !== -1;
      // }
    },
    beforeDestroy() {
      clearInterval(this.timer);
@@ -1606,6 +1630,48 @@
    },
    inputChanges() {
      this.$refs.historyTj.getlist();
    },
    candelete(item) {
      let data = {
        cusCardId: this.form.cusIdcard,
        proId: item.proPrantId,
      };
      delTbBycusCardIdAndProId(data).then((res) => {
        getTransitionList(this.form.cusIdcard).then((response) => {
          this.tableData1 = response.data;
          this.TotalPrice1 = 0;
          if (this.tableData1) {
            this.tableData1.forEach((item) => {
              this.TotalPrice1 += item.nowPrice;
              if (item.pacName === null) {
                item.pacName = "单项";
              }
              if (item.pacName == "单项") {
                item.list.forEach((item9) => {
                  this.treeList.push(item9.proId);
                });
              }
              this.pacName = item.pacName;
            });
            const r = /^\+?[0-9][0-9]*$/; //正整数(可以0打头)
            let TotalPrice = this.TotalPrice1 * (this.discount / 10);
            if (r.test(TotalPrice)) {
              this.TotalPrice = TotalPrice + ".00";
            } else {
              this.TotalPrice = TotalPrice;
            }
            this.list1 = false;
            this.list3 = true;
          } else {
            this.list1 = true;
            this.TotalPrice = "0.00";
          }
        });
      });
    },
    cope() {
      this.tcShow = true;
@@ -1973,7 +2039,6 @@
                  if (this.tableData1) {
                    this.tableData1.forEach((item) => {
                      this.TotalPrice1 += item.ysPrice;
                      console.log(this.TotalPrice1);
                      this.TotalPrice = (
                        this.TotalPrice1 *
                        (this.discount / 10)
@@ -2002,7 +2067,6 @@
                      this.TotalPrice1 = 0;
                      this.tableData1.forEach((item) => {
                        this.TotalPrice1 += item.nowPrice;
                        console.log(this.TotalPrice1);
                        this.TotalPrice = (
                          this.TotalPrice1 *
                          (this.discount / 10)
@@ -2274,15 +2338,16 @@
    //   }
    // },
    resetpackage(){
    resetpackage() {
      if (this.form.cusIdcard) {
        var cusId = this.form.cusIdcard;
      } else {
        this.$message.warning("请先填写信息,再选体检内容");
      }
      let _this = this;
        _this.pacId = "";
      _this.pacId = "";
      this.proIds = [];
      this.tjCategory ="12"
      let data = {
        cusId,
        pacId: _this.pacId,
@@ -2295,7 +2360,7 @@
          getTransitionList(cusId).then((response) => {
            this.tableData1 = response.data;
            this.TotalPrice1 = 0;
            if (this.tableData1.length>=1) {
            if (this.tableData1.length >= 1) {
              this.list1 = false;
              this.list3 = true;
            } else {
@@ -2310,13 +2375,13 @@
    Package() {
      this.taocan = true;
      this.activeNames = "first";
      let cusSex = this.form.cusSex;
      this.datekey = Date.now();
      //全部套餐
      this.loading = true;
      deptTreeSelect(cusSex).then((response) => {
        this.newpacName = response.rows;
        try {
          if (this.tableData1.length >= 1) {
            this.newpacName.forEach((item3) => {
@@ -2390,8 +2455,18 @@
        this.getDataList();
      }
    },
    // gaibian(val){
    //   console.log(val);
    //   let pname = val;
    //   console.log(pname);
    //   getProParentIdDxList(pname).then(response=>{
    //     this.Treedata = response.data.list;
    //   })
    // },
    getDataList() {
      console.log(111);
      this.loading = true;
      // this.pname = "null";
      getProParentIdDxList().then((response) => {
        this.Treedata = response.data.list;
        if (this.tableData[0]) {
@@ -2403,23 +2478,29 @@
            });
          });
        }
        this.checkedkey.push(this.Treedata[0].proId);
        let proId = this.Treedata[0].proId;
        this.checkedkey.push("1735504273274236929");
        let proId = "1735504273274236929";
        this.Treedata.forEach(item =>{
          if(proId == item.proId){
            this.names = item.proName
          }
        })
        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;
                item.propinName = this.names;
            });
          });
          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;
            });
          }
        });
@@ -2446,10 +2527,12 @@
            });
          });
          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.TotalPrice1 = item.proPrice + this.TotalPrice1;
              this.marryall += item.proPrice;
            });
          }
        });
@@ -2475,15 +2558,23 @@
      return this.DataList;
    },
    renderContent(h, { node, data, store }) {
      return (
        <span class="custom-tree-node">
            <span>{node.label}</span>
          <span>({data.proPrice}元)</span>
        </span>
      );
    },
    // 点击获取每个树节点
    handleCurrentChecked1(data, checked, checkedNodes) {
      if (checked == false) {
        this.DataList.forEach((item, index) => {
          if (item.proId == data.proId) {
            this.DataList.splice(index, 1);
            this.TotalPrice1 = 0;
            this.marryall = 0;
            this.DataList.forEach((item1) => {
              this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
              this.marryall += item1.proPrice;
            });
          }
        });
@@ -2495,9 +2586,9 @@
          }
        });
        this.spliceData();
        this.TotalPrice1 = 0;
        this.marryall = 0;
        this.DataList.forEach((item1) => {
          this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
          this.marryall += item1.proPrice;
        });
      }
    },
@@ -2507,16 +2598,15 @@
      this.DataList.forEach((item, index) => {
        if (item.proId == row.proId) {
          this.DataList.splice(index, 1);
          this.TotalPrice1 = 0;
          this.marryall = 0;
          this.DataList.forEach((item1) => {
            this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
            this.marryall += item1.proPrice;
          });
        }
      });
    },
    //  // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 }
    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)) {
@@ -2564,7 +2654,7 @@
        proIds: this.proIds,
      };
      getaddtTransition(data).then((response) => {
        if (response.code === 200) {
        if(response.code==200 ){
          let cusId = this.form.cusIdcard;
          this.proIds = [];
          getTransitionList(cusId).then((response) => {
@@ -2573,8 +2663,8 @@
            if (this.tableData1) {
              this.tableData1.forEach((item) => {
                this.TotalPrice1 += item.nowPrice;
                if (item.pacName === null) {
                  item.pacName = "单项";
                if (item.tjCategory!=null ) {
                  this.tjCategory  = item.tjCategory
                }
                if (item.pacName == "单项") {
                  item.list.forEach((item9) => {
@@ -2591,12 +2681,10 @@
              } else {
                this.TotalPrice = TotalPrice;
              }
              this.list1 = false;
              this.list3 = true;
            } else {
              this.list1 = true;
              this.TotalPrice = "0.00";
            }
          });
@@ -2949,7 +3037,7 @@
            message: "请选择套餐!",
          });
        }
      }else {
      } else {
        this.$modal.msgError("请选择体检类别");
      }
    },
@@ -3004,7 +3092,7 @@
}
.tab3 {
  max-height: 400px;
  max-height: 390px;
  overflow-y: auto;
  border: 1px solid #d9d9d9;
}