shareCommonTarget.vue 13 KB

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