Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

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