Sfoglia il codice sorgente

微信登录 /飞书

三七 4 ore fa
parent
commit
42ea20f252

+ 9 - 0
src/api/store/user.js

@@ -125,3 +125,12 @@ export function enabledBlackUsers(data) {
   })
   })
 }
 }
 
 
+// 绑定手机号
+export function bindPhNum(data) {
+  return request({
+    url: '/store/user/bindPhNum',
+    method: 'post',
+    data: data
+  })
+}
+

+ 30 - 1
src/views/company/companyUser/index.vue

@@ -275,6 +275,14 @@
                 v-if="scope.row.doctorId!=null"
                 v-if="scope.row.doctorId!=null"
                 @click="handleUnBindUserId(scope.row)"
                 @click="handleUnBindUserId(scope.row)"
               >解绑医生</el-button>
               >解绑医生</el-button>
+              <el-button
+                v-if="scope.row.unionId"
+                size="mini"
+                type="text"
+                icon="el-icon-edit"
+                @click="unBind(scope.row)"
+                v-hasPermi="['company:user:unBind']"
+              >解绑登录的微信</el-button>
               <el-button
               <el-button
                 v-if="scope.row.qwStatus == 0"
                 v-if="scope.row.qwStatus == 0"
                 size="mini"
                 size="mini"
@@ -935,7 +943,8 @@ import {
   isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles,
   isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles,
   queryFsUserByPhone,
   queryFsUserByPhone,
   batchBindCompanyUserId,
   batchBindCompanyUserId,
-  getBoundUsers
+  getBoundUsers,
+  unBind
 } from "@/api/company/companyUser";
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
 import { treeselect } from "@/api/company/companyDept";
@@ -2099,6 +2108,26 @@ export default {
         this.getList();
         this.getList();
       })
       })
     },
     },
+
+    unBind(row){
+      this.$confirm(
+          '确定要解绑吗?解绑后登录需要重新扫码绑定。',
+          '提示',
+          {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+          }
+      ).then(() => {
+          unBind(row.userId).then(response => {
+              if (response.code === 200) {
+                  this.msgSuccess("解绑成功");
+              }
+          });
+      }).catch(() => {
+          this.msgInfo("已取消操作");
+      });
+    },
     /** 绑定用户按钮操作 */
     /** 绑定用户按钮操作 */
     handleBindUser(row) {
     handleBindUser(row) {
       this.bindUserForm.companyUserId = row.userId;
       this.bindUserForm.companyUserId = row.userId;

+ 4 - 4
src/views/qw/sopTemp/updateSopTemp.vue

@@ -2860,7 +2860,7 @@ export default {
         if (selectedCourse && content.type == 2 && content.courseId != null) {
         if (selectedCourse && content.type == 2 && content.courseId != null) {
           //响应式直接给链接的标题/封面上值
           //响应式直接给链接的标题/封面上值
 
 
-          if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
+          if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9 || content.setting[i].contentType == 28) {
             this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
           }
@@ -3023,7 +3023,7 @@ export default {
         for (let i = 0; i < content.setting.length; i++) {
         for (let i = 0; i < content.setting.length; i++) {
           //响应式直接给链接的标题/封面上值
           //响应式直接给链接的标题/封面上值
           if (selectedCourse && content.type == 2 && content.courseId != null) {
           if (selectedCourse && content.type == 2 && content.courseId != null) {
-            if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
+            if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9 || content.setting[i].contentType == 28) {
               this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
               this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
             }
@@ -3044,7 +3044,7 @@ export default {
           //响应式直接给链接的描述上值
           //响应式直接给链接的描述上值
           if (selectedVideo && content.type == 2 && content.videoId != null) {
           if (selectedVideo && content.type == 2 && content.videoId != null) {
 
 
-            if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
+            if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9 ||  content.setting[i].contentType == 28 ) {
               this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
               this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
 
 
               if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
               if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
@@ -3088,7 +3088,7 @@ export default {
         //如果是链接的才上
         //如果是链接的才上
         if (selectedVideo && content.type == 2 && content.videoId != null) {
         if (selectedVideo && content.type == 2 && content.videoId != null) {
 
 
-          if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
+          if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9 || content.setting[i].contentType == 28) {
             this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
             this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
 
 
             if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
             if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {

+ 86 - 2
src/views/store/components/userDetailsTemp.vue

@@ -19,7 +19,15 @@
           </el-image>
           </el-image>
         </el-descriptions-item>
         </el-descriptions-item>
         <el-descriptions-item label="手机号码" >
         <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>
         <el-descriptions-item label="用户积分" >
         <el-descriptions-item label="用户积分" >
           <span v-if="item!=null">{{item.integral}}</span>
           <span v-if="item!=null">{{item.integral}}</span>
@@ -156,12 +164,31 @@
 
 
 
 
     </el-dialog>
     </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>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { listPatient, getPatient, delPatient, addPatient, updatePatient, exportPatient ,getPatientByUserId} from "@/api/store/patient";
 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 { getListUserCoupon } from "@/api/store/userCoupon";
 import userStorerDetails from "../components/userStorerDetails.vue";
 import userStorerDetails from "../components/userStorerDetails.vue";
 import userPatietDetails from "../components/userPatietDetails.vue";
 import userPatietDetails from "../components/userPatietDetails.vue";
@@ -199,6 +226,22 @@ export default {
       // 积分购相关
       // 积分购相关
       integralPurchaseVisible: false,
       integralPurchaseVisible: false,
       currentUserId: null,
       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: [],
       userCouponList: [],
       queryParams: {
       queryParams: {
@@ -251,6 +294,47 @@ export default {
       this.currentUserId = null;
       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) {
     handleClickX(tab, event) {
       if(tab.name=="10"){
       if(tab.name=="10"){
         this.queryParams.status=null;
         this.queryParams.status=null;