1
wwl
2025-01-04 492a91ada4f0f98d9d800b55f9dddda7b53f7dd8
src/views/system/tijian/index.vue
@@ -218,13 +218,7 @@
              <el-input :disabled="isDisabled" v-model="form.cusIntroduce" placeholder="请输入介绍人" />
            </el-form-item>
            <el-form-item label="单位名称" prop="compName">
              <el-select :disabled="isDisabled" v-model="form.compName" remote default-first-option allow-create
                filterable style="width: 200px" placeholder="请选择单位名称" clearable @change="idFn1">
                <el-option v-for="dict in CompanyList" :key="dict.cnName" :label="dict.cnName" :value="dict.cnName" />
              </el-select>
              <!-- <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> -->
            </el-form-item>
            <el-form-item label="文化程度" prop="wenHua" label-width="93px">
              <el-input :disabled="isDisabled" v-model="form.wenHua" placeholder="请输入文化程度" />
@@ -301,7 +295,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 +316,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">
@@ -494,15 +476,47 @@
      <el-col :span="15">
        <div class="grid-content bg-purple">
          <template>
            <el-form :model="form" :inline="true" label-width="75px" style="margin-left: 20px">
            <el-form :model="form" :inline="true" label-width="75px" style="margin-left: 20px;width: 900px;">
              <el-form-item label="姓名" prop="cusName">
                <span slot="label">
                  姓名
                </span>
                <el-input v-model="form.cusName" placeholder="请输入姓名" :disabled="isDisabled" />
              </el-form-item>
              <el-form-item label="性别" prop="cusSex">
                <el-select :disabled="isDisabled" v-model="form.cusSex" placeholder="性别" style="width: 150px">
                  <el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
                    :value="parseInt(dict.value)"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="证件号码" prop="cusIdcard">
                <span slot="label">
                  证件号码
                </span>
                <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="请输入身份证号" @input="inputChange" />
              </el-form-item>
              <el-form-item label="单位名称" prop="firmName">
                <el-select v-model="form.firmName" remote default-first-option allow-create filterable
                  style="width: 200px" placeholder="请选择单位名称" clearable @change="idFn1" @clear="clear">
                  <el-option v-for="dict in CompanyList" :key="dict.cnName" :label="dict.cnName" :value="dict.cnName" />
                </el-select>
              </el-form-item>
              <el-form-item label="体检类型">
                <el-select style="width: 150px" v-model="form.tjType" placeholder="请选择体检类型">
                  <el-option v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label"
                    :value="dict.value"></el-option>
                    :value="dict.value" :disabled="!form.firmId && dict.value === '1'"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="体检类别">
                <el-select style="width: 200px" v-model="tjCategory" placeholder="请选择体检类别">
                  <el-option v-for="dict in dict.type.dict_tjtype" :key="dict.value" :label="dict.label"
                    :value="dict.value"></el-option>
                </el-select>
                <!-- <el-input v-model="form.category" placeholder="请输入体检类别" /> -->
              </el-form-item>
              <el-form-item label="应收金额">
                <el-input placeholder="应收金额" v-model="TotalPrice1" disabled style="width: 150px"></el-input>
                <el-input placeholder="应收金额" v-model="TotalPrice1" disabled style="width: 200px"></el-input>
              </el-form-item>
              <el-form-item label="优惠">
                <!-- {{ discount }} -->
@@ -510,24 +524,11 @@
                  :max="10" :min="0" @change="numberChange" :disabled="isfalse"></el-input-number>
              </el-form-item>
              <el-form-item label="实收金额">
                <el-input placeholder="实收金额" v-model="TotalPrice" style="width: 150px"></el-input>
                <el-input placeholder="实收金额" v-model="TotalPrice" style="width: 206px"></el-input>
              </el-form-item>
              <br />
              <el-form-item label="领取方式">
                <el-select v-model="getType" style="width: 150px" @change="getmailType">
                  <el-option v-for="dict in dict.type.report_get_type" :key="dict.value" :label="dict.label"
                    :value="dict.value"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="体检类别">
                <el-select style="width: 150px" v-model="tjCategory" placeholder="请选择体检类别">
                  <el-option v-for="dict in dict.type.dict_tjtype" :key="dict.value" :label="dict.label"
                    :value="dict.value"></el-option>
                </el-select>
                <!-- <el-input v-model="form.category" placeholder="请输入体检类别" /> -->
              </el-form-item>
              <el-form-item style="margin-left: 149px">
                <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button>
@@ -617,6 +618,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>
@@ -1032,6 +1039,8 @@
        cusMarryStatus: "5",
        idType: "1",
        ageUnit: "0",
        firmId: '',
      },
      form1: {},
      title: "",
@@ -1084,6 +1093,34 @@
  mounted() { },
  methods: {
    clear() {
      this.form.firmId = ""
    },
    /** 删除按钮操作 */
    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 +1134,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 +1142,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
    },
