target.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <div class="ABtarage">
  3. <template>
  4. <div class="container linep" style="margin: 0">
  5. <van-collapse v-model="activeNames">
  6. <div v-for="(homePageItem, index) in homePageIndicatorDate" :key="index">
  7. <van-collapse-item
  8. v-if="homePageItem.labelStyle == 1"
  9. :name="(index + 1).toString()"
  10. :title="homePageItem.name">
  11. <van-row>
  12. <!-- 动态渲染标题栏 -->
  13. <div
  14. v-for="(periodItem, periodIndex) in homePageItem.children"
  15. :key="'title-' + periodIndex">
  16. <van-col span="12">
  17. <span :class="periodIndex % 2 === 0 ? 'leftTitle' : 'rightTitle'">{{
  18. periodItem.name
  19. }}</span>
  20. </van-col>
  21. </div>
  22. <!-- 动态渲染指标项 -->
  23. <div v-if="homePageItem.children.length >= 2">
  24. <!-- 遍历第一个周期的所有指标 -->
  25. <div
  26. v-for="(metric, metricIndex) in homePageItem.children[0].children"
  27. :key="'metric-' + metricIndex">
  28. <!-- 左侧指标 -->
  29. <van-col span="12">
  30. <p>
  31. {{ metric.name }}:
  32. <span class="colorblack">
  33. <template v-if="metric.indicatorUnit === '%'"
  34. >{{ metric.indicatorValue }}%</template
  35. >
  36. <template v-else>
  37. {{ Micrometer(metric.indicatorValue) }}
  38. {{ metric.indicatorUnit }}
  39. </template>
  40. </span>
  41. </p>
  42. </van-col>
  43. <!-- 对应右侧指标 -->
  44. <van-col span="12">
  45. <p>
  46. {{ homePageItem.children[1]?.children[metricIndex]?.name || '-' }}:
  47. <span class="colorblack">
  48. <template
  49. v-if="
  50. homePageItem.children[1]?.children[metricIndex]?.indicatorUnit === '%'
  51. ">
  52. {{ homePageItem.children[1]?.children[metricIndex]?.indicatorValue }}%
  53. </template>
  54. <template v-else>
  55. {{
  56. Micrometer(
  57. homePageItem.children[1]?.children[metricIndex]?.indicatorValue,
  58. )
  59. }}
  60. {{ homePageItem.children[1]?.children[metricIndex]?.indicatorUnit }}
  61. </template>
  62. </span>
  63. </p>
  64. </van-col>
  65. </div>
  66. </div>
  67. </van-row>
  68. </van-collapse-item>
  69. <van-collapse-item
  70. v-if="homePageItem.labelStyle == 2"
  71. :name="(index + 1).toString()"
  72. :title="homePageItem.name">
  73. <!-- 外层循环:遍历主要类别 -->
  74. <van-row
  75. v-for="(category, index) in homePageItem.children"
  76. :key="index"
  77. :style="{ marginTop: index > 0 ? '10px' : '0' }">
  78. <van-col span="24">
  79. <span :class="index % 2 === 0 ? 'leftTitle' : 'rightTitle'">{{
  80. category.name
  81. }}</span>
  82. </van-col>
  83. <!-- 内层循环:遍历各个统计项 -->
  84. <div v-for="(item, idx) in category.children" :key="idx">
  85. <van-col :span="idx == 0 ? 24 : 12">
  86. <p>
  87. {{ item.name }}:<span
  88. :style="labelStyle(item.clickable)"
  89. @click="onClick(item.clickable)"
  90. class="colorbalck"
  91. >{{ Micrometer(item.indicatorValue) }}{{ item.indicatorUnit }}</span
  92. >
  93. </p>
  94. </van-col>
  95. </div>
  96. </van-row>
  97. </van-collapse-item>
  98. <van-collapse-item
  99. v-if="homePageItem.labelStyle == 3"
  100. :name="(index + 1).toString()"
  101. :title="homePageItem.name">
  102. <!-- 外层循环:遍历主要类别 -->
  103. <van-row
  104. v-for="(category, index) in homePageItem.children"
  105. :key="index"
  106. :style="{ marginTop: index == 0 ? '-10px' : '0' }">
  107. <!-- 内层循环:遍历各个统计项 -->
  108. <div v-for="(item, idx) in category.children" :key="idx">
  109. <van-col :span="idx == 0 ? 24 : 12">
  110. <p>
  111. {{ item.name }}:<span
  112. :style="labelStyle(item.clickable)"
  113. @click="onClick(item.clickable)"
  114. class="colorbalck"
  115. >{{ Micrometer(item.indicatorValue) }}{{ item.indicatorUnit }}</span
  116. >
  117. </p>
  118. </van-col>
  119. </div>
  120. </van-row>
  121. </van-collapse-item>
  122. </div>
  123. </van-collapse>
  124. </div>
  125. </template>
  126. </div>
  127. </template>
  128. <script>
  129. import store from '@/store';
  130. export default {
  131. name: 'home',
  132. props: {
  133. homePageIndicatorDate: {
  134. type: Array,
  135. },
  136. },
  137. data() {
  138. return {
  139. shows: true,
  140. show: true,
  141. num: 0,
  142. todayGoal: {},
  143. progressWidth: 0,
  144. updataTime: '',
  145. activeNames: [
  146. '1',
  147. '2',
  148. '3',
  149. '4',
  150. '5',
  151. '6',
  152. '7',
  153. '8',
  154. '10',
  155. '11',
  156. '12',
  157. '16',
  158. '17',
  159. '20',
  160. '21',
  161. '22',
  162. '23',
  163. '24',
  164. '25',
  165. '26',
  166. '27',
  167. '28',
  168. '29',
  169. '30',
  170. '31',
  171. '32',
  172. '33',
  173. '34',
  174. '35',
  175. '36',
  176. '37',
  177. '38',
  178. '39',
  179. '40',
  180. '41',
  181. '42',
  182. '43',
  183. ],
  184. activeNameType: [],
  185. powerGradeShow: false,
  186. showButton: false,
  187. isCommit: null,
  188. powerGrade: '2',
  189. deptLevel: '',
  190. // positionId:等级(1-销售员 2-销售部主管 3-大区主管 4-区域公司总经理 5-DIY公司)
  191. reportTargetAll: {},
  192. homePageIndicatorList: [],
  193. approvalPendingNum: 0,
  194. isDiy: false,
  195. approvalButton: false,
  196. times: 5,
  197. timer: null,
  198. type: '-1',
  199. monthNoVisit: {},
  200. flag: true,
  201. reportInfoData: {},
  202. applyNumber: '',
  203. proccessPendingNum: 0,
  204. JZQuota: false,
  205. GZdata: false,
  206. };
  207. },
  208. methods: {
  209. labelStyle(val) {
  210. return {
  211. 'text-decoration': val == 1 ? 'underline' : 'none',
  212. color: val == 1 ? '#0057ba' : '#666666',
  213. };
  214. },
  215. // 跳转详情
  216. onClick(val) {
  217. if (val == 1) {
  218. store.dispatch('setActivaTypeStore', 'FuWuShang');
  219. this.$router.push({ path: '/noVisit' });
  220. }
  221. },
  222. },
  223. };
  224. </script>
  225. <style scoped>
  226. .homeTitle {
  227. padding: 6px 16px;
  228. }
  229. .homeTitle .van-icon__image {
  230. width: 1.4em;
  231. height: auto;
  232. }
  233. .container {
  234. /* margin: 10px; */
  235. }
  236. .container .van-collapse-item {
  237. margin-bottom: 10px;
  238. border-radius: 6px;
  239. overflow: hidden;
  240. }
  241. .progressContentlist {
  242. font-size: 14px;
  243. border-bottom: 1px dashed #f1f1f1;
  244. padding: 10px 0;
  245. }
  246. .linep p {
  247. margin: 10px 0 0 0;
  248. font-size: 14px;
  249. color: #666;
  250. }
  251. .leftTitle {
  252. background-color: #74a4d9;
  253. color: #fff;
  254. display: inline-block;
  255. padding: 0 4px;
  256. border-radius: 2px;
  257. }
  258. .rightTitle {
  259. background-color: #e7b4bb;
  260. color: #fff;
  261. display: inline-block;
  262. padding: 0 4px;
  263. border-radius: 2px;
  264. white-space: nowrap;
  265. }
  266. </style>
  267. <style lang="scss">
  268. .myTab .van-tabs__nav--card {
  269. margin: 0 !important;
  270. border-left: 0;
  271. border-right: 0;
  272. }
  273. .myTab .van-tabs__wrap,
  274. .van-tabs__nav--card {
  275. height: 39px;
  276. }
  277. .myTab .van-tab {
  278. line-height: 40px;
  279. }
  280. .linep .van-collapse-item__content {
  281. color: #666;
  282. }
  283. .linep .van-collapse-item__content {
  284. color: #666;
  285. }
  286. .linep .van-cell__title {
  287. color: #1e5398;
  288. font-weight: 500;
  289. font-size: 16px;
  290. }
  291. .homeCellIcon {
  292. line-height: 34px;
  293. }
  294. .homeTitle .van-cell__title {
  295. color: #444;
  296. font-size: 16px;
  297. font-weight: bold;
  298. padding-left: 4px;
  299. line-height: 36px;
  300. height: 36px;
  301. }
  302. .updataTime {
  303. color: #999;
  304. font-size: 12px;
  305. text-align: center;
  306. }
  307. .homeTitle .van-tag--danger {
  308. /* border-radius: 20px; */
  309. }
  310. .van-dialog__confirm,
  311. .van-dialog__confirm:active {
  312. color: #0057ba;
  313. }
  314. .tipTitleBox p {
  315. margin: 0;
  316. line-height: 28px;
  317. color: #555;
  318. }
  319. .tipTitleBox .p {
  320. color: #555;
  321. font-size: 16px;
  322. border-bottom: 1px solid #f5f5f5;
  323. margin: 0;
  324. margin-bottom: 10px;
  325. text-align: center;
  326. padding: 14px 0px;
  327. }
  328. .storeTypeHome .van-collapse-item__content {
  329. padding: 0;
  330. }
  331. .storeTypeHome .storeTypeHomeList .van-cell__title {
  332. color: #4a4a4a;
  333. font-size: 14px;
  334. }
  335. .storeTypeHome .monthNoVisit {
  336. padding: 10px;
  337. margin: 10px;
  338. border-radius: 5px;
  339. background-color: #ebf4ff;
  340. }
  341. .storeTypeHome .leftContent {
  342. padding-right: 68px;
  343. position: relative;
  344. }
  345. .storeTypeHome .monthNoVisitStatstext {
  346. font-size: 12px;
  347. background-color: #0057ba;
  348. position: absolute;
  349. right: 0;
  350. top: 6px;
  351. padding: 2px 6px 2px 12px;
  352. border-bottom-left-radius: 60px;
  353. border-top-left-radius: 60px;
  354. color: #fff;
  355. }
  356. .ABtarage {
  357. .table-headermd {
  358. font-size: 12px;
  359. text-align: center;
  360. position: initial;
  361. width: 98% !important;
  362. margin: 0 auto;
  363. border-right: 0;
  364. }
  365. .table-headermdhome {
  366. font-size: 14px;
  367. }
  368. .table-headermdhome th.el-table__cell > .cell {
  369. white-space: pre;
  370. }
  371. .table-headermd .el-table__header,
  372. .table-headermd .el-table__body {
  373. width: 100% !important;
  374. }
  375. .table-headermdhome.van-cell {
  376. padding: 0 6px;
  377. height: 100%;
  378. }
  379. .table-headermd th.el-table__cell > .cell {
  380. padding: 0 4px;
  381. text-align: center;
  382. }
  383. .table-headermdhometh.el-table__cell:first-child > .cell {
  384. text-align: left;
  385. }
  386. .table-headermd th.el-table__cell {
  387. background-color: #1989fa;
  388. color: #fff;
  389. }
  390. .table-headermdhome th.el-table__cell {
  391. background-color: #fff;
  392. color: #444;
  393. }
  394. .table-headermd .el-table__cell {
  395. padding: 4px 0;
  396. }
  397. .table-headermdhome.el-table .cell {
  398. padding: 0 4px;
  399. text-align: center;
  400. }
  401. .table-headermdhome .tipTitle {
  402. overflow: hidden;
  403. text-overflow: ellipsis;
  404. display: -webkit-box;
  405. -webkit-box-orient: vertical;
  406. -webkit-line-clamp: 2;
  407. text-align: center;
  408. }
  409. .table-headermd::before {
  410. height: 0;
  411. }
  412. .table-headermd .cell,
  413. .el-table--border .el-table__cell:first-child .cell {
  414. padding: 0 4px;
  415. }
  416. }
  417. .colBack {
  418. width: 100%;
  419. height: 100%;
  420. display: block;
  421. /* overflow: unset; */
  422. position: relative;
  423. z-index: 2;
  424. float: left;
  425. z-index: 2;
  426. .back {
  427. position: absolute;
  428. background: rgb(226, 240, 217);
  429. height: 100%;
  430. display: block;
  431. overflow: hidden;
  432. /* z-index: 1; */
  433. border-radius: 12px;
  434. bottom: -4px;
  435. }
  436. .backLeft {
  437. width: 45%;
  438. left: -12px;
  439. }
  440. .backRight {
  441. width: 50%;
  442. left: calc(50% - 12px);
  443. }
  444. .van-col {
  445. position: relative;
  446. z-index: 3;
  447. }
  448. }
  449. </style>