staging.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view style="background-color: #fff;">
  3. <view v-if="gwShow" style="padding: 20rpx;">
  4. <view style="font-size: 38rpx;font-weight: 600;">公文办理</view>
  5. <view style="margin-top: 40rpx;">
  6. <u-grid :border="false" col="4">
  7. <u-grid-item @click="shouwen('收文','003',1)">
  8. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['003']" :offset="[-10,10]"
  9. :showZero="false" absolute></u-badge>
  10. <image src="/static/swgl.png" mode="widthFix" style="width: 100rpx;"></image>
  11. <text class="grid-text">收文</text>
  12. </u-grid-item>
  13. <u-grid-item v-if="fwBlock" @click="shouwen('发文','002',2)">
  14. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['002']" :offset="[-10,10]"
  15. :showZero="false" absolute></u-badge>
  16. <image src="/static/fwgl.png" mode="widthFix" style="width: 100rpx;"></image>
  17. <text class="grid-text">发文</text>
  18. </u-grid-item>
  19. <!-- <u-grid-item @click="shouwen('其他处室收文','012',1)">
  20. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['012']" :offset="[-10,10]"
  21. :showZero="false" absolute></u-badge>
  22. <image src="/static/swgl.png" mode="widthFix" style="width: 100rpx;"></image>
  23. <text class="grid-text">其他处室收文</text>
  24. </u-grid-item>
  25. <u-grid-item @click="shouwen('其他处室发文','005',2)">
  26. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['005']" :offset="[-10,10]"
  27. :showZero="false" absolute></u-badge>
  28. <image src="/static/fwgl.png" mode="widthFix" style="width: 100rpx;"></image>
  29. <text class="grid-text">其他处室发文</text>
  30. </u-grid-item> -->
  31. </u-grid>
  32. </view>
  33. </view>
  34. <u-divider v-if="gwShow"></u-divider>
  35. <view v-if="rcbgShow" style="padding: 20rpx;">
  36. <view style="font-size: 38rpx;font-weight: bold;">日常办公</view>
  37. <view style="margin-top: 40rpx;">
  38. <u-grid :border="false" col="4">
  39. <u-grid-item v-if="ccbaBlock" @click="dailyWork('中层出差备案','006',1)">
  40. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['006']" :offset="[-10,10]"
  41. :showZero="false" absolute></u-badge>
  42. <image src="/static/ccba.png" mode="widthFix" style="width: 100rpx;"></image>
  43. <text class="grid-text">出差备案</text>
  44. </u-grid-item>
  45. <u-grid-item v-if="wcskBlock" @click="dailyWork('外出授课备案','007',2)">
  46. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['007']" :offset="[-10,10]"
  47. :showZero="false" absolute></u-badge>
  48. <image src="/static/skba.png" mode="widthFix" style="width: 100rpx;"></image>
  49. <text class="grid-text">授课备案</text>
  50. </u-grid-item>
  51. <u-grid-item v-if="qjBlock" @click="dailyWork('职工请 ( 休 ) 假申请','009',3)">
  52. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['009']" :offset="[-10,10]"
  53. :showZero="false" absolute></u-badge>
  54. <image src="/static/qingjia.png" mode="widthFix" style="width: 100rpx;"></image>
  55. <text class="grid-text">请假申请</text>
  56. </u-grid-item>
  57. <u-grid-item v-if="xxfbshBlock" @click="shouwen('信息发布审核','010',3)">
  58. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['010']" :offset="[-10,10]"
  59. :showZero="false" absolute></u-badge>
  60. <image src="/static/xxfbsh.png" mode="widthFix" style="width: 100rpx;"></image>
  61. <text class="grid-text">信息发布审核</text>
  62. </u-grid-item>
  63. <u-grid-item v-if="sqycBlock" @click="dailyWork('用车申请','015',4)">
  64. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['015']" :offset="[-10,10]"
  65. :showZero="false" absolute></u-badge>
  66. <image src="/static/usecar.png" mode="widthFix" style="width: 100rpx;"></image>
  67. <text class="grid-text">用车申请</text>
  68. </u-grid-item>
  69. <u-grid-item v-if="tbsqBlock" @click="dailyWork('调班申请','020',5)">
  70. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['020']" :offset="[-10,10]"
  71. :showZero="false" absolute></u-badge>
  72. <image src="/static/tiaoban.png" mode="widthFix" style="width: 100rpx;"></image>
  73. <text class="grid-text">调班申请 </text>
  74. </u-grid-item>
  75. <u-grid-item v-if="yzsqBlock" @click="dailyWork('用章申请','017',6)">
  76. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['017']" :offset="[-10,10]"
  77. :showZero="false" absolute></u-badge>
  78. <image src="/static/yongzhang.png" mode="widthFix" style="width: 99rpx;"></image>
  79. <text class="grid-text">用章申请 </text>
  80. </u-grid-item>
  81. <u-grid-item v-if="htyzBlock" @click="dailyWork('合同用章申请','018',7)">
  82. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['018']" :offset="[-10,10]"
  83. :showZero="false" absolute></u-badge>
  84. <image src="/static/htyongzhang.png" mode="widthFix" style="width: 99rpx;"></image>
  85. <text class="grid-text">合同用章申请 </text>
  86. </u-grid-item>
  87. <u-grid-item v-if="zbtjBlock" @click="weekly('周报')">
  88. <u-badge style="z-index: 2;" :type="type" max="99" :offset="[-10,10]" :showZero="false"
  89. absolute></u-badge>
  90. <image src="/static/weekly.png" mode="widthFix" style="width: 99rpx;"></image>
  91. <text class="grid-text">周报 </text>
  92. </u-grid-item>
  93. <u-grid-item v-if="dbsxBlock" @click="dailyWork('督办事项','016',8)">
  94. <u-badge style="z-index: 2;" :type="type" max="99" :value="totalValue" :offset="[-10,10]"
  95. :showZero="false" absolute></u-badge>
  96. <image src="/static/duban.png" mode="widthFix" style="width: 100rpx;"></image>
  97. <text class="grid-text">督办事项 </text>
  98. </u-grid-item>
  99. </u-grid>
  100. </view>
  101. <u-divider></u-divider>
  102. </view>
  103. <view v-if="qtyyShow" class="">
  104. <view style="padding:10rpx 20rpx;">
  105. <view style="font-size:38rpx;font-weight: bold;">其他应用</view>
  106. <view style="margin-top: 40rpx;">
  107. <u-grid :border="false" col="4">
  108. <u-grid-item v-if="kq != 0&&kqglShow" @click="kaoqin">
  109. <image src="/static/kqgl.png" mode="widthFix" style="width: 100rpx;"></image>
  110. <text class="grid-text">考勤管理</text>
  111. </u-grid-item>
  112. <u-grid-item v-if="zbglShow" @click="zhiban">
  113. <image src="/static/zhiban.png" mode="widthFix" style="width: 100rpx;"></image>
  114. <text class="grid-text">值班安排</text>
  115. </u-grid-item>
  116. </u-grid>
  117. </view>
  118. </view>
  119. </view>
  120. <!-- <u-divider></u-divider>
  121. <view style="padding: 20rpx;">
  122. <view style="font-size:38rpx;font-weight: bold;">值班安排</view>
  123. <view style="margin-top: 40rpx;">
  124. <u-grid :border="false" col="4">
  125. <u-grid-item @click="zhiban">
  126. <image src="/static/zhiban.png" mode="widthFix" style="width: 100rpx;"></image>
  127. <text class="grid-text">值班安排</text>
  128. </u-grid-item>
  129. </u-grid>
  130. </view>
  131. </view> -->
  132. </view>
  133. </template>
  134. <script>
  135. export default {
  136. data() {
  137. return {
  138. //待办相关
  139. db: {
  140. pageNum: 1,
  141. pageSize: 20,
  142. fkFlow: null,
  143. title: null,
  144. token: uni.getStorageSync('jtoken')
  145. },
  146. numList: {},
  147. type: "error",
  148. value: 100,
  149. num: 0,
  150. kq: false,
  151. gwShow: false,
  152. rcbgShow: false,
  153. fwBlock: false,
  154. qjBlock: false,
  155. ccbaBlock: false,
  156. wcskBlock: false,
  157. xxfbshBlock: false,
  158. xslwspBlock: false,
  159. tbsqBlock: false,
  160. dbsxBlock: false,
  161. zbtjBlock: false,
  162. yzsqBlock: false,
  163. sqycBlock: false,
  164. htyzBlock: false,
  165. qtyyShow: false,
  166. kqglShow: false,
  167. zbglShow: false,
  168. totalValue: null
  169. }
  170. },
  171. onLoad() {
  172. uni.$u.http.get('/getInfo').then(res => {
  173. console.log('res', res)
  174. res.permissions.filter((item) => {
  175. if (
  176. item == "lcqd:fw:start" ||
  177. item == "lcqd:sw:start" ||
  178. item == "*:*:*"
  179. ) {
  180. this.gwShow = true;
  181. }
  182. if (
  183. item == "lcqd:qj:start" ||
  184. item == "lcqd:ccba:start" ||
  185. item == "lcqd:wcsk:start" ||
  186. item == "lcqd:xxfbsh:start" ||
  187. item == "lcqd:xslwsp:start" ||
  188. item == "lcqd:tbsq:start" ||
  189. item == "lcqd:sqyc:start" ||
  190. item == "lcqd:dbsx:start" ||
  191. item == "lcqd:zbtj:start" ||
  192. item == "lcqd:yzsq:start" ||
  193. item == "lcqd:htyz:start" ||
  194. item == "*:*:*"
  195. ) {
  196. this.rcbgShow = true;
  197. }
  198. if (item == 'oa:attendance:index' || item == 'duty:dutyl:list' ||
  199. item == "*:*:*") {
  200. this.qtyyShow = true
  201. }
  202. if (item == 'oa:attendance:index' ||
  203. item == "*:*:*") {
  204. this.kqglShow = true
  205. }
  206. if (item == 'duty:dutyl:list' ||
  207. item == "*:*:*") {
  208. this.zbglShow = true
  209. }
  210. if (item == "lcqd:fw:start" ||
  211. item == "*:*:*") {
  212. this.fwBlock = true
  213. }
  214. if (item == 'lcqd:sw:start' ||
  215. item == "*:*:*") {
  216. this.swBlock = true
  217. }
  218. if (item == 'lcqd:qj:start' ||
  219. item == "*:*:*") {
  220. this.qjBlock = true
  221. }
  222. if (item == 'lcqd:ccba:start' ||
  223. item == "*:*:*") {
  224. this.ccbaBlock = true
  225. }
  226. if (item == 'lcqd:wcsk:start' ||
  227. item == "*:*:*") {
  228. this.wcskBlock = true
  229. }
  230. if (item == 'lcqd:xxfbsh:start' ||
  231. item == "*:*:*") {
  232. this.xxfbshBlock = true
  233. }
  234. if (item == 'lcqd:xslwsp:start' ||
  235. item == "*:*:*") {
  236. this.xslwspBlock = true
  237. }
  238. if (item == 'lcqd:tbsq:start' ||
  239. item == "*:*:*") {
  240. this.tbsqBlock = true
  241. }
  242. if (item == 'lcqd:dbsx:start' ||
  243. item == "*:*:*") {
  244. this.dbsxBlock = true
  245. }
  246. if (item == 'lcqd:sqyc:start' ||
  247. item == "*:*:*") {
  248. this.sqycBlock = true
  249. }
  250. if (item == 'lcqd:yzsq:start' ||
  251. item == "*:*:*") {
  252. this.yzsqBlock = true
  253. }
  254. if (item == 'lcqd:zbtj:start' ||
  255. item == "*:*:*") {
  256. this.zbtjBlock = true
  257. }
  258. if (item == 'lcqd:htyz:start' ||
  259. item == "*:*:*") {
  260. this.htyzBlock = true
  261. }
  262. });
  263. })
  264. },
  265. onShow() {
  266. this.kq = uni.getStorageSync('type')
  267. console.log('kq', this.kq)
  268. this.getdbNum()
  269. this.getUnreadEmail()
  270. this.getdbTotal()
  271. },
  272. watch: {
  273. 'num': {
  274. handler: function(v, o) {
  275. if (this.num > 0) {
  276. this.$forceUpdate()
  277. }
  278. },
  279. deep: true
  280. },
  281. },
  282. methods: {
  283. getdbTotal() {
  284. uni.$u.http.get('/offcial/supervision/dblist', {
  285. params: this.db
  286. }).then(res => {
  287. console.log('res', res)
  288. this.totalValue = res.total
  289. // uni.hideLoading()
  290. // this.dbList = [...this.dbList, ...res.rows]
  291. // if (res.total <= this.db.pageSize) {
  292. // this.statusList[0] = "nomore"
  293. // } else {
  294. // this.statusList[0] = "loadmore"
  295. // }
  296. // this.$forceUpdate()
  297. // this.dbTotal = Math.ceil(res.total / this.db.pageSize)
  298. })
  299. },
  300. // 周报
  301. weekly() {
  302. uni.navigateTo({
  303. url: "/pages/weekly/weekly"
  304. })
  305. },
  306. //收发文
  307. shouwen(v, i, t) {
  308. uni.navigateTo({
  309. url: `/pages/shouwen/shouwen?title=${v}&fkFlow=${i}&type=${t}`
  310. })
  311. },
  312. //考勤
  313. kaoqin() {
  314. uni.navigateTo({
  315. url: "/pages/kaoqin/kaoqin"
  316. })
  317. },
  318. // 值班
  319. zhiban() {
  320. uni.navigateTo({
  321. url: "/pages/zhibananpai/zhibananpai"
  322. })
  323. },
  324. //日常办公
  325. dailyWork(v, i, t) {
  326. uni.navigateTo({
  327. url: `/pages/dailyWork/dailyWork?title=${v}&fkFlow=${i}&type=${t}`
  328. })
  329. },
  330. //查询待办数量
  331. getdbNum() {
  332. let that = this
  333. uni.$u.http.get('/jflow/restful/DB_Todolist_Num?token=' + uni.getStorageSync('jtoken')).then(res => {
  334. if (res.code == 200) {
  335. this.num = 0
  336. this.numList = {}
  337. if (res.list.length > 0) {
  338. let qwe = 0
  339. for (let i in res.list) {
  340. if (res.list[i].FK_Flow != '008' & res.list[i].FK_Flow != '016') {
  341. qwe = res.list[i].Total + qwe
  342. this.numList[res.list[i].FK_Flow] = res.list[i].Total
  343. this.num++
  344. }
  345. console.log('qwe', qwe)
  346. console.log('total', that.totalValue)
  347. if (qwe == '0') {
  348. qwe = that.totalValue
  349. } else {
  350. qwe = qwe + that.totalValue
  351. }
  352. console.log('qwe', qwe)
  353. if (i == res.list.length - 1) {
  354. this.$forceUpdate()
  355. uni.setTabBarBadge({ //显示数字
  356. index: 1, //tabbar下标
  357. text: '' + qwe + '' //数字
  358. })
  359. }
  360. }
  361. } else {
  362. this.$forceUpdate()
  363. uni.removeTabBarBadge({ //显示数字
  364. index: 1, //tabbar下标
  365. })
  366. }
  367. }
  368. })
  369. },
  370. //获取未读邮件
  371. getUnreadEmail() {
  372. uni.$u.http.get('/oa/mail/count/unread').then(res => {
  373. if (res == 0) {
  374. uni.removeTabBarBadge({ //显示数字
  375. index: 2, //tabbar下标
  376. })
  377. } else {
  378. uni.setTabBarBadge({ //显示数字
  379. index: 2, //tabbar下标
  380. text: '' + res + '' //数字
  381. })
  382. }
  383. })
  384. },
  385. }
  386. }
  387. </script>
  388. <style lang="scss" scoped>
  389. .grid-text {
  390. font-size: 28rpx;
  391. color: #606266;
  392. padding: 10rpx 0 20rpx 0rpx;
  393. /* #ifndef APP-PLUS */
  394. box-sizing: border-box;
  395. /* #endif */
  396. }
  397. ::v-deep .u-badge {
  398. width: 36rpx;
  399. height: 36rpx;
  400. display: flex;
  401. font-size: 28rpx;
  402. align-items: center;
  403. justify-content: center;
  404. // font-weight: bold;
  405. }
  406. </style>