@@ -1158,16 +1195,20 @@
    },
    idFn1(value) {
      if (value) {
        const originalCompId = this.form.dictCompId;
        this.form.compName = value;
        console.log(value)
        const originalCompId = this.form.firmId;
        this.form.firmName = value;
        this.CompanyList.forEach((item) => {
          if (item.cnName == this.form.compName) {
            this.form.dictCompId = item.drugManufacturerId;
          if (item.cnName == this.form.firmName) {
            this.form.firmId = item.drugManufacturerId;
          }
        });
        if (this.form.dictCompId === originalCompId) {
          this.form.dictCompId = "";
        if (this.form.firmId === originalCompId) {
          this.form.firmId = "";
        }
        if (this.form.firmId) {
          this.form.tjType = "1"
        }
      }
    },
@@ -1283,42 +1324,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;
@@ -1568,6 +1573,7 @@
        updateBy: null,
        updateTime: null,
        deleted: null,
        firmid: ''
      };
      this.resetForm("form");
    },
@@ -1600,11 +1606,34 @@
    // 折扣
    numberChange(currentValue, oldValue) {
      this.discount = currentValue;
      if (this.discount <= this.getInfodis) {
        this.discount = this.getInfodis;
      }
      // this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2);
      this.$confirm("确定修改所有子项的折扣吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.discount = currentValue;
          if (this.discount < this.getInfodis) {
            this.discount = this.getInfodis;
            // this.$modal.msgError(`该人员最高优惠权限为${this.getInfodis}折`);
          }
          this.tableData1.forEach((item) => {
            item.discount = this.discount
            const ordPrice = new Big(item.ordPrice);
            const discount = new Big(item.discount);
            const result = ordPrice.times(discount.div(10));  // ordPrice * (discount / 10)
            item.nowPrice = result.toNumber();
            this.TotalPrice = this.tableData1.reduce((sum, item) => {
              return sum.plus(new Big(item.nowPrice || '0'));
            }, new Big(0));
          })
          // ----------------------------------------------------------
        })
        .catch(() => {
          this.discount = oldValue;
        });
    },
    /** 登记提交按钮 */
@@ -2152,7 +2181,7 @@
      this.name = this.queryParam.pacName;
      let param = {
        sex: this.form.cusSex,
        dwId: this.form.dictCompId
        dwId: this.form.firmId
      }
      if (this.name) {
        getPackageListName(this.name).then((response) => {
@@ -2266,10 +2295,10 @@
      let param = {
        sex: cusSex,
        dwId: this.form.dictCompId || ''
        dwId: this.form.firmId || ''
      }
      if (this.form.tjType == 1) {
        if (!this.form.dictCompId) {
        if (!this.form.firmId) {
          this.$message({
            type: "warning",
            message: "请先维护单位!",
@@ -2695,7 +2724,6 @@
      } else {
        this.$message.warning("请先填写信息,再选体检内容");
      }
      let _this = this;
      if (this.tableData.length != 0) {
        this.tableData.forEach((item) => {
@@ -2730,8 +2758,6 @@
              this.TotalPrice1 = 0;
              if (this.tableData1) {
                this.tableData1.forEach((item) => {
                  this.TotalPrice1 += item.ordPrice;
                  this.TotalPrice += item.nowPrice;
                  if (item.tjCategory != null) {
                    this.tjCategory = item.tjCategory;
                  }
@@ -2740,10 +2766,16 @@
                      this.treeList.push(item9.proId);
                    });
                  }
                  this.TotalPrice1 += item.ordPrice;
                  this.TotalPrice += item.nowPrice;
                  this.pacName = item.pacName;
                });
                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.list1 = false;
                this.list3 = true;
                this.list2 = false;
@@ -2756,7 +2788,8 @@
          }
        });
      } else {
      }
       else {
        getaddtTransition(data).then((response) => {
          if (response.code == 200) {
            let cusId = this.form.cusIdcard;
@@ -2766,8 +2799,6 @@
              this.TotalPrice1 = 0;
              if (this.tableData1) {
                this.tableData1.forEach((item) => {
                  this.TotalPrice1 += item.ordPrice;
                  this.TotalPrice += item.nowPrice;
                  if (item.tjCategory != null) {
                    this.tjCategory = item.tjCategory;
                  }
@@ -2776,9 +2807,12 @@
                      this.treeList.push(item9.proId);
                    });
                  }
                  this.TotalPrice1 += item.ordPrice;
                  this.TotalPrice += item.nowPrice;
                  this.pacName = item.pacName;
                });
                this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10
                this.list1 = false;
@@ -2794,8 +2828,6 @@
          }
        });
      }
      this.taocan = false;
      this.defaultKeys = [];
      this.DataLists = [];
@@ -3139,7 +3171,7 @@
                message: "请选择套餐!",
              });
            }
          } else{
          } else {
            this.$modal.msgError("改变折扣错误");
          }
        })