소스 검색

客服查询

chenrui 1 년 전
부모
커밋
48aa643d30
6개의 변경된 파일105개의 추가작업 그리고 10개의 파일을 삭제
  1. 9 0
      src/api/bizuser.js
  2. 2 1
      src/store/getters.js
  3. 2 1
      src/store/modules/app.js
  4. 9 6
      src/utils/mixin.js
  5. 73 0
      src/views/common/customerService.vue
  6. 10 2
      src/views/salesManagement/salesQueryNew/list.vue

+ 9 - 0
src/api/bizuser.js

@@ -214,3 +214,12 @@ export const querySupplierScope = params => {
     method: 'post'
   })
 }
+
+// 已启用状态下的客户列表
+export const queryUnderlingKf = params => {
+  return axios({
+    url: '/bizuser/queryUnderlingKf',
+    data: params,
+    method: 'post'
+  })
+}

+ 2 - 1
src/store/getters.js

@@ -24,7 +24,8 @@ const getters = {
   priceAuthOptions: state => state.app.priceAuthOptions,
   curActionPermission: state => state.app.curActionPermission,
   isWarehouse: state => state.app.isWarehouse,
-  defWarehouse: state => state.app.defWarehouse
+  defWarehouse: state => state.app.defWarehouse,
+  isShowCustomerSearch: state => state.app.isShowCustomerSearch,
 }
 
 export default getters

+ 2 - 1
src/store/modules/app.js

@@ -47,7 +47,8 @@ const app = {
     warehouseAuthList: null, // 有权限的仓库列表
     warehouseAllList: null, // 无权限所有仓库列表
     defWarehouse: null, // 默认仓库
-    isWarehouse: false// 仓库管理权限
+    isWarehouse: false,// 仓库管理权限
+    isShowCustomerSearch:false //客服查询权限
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {

+ 9 - 6
src/utils/mixin.js

@@ -78,16 +78,19 @@ const AppDeviceEnquire = {
 
 // 所有页
 const commonMixin = {
-  data(){
+  data () {
     return {
       toThousands,
       boldAmounts
     }
   },
-  computed:{
+  computed: {
     isShowWarehouse () {
       return this.$store.state.app.isWarehouse
     },
+    isShowCustomerSearch () {
+      return this.$store.state.app.isShowCustomerSearch
+    },
     defWarehouse () {
       return this.$store.state.app.defWarehouse
     }
@@ -101,16 +104,16 @@ const commonMixin = {
         if (this.spinning !== undefined) {
           this.spinning = a
         }
-        if (this.exportLoading !== undefined){
+        if (this.exportLoading !== undefined) {
           this.exportLoading = a
         }
-        if(this.isInster !== undefined){
+        if (this.isInster !== undefined) {
           this.isInster = a
         }
-        if(this.addMoreLoading != undefined){
+        if (this.addMoreLoading != undefined) {
           this.addMoreLoading = a
         }
-        if(this.confirmLoading != undefined){
+        if (this.confirmLoading != undefined) {
           this.confirmLoading = a
         }
       }

+ 73 - 0
src/views/common/customerService.vue

@@ -0,0 +1,73 @@
+<template>
+  <a-select
+    :size="size"
+    :value="bizUserSnVal"
+    :placeholder="placeholder"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    :dropdownMatchSelectWidth="false"
+    @change="handleChange"
+    allowClear
+    :disabled="disabled"
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in customerData" :key="item.id" :value="item.bizUserSn">
+      {{ item.userName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import { queryUnderlingKf } from '@/api/bizuser'
+export default {
+  props: {
+    value: {
+      type: [String, Array],
+      defatut: ''
+    },
+    size: {
+      type: String,
+      default: 'default'
+    },
+    placeholder: {
+      type: String,
+      default: '请选择客服名称'
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      customerData: [],
+      bizUserSnVal: this.value,
+      fetching: false
+    }
+  },
+  mounted () {
+    this.getListData()
+  },
+  watch: {
+    value (newValue, oldValue) {
+      this.bizUserSnVal = newValue
+    }
+  },
+  methods: {
+    getListData () {
+      queryUnderlingKf({}).then(res => {
+        this.customerData = res.data ? res.data : []
+        this.$store.state.app.isShowCustomerSearch = res.data && res.data.length > 0
+      })
+    },
+    handleChange (value) {
+      this.bizUserSnVal = value
+      this.$emit('change', value)
+      this.$emit('input', value)
+    },
+    resetForm () {
+      this.bizUserSnVal = undefined
+    }
+  }
+}
+</script>

+ 10 - 2
src/views/salesManagement/salesQueryNew/list.vue

@@ -104,6 +104,11 @@
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
+                <a-form-item label="客服">
+                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-item>
+              </a-col>
             </template>
             <a-col :md="8" :sm="24">
               <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
@@ -308,10 +313,11 @@ import { hdExportExcel } from '@/libs/exportExcel'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
 import { salesDetailExport } from '@/api/salesBillReport'
+import customerService from '@/views/common/customerService'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal },
+  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal, customerService },
   data () {
     return {
       spinning: false,
@@ -346,7 +352,8 @@ export default {
         shippingAddrProvinceSn: undefined,
         warehouseSn: undefined,
         promoFlag: undefined,
-        expenseClainFlag: undefined
+        expenseClainFlag: undefined,
+        bizUserSn: undefined
       },
       totalData: {
         totalAmount: 0,
@@ -676,6 +683,7 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.queryParam.promoFlag = undefined
       this.queryParam.expenseClainFlag = undefined
+      this.queryParam.bizUserSn = undefined
       if (this.advanced) {
         this.$refs.subarea.clearData()
       }