Browse Source

直播权限优化

三七 14 hours ago
parent
commit
ce50007df4

+ 9 - 0
src/api/course/courseWatchLog.js

@@ -154,6 +154,15 @@ export function getCustomerListLikeName(params) {
     params: params
   })
 }
+
+// 根据名称模糊查询客服成员列表(app_customer_role_member)
+export function getCustomerMemberListLikeName(params) {
+  return request({
+    url: '/course/appCourseWatchLog/getCustomerMemberListLikeName',
+    method: 'get',
+    params: params
+  })
+}
 // 查询短链课程看课记录列表app看课
 export function listAppCourseWatchLog(query) {
   return request({

+ 4 - 2
src/views/course/courseWatchLog/indexApp.vue

@@ -29,6 +29,8 @@
             :key="item.value"
             :label="item.label"
             :value="item.value">
+            <span>{{ item.isDelete === 1 ? String(item.label).replace(/-已删除$/, '') : item.label }}</span>
+            <span v-if="item.isDelete === 1" style="float: right; color: #F56C6C; font-size: 12px;">已删除</span>
           </el-option>
         </el-select>
       </el-form-item>
@@ -285,7 +287,7 @@
 </template>
 
 <script>
-import { listAppCourseWatchLog, exportAppCourseWatchLog, getCustomerListLikeName, batchUpdateFriendRemark } from "@/api/course/courseWatchLog";
+import { listAppCourseWatchLog, exportAppCourseWatchLog, getCustomerMemberListLikeName, batchUpdateFriendRemark } from "@/api/course/courseWatchLog";
 import { courseList,videoList } from '../../../api/course/courseRedPacketLog'
 import {getTask} from "@/api/common";
 import { listTagGroupForUserBindTag } from "@/api/app/tag/tagGroup";
@@ -799,7 +801,7 @@ export default {
      * 获取员工列表
      */
     getCompanyUserListLikeName() {
-      getCustomerListLikeName(this.companyUserOptionsParams).then(response => {
+      getCustomerMemberListLikeName(this.companyUserOptionsParams).then(response => {
         this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
         this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
         this.companyUserOptionsLoading = false;

+ 2 - 2
src/views/hisStore/storeProduct/index.vue

@@ -277,7 +277,7 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['store:storePayment:export']"
+          v-hasPermi="['store:storeProduct:export']"
         >导出</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -397,7 +397,7 @@
             type="text"
             icon="el-icon-edit"
             @click="showOperLog(scope.row)"
-            v-hasPermi="['store:storeProduct:list']"
+            v-hasPermi="['store:storeProduct:query']"
             v-if="scope.row.isAudit===1"
           >审核记录</el-button>
           <el-button

+ 5 - 5
src/views/hisStore/storeProductAudit/index.vue

@@ -91,7 +91,7 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['store:storePayment:export']"
+          v-hasPermi="['store:storeProductAudit:export']"
         >导出</el-button>
       </el-col>
 
@@ -196,8 +196,8 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="handleBatchUpdate(1)">审核通过</el-button>
-        <el-button type="primary" @click="handleBatchUpdate(2)">审核退回</el-button>
+        <el-button type="primary" @click="handleBatchUpdate(1)" v-hasPermi="['store:storeProductAudit:edit']">审核通过</el-button>
+        <el-button type="primary" @click="handleBatchUpdate(2)" v-hasPermi="['store:storeProductAudit:edit']">审核退回</el-button>
         <el-button @click="cancel1">取 消</el-button>
       </div>
     </el-dialog>
@@ -720,8 +720,8 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="handleUpdate1(1)">审核通过</el-button>
-        <el-button type="primary" @click="handleUpdate1(2)">审核退回</el-button>
+        <el-button type="primary" @click="handleUpdate1(1)" v-hasPermi="['store:storeProductAudit:edit']">审核通过</el-button>
+        <el-button type="primary" @click="handleUpdate1(2)" v-hasPermi="['store:storeProductAudit:edit']">审核退回</el-button>
       </div>
     </el-dialog>
     <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>

+ 65 - 5
src/views/live/liveWatchUser/index.vue

@@ -62,6 +62,7 @@
           clearable
           size="small"
           style="width: 200px"
+          @change="handleCompanyChange"
         >
           <el-option
             v-for="item in companyList"
@@ -71,14 +72,27 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="销售ID" prop="companyUserId">
-        <el-input
+      <el-form-item label="销售名称" prop="companyUserId">
+        <el-select
           v-model="queryParams.companyUserId"
-          placeholder="请输入销售用户ID"
           clearable
+          filterable
+          remote
+          placeholder="请输入销售名称"
+          :remote-method="loadCompanyUserOptions"
+          v-select-load-more="loadMoreCompanyUserOptions"
+          :loading="companyUserOptionsLoading"
+          @visible-change="handleCompanyUserDropdownVisible"
           size="small"
-          @keyup.enter.native="handleQuery"
-        />
+          style="width: 220px"
+        >
+          <el-option
+            v-for="item in companyUserOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue">
+          </el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="观看时间" prop="dateRange">
         <el-date-picker
@@ -382,6 +396,7 @@
 <script>
 import { liveWatchUserList } from '@/api/live/liveWatchUser'
 import { getCompanyList } from '@/api/company/company'
+import { getCompanyUserListLikeName } from '@/api/company/companyUser'
 import { listLiveRedPacketLog } from '@/api/live/liveRedPacketLog'
 import { listCourseCouponUserListVO } from '@/api/his/courseCouponUser'
 import { listTagGroupForUserBindTag } from '@/api/app/tag/tagGroup'
@@ -403,6 +418,15 @@ export default {
       liveOptions: [],
       liveRewardTypeList: [],
       dateRange: [],
+      companyUserOptionsLoading: false,
+      companyUserOptions: [],
+      companyUserOptionsParams: {
+        name: undefined,
+        companyId: undefined,
+        hasNextPage: false,
+        pageNum: 1,
+        pageSize: 10
+      },
       queryParams: {
         pageNum: 1,
         pageSize: 10,
@@ -730,6 +754,41 @@ export default {
         this.companyList = res.data || []
       })
     },
+    handleCompanyChange() {
+      this.queryParams.companyUserId = null
+      this.companyUserOptions = []
+      this.companyUserOptionsParams.pageNum = 1
+      this.companyUserOptionsParams.hasNextPage = false
+    },
+    loadCompanyUserOptions(query) {
+      this.companyUserOptions = []
+      this.companyUserOptionsParams.pageNum = 1
+      this.companyUserOptionsParams.name = query
+      this.companyUserOptionsLoading = true
+      this.getCompanyUserListLikeName()
+    },
+    getCompanyUserListLikeName() {
+      this.companyUserOptionsParams.companyId = this.queryParams.companyId || undefined
+      getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
+        const page = (response && response.data) || {}
+        this.companyUserOptions = [...this.companyUserOptions, ...(page.list || [])]
+        this.companyUserOptionsParams.hasNextPage = !!page.hasNextPage
+      }).finally(() => {
+        this.companyUserOptionsLoading = false
+      })
+    },
+    loadMoreCompanyUserOptions() {
+      if (!this.companyUserOptionsParams.hasNextPage) {
+        return
+      }
+      this.companyUserOptionsParams.pageNum += 1
+      this.getCompanyUserListLikeName()
+    },
+    handleCompanyUserDropdownVisible(visible) {
+      if (visible && this.companyUserOptions.length === 0) {
+        this.loadCompanyUserOptions('')
+      }
+    },
     loadLiveGroupTypeList() {
       getLiveGroupTypeList({ pageNum: 1, pageSize: 999 }).then(res => {
         this.liveGroupTypeList = res.rows || res.data || []
@@ -791,6 +850,7 @@ export default {
       this.queryParams.pageSize = 10
       this.queryParams.liveGroupType = null
       this.queryParams.liveId = null
+      this.companyUserOptions = []
       this.loadLiveOptions()
       this.handleQuery()
     },