Переглянути джерело

Merge branch 'feature_20241129_渠道客诉'

zhujindu 1 рік тому
батько
коміт
0631c9ec71

+ 21 - 1
src/api/complaintDetail.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 
-// 不想写
+// 客诉跟进信息详情接口
 export function getComplaintCustomerClueInfoById(query) {
   return request({
     url: '/mobile/customerClueInfo/getComplaintCustomerClueInfoById',
@@ -8,6 +8,8 @@ export function getComplaintCustomerClueInfoById(query) {
     params: query,
   });
 }
+
+// 新增客诉跟进信息答案接口
 export function insertCustomerClueAnswerKs(data) {
   return request({
     url: '/mobile/customerClueInfo/insertCustomerClueAnswerKs',
@@ -15,3 +17,21 @@ export function insertCustomerClueAnswerKs(data) {
     data,
   });
 }
+
+// 客资分类字典接口
+export function customerClassify(query) {
+  return request({
+    url: '/mobile/customerClueInfo/type/customerClassify',
+    method: 'get',
+    params: query,
+  });
+}
+
+// 客资子类字典接口
+export function customerSubClassify(query) {
+  return request({
+    url: '/mobile/customerClueInfo/type/customerSubClassify',
+    method: 'get',
+    params: query,
+  });
+}

+ 8 - 5
src/views/clew/complaintDetail/complaintLog.vue

@@ -5,11 +5,11 @@
         <div class="label">来电分类:</div>
         <div class="value">
           <!-- 一级分类 -->
-          <span v-if="iten.customerClassifyName">{{ iten.customerClassifyName }}-</span>
+          <span v-if="iten.customerClassifyName">{{ iten.customerClassifyName }}</span>
           <!-- 二级分类 -->
-          <span v-if="iten.customerSubClassifyName">{{ iten.customerSubClassifyName }}-</span>
+          <span v-if="iten.customerSubClassifyName">-{{ iten.customerSubClassifyName }}</span>
           <!-- 三级分类 -->
-          <span v-if="iten.customerThreeClassifyName">{{ iten.customerThreeClassifyName }}</span>
+          <!-- <span v-if="iten.customerThreeClassifyName">-{{ iten.customerThreeClassifyName }}</span> -->
         </div>
       </div>
       <div class="info">
@@ -21,11 +21,11 @@
         <div class="value">{{ iten.feedbackContent }}</div>
       </div>
       <div class="info">
-        <div class="label">来时间:</div>
+        <div class="label">来时间:</div>
         <div class="value">{{ iten.createTime }}</div>
       </div>
       <div class="info">
-        <div class="label">来次数:</div>
+        <div class="label">来次数:</div>
         <div class="value">{{ iten.serialNumber }}</div>
       </div>
     </div>
@@ -78,4 +78,7 @@ export default {
   margin-bottom: 8px;
   padding-bottom: 8px;
 }
+.complaintLog:last-child {
+  border-bottom: none;
+}
 </style>

+ 233 - 8
src/views/clew/complaintDetail/index.vue

@@ -10,6 +10,23 @@
     <div class="lineGrey"></div>
     <!-- 客诉详情 -->
     <infoDetail v-if="infoData" :infoData="infoData" :customerClassify="customerClassifyOption">
+      <van-button
+        type="info"
+        v-if="infoData.customerClueStatus == 0"
+        style="
+          float: right;
+          background: #0057ba;
+          border-color: #0057ba;
+          color: #fff;
+          margin-top: -36px;
+          border-radius: 5px;
+        "
+        size="small"
+        plain
+        class="centerBtn"
+        @click="onstopVisit"
+        >转交其他组织</van-button
+      >
     </infoDetail>
     <!-- 客诉记录 -->
     <complaintLog
@@ -36,6 +53,7 @@
         </van-cell>
       </div>
     </van-cell-group>
+    <p v-if="infoData && infoData.isClose == 1" style="padding: 10px 0"></p>
     <!-- 跟进任务填写 -->
     <div class="assign" v-if="infoData && infoData.isClose != 1">
       <!-- <div class="assign"> -->
@@ -47,7 +65,7 @@
             clickable
             name="picker"
             :value="customerClassifyValue"
-            label="来电分类一"
+            label="来电分类一 :"
             placeholder="点击选择来电分类一"
             @click="showPicker1 = true" />
         </div>
@@ -57,7 +75,7 @@
             clickable
             name="picker"
             :value="customerSubClassifyValue"
-            label="来电分类二"
+            label="来电分类二 :"
             placeholder="点击选择来电分类二"
             @click="showPicker2 = true" />
         </div>
@@ -72,6 +90,37 @@
         </van-button>
       </div>
     </div>
+    <van-dialog v-model="show" title="转发客资" show-cancel-button :before-close="confirm">
+      <p>
+        <van-notice-bar wrapable :scrollable="false" text="一旦转交出去,则无法再查看,请确认!" />
+      </p>
+      <van-row class="serchInput">
+        <van-col span="24">
+          <van-cell
+            class="monthNow selectcell"
+            :title="companyName"
+            is-link
+            arrow-direction="down"
+            @click="regionClick" />
+        </van-col>
+        <van-col span="24">
+          <van-cell
+            class="monthNow selectcell"
+            :title="regionName"
+            is-link
+            @click="SalesRegionClick"
+            arrow-direction="down" />
+        </van-col>
+        <van-col span="24">
+          <van-cell
+            class="monthNow selectcell"
+            :title="deptName"
+            is-link
+            @click="SalesDepartmentClick"
+            arrow-direction="down" />
+        </van-col>
+      </van-row>
+    </van-dialog>
     <!-- 客诉跟进历史 -->
     <van-dialog
       v-model="showView"
@@ -98,6 +147,30 @@
         @confirm="onConfirm2"
         @cancel="showPicker2 = false" />
     </van-popup>
+    <van-popup v-model="RegionShow" capture position="bottom">
+      <van-picker
+        :columns="companyList"
+        show-toolbar
+        value-key="deptName"
+        @cancel="RegionShow = false"
+        @confirm="onregionConfirm" />
+    </van-popup>
+    <van-popup v-model="SalesRegionShow" capture position="bottom">
+      <van-picker
+        :columns="regionList"
+        show-toolbar
+        value-key="deptName"
+        @cancel="SalesRegionShow = false"
+        @confirm="onSalesRegionConfirm" />
+    </van-popup>
+    <van-popup v-model="SalesDepartmentShow" capture position="bottom">
+      <van-picker
+        :columns="deptList"
+        show-toolbar
+        value-key="deptName"
+        @cancel="SalesDepartmentShow = false"
+        @confirm="onSalesDepartmentConfirm" />
+    </van-popup>
   </div>
 </template>
 
@@ -105,6 +178,8 @@
 import {
   getComplaintCustomerClueInfoById,
   insertCustomerClueAnswerKs,
+  customerClassify,
+  customerSubClassify,
 } from '@/api/complaintDetail';
 import infoDetail from './infoDetail.vue';
 import complaintLog from './complaintLog.vue';
@@ -112,6 +187,7 @@ import { mapState } from 'vuex';
 import radioGroup from './radioGroup';
 import followUpHistory from './followUpHistory';
 import { getDictOption } from '@/api/index';
+import { updateCustomerClueDept, getDeptInfo } from '@/api/clew';
 
 export default {
   name: 'complaintDetail',
@@ -145,17 +221,32 @@ export default {
       showPicker2: false,
       customerClassifyOption: [],
       customerSubClassifyOption: [],
+      deptCode: '',
+      regionList: [],
+      deptList: [],
+      companyName: '',
+      companyCode: '',
+      regionName: '',
+      regionCode: '',
+      deptName: '',
+      show: false,
+      RegionShow: false,
+      SalesRegionShow: false,
+      SalesDepartmentShow: false,
+      companyList: [],
+      deptForm: { type: '', parentId: '' },
     };
   },
   watch: {},
   activated() {
     this.id = this.$route.query.id;
     this.postName = localStorage.getItem('postName');
+    this.getDeptInfo();
     this.getComplaintCustomerClueInfoByIdFun();
   },
   methods: {
     async getCustomerClassify() {
-      let option = await getDictOption({}, 'customer_classify');
+      let option = await customerClassify();
       this.customerClassifyOption = option.data || [];
       // 来电分类一
       let item = this.customerClassifyOption.find(
@@ -163,14 +254,16 @@ export default {
       );
       this.customerClassifyValue = item.dictLabel || '';
       this.customerClassify = item.dictValue;
+      this.getCustomerSubClassify(this.customerClassify);
     },
-    async getCustomerSubClassify() {
-      let option = await getDictOption({}, 'customer_sub_classify');
+    async getCustomerSubClassify(parentId) {
+      let option = await customerSubClassify({ parentId: parentId });
       this.customerSubClassifyOption = option.data || [];
       // 来电分类二
       let item = this.customerSubClassifyOption.find(
         (val) => val.dictValue == this.infoData.customerSubClassify
       );
+      item = item || this.customerSubClassifyOption[0];
       this.customerSubClassifyValue = item.dictLabel || '';
       this.customerSubClassify = item.dictValue;
     },
@@ -187,7 +280,18 @@ export default {
             this.taskGather = response.data.customerClue.customerClueItemList;
           }
           this.getCustomerClassify();
-          this.getCustomerSubClassify();
+          // 当前客资归属人不是当前登录人
+          if (this.infoData.sendUserId != localStorage.getItem('userId')) {
+            this.$dialog
+              .confirm({
+                title: '提示',
+                message: '该客诉已经被转移给其他人',
+                showCancelButton: false,
+              })
+              .then(() => {
+                window.location.replace(window.location.origin + '/mobile/clew');
+              });
+          }
         } else {
           this.$toast(res.msg);
         }
@@ -307,12 +411,115 @@ export default {
       this.customerClassifyValue = value.dictLabel;
       this.customerClassify = value.dictValue;
       this.showPicker1 = false;
+      this.getCustomerSubClassify(this.customerClassify);
     },
     onConfirm2(value) {
       this.customerSubClassifyValue = value.dictLabel;
       this.customerSubClassify = value.dictValue;
       this.showPicker2 = false;
     },
+    onstopVisit() {
+      this.deptCode = '';
+      this.regionList = [];
+      this.deptList = [];
+      this.companyName = '请选择公司';
+      this.companyCode = '';
+      this.regionName = '请选择大区';
+      this.regionCode = '';
+      this.deptName = '请选择销售部';
+      this.show = true;
+    },
+    confirm(action, done) {
+      if (action === 'confirm') {
+        if (this.deptCode != '') {
+          updateCustomerClueDept({
+            customerClueInfoId: this.$route.query.id,
+            deptId: this.deptCode,
+          }).then((require) => {
+            if (require.code == 200) {
+              this.$toast.success('转发成功');
+              this.show = false;
+              if (this.$route.query.token != undefined) {
+                window.location.replace(window.location.origin + '/mobile/clew');
+              } else {
+                this.$router.go(-1);
+              }
+              return done(true);
+            } else {
+              this.$toast(res.msg);
+            }
+          });
+        } else {
+          this.$toast('请选择要转发销售部');
+          return done(false);
+        }
+      } else {
+        return done(true);
+        this.show = false;
+      }
+    },
+    onregionConfirm(val) {
+      this.RegionShow = false;
+      this.companyName = val.deptName;
+      this.companyCode = val.deptId;
+      this.regionName = '请选择大区';
+      this.regionCode = '';
+      this.deptName = '请选择销售部';
+      this.deptCode = '';
+      this.getDeptInfo('dept', 1);
+    },
+    onSalesRegionConfirm(val) {
+      this.SalesRegionShow = false;
+      this.regionName = val.deptName;
+      this.regionCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('dept', 2);
+      }
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+    },
+    onSalesDepartmentConfirm(val) {
+      this.SalesDepartmentShow = false;
+      this.deptName = val.deptName;
+      if (val.deptId != '') {
+        this.deptCode = val.deptId;
+        this.getDeptInfo('user');
+      }
+      this.userName = '全部业务员';
+      this.userCode = '';
+    },
+    getDeptInfo(type, grade) {
+      this.deptForm.type = type;
+      if (grade == '1') {
+        this.deptForm.parentId = this.companyCode;
+      } else if (grade == '2') {
+        this.deptForm.parentId = this.regionCode;
+      } else {
+        this.deptForm.type = '';
+        this.deptForm.parentId = '';
+      }
+      getDeptInfo(this.deptForm).then((res) => {
+        res.data.forEach((item) => {
+          delete item.children;
+        });
+        if (grade == '1') {
+          this.regionList = res.data;
+        } else if (grade == '2') {
+          this.deptList = res.data;
+        } else {
+          this.companyList = res.data;
+        }
+      });
+    },
+    regionClick() {
+      this.RegionShow = true;
+    },
+    SalesRegionClick(val) {
+      this.SalesRegionShow = true;
+    },
+    SalesDepartmentClick() {
+      this.SalesDepartmentShow = true;
+    },
     onClickLeft() {
       this.$router.go(-1);
     },
@@ -333,6 +540,7 @@ export default {
   }
   .taskGather {
     padding-left: 20px;
+    padding-bottom: 20px;
     .title {
       font-size: 15px;
       font-weight: 600;
@@ -370,8 +578,25 @@ export default {
     }
   }
   .van-cell {
-    font-size: 15px;
-    color: #000;
+    font-size: 15px !important;
+    .van-cell__title {
+      color: #000 !important;
+    }
+  }
+  .complaintType {
+    .typeItem {
+      .van-cell__title {
+        padding: 3px;
+      }
+      .van-field__value {
+        padding: 3px;
+        padding-left: 5px;
+        border: 1px solid #ccc;
+        .van-field__control {
+          color: #626262;
+        }
+      }
+    }
   }
 }
 </style>

+ 11 - 6
src/views/clew/index.vue

@@ -2,14 +2,14 @@
   <div class="bgcolor clew">
     <div class="navBarTOP">
       <van-nav-bar class="navBar" title="客资任务" left-arrow @click-left="onClickLeft">
-        <template #right>
+        <!-- <template #right>
           <van-dropdown-menu>
             <van-dropdown-item
               v-model="cid"
               :options="customerClueOption"
               @change="dropdownChange" />
           </van-dropdown-menu>
-        </template>
+        </template> -->
       </van-nav-bar>
       <van-tabs v-model="isHandle" color="#0057ba" @change="tabChange">
         <van-tab title="未跟进" name="-1" :disabled="disabled"></van-tab>
@@ -82,9 +82,10 @@ export default {
   },
   watch: {
     $route(to, from) {
-      // if (to.path == '/clew' && from.path == '/My/index') {
-      //   this.approveList();
-      // }
+      if (to.path == '/clew' && from.path == '/My/index') {
+        this.isHandle = '-1';
+        this.cid = -1;
+      }
       // if (to.path == '/clew' && from.path == '/clewent') {
       //   this.pageNum = 1;
       //   this.approveList();
@@ -248,7 +249,10 @@ export default {
     margin-top: 3px;
     .van-dropdown-menu {
       height: 100%;
-      border: 1px solid #f4f0f0;
+      /* border: 1px solid #f4f0f0; */
+      .van-dropdown-menu__bar {
+        box-shadow: none !important;
+      }
     }
   }
   .van-dropdown-menu__bar {
@@ -257,6 +261,7 @@ export default {
   }
   .van-dropdown-menu__title::after {
     right: 0 !important;
+    border-color: transparent transparent #000000 #000000 !important;
   }
 }
 </style>