1
wwl
2025-04-02 ba9feade5bf2759e64815e72e2b247d9a8b9c27e
1
2个文件已修改
313 ■■■■ 已修改文件
src/views/doctor/check/index.vue 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/comp/index.vue 229 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/check/index.vue
@@ -1095,7 +1095,7 @@
        // 将当前行添加到 rows 中
        this.rows.push(row);
        console.log(this.rows, row);
      }
    },
@@ -1343,7 +1343,7 @@
    },
    handleClose() {
      this.$tab.refreshPage();
      this.drawer = false;  // 只关闭抽屉,不刷新页面或重置数据
    },
    handleClose1() {
@@ -1356,7 +1356,7 @@
    changDesc(item) {
      console.log(item);
      item.conclusion = item.exceptionDesc ? "异常" : "正常";
    },
@@ -1839,47 +1839,47 @@
    },
    determine() {
  let tjNumber = this.tableAll.tjNumber;
  this.userList.forEach((item) => {
    if (this.doctorName == item.nickName) this.doctorName = item.userId;
  });
  this.proParentList.sons.forEach((item) => {
    if (this.rows) {
      this.rows.forEach((item1) => {
        if (item1 === item) item = item1;
      let tjNumber = this.tableAll.tjNumber;
      this.userList.forEach((item) => {
        if (this.doctorName == item.nickName) this.doctorName = item.userId;
      });
    }
    this.tjOrderDetail.push({
      proAdvice: item.proAdvice,
      proName: item.project.proName,
      proId: item.project.proId,
      orderDetailId: item.orderDetailId,
      flowingWaterId: item.flowingWaterId,
      proResult: item.proResult,
      tjStatus: 1,
      isReturn: item.isReturn === true ? 1 : 0,
      exceptionDesc: item.exceptionDesc === true ? 1 : 0,
      conclusion: item.conclusion,
      rulesList: item.rulesList,
    });
  });
      this.proParentList.sons.forEach((item) => {
        if (this.rows) {
          this.rows.forEach((item1) => {
            if (item1 === item) item = item1;
          });
        }
        this.tjOrderDetail.push({
          proAdvice: item.proAdvice,
          proName: item.project.proName,
          proId: item.project.proId,
          orderDetailId: item.orderDetailId,
          flowingWaterId: item.flowingWaterId,
          proResult: item.proResult,
          tjStatus: 1,
          isReturn: item.isReturn === true ? 1 : 0,
          exceptionDesc: item.exceptionDesc === true ? 1 : 0,
          conclusion: item.conclusion,
          rulesList: item.rulesList,
        });
      });
  let data = [{
    tjNumber,
    proId: this.proId,
    remark: this.proParentList.remark,
    proName: this.proName,
    summaryList: this.vaids1,
    doctorName: this.doctorName,
    tjOrderDetailList: this.tjOrderDetail,
  }];
  getaddRemark(data).then((res) => {
    this.$modal.msgSuccess("提交成功");
    this.rows = []; // 提交成功后清空 this.rows
    this.drawer = false;
  });
  this.handleClose();
},
      let data = [{
        tjNumber,
        proId: this.proId,
        remark: this.proParentList.remark,
        proName: this.proName,
        summaryList: this.vaids1,
        doctorName: this.doctorName,
        tjOrderDetailList: this.tjOrderDetail,
      }];
      getaddRemark(data).then((res) => {
        this.$modal.msgSuccess("提交成功");
        this.rows = []; // 提交成功后清空 this.rows
        this.drawer = false;
      });
      this.handleClose();
    },
  },
};
</script>
src/views/system/comp/index.vue
@@ -1,5 +1,45 @@
<template>
  <div class="app-container">
    <el-dialog title="选择套餐" :visible.sync="taocan" width="70%" height="700px" :close-on-click-modal="false">
  <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" label-width="auto">
    <el-form-item label="套餐名称" prop="pacName">
      <el-input
        v-model="queryParam.pacName"
        placeholder="请输入套餐名称"
        clearable
        @keyup.enter.native="handle"
        style="width: 200px"
      />
    </el-form-item>
    <el-form-item>
      <el-button
        type="primary"
        icon="el-icon-search"
        size="mini"
        @click="handle"
      >搜索</el-button>
    </el-form-item>
  </el-form>
  <el-table
    v-loading="loading"
    element-loading-text="正在加载中..."
    element-loading-spinner="el-icon-loading"
    border
    :data="newpacName1"
    @selection-change="handleSelectionChange1"
    height="450px"
    ref="tb"
  >
    <el-table-column type="selection" width="40px" align="center" label="选择" />
    <el-table-column label="套餐名称" align="center" prop="pacName" width="120px" />
    <el-table-column label="套餐价格" align="center" prop="price" width="120px" />
    <el-table-column label="套餐明细" align="center" prop="allProName" :show-overflow-tooltip="true" />
  </el-table>
  <span slot="footer" class="dialog-footer">
    <el-button @click="cancel1">取 消</el-button>
    <el-button type="primary" @click="submit">确 定</el-button>
  </span>
</el-dialog>
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"
      @submit.native.prevent>
      <el-form-item label="单位名称" prop="cnName">
@@ -289,8 +329,10 @@
                </template>
              </el-table-column>
            </el-table>
            <div style="font-size: 16px;margin-top: 10px;">当前项目条数:<span style="font-weight: 700;">{{ OnenewpacName.length }}</span>条</div>
            <div style="font-size: 16px;margin-top: 10px;">当前项目条数:<span style="font-weight: 700;">{{
              OnenewpacName.length
            }}</span>条</div>
          </el-col>
          <el-col :span="2" :xs="24">
            <div style="margin: 240% 16%">
@@ -300,6 +342,9 @@
          <el-col :span="8" :xs="24">
            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
              label-width="68px" @submit.native.prevent>
              <el-form-item>
                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button>
              </el-form-item>
              <el-form-item label="项目名称" prop="proName">
                <el-input ref="inputName" v-model="queryParams.proName" placeholder="请输入项目名称" clearable
                  @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -370,8 +415,10 @@
                </template>
              </el-table-column>
            </el-table>
            <div style="font-size: 16px;margin-top: 10px;">当前项目条数:<span style="font-weight: 700;">{{ OnenewpacName.length }}</span>条</div>
            <div style="font-size: 16px;margin-top: 10px;">当前项目条数:<span style="font-weight: 700;">{{
              OnenewpacName.length
            }}</span>条</div>
          </el-col>
          <el-col :span="2" :xs="24">
            <div style="margin: 240% 16%" class="btntoleft">
@@ -386,6 +433,10 @@
          <el-col :span="7" :xs="24">
            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
              label-width="68px" @submit.native.prevent>
              <el-form-item>
                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button>
              </el-form-item>
              <el-form-item label="项目名称" prop="proName">
                <el-input ref="inputName" v-model="queryParams.proName" placeholder="请输入项目名称" clearable
                  @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -459,8 +510,10 @@
                </template>
              </el-table-column>
            </el-table>
            <div style="font-size: 16px;margin-top: 10px;">当前项目条数:<span style="font-weight: 700;">{{ OnenewpacName.length }}</span>条</div>
            <div style="font-size: 16px;margin-top: 10px;">当前项目条数:<span style="font-weight: 700;">{{
              OnenewpacName.length
            }}</span>条</div>
          </el-col>
          <el-col :span="2" :xs="24">
            <div style="margin: 240% 16%">
@@ -472,6 +525,9 @@
          <el-col :span="8" :xs="24">
            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
              label-width="68px" @submit.native.prevent>
              <el-form-item>
                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button>
              </el-form-item>
              <el-form-item label="项目名称" prop="proName">
                <el-input ref="inputName" v-model="queryParams.proName" placeholder="请输入项目名称" clearable
                  @keyup.enter.native="handleSearchFor" style="width: 140px" />
@@ -582,8 +638,9 @@
  getPackageList,
  delegrouping,
  getDetails,
} from "@/api/system/comp";
import { deptTreeSelect, projectGetList, getconfigKey } from "@/api/system/tijian";
import { deptTreeSelect, projectGetList, getconfigKey,} from "@/api/system/tijian";
import { getInfo } from "@/api/login";
export default {
  name: "Comp",
@@ -605,6 +662,15 @@
      }
    };
    return {
      newpacName1: [],
      taocan: false,
      queryParam: {
        pageNum: 1,
        pageSize: 10,
        pacName: null,
        pacRemark: null,
      },
      // 遮罩层
      loading: true,
      Treedata: [],
@@ -737,6 +803,71 @@
    this.getList();
  },
  methods: {
    handleSelectionChange1(selection) {
  // 实现单选逻辑
  if (selection.length > 1) {
    const lastSelected = selection[selection.length - 1];
    this.$refs.tb.clearSelection();
    this.$refs.tb.toggleRowSelection(lastSelected, true);
    this.selectedPackage = lastSelected;
  } else if (selection.length === 1) {
    this.selectedPackage = selection[0];
  } else {
    this.selectedPackage = null;
  }
},
submit() {
  if (!this.selectedPackage) {
    this.$modal.msgError("请先选择一个套餐");
    return;
  }
  // 清空左侧表格
  this.OnenewpacName = [];
  // 获取选中的套餐项目列表
  const newProjects = this.selectedPackage.tjProjectList || [];
  // 将选中的套餐项目添加到左侧表格
  this.loading = true;
  newProjects.forEach(project => {
    // 为每个项目设置默认折扣和现价
    this.$set(project, 'limits', 10); // 默认折扣 10(即原价)
    this.$set(project, 'ysPrice', project.proPrice); // 现价初始化为原价
    this.OnenewpacName.push(project);
  });
  // 更新总价和现价
  this.queryParams.price = this.OnenewpacName.reduce((sum, item) => {
    return sum + (item.proPrice || 0);
  }, 0);
  this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => {
    return sum + (item.ysPrice || 0);
  }, 0);
  // 更新优惠值
  this.youhui = this.queryParams.price > 0
    ? (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10
    : 0;
  // 关闭对话框
  this.taocan = false;
  this.loading = false;
  this.$modal.msgSuccess("添加成功");
},
    cancel1() {
      this.taocan = false;
    },
    Package() {
      this.taocan = true;
      deptTreeSelect(this.forms.sex).then((res) => {
        if (res.rows) {
          this.newpacName1 = res.rows
        }
      });
    },
    handleManualChange(row) {
      console.log("这是主动出发的");
      this.updateProPrice(row);
@@ -985,49 +1116,49 @@
    },
    numberChangeXianPrice(currentValue, oldValue) {
  // 如果现价没有变化,直接返回
  if (this.queryParams.xianprice === this.lastXianPrice || !this.queryParams.xianprice) {
    return;
  }
  this.$confirm("确定修改所有子项的折扣吗?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      // 确保修改折扣的值
      this.youhui = currentValue;
      let totalYsprice = new Big(0); // 初始化总 ysprice
      // 遍历每个项目,更新每个子项的价格
      this.OnenewpacName.forEach((item) => {
        item.limits = this.youhui;
        const proPrice = new Big(item.proPrice);
        const limits = new Big(item.limits);
        const result = proPrice.times(limits.div(10));  // ordPrice * (discount / 10)
        item.ysPrice = result.toNumber();
        totalYsprice = totalYsprice.plus(new Big(item.ysPrice));
      });
      // 如果总的 ysPrice 和查询参数中的 xianprice 不一致,进行调整
      if (!totalYsprice.eq(this.queryParams.xianprice)) {
        const diff = new Big(this.queryParams.xianprice).minus(totalYsprice);
        // 如果 OnenewpacName 数组不为空,调整最后一项的 ysPrice
        if (this.OnenewpacName.length > 0) {
          const lastItem = this.OnenewpacName[this.OnenewpacName.length - 1];
          const newYsPrice = new Big(lastItem.ysPrice).plus(diff).toNumber();
          // 使用 $set 确保响应性更新
          this.$set(this.OnenewpacName[this.OnenewpacName.length - 1], 'ysPrice', newYsPrice);
        }
      // 如果现价没有变化,直接返回
      if (this.queryParams.xianprice === this.lastXianPrice || !this.queryParams.xianprice) {
        return;
      }
      // 更新 lastXianPrice 以便下次比较
      this.lastXianPrice = this.queryParams.xianprice;
    })
    .catch(() => {
      // 如果取消修改,恢复原有的优惠值
      this.youhui = oldValue;
    });
},
      this.$confirm("确定修改所有子项的折扣吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 确保修改折扣的值
          this.youhui = currentValue;
          let totalYsprice = new Big(0); // 初始化总 ysprice
          // 遍历每个项目,更新每个子项的价格
          this.OnenewpacName.forEach((item) => {
            item.limits = this.youhui;
            const proPrice = new Big(item.proPrice);
            const limits = new Big(item.limits);
            const result = proPrice.times(limits.div(10));  // ordPrice * (discount / 10)
            item.ysPrice = result.toNumber();
            totalYsprice = totalYsprice.plus(new Big(item.ysPrice));
          });
          // 如果总的 ysPrice 和查询参数中的 xianprice 不一致,进行调整
          if (!totalYsprice.eq(this.queryParams.xianprice)) {
            const diff = new Big(this.queryParams.xianprice).minus(totalYsprice);
            // 如果 OnenewpacName 数组不为空,调整最后一项的 ysPrice
            if (this.OnenewpacName.length > 0) {
              const lastItem = this.OnenewpacName[this.OnenewpacName.length - 1];
              const newYsPrice = new Big(lastItem.ysPrice).plus(diff).toNumber();
              // 使用 $set 确保响应性更新
              this.$set(this.OnenewpacName[this.OnenewpacName.length - 1], 'ysPrice', newYsPrice);
            }
          }
          // 更新 lastXianPrice 以便下次比较
          this.lastXianPrice = this.queryParams.xianprice;
        })
        .catch(() => {
          // 如果取消修改,恢复原有的优惠值
          this.youhui = oldValue;
        });
    },
    changegroupingName() {