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.
 
 
 

258 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. replaceReception:this.replaceReception
  136. }).then(res => {
  137. uni.showToast({
  138. icon: "none",
  139. title: "分配成功"
  140. })
  141. uni.navigateBack();
  142. uni.hideLoading();
  143. });
  144. },
  145. getFreeList() {
  146. this.$u.get("/zkAgentPool/freeList?itemId=" + this.buildingID).then(res => {
  147. if (res.length == 0) {
  148. this.freeList = []
  149. } else {
  150. this.freeList = res;
  151. this.textcdhSKJ = res[0].name
  152. }
  153. })
  154. },
  155. radioChange: function(evt) {
  156. this.chosedAgentId = '';
  157. this.chosedAgentId = evt.detail.value;
  158. },
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .empty {
  164. flex: 1;
  165. display: flex;
  166. flex-direction: column;
  167. justify-content: center;
  168. align-items: center;
  169. .image {
  170. width: 478upx;
  171. height: 478upx;
  172. }
  173. .tips {
  174. font-size: 36upx;
  175. color: #242424;
  176. line-height: 1;
  177. margin-top: 50upx;
  178. }
  179. }
  180. .save {
  181. position: fixed;
  182. width: calc(100vw - 60upx);
  183. bottom: 50upx;
  184. left: 30rpx;
  185. color: #FFFFFF;
  186. font-size: 30upx;
  187. height: 98upx;
  188. border-radius: 8upx;
  189. display: flex;
  190. justify-content: center;
  191. align-items: center;
  192. background: rgba(42, 111, 255, 1);
  193. }
  194. .box {
  195. background: #F8F8F8;
  196. width: 100%;
  197. height: 100%;
  198. font-size: 30rpx;
  199. font-weight: 400;
  200. // line-height: 30px;
  201. .nextcon {
  202. height: 78rpx;
  203. background: #F4F8FD;
  204. color: #2671E2;
  205. text-align: center;
  206. line-height: 78rpx;
  207. }
  208. .content-tips {
  209. display: flex;
  210. justify-content: space-between;
  211. background: #fff;
  212. padding: 0 30rpx;
  213. height: 148rpx;
  214. margin-bottom: 20rpx;
  215. .left {
  216. display: flex;
  217. margin-top: 30rpx;
  218. .img {
  219. width: 72rpx;
  220. height: 72rpx;
  221. background: #FFFFFF;
  222. border: 1px solid #C9C9C9;
  223. line-height: 64rpx;
  224. text-align: center;
  225. border-radius: 50%;
  226. margin-right: 20rpx;
  227. }
  228. .text {
  229. .name {
  230. margin-top: 4rpx;
  231. font-weight: 600;
  232. color: #333333;
  233. line-height: 30rpx;
  234. margin-bottom: 24rpx;
  235. }
  236. }
  237. }
  238. .right {
  239. margin: 54rpx 0;
  240. }
  241. }
  242. }
  243. </style>