1
wwl
2025-01-03 416b4ef820586a62b136d77fa0ccc185f173b5b9
src/views/system/tijian/index.vue
@@ -301,7 +301,7 @@
            </el-form-item>
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="handle">查询</el-button>
              <!-- <el-button type="primary"  size="mini" @click="submit">确认</el-button> -->
            </el-form-item>
          </el-form>
          <div class="tab4">
@@ -322,19 +322,7 @@
</el-table-column> -->
              </el-table>
            </div>
            <!-- <el-button
                style="
                  width: 20px;
                  height: 100px;
                  margin-top: 20%;
                  font-size: 10px;
                  padding-right: 20px;
                "
                type="primary"
                size="mini"
                @click="submit"
                ><i style="font-size: 18px" class="el-icon-d-arrow-right"></i
              ></el-button> -->
          </div>
        </el-tab-pane>
        <el-tab-pane label="组合" name="third">
@@ -617,6 +605,12 @@
              <el-table-column prop="proCheckMethod" label="是否空腹">
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.proCheckMethod" />
                </template>
              </el-table-column>
              <el-table-column label="操作" align="center" width="80px">
                <template slot-scope="scope">
                  <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete1(scope.row)" title="删除">
                  </el-button>
                </template>
              </el-table-column>
            </el-table>
@@ -1084,6 +1078,31 @@
  mounted() { },
  methods: {
    /** 删除按钮操作 */
    handleDelete1(row) {
      console.log(row);
      let data = {
        cusCardId: row.cusId,
        proId: row.parentProId,
      };
      this.$modal.confirm('是否确认删除?').then(() => {
        return delTbBycusCardIdAndProId(data);
      }).then(() => {
        this.TotalPrice1 = 0
        getTransitionList1(row.cusId).then((response) => {
          this.tableData1 = response.data;
          this.tableData1.forEach((item) => {
            this.TotalPrice1 += item.ordPrice;
            this.TotalPrice += item.nowPrice;
          });
          this.TotalPrice = this.tableData1.reduce((sum, item) => {
            return sum.plus(new Big(item.nowPrice || '0'));
          }, new Big(0));
          this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10
        });
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    validateDiscount(row) {
      if (row.discount > 10) {
        row.discount = 10; // 强制将值设置为最大值
@@ -1097,7 +1116,7 @@
    },
    updateProPrice(row) {
      const ordPrice = new Big(row.ordPrice);
      const discount = new Big(row.discount);
      const result = ordPrice.times(discount.div(10));  // ordPrice * (discount / 10)
      row.nowPrice = result.toNumber();
@@ -1105,7 +1124,7 @@
        return sum.plus(new Big(item.nowPrice || '0'));
      }, new Big(0));
      this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1)*100)/100)*10
      this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10
    },
@@ -1283,42 +1302,6 @@
      this.$refs.historyTj.getlist();
    },
    candelete(item) {
      let data = {
        cusCardId: this.form.cusIdcard,
        proId: item.proPrantId,
      };
      delTbBycusCardIdAndProId(data).then((res) => {
        getTransitionList1(this.form.cusIdcard).then((response) => {
          this.tableData1 = response.data;
          this.TotalPrice1 = 0;
          if (this.tableData1) {
            this.tableData1.forEach((item) => {
              this.TotalPrice1 += item.ordPrice;
              this.TotalPrice += item.nowPrice;
              if (item.pacName === null) {
                item.pacName = "单项";
              }
              if (item.pacName == "单项") {
                item.list.forEach((item9) => {
                  this.treeList.push(item9.proId);
                });
              }
              this.pacName = item.pacName;
            });
            this.list1 = false;
            this.list3 = true;
          } else {
            this.list1 = true;
            this.TotalPrice = 0;
          }
        });
      });
    },
    cope() {
      this.tcShow = true;
      let cusIdCard = this.form.cusIdcard;
@@ -2695,7 +2678,6 @@
      } else {
        this.$message.warning("请先填写信息,再选体检内容");
      }
      let _this = this;
      if (this.tableData.length != 0) {
        this.tableData.forEach((item) => {
@@ -3139,7 +3121,7 @@
                message: "请选择套餐!",
              });
            }
          } else{
          } else {
            this.$modal.msgError("改变折扣错误");
          }
        })