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.
 
 
 

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