xiuli.gao 2 years ago
parent
commit
f1df4d9149

+ 2 - 2
project/src/assets/config/config.js

@@ -17,7 +17,7 @@ axios.interceptors.request.use(
17 17
         admin_id: getCookie("admin_id"),
18 18
         ttl: Number(getCookie("ttl")),
19 19
         sign: getCookie("sign"),
20
-        corpid: store.state && store.state.defaultCorp && store.state.defaultCorp.corpid
20
+        corpid: JSON.parse(getLocal('defaultCorp')).corpid
21 21
       }
22 22
     } else {
23 23
       config.params = {
@@ -25,7 +25,7 @@ axios.interceptors.request.use(
25 25
         admin_id: getCookie("admin_id"),
26 26
         ttl: Number(getCookie("ttl")),
27 27
         sign: getCookie("sign"),
28
-        corpid: store.state && store.state.defaultCorp && store.state.defaultCorp.corpid
28
+        corpid: JSON.parse(getLocal('defaultCorp')).corpid
29 29
       }
30 30
     }
31 31
     // }

BIN
project/src/assets/img/lianjie.png


BIN
project/src/assets/img/self_head.png


BIN
project/src/assets/img/tupian.png


BIN
project/src/assets/img/xiaochengxu.png


+ 13 - 20
project/src/components/Index/header.vue

@@ -9,12 +9,12 @@
9 9
         <div class="enterpriseBox">
10 10
           <div class="enterprise-self">
11 11
             <!-- <img :src="enterprise.corp_square_logo_url" alt=""> -->
12
-            <span>{{enterprise.corp_full_name}}</span>
12
+            <span>{{enterprise.corp_full_name?enterprise.corp_full_name:enterprise.corp_name}}</span>
13 13
           </div>
14 14
           <i :class="['el-icon-caret-bottom',reversalAnimationFlag?'reversalAnimation':'']"></i>
15 15
         </div>
16
-        <el-select class="enterpriseElSelect" v-model="enterprise.corpid" size="small" placeholder="请选择" @visible-change="(val)=>{reversalAnimationFlag = val}">
17
-          <el-option v-for="item in enterpriseList" :key="item.corpid" :label="item.corp_full_name" :value="item.corpid">
16
+        <el-select class="enterpriseElSelect" v-model="enterprise.corpid" size="small" placeholder="请选择" @visible-change="(val)=>{reversalAnimationFlag = val}" @change="corpidChange">
17
+          <el-option v-for="(item,index) in enterpriseList" :key="index+'enterpriseList'" :label="item.corp_full_name?item.corp_full_name:item.corp_name" :value="item.corpid">
18 18
           </el-option>
19 19
         </el-select>
20 20
       </div>
@@ -68,32 +68,25 @@ export default {
68 68
       passwordFlag: false,
69 69
       password: '',
70 70
       re_password: '',
71
-      enterpriseList: [{
72
-        value: '选项1',
73
-        label: '黄金糕'
74
-      }, {
75
-        value: '选项2',
76
-        label: '双皮奶'
77
-      }, {
78
-        value: '选项3',
79
-        label: '蚵仔煎'
80
-      }, {
81
-        value: '选项4',
82
-        label: '龙须面'
83
-      }, {
84
-        value: '选项5',
85
-        label: '北京烤鸭'
86
-      }],
71
+      enterpriseList: [],
87 72
       enterprise: '',
88 73
       reversalAnimationFlag: false
89 74
     }
90 75
   },
91 76
   created () {
92 77
     this.enterpriseList = this.$store.state.authorize_corpList;
93
-    this.enterprise = this.$store.state.defaultCorp;
78
+    this.enterprise = JSON.parse(this.$localSelfStore.getLocal('defaultCorp'));
94 79
     this.userInfo = JSON.parse(this.$localSelfStore.getLocal('userInfo'))
95 80
   },
96 81
   methods: {
82
+    corpidChange (val) {
83
+      let arr = this.enterpriseList.filter((v) => {
84
+        return v.corpid == val
85
+      })[0];
86
+      this.enterprise = JSON.parse(JSON.stringify(arr))
87
+      this.$localSelfStore.setLocal('defaultCorp', JSON.stringify(this.enterprise));
88
+      this.reload()
89
+    },
97 90
     passwordEdit () {//修改密码
98 91
       if (!this.password || this.password == '') {
99 92
         this.$message({

+ 10 - 10
project/src/components/assembly/editCon.vue

@@ -30,15 +30,15 @@
30 30
             <span>添加附件</span>
31 31
           </div>
32 32
           <div class="propoverItem" @click="fileEvent('img')">
33
-            <img src="@/assets/img/logoIndex.png" alt="">
33
+            <img src="@/assets/img/tupian.png" alt="">
34 34
             <span>图片</span>
35 35
           </div>
36 36
           <div class="propoverItem" @click="fileEvent('link')">
37
-            <img src="@/assets/img/logoIndex.png" alt="">
37
+            <img src="@/assets/img/lianjie.png" alt="">
38 38
             <span>链接</span>
39 39
           </div>
40 40
           <div class="propoverItem" @click="fileEvent('miniprogram')">
41
-            <img src="@/assets/img/logoIndex.png" alt="">
41
+            <img src="@/assets/img/xiaochengxu.png" alt="">
42 42
             <span>小程序</span>
43 43
           </div>
44 44
         </el-popover>
@@ -83,12 +83,12 @@
83 83
           <div class="phoneConItemCon" v-if="item.msgtype=='miniprogram'">
84 84
             <div class="phone_miniprogram">
85 85
               <div class="phone_miniprogram_title">
86
-                <img src="@/assets/img/loginBg.png" alt="">
86
+                <img src="@/assets/img/xiaochengxu.png" alt="">
87 87
                 <div class="name">{{item.miniprogram.title}}</div>
88 88
               </div>
89 89
               <img class="phone_miniprogram_img" :src="item.miniprogram.pic_url" alt="">
90 90
               <div class="phone_minirpogram_mark">
91
-                <img src="@/assets/img/loginBg.png" alt="">
91
+                <img src="@/assets/img/xiaochengxu.png" alt="">
92 92
                 <span>小程序</span>
93 93
               </div>
94 94
             </div>
@@ -213,7 +213,7 @@ export default {
213 213
         admin_id: this.$cookie.getCookie('admin_id'),
214 214
         ttl: this.$cookie.getCookie('ttl'),
215 215
         sign: this.$cookie.getCookie('sign'),
216
-        corpid: this.$store.state.defaultCorp.corpid,
216
+        corpid: JSON.parse(this.$localSelfStore.getLocal('defaultCorp')).corpid,
217 217
         type: 1,//素材类型。1图片 2语音 3视频
218 218
         need_media_id: 0,
219 219
       },
@@ -221,7 +221,7 @@ export default {
221 221
         admin_id: this.$cookie.getCookie('admin_id'),
222 222
         ttl: this.$cookie.getCookie('ttl'),
223 223
         sign: this.$cookie.getCookie('sign'),
224
-        corpid: this.$store.state.defaultCorp.corpid,
224
+        corpid: JSON.parse(this.$localSelfStore.getLocal('defaultCorp')).corpid,
225 225
         type: 1,//素材类型。1图片 2语音 3视频
226 226
         need_media_id: 1,//是否需要返回media_id.0否 1是
227 227
       },
@@ -596,8 +596,8 @@ export default {
596 596
             font-size: 12px;
597 597
             color: #777;
598 598
             img {
599
-              width: 10px;
600
-              height: 10px;
599
+              width: 13px;
600
+              height: 13px;
601 601
               margin-right: 4px;
602 602
             }
603 603
           }
@@ -657,7 +657,7 @@ export default {
657 657
     color: #00b38a;
658 658
   }
659 659
   img {
660
-    width: 10px;
660
+    width: 15px;
661 661
     margin: 0 8px;
662 662
   }
663 663
 }

+ 1 - 1
project/src/components/assembly/screen/serviceSingle.vue

@@ -13,7 +13,7 @@
13 13
         <i class="el-icon-circle-close other-icon"></i>
14 14
       </div>
15 15
     </div>
16
-    <el-dialog title="" :visible.sync="visible" :close-on-click-modal="false" width="400px" center top="15vh">
16
+    <el-dialog title="" :visible.sync="visible" :close-on-click-modal="false" width="400px" append-to-body center top="15vh">
17 17
       <div v-loading="loading">
18 18
         <div class="propoverItem">
19 19
           <!-- <self-input :hasLabel="false" width="270px" style="margin-top:0"></self-input> -->

+ 10 - 7
project/src/components/customManage/customerTransfer.vue

@@ -144,8 +144,8 @@
144 144
     </el-drawer>
145 145
 
146 146
     <!-- 分配客户 -->
147
-    <el-dialog title="分配客户" :visible.sync="distributionUserVisible" width="600px" center top="15vh">
148
-      <distribution-user></distribution-user>
147
+    <el-dialog title="分配客户" :visible.sync="distributionUserVisible" width="600px" center>
148
+      <distribution-user :userType='type' @closeToast='distributionUserVisible=false'></distribution-user>
149 149
     </el-dialog>
150 150
   </div>
151 151
 </template>
@@ -204,10 +204,8 @@ export default {
204 204
     }
205 205
   },
206 206
   created () {
207
-    if (localStorage.getItem('transter') && localStorage.getItem('transter') != '') {
208
-      localStorage.getItem('transter') == 'off' ? this.type = 1 : this.type = 2;
209
-      localStorage.setItem('transter', '')
210
-    }
207
+    console.log(localStorage.getItem('transter'));
208
+    localStorage.getItem('transter') == 'off' ? this.type = 1 : this.type = 2;
211 209
     this.init(1)
212 210
   },
213 211
   methods: {
@@ -250,6 +248,11 @@ export default {
250 248
       this.init(1)
251 249
     },
252 250
     changeType (type) {
251
+      if (type == 1) {
252
+        localStorage.setItem('transter', 'off')
253
+      } else {
254
+        localStorage.setItem('transter', 'on')
255
+      }
253 256
       this.type = type;
254 257
       this.multipleSelection = {};
255 258
       this.exclude_multiple_selection = {};
@@ -258,7 +261,7 @@ export default {
258 261
       this.resetEvent()
259 262
     },
260 263
     toDistribution () {//去分配
261
-
264
+      this.distributionUserVisible = true
262 265
     },
263 266
     shieldingUserCancel (type) {
264 267
       if (type == 'update') {

+ 185 - 2
project/src/components/customManage/distributionUser.vue

@@ -4,8 +4,191 @@
4 4
       <i class="el-icon-message-solid"></i>
5 5
       <div>
6 6
         <p>可将选中的客户转接给其他员工,进行后续服务</p>
7
-        <p>注意:90天内客户只能被转移一次,一个客户最多只能被转接两次</p>
7
+        <p v-if="userType==2">注意:90天内客户只能被转移一次,一个客户最多只能被转接两次</p>
8 8
       </div>
9 9
     </div>
10
+    <service-single title='接替员工' style="margin-top:20px;margin-left:-30px" @customerDefine="serviceSingleEvent"></service-single>
11
+    <div class="buttons">
12
+      <el-button type="primary" plain size="mini" @click="$emit('closeToast')">取消</el-button>
13
+      <el-button type="primary" size="mini" @click="defineEvent">确定</el-button>
14
+    </div>
15
+
16
+    <el-dialog title="分配客户" :visible.sync="infoVisible" :close-on-click-modal="false" width="600px" append-to-body center top="15vh">
17
+      <div class="self-hint" style="border:none;">
18
+        <i class="el-icon-message-solid"></i>
19
+        <p>转接后客户将在24小时后成功转接,若客户拒绝,本次转接将不会生效</p>
20
+      </div>
21
+      <div class="userReceive">
22
+        <div class="receiveTop">
23
+          <p>客户将收到以下消息</p>
24
+          <div class="xg" @click="userChangeVisible=true"><i class="el-icon-edit"></i><span>修改</span></div>
25
+        </div>
26
+        <div class="userReceiveInfo">
27
+          <div class="user">
28
+            <div class="phonePeople">
29
+              <i class="el-icon-s-custom"></i>
30
+            </div>
31
+            <div class="con">{{reason}}</div>
32
+          </div>
33
+          <div class="userHint">由于工作变更,<span>{{user_replace_info.name}}@{{enterprise.corp_full_name?enterprise.corp_full_name:enterprise.corp_name}}</span>将在24小时后添加为你的企业微信联系人,接替 高秀丽@几门成都见公司 继续为你提供服务。</div>
34
+          <div class="userHint"><span>暂不添加</span></div>
35
+        </div>
36
+      </div>
37
+      <div class="buttons">
38
+        <el-button type="primary" plain size="mini" @click="userChangeVisible=false">返回</el-button>
39
+        <el-button type="primary" size="mini" @click="userChangeVisible=false;reason=changeReason;">保存</el-button>
40
+      </div>
41
+    </el-dialog>
42
+    <el-dialog title="分配客户" :visible.sync="userChangeVisible" :close-on-click-modal="false" width="600px" append-to-body center top="15vh">
43
+      <div class="self-hint">
44
+        <i class="el-icon-message-solid"></i>
45
+        <span>转接后客户将在24小时后成功转接,若客户拒绝,本次转接将不会生效</span>
46
+      </div>
47
+      <div class="receiveTop" style="margin-top:15px">
48
+        <p>客户将收到以下消息</p>
49
+      </div>
50
+      <textarea class="textarea" autocomplete="off" placeholder="请输入客户收到的消息" v-model="changeReason"></textarea>
51
+      <div class="buttons">
52
+        <el-button type="primary" plain size="mini" @click="userChangeVisible=false">返回</el-button>
53
+        <el-button type="primary" size="mini" @click="userChangeVisible=false;reason=changeReason;">保存</el-button>
54
+      </div>
55
+    </el-dialog>
56
+    <el-dialog title="设置" :visible.sync="setUpVisible" :close-on-click-modal="false" width="600px" append-to-body center top="15vh">
57
+
58
+    </el-dialog>
10 59
   </div>
11
-</template>
60
+</template>
61
+<script>
62
+import serviceSingle from '@/components/assembly/screen/serviceSingle.vue'
63
+export default {
64
+  components: { serviceSingle },
65
+  props: {
66
+    userType: {
67
+      type: Number | String,
68
+    }
69
+  },
70
+  data () {
71
+    return {
72
+      user_replace_info: {},
73
+      userChangeVisible: false,
74
+      reason: '您好,您的服务已升级,后续将由我的同事 高秀丽@几门成都见公司 接替我的工作,继续为您服务。',
75
+      changeReason: '您好,您的服务已升级,后续将由我的同事 高秀丽@几门成都见公司 接替我的工作,继续为您服务。',
76
+      setUpVisible: false,
77
+      infoVisible: false,
78
+      enterprise: {}
79
+    }
80
+  },
81
+  created () {
82
+    this.enterprise = JSON.parse(this.$localSelfStore.getLocal('defaultCorp'));
83
+  },
84
+  methods: {
85
+    serviceSingleEvent (val) {
86
+      if (val && val.user_id) {
87
+        this.user_replace_info = val;
88
+      } else {
89
+        this.user_replace_info = {}
90
+      }
91
+
92
+    },
93
+    defineEvent () {
94
+      if (!this.user_replace_info || !this.user_replace_info.user_id) {
95
+        this.$message({
96
+          message: '请选择接替员工!',
97
+          type: "warning"
98
+        })
99
+        return
100
+      }
101
+      this.infoVisible = true
102
+    },
103
+  }
104
+}
105
+</script>
106
+<style lang="scss" scoped>
107
+.line {
108
+  width: 100%;
109
+  height: 1px;
110
+  background: #f1f1f1;
111
+  margin: 30px 0 30px 0;
112
+}
113
+.receiveTop {
114
+  display: flex;
115
+  align-items: center;
116
+  justify-content: space-between;
117
+  p {
118
+    color: #444444;
119
+    font-size: 13px;
120
+    line-height: 18px;
121
+  }
122
+  .xg {
123
+    display: flex;
124
+    align-items: center;
125
+    color: #00b38a;
126
+    font-size: 13px;
127
+    line-height: 18px;
128
+    font-weight: bold;
129
+    cursor: pointer;
130
+    i {
131
+      margin-right: 7px;
132
+    }
133
+  }
134
+}
135
+.userReceive {
136
+  margin-top: 20px;
137
+
138
+  .userReceiveInfo {
139
+    background: #fafafa;
140
+    padding: 20px;
141
+    margin-top: 10px;
142
+    .user {
143
+      display: flex;
144
+      .phonePeople {
145
+        width: 26px;
146
+        height: 26px;
147
+        background: #00b38a;
148
+        color: #ffffff;
149
+        font-size: 16px;
150
+        display: flex;
151
+        align-items: center;
152
+        justify-content: center;
153
+        border-radius: 2px;
154
+        margin-right: 6px;
155
+        margin-top: 2px;
156
+      }
157
+      .con {
158
+        flex: 1;
159
+        color: #333333;
160
+        font-size: 14px;
161
+        line-height: 20px;
162
+        background: #fefeff;
163
+        padding: 8px 13px;
164
+        border: 1px solid #eeeeee;
165
+        border-radius: 2px;
166
+      }
167
+    }
168
+    .userHint {
169
+      color: #787878;
170
+      font-size: 13px;
171
+      line-height: 18px;
172
+      text-align: center;
173
+      margin-top: 13px;
174
+      span {
175
+        color: #5a6c95;
176
+      }
177
+    }
178
+  }
179
+}
180
+.buttons {
181
+  text-align: right;
182
+  padding: 20px 0 10px;
183
+}
184
+.textarea {
185
+  width: 100%;
186
+  height: 237px;
187
+  margin-top: 10px;
188
+  background: #fafafa !important;
189
+  border: none;
190
+  padding: 15px 10px;
191
+  font-size: 14px;
192
+  color: #333333;
193
+}
194
+</style>

+ 11 - 2
project/src/store.js

@@ -6,7 +6,6 @@ import { setLocal, getLocal, delLocal, delAllLocal } from '@/assets/js/storage.j
6 6
 import { setCookie, getCookie, delCookie, delAllCookie } from '@/assets/js/cookie.js'
7 7
 Vue.use(Vuex);
8 8
 const state = {  //要设置的全局访问的state对象
9
-  defaultCorp: {},//企业信息
10 9
   exportNumber: 500,//导出的数量
11 10
   simpleName: '企微',//平台简称
12 11
   fullName: '企微助手',//平台全称
@@ -35,7 +34,17 @@ const actions = {
35 34
         let data = res.data;
36 35
         if (data && data.errno == 0) {
37 36
           state.authorize_corpList = data.rst.data
38
-          state.defaultCorp = data.rst.data[0]
37
+          let flag = false;
38
+          if (getLocal('defaultCorp') && JSON.parse(getLocal('defaultCorp')) && JSON.parse(getLocal('defaultCorp')).corpid) {
39
+            data.rst.data.forEach((item) => {
40
+              if (item.corpid == JSON.parse(getLocal('defaultCorp')).corpid) {
41
+                flag = true
42
+              }
43
+            });
44
+          }
45
+          if (!flag) {
46
+            setLocal('defaultCorp', JSON.stringify(data.rst.data[0]))
47
+          }
39 48
           resolve(true);
40 49
         } else {
41 50
           resolve(true);