table.vue 19 KB

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