qx
7 天以前 e8c70e6ca2ab1eb5bc3b2120352e2c6572b3ee9a
src/views/system/tijian/index.vue
@@ -89,7 +89,8 @@
              <span slot="label" style="display: inline-block; border-bottom: 2px solid blue" @click="openname">
                姓名
              </span>
              <el-input v-model="form.cusName" placeholder="请输入姓名" :disabled="isDisabled" />
              <el-input v-model="form.cusName" placeholder="请输入姓名" :disabled="isDisabled"
                @input="form.cusName = $event.replace(/\s/g, '')" />
            </el-form-item>
            <el-form-item label="证件类型" prop="idType">
@@ -147,7 +148,8 @@
              <span slot="label" style="display: inline-block; border-bottom: 2px solid blue" @click="handleQuery">
                证件号码
              </span>
              <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="请输入身份证号" @input="inputChange" />
              <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="请输入身份证号"
                @input="handleIdCardInput" />
              <!-- <i style="
                    font-size: 1rem;
                    position: absolute;
@@ -179,7 +181,8 @@
                trigger: 'blur',
              },
            ]">
              <el-input v-model="form.cusPhone" placeholder="请输入联系电话" :disabled="isDisabled" />
              <el-input v-model="form.cusPhone" placeholder="请输入联系电话" :disabled="isDisabled" maxlength="11"
                @input="form.cusPhone = $event.replace(/\s/g, '')" />
            </el-form-item>
            <el-form-item label="出生日期" prop="cusBrithday">
@@ -282,7 +285,8 @@
      <el-tabs type="border-card" style="height: 560px; margin: 0 10px; width: 100%" v-model="activeNames"
        @tab-click="handleClick">
        <el-tab-pane label="套餐" name="first">
          <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" v-if="showSearch" label-width="auto">
          <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" v-if="showSearch" label-width="auto"
            @submit.native.prevent="handle">
            <el-form-item label="套餐名称" prop="pacName">
              <el-input v-model="queryParam.pacName" placeholder="请输入套餐名称" clearable @keyup.enter.native="handle" />
            </el-form-item>
@@ -336,7 +340,7 @@
                    margin-top: 10px;
                  ">
                  已选项目列表
                </div>
                <el-table :data="DataLists" border style="width: 100%" height="400" :span-method="objectspanmethod">
                  <el-table-column prop="propinName" label="检查项目">
@@ -529,7 +533,7 @@
                this.tableData1[0].pacName || ""
              }}</span>
              已选项目条数:<span style="font-weight: 700; color: red; margin-right: 5px">{{ this.tableData1.length || 0
                }}</span>条
              }}</span>条
            </div>
            已选项目列表
          </div>
@@ -954,6 +958,7 @@
      // valueUrl: "ws://192.168.1.3:6789/websocket",
      valueUrl: "ws://127.0.0.1:6789/websocket",
      valueUrls: "ws://127.0.0.1:6789/websocket",
      // valueUrls: "ws://"+getIp() +":6789/websocket",
      webSocket: null,
      // 身份证需要
@@ -1073,6 +1078,10 @@
    this.marryall = 0;
  },
  methods: {
    handleIdCardInput(value) {
      this.form.cusIdcard = value.replace(/\s/g, '');
      this.inputChange(); // 保留原有的身份证输入处理逻辑
    },
    debounceNumberChange(currentValue, oldValue) {
      clearTimeout(this.debounceTimer);
      this.debounceTimer = setTimeout(() => {
@@ -1112,7 +1121,7 @@
            });
            this.TotalPrice = this.tableData1.reduce((sum, item) => {
              return sum.plus(new Big(item.nowPrice || "0"));
            }, new Big(0));
            }, new Big(0)).toNumber();
            this.discount =
              (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) *
              10;
@@ -1143,13 +1152,13 @@
      row.nowPrice = result.toNumber();
      this.TotalPrice = this.tableData1.reduce((sum, item) => {
        return sum.plus(new Big(item.nowPrice || "0"));
      }, new Big(0));
      }, new Big(0)).toNumber();
      this.discount =
        (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10;
    },
    updateProPrice1(row) {
      console.log("进入了1")
      console.log("进入了1", row)
      const ordPrice = new Big(row.ordPrice);
      const discount = new Big(row.discount);
      const result = ordPrice.times(discount.div(10));
@@ -1221,11 +1230,9 @@
      this.open1 = true;
      this.title = "添加体检单位信息维护";
    },
    idFn1(value) {
      if (value) {
        // console.log(value);
    idFn1() {
      if (this.form.firmName) {
        const originalCompId = this.form.firmId;
        this.form.firmName = value;
        this.CompanyList.forEach((item) => {
          if (item.cnName == this.form.firmName) {
            this.form.firmId = item.drugManufacturerId;
@@ -1235,10 +1242,15 @@
        if (this.form.firmId === originalCompId) {
          this.form.firmId = "";
        }
        if (this.form.firmId) {
          this.form.tjType = "1";
        }
      }
      if (this.form.firmName) {
        this.form.tjType = this.dict.type.dict_team[1].value;
      } else {
        this.form.tjType = this.dict.type.dict_team[0].value;
      }
    },
    getCurrentDateTime() {
      const currentDate = new Date();
@@ -1278,32 +1290,34 @@
      //   return data.proEngName.indexOf(value) !== -1;
      // }
      if (!value) return true;
        if (data.proName.indexOf(value) !== -1) return true;
        if (data.proEngName.indexOf(value) !== -1) return true;
        // 匹配小写
        let arr = data.proName.spell('low', 'array');
        let spell = arr.join('');
        let lengths = [0];
        for (var i = 0; i < arr.length - 1; i++) {
            lengths.push(lengths[i] + arr[i].length);
        };
        //判断label完整拼音 中 输入值的 index 是不是等于某个汉字第一个拼音字母的index值
        if(lengths.indexOf(spell.indexOf(value)) !== -1) return true
        // 大写
        let arrUp = data.proName.spell('up', 'array');
        let spellUp = arrUp.join('');
        let lengthsUp = [0];
        for (var i = 0; i < arrUp.length - 1; i++) {
            lengthsUp.push(lengthsUp[i] + arrUp[i].length);
        };
        return lengthsUp.indexOf(spellUp.indexOf(value)) !== -1;
      if (data.proName.indexOf(value) !== -1) return true;
      let values = value.toLowerCase();
      if (data.proEngName.indexOf(values) !== -1) return true;
      // 匹配小写
      let arr = data.proName.spell('low', 'array');
      let spell = arr.join('');
      let lengths = [0];
      for (var i = 0; i < arr.length - 1; i++) {
        lengths.push(lengths[i] + arr[i].length);
      };
      //判断label完整拼音 中 输入值的 index 是不是等于某个汉字第一个拼音字母的index值
      if (lengths.indexOf(spell.indexOf(value)) !== -1) return true
      // 大写
      let arrUp = data.proName.spell('up', 'array');
      let spellUp = arrUp.join('');
      let lengthsUp = [0];
      for (var i = 0; i < arrUp.length - 1; i++) {
        lengthsUp.push(lengthsUp[i] + arrUp[i].length);
      };
      return lengthsUp.indexOf(spellUp.indexOf(value)) !== -1;
    },
    filterpackage(value, data) {
      if (!value) return true;
      if (data.zhmc.indexOf(value) !== -1) {
        return data.zhmc.indexOf(value) !== -1;
      } else {
        return data.pym.indexOf(value) !== -1;
        let values = value.toLowerCase();
        return data.pym.indexOf(values) !== -1;
      }
    },
    beforeDestroy() {
@@ -1639,7 +1653,7 @@
            item.nowPrice = result.toNumber();
            this.TotalPrice = this.tableData1.reduce((sum, item) => {
              return sum.plus(new Big(item.nowPrice || "0"));
            }, new Big(0));
            }, new Big(0)).toNumber();
          });
        })
        .catch(() => {
@@ -1696,35 +1710,46 @@
        });
    },
    /** 登记提交按钮 */
    /** 登记提交按钮 */
    submitForm() {
      let _this = this;
      this.$refs["form"].validate((valid) => {
        if (valid) {
          // return;
          if (this.form.cusSex === "女") {
            this.form.cusSex = 1;
          }
          if (this.form.cusSex === "男") {
            this.form.cusSex = 0;
          }
          if (this.form.cusSex === "未知") {
            this.form.cusSex = 2;
          }
          if (this.form.tjType === "") {
            this.form.tjType = this.dict.type.dict_team[0].value;
          }
      if (!this.form.cusPhone || !this.form.cusName) {
        this.$message.warning("请填选必填项");
      } else {
        this.$refs["form"].validate((valid) => {
          if (valid) {
            // 创建表单数据的副本并去除空格
            const formData = { ...this.form };
            formData.cusName = formData.cusName ? formData.cusName.replace(/\s/g, '') : '';
            formData.cusPhone = formData.cusPhone ? formData.cusPhone.replace(/\s/g, '') : '';
            formData.cusIdcard = formData.cusIdcard ? formData.cusIdcard.replace(/\s/g, '') : '';
          addCustomer(this.form).then((response) => {
            this.responseList = response.data;
            // 处理性别值
            if (formData.cusSex === "女") {
              formData.cusSex = 1;
            }
            if (formData.cusSex === "男") {
              formData.cusSex = 0;
            }
            if (formData.cusSex === "未知") {
              formData.cusSex = 2;
            }
            if (formData.tjType === "") {
              formData.tjType = this.dict.type.dict_team[0].value;
            this.$modal.msgSuccess("新增成功");
            }
            _this.tcShow = true;
            _this.isDisabled = true;
            _this.top = false;
          });
        }
      });
            addCustomer(formData).then((response) => {
              this.responseList = response.data;
              this.form.tjType = this.dict.type.dict_team[0].value;
              this.$modal.msgSuccess("新增成功");
              _this.tcShow = true;
              _this.isDisabled = true;
              _this.top = false;
            });
          }
        });
      }
    },
    getmailType() {
@@ -1763,7 +1788,12 @@
            if (this.form.reservationId != null) {
              if (this.form.groupingId) {
                this.form.firmName = this.form.compName;
                this.form.tjType = "1";
                this.dict.type.dict_team.forEach((item) => {
                  if (item.label == "团队") {
                    this.form.tjType = item.value;
                  }
                })
                // this.form.tjType = this.dict.type.dict_team[1].value;
                this.CompanyList.forEach((item) => {
                  if (item.cnName == this.form.firmName) {
                    this.form.firmId = item.drugManufacturerId;
@@ -1898,11 +1928,15 @@
    // 最新使用webSocket通信
    readCardWebSocket(resultObj) {
      let _this = this;
      const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char)
      if (resultObj.code === 200 && resultObj.data.name != null) {
        //回显相关数据
        _this.form.cusName = resultObj.data.name;
        _this.form.cusSex = resultObj.data.sex == "0" ? "女" : "男";
        if (isChineseChar(resultObj.data.sex)) {
          _this.form.cusSex = resultObj.data.sex == "女" ? 1 : 0
        } else {
          _this.form.cusSex = resultObj.data.sex;
        }
        _this.form.cusNational = resultObj.data.mz;
        _this.form.cusBrithday = resultObj.data.csrq;
        if (_this.form.cusBrithday) {
@@ -1957,7 +1991,7 @@
          //回显相关数据
          _this.form.cusName = resultObj.resultContent.partyName;
          _this.form.cusSex =
            resultObj.resultContent.gender == "0" ? "女" : "男";
            resultObj.resultContent.gender;
          _this.form.cusNational = resultObj.resultContent.nation;
          _this.form.cusBrithday = resultObj.resultContent.bornDay;
          if (_this.form.cusBrithday) {
@@ -2234,7 +2268,7 @@
      this.malldisble = false;
      this.defaultKeys = [];
      this.DataLists = [];
    },
    cancell() {
@@ -2254,7 +2288,8 @@
        dwId: this.form.firmId,
      };
      if (this.name) {
        getPackageListName(this.name).then((response) => {
        let name = this.name.toLowerCase()
        getPackageListName(name).then((response) => {
          this.newpacName = response.data;
          this.loading = false;
        });
@@ -2317,6 +2352,11 @@
    Package() {
      this.activeNames = "first";
      if (this.form.cusSex == "男") {
        this.form.cusSex = 0;
      } else if (this.form.cusSex == "女") {
        _this.form.cusSex = 1;
      }
      let cusSex = this.form.cusSex;
      this.datekey = Date.now();
      //全部套餐
@@ -2900,10 +2940,15 @@
    // 处理订单项目
    processOrderItems(cusId) {
      console.log(11222)
      getTransitionList1(cusId).then((response) => {
        this.tableData1 = response.data;
        let Price = 0;
        if (this.tableData1) {
          this.tableData1.forEach((item) => {
            if (typeof item.nowPrice === 'number') {
              item.nowPrice = Number(item.nowPrice.toFixed(3));
            }
            if (item.tjCategory != null) {
              this.tjCategory = item.tjCategory;
            }
@@ -2913,8 +2958,11 @@
              });
            }
            this.TotalPrice1 += item.ordPrice || 0; // 累加应收金额
            this.TotalPrice += item.nowPrice || 0; // 累加实收金额
            // this.TotalPrice += item.nowPrice || 0;
            Price += item.nowPrice || 0; // 累加实收金额
            this.TotalPrice = Price.toFixed(2);
          });
          console.log(this.TotalPrice1, this.TotalPrice)
          // 计算折扣
          this.discount = this.TotalPrice1 > 0 ?
            (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 : 0;
@@ -2941,6 +2989,15 @@
        if (this.tableData[0]) {
          var pacId = this.tableData[0].pacId;
        }
        // 去空格处理
        const processedForm = {
          ...this.form,
          cusName: this.form.cusName ? this.form.cusName.replace(/\s/g, '') : '',
          cusPhone: this.form.cusPhone ? this.form.cusPhone.replace(/\s/g, '') : '',
          cusIdcard: this.form.cusIdcard ? this.form.cusIdcard.replace(/\s/g, '') : ''
        };
        List.forEach((item) => {
          if (item.list) {
            item.list.forEach((item1) => {
@@ -2966,6 +3023,7 @@
            });
          }
        });
        let copeWith = this.TotalPrice1;
        let paidIn = this.TotalPrice.toString();
        let discount = this.discount;
@@ -2983,6 +3041,10 @@
            getType: this.getType,
            addAddress: this.addAddress,
            tjCategory: this.tjCategory,
            // 使用去掉空格后的数据
            cusName: processedForm.cusName,
            cusPhone: processedForm.cusPhone,
            cusIdcard: processedForm.cusIdcard
          };
        } else {
          data = {
@@ -2993,8 +3055,13 @@
            tjType,
            getType: this.getType,
            tjCategory: this.tjCategory,
            // 使用去掉空格后的数据
            cusName: processedForm.cusName,
            cusPhone: processedForm.cusPhone,
            cusIdcard: processedForm.cusIdcard
          };
        }
        getOrder(data).then((res) => {
          this.$modal.msgSuccess("提交成功");
          this.tjNumbers = res.msg;
@@ -3233,6 +3300,7 @@
            discount: item.discount,
            parentProId: item.parentProId,
            cusIdCard: item.cusId,
            yhj: item.nowPrice
          })); // 创建新的对象,包含 discount 和 id
        gaibianzhekou(newArray).then((res) => {
          this.loadingSubmit = false;
@@ -3339,8 +3407,10 @@
}
.filter-tree {
  overflow-y: auto; /* 保留纵向滚动条 */
  overflow-x: hidden; /* 隐藏横向滚动条 */
  overflow-y: auto;
  /* 保留纵向滚动条 */
  overflow-x: hidden;
  /* 隐藏横向滚动条 */
  height: 350px;
}
@@ -3451,6 +3521,7 @@
  width: 100%;
  display: flex;
}
/* .tab3 {
  overflow-y: auto;
}