Prechádzať zdrojové kódy

销售人员绑定主备小程序

wjj 1 týždeň pred
rodič
commit
c49d9a8bd5

+ 9 - 0
src/api/company/companyUser.js

@@ -371,3 +371,12 @@ export function transferCustomer(data) {
     data: data
   })
 }
+
+// 绑定销售主备看课小程序信息
+export function bindCourserAppId(data) {
+  return request({
+    url: '/company/user/bindCourserAppId',
+    method: 'post',
+    data: data
+  })
+}

+ 7 - 0
src/api/course/coursePlaySourceConfig.js

@@ -53,3 +53,10 @@ export function options() {
     method: 'get',
   })
 }
+
+export function allList() {
+  return request({
+    url: '/course/playSourceConfig/allList',
+    method: 'get',
+  })
+}

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

@@ -293,6 +293,13 @@
                 :loading="bindCidServerLoading"
                 @click="handleBindCidServer(scope.row)"
               >绑定cid服务</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-s-platform"
+                plain
+                @click="bindAppId(scope.row)"
+              >绑定看课主备小程序</el-button>
 
               <el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['company:user:edit']">修改</el-button>
               <el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['company:user:remove']">删除</el-button>
@@ -767,6 +774,35 @@
       </div>
     </el-dialog>
     <!-- ======================== 客户转交弹窗结束 ======================== -->
+
+    <el-dialog :title="bindApp.title" v-if="bindApp.open"  :visible.sync="bindApp.open" width="600px"  append-to-body>
+      <el-form ref="bindAppForm" :model="bindAppForm" :rules="bindAppRules" label-width="80px">
+        <el-form-item label="主小程序" prop="mainAppId">
+          <el-select v-model="bindAppForm.mainAppId" placeholder="请选择主小程序" filterable clearable style="width: 280px;">
+            <el-option
+              v-for="item in appIdList"
+              :key="item.dictValue1"
+              :label="item.dictLabel"
+              :value="item.dictValue1"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备小程序" prop="backupAppId">
+          <el-select v-model="bindAppForm.backupAppId" multiple  placeholder="请选择备用小程序" filterable clearable style="width: 280px;">
+            <el-option
+              v-for="item in appIdList"
+              :key="item.dictValue1"
+              :label="item.dictLabel"
+              :value="item.dictValue1"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="bindAppSubmitForm">确 定</el-button>
+        <el-button @click="bindAppCancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -788,7 +824,8 @@ import {
   isAllowedAllRegister,isAllowedEveryoneView, unBindDoctorId, bindDoctorId,updateBatchUserRoles,changeCreateStatus,bindCompanyUserReplyTxt,
   getSaleList,
   getSaleCustomerList,
-  transferCustomer
+  transferCustomer,
+  bindCourserAppId
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
@@ -805,12 +842,28 @@ import selectDoctor from "@/views/qw/user/selectDoctor.vue";
 import Tip from "../../../components/Tip/index.vue";
 import {bindCidServer,unbindCidServer} from "@/api/company/companyAiWorkflowServer";
 import AiSipCallUser from "../../aiSipCall/aiSipCallUser.vue";
+import {allList} from "@/api/course/coursePlaySourceConfig";
 export default {
   name: "User",
   components: {Tip, selectDoctor, Treeselect ,selectUser,AiSipCallUser},
   data() {
     return {
+      bindApp:{
+        open:false,
+        title:"绑定主备小程序"
+      },
+      bindAppForm:{ userId: null, mainAppId: null, backupAppId: null },
+      appIdList:[],
       bindCidServerLoading:false,
+      // 表单校验
+      bindAppRules: {
+        mainAppId: [
+          { required: true, message: "主小程序不能为空", trigger: "change" },
+        ],
+        backupAppId: [
+          { required: true, message: "备小程序不能为空", trigger: "change" },
+        ],
+      },
       doctor: {
         open: false,
         title: '绑定医生'
@@ -1024,6 +1077,9 @@ export default {
     },
   },
   created() {
+    allList().then(response => {
+      this.appIdList = response.data;
+    });
     this.getList();
     this.getTreeselect();
     this.getDicts("sys_normal_disable").then((response) => {
@@ -1053,6 +1109,14 @@ export default {
     }
   },
   methods: {
+
+    bindAppId(row){
+      this.resetBindApp();
+      this.bindAppForm.userId = row.userId;
+      this.bindAppForm.mainAppId = row.mainAppId || null;
+      this.bindAppForm.backupAppId = row.backupAppId ? row.backupAppId.split(",") : [];
+      this.bindApp.open = true;
+    },
     checkBindSipCallUser(row){
 
       this.$refs.aiSipCallUser.handleAddCompanyUserOnSip(row.userName,row.nickName,row.userId);
@@ -1290,6 +1354,10 @@ export default {
       this.open = false;
       this.reset();
     },
+    bindAppCancel() {
+      this.bindApp.open = false;
+      this.resetBindApp();
+    },
     cancelBind() {
       this.bindCompanyOpen = false;
       this.resetBindCompany();
@@ -1343,6 +1411,14 @@ export default {
       };
       this.resetForm("form");
     },
+    resetBindApp(){
+      this.bindAppForm = {
+        userId: null,
+        mainAppId: null,
+        backupAppId: null,
+      };
+      this.resetForm("bindAppForm");
+    },
 
     resetBindCompany() {
       this.formBindCompany = {
@@ -1438,6 +1514,19 @@ export default {
         .catch(() => {
         });
     },
+    bindAppSubmitForm: function() {
+      this.$refs["bindAppForm"].validate((valid) => { 
+        if (valid) {
+          bindCourserAppId(this.bindAppForm).then((response) => {
+            if (response.code === 200) {
+              this.msgSuccess("绑定成功");
+              this.bindApp.open = false;
+              this.getList();
+            }
+          });
+        }
+      });
+    },
     /** 提交按钮 */
     submitForm: function() {
 

+ 1 - 1
src/views/qw/externalContact/collection.vue

@@ -335,7 +335,7 @@ export default {
       })
     },
     getQuestionOptions() {
-      questionOptions().then(response => {
+      questionOptions(1).then(response => {
         this.questionOptions = response.rows;
       })
     },