index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <script setup>
  2. import {
  3. ref
  4. } from "vue";
  5. import {
  6. onLoad,
  7. onPullDownRefresh,
  8. onReachBottom,
  9. onPageScroll,
  10. } from "@dcloudio/uni-app";
  11. import {
  12. getOverdueNum
  13. } from "@/api/work/overdue.js";
  14. import store from '@/store';
  15. // 图标
  16. import iconFundPlan from "@/static/func/func-fundPlan.svg";
  17. import iconFundUse from "@/static/func/func-fundUse.svg";
  18. import iconProjectProcess from "@/static/func/func-projectProcess.svg";
  19. import iconImportant from "@/static/func/func-important.svg";
  20. import iconPreFlow from "@/static/func/func-preFlow.svg";
  21. import iconIndustyRateValue from "@/static/func/func-industyRateValue.svg";
  22. import iconIndustyRateAmt from "@/static/func/func-industyRateAmt.svg";
  23. import iconAreaRate from "@/static/func/func-areaRate.svg";
  24. import iconYearRate from "@/static/func/func-yearRate.svg";
  25. import iconReport from "@/static/func/func-report.svg";
  26. let funType = ref(null)
  27. let title = ref(null)
  28. function goToPage(url, permissionCode, type) {
  29. if (permissionCode) {
  30. let havePermission = checkRoleById([permissionCode])
  31. if (!havePermission) return
  32. }
  33. uni.$u.route({
  34. url: url,
  35. params: {
  36. type: type || null
  37. }
  38. })
  39. }
  40. // 判断功能菜单权限
  41. const roles = store.getters && store.getters.permissions;
  42. let qyxxFalg = ref(false)
  43. let xmtzFalg = ref(false)
  44. let cbxmFalg = ref(false)
  45. let lxrFalg = ref(false)
  46. let zbFalg = ref(false)
  47. let ybFalg = ref(false)
  48. let ndjhFalg = ref(false)
  49. let wtqdFalg = ref(false)
  50. let wtlrFalg = ref(false)
  51. let wtgzFalg = ref(false)
  52. let yqtxFalg = ref(false)
  53. let yyqFalg = ref(false)
  54. function judgeFuncList() {
  55. if (roles.includes('7112')) {
  56. qyxxFalg.value = true
  57. }
  58. if (roles.includes('7111')) {
  59. xmtzFalg.value = true
  60. }
  61. if (roles.includes('7113')) {
  62. cbxmFalg.value = true
  63. }
  64. if (roles.includes('7114')) {
  65. lxrFalg.value = true
  66. }
  67. if (roles.includes('8112')) {
  68. zbFalg.value = true
  69. }
  70. if (roles.includes('8113')) {
  71. ybFalg.value = true
  72. }
  73. if (roles.includes('8111')) {
  74. ndjhFalg.value = true
  75. }
  76. if (roles.includes('7131')) {
  77. wtqdFalg.value = true
  78. }
  79. if (roles.includes('7132')) {
  80. wtlrFalg.value = true
  81. }
  82. if (roles.includes('7133')) {
  83. wtgzFalg.value = true
  84. }
  85. if (roles.includes('7134')) {
  86. yqtxFalg.value = true
  87. }
  88. if (roles.includes('7135')) {
  89. yyqFalg.value = true
  90. }
  91. // let tempList = JSON.parse(JSON.stringify(functionList.value))
  92. // for (let i in tempList) {
  93. // //如果父级都没权限 直接移除
  94. // if (!roles.includes(tempList[i].permissionCode)) {
  95. // tempList[i].ban = true
  96. // } else {
  97. // let funcListSon = tempList[i].funcList
  98. // for (let j in funcListSon) {
  99. // if (!roles.includes(funcListSon[j].permissionCode)) {
  100. // funcListSon[j].ban = true
  101. // }
  102. // }
  103. // }
  104. // }
  105. // let filterList = tempList.filter(item => {
  106. // return !item.ban
  107. // })
  108. // for (let i in filterList) {
  109. // let filterListSon = filterList[i].funcList.filter(item => {
  110. // return !item.ban
  111. // })
  112. // filterList[i].funcList = filterListSon
  113. // }
  114. // functionList.value = filterList
  115. }
  116. // 未读角标
  117. let overdueWill = ref(0);
  118. let overdued = ref(0);
  119. // 功能列表
  120. let funcType = ref({
  121. tjfx: [{
  122. name: "资金计划",
  123. icon: iconFundPlan,
  124. code: "7141",
  125. url: "/pages/countAnalysis/fundPlan/index",
  126. }, {
  127. name: "资金使用",
  128. icon: iconFundUse,
  129. code: "7142",
  130. url: "/pages/countAnalysis/fundUse/index"
  131. }, {
  132. name: "问题处理进度",
  133. longName: true,
  134. icon: iconProjectProcess,
  135. code: "7143",
  136. url: "/pages/countAnalysis/projectProcess/index"
  137. }, {
  138. name: "重大事项",
  139. icon: iconImportant,
  140. code: "7144",
  141. url: "/pages/important/index"
  142. }, {
  143. name: "前期手续",
  144. icon: iconPreFlow,
  145. code: "7145",
  146. url: "/pages/preFlow/index"
  147. }, {
  148. name: "行业占比分析-数量",
  149. longName: true,
  150. icon: iconIndustyRateValue,
  151. url: "/pages/analysis/index?type=industyRateValue",
  152. }, {
  153. name: "行业占比分析-金额",
  154. longName: true,
  155. icon: iconIndustyRateAmt,
  156. url: "/pages/analysis/index?type=industyRateAmt"
  157. }, {
  158. name: "区县占比分析",
  159. longName: true,
  160. icon: iconAreaRate,
  161. url: "/pages/analysis/index?type=areaRate"
  162. }, {
  163. name: "年度投资分析",
  164. longName: true,
  165. icon: iconYearRate,
  166. url: "/pages/analysis/index?type=yearRate"
  167. }, {
  168. name: "投资分析报告",
  169. icon: iconReport,
  170. url: "/pages/analysis/report/index"
  171. }]
  172. });
  173. // 渲染列表
  174. let showList = ref([])
  175. const judgeFuncListByFilter = () => {
  176. let funcList = funcType.value.tjfx;
  177. showList.value = funcList.filter(item => !item.code || roles.includes(item.code));
  178. }
  179. onLoad((e) => {
  180. funType.value = e.type
  181. if (e.type === 'jbxx') {
  182. title.value = '基本信息'
  183. } else if (e.type === 'jdgl') {
  184. title.value = '进度管理'
  185. } else if (e.type === 'wtdb') {
  186. title.value = '问题督办'
  187. getOverdueNum().then(res => {
  188. overdueWill.value = res.data.willOver ?? 0;
  189. overdued.value = res.data.isOver ?? 0;
  190. })
  191. } else if (e.type === 'tjfx') {
  192. title.value = '统计分析'
  193. judgeFuncListByFilter();
  194. }
  195. judgeFuncList(); //判断权限
  196. })
  197. </script>
  198. <template>
  199. <view class="content">
  200. <view class="top-box"></view>
  201. <page-title>{{title}}</page-title>
  202. <view class="btnlist-box" v-if="funType==='jbxx'">
  203. <view class="btn color1" @click="goToPage('/pages/enterpriseInfo/index')" v-if="qyxxFalg">
  204. <view class="btn-icon">
  205. <image src="@/static/func/qyxx-icon.svg" mode=""></image>
  206. </view>
  207. <view class="name">
  208. 企业信息
  209. </view>
  210. </view>
  211. <view class="btn color2" @click="goToPage('/pages/projectInfo/index',null,'all')" v-if="xmtzFalg">
  212. <view class="btn-icon">
  213. <image src="@/static/func/xmtz-icon.svg" mode=""></image>
  214. </view>
  215. <view class="name">
  216. 项目台账
  217. </view>
  218. </view>
  219. <view class="btn color3" @click="goToPage('/pages/cbProject/index')" v-if="cbxmFalg">
  220. <view class="btn-icon">
  221. <image src="@/static/func/cbxm-icon.svg" mode=""></image>
  222. </view>
  223. <view class="name">
  224. 储备项目
  225. </view>
  226. </view>
  227. <view class="btn color4" @click="goToPage('/pages/contact/index')" v-if="lxrFalg">
  228. <view class="btn-icon">
  229. <image src="@/static/func/lxr-icon.svg" mode=""></image>
  230. </view>
  231. <view class="name">
  232. 联系人
  233. </view>
  234. </view>
  235. <view class="btn intermediaryService" @click="goToPage('/pages/intermediaryService/search/index')">
  236. <view class="btn-icon">
  237. <image src="@/static/func/func-intermediaryService.svg" mode=""></image>
  238. </view>
  239. <view class="name">
  240. 中介服务库
  241. </view>
  242. </view>
  243. </view>
  244. <view class="btnlist-box" v-if="funType==='jdgl'">
  245. <view class="btn color1" @click="goToPage('/pages/weekly/index')" v-if="zbFalg">
  246. <view class="btn-icon">
  247. <image src="@/static/func/week-icon.svg" mode=""></image>
  248. </view>
  249. <view class="name">
  250. 周报
  251. </view>
  252. </view>
  253. <view class="btn color2" @click="goToPage('/pages/monthly/index')" v-if="ybFalg">
  254. <view class="btn-icon">
  255. <image src="@/static/func/month-icon.svg" mode=""></image>
  256. </view>
  257. <view class="name">
  258. 月报
  259. </view>
  260. </view>
  261. <view class="btn color4" @click="goToPage('/pages/yearly/index')" v-if="ndjhFalg">
  262. <view class="btn-icon">
  263. <image src="@/static/func/ndjh-icon.svg" mode=""></image>
  264. </view>
  265. <view class="name">
  266. 年度计划
  267. </view>
  268. </view>
  269. </view>
  270. <view class="btnlist-box" v-if="funType==='wtdb'">
  271. <view class="btn color1" @click="goToPage('/pages/oversee/index')" v-if="wtqdFalg">
  272. <view class="btn-icon">
  273. <image src="@/static/func/wtqd-icon.svg" mode=""></image>
  274. </view>
  275. <view class="name">
  276. 问题清单
  277. </view>
  278. </view>
  279. <view class="btn color5" @click="goToPage('/pages/questionInput/index')" v-if="wtlrFalg">
  280. <view class="btn-icon">
  281. <image src="@/static/func/wtlr-icon.svg" mode=""></image>
  282. </view>
  283. <view class="name">
  284. 问题录入
  285. </view>
  286. </view>
  287. <view class="btn color6" @click="goToPage('/pages/questionTrace/index')" v-if="wtgzFalg">
  288. <view class="btn-icon">
  289. <image src="@/static/func/wtgz-icon.svg" mode=""></image>
  290. </view>
  291. <view class="name">
  292. 问题跟踪
  293. </view>
  294. </view>
  295. <view class="btn color7" @click="goToPage('/pages/overdue/index')" v-if="yqtxFalg">
  296. <view class="btn-icon">
  297. <image src="@/static/func/yqtx-icon.svg" mode=""></image>
  298. </view>
  299. <view class="name">
  300. 预期提醒
  301. </view>
  302. <u-badge class="badge-num" type="error" max="99" :value="overdueWill"></u-badge>
  303. </view>
  304. <view class="btn color8" @click="goToPage('/pages/overdue/overdued/index')" v-if="yyqFalg">
  305. <view class="btn-icon">
  306. <image src="@/static/func/yyq-icon.svg" mode=""></image>
  307. </view>
  308. <view class="name">
  309. 已逾期
  310. </view>
  311. <u-badge class="badge-num" type="error" max="99" :value="overdued"></u-badge>
  312. </view>
  313. </view>
  314. <view class="btnlist-box" v-if="funType==='tjfx'">
  315. <view class="func-area">
  316. <u-grid :border="false" col="4">
  317. <u-grid-item v-for="(item,index) in showList" :key="index">
  318. <view class="func-item" @click="goToPage(item.url)">
  319. <view class="func-item-icon">
  320. <image :src="item.icon"></image>
  321. </view>
  322. <view class="func-item-name" :class="item.longName ? 'func-item-shortGap':''">
  323. {{item.name}}
  324. </view>
  325. </view>
  326. </u-grid-item>
  327. </u-grid>
  328. </view>
  329. </view>
  330. </view>
  331. </template>
  332. <style scoped lang="scss">
  333. .func-area {
  334. width: 100%;
  335. min-height: 300rpx;
  336. padding: 0 16rpx;
  337. box-sizing: border-box;
  338. }
  339. .func-item {
  340. width: 160rpx;
  341. height: 168rpx;
  342. margin-bottom: 16rpx;
  343. padding: 28rpx 0;
  344. box-sizing: border-box;
  345. background: #FFF;
  346. border-radius: 20rpx;
  347. .func-item-icon {
  348. width: 60rpx;
  349. height: 50rpx;
  350. margin: 0 auto 0;
  351. image {
  352. width: 100%;
  353. height: 100%;
  354. }
  355. }
  356. .func-item-name {
  357. width: 116rpx;
  358. margin: 26rpx auto 0;
  359. font-size: 24rpx;
  360. color: #343437;
  361. text-align: center;
  362. }
  363. .func-item-shortGap {
  364. margin: 16rpx auto 0;
  365. }
  366. }
  367. .color1 {
  368. background-color: #5773FF
  369. }
  370. .color2 {
  371. background-color: #14B890
  372. }
  373. .color3 {
  374. background-color: #744BF1
  375. }
  376. .color4 {
  377. background-color: #F79721
  378. }
  379. .color5 {
  380. background-color: #FC8181
  381. }
  382. .color6 {
  383. background-color: #8187FC
  384. }
  385. .color7 {
  386. background-color: #3ABF7A
  387. }
  388. .color8 {
  389. background-color: #E8B923
  390. }
  391. .industyRate-value {
  392. background: #22AD65;
  393. }
  394. .industyRate-amt {
  395. background: #FDAF4D;
  396. }
  397. .areaRate {
  398. background: #7073F0;
  399. }
  400. .yearRate {
  401. background: #DC5652;
  402. }
  403. .reportRate {
  404. background: #3B7CED;
  405. }
  406. .intermediaryService {
  407. background: #FC8181;
  408. }
  409. .content {
  410. padding-top: 100px;
  411. position: relative;
  412. width: 100%;
  413. height: 100%;
  414. background: #EAF1FF;
  415. }
  416. .btnlist-box {
  417. width: 100%;
  418. display: flex;
  419. flex-direction: column;
  420. align-items: center;
  421. margin-top: 50rpx;
  422. justify-content: flex-start;
  423. gap: 50rpx;
  424. .btn {
  425. position: relative;
  426. display: flex;
  427. justify-content: center;
  428. align-items: center;
  429. width: 416rpx;
  430. height: 116rpx;
  431. border-radius: 20rpx 20rpx 20rpx 20rpx;
  432. box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(12, 69, 167, 0.35);
  433. color: #FFFFFF;
  434. font-weight: 500;
  435. font-size: 36rpx;
  436. font-family: OPPOSans-M;
  437. .btn-icon {
  438. width: 90rpx;
  439. height: 88rpx;
  440. margin-right: 40rpx;
  441. image {
  442. width: 100%;
  443. height: 100%;
  444. }
  445. }
  446. .name {
  447. width: 180rpx;
  448. margin-right: 50rpx;
  449. }
  450. .badge-num {
  451. position: absolute;
  452. top: -5rpx;
  453. right: -15rpx;
  454. }
  455. }
  456. }
  457. </style>