Procházet zdrojové kódy

销售配置获客链接

wangxy před 9 hodinami
rodič
revize
f7ad06f272

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

@@ -350,3 +350,11 @@ export function unbindSaleAndFsUser(data) {
     data
   });
 }
+
+export function updateCustomerAcquisitionLink(data) {
+  return request({
+    url: '/company/user/updateCustomerAcquisitionLink',
+    method: 'post',
+    data: data
+  })
+}

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

@@ -111,6 +111,15 @@
               @click="handleBindCompanyUserCode"
             >生成注册/绑定销售二维码</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              :disabled="single"
+              @click="handleConfigCustomerLink"
+            >配置获客链接</el-button>
+          </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
@@ -219,6 +228,14 @@
                 :type="scope.row.isAllowedAllRegister === 1 ? 'success' : 'info'">{{scope.row.isAllowedAllRegister === 1 ? '是' : '否' }}</el-tag>
             </template>
           </el-table-column>
+          <el-table-column label="获客链接" align="center" prop="customerAcquisitionLink" width="120" :show-overflow-tooltip="true">
+            <template slot-scope="scope">
+              <span v-if="scope.row.customerAcquisitionLink">
+                <el-link type="primary" :href="scope.row.customerAcquisitionLink" target="_blank">{{ scope.row.customerAcquisitionLink }}</el-link>
+              </span>
+              <span v-else>-</span>
+            </template>
+          </el-table-column>
           <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
@@ -728,6 +745,18 @@
 
     <ai-sip-call-user ref="aiSipCallUser" v-show="false" @refreshParentData="getList" />
 
+    <el-dialog title="配置获客链接" :visible.sync="customerLinkOpen" width="500px" append-to-body>
+      <el-form ref="customerLinkForm" :model="customerLinkForm" :rules="customerLinkRules" label-width="100px">
+        <el-form-item label="获客链接" prop="customerAcquisitionLink">
+          <el-input v-model="customerLinkForm.customerAcquisitionLink" placeholder="请输入获客链接" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitCustomerLink">确 定</el-button>
+        <el-button @click="customerLinkOpen = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -751,7 +780,8 @@ import {
   bindDoctorId,
   updateBatchUserRoles,
   getSaleBindUserList,
-  bindSaleAndFsUser
+  bindSaleAndFsUser,
+  updateCustomerAcquisitionLink
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
@@ -980,6 +1010,16 @@ export default {
         roleIds: []
       },
       bindCidServerLoading:false,
+      customerLinkOpen: false,
+      customerLinkForm: {
+        userId: null,
+        customerAcquisitionLink: ''
+      },
+      customerLinkRules: {
+        customerAcquisitionLink: [
+          { required: true, message: '获客链接不能为空', trigger: 'blur' }
+        ]
+      },
     };
   },
   watch: {
@@ -1407,6 +1447,35 @@ export default {
       });
     },
 
+    handleConfigCustomerLink() {
+      const row = this.userList.find(item => this.ids.includes(item.userId));
+      if (!row) {
+        this.$message.warning('请先选择一个用户');
+        return;
+      }
+      this.customerLinkForm = {
+        userId: row.userId,
+        customerAcquisitionLink: row.customerAcquisitionLink || ''
+      };
+      this.customerLinkOpen = true;
+    },
+
+    submitCustomerLink() {
+      this.$refs['customerLinkForm'].validate((valid) => {
+        if (valid) {
+          updateCustomerAcquisitionLink(this.customerLinkForm).then((response) => {
+            if (response.code === 200) {
+              this.msgSuccess('配置获客链接成功');
+              this.customerLinkOpen = false;
+              this.getList();
+            } else {
+              this.$message.error(response.msg || '配置失败');
+            }
+          });
+        }
+      });
+    },
+
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();