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.
 
 
 
 

272 lines
6.0 KiB

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