shareCommonTarget.vue 13 KB

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