AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

consultant.vue 5.7 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="box">
  3. <!-- 顾问选择 -->
  4. <view class="nextcon">
  5. 下一位接待顾问:{{textcdhSKJ}}
  6. </view>
  7. <view class="content" style="padding-bottom: 200rpx;">
  8. <radio-group @change="radioChange">
  9. <view v-for="(item,index) in freeList" :key="index" class="content-tips">
  10. <view class="left">
  11. <view class="img">
  12. {{item.name.slice(0,1)}}
  13. </view>
  14. <view class="text">
  15. <view class="name">
  16. {{item.name}}
  17. </view>
  18. <view class="num">
  19. 今日接待: {{item.todayNum}}
  20. </view>
  21. </view>
  22. </view>
  23. <view class="right">
  24. <radio :value="item.agentId" :checked="index == current" style="transform:scale(0.9)"
  25. color="#2671E2"></radio>
  26. </view>
  27. </view>
  28. </radio-group>
  29. </view>
  30. <view class="empty" v-if="freeList.length == 0">
  31. <image class="image" src="@/static/images/customerEmpty.png" mode=""></image>
  32. <view class="tips">
  33. 暂无空闲顾问
  34. </view>
  35. </view>
  36. <view class="save" @click="save" :class="{active:chosedAgentId}">
  37. 保存
  38. </view>
  39. <u-modal v-model="show" :mask-close-able="true" :title="'代接待提醒'" :confirm-text="confirmtext" :cancel-text='canceltext' @cancel="confirmA" @confirm="confirmB" :show-cancel-button='true' :content="content"></u-modal>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. customerId: '',
  47. buildingID: '',
  48. freeList: [],
  49. current: null,
  50. chosedAgentId: '',
  51. textcdhSKJ: '',
  52. show:false,
  53. content: '东临碣石,以观沧海',
  54. confirmtext:'1',//确认文字
  55. canceltext:'2',//取消文字
  56. daitiReceptionobj:{},
  57. replaceReception:0
  58. }
  59. },
  60. onLoad(option) {
  61. this.customerId = option.id;
  62. },
  63. onShow() {
  64. this.buildingID = uni.getStorageSync('buildingID').id;
  65. this.getFreeList();
  66. },
  67. methods: {
  68. //取消
  69. confirmA(){
  70. if(this.daitiReceptionobj.assign!=null){
  71. this.baochunfun()
  72. }else{
  73. uni.showToast({
  74. icon: "none",
  75. title: "【"+this.daitiReceptionobj.owner.name+"】正在接待中"
  76. })
  77. return;
  78. }
  79. },
  80. // 确认
  81. confirmB(){
  82. this.replaceReception=1;
  83. this.baochunfun()
  84. },
  85. save() {
  86. console.log(this.chosedAgentId)
  87. if (!this.chosedAgentId) {
  88. uni.showToast({
  89. icon: "none",
  90. title: "未选择指派顾问"
  91. })
  92. return
  93. }
  94. const that = this;
  95. this.$u.post("customer/daitiReception", {
  96. agentId: that.chosedAgentId,
  97. id: that.customerId,
  98. projectId:this.buildingID
  99. }).then(res => {
  100. if(res.unchecked==0){
  101. that.baochunfun()
  102. }else{
  103. if(res.zs==0){
  104. that.baochunfun()
  105. }else{
  106. if(res.assign==null&&res.replacement==null){
  107. that.baochunfun()
  108. }else{
  109. if(res.assign==null){
  110. that.daitiReceptionobj=res;
  111. that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?"
  112. that.confirmtext=res.replacement.name +"代接代",//确认文字
  113. that.canceltext=res.owner.name +'接待',//取消文字
  114. that.show=true;
  115. }else{
  116. that.daitiReceptionobj=res;
  117. that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?"
  118. that.confirmtext=res.replacement.name +"代接代",//确认文字
  119. that.canceltext=res.assign.name +'接待',//取消文字
  120. that.show=true;
  121. }
  122. }
  123. }
  124. }
  125. });
  126. },
  127. baochunfun(){
  128. uni.showLoading({
  129. title: "保存中",
  130. mask: true
  131. })
  132. const that = this;
  133. this.$u.post("customer/assign", {
  134. agentId: that.chosedAgentId,
  135. id: that.customerId,
  136. replaceReception:this.replaceReception
  137. }).then(res => {
  138. uni.showToast({
  139. icon: "none",
  140. title: "分配成功"
  141. })
  142. uni.navigateBack();
  143. uni.hideLoading();
  144. });
  145. },
  146. getFreeList() {
  147. this.$u.get("/zkAgentPool/freeList?itemId=" + this.buildingID).then(res => {
  148. if (res.length == 0) {
  149. this.freeList = []
  150. } else {
  151. this.freeList = res;
  152. this.textcdhSKJ = res[0].name
  153. }
  154. })
  155. },
  156. radioChange: function(evt) {
  157. this.chosedAgentId = '';
  158. this.chosedAgentId = evt.detail.value;
  159. },
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .empty {
  165. flex: 1;
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: center;
  169. align-items: center;
  170. .image {
  171. width: 478upx;
  172. height: 478upx;
  173. }
  174. .tips {
  175. font-size: 36upx;
  176. color: #242424;
  177. line-height: 1;
  178. margin-top: 50upx;
  179. }
  180. }
  181. .save {
  182. position: fixed;
  183. width: calc(100vw - 60upx);
  184. bottom: 50upx;
  185. left: 30rpx;
  186. color: #FFFFFF;
  187. font-size: 30upx;
  188. height: 98upx;
  189. border-radius: 8upx;
  190. display: flex;
  191. justify-content: center;
  192. align-items: center;
  193. background: rgba(42, 111, 255, 1);
  194. }
  195. .box {
  196. background: #F8F8F8;
  197. width: 100%;
  198. height: 100%;
  199. font-size: 30rpx;
  200. font-weight: 400;
  201. // line-height: 30px;
  202. .nextcon {
  203. height: 78rpx;
  204. background: #F4F8FD;
  205. color: #2671E2;
  206. text-align: center;
  207. line-height: 78rpx;
  208. }
  209. .content-tips {
  210. display: flex;
  211. justify-content: space-between;
  212. background: #fff;
  213. padding: 0 30rpx;
  214. height: 148rpx;
  215. margin-bottom: 20rpx;
  216. .left {
  217. display: flex;
  218. margin-top: 30rpx;
  219. .img {
  220. width: 72rpx;
  221. height: 72rpx;
  222. background: #FFFFFF;
  223. border: 1px solid #C9C9C9;
  224. line-height: 64rpx;
  225. text-align: center;
  226. border-radius: 50%;
  227. margin-right: 20rpx;
  228. }
  229. .text {
  230. .name {
  231. margin-top: 4rpx;
  232. font-weight: 600;
  233. color: #333333;
  234. line-height: 30rpx;
  235. margin-bottom: 24rpx;
  236. }
  237. }
  238. }
  239. .right {
  240. margin: 54rpx 0;
  241. }
  242. }
  243. }
  244. </style>