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" @input="form.cusName = $event.replace(/\s/g, '')" />
              <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="handleIdCardInput"/>
              <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" @input="form.cusPhone = $event.replace(/\s/g, '')"/>
              <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,
      // 身份证需要
@@ -1074,9 +1079,9 @@
  },
  methods: {
    handleIdCardInput(value) {
  this.form.cusIdcard = value.replace(/\s/g, '');
  this.inputChange(); // 保留原有的身份证输入处理逻辑
},
      this.form.cusIdcard = value.replace(/\s/g, '');
      this.inputChange(); // 保留原有的身份证输入处理逻辑
    },
    debounceNumberChange(currentValue, oldValue) {
      clearTimeout(this.debounceTimer);
      this.debounceTimer = setTimeout(() => {
@@ -1116,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;
@@ -1147,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));
@@ -1237,15 +1242,15 @@
        if (this.form.firmId === originalCompId) {
          this.form.firmId = "";
        }
      }
      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;
        }
        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();
@@ -1285,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() {
@@ -1646,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(() => {
@@ -1704,45 +1711,46 @@
    },
    /** 登记提交按钮 */
    /** 登记提交按钮 */
submitForm() {
  let _this = this;
  if(!this.form.cusPhone || !this.form.cusName){
    submitForm() {
      let _this = this;
      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, '') : '';
      } 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, '') : '';
      // 处理性别值
      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;
      }
            // 处理性别值
            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;
      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;
      });
    }
  });
}
},
            }
            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() {
      if (this.getType == "2") {
@@ -1780,8 +1788,8 @@
            if (this.form.reservationId != null) {
              if (this.form.groupingId) {
                this.form.firmName = this.form.compName;
                this.dict.type.dict_team.forEach((item)=> {
                  if(item.label == "团队"){
                this.dict.type.dict_team.forEach((item) => {
                  if (item.label == "团队") {
                    this.form.tjType = item.value;
                  }
                })
@@ -1920,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) {
@@ -1979,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) {
@@ -2256,7 +2268,7 @@
      this.malldisble = false;
      this.defaultKeys = [];
      this.DataLists = [];
    },
    cancell() {
@@ -2276,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;
        });
@@ -2340,10 +2353,10 @@
    Package() {
      this.activeNames = "first";
      if (this.form.cusSex == "男") {
            this.form.cusSex = 0;
          } else  if (this.form.cusSex == "女"){
            _this.form.cusSex = 1;
          }
        this.form.cusSex = 0;
      } else if (this.form.cusSex == "女") {
        _this.form.cusSex = 1;
      }
      let cusSex = this.form.cusSex;
      this.datekey = Date.now();
      //全部套餐
@@ -2927,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;
            }
@@ -2940,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;
@@ -2956,122 +2977,122 @@
      });
    },
    submitCheckinfee() {
  let _this = this;
  if (_this.tjCategory !== "") {
    let List = _this.tableData1;
    if (this.responseList.cusId) {
      var userId = this.responseList.cusId;
    } else {
      var userId = _this.form.cusId;
    }
    let tjType = _this.form.tjType;
    if (this.tableData[0]) {
      var pacId = this.tableData[0].pacId;
    }
      let _this = this;
      if (_this.tjCategory !== "") {
        let List = _this.tableData1;
        if (this.responseList.cusId) {
          var userId = this.responseList.cusId;
        } else {
          var userId = _this.form.cusId;
        }
        let tjType = _this.form.tjType;
        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, '') : ''
    };
        // 去空格处理
        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) => {
          this.tjOrderList.push({
            proName: item1.proName,
            proPrice: item1.nowPrice,
            proId: item1.proId,
          });
        List.forEach((item) => {
          if (item.list) {
            item.list.forEach((item1) => {
              this.tjOrderList.push({
                proName: item1.proName,
                proPrice: item1.nowPrice,
                proId: item1.proId,
              });
            });
          } else if (item.tjProjectList) {
            item.tjProjectList.forEach((item1) => {
              this.tjOrderList.push({
                proName: item1.proName,
                proPrice: item1.priceNow,
                proId: item1.proId,
              });
            });
          } else {
            this.tjOrderList.push({
              proName: item.proName,
              proPrice: item.ysPrice,
              proId: item.proId,
            });
          }
        });
      } else if (item.tjProjectList) {
        item.tjProjectList.forEach((item1) => {
          this.tjOrderList.push({
            proName: item1.proName,
            proPrice: item1.priceNow,
            proId: item1.proId,
        let copeWith = this.TotalPrice1;
        let paidIn = this.TotalPrice.toString();
        let discount = this.discount;
        this.tjFlowingWater = { copeWith, paidIn, discount };
        let data;
        if (pacId || this.getType == "2") {
          data = {
            photo: this.srcUrl,
            pacId,
            tjOrderList: this.tjOrderList,
            tjFlowingWater: this.tjFlowingWater,
            userId,
            tjType,
            getType: this.getType,
            addAddress: this.addAddress,
            tjCategory: this.tjCategory,
            // 使用去掉空格后的数据
            cusName: processedForm.cusName,
            cusPhone: processedForm.cusPhone,
            cusIdcard: processedForm.cusIdcard
          };
        } else {
          data = {
            photo: this.srcUrl,
            tjOrderList: this.tjOrderList,
            tjFlowingWater: this.tjFlowingWater,
            userId,
            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;
          this.charge = true;
          let data = {
            tjNum: res.msg,
          };
          getfindTj(data).then((response) => {
            if (response.data) {
              this.feeitems = response.data;
              if (this.feeitems.length != 0) {
                this.$nextTick(() => {
                  this.$refs.multipleTable.toggleRowSelection(
                    this.feeitems[0],
                    true
                  );
                });
              } else {
                this.$refs.multipleTable.clearSelection();
              }
              this.loading = false;
            } else {
              this.feeitems = [];
              this.loading = false;
            }
          });
        });
      } else {
        this.tjOrderList.push({
          proName: item.proName,
          proPrice: item.ysPrice,
          proId: item.proId,
        });
        this.$modal.msgError("请选择体检类别");
      }
    });
    let copeWith = this.TotalPrice1;
    let paidIn = this.TotalPrice.toString();
    let discount = this.discount;
    this.tjFlowingWater = { copeWith, paidIn, discount };
    let data;
    if (pacId || this.getType == "2") {
      data = {
        photo: this.srcUrl,
        pacId,
        tjOrderList: this.tjOrderList,
        tjFlowingWater: this.tjFlowingWater,
        userId,
        tjType,
        getType: this.getType,
        addAddress: this.addAddress,
        tjCategory: this.tjCategory,
        // 使用去掉空格后的数据
        cusName: processedForm.cusName,
        cusPhone: processedForm.cusPhone,
        cusIdcard: processedForm.cusIdcard
      };
    } else {
      data = {
        photo: this.srcUrl,
        tjOrderList: this.tjOrderList,
        tjFlowingWater: this.tjFlowingWater,
        userId,
        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;
      this.charge = true;
      let data = {
        tjNum: res.msg,
      };
      getfindTj(data).then((response) => {
        if (response.data) {
          this.feeitems = response.data;
          if (this.feeitems.length != 0) {
            this.$nextTick(() => {
              this.$refs.multipleTable.toggleRowSelection(
                this.feeitems[0],
                true
              );
            });
          } else {
            this.$refs.multipleTable.clearSelection();
          }
          this.loading = false;
        } else {
          this.feeitems = [];
          this.loading = false;
        }
      });
    });
  } else {
    this.$modal.msgError("请选择体检类别");
  }
},
    },
    // 表格单选
    handleSelect(selection, val) {
@@ -3386,8 +3407,10 @@
}
.filter-tree {
  overflow-y: auto; /* 保留纵向滚动条 */
  overflow-x: hidden; /* 隐藏横向滚动条 */
  overflow-y: auto;
  /* 保留纵向滚动条 */
  overflow-x: hidden;
  /* 隐藏横向滚动条 */
  height: 350px;
}
@@ -3498,6 +3521,7 @@
  width: 100%;
  display: flex;
}
/* .tab3 {
  overflow-y: auto;
}