index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <div>
  3. <el-row>
  4. <el-col :span="24">
  5. <basic-container v-if="permission.home_front">
  6. <avue-data-rotate :option="optionFront"></avue-data-rotate>
  7. </basic-container>
  8. <basic-container v-if="permission.home_quick_menu || permission.home_manage">
  9. <el-collapse v-model="activeNames" @change="handleChange">
  10. <div v-if="permission.home_quick_menu">
  11. <el-row v-for="(item1, index1) in menus" :key="item1.id">
  12. <el-collapse-item :title="item1.name" :name="index1" >
  13. <el-col :span="8" v-for="(item2, index2) in item1.children" :key="item2.id">
  14. <el-button type="primary" plain @click="$router.push({path: item2.path})">{{item2.name}}</el-button>
  15. </el-col>
  16. </el-collapse-item>
  17. </el-row>
  18. </div>
  19. <div v-if="permission.home_manage">
  20. <el-select v-model="selectOrgNo" filterable placeholder="請選擇" style="position: absolute;left: 400px;margin-top: 5px;" @change="selectDept">
  21. <el-option
  22. v-for="item in deptList"
  23. :key="item.orgNo"
  24. :label="item.deptName"
  25. :value="item.orgNo">
  26. </el-option>
  27. </el-select>
  28. <el-collapse-item title="每日、每周、每月待辦事項" :name="5">
  29. <el-col :span="8" >
  30. <avue-crud
  31. :option="optionDay"
  32. :data="dataDay"
  33. :page.sync="pageDay"
  34. v-model="form"
  35. ref="crud"
  36. >
  37. <template slot="status" slot-scope="{row, index}">
  38. <div align="center">
  39. <i v-if="row.checked > 0" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
  40. <i v-if="!row.checked > 0" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
  41. </div>
  42. </template>
  43. </avue-crud>
  44. </el-col>
  45. <el-col :span="8" >
  46. <avue-crud
  47. :option="optionWeek"
  48. :data="dataWeek"
  49. :page.sync="pageWeek"
  50. v-model="form"
  51. ref="crud"
  52. >
  53. <template slot="status" slot-scope="{row, index}">
  54. <div align="center">
  55. <i v-if="row.checked > 0" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
  56. <i v-if="!row.checked > 0" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
  57. </div>
  58. </template>
  59. </avue-crud>
  60. </el-col>
  61. <el-col :span="8" >
  62. <avue-crud
  63. :option="optionMonth"
  64. :data="dataMonth"
  65. :page.sync="pageMonth"
  66. v-model="form"
  67. ref="crud"
  68. >
  69. <template slot="status" slot-scope="{row, index}">
  70. <div align="center">
  71. <i v-if="row.checked > 0" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
  72. <i v-if="!row.checked > 0" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
  73. </div>
  74. </template>
  75. </avue-crud>
  76. </el-col>
  77. </el-collapse-item>
  78. </div>
  79. </el-collapse>
  80. </basic-container>
  81. <basic-container v-if="permission.home_backgr">
  82. <avue-data-rotate :option="optionBackgr"></avue-data-rotate>
  83. </basic-container>
  84. </el-col>
  85. </el-row>
  86. </div>
  87. </template>
  88. <script>
  89. import {mapGetters} from "vuex";
  90. import {getMyInitiated, getToBoReleased, getToBeConfirmed, getMyConfirmation} from "@/api/bank/home";
  91. import {getHomeCount, getReport} from "../../api/bank/home";
  92. import {getList} from "@/api/bank/checklist";
  93. import {getTopMenu, getRoutes} from '@/api/system/menu'
  94. import {getChildsDept, getDeptTree, getTree} from "../../api/system/dept";
  95. export default {
  96. name: "wel",
  97. data() {
  98. return {
  99. activeNames: [0,1,2,3,4,5],
  100. selectOrgNo: '',
  101. deptList: [],
  102. menus: [],
  103. initiatedCount: 0,
  104. releaseCount: 0,
  105. tobeconfirmCount: 0,
  106. confirmedCount: 0,
  107. optionFront: {
  108. span: 8,
  109. data: [
  110. {
  111. click: (item) => {
  112. this.$router.push({path: "/desk/initiated"})
  113. },
  114. count: 0,
  115. title: '我的發起',
  116. icon: 'el-icon-warning',
  117. color: '#409eff'
  118. }, {
  119. click: (item) => {
  120. this.$router.push({path: "/desk/tobeconfirm"})
  121. },
  122. count: '53%',
  123. title: '待處理',
  124. display: false,
  125. icon: 'el-icon-view',
  126. color: '#f39c12'
  127. }, {
  128. click: (item) => {
  129. this.$router.push({path: "/desk/confirmed"})
  130. },
  131. count: '0',
  132. title: '已處理',
  133. icon: 'el-icon-setting',
  134. color: '#5daf34'
  135. }
  136. ]
  137. },
  138. optionManage: {
  139. span: 8,
  140. data: [
  141. {
  142. click: (item) => {
  143. // this.$router.push({path: "/desk/initiated"})
  144. alert("待开发");
  145. },
  146. count: 0,
  147. title: '每日',
  148. icon: 'el-icon-warning',
  149. color: 'rgb(49, 180, 141)'
  150. }, {
  151. click: function (item) {
  152. // alert(JSON.stringify(item));
  153. alert("待开发");
  154. },
  155. count: '0',
  156. title: '每週',
  157. icon: 'el-icon-view',
  158. color: '#00a65a'
  159. }, {
  160. click: function (item) {
  161. // alert(JSON.stringify(item));
  162. alert("待开发");
  163. },
  164. count: '0',
  165. title: '每月',
  166. display: false,
  167. icon: 'el-icon-view',
  168. color: '#00a65a'
  169. }
  170. ]
  171. },
  172. optionBackgr: {
  173. span: 8,
  174. data: [
  175. /*{
  176. click: (item) => {
  177. this.$router.push({path: "/bank/checklist"})
  178. },
  179. count: '0/0',
  180. title: '每日',
  181. icon: 'el-icon-warning',
  182. color: 'rgb(49, 180, 141)'
  183. }, {
  184. click: (item) => {
  185. this.$router.push({path: "/bank/checklist"})
  186. },
  187. count: '0/0',
  188. title: '每週',
  189. icon: 'el-icon-view',
  190. color: '#00a65a'
  191. }, {
  192. click: (item) => {
  193. this.$router.push({path: "/bank/checklist"})
  194. },
  195. count: '0/0',
  196. title: '每月',
  197. display: false,
  198. icon: 'el-icon-view',
  199. color: '#00a65a'
  200. },*/
  201. {
  202. click: (item) => {
  203. this.$router.push({path: "/desk/tobeconfirm"})
  204. },
  205. count: '0',
  206. title: '待處理',
  207. icon: 'el-icon-setting',
  208. color: '#f39c12'
  209. },{
  210. click: (item) => {
  211. this.$router.push({path: "/desk/initiated"})
  212. },
  213. count: 0,
  214. title: '我的發起',
  215. icon: 'el-icon-warning',
  216. color: '#409eff'
  217. }, {
  218. click: (item) => {
  219. this.$router.push({path: "/desk/toberelease"})
  220. },
  221. count: '0',
  222. title: '待發佈',
  223. display: false,
  224. icon: 'el-icon-view',
  225. color: '#00a65a'
  226. }
  227. ]
  228. },
  229. form: {},
  230. dataDay: [],
  231. pageDay: {
  232. pageSize: 10,
  233. currentPage: 1,
  234. total: 0
  235. },
  236. optionDay: {
  237. card: true,
  238. menu: false,
  239. align: 'center',
  240. header: false,
  241. column: [
  242. {
  243. label: "每日核對項目",
  244. prop: "item",
  245. type: "select",
  246. dicUrl: "/api/blade-system/dict/dictionary?code=check_item",
  247. props:{
  248. label: "dictValue",
  249. value: "dictKey",
  250. },
  251. },
  252. {
  253. label: "區域/支行",
  254. prop: "deptName",
  255. },
  256. {
  257. label: "狀態",
  258. prop: "status",
  259. },
  260. {
  261. label: "最近核對時間",
  262. prop: "checkDate",
  263. type: "datetime",
  264. },
  265. ],
  266. },
  267. dataWeek:[],
  268. pageWeek: {
  269. pageSize: 10,
  270. currentPage: 1,
  271. total: 0
  272. },
  273. optionWeek: {
  274. card: true,
  275. menu: false,
  276. align: 'center',
  277. header: false,
  278. column: [
  279. {
  280. label: "每週核對項目",
  281. prop: "item",
  282. type: "select",
  283. dicUrl: "/api/blade-system/dict/dictionary?code=check_item",
  284. props:{
  285. label: "dictValue",
  286. value: "dictKey",
  287. },
  288. },
  289. {
  290. label: "區域/支行",
  291. prop: "deptName",
  292. },
  293. {
  294. label: "狀態",
  295. prop: "status",
  296. },
  297. {
  298. label: "最近核對時間",
  299. prop: "checkDate",
  300. type: "datetime",
  301. },
  302. ],
  303. },
  304. dataMonth: [],
  305. pageMonth: {
  306. pageSize: 10,
  307. currentPage: 1,
  308. total: 0
  309. },
  310. optionMonth: {
  311. card: true,
  312. menu: false,
  313. header: false,
  314. align: 'center',
  315. column: [
  316. {
  317. label: "每月核對項目",
  318. prop: "item",
  319. type: "select",
  320. overHidden: true,
  321. dicUrl: "/api/blade-system/dict/dictionary?code=check_item",
  322. props:{
  323. label: "dictValue",
  324. value: "dictKey",
  325. },
  326. },
  327. {
  328. label: "區域/支行",
  329. prop: "deptName",
  330. },
  331. {
  332. label: "狀態",
  333. prop: "status",
  334. },
  335. {
  336. label: "最近核對時間",
  337. prop: "checkDate",
  338. type: "datetime",
  339. },
  340. ],
  341. },
  342. };
  343. },
  344. computed: {
  345. ...mapGetters(["permission", "userInfo", "menuAll"]),
  346. },
  347. created() {
  348. getChildsDept().then(res => {
  349. let data = res.data.data;
  350. for (let i = 0; i < data.length; i++) {
  351. let item = data[i];
  352. if (item.orgNo.indexOf('999') == 0){
  353. data.splice(i,1);
  354. i--;
  355. }
  356. }
  357. this.deptList = data;
  358. if (data && data.length > 0){
  359. this.selectDept(data[0].orgNo)
  360. }
  361. });
  362. getMyInitiated().then(res => {
  363. const initiatedCount = res.data.data;
  364. this.optionFront.data[0].count = initiatedCount;
  365. this.optionBackgr.data[1].count = initiatedCount;
  366. })
  367. getToBoReleased().then(res => {
  368. const tobeReleaseCount = res.data.data;
  369. this.optionBackgr.data[2].count = tobeReleaseCount;
  370. });
  371. getToBeConfirmed().then(res => {
  372. const tobeConfirmedCount = res.data.data;
  373. this.optionFront.data[1].count = tobeConfirmedCount;
  374. this.optionBackgr.data[0].count = tobeConfirmedCount;
  375. });
  376. getMyConfirmation().then(res => {
  377. const confirmedCount = res.data.data;
  378. this.optionFront.data[2].count = confirmedCount;
  379. });
  380. },
  381. mounted() {
  382. if (this.menuAll.length > 0){
  383. this.getBusinessMenu();
  384. }else{
  385. getRoutes().then(res => {
  386. this.menuAll = res.data.data;
  387. this.getBusinessMenu();
  388. });
  389. }
  390. },
  391. methods: {
  392. selectDept(value){
  393. this.selectOrgNo = value;
  394. this.onLoadDay(this.pageDay)
  395. this.onLoadWeek(this.pageWeek)
  396. this.onLoadMonth(this.pageMonth)
  397. },
  398. getBusinessMenu() {
  399. for (let i = 0; i < this.menuAll.length; i++) {
  400. let item = this.menuAll[i];
  401. if (item.name == '業務管理') {
  402. this.menus = item.children;
  403. }
  404. }
  405. },
  406. handleChange(val) {
  407. },
  408. onLoadDay(page, params = {}){
  409. params.cycle = "day";
  410. params.orgNo = this.selectOrgNo;
  411. getReport(Object.assign(params, page)).then(res => {
  412. const data = res.data.data;
  413. this.dataDay = data;
  414. this.loading = false;
  415. // this.selectionClear();
  416. });
  417. /*getList(page.currentPage, page.pageSize, params).then(res => {
  418. const data = res.data.data;
  419. let list = data.records;
  420. for (let i = 0; i < list.length; i++) {
  421. let item = list[i];
  422. let status = false;
  423. if (item.isChecked == 1){
  424. let create = item.createTime.split(' ');
  425. let update = item.updateTime.split(' ');
  426. let time = update[1].split(':');
  427. if (create[0] == update[0] && time[0] < 21){
  428. status = true;
  429. }
  430. }
  431. item.status = status;
  432. }
  433. this.pageDay.total = data.total;
  434. this.dataDay = list;
  435. });*/
  436. },
  437. onLoadWeek(page, params = {}){
  438. params.cycle = "week";
  439. params.orgNo = this.selectOrgNo;
  440. getReport(Object.assign(params, page)).then(res => {
  441. const data = res.data.data;
  442. this.dataWeek = data;
  443. this.loading = false;
  444. // this.selectionClear();
  445. });
  446. /*getList(page.currentPage, page.pageSize, params).then(res => {
  447. const data = res.data.data;
  448. let list = data.records;
  449. for (let i = 0; i < list.length; i++) {
  450. let item = list[i];
  451. let status = false;
  452. if (item.isChecked == 1){
  453. let create = item.createTime.split(' ');
  454. let update = item.updateTime.split(' ');
  455. let time = update[1].split(':');
  456. if (create[0] == update[0] && time[0] < 21){
  457. status = true;
  458. }
  459. }
  460. item.status = status;
  461. }
  462. this.pageWeek.total = data.total;
  463. this.dataWeek = list;
  464. });*/
  465. },
  466. onLoadMonth(page, params = {}){
  467. params.cycle = "month";
  468. params.orgNo = this.selectOrgNo;
  469. getReport(Object.assign(params, page)).then(res => {
  470. const data = res.data.data;
  471. this.dataMonth = data;
  472. this.loading = false;
  473. // this.selectionClear();
  474. });
  475. },
  476. },
  477. };
  478. </script>
  479. <style scoped>
  480. >>> .el-font-size {
  481. font-size: 14px;
  482. }
  483. >>> .el-collapse-item__header{
  484. font-size: 25px;
  485. font-weight: bold;
  486. }
  487. >>> .el-collapse-item__wrap{
  488. margin: 15px;
  489. }
  490. >>> th, td{
  491. padding: 10px;
  492. margin: 10px;
  493. }
  494. </style>