tongjiSchool.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <template>
  2. <div>
  3. <basic-container>
  4. <div class="container" style="height: 400px;">
  5. <div class="container-items">
  6. <but-card iconName="el-icon-edit-outline" name="小学部工资" />
  7. <but-card iconName="el-icon-edit-outline" name="初中部工资" />
  8. <but-card iconName="el-icon-edit-outline" name="高中部工资" />
  9. <but-card iconName="el-icon-edit-outline" name="后勤工资" />
  10. <but-card iconName="el-icon-edit-outline" name="添加教师" />
  11. <but-card iconName="el-icon-edit-outline" name="添加后勤" />
  12. </div>
  13. <index-card title="教师工资总体数据" iconName="el-icon-view">
  14. <div slot="select">
  15. <el-date-picker
  16. v-model="annual2"
  17. type="year"
  18. size="mini"
  19. placeholder="选择年"
  20. value-format="yyyy"
  21. style="margin-right:10px"
  22. @change="getsalaryData"
  23. >
  24. </el-date-picker>
  25. <el-select
  26. slot="content"
  27. size="mini"
  28. v-model="salaryType2"
  29. placeholder="请选择"
  30. @change="getsalaryData"
  31. >
  32. <el-option
  33. v-for="item in options"
  34. :key="item.value"
  35. :label="item.label"
  36. :value="item.value"
  37. >
  38. </el-option>
  39. </el-select>
  40. </div>
  41. <div slot="content" style="height:290px">
  42. <avue-data-icons :option="option"></avue-data-icons>
  43. </div>
  44. </index-card>
  45. </div>
  46. </basic-container>
  47. <basic-container>
  48. <index-card
  49. title="工资走势图"
  50. iconName="el-icon-s-fold"
  51. style="height:500px;margin-bottom: 30px"
  52. >
  53. <div slot="select">
  54. <el-date-picker
  55. v-model="annual"
  56. type="year"
  57. size="mini"
  58. placeholder="选择年"
  59. value-format="yyyy"
  60. style="margin-right:10px"
  61. @change="getsalaryStatistics"
  62. >
  63. </el-date-picker>
  64. <el-select
  65. slot="content"
  66. size="mini"
  67. v-model="salaryType"
  68. placeholder="请选择"
  69. @change="getsalaryStatistics"
  70. >
  71. <el-option
  72. v-for="item in options"
  73. :key="item.value"
  74. :label="item.label"
  75. :value="item.value"
  76. >
  77. </el-option>
  78. </el-select>
  79. </div>
  80. <div slot="content" style="height:450px" id="commoDity"></div>
  81. </index-card>
  82. <br />
  83. </basic-container>
  84. <basic-container>
  85. <index-card
  86. title="工资环比走势图"
  87. iconName="el-icon-s-fold"
  88. style="height:500px;margin-bottom: 30px"
  89. >
  90. <div slot="select">
  91. <el-date-picker
  92. v-model="annual3"
  93. type="year"
  94. size="mini"
  95. placeholder="选择年"
  96. value-format="yyyy"
  97. style="margin-right:10px"
  98. @change="getsalaryDataChain"
  99. >
  100. </el-date-picker>
  101. <el-select
  102. slot="content"
  103. size="mini"
  104. v-model="moon"
  105. placeholder="请选择月份"
  106. @change="moonChange"
  107. clearable
  108. style="margin-right:10px"
  109. >
  110. <el-option
  111. v-for="item in moonList"
  112. :key="item.value"
  113. :label="item.dictValue"
  114. :value="item.dictKey"
  115. >
  116. </el-option>
  117. </el-select>
  118. <el-select
  119. slot="content"
  120. size="mini"
  121. v-model="semester"
  122. placeholder="请选择学期"
  123. clearable
  124. @change="semesterChange"
  125. >
  126. <el-option
  127. v-for="item in options2"
  128. :key="item.value"
  129. :label="item.label"
  130. :value="item.value"
  131. >
  132. </el-option>
  133. </el-select>
  134. </div>
  135. <div slot="content" style="height:450px" id="commoDity2"></div>
  136. </index-card>
  137. <br />
  138. </basic-container>
  139. </div>
  140. </template>
  141. <script>
  142. import { salaryStatistics, salaryData, salaryDataChain } from "@/api/wel";
  143. import { mapGetters } from "vuex";
  144. import indexCard from "../components/card.vue";
  145. import butCard from "../components/butCard.vue";
  146. export default {
  147. name: "wel",
  148. data() {
  149. return {
  150. moon: null,
  151. semester: null,
  152. moonList: [],
  153. fsalaryList2: [],
  154. studentNumberList2: [],
  155. fsalaryList: [],
  156. studentNumberList: [],
  157. activeNames: ["1", "2", "3", "5"],
  158. logActiveNames: ["24"],
  159. annual: "2022",
  160. annual2: "2022",
  161. annual3: "2022",
  162. salaryType: "",
  163. salaryType2: "",
  164. isHeight: {},
  165. options: [
  166. {
  167. value: "",
  168. label: "全部"
  169. },
  170. {
  171. value: "小学部",
  172. label: "小学部"
  173. },
  174. {
  175. value: "初中部",
  176. label: "初中部"
  177. },
  178. {
  179. value: "高中部",
  180. label: "高中部"
  181. },
  182. {
  183. value: "后勤部",
  184. label: "后勤部"
  185. }
  186. ],
  187. options2: [
  188. {
  189. value: "上学期",
  190. label: "上学期"
  191. },
  192. {
  193. value: "下学期",
  194. label: "下学期"
  195. }
  196. ],
  197. option: {
  198. span: 6,
  199. data: [
  200. {
  201. // click: function(item) {
  202. // // alert(JSON.stringify(item));
  203. // },
  204. title: "工资总额",
  205. count: 0,
  206. decimals: 2,
  207. icon: "el-icon-tickets"
  208. // href:'https://avuejs.com',
  209. // target: "_blank"
  210. },
  211. {
  212. // click: function(item) {
  213. // // alert(JSON.stringify(item));
  214. // },
  215. title: "年工资额增长率(%)",
  216. count: 0,
  217. decimals: 2,
  218. icon: "el-icon-s-marketing"
  219. // href:'https://avuejs.com',
  220. // target: "_blank"
  221. },
  222. {
  223. // click: function(item) {
  224. // // alert(JSON.stringify(item));
  225. // },
  226. title: "人均工资",
  227. count: 0,
  228. decimals: 2,
  229. icon: "el-icon-s-finance"
  230. // href:'https://avuejs.com',
  231. // target: "_blank"
  232. },
  233. {
  234. // click: function(item) {
  235. // // alert(JSON.stringify(item));
  236. // },
  237. title: "年人均工资增长率(%)",
  238. count: 0,
  239. decimals: 2,
  240. icon: "el-icon-s-claim"
  241. // href:'https://avuejs.com',
  242. // target: "_blank"
  243. },
  244. {
  245. // click: function(item) {
  246. // // alert(JSON.stringify(item));
  247. // },
  248. title: "保险总额",
  249. count: 0,
  250. decimals: 2,
  251. icon: "el-icon-s-cooperation"
  252. // href:'https://avuejs.com',
  253. // target: "_blank"
  254. },
  255. {
  256. // click: function(item) {
  257. // // alert(JSON.stringify(item));
  258. // },
  259. title: "保险总额同比(%)",
  260. count: 0,
  261. decimals: 2,
  262. icon: "el-icon-notebook-1"
  263. // href:'https://avuejs.com',
  264. // target: "_blank"
  265. },
  266. {
  267. // click: function(item) {
  268. // // alert(JSON.stringify(item));
  269. // },
  270. title: "人均保险",
  271. count: 0,
  272. decimals: 2,
  273. icon: "el-icon-s-custom"
  274. // href:'https://avuejs.com',
  275. // target: "_blank"
  276. },
  277. {
  278. // click: function(item) {
  279. // // alert(JSON.stringify(item));
  280. // },
  281. title: "人均保险同比(%)",
  282. count: 0,
  283. icon: "el-icon-notebook-2"
  284. // href:'https://avuejs.com',
  285. // target: "_blank"
  286. }
  287. ]
  288. }
  289. };
  290. },
  291. created() {
  292. this.isHeight.height = window.innerHeight - 165 + "px";
  293. this.getWorkDicts("month").then(res => {
  294. this.moonList = res.data.data;
  295. });
  296. },
  297. mounted() {
  298. this.getsalaryStatistics();
  299. this.getsalaryData();
  300. this.getsalaryDataChain();
  301. },
  302. components: {
  303. indexCard,
  304. butCard
  305. },
  306. computed: {
  307. ...mapGetters(["userInfo"])
  308. },
  309. methods: {
  310. getsalaryStatistics() {
  311. this.fsalaryList = [];
  312. this.studentNumberList = [];
  313. salaryStatistics({
  314. annual: this.annual,
  315. salaryType: this.salaryType
  316. })
  317. .then(res => {
  318. res.data.data.forEach(e => {
  319. this.fsalaryList.push(Number(e.fsalary));
  320. this.studentNumberList.push(Number(e.studentNumber));
  321. });
  322. })
  323. .finally(() => {
  324. this.commoDity();
  325. });
  326. },
  327. moonChange() {
  328. this.semester = null;
  329. this.getsalaryDataChain();
  330. },
  331. semesterChange() {
  332. this.moon = null;
  333. this.getsalaryDataChain();
  334. },
  335. getsalaryDataChain() {
  336. this.yearList = [];
  337. this.fsalaryList2 = [];
  338. this.studentNumberList2 = [];
  339. salaryDataChain({
  340. annual: this.annual3,
  341. moon: this.moon,
  342. semester: this.semester
  343. })
  344. .then(res => {
  345. let data = res.data.data;
  346. for (let i = 5; i >= 0; i--) {
  347. this.yearList.push(Number(this.annual3) - i + "年");
  348. }
  349. this.fsalaryList2.push(Number(data.fsalary));
  350. this.fsalaryList2.push(Number(data.fsalaryOne));
  351. this.fsalaryList2.push(Number(data.fsalaryTwo));
  352. this.fsalaryList2.push(Number(data.fsalaryThree));
  353. this.fsalaryList2.push(Number(data.fsalaryFour));
  354. this.fsalaryList2.push(Number(data.fsalaryFive));
  355. this.studentNumberList2.push(Number(data.studentNumber));
  356. this.studentNumberList2.push(Number(data.studentNumberOne));
  357. this.studentNumberList2.push(Number(data.studentNumberTwo));
  358. this.studentNumberList2.push(Number(data.studentNumberThree));
  359. this.studentNumberList2.push(Number(data.studentNumberFour));
  360. this.studentNumberList2.push(Number(data.studentNumberFive));
  361. })
  362. .finally(() => {
  363. this.commoDity2();
  364. });
  365. },
  366. getsalaryData() {
  367. salaryData({
  368. annual: this.annual2,
  369. salaryType: this.salaryType2
  370. }).then(res => {
  371. let data = res.data.data;
  372. this.option.data.forEach(e => {
  373. if (e.title == "工资总额") {
  374. e.count = data.salaryRental;
  375. } else if (e.title == "年工资额增长率(%)") {
  376. e.count = data.annualWageGrowth;
  377. } else if (e.title == "人均工资") {
  378. e.count = data.averageWage;
  379. } else if (e.title == "年人均工资增长率(%)") {
  380. e.count = data.averageWageGrowthRate;
  381. } else if (e.title == "保险总额") {
  382. e.count = data.insuredSum;
  383. } else if (e.title == "保险总额同比(%)") {
  384. e.count = data.insuredSumYear;
  385. } else if (e.title == "人均保险") {
  386. e.count = data.insuredMean;
  387. } else if (e.title == "人均保险同比(%)") {
  388. e.count = data.insuredMeanYear;
  389. }
  390. });
  391. });
  392. },
  393. handleChange(val) {
  394. window.console.log(val);
  395. },
  396. commoDity() {
  397. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  398. let myChart = this.$echarts.init(document.getElementById("commoDity"));
  399. // 绘制图表
  400. myChart.setOption({
  401. tooltip: {
  402. trigger: "axis",
  403. axisPointer: {
  404. type: "shadow"
  405. }
  406. },
  407. legend: {
  408. data: ["工资", "人数"]
  409. },
  410. xAxis: {
  411. type: "category",
  412. data: [
  413. "一月",
  414. "二月",
  415. "三月",
  416. "四月",
  417. "五月",
  418. "六月",
  419. "七月",
  420. "八月",
  421. "九月",
  422. "十月",
  423. "十一月",
  424. "十二月"
  425. ]
  426. },
  427. grid: {
  428. left: "3%",
  429. right: "4%",
  430. bottom: "3%",
  431. containLabel: true
  432. },
  433. yAxis: {
  434. type: "value",
  435. axisLabel: {
  436. formatter: "{value} 元"
  437. }
  438. },
  439. series: [
  440. {
  441. data: this.fsalaryList,
  442. name: "工资",
  443. type: "bar"
  444. },
  445. {
  446. data: this.studentNumberList,
  447. name: "人数",
  448. type: "bar"
  449. }
  450. ]
  451. });
  452. },
  453. commoDity2() {
  454. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  455. let myChart = this.$echarts.init(document.getElementById("commoDity2"));
  456. // 绘制图表
  457. myChart.setOption({
  458. tooltip: {
  459. trigger: "axis",
  460. axisPointer: {
  461. type: "shadow"
  462. }
  463. },
  464. legend: {
  465. data: ["工资", "人数"]
  466. },
  467. xAxis: {
  468. type: "category",
  469. data: this.yearList,
  470. },
  471. grid: {
  472. left: "3%",
  473. right: "4%",
  474. bottom: "3%",
  475. containLabel: true
  476. },
  477. yAxis: {
  478. type: "value",
  479. axisLabel: {
  480. formatter: "{value} 元"
  481. }
  482. },
  483. series: [
  484. {
  485. data: this.fsalaryList2,
  486. name: "工资",
  487. type: "bar"
  488. },
  489. {
  490. data: this.studentNumberList2,
  491. name: "人数",
  492. type: "bar"
  493. }
  494. ]
  495. });
  496. }
  497. }
  498. };
  499. </script>
  500. <style lang="scss" scoped>
  501. .container {
  502. display: grid;
  503. grid-template-columns: repeat(auto-fill, 50%);
  504. grid-template-rows: 40% 30% 30%;
  505. .container-items {
  506. display: grid;
  507. grid-template-columns: repeat(auto-fill, 33.33%);
  508. grid-template-rows: repeat(auto-fill, 140%);
  509. align-items: center;
  510. }
  511. }
  512. //今日营业
  513. .operate {
  514. display: grid;
  515. grid-template-rows: repeat(auto-fill, 33.33%);
  516. .operate-item {
  517. display: flex;
  518. align-items: center;
  519. .item-text {
  520. display: flex;
  521. align-items: end;
  522. font-size: 14px;
  523. .item-point {
  524. line-height: 14px;
  525. width: 14px;
  526. height: 14px;
  527. border-radius: 2px;
  528. background: #ff7d13;
  529. margin-right: 4px;
  530. margin-bottom: 1px;
  531. }
  532. }
  533. p {
  534. font-size: 24px;
  535. line-height: 24px;
  536. margin: 0 4px !important;
  537. }
  538. }
  539. }
  540. </style>