visitPage.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="visitPage" v-if="resData">
  3. <div class="storeType" v-for="(item, index) in contentData" :key="index">
  4. <div class="title" :style="{ background: item.bagColor }">{{ item.title }}</div>
  5. <div class="itemContent">
  6. <div class="temList" v-for="(list, ind) in item.visitDetail" :key="ind">
  7. <div class="itemLeft">
  8. <div class="label">{{ list.leftTable }}</div>
  9. <div class="label">
  10. {{ resData[item.titleProp][list.leftProp] }}
  11. </div>
  12. </div>
  13. <div class="itemRight">
  14. <div class="label">{{ list.rightTable }}</div>
  15. <div class="label" :style="labelStyle(list)" @click="onClick(item, list)">
  16. {{ resData[item.titleProp][list.rightProp] }}{{ list.rightUnit }}
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="mask" v-if="maskShow"><van-loading type="spinner" color="#1989fa" /></div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'visitPage',
  28. props: {
  29. // 折叠数据label
  30. contentData: {
  31. type: Array,
  32. default: [],
  33. },
  34. // 遮罩层
  35. maskShow: {
  36. type: Boolean,
  37. default: false,
  38. },
  39. // 接口返回折叠数据
  40. resData: {
  41. type: Object,
  42. default: () => {},
  43. },
  44. // 用户等级
  45. empLevel: {
  46. type: String,
  47. },
  48. // 来源类型 'noVisit':未拜访; 'createStore':建店;
  49. fromType: {
  50. type: String,
  51. },
  52. },
  53. data() {
  54. return {};
  55. },
  56. methods: {
  57. labelStyle(list) {
  58. return {
  59. 'text-decoration': list.rightIsClick ? 'underline' : 'none',
  60. color: list.rightIsClick ? '#0057ba' : '#666666',
  61. };
  62. },
  63. // 跳转详情
  64. onClick(item, list) {
  65. // 等级3(销售员):点击未拜访;进入未拜访列表(noVIsit);点击建店:进入我的-我的客户(storemanagementlist)
  66. // 等级2或1(销售部主管和大区负责人):进入统页面(hintDetail)
  67. if (this.empLevel == '3') {
  68. if (this.fromType == 'noVisit') {
  69. // 进入未拜访列表(noVIsit)
  70. this.$router.push({ path: '/noVisit', query: { activeName: item.titleProp } });
  71. } else if (this.fromType == 'createStore') {
  72. // 进入我的-我的客户(storemanagementlist)
  73. // 1:未完工;2:未结案
  74. let storeStatus = list.rightTable.indexOf('未完工') != -1 ? '1' : '2';
  75. localStorage.setItem('storeStatus', storeStatus);
  76. this.$router.push({ path: '/storemanagementlist', query: { storeStatus: storeStatus } });
  77. }
  78. } else {
  79. // 销售部主管和大区负责人跳转统计页面
  80. this.$router.push({ path: '/hintDetail', query: { fromType: this.fromType } });
  81. }
  82. },
  83. },
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. .visitPage {
  88. position: relative;
  89. .storeType {
  90. display: flex;
  91. padding: 8px 0;
  92. .title {
  93. color: #fff;
  94. height: 21px;
  95. margin-right: 10px;
  96. width: 50px;
  97. text-align: center;
  98. line-height: 21px;
  99. border-radius: 2px;
  100. }
  101. .itemContent {
  102. /* display: flex; */
  103. color: #666666;
  104. flex: 1;
  105. .temList {
  106. display: flex;
  107. justify-content: space-between;
  108. .itemLeft {
  109. display: flex;
  110. flex: 1;
  111. }
  112. .itemRight {
  113. width: 110px;
  114. display: flex;
  115. }
  116. }
  117. }
  118. }
  119. .mask {
  120. position: absolute;
  121. width: 100%;
  122. height: 100%;
  123. top: 0;
  124. background: rgba(255, 255, 255, 0.8);
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. }
  129. }
  130. </style>