| | |
| | | let _this = this; |
| | | if (!this.form.cusPhone || !this.form.cusName) { |
| | | this.$message.warning("请填选必填项"); |
| | | } else { |
| | | return; |
| | | } |
| | | |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | // 创建表单数据的副本并去除空格 |
| | |
| | | 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 === "女") { |
| | |
| | | } |
| | | if (formData.tjType === "") { |
| | | formData.tjType = this.dict.type.dict_team[0].value; |
| | | } |
| | | |
| | | // 可选:检查 sfzImg 是否存在 |
| | | if (!formData.sfzImg) { |
| | | this.$message.warning("请先获取身份证头像"); |
| | | return; |
| | | } |
| | | |
| | | addCustomer(formData).then((response) => { |
| | |
| | | _this.tcShow = true; |
| | | _this.isDisabled = true; |
| | | _this.top = false; |
| | | }).catch((error) => { |
| | | this.$modal.msgError("登记失败,请检查数据"); |
| | | console.error("Error in addCustomer:", error); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | getmailType() { |
| | |
| | | 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"; |
| | |
| | | var pacId = this.tableData[0].pacId; |
| | | } |
| | | |
| | | //tjOrderList//这个是处理完的每一项套餐信息 |
| | | // tjOrderList 处理 |
| | | List.forEach((item) => { |
| | | if (item.list) { |
| | | item.list.forEach((item1) => { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | 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, |
| | |
| | | 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; |