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.
 
 
 

347 rivejä
7.8 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view class="customer" v-for="(item,index) in waitCustomList" :key='index' @click="tapThevisiting(item)">
  4. <view class="title">
  5. <view class="zuo">
  6. <view class="zuoimg">A</view>
  7. <view class="zuoname">{{item.name}}</view>
  8. </view>
  9. <view class="you">
  10. <view class="youimg1" v-if="item.status!=0"></view>
  11. <view class="youimg1-1" v-if="item.status==0"></view>
  12. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view>
  13. </view>
  14. </view>
  15. <view class="centerbox" v-if="item.status!=0">
  16. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  17. <view class="centerbox-che">开始时间:<text class="shizai">{{item.createTime}}</text></view>
  18. <view class="centerbox-che">顾问姓名:<text class="shizai">{{item.agentName}}</text></view>
  19. <view class="centerbox-che2" v-if="item.zkEquipmentState.audioStatus!='' && item.zkEquipmentState!=null">
  20. <view class="Workcard">工牌电量:<text class="shizai">{{item.zkEquipmentState.electricity}}%</text></view>
  21. <view class="Workcard">录音状态:
  22. <text v-if="item.zkEquipmentState.audioStatus=='true'" class="shizai">使用中</text>
  23. <text v-if="item.zkEquipmentState.audioStatus=='false'" class="shizai">未使用</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="footer-button" v-if="item.status!=0">
  28. <view class="footer1" @click.stop="addTime(item)">接待延时</view>
  29. <view class="footer1" @click.stop="assign(item)">重新指派</view>
  30. <view class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  31. </view>
  32. <view class="centerbox" v-if="item.status==0">
  33. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  34. </view>
  35. <view class="footer-button" v-if="item.status==0">
  36. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  37. </view>
  38. </view>
  39. <image v-if="isAdd == 0&&(dataCode!=6||(dataCode==6&&addAccount==0))" @click="addreception()" class="add" src="/static/images/add.png" mode=""></image>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. buildingID:'',
  47. waitCustomList:[],
  48. isAdd:'',
  49. dataCode:''
  50. };
  51. },
  52. components: {},
  53. onLoad() {},
  54. onShow() {
  55. this.buildingID = uni.getStorageSync('buildingID').id;
  56. const {
  57. addAccount,
  58. dataCode
  59. } = uni.getStorageSync("weapp_session_userInfo_data");
  60. this.addAccount=addAccount
  61. this.dataCode=dataCode
  62. this.init()
  63. this.queryHaveDept()
  64. },
  65. methods: {
  66. tapThevisiting(item) {
  67. if(item.status==0){
  68. uni.showToast({
  69. icon: "none",
  70. title: "排队中"
  71. })
  72. return
  73. }else{
  74. const parames = {
  75. pageNum: 1,
  76. pageSize: 100,
  77. query: {
  78. customerId: item.id,
  79. }
  80. }
  81. var item={
  82. bg:0,
  83. customerId:item.id,
  84. }
  85. this.$u.post("/corpus/findByPage", parames).then(res => {
  86. if(res){
  87. let newobj = res[0];
  88. uni.navigateTo({
  89. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(item)}&stateisshow=${"1"}`
  90. })
  91. }else{
  92. uni.showToast({
  93. icon: "none",
  94. title: "暂无音频"
  95. })
  96. return
  97. }
  98. })
  99. }
  100. },
  101. queryHaveDept() {
  102. return new Promise((resolve, reject) => {
  103. this.$u.get("/user/queryHaveDept?houseId="+this.buildingID).then(res => {
  104. this.isAdd=res;
  105. resolve();
  106. })
  107. })
  108. },
  109. init(){
  110. this.waitCustomList=[]
  111. let parames={
  112. itemId:this.buildingID
  113. }
  114. this.$u.post("/customer/reception", parames).then(data => {
  115. this.waitCustomList=data;
  116. });
  117. },
  118. //延时接待
  119. addTime(item) {
  120. uni.showModal({
  121. content: "确定延长半小时接待时间?",
  122. cancelColor: "#999999",
  123. success: res => {
  124. if (res.confirm) {
  125. this.$u.post("/customer/delayed", {
  126. cusId: item.id
  127. }).then(res => {
  128. uni.showToast({
  129. icon: "none",
  130. title: "操作成功"
  131. })
  132. });
  133. }
  134. }
  135. })
  136. },
  137. //结束接待
  138. changeEnd(id) {
  139. uni.showModal({
  140. content: "确定更改当前客户接待状态为结束?",
  141. cancelColor: "#999999",
  142. success: res => {
  143. if (res.confirm) {
  144. this.$u.post("/customer/endReception", {
  145. id
  146. }).then(res => {
  147. uni.showToast({
  148. icon: "none",
  149. title: "操作成功"
  150. })
  151. this.init();
  152. });
  153. }
  154. }
  155. })
  156. },
  157. //新增接待
  158. addreception(){
  159. const {
  160. dataCode,addAccount
  161. } = uni.getStorageSync("weapp_session_userInfo_data");
  162. if(dataCode==6){
  163. if(addAccount!=0){
  164. uni.showToast({
  165. title: '不允许自建客户!',
  166. duration: 2000
  167. });
  168. return
  169. }
  170. if(this.waitCustomList.length==0){
  171. uni.navigateTo({
  172. url: "/pages/customer/add/add"
  173. })
  174. return
  175. }else{
  176. for(var i=0; i<this.waitCustomList.length; i++){
  177. if(this.waitCustomList[i].status==1){
  178. uni.showLoading({
  179. title: '当前还有未完成的客户项'
  180. });
  181. setTimeout(function () {
  182. uni.hideLoading();
  183. }, 1000);
  184. return
  185. }else{
  186. uni.navigateTo({
  187. url: "/pages/customer/add/add"
  188. })
  189. return
  190. }
  191. }
  192. }
  193. }else{
  194. uni.navigateTo({
  195. url: '/pages/mine/reception/addreception'
  196. });
  197. }
  198. },
  199. assign(item) {
  200. let url = `/pages/mine/reception/consultant?id=${item.id}`
  201. if (item.beforeAgentId) {
  202. url += `&beforeAgentId=${item.beforeAgentId}`;
  203. }
  204. uni.navigateTo({
  205. url: url
  206. })
  207. },
  208. },
  209. };
  210. </script>
  211. <style lang="scss" scoped>
  212. .cented-box{
  213. background: #F8F8F8;
  214. width: 100%;
  215. height: 100vh;
  216. padding-bottom: 30rpx;
  217. }
  218. .customer{
  219. margin-top: 30rpx;
  220. width: 100%;
  221. background: #FFFFFF;
  222. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  223. .title{
  224. height: 90rpx;
  225. border-bottom: 1px solid #E0E0E0;
  226. display: flex;
  227. align-items: center;
  228. .zuo{
  229. width: 80%;
  230. height: 100%;
  231. display: flex;
  232. align-items: center;
  233. .zuoimg{
  234. width: 52rpx;
  235. height: 52rpx;
  236. border-radius: 50%;
  237. border: 1px solid #C9C9C9;
  238. font-size: 30rpx;
  239. color: #292929;
  240. font-weight: 400;
  241. line-height: 52rpx;
  242. text-align: center;
  243. margin-left: 30rpx;
  244. }
  245. .zuoname{
  246. font-size: 30rpx;
  247. font-weight: 500;
  248. color: #333333;
  249. line-height: 30rpx;
  250. margin-left: 20rpx;
  251. }
  252. }
  253. .you{
  254. width: 20%;
  255. height: 100%;
  256. display: flex;
  257. align-items: center;
  258. .youimg1{
  259. width: 12rpx;
  260. height: 12rpx;
  261. border-radius: 50%;
  262. background: #2B6EFF;
  263. }
  264. .youimg1-1{
  265. width: 12rpx;
  266. height: 12rpx;
  267. border-radius: 50%;
  268. background: #F2A269;
  269. }
  270. .youtext{
  271. font-size: 30rpx;
  272. font-weight: 400;
  273. color: #292929;
  274. line-height: 30rpx;
  275. margin-left: 10rpx;
  276. }
  277. }
  278. }
  279. .centerbox{
  280. .centerbox-che{
  281. width: 100%;
  282. margin-top: 30rpx;
  283. height: 30rpx;
  284. font-size: 30rpx;
  285. font-weight: 400;
  286. color: #666666;
  287. line-height: 30rpx;
  288. text-indent: 30rpx;
  289. .shizai{
  290. color: #333333;
  291. }
  292. }
  293. .centerbox-che2{
  294. width: 100%;
  295. margin-top: 30rpx;
  296. height: 30rpx;
  297. font-size: 30rpx;
  298. font-weight: 400;
  299. color: #666666;
  300. line-height: 30rpx;
  301. text-indent: 30rpx;
  302. display: flex;
  303. .Workcard{
  304. width: 50%;
  305. }
  306. }
  307. }
  308. .footer-button{
  309. margin-top: 30rpx;
  310. width: 100%;
  311. height: 90rpx;
  312. display: flex;
  313. font-size: 30rpx;
  314. font-weight: 400;
  315. color: #333333;
  316. border-top: 1rpx solid #E0E0E0;
  317. .footer1{
  318. flex: 1;
  319. text-align: center;
  320. line-height: 90rpx;
  321. border-right: 1rpx solid #E0E0E0;
  322. }
  323. .footer3{
  324. flex: 1;
  325. text-align: center;
  326. line-height: 90rpx;
  327. }
  328. }
  329. }
  330. .add {
  331. width: 90rpx;
  332. height: 90rpx;
  333. position: fixed;
  334. bottom: 70rpx;
  335. right: 44rpx;
  336. }
  337. </style>