Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

ct 5 hari lalu
induk
melakukan
06de17a0ce

+ 16 - 0
src/api/company/companyConfig.js

@@ -35,4 +35,20 @@ export function configUserCheck(data) {
   })
 }
 
+export function getCompanyMiniAppList() {
+  return request({
+    url: '/company/companyConfig/getCompanyMiniAppList',
+    method: 'get'
+  })
+}
+
+export function saveCompanyMiniApp(data) {
+  return request({
+    url: '/company/companyConfig/saveCompanyMiniApp',
+    method: 'post',
+    data: data
+  })
+}
+
+
 

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

@@ -334,3 +334,29 @@ export function updateBatchUserRoles(data) {
     data: data
   })
 }
+
+// 根据手机号码查询fs_user(完全匹配)
+export function queryFsUserByPhone(phone) {
+  return request({
+    url: '/company/user/fsUser/queryByPhone',
+    method: 'get',
+    params: { phone: phone }
+  })
+}
+
+// 批量绑定用户到员工
+export function batchBindCompanyUserId(data) {
+  return request({
+    url: '/company/user/batchBindCompanyUserId',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询已绑定的用户
+export function getBoundUsers(companyUserId) {
+  return request({
+    url: '/company/user/getBoundUsers/' + companyUserId,
+    method: 'get'
+  })
+}

+ 111 - 0
src/views/company/companyConfig/miniappConfig.vue

@@ -0,0 +1,111 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName">
+      <el-tab-pane label="公司小程序配置" name="companyConfig">
+        <el-form ref="sysConfig" :model="sysConfig" label-width="120px">
+          <el-form-item label="主要小程序" prop="mainMiniAppId">
+            <el-select
+              v-model="queryParams.mainMiniAppId"
+              placeholder="请选择主要小程序"
+              clearable
+              size="small"
+            >
+              <el-option
+                v-for="item in companyMiniAppList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.appid"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="备用小程序" prop="backupMiniAppId">
+            <el-select
+              v-model="queryParams.backupMiniAppId"
+              placeholder="请选择备用小程序"
+              clearable
+              size="small"
+            >
+              <el-option
+                v-for="item in companyMiniAppList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.appid"
+              />
+            </el-select>
+          </el-form-item>
+          <div class="line"></div>
+          <div style="float: right; margin-right: 20px">
+            <el-button type="primary" @click="onSubmit1">提交</el-button>
+          </div>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+import {
+    getCompanyMiniAppList,
+    saveCompanyMiniApp
+} from "@/api/company/companyConfig";
+
+export default {
+  name: "miniappConfig",
+  data() {
+    return {
+     activeName: "companyConfig",
+     queryParams:{
+        mainMiniAppId:null,
+        backupMiniAppId:null
+     },
+     companyMiniAppList:[],
+     sysConfig:{}
+    };
+  },
+  created() {
+    this.initMimiAppList();
+  },
+  mounted() {},
+  methods: {
+    initMimiAppList(){
+        getCompanyMiniAppList().then(res=>{
+        console.log(res.data);
+        this.companyMiniAppList = res.data;
+        let current = res.current;
+        if(!!current){
+            this.queryParams.mainMiniAppId =  current.mainMiniAppId;
+            this.queryParams.backupMiniAppId =  current.backupMiniAppId;
+        }
+        }).catch(res=>{
+          console.log(res);
+        })
+    },
+    //保存配置
+    onSubmit1() {
+        console.log(this.queryParams);
+        saveCompanyMiniApp(this.queryParams).then(res=>{
+            this.msgSuccess("修改成功");
+        }).catch(res=>{
+
+        })
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.tip {
+  color: indianred;
+}
+.line {
+  margin: 10px 0;
+  background-color: gainsboro;
+  height: 1px;
+}
+.el-row {
+  margin-bottom: 0px;
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+</style>
+

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

@@ -245,6 +245,14 @@
                 v-hasPermi="['qw:user:bind']"
               >查或换绑企微</el-button>
 
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-user"
+                plain
+                @click="handleBindUser(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>
               <el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['company:user:resetPwd']">重置密码</el-button>
@@ -618,6 +626,61 @@
       <selectDoctor ref="selectDoctor" @bindCompanyUserDoctorId="bindCompanyUserDoctorId"></selectDoctor>
     </el-dialog>
 
+    <!-- 绑定用户对话框 -->
+    <el-dialog title="绑定用户" :visible.sync="bindUserDialog.open" width="900px" append-to-body @close="resetBindUserForm">
+      <el-form :model="bindUserForm" label-width="100px">
+        <el-form-item label="手机号码">
+          <el-input
+            v-model="bindUserForm.phone"
+            placeholder="请输入手机号码(完全匹配)"
+            clearable
+            style="width: 300px;"
+            @keyup.enter.native="queryFsUserByPhone"
+          >
+            <el-button slot="append" icon="el-icon-search" @click="queryFsUserByPhone">查询</el-button>
+          </el-input>
+        </el-form-item>
+      </el-form>
+
+      <!-- 已绑定用户信息 -->
+      <div v-if="boundUsersList.length > 0" style="margin-bottom: 20px;">
+        <el-divider content-position="left">已绑定用户</el-divider>
+        <el-table :data="boundUsersList" border style="width: 100%">
+          <el-table-column prop="userId" label="用户ID" width="100" align="center"></el-table-column>
+          <el-table-column prop="nickname" label="用户名称" align="center"></el-table-column>
+          <el-table-column prop="phone" label="电话" align="center"></el-table-column>
+        </el-table>
+      </div>
+
+      <!-- 查询结果 -->
+      <div v-if="fsUserList.length > 0">
+        <el-divider content-position="left">查询结果(可多选)</el-divider>
+        <el-table
+          :data="fsUserList"
+          border
+          v-loading="bindUserLoading"
+          @selection-change="handleFsUserSelectionChange"
+          style="width: 100%"
+        >
+          <el-table-column type="selection" width="55" align="center"></el-table-column>
+          <el-table-column prop="userId" label="用户ID" width="100" align="center"></el-table-column>
+          <el-table-column prop="nickname" label="用户名称" align="center"></el-table-column>
+          <el-table-column prop="phone" label="电话" align="center"></el-table-column>
+        </el-table>
+      </div>
+      <div v-else-if="bindUserForm.phone && !bindUserLoading" style="text-align: center; padding: 20px; color: #909399;">
+        暂无查询结果
+      </div>
+      <div v-if="bindUserLoading" style="text-align: center; padding: 20px;">
+        <i class="el-icon-loading"></i> 查询中...
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="bindUserDialog.open = false">取 消</el-button>
+        <el-button type="primary" @click="submitBindUser" :disabled="selectedFsUserIds.length === 0">确 定</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -636,7 +699,10 @@ import {
   generateSubDomain,
   setIsRegisterMember,
   updateCompanyUserAreaList,
-  isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles
+  isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles,
+  queryFsUserByPhone,
+  batchBindCompanyUserId,
+  getBoundUsers
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
@@ -847,6 +913,19 @@ export default {
         userIds: [],
         roleIds: []
       },
+      // 绑定用户相关
+      bindUserDialog: {
+        open: false,
+        title: '绑定用户'
+      },
+      bindUserForm: {
+        phone: '',
+        companyUserId: null
+      },
+      fsUserList: [],
+      selectedFsUserIds: [],
+      boundUsersList: [],
+      bindUserLoading: false,
     };
   },
   watch: {
@@ -1609,6 +1688,107 @@ export default {
         this.getList();
       })
     },
+    /** 绑定用户按钮操作 */
+    handleBindUser(row) {
+      this.bindUserForm.companyUserId = row.userId;
+      this.bindUserForm.phone = '';
+      this.fsUserList = [];
+      this.selectedFsUserIds = [];
+      this.boundUsersList = [];
+      this.bindUserDialog.open = true;
+
+      // 查询已绑定的用户
+      this.loadBoundUsers(row.userId);
+    },
+    /** 查询已绑定的用户 */
+    loadBoundUsers(companyUserId) {
+      getBoundUsers(companyUserId).then(response => {
+        if (response.code === 200 && response.data) {
+          this.boundUsersList = Array.isArray(response.data) ? response.data : [response.data];
+        } else {
+          this.boundUsersList = [];
+        }
+      }).catch(() => {
+        this.boundUsersList = [];
+      });
+    },
+    /** 根据手机号码查询fs_user */
+    queryFsUserByPhone() {
+      if (!this.bindUserForm.phone) {
+        this.$message.warning('请输入手机号码');
+        return;
+      }
+
+      // 验证手机号码格式
+      const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
+      if (!phonePattern.test(this.bindUserForm.phone)) {
+        this.$message.error('请输入正确的手机号码');
+        return;
+      }
+
+      this.bindUserLoading = true;
+      queryFsUserByPhone(this.bindUserForm.phone).then(response => {
+        this.bindUserLoading = false;
+        if (response.code === 200) {
+          if (response.data) {
+            // 如果返回的是单个对象,转换为数组
+            this.fsUserList = Array.isArray(response.data) ? response.data : [response.data];
+            if (this.fsUserList.length === 0) {
+              this.$message.info('未找到匹配的用户');
+            }
+          } else {
+            this.fsUserList = [];
+            this.$message.info('未找到匹配的用户');
+          }
+        } else {
+          this.fsUserList = [];
+          this.$message.error(response.msg || '查询失败');
+        }
+      }).catch(error => {
+        this.bindUserLoading = false;
+        this.fsUserList = [];
+        this.$message.error('查询失败');
+      });
+    },
+    /** 处理fs_user选择变化 */
+    handleFsUserSelectionChange(selection) {
+      this.selectedFsUserIds = selection.map(item => item.userId);
+    },
+    /** 提交绑定用户 */
+    submitBindUser() {
+      if (this.selectedFsUserIds.length === 0) {
+        this.$message.warning('请至少选择一个用户');
+        return;
+      }
+
+      const data = {
+        companyUserId: this.bindUserForm.companyUserId,
+        fsUserIds: this.selectedFsUserIds
+      };
+
+      batchBindCompanyUserId(data).then(response => {
+        if (response.code === 200) {
+          this.$message.success('绑定成功');
+          this.bindUserDialog.open = false;
+          this.getList();
+        } else {
+          this.$message.error(response.msg || '绑定失败');
+        }
+      }).catch(error => {
+        this.$message.error('绑定失败');
+      });
+    },
+    /** 重置绑定用户表单 */
+    resetBindUserForm() {
+      this.bindUserForm = {
+        phone: '',
+        companyUserId: null
+      };
+      this.fsUserList = [];
+      this.selectedFsUserIds = [];
+      this.boundUsersList = [];
+      this.bindUserLoading = false;
+    },
   },
 }
 </script>

+ 8 - 3
src/views/fastGpt/fastGptRole/fastGptRole.vue

@@ -51,7 +51,7 @@
             @click="handleBindAi(scope.row)"
           >绑定AI客服</el-button>
 
-          <el-button
+<!--          <el-button
             style="margin-top: 2%"
             v-if="scope.row.corpName!=null"
             size="mini"
@@ -59,7 +59,7 @@
             plain
             icon="el-icon-edit"
             @click="handleRelieveAi(scope.row)"
-          >解绑</el-button>
+          >解绑</el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -120,7 +120,8 @@ export default {
         kfId: null,
         kfUrl: null,
         avatar: null,
-        kfMediaId: null
+        kfMediaId: null,
+        bindCorpId: null,
       },
       // 表单参数
       form: {},
@@ -146,6 +147,7 @@ export default {
     /** 查询应用列表 */
     getList() {
       this.loading = true;
+      this.queryParams.bindCorpId = this.corpId;
       listFastGptRole(this.queryParams).then(response => {
         this.fastGptRoleList = response.rows;
         this.total = response.total;
@@ -226,6 +228,9 @@ export default {
     handleBindAiData(val){
       this.qwUserId=val.id;
       this.corpId=val.corpId;
+      this.queryParams.bindCorpId = val.corpId;
+      // 设置完数据后主动查询
+      this.getList();
     }
   }
 };

+ 12 - 2
src/views/hisStore/storeOrder/index.vue

@@ -91,6 +91,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="产品名称" prop="productName">
+        <el-input
+          v-model="queryParams.productName"
+          placeholder="请输入产品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
 
       <el-form-item label="手机号" prop="userPhone">
         <el-input
@@ -511,7 +520,7 @@
               <el-tag prop="orderMedium" v-for="(item, index) in orderMediumOptions"    v-if="scope.row.orderMedium==item.dictValue">{{item.dictLabel}}</el-tag>
           </template>
       </el-table-column>
-      <el-table-column label="订单产品" align="center" width="200px">
+      <el-table-column label="产品名称" align="center" width="200px">
         <template slot-scope="scope">
           <div v-if="scope.row.items && scope.row.items.length > 0">
             <el-tag
@@ -668,7 +677,7 @@
                     </el-popover>
                   </template>
                 </el-table-column>
-                <el-table-column label="品名称" show-overflow-tooltip align="center" prop="productName" />
+                <el-table-column label="品名称" show-overflow-tooltip align="center" prop="productName" />
                 <el-table-column label="商品规格" align="center" prop="sku" />
                 <el-table-column label="库存" align="center" prop="stock" />
                 <el-table-column label="单价" align="center" prop="price" />
@@ -1230,6 +1239,7 @@ export default {
         isSysDel: null,
         deptId:null,
         isUpload:null,
+        productName:null,
 
       },
       // 表单参数

+ 32 - 0
src/views/live/live/index.vue

@@ -238,6 +238,11 @@
               >
                 <i class="el-icon-service"></i> 复制直播间
               </el-dropdown-item>
+              <el-dropdown-item
+                @click.native="handleLink(scope.row)"
+              >
+                <i class="el-icon-service"></i> 查看小程序链接
+              </el-dropdown-item>
               <el-dropdown-item
                 v-if="scope.row.liveCodeUrl == null"
                 @click.native="handleGenerateCode(scope.row)"
@@ -558,7 +563,34 @@ export default {
       deep: false // startTime 是字符串,无需深度监听
     }
   },
+  computed:{
+    companyUserId() {
+      return this.$store.state.user.user.userId
+    },
+    companyId() {
+      return this.$store.state.user.user.companyId
+    },
+  },
   methods: {
+
+    handleLink(row){
+      if (!row.liveId) {
+        this.$message.error('获取直播间id失败');
+        return
+      }
+      if (!this.companyUserId) {
+        this.$message.error('获取销售id失败');
+        return
+      }
+      if (!this.companyId) {
+        this.$message.error('获取销售公司失败');
+        return
+      }
+      const companyUrl = "/pages_course/living?companyId=" + this.companyId + "&companyUserId=" + this.companyUserId + "&liveId=" + row.liveId
+      this.$alert(companyUrl, '小程序跳转连接', {
+        confirmButtonText: '确定',
+      });
+    },
     beforeAvatarUpload(file) {
       const isLt1M = file.size / 1024 / 1024 < 1;
       if (!isLt1M) {

+ 43 - 9
src/views/live/liveOrder/index.vue

@@ -25,6 +25,35 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="订单号" prop="orderCode">
+        <el-input
+          v-model="queryParams.orderCode"
+          placeholder="请输入订单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="收货人电话" prop="userPhone">
+        <el-input
+          v-model="queryParams.userPhone"
+          placeholder="请输入收货人电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="收货人姓名" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入收货人姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
 
       <el-form-item label="商品规格" prop="productSpec">
         <el-input
@@ -100,11 +129,11 @@
       <el-form-item label="下单时间" prop="orderTimeRange">
         <el-date-picker
           v-model="orderTimeRange"
-          type="daterange"
+          type="datetimerange"
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
+          value-format="yyyy-MM-dd HH:mm:ss"
           size="small"
           @change="handleOrderTimeChange"
         />
@@ -138,13 +167,15 @@
 
     <el-table border v-loading="loading" :data="liveOrderList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="订单号" align="center" prop="orderCode" />
+
       <el-table-column label="销售ID" align="center" prop="companyUserId" >
         <template slot-scope="scope">
           <span v-if="scope.row.companyUserId > 0" >{{ scope.row.companyUserId }}</span>
           <span v-else>-</span>
         </template>
       </el-table-column>
-      <el-table-column label="绑定销售昵称" align="center" prop="companyUserName" />
+      <el-table-column label="绑定销售昵称" align="center" prop="companyUserNickName" />
       <el-table-column label="客户编码" align="center" prop="userId" />
       <el-table-column label="会员等级" align="center" prop="userLevel">
       </el-table-column>
@@ -157,7 +188,8 @@
       <el-table-column label="客户ID" align="center" prop="userId" />
       <el-table-column label="客户昵称" align="center" prop="nickName" />
       <el-table-column label="客户绑定手机号" align="center" prop="userBindPhone" />
-      <el-table-column label="收货手机号" align="center" prop="userPhone" />
+      <el-table-column label="收货人电话" align="center" prop="userPhone" />
+      <el-table-column label="收货人姓名" align="center" prop="userName" />
       <el-table-column label="累计成交笔数" align="center" prop="totalOrderCount" />
       <el-table-column label="累计成交总额" align="center" prop="totalOrderAmount" />
       <el-table-column label="最新绑定时间" align="center" prop="latestBindTime" width="180">
@@ -177,6 +209,7 @@
       <el-table-column label="商品规格" align="center" prop="productSpec" width="120" />
       <el-table-column label="商品数量" align="center" prop="totalNum" />
       <el-table-column label="销售价格" align="center" prop="totalPrice" />
+      <el-table-column label="成交价" align="center" prop="payMoney"/>
 <!--      <el-table-column label="成本价格" align="center" prop="costPrice" />-->
       <el-table-column label="收货地址" align="center" prop="userAddress" width="200" />
       <el-table-column label="对应供应商" align="center" prop="supplierName" width="120" />
@@ -302,10 +335,11 @@ export default {
     this.getList();
     this.getDicts("sys_live_order_status").then(response => {
       this.orderStatusOptions = response.data;
+      this.orderOptions = this.orderStatusOptions;
     });
-    this.getDicts("sys_order_status").then(response => {
-      this.orderOptions = response.data;
-    });
+    // this.getDicts("sys_order_status").then(response => {
+    //   this.orderOptions = response.data;
+    // });
     this.getDicts("sys_user_level").then(response => {
       this.memberLevelOptions = response.data;
     });
@@ -336,8 +370,8 @@ export default {
 // 下单时间范围选择变化处理
     handleOrderTimeChange(value) {
       if (value && value.length === 2) {
-        this.queryParams.createTimeStart = value[0] + ' 00:00:00';
-        this.queryParams.createTimeEnd = value[1] + ' 23:59:59';
+        this.queryParams.createTimeStart = value[0];
+        this.queryParams.createTimeEnd = value[1];
       } else {
         this.queryParams.createTimeStart = null;
         this.queryParams.createTimeEnd = null;

+ 1 - 1
src/views/live/liveOrder/liveOrderDetails.vue

@@ -6,7 +6,7 @@
     <div class="contentx" v-if="item!=null">
       <div class="desct"></div>
       <div class="order-status" v-if="item!=null" >
-        <el-steps  :active="item.status==4?item.status:item.status" align-center finish-status="success">
+        <el-steps  :active="item.status==3?item.status+1:item.status" align-center>
           <el-step title="待支付"></el-step>
           <el-step title="待发货"></el-step>
           <el-step title="待收货"></el-step>