qx
qx
2025-03-31 133bed33ad18d4c8615fd7a0f288a0f633efab12
src/views/system/package/index.vue
@@ -486,6 +486,7 @@
      },
      forms: {},
      youhui: 10,
      initializing: true, // 初始化标志
      debounceTimer: null,
      rules: {
       
@@ -497,6 +498,7 @@
    this.getKeyword();
    this.getCategory();
  },
  methods: {
    debounceNumberChange(currentValue, oldValue) {
      clearTimeout(this.debounceTimer);
@@ -608,6 +610,7 @@
        counterPrice: null,
        limits: 10,
      };
      this.initializing = true;
      this.resetForm("form");
    },
    handleQuery() {
@@ -649,6 +652,7 @@
      this.checkedListkey = [];
      this.checkedNodes = [];
      this.getDataList();
      this.youhui = 10
    },
    handleStatusChange(row) {
      let data = {
@@ -666,6 +670,7 @@
        });
    },
    handleUp() {
      this.reset();
      this.title = "体检套餐信息维护";
      this.open = true;
      getPacInFo(this.forms.pacId).then((response) => {
@@ -694,7 +699,7 @@
      getPacInFo(row.pacId).then((response) => {
        const data = response.data || {};
        Object.keys(data).forEach((key) => {
          this.$set(this.form, key, data[key]);
          this.$set(this.form, key, response.data[key]);
        });
        this.youhui = data.limits || 10;
        this.pics = data.price || 0;
@@ -707,7 +712,9 @@
        this.checkedkey = this.DataList.map(item => item.proId || '');
        this.checkedListkey = [...this.checkedkey];
        this.checkedNodes = [...this.checkedkey];
        return this.getDataList();
      }).then(() => {
        this.loading = false;
        this.$nextTick(() => {
@@ -716,7 +723,6 @@
      }).catch((error) => {
        this.loading = false;
        this.$message.error("加载数据失败");
        console.error(error);
      });
    },
    addmembers() {
@@ -826,7 +832,9 @@
        this.pics = this.DataList.reduce((total, item) => total + item.priceOrd, 0);
        this.$nextTick(() => {
          this.$refs.tree.setCheckedKeys(this.checkedNodes);
          this.initializing = false;
        });
      });
      this.loading = false;
    },
@@ -838,6 +846,9 @@
      });
    },
    handleCurrentChecked(data, checked, indeterminate) {
      if (this.initializing) {
        return; // 初始化时不处理
      }
      if (checked) {
        if (!this.DataList.some((item) => item.proId === data.proId)) {
          this.DataList.push({
@@ -851,14 +862,16 @@
        if (!this.checkedNodes.includes(data.proId)) {
          this.checkedNodes.push(data.proId);
        }
        this.updateTotalPrice();
      } else {
        this.DataList = this.DataList.filter((item) => item.proId !== data.proId);
        const index = this.checkedNodes.indexOf(data.proId);
        if (index > -1) {
          this.checkedNodes.splice(index, 1);
        }
        this.updateTotalPrice();
      }
      this.updateTotalPrice();
    },
    updateTotalPrice() {
      this.form.xianprice = this.DataList.reduce((sum, item) => {