Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

314 строки
6.9 KiB

  1. <template>
  2. <view class="box">
  3. <!-- 顾问选择 -->
  4. <view class="nextcon">
  5. 下一位接待顾问:{{textcdhSKJ}}
  6. </view>
  7. <!-- 搜索筛选顾问 -->
  8. <view class="search-tag">
  9. <u-search v-model="keywords" @search="searchFunc" bgColor="#F8F8F8" shape="round" placeholder="顾问名称"
  10. :showAction="false" :clearabled="true"></u-search>
  11. <view class="tabs-box" v-if="list.length > 0">
  12. <u-tabs :list="list" :current="listCurrent" name="deptName" @change="change"></u-tabs>
  13. </view>
  14. </view>
  15. <view class="content">
  16. <radio-group @change="radioChange">
  17. <view v-for="(item,index) in freeList" :key="index" class="content-tips">
  18. <view class="left">
  19. <view class="img">
  20. {{item.name.slice(0,1)}}
  21. </view>
  22. <view class="text">
  23. <view class="name">
  24. {{item.name}}
  25. </view>
  26. <view class="num">
  27. 今日接待: {{item.todayNum}}
  28. </view>
  29. </view>
  30. </view>
  31. <view class="right">
  32. <radio :value="item.agentId" :checked="index == current" style="transform:scale(0.9)"
  33. color="#2671E2"></radio>
  34. </view>
  35. </view>
  36. </radio-group>
  37. <view class="empty" v-if="freeList.length == 0">
  38. <image class="image" src="@/static/images/customerEmpty.png" mode=""></image>
  39. <view class="tips">
  40. 暂无空闲顾问
  41. </view>
  42. </view>
  43. </view>
  44. <view v-if="freeList.length > 0" class="save" @click="save" :class="{active:chosedAgentId}">
  45. 保存
  46. </view>
  47. <u-modal v-model="show" :mask-close-able="true" :title="'代接待提醒'" :confirm-text="confirmtext"
  48. :cancel-text='canceltext' @cancel="confirmA" @confirm="confirmB" :show-cancel-button='true'
  49. :content="content"></u-modal>
  50. <!-- 加载组件 -->
  51. <loading v-model="LOADING"></loading>
  52. </view>
  53. </template>
  54. <script>
  55. import loading from "@/components/loading/index.vue"
  56. export default {
  57. components: {
  58. loading
  59. },
  60. data() {
  61. return {
  62. customerId: '',
  63. buildingID: '',
  64. freeList: [],
  65. current: null,
  66. chosedAgentId: '',
  67. textcdhSKJ: '',
  68. show: false,
  69. content: '东临碣石,以观沧海',
  70. confirmtext: '1', //确认文字
  71. canceltext: '2', //取消文字
  72. daitiReceptionobj: {},
  73. replaceReception: 0,
  74. keywords: '', // 关键词
  75. list: [], // 部门列表
  76. listCurrent: 0, //选中分类下标
  77. deptId: '',
  78. }
  79. },
  80. onLoad(option) {
  81. this.LOADING = true
  82. this.customerId = option.id;
  83. },
  84. onShow() {
  85. this.buildingID = uni.getStorageSync('buildingID').id;
  86. this.getFreeList();
  87. },
  88. methods: {
  89. //取消
  90. confirmA() {
  91. if (this.daitiReceptionobj.assign != null) {
  92. this.baochunfun()
  93. } else {
  94. uni.showToast({
  95. icon: "none",
  96. title: "【" + this.daitiReceptionobj.owner.name + "】正在接待中"
  97. })
  98. return;
  99. }
  100. },
  101. // 确认
  102. confirmB() {
  103. this.replaceReception = 1;
  104. this.baochunfun()
  105. },
  106. save() {
  107. console.log(this.chosedAgentId)
  108. if (!this.chosedAgentId) {
  109. uni.showToast({
  110. icon: "none",
  111. title: "未选择指派顾问"
  112. })
  113. return
  114. }
  115. const that = this;
  116. this.$u.post("customer/daitiReception", {
  117. agentId: that.chosedAgentId,
  118. id: that.customerId
  119. }).then(res => {
  120. if (res.unchecked == 0) {
  121. that.baochunfun()
  122. } else {
  123. if (res.zs == 0) {
  124. that.baochunfun()
  125. } else {
  126. if (res.assign == null && res.replacement == null) {
  127. that.baochunfun()
  128. } else {
  129. if (res.assign == null) {
  130. that.daitiReceptionobj = res;
  131. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  132. "】代接待吗?"
  133. that.confirmtext = res.replacement.name + "代接待", //确认文字
  134. that.canceltext = res.owner.name + '接待', //取消文字
  135. that.show = true;
  136. } else {
  137. that.daitiReceptionobj = res;
  138. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  139. "】代接待吗?"
  140. that.confirmtext = res.replacement.name + "代接待", //确认文字
  141. that.canceltext = res.assign.name + '接待', //取消文字
  142. that.show = true;
  143. }
  144. }
  145. }
  146. }
  147. });
  148. },
  149. baochunfun() {
  150. uni.showLoading({
  151. title: "保存中",
  152. mask: true
  153. })
  154. const that = this;
  155. this.$u.post("customer/assign", {
  156. agentId: that.chosedAgentId,
  157. id: that.customerId,
  158. replaceReception: this.replaceReception
  159. }).then(res => {
  160. uni.showToast({
  161. icon: "none",
  162. title: "分配成功"
  163. })
  164. uni.navigateBack();
  165. uni.hideLoading();
  166. });
  167. },
  168. getFreeList() {
  169. this.$u.get("/zkAgentPool/freeList?itemId=" + this.buildingID).then(res => {
  170. this.LOADING = false
  171. if (res.length == 0) {
  172. this.freeList = []
  173. } else {
  174. this.freeList = res;
  175. this.textcdhSKJ = res[0].name
  176. }
  177. }).catch(e => {
  178. this.LOADING = false
  179. })
  180. },
  181. radioChange(evt) {
  182. this.chosedAgentId = '';
  183. this.chosedAgentId = evt.detail.value;
  184. },
  185. }
  186. }
  187. </script>
  188. <style lang="scss" scoped>
  189. .box {
  190. background: #F8F8F8;
  191. width: 100%;
  192. min-height: calc(100vh - var(--window-top));
  193. display: flex;
  194. flex-direction: column;
  195. font-size: 30rpx;
  196. font-weight: 400;
  197. .nextcon {
  198. flex-shrink: 0;
  199. height: 78rpx;
  200. background: #F4F8FD;
  201. color: #2671E2;
  202. text-align: center;
  203. line-height: 78rpx;
  204. }
  205. .search-tag {
  206. margin: 0 0 20rpx 0;
  207. padding: 30rpx 30rpx 0;
  208. background: #fff;
  209. .tabs-box {
  210. background: #fff;
  211. }
  212. }
  213. .content {
  214. flex-grow: 1;
  215. display: flex;
  216. flex-direction: column;
  217. .content-tips {
  218. display: flex;
  219. justify-content: space-between;
  220. background: #fff;
  221. padding: 0 30rpx;
  222. height: 148rpx;
  223. margin-bottom: 20rpx;
  224. .left {
  225. display: flex;
  226. margin-top: 30rpx;
  227. .img {
  228. width: 72rpx;
  229. height: 72rpx;
  230. background: #FFFFFF;
  231. border: 1px solid #C9C9C9;
  232. line-height: 64rpx;
  233. text-align: center;
  234. border-radius: 50%;
  235. margin-right: 20rpx;
  236. }
  237. .text {
  238. .name {
  239. margin-top: 4rpx;
  240. font-weight: 600;
  241. color: #333333;
  242. line-height: 30rpx;
  243. margin-bottom: 24rpx;
  244. }
  245. }
  246. }
  247. .right {
  248. margin: 54rpx 0;
  249. }
  250. }
  251. .empty {
  252. flex: 1;
  253. display: flex;
  254. flex-direction: column;
  255. justify-content: center;
  256. align-items: center;
  257. .image {
  258. width: 300rpx;
  259. height: 300rpx;
  260. }
  261. .tips {
  262. font-size: 36rpx;
  263. color: #242424;
  264. line-height: 1;
  265. margin-top: 50rpx;
  266. }
  267. }
  268. }
  269. .save {
  270. position: sticky;
  271. bottom: 50rpx;
  272. z-index: 10;
  273. flex-shrink: 0;
  274. margin: 50rpx auto;
  275. width: calc(100vw - 60rpx);
  276. color: #FFFFFF;
  277. font-size: 30rpx;
  278. height: 98rpx;
  279. border-radius: 8rpx;
  280. display: flex;
  281. justify-content: center;
  282. align-items: center;
  283. background: rgba(42, 111, 255, 1);
  284. }
  285. }
  286. </style>