table.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. <template>
  2. <div style="margin-top:16px">
  3. <el-table
  4. :data="tableData"
  5. style="width: 100%"
  6. :height="height"
  7. size="small">
  8. <el-table-column
  9. prop="depfullname"
  10. :label="$t('部门')"
  11. width="120"
  12. fixed>
  13. <template slot-scope="scope">
  14. <p>{{scope.row.depfullname.substring(scope.row.depfullname.lastIndexOf("/",scope.row.depfullname.lastIndexOf('/')-1) + 1)}}</p>
  15. </template>
  16. </el-table-column>
  17. <el-table-column
  18. prop="name"
  19. :label="$t('人员')"
  20. width="80"
  21. fixed>
  22. <template slot-scope="scope">
  23. <p>{{scope.row.name?scope.row.name:'--'}}</p>
  24. </template>
  25. </el-table-column>
  26. <el-table-column
  27. prop="position"
  28. :label="$t('职位')"
  29. width="100"
  30. fixed>
  31. <template slot-scope="scope">
  32. <p>{{scope.row.position?scope.row.position:'--'}}</p>
  33. </template>
  34. </el-table-column>
  35. <el-table-column
  36. :label="$t('目标')+'/'+$t('实际')"
  37. width="100">
  38. <template>
  39. <p class="center d-text">{{$t('目标')}}</p>
  40. <p class="border"></p>
  41. <p class="center d-text">{{$t('实际')}}</p>
  42. </template>
  43. </el-table-column>
  44. <el-table-column :label="$t('年度(万元)')">
  45. <el-table-column
  46. prop="y1l"
  47. :label="$t('基本')"
  48. width="120">
  49. <template slot-scope="scope">
  50. <p class="center d-text">{{tool.formatAmount(scope.row.y1l,2)}}</p>
  51. <p class="border"></p>
  52. <p class="center">{{tool.formatAmount(scope.row.y1a,2)}}</p>
  53. <p class="center" :class="scope.row.y1pl < 100?'green':'red'">({{scope.row.y1pl}}%)</p>
  54. </template>
  55. </el-table-column>
  56. <el-table-column
  57. prop="y1h"
  58. :label="$t('挑战')"
  59. width="120">
  60. <template slot-scope="scope">
  61. <p class="center d-text">{{tool.formatAmount(scope.row.y1h,2)}}</p>
  62. <p class="border"></p>
  63. <p class="center">{{tool.formatAmount(scope.row.y1a,2)}}</p>
  64. <p class="center" :class="scope.row.y1ph < 100?'green':'red'">({{scope.row.y1ph}}%)</p>
  65. </template>
  66. </el-table-column>
  67. </el-table-column>
  68. <el-table-column :label="$t('第一季度(万元)')">
  69. <el-table-column
  70. prop="s1l"
  71. :label="$t('基本')"
  72. width="120">
  73. <template slot-scope="scope">
  74. <p class="center d-text">{{tool.formatAmount(scope.row.s1l,2)}}</p>
  75. <p class="border"></p>
  76. <p class="center">{{tool.formatAmount(scope.row.s1a,2)}}</p>
  77. <p class="center" :class="scope.row.s1pl < 100?'green':'red'">({{scope.row.s1pl}}%)</p>
  78. </template>
  79. </el-table-column>
  80. <el-table-column
  81. prop="s1h"
  82. :label="$t('挑战')"
  83. width="120">
  84. <template slot-scope="scope">
  85. <p class="center d-text">{{tool.formatAmount(scope.row.s1h,2)}}</p>
  86. <p class="border"></p>
  87. <p class="center">{{tool.formatAmount(scope.row.s1a,2)}}</p>
  88. <p class="center" :class="scope.row.s1ph < 100?'green':'red'">({{scope.row.s1ph}}%)</p>
  89. </template>
  90. </el-table-column>
  91. </el-table-column>
  92. <el-table-column :label="$t('一月(万元)')">
  93. <el-table-column
  94. prop="m1l"
  95. :label="$t('基本')"
  96. width="120">
  97. <template slot-scope="scope">
  98. <p class="center d-text">{{tool.formatAmount(scope.row.m1l,2)}}</p>
  99. <p class="border"></p>
  100. <p class="center">{{tool.formatAmount(scope.row.m1a,2)}}</p>
  101. <p class="center" :class="scope.row.m1pl < 100?'green':'red'">({{scope.row.m1pl}}%)</p>
  102. </template>
  103. </el-table-column>
  104. <el-table-column
  105. prop="m1h"
  106. :label="$t('挑战')"
  107. width="120">
  108. <template slot-scope="scope">
  109. <p class="center d-text">{{tool.formatAmount(scope.row.m1h,2)}}</p>
  110. <p class="border"></p>
  111. <p class="center">{{tool.formatAmount(scope.row.m1a,2)}}</p>
  112. <p class="center" :class="scope.row.m1ph < 100?'green':'red'">({{scope.row.m1ph}}%)</p>
  113. </template>
  114. </el-table-column>
  115. </el-table-column>
  116. <el-table-column :label="$t('二月(万元)')">
  117. <el-table-column
  118. prop="m2l"
  119. :label="$t('基本')"
  120. width="120">
  121. <template slot-scope="scope">
  122. <p class="center d-text">{{tool.formatAmount(scope.row.m2l,2)}}</p>
  123. <p class="border"></p>
  124. <p class="center">{{tool.formatAmount(scope.row.m2a,2)}}</p>
  125. <p class="center" :class="scope.row.m2pl < 100?'green':'red'">({{scope.row.m2pl}}%)</p>
  126. </template>
  127. </el-table-column>
  128. <el-table-column
  129. prop="m2h"
  130. :label="$t('挑战')"
  131. width="120">
  132. <template slot-scope="scope">
  133. <p class="center d-text">{{tool.formatAmount(scope.row.m2h,2)}}</p>
  134. <p class="border"></p>
  135. <p class="center">{{tool.formatAmount(scope.row.m2a,2)}}</p>
  136. <p class="center" :class="scope.row.m2ph < 100?'green':'red'">({{scope.row.m2ph}}%)</p>
  137. </template>
  138. </el-table-column>
  139. </el-table-column>
  140. <el-table-column :label="$t('三月(万元)')">
  141. <el-table-column
  142. prop="m3l"
  143. :label="$t('基本')"
  144. width="120">
  145. <template slot-scope="scope">
  146. <p class="center d-text">{{tool.formatAmount(scope.row.m3l,2)}}</p>
  147. <p class="border"></p>
  148. <p class="center">{{tool.formatAmount(scope.row.m3a,2)}}</p>
  149. <p class="center" :class="scope.row.m3pl < 100?'green':'red'">({{scope.row.m3pl}}%)</p>
  150. </template>
  151. </el-table-column>
  152. <el-table-column
  153. prop="m3h"
  154. :label="$t('挑战')"
  155. width="120">
  156. <template slot-scope="scope">
  157. <p class="center d-text">{{tool.formatAmount(scope.row.m3h,2)}}</p>
  158. <p class="border"></p>
  159. <p class="center">{{tool.formatAmount(scope.row.m3a,2)}}</p>
  160. <p class="center" :class="scope.row.m3ph < 100?'green':'red'">({{scope.row.m3ph}}%)</p>
  161. </template>
  162. </el-table-column>
  163. </el-table-column>
  164. <el-table-column :label="$t('第二季度(万元)')">
  165. <el-table-column
  166. prop="s2l"
  167. :label="$t('基本')"
  168. width="120">
  169. <template slot-scope="scope">
  170. <p class="center d-text">{{tool.formatAmount(scope.row.s2l,2)}}</p>
  171. <p class="border"></p>
  172. <p class="center">{{tool.formatAmount(scope.row.s2a,2)}}</p>
  173. <p class="center" :class="scope.row.s2pl < 100?'green':'red'">({{scope.row.s2pl}}%)</p>
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. prop="s2h"
  178. :label="$t('挑战')"
  179. width="120">
  180. <template slot-scope="scope">
  181. <p class="center d-text">{{tool.formatAmount(scope.row.s2h,2)}}</p>
  182. <p class="border"></p>
  183. <p class="center">{{tool.formatAmount(scope.row.s2a,2)}}</p>
  184. <p class="center" :class="scope.row.s2ph < 100?'green':'red'">({{scope.row.s2ph}}%)</p>
  185. </template>
  186. </el-table-column>
  187. </el-table-column>
  188. <el-table-column :label="$t('四月(万元)')">
  189. <el-table-column
  190. prop="m4l"
  191. :label="$t('基本')"
  192. width="120">
  193. <template slot-scope="scope">
  194. <p class="center d-text">{{tool.formatAmount(scope.row.m4l,2)}}</p>
  195. <p class="border"></p>
  196. <p class="center">{{tool.formatAmount(scope.row.m4a,2)}}</p>
  197. <p class="center" :class="scope.row.m4pl < 100?'green':'red'">({{scope.row.m4pl}}%)</p>
  198. </template>
  199. </el-table-column>
  200. <el-table-column
  201. prop="m4h"
  202. :label="$t('挑战')"
  203. width="120">
  204. <template slot-scope="scope">
  205. <p class="center d-text">{{tool.formatAmount(scope.row.m4h,2)}}</p>
  206. <p class="border"></p>
  207. <p class="center">{{tool.formatAmount(scope.row.m4a,2)}}</p>
  208. <p class="center" :class="scope.row.m4ph < 100?'green':'red'">({{scope.row.m4ph}}%)</p>
  209. </template>
  210. </el-table-column>
  211. </el-table-column>
  212. <el-table-column :label="$t('五月(万元)')">
  213. <el-table-column
  214. prop="m5l"
  215. :label="$t('基本')"
  216. width="120">
  217. <template slot-scope="scope">
  218. <p class="center d-text">{{tool.formatAmount(scope.row.m5l,2)}}</p>
  219. <p class="border"></p>
  220. <p class="center">{{tool.formatAmount(scope.row.m5a,2)}}</p>
  221. <p class="center" :class="scope.row.m5pl < 100?'green':'red'">({{scope.row.m5pl}}%)</p>
  222. </template>
  223. </el-table-column>
  224. <el-table-column
  225. prop="m5h"
  226. :label="$t('挑战')"
  227. width="120">
  228. <template slot-scope="scope">
  229. <p class="center d-text">{{tool.formatAmount(scope.row.m5h,2)}}</p>
  230. <p class="border"></p>
  231. <p class="center">{{tool.formatAmount(scope.row.m5a,2)}}</p>
  232. <p class="center" :class="scope.row.m5ph < 100?'green':'red'">({{scope.row.m5ph}}%)</p>
  233. </template>
  234. </el-table-column>
  235. </el-table-column>
  236. <el-table-column :label="$t('六月(万元)')">
  237. <el-table-column
  238. prop="m6l"
  239. :label="$t('基本')"
  240. width="120">
  241. <template slot-scope="scope">
  242. <p class="center d-text">{{tool.formatAmount(scope.row.m6l,2)}}</p>
  243. <p class="border"></p>
  244. <p class="center">{{tool.formatAmount(scope.row.m6a,2)}}</p>
  245. <p class="center" :class="scope.row.m6pl < 100?'green':'red'">({{scope.row.m6pl}}%)</p>
  246. </template>
  247. </el-table-column>
  248. <el-table-column
  249. prop="m6h"
  250. :label="$t('挑战')"
  251. width="120">
  252. <template slot-scope="scope">
  253. <p class="center d-text">{{tool.formatAmount(scope.row.m6h,2)}}</p>
  254. <p class="border"></p>
  255. <p class="center">{{tool.formatAmount(scope.row.m6a,2)}}</p>
  256. <p class="center" :class="scope.row.m6ph < 100?'green':'red'">({{scope.row.m6ph}}%)</p>
  257. </template>
  258. </el-table-column>
  259. </el-table-column>
  260. <el-table-column :label="$t('第三季度(万元)')">
  261. <el-table-column
  262. prop="s3l"
  263. :label="$t('基本')"
  264. width="120">
  265. <template slot-scope="scope">
  266. <p class="center d-text">{{tool.formatAmount(scope.row.s3l,2)}}</p>
  267. <p class="border"></p>
  268. <p class="center">{{tool.formatAmount(scope.row.s3a,2)}}</p>
  269. <p class="center" :class="scope.row.s3pl < 100?'green':'red'">({{scope.row.s3pl}}%)</p>
  270. </template>
  271. </el-table-column>
  272. <el-table-column
  273. prop="s3h"
  274. :label="$t('挑战')"
  275. width="120">
  276. <template slot-scope="scope">
  277. <p class="center d-text">{{tool.formatAmount(scope.row.s3h,2)}}</p>
  278. <p class="border"></p>
  279. <p class="center">{{tool.formatAmount(scope.row.s3a,2)}}</p>
  280. <p class="center" :class="scope.row.s3ph < 100?'green':'red'">({{scope.row.s3ph}}%)</p>
  281. </template>
  282. </el-table-column>
  283. </el-table-column>
  284. <el-table-column :label="$t('七月(万元)')">
  285. <el-table-column
  286. prop="m7l"
  287. :label="$t('基本')"
  288. width="120">
  289. <template slot-scope="scope">
  290. <p class="center d-text">{{tool.formatAmount(scope.row.m7l,2)}}</p>
  291. <p class="border"></p>
  292. <p class="center">{{tool.formatAmount(scope.row.m7a,2)}}</p>
  293. <p class="center" :class="scope.row.m7pl < 100?'green':'red'">({{scope.row.m7pl}}%)</p>
  294. </template>
  295. </el-table-column>
  296. <el-table-column
  297. prop="m7h"
  298. :label="$t('挑战')"
  299. width="120">
  300. <template slot-scope="scope">
  301. <p class="center d-text">{{tool.formatAmount(scope.row.m7h,2)}}</p>
  302. <p class="border"></p>
  303. <p class="center">{{tool.formatAmount(scope.row.m7a,2)}}</p>
  304. <p class="center" :class="scope.row.m7ph < 100?'green':'red'">({{scope.row.m7ph}}%)</p>
  305. </template>
  306. </el-table-column>
  307. </el-table-column>
  308. <el-table-column :label="$t('八月(万元)')">
  309. <el-table-column
  310. prop="m8l"
  311. :label="$t('基本')"
  312. width="120">
  313. <template slot-scope="scope">
  314. <p class="center d-text">{{tool.formatAmount(scope.row.m8l,2)}}</p>
  315. <p class="border"></p>
  316. <p class="center">{{tool.formatAmount(scope.row.m8a,2)}}</p>
  317. <p class="center" :class="scope.row.m8pl < 100?'green':'red'">({{scope.row.m8pl}}%)</p>
  318. </template>
  319. </el-table-column>
  320. <el-table-column
  321. prop="m8h"
  322. :label="$t('挑战')"
  323. width="120">
  324. <template slot-scope="scope">
  325. <p class="center d-text">{{tool.formatAmount(scope.row.m8h,2)}}</p>
  326. <p class="border"></p>
  327. <p class="center">{{tool.formatAmount(scope.row.m8a,2)}}</p>
  328. <p class="center" :class="scope.row.m8ph < 100?'green':'red'">({{scope.row.m8ph}}%)</p>
  329. </template>
  330. </el-table-column>
  331. </el-table-column>
  332. <el-table-column :label="$t('九月(万元)')">
  333. <el-table-column
  334. prop="m9l"
  335. :label="$t('基本')"
  336. width="120">
  337. <template slot-scope="scope">
  338. <p class="center d-text">{{tool.formatAmount(scope.row.m9l,2)}}</p>
  339. <p class="border"></p>
  340. <p class="center">{{tool.formatAmount(scope.row.m9a,2)}}</p>
  341. <p class="center" :class="scope.row.m9pl < 100?'green':'red'">({{scope.row.m9pl}}%)</p>
  342. </template>
  343. </el-table-column>
  344. <el-table-column
  345. prop="m9h"
  346. :label="$t('挑战')"
  347. width="120">
  348. <template slot-scope="scope">
  349. <p class="center d-text">{{tool.formatAmount(scope.row.m9h,2)}}</p>
  350. <p class="border"></p>
  351. <p class="center">{{tool.formatAmount(scope.row.m9a,2)}}</p>
  352. <p class="center" :class="scope.row.m9ph < 100?'green':'red'">({{scope.row.m9ph}}%)</p>
  353. </template>
  354. </el-table-column>
  355. </el-table-column>
  356. <el-table-column :label="$t('第四季度(万元)')">
  357. <el-table-column
  358. prop="s4l"
  359. :label="$t('基本')"
  360. width="120">
  361. <template slot-scope="scope">
  362. <p class="center d-text">{{tool.formatAmount(scope.row.s4l,2)}}</p>
  363. <p class="border"></p>
  364. <p class="center">{{tool.formatAmount(scope.row.s4a,2)}}</p>
  365. <p class="center" :class="scope.row.s4pl < 100?'green':'red'">({{scope.row.s4pl}}%)</p>
  366. </template>
  367. </el-table-column>
  368. <el-table-column
  369. prop="s4h"
  370. :label="$t('挑战')"
  371. width="120">
  372. <template slot-scope="scope">
  373. <p class="center d-text">{{tool.formatAmount(scope.row.s4h,2)}}</p>
  374. <p class="border"></p>
  375. <p class="center">{{tool.formatAmount(scope.row.s4a,2)}}</p>
  376. <p class="center" :class="scope.row.s4ph < 100?'green':'red'">({{scope.row.s4ph}}%)</p>
  377. </template>
  378. </el-table-column>
  379. </el-table-column>
  380. <el-table-column :label="$t('十月(万元)')">
  381. <el-table-column
  382. prop="m10l"
  383. :label="$t('基本')"
  384. width="120">
  385. <template slot-scope="scope">
  386. <p class="center d-text">{{tool.formatAmount(scope.row.m10l,2)}}</p>
  387. <p class="border"></p>
  388. <p class="center">{{tool.formatAmount(scope.row.m10a,2)}}</p>
  389. <p class="center" :class="scope.row.m10pl < 100?'green':'red'">({{scope.row.m10pl}}%)</p>
  390. </template>
  391. </el-table-column>
  392. <el-table-column
  393. prop="m10h"
  394. :label="$t('挑战')"
  395. width="120">
  396. <template slot-scope="scope">
  397. <p class="center d-text">{{tool.formatAmount(scope.row.m10h,2)}}</p>
  398. <p class="border"></p>
  399. <p class="center">{{tool.formatAmount(scope.row.m10a,2)}}</p>
  400. <p class="center" :class="scope.row.m10ph < 100?'green':'red'">({{scope.row.m10ph}}%)</p>
  401. </template>
  402. </el-table-column>
  403. </el-table-column>
  404. <el-table-column :label="$t('十一月(万元)')">
  405. <el-table-column
  406. prop="m11l"
  407. :label="$t('基本')"
  408. width="120">
  409. <template slot-scope="scope">
  410. <p class="center d-text">{{tool.formatAmount(scope.row.m11l,2)}}</p>
  411. <p class="border"></p>
  412. <p class="center">{{tool.formatAmount(scope.row.m11a,2)}}</p>
  413. <p class="center" :class="scope.row.m11pl < 100?'green':'red'">({{scope.row.m11pl}}%)</p>
  414. </template>
  415. </el-table-column>
  416. <el-table-column
  417. prop="m11h"
  418. :label="$t('挑战')"
  419. width="120">
  420. <template slot-scope="scope">
  421. <p class="center d-text">{{tool.formatAmount(scope.row.m11h,2)}}</p>
  422. <p class="border"></p>
  423. <p class="center">{{tool.formatAmount(scope.row.m11a,2)}}</p>
  424. <p class="center" :class="scope.row.m11ph < 100?'green':'red'">({{scope.row.m11ph}}%)</p>
  425. </template>
  426. </el-table-column>
  427. </el-table-column>
  428. <el-table-column :label="$t('十二月(万元)')">
  429. <el-table-column
  430. prop="m12l"
  431. :label="$t('基本')"
  432. width="120">
  433. <template slot-scope="scope">
  434. <p class="center d-text">{{tool.formatAmount(scope.row.m12l,2)}}</p>
  435. <p class="border"></p>
  436. <p class="center">{{tool.formatAmount(scope.row.m12a,2)}}</p>
  437. <p class="center" :class="scope.row.m12pl < 100?'green':'red'">({{scope.row.m12pl}}%)</p>
  438. </template>
  439. </el-table-column>
  440. <el-table-column
  441. prop="m12h"
  442. :label="$t('挑战')"
  443. width="120">
  444. <template slot-scope="scope">
  445. <p class="center d-text">{{tool.formatAmount(scope.row.m12h,2)}}</p>
  446. <p class="border"></p>
  447. <p class="center">{{tool.formatAmount(scope.row.m12a,2)}}</p>
  448. <p class="center" :class="scope.row.m12ph < 100?'green':'red'">({{scope.row.m12ph}}%)</p>
  449. </template>
  450. </el-table-column>
  451. </el-table-column>
  452. <!-- <el-table-column
  453. prop="operation"
  454. :label="$t('操作')"
  455. width="120"
  456. :fixed="Object.keys(tableData).length != 0 ? 'right' : ''">
  457. <template slot-scope="scope" v-if="scope.row.hrid">
  458. <slot :data="{data:scope.row,year:year}" name="edit"/>
  459. <slot :data="{data:scope.row,year:year}" name="detail"/>
  460. </template>
  461. </el-table-column>-->
  462. </el-table>
  463. <div class="container normal-panel" style="text-align:right">
  464. <el-pagination
  465. background
  466. small
  467. @size-change="handleSizeChange"
  468. @current-change="handleCurrentChange"
  469. :current-page="currentPage"
  470. :page-sizes="[20, 50, 100, 200]"
  471. layout="total,sizes, prev, pager, next, jumper"
  472. :total="total">
  473. </el-pagination>
  474. </div>
  475. </div>
  476. </template>
  477. <script>
  478. export default {
  479. props:['height'],
  480. data () {
  481. return {
  482. tableData:[],
  483. currentPage:0,
  484. total:0,
  485. year:'',
  486. params: {
  487. "id": 20220904165302,
  488. "content": {
  489. "pageNumber": 1,
  490. "pageSize": 20,
  491. "year": '',
  492. "type":1,
  493. "where":{
  494. "condition":""//支持部门名称查询
  495. }
  496. },
  497. }
  498. }
  499. },
  500. watch: {
  501. year: {
  502. handler(val) {
  503. this.queryData()
  504. }
  505. }
  506. },
  507. methods:{
  508. async queryData () {
  509. console.log("页面执行")
  510. this.params.content.year = this.year
  511. const res = await this.$api.requested(this.params)
  512. this.tableData = res.data
  513. this.total = res.total
  514. this.currentPage = res.pageNumber
  515. },
  516. handleSizeChange(val) {
  517. // console.log(`每页 ${val} 条`);
  518. this.param.content.pageSize = val
  519. this.queryData()
  520. },
  521. handleCurrentChange(val) {
  522. // console.log(`当前页: ${val}`);
  523. this.param.content.pageNumber = val
  524. this.queryData()
  525. },
  526. },
  527. mounted () {
  528. this.queryData()
  529. }
  530. }
  531. </script>
  532. <style>
  533. </style>
  534. <style scoped>
  535. .d-text{
  536. height: 46px;
  537. line-height: 46px;
  538. }
  539. .border{
  540. border:1px solid #c1bfbf;
  541. transform: scale(2,.2);
  542. }
  543. .center{
  544. text-align: center;
  545. }
  546. .red{
  547. color:red
  548. }
  549. .green{
  550. color:green
  551. }
  552. </style>