staging.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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 v-if="swBlock" @click="shouwen('收文','003,012',1)">
  8. <u-badge style="z-index: 2;" :type="type" max="99" :value="shouwenNum" :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. <!--
  26. <u-grid-item @click="shouwen('其他处室发文','005',2)">
  27. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['005']" :offset="[-10,10]"
  28. :showZero="false" absolute></u-badge>
  29. <image src="/static/fwgl.png" mode="widthFix" style="width: 100rpx;"></image>
  30. <text class="grid-text">其他处室发文</text>
  31. </u-grid-item> -->
  32. </u-grid>
  33. </view>
  34. </view>
  35. <u-divider v-if="gwShow"></u-divider>
  36. <view v-if="rcbgShow" style="padding: 20rpx;">
  37. <view style="font-size: 38rpx;font-weight: bold;">日常办公</view>
  38. <view style="margin-top: 40rpx;">
  39. <u-grid :border="false" col="4">
  40. <!-- <u-grid-item v-if="ccbaBlock" @click="dailyWork('中层出差备案','006',1)">
  41. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['006']" :offset="[-10,10]"
  42. :showZero="false" absolute></u-badge>
  43. <image src="/static/ccba.png" mode="widthFix" style="width: 100rpx;"></image>
  44. <text class="grid-text">出差备案</text>
  45. </u-grid-item>
  46. <u-grid-item v-if="wcskBlock" @click="dailyWork('外出授课备案','007',2)">
  47. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['007']" :offset="[-10,10]"
  48. :showZero="false" absolute></u-badge>
  49. <image src="/static/skba.png" mode="widthFix" style="width: 100rpx;"></image>
  50. <text class="grid-text">授课备案</text>
  51. </u-grid-item> -->
  52. <u-grid-item v-if="qjBlock" @click="dailyWork('职工请 ( 休 ) 假申请','021',3)">
  53. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['021']" :offset="[-10,10]"
  54. :showZero="false" absolute></u-badge>
  55. <image src="/static/qingjia.png" mode="widthFix" style="width: 100rpx;"></image>
  56. <text class="grid-text">请假申请</text>
  57. </u-grid-item>
  58. <!-- <u-grid-item v-if="xxfbshBlock" @click="shouwen('信息发布审核','010',3)">
  59. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['010']" :offset="[-10,10]"
  60. :showZero="false" absolute></u-badge>
  61. <image src="/static/xxfbsh.png" mode="widthFix" style="width: 100rpx;"></image>
  62. <text class="grid-text">信息发布审核</text>
  63. </u-grid-item> -->
  64. <u-grid-item v-if="sqycBlock" @click="dailyWork('用车申请','015',4)">
  65. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['015']" :offset="[-10,10]"
  66. :showZero="false" absolute></u-badge>
  67. <image src="/static/usecar.png" mode="widthFix" style="width: 100rpx;"></image>
  68. <text class="grid-text">用车申请</text>
  69. </u-grid-item>
  70. <!-- <u-grid-item v-if="tbsqBlock" @click="dailyWork('调班申请','020',5)">
  71. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['020']" :offset="[-10,10]"
  72. :showZero="false" absolute></u-badge>
  73. <image src="/static/tiaoban.png" mode="widthFix" style="width: 100rpx;"></image>
  74. <text class="grid-text">调班申请 </text>
  75. </u-grid-item> -->
  76. <u-grid-item v-if="yzsqBlock" @click="dailyWork('用章申请','017',6)">
  77. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['017']" :offset="[-10,10]"
  78. :showZero="false" absolute></u-badge>
  79. <image src="/static/yongzhang.png" mode="widthFix" style="width: 99rpx;"></image>
  80. <text class="grid-text">用章申请 </text>
  81. </u-grid-item>
  82. <!-- <u-grid-item v-if="htyzBlock" @click="dailyWork('合同用章申请','018',7)">
  83. <u-badge style="z-index: 2;" :type="type" max="99" :value="numList['018']" :offset="[-10,10]"
  84. :showZero="false" absolute></u-badge>
  85. <image src="/static/htyongzhang.png" mode="widthFix" style="width: 99rpx;"></image>
  86. <text class="grid-text">合同用章申请 </text>
  87. </u-grid-item>
  88. <u-grid-item v-if="zbtjBlock" @click="weekly('周报')">
  89. <u-badge style="z-index: 2;" :type="type" max="99" :offset="[-10,10]" :showZero="false"
  90. absolute></u-badge>
  91. <image src="/static/weekly.png" mode="widthFix" style="width: 99rpx;"></image>
  92. <text class="grid-text">周报 </text>
  93. </u-grid-item>
  94. <u-grid-item v-if="dbsxBlock" @click="dailyWork('督办事项','016',8)">
  95. <u-badge style="z-index: 2;" :type="type" max="99" :value="totalValue" :offset="[-10,10]"
  96. :showZero="false" absolute></u-badge>
  97. <image src="/static/duban.png" mode="widthFix" style="width: 100rpx;"></image>
  98. <text class="grid-text">督办事项 </text>
  99. </u-grid-item> -->
  100. </u-grid>
  101. </view>
  102. <u-divider></u-divider>
  103. </view>
  104. <view v-if="qtyyShow" class="">
  105. <view style="padding:10rpx 20rpx;">
  106. <view style="font-size:38rpx;font-weight: bold;">其他应用</view>
  107. <view style="margin-top: 40rpx;">
  108. <u-grid :border="false" col="4">
  109. <u-grid-item v-if="kq != 0&&kqglShow" @click="kaoqin">
  110. <image src="/static/kqgl.png" mode="widthFix" style="width: 100rpx;"></image>
  111. <text class="grid-text">考勤管理</text>
  112. </u-grid-item>
  113. <u-grid-item v-if="zbglShow" @click="zhiban">
  114. <image src="/static/zhiban.png" mode="widthFix" style="width: 100rpx;"></image>
  115. <text class="grid-text">值班安排</text>
  116. </u-grid-item>
  117. </u-grid>
  118. </view>
  119. </view>
  120. </view>
  121. <!-- <u-divider></u-divider>
  122. <view style="padding: 20rpx;">
  123. <view style="font-size:38rpx;font-weight: bold;">值班安排</view>
  124. <view style="margin-top: 40rpx;">
  125. <u-grid :border="false" col="4">
  126. <u-grid-item @click="zhiban">
  127. <image src="/static/zhiban.png" mode="widthFix" style="width: 100rpx;"></image>
  128. <text class="grid-text">值班安排</text>
  129. </u-grid-item>
  130. </u-grid>
  131. </view>
  132. </view> -->
  133. </view>
  134. </template>
  135. <script>
  136. export default {
  137. data() {
  138. return {
  139. //待办相关
  140. db: {
  141. pageNum: 1,
  142. pageSize: 20,
  143. fkFlow: null,
  144. title: null,
  145. token: uni.getStorageSync('jtoken')
  146. },
  147. numList: {},
  148. type: "error",
  149. value: 100,
  150. num: 0,
  151. kq: false,
  152. gwShow: false,
  153. rcbgShow: false,
  154. fwBlock: false,
  155. swShow: false,
  156. fwShow: false,
  157. qjBlock: false,
  158. ccbaBlock: false,
  159. wcskBlock: false,
  160. xxfbshBlock: false,
  161. xslwspBlock: false,
  162. tbsqBlock: false,
  163. dbsxBlock: false,
  164. zbtjBlock: false,
  165. yzsqBlock: false,
  166. sqycBlock: false,
  167. htyzBlock: false,
  168. qtyyShow: false,
  169. kqglShow: false,
  170. zbglShow: false,
  171. totalValue: null,
  172. shouwenNum: null
  173. }
  174. },
  175. onLoad() {
  176. uni.$u.http.get('/getInfo').then(res => {
  177. console.log('res', res)
  178. res.permissions.filter((item) => {
  179. if (
  180. item == "lcqd:fw:start" ||
  181. item == "lcqd:sw:item" ||
  182. item == "*:*:*"
  183. ) {
  184. this.gwShow = true;
  185. }
  186. if (
  187. item == "lcqd:qj:start" ||
  188. item == "lcqd:ccba:start" ||
  189. item == "lcqd:wcsk:start" ||
  190. item == "lcqd:xxfbsh:start" ||
  191. item == "lcqd:xslwsp:start" ||
  192. item == "lcqd:tbsq:start" ||
  193. item == "lcqd:sqyc:start" ||
  194. item == "lcqd:dbsx:start" ||
  195. item == "lcqd:zbtj:start" ||
  196. item == "lcqd:yzsq:start" ||
  197. item == "lcqd:htyz:start" ||
  198. item == "*:*:*"
  199. ) {
  200. this.rcbgShow = true;
  201. }
  202. if (item == 'oa:attendance:index' || item == 'duty:dutyl:list' ||
  203. item == "*:*:*") {
  204. this.qtyyShow = true
  205. }
  206. if (item == 'oa:attendance:index' ||
  207. item == "*:*:*") {
  208. this.kqglShow = true
  209. }
  210. if (item == 'duty:dutyl:list' ||
  211. item == "*:*:*") {
  212. this.zbglShow = true
  213. }
  214. if (item == "lcqd:fw:start" ||
  215. item == "*:*:*") {
  216. this.fwBlock = true
  217. }
  218. if (item == 'lcqd:sw:item' ||
  219. item == "*:*:*") {
  220. this.swBlock = true
  221. }
  222. if (item == 'lcqd:qj:start' ||
  223. item == "*:*:*") {
  224. this.qjBlock = true
  225. }
  226. if (item == 'lcqd:ccba:start' ||
  227. item == "*:*:*") {
  228. this.ccbaBlock = true
  229. }
  230. if (item == 'lcqd:wcsk:start' ||
  231. item == "*:*:*") {
  232. this.wcskBlock = true
  233. }
  234. if (item == 'lcqd:xxfbsh:start' ||
  235. item == "*:*:*") {
  236. this.xxfbshBlock = true
  237. }
  238. if (item == 'lcqd:xslwsp:start' ||
  239. item == "*:*:*") {
  240. this.xslwspBlock = true
  241. }
  242. if (item == 'lcqd:tbsq:start' ||
  243. item == "*:*:*") {
  244. this.tbsqBlock = true
  245. }
  246. if (item == 'lcqd:dbsx:start' ||
  247. item == "*:*:*") {
  248. this.dbsxBlock = true
  249. }
  250. if (item == 'lcqd:sqyc:start' ||
  251. item == "*:*:*") {
  252. this.sqycBlock = true
  253. }
  254. if (item == 'lcqd:yzsq:start' ||
  255. item == "*:*:*") {
  256. this.yzsqBlock = true
  257. }
  258. if (item == 'lcqd:zbtj:start' ||
  259. item == "*:*:*") {
  260. this.zbtjBlock = true
  261. }
  262. if (item == 'lcqd:htyz:start' ||
  263. item == "*:*:*") {
  264. this.htyzBlock = true
  265. }
  266. });
  267. })
  268. this.needUpdateApp()
  269. },
  270. onShow() {
  271. this.shouwenNum = null
  272. this.kq = uni.getStorageSync('type')
  273. this.getdbNum()
  274. this.getUnreadEmail()
  275. // this.getdbTotal()
  276. console.log('75555555555')
  277. // uni.$off()
  278. uni.$on('query', (query) => {
  279. console.log('query', query)
  280. if (query.a == 'stag') {
  281. console.log('55555557')
  282. this.getdbNum()
  283. }
  284. })
  285. },
  286. watch: {
  287. 'num': {
  288. handler: function(v, o) {
  289. if (this.num > 0) {
  290. this.$forceUpdate()
  291. }
  292. },
  293. deep: true
  294. },
  295. },
  296. methods: {
  297. //升级
  298. needUpdateApp(i) {
  299. var _this = this;
  300. plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
  301. uni.showLoading({
  302. title: "检查中...",
  303. mask: true
  304. })
  305. uni.$u.http.post('/app/version/advance/' + wgtinfo.versionCode).then(res => {
  306. if (res.code == 200) {
  307. if (res.data != undefined) {
  308. uni.hideLoading()
  309. uni.showModal({
  310. title: "提示",
  311. content: "有新版本是否进行更新",
  312. success(qwe) {
  313. if (qwe.confirm) {
  314. _this.upgradeApp(getApp().globalData.updateUrl + res
  315. .data.url)
  316. }
  317. }
  318. })
  319. } else {
  320. uni.hideLoading()
  321. // uni.showToast({
  322. // title: "当前为最新版本",
  323. // icon: "none"
  324. // })
  325. }
  326. }
  327. }).catch(res => {
  328. uni.hideLoading()
  329. })
  330. })
  331. },
  332. upgradeApp(url) {
  333. uni.showLoading({
  334. title: '更新中……'
  335. });
  336. uni.downloadFile({
  337. url: url,
  338. success: downloadResult => {
  339. if (downloadResult.statusCode === 200) {
  340. try {
  341. var filePath = downloadResult.tempFilePath;
  342. var ext = filePath.substring(
  343. filePath.lastIndexOf('.') + 1
  344. );
  345. plus.runtime.install(
  346. downloadResult.tempFilePath, {},
  347. function() {
  348. uni.hideLoading()
  349. plus.runtime.restart();
  350. },
  351. function(e) {
  352. // console.log(e);
  353. }
  354. );
  355. } catch (e) {
  356. // console.log(e);
  357. }
  358. } else {
  359. uni.hideLoading()
  360. uni.showToast({
  361. title: "下载失败",
  362. icon: 'none'
  363. })
  364. }
  365. },
  366. fail: res => {
  367. }
  368. });
  369. },
  370. getdbTotal() {
  371. uni.$u.http.get('/offcial/supervision/dblist', {
  372. params: this.db
  373. }).then(res => {
  374. console.log('res', res)
  375. this.totalValue = res.total
  376. // uni.hideLoading()
  377. // this.dbList = [...this.dbList, ...res.rows]
  378. // if (res.total <= this.db.pageSize) {
  379. // this.statusList[0] = "nomore"
  380. // } else {
  381. // this.statusList[0] = "loadmore"
  382. // }
  383. // this.$forceUpdate()
  384. // this.dbTotal = Math.ceil(res.total / this.db.pageSize)
  385. })
  386. },
  387. // 周报
  388. weekly() {
  389. uni.navigateTo({
  390. url: "/pages/weekly/weekly"
  391. })
  392. },
  393. //收发文
  394. shouwen(v, i, t) {
  395. uni.navigateTo({
  396. url: `/pages/shouwen/shouwen?title=${v}&fkFlow=${i}&type=${t}`
  397. })
  398. },
  399. //考勤
  400. kaoqin() {
  401. uni.navigateTo({
  402. url: "/pages/kaoqin/kaoqin"
  403. })
  404. },
  405. // 值班
  406. zhiban() {
  407. uni.navigateTo({
  408. url: "/pages/zhibananpai/zhibananpai"
  409. })
  410. },
  411. //日常办公
  412. dailyWork(v, i, t) {
  413. uni.navigateTo({
  414. url: `/pages/dailyWork/dailyWork?title=${v}&fkFlow=${i}&type=${t}`
  415. })
  416. },
  417. //查询待办数量
  418. getdbNum() {
  419. let that = this
  420. uni.$u.http.get('/jflow/restful/DB_Todolist_Num?token=' + uni.getStorageSync('jtoken')).then(res => {
  421. if (res.code == 200) {
  422. this.num = 0
  423. this.numList = {}
  424. if (res.list.length > 0) {
  425. let qwe = 0
  426. for (let i in res.list) {
  427. if (res.list[i].FK_Flow != '008' & res.list[i].FK_Flow != '016') {
  428. qwe = res.list[i].Total + qwe
  429. this.numList[res.list[i].FK_Flow] = res.list[i].Total
  430. this.num++
  431. }
  432. console.log('565', this.numList['003'])
  433. if (this.numList['003'] != null && this.numList['012'] != null && this.numList[
  434. '003'] != undefined && this.numList['012']) {
  435. this.shouwenNum = this.numList['003'] + this.numList['012']
  436. } else if (this.numList['003'] != null && this.numList['003'] != undefined) {
  437. this.shouwenNum = this.numList['003']
  438. } else if (this.numList['012'] != null && this.numList['012'] != undefined) {
  439. this.shouwenNum = this.numList['012']
  440. }
  441. console.log('qwe', qwe)
  442. console.log('total', that.totalValue)
  443. if (qwe == '0') {
  444. qwe = that.totalValue
  445. } else {
  446. qwe = qwe + that.totalValue
  447. }
  448. console.log('qwe', qwe)
  449. if (i == res.list.length - 1) {
  450. this.$forceUpdate()
  451. uni.setTabBarBadge({ //显示数字
  452. index: 0, //tabbar下标
  453. text: '' + qwe + '' //数字
  454. })
  455. }
  456. }
  457. } else {
  458. this.$forceUpdate()
  459. uni.removeTabBarBadge({ //显示数字
  460. index: 0, //tabbar下标
  461. })
  462. }
  463. console.log('this。', this.numList)
  464. }
  465. })
  466. },
  467. //获取未读邮件
  468. getUnreadEmail() {
  469. uni.$u.http.get('/oa/mail/count/unread').then(res => {
  470. if (res == 0) {
  471. this.$forceUpdate()
  472. uni.removeTabBarBadge({ //显示数字
  473. index: 1, //tabbar下标
  474. })
  475. } else {
  476. this.$forceUpdate()
  477. uni.setTabBarBadge({ //显示数字
  478. index: 1, //tabbar下标
  479. text: '' + res + '' //数字
  480. })
  481. }
  482. })
  483. },
  484. }
  485. }
  486. </script>
  487. <style lang="scss" scoped>
  488. .grid-text {
  489. font-size: 28rpx;
  490. color: #606266;
  491. padding: 10rpx 0 20rpx 0rpx;
  492. /* #ifndef APP-PLUS */
  493. box-sizing: border-box;
  494. /* #endif */
  495. }
  496. ::v-deep .u-badge {
  497. width: 36rpx;
  498. height: 36rpx;
  499. display: flex;
  500. font-size: 28rpx;
  501. align-items: center;
  502. justify-content: center;
  503. // font-weight: bold;
  504. }
  505. </style>