1
wwl
2025-04-02 ba9feade5bf2759e64815e72e2b247d9a8b9c27e
1
2个文件已修改
141 ■■■■■ 已修改文件
src/views/doctor/check/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/comp/index.vue 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/check/index.vue
@@ -1343,7 +1343,7 @@
    },
    handleClose() {
      this.$tab.refreshPage();
      this.drawer = false;  // 只关闭抽屉,不刷新页面或重置数据
    },
    handleClose1() {
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,7 +329,9 @@
                </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">
@@ -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,7 +415,9 @@
                </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">
@@ -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,7 +510,9 @@
                </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">
@@ -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);