qx
9 天以前 4c4abb59d6ee838c61b851fcc7be93c0522c39c4
Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region
1个文件已修改
48 ■■■■ 已修改文件
src/views/system/tijian/index.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/tijian/index.vue
@@ -1715,7 +1715,9 @@
      let _this = this;
      if (!this.form.cusPhone || !this.form.cusName) {
        this.$message.warning("请填选必填项");
      } else {
    return;
  }
        this.$refs["form"].validate((valid) => {
          if (valid) {
            // 创建表单数据的副本并去除空格
@@ -1723,6 +1725,8 @@
            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, '') : '';
      // 添加 sfzImg 字段
      formData.sfzImg = this.imageUrl || ''; // 使用 base64 格式的头像数据,若为空则传空字符串
            // 处理性别值
            if (formData.cusSex === "女") {
@@ -1736,7 +1740,12 @@
            }
            if (formData.tjType === "") {
              formData.tjType = this.dict.type.dict_team[0].value;
      }
      // 可选:检查 sfzImg 是否存在
      if (!formData.sfzImg) {
        this.$message.warning("请先获取身份证头像");
        return;
            }
            addCustomer(formData).then((response) => {
@@ -1746,10 +1755,12 @@
              _this.tcShow = true;
              _this.isDisabled = true;
              _this.top = false;
      }).catch((error) => {
        this.$modal.msgError("登记失败,请检查数据");
        console.error("Error in addCustomer:", error);
            });
          }
        });
      }
    },
    getmailType() {
@@ -2240,11 +2251,6 @@
    handleChangesName(params) {
      this.form.cusIdcard = params[0].sfzh;
      this.handleQuery();
    },
    // 上传头像
    handleAvatarSuccess(res, file) {
      this.imageUrl = URL.createObjectURL(file.raw);
    },
    beforeAvatarUpload(file) {
      const isJPG = file.type === "image/jpeg";
@@ -3264,7 +3270,7 @@
          var pacId = this.tableData[0].pacId;
        }
        //tjOrderList//这个是处理完的每一项套餐信息
    // tjOrderList 处理
        List.forEach((item) => {
          if (item.list) {
            item.list.forEach((item1) => {
@@ -3290,27 +3296,30 @@
            });
          }
        });
        let copeWith = this.TotalPrice1;
        let paidIn = this.TotalPrice.toString();
        let discount = this.discount;
        this.tjFlowingWater = { copeWith, paidIn, discount };
        const newArray = this.tableData1
          .filter((item) => item.discount < 10) // 过滤出 discount < 10 的项
      .filter((item) => item.discount < 10)
          .map((item) => ({
            discount: item.discount,
            parentProId: item.parentProId,
            cusIdCard: item.cusId,
            yhj: item.nowPrice
          })); // 创建新的对象,包含 discount 和 id
        yhj: item.nowPrice,
      }));
        gaibianzhekou(newArray).then((res) => {
          this.loadingSubmit = false;
          if (res.code === 200) {
            let data;
            if (pacId || this.tjOrderList.length > 0) {
              data = {
                photo: this.srcUrl,
            photo: this.srcUrl, // 保留原有 photo 字段(如果后端仍需要)
            sfzImg: this.imageUrl, // 添加 sfzImg 字段,优先使用服务器URL,若无则使用base64
                pacId,
                tjOrderList: this.tjOrderList,
                tjFlowingWater: this.tjFlowingWater,
@@ -3322,19 +3331,6 @@
                firmDeptName: this.form.firmDeptName,
              };
              this.listgetOrder(data);
            } else if (pacId || this.tjOrderList.length > 0) {
              data = {
                photo: this.srcUrl,
                tjOrderList: this.tjOrderList,
                tjFlowingWater: this.tjFlowingWater,
                userId,
                tjType,
                tjCategory: this.tjCategory,
                firmId: this.form.firmId,
                firmName: this.form.firmName,
                firmDeptName: this.form.firmDeptName,
              };
              this.listgetOrder(data);
            } else {
              this.loadingSubmit = false;