|
|
@@ -19,7 +19,15 @@
|
|
|
</el-image>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="手机号码" >
|
|
|
- <span v-if="item!=null">{{item.phone}}</span>
|
|
|
+ <template v-if="item!=null">
|
|
|
+ <span v-if="item.phone" style="margin-right: 8px;">{{item.phone}}</span>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ v-hasPermi="['his:user:bindPhNum']"
|
|
|
+ @click="openBindPhone"
|
|
|
+ >{{ item.phone ? '修改手机号' : '绑定手机号' }}</el-button>
|
|
|
+ </template>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="用户积分" >
|
|
|
<span v-if="item!=null">{{item.integral}}</span>
|
|
|
@@ -156,12 +164,31 @@
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 绑定手机号弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="item && item.phone ? '修改手机号' : '绑定手机号'"
|
|
|
+ :visible.sync="bindPhoneVisible"
|
|
|
+ width="420px"
|
|
|
+ append-to-body
|
|
|
+ @close="resetBindPhoneForm"
|
|
|
+ >
|
|
|
+ <el-form ref="bindPhoneForm" :model="bindPhoneForm" :rules="bindPhoneRules" label-width="90px">
|
|
|
+ <el-form-item label="手机号码" prop="phNum">
|
|
|
+ <el-input v-model="bindPhoneForm.phNum" placeholder="请输入手机号码" maxlength="11" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="bindPhoneVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" :loading="bindPhoneLoading" @click="submitBindPhone">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listPatient, getPatient, delPatient, addPatient, updatePatient, exportPatient ,getPatientByUserId} from "@/api/store/patient";
|
|
|
-import { listUser, getUser, delUser, addUser, updateUser, exportUser ,getUserAddr} from "@/api/store/user";
|
|
|
+import { listUser, getUser, delUser, addUser, updateUser, exportUser ,getUserAddr, bindPhNum} from "@/api/store/user";
|
|
|
import { getListUserCoupon } from "@/api/store/userCoupon";
|
|
|
import userStorerDetails from "../components/userStorerDetails.vue";
|
|
|
import userPatietDetails from "../components/userPatietDetails.vue";
|
|
|
@@ -199,6 +226,22 @@ export default {
|
|
|
// 积分购相关
|
|
|
integralPurchaseVisible: false,
|
|
|
currentUserId: null,
|
|
|
+ // 绑定手机号
|
|
|
+ bindPhoneVisible: false,
|
|
|
+ bindPhoneLoading: false,
|
|
|
+ bindPhoneForm: {
|
|
|
+ phNum: ''
|
|
|
+ },
|
|
|
+ bindPhoneRules: {
|
|
|
+ phNum: [
|
|
|
+ { required: true, message: '请输入手机号码', trigger: 'blur' },
|
|
|
+ {
|
|
|
+ pattern: /^1[3-9]\d{9}$/,
|
|
|
+ message: '请输入正确的手机号码',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
// 会员优惠券表格数据
|
|
|
userCouponList: [],
|
|
|
queryParams: {
|
|
|
@@ -251,6 +294,47 @@ export default {
|
|
|
this.currentUserId = null;
|
|
|
},
|
|
|
|
|
|
+ openBindPhone() {
|
|
|
+ this.resetBindPhoneForm();
|
|
|
+ this.bindPhoneVisible = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ resetBindPhoneForm() {
|
|
|
+ this.bindPhoneForm = { phNum: '' };
|
|
|
+ this.bindPhoneLoading = false;
|
|
|
+ if (this.$refs.bindPhoneForm) {
|
|
|
+ this.$refs.bindPhoneForm.clearValidate();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ submitBindPhone() {
|
|
|
+ this.$refs.bindPhoneForm.validate(valid => {
|
|
|
+ if (!valid) return;
|
|
|
+ if (!this.item || !this.item.userId) {
|
|
|
+ this.$message.warning('无法获取会员信息');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.bindPhoneLoading = true;
|
|
|
+ bindPhNum({
|
|
|
+ phNum: Number(this.bindPhoneForm.phNum),
|
|
|
+ fsUserId: this.item.userId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.msgSuccess(res.msg || '操作成功');
|
|
|
+ this.bindPhoneVisible = false;
|
|
|
+ this.item.phone = this.bindPhoneForm.phNum;
|
|
|
+ this.getDetails(this.item.userId);
|
|
|
+ } else {
|
|
|
+ this.msgError(res.msg || '操作失败');
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ // 错误信息由请求拦截器处理
|
|
|
+ }).finally(() => {
|
|
|
+ this.bindPhoneLoading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
handleClickX(tab, event) {
|
|
|
if(tab.name=="10"){
|
|
|
this.queryParams.status=null;
|