1
wwl
2025-03-10 55ea92618035b490745ecb8026c8cd1a772b9e09
1
1个文件已修改
58 ■■■■ 已修改文件
src/views/system/tijian/index.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/tijian/index.vue
@@ -89,7 +89,7 @@
              <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 +147,7 @@
              <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 +179,7 @@
                trigger: 'blur',
              },
            ]">
              <el-input v-model="form.cusPhone" placeholder="请输入联系电话" :disabled="isDisabled" />
              <el-input v-model="form.cusPhone" placeholder="请输入联系电话" :disabled="isDisabled" @input="form.cusPhone = $event.replace(/\s/g, '')"/>
            </el-form-item>
            <el-form-item label="出生日期" prop="cusBrithday">
@@ -1073,6 +1073,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(() => {
@@ -1696,29 +1700,34 @@
        });
    },
    /** 登记提交按钮 */
    /** 登记提交按钮 */
    submitForm() {
      let _this = this;
      this.$refs["form"].validate((valid) => {
        if (valid) {
          // return;
          if (this.form.cusSex === "女") {
            this.form.cusSex = 1;
      // 创建表单数据的副本并去除空格
      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 (this.form.cusSex === "男") {
            this.form.cusSex = 0;
      if (formData.cusSex === "男") {
        formData.cusSex = 0;
          }
          if (this.form.cusSex === "未知") {
            this.form.cusSex = 2;
      if (formData.cusSex === "未知") {
        formData.cusSex = 2;
          }
          if (this.form.tjType === "") {
            this.form.tjType = this.dict.type.dict_team[0].value;
      if (formData.tjType === "") {
        formData.tjType = this.dict.type.dict_team[0].value;
          }
          addCustomer(this.form).then((response) => {
      addCustomer(formData).then((response) => {
            this.responseList = response.data;
            this.$modal.msgSuccess("新增成功");
            _this.tcShow = true;
            _this.isDisabled = true;
            _this.top = false;
@@ -2941,6 +2950,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 +2984,7 @@
            });
          }
        });
        let copeWith = this.TotalPrice1;
        let paidIn = this.TotalPrice.toString();
        let discount = this.discount;
@@ -2983,6 +3002,10 @@
            getType: this.getType,
            addAddress: this.addAddress,
            tjCategory: this.tjCategory,
        // 使用去掉空格后的数据
        cusName: processedForm.cusName,
        cusPhone: processedForm.cusPhone,
        cusIdcard: processedForm.cusIdcard
          };
        } else {
          data = {
@@ -2993,8 +3016,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;