AI销管
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

consultant.vue 6.0 KiB

2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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>