Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

199 wiersze
3.8 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.7)"
  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. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. customerId: '',
  46. buildingID: '',
  47. freeList: [],
  48. current: null,
  49. chosedAgentId: '',
  50. textcdhSKJ: ''
  51. }
  52. },
  53. onLoad(option) {
  54. this.customerId = option.id;
  55. },
  56. onShow() {
  57. this.buildingID = uni.getStorageSync('buildingID').id;
  58. this.getFreeList();
  59. },
  60. methods: {
  61. getFreeList() {
  62. this.$u.get("/zkAgentPool/freeList?itemId=" + this.buildingID).then(res => {
  63. if (res.length == 0) {
  64. this.freeList = []
  65. } else {
  66. this.freeList = res;
  67. this.textcdhSKJ = res[0].name
  68. }
  69. })
  70. },
  71. radioChange: function(evt) {
  72. this.chosedAgentId = '';
  73. this.chosedAgentId = evt.detail.value;
  74. },
  75. save() {
  76. console.log(this.chosedAgentId)
  77. if (!this.chosedAgentId) {
  78. uni.showToast({
  79. icon: "none",
  80. title: "未选择指派顾问"
  81. })
  82. return
  83. }
  84. uni.showLoading({
  85. title: "保存中",
  86. mask: true
  87. })
  88. const that = this;
  89. this.$u.post("customer/assign", {
  90. agentId: that.chosedAgentId,
  91. id: that.customerId
  92. }).then(res => {
  93. uni.showToast({
  94. icon: "none",
  95. title: "分配成功"
  96. })
  97. uni.navigateBack();
  98. uni.hideLoading();
  99. });
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .empty {
  106. flex: 1;
  107. display: flex;
  108. flex-direction: column;
  109. justify-content: center;
  110. align-items: center;
  111. .image {
  112. width: 478upx;
  113. height: 478upx;
  114. }
  115. .tips {
  116. font-size: 36upx;
  117. color: #242424;
  118. line-height: 1;
  119. margin-top: 50upx;
  120. }
  121. }
  122. .save {
  123. position: fixed;
  124. width: calc(100vw - 60upx);
  125. bottom: 50upx;
  126. left: 30rpx;
  127. color: #FFFFFF;
  128. font-size: 30upx;
  129. height: 98upx;
  130. border-radius: 8upx;
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. background: rgba(42, 111, 255, 1);
  135. }
  136. .box {
  137. background: #F8F8F8;
  138. width: 100%;
  139. height: 100%;
  140. font-size: 30rpx;
  141. font-weight: 400;
  142. // line-height: 30px;
  143. .nextcon {
  144. height: 78rpx;
  145. background: #F4F8FD;
  146. color: #2671E2;
  147. text-align: center;
  148. line-height: 78rpx;
  149. }
  150. .content-tips {
  151. display: flex;
  152. justify-content: space-between;
  153. background: #fff;
  154. padding: 0 30rpx;
  155. height: 148rpx;
  156. margin-bottom: 20rpx;
  157. .left {
  158. display: flex;
  159. margin-top: 30rpx;
  160. .img {
  161. width: 72rpx;
  162. height: 72rpx;
  163. background: #FFFFFF;
  164. border: 1px solid #C9C9C9;
  165. line-height: 64rpx;
  166. text-align: center;
  167. border-radius: 50%;
  168. margin-right: 20rpx;
  169. }
  170. .text {
  171. .name {
  172. margin-top: 4rpx;
  173. font-weight: 600;
  174. color: #333333;
  175. line-height: 30rpx;
  176. margin-bottom: 24rpx;
  177. }
  178. }
  179. }
  180. .right {
  181. margin: 54rpx 0;
  182. }
  183. }
  184. }
  185. </style>