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.
 
 
 

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