homePage.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <view class="headerView">
  3. <u-navbar title="首页" v-show="false"></u-navbar>
  4. <!-- 头部 -->
  5. <view class="header">
  6. <view class="main">
  7. <view class="title">
  8. <view class="name" @click="changeShow()">
  9. <view class="text">
  10. 你好,{{userInfo.name}}!
  11. </view>
  12. <view class="icon">
  13. <u-icon name='arrow-down' color="#fff" size="28"></u-icon>
  14. </view>
  15. </view>
  16. <view class="options" v-if="show==true" >
  17. <!-- <view @click="changeShow()">切换身份</view> -->
  18. <view @click="logout()">退出账号</view>
  19. </view>
  20. <view class="qr-code" v-if="false">
  21. <!-- <img src="@/assets/img/riLine-qr-scan-line@1x.png" alt=""> -->
  22. <u-icon name="scan" size="48" color="#fff"></u-icon>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 宫格 -->
  28. <view class="gird" >
  29. <!-- 公告 -->
  30. <view class="notice" >
  31. <ujp-notice-bar mode="horizontal"
  32. bg-color="#6290f7" color="#fff"
  33. :list="['库存PDA设备将于2023年4月1日升级维护']"></ujp-notice-bar>
  34. <!-- <u-icon name="volume-up-fill" size="40" color="#fff"></u-icon>
  35. <text></text> -->
  36. </view>
  37. <template v-if="role('3')">
  38. <view class="item" @click="gotoUrl('pages/projectDepartment/exportProcess/exportProcess')">
  39. <view class="title">
  40. <u-badge type="error" :count="badgeexportProcess"></u-badge>出库审核
  41. </view>
  42. <view class="hint">
  43. 审批出库申请单据
  44. </view>
  45. <view class="img">
  46. <img src="@/assets/img/projectGird2.png" alt="">
  47. </view>
  48. </view>
  49. </template>
  50. <template v-if="role('2')">
  51. <view class="item" @click="gotoUrl('pages/projectDepartment/exportApplication/exportApplication')">
  52. <view class="title">
  53. 出库申请
  54. </view>
  55. <view class="hint">
  56. 提交出库申请单据
  57. </view>
  58. <view class="img">
  59. <img src="@/assets/img/projectGird1.png" alt="">
  60. </view>
  61. </view>
  62. <view class="item" @click="gotoUrl('pages/projectDepartment/exportReturn/exportReturn')">
  63. <view class="title">
  64. 设备归还
  65. </view>
  66. <view class="hint">
  67. 提交设备归还单据
  68. </view>
  69. <view class="img">
  70. <img src="@/assets/img/projectGird3.png" alt="">
  71. </view>
  72. </view>
  73. </template>
  74. <view class="item" @click="gotoUrl('pages/otherFunctions/equipmentRetrieval/equipmentRetrieval')">
  75. <view class="title">
  76. 设备检索
  77. </view>
  78. <view class="hint">
  79. 库存物品信息检索
  80. </view>
  81. <view class="img">
  82. <img src="@/assets/img/projectGird4.png" alt="">
  83. </view>
  84. </view>
  85. <template v-if="role('1')">
  86. <view class="item" @click="gotoUrl('pages/storeManagement/equipmentDelivery/equipmentDelivery')">
  87. <view class="title">
  88. 设备出库
  89. </view>
  90. <view class="hint">
  91. 申请物品登记核准出库
  92. </view>
  93. <view class="img">
  94. <img src="@/assets/img/girdH1.png" alt="">
  95. </view>
  96. </view>
  97. <view class="item" @click="gotoUrl('pages/storeManagement/equipmentEnter/equipmentEnter')">
  98. <view class="title">
  99. 设备入库
  100. </view>
  101. <view class="hint">
  102. 申购采购收货入库登记
  103. </view>
  104. <view class="img">
  105. <img src="@/assets/img/girdH2.png" alt="">
  106. </view>
  107. </view>
  108. <view class="item" @click="gotoUrl('pages/storeManagement/equipmentInspection/equipmentInspection')" >
  109. <view class="title">
  110. 设备巡检
  111. </view>
  112. <view class="hint">
  113. 当前物品计量库存盘点
  114. </view>
  115. <view class="img">
  116. <img src="@/assets/img/girdH3.png" alt="">
  117. </view>
  118. </view>
  119. </template>
  120. </view>
  121. <!-- 其他功能 -->
  122. <view class="other-functions" v-if="role('other')">
  123. <view class="title">
  124. 其他功能
  125. </view>
  126. <view class="function-gird">
  127. <view class="item">
  128. <img src="@/assets/img/riLine-file-add-line@1x.png" alt="">
  129. <text>新增巡检</text>
  130. </view>
  131. <view class="item">
  132. <img src="@/assets/img/riLine-printer-line@1x.png" alt="">
  133. <text>打印标签</text>
  134. </view>
  135. <view class="item">
  136. <img src="@/assets/img/riLine-spam-line@1x.png" alt="">
  137. <text>故障申报</text>
  138. </view>
  139. <view class="item">
  140. <img src="@/assets/img/riLine-arrow-left-right-line@1x.png" alt="">
  141. <text>设备移交</text>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </template>
  147. <script>
  148. import * as API from '@/apis/pagejs/index.js'
  149. import ujpNoticeBar from "@/pages/otherFunctions/components/u-notice-bar.vue"
  150. export default {
  151. data() {
  152. return {
  153. show:false,
  154. badgeexportProcess:0,
  155. userInfo:{
  156. name:""
  157. }
  158. }
  159. },
  160. components:{
  161. ujpNoticeBar
  162. },
  163. onLoad() {
  164. this.userInfo=this.carhelp.getPersonInfo()
  165. //this.getUserDepartmentList()
  166. this.getInfo()
  167. },
  168. onShow(){
  169. if(this.role("3")){
  170. API.outApproveList({
  171. pageIndex: 1,
  172. pageSize: 1,
  173. status: 0,
  174. }).then((res) => {
  175. this.badgeexportProcess=res.data.recordsTotal
  176. }).catch(error => {
  177. uni.showToast({
  178. title: error
  179. })
  180. })
  181. }
  182. },
  183. methods: {
  184. role(val){
  185. if(this.userInfo.type!=null&&this.userInfo.type!=undefined){
  186. var index=this.userInfo.type.split(',').indexOf(val)
  187. return index>-1
  188. }else{
  189. return false
  190. }
  191. },
  192. getInfo(){
  193. API.findByOpenId({
  194. openId: this.carhelp.getOpenId(),
  195. noerror:true,
  196. }).then((res) => {
  197. this.carhelp.setPersonInfo(res.data.regUser );
  198. this.userInfo=this.carhelp.getPersonInfo()
  199. }).catch(error => {
  200. uni.hideLoading();
  201. //this.getPhone()
  202. })
  203. },
  204. logout(){
  205. this.changeShow()
  206. uni.showModal({
  207. title: '提示',
  208. content: '确认是否退出?',
  209. success: res=> {
  210. if (res.confirm) {
  211. //付钱 改为组件
  212. this.logoutApi();
  213. } else if (res.cancel) {
  214. console.log('用户点击取消');
  215. }
  216. }
  217. });
  218. },
  219. logoutApi(){
  220. uni.showLoading({
  221. title: "加载中",
  222. mask: true,
  223. })
  224. var data = {
  225. };
  226. API.logout(data).then((res) => {
  227. this.carhelp.logoff();
  228. uni.redirectTo({
  229. url:"/pages/index/index"
  230. })
  231. }).catch(error => {
  232. uni.showToast({
  233. title: error
  234. })
  235. })
  236. },
  237. changeShow(){
  238. this.show=!this.show
  239. }
  240. }
  241. }
  242. </script>
  243. <style >
  244. page{
  245. background-color: rgba(1,122,255,1);
  246. padding-bottom: 100rpx;
  247. }
  248. </style>
  249. <style lang="scss" scoped>
  250. .options{
  251. width: 260rpx;
  252. line-height: 60rpx;
  253. //text-align: center;
  254. padding:8rpx 0px 8rpx 16rpx;
  255. background-color: #fff;
  256. color: rgba(65, 80, 88, 1);
  257. font-family: Microsoft Yahei;
  258. position: absolute;
  259. top: 228rpx;
  260. border-radius: 1px;
  261. //right: 24rpx;
  262. box-shadow:5px 5px 10px gray;
  263. }
  264. .headerView{
  265. //background:linear-gradient(180deg, rgba(0,45,194,1) 0%,rgba(0,59,254,1) 49%,rgba(1,122,255,1) 100%);
  266. background-color: rgba(1,122,255,1);
  267. }
  268. page{
  269. background-color: rgba(1,122,255,1);
  270. padding-bottom: 100rpx;
  271. }
  272. // 头部
  273. .header{
  274. width: 100%;
  275. height: 289px;
  276. background:linear-gradient(180deg, rgba(0,45,194,1) 0%,rgba(0,59,254,1) 49%,rgba(1,122,255,1) 100%);
  277. padding: 0 40rpx;
  278. .main{
  279. width: 100%;
  280. height: 100%;
  281. background: url(@/assets/img/background.png) no-repeat;
  282. background-position: top -70rpx right -50rpx;
  283. position: relative;
  284. background-position-y: 20px;
  285. padding-top: 20rpx;
  286. }
  287. .title{
  288. //margin-top: 60px;
  289. padding-top: 60px;
  290. display: flex;
  291. justify-content: space-between;
  292. align-items: center;
  293. color: rgba(255, 255, 255, 1);
  294. line-height: 88rpx;
  295. .name{
  296. display: flex;
  297. font-size: 40rpx;
  298. }
  299. .qr-code{
  300. display: flex;
  301. }
  302. }
  303. }
  304. // 宫格
  305. .gird{
  306. // 公告
  307. .notice{
  308. overflow: hidden;
  309. width: 100%;
  310. display: flex;
  311. align-items: center;
  312. background-color: #6290f7;
  313. color: rgba(255, 255, 255, 1);
  314. font-weight: bold;
  315. border-radius: 8px;
  316. height: 80rpx;
  317. line-height: 80rpx;
  318. padding: 0 24rpx;
  319. // position: absolute;
  320. bottom: 260rpx;
  321. left: 0;
  322. right: 0;
  323. margin-bottom: 40rpx;
  324. text{
  325. font-size: 28rpx;
  326. width: 542px;
  327. margin-left: 16rpx;
  328. white-space: nowrap;
  329. overflow: hidden;
  330. text-overflow: ellipsis;
  331. }
  332. }
  333. padding: 0 40rpx;
  334. display: flex;
  335. justify-content: space-between;
  336. flex-wrap: wrap;
  337. margin-top: -124rpx;
  338. .item{
  339. width: 720rpx;
  340. height: 100px;
  341. background-color: rgba(255, 255, 255, 1);
  342. border-radius: 8px;
  343. padding: 32rpx 24rpx;
  344. position: relative;
  345. margin-bottom: 30rpx;
  346. .title{
  347. color: rgba(16, 16, 16, 1);
  348. font-size: 44rpx;
  349. margin-bottom: 8rpx;
  350. font-family: 'Alibaba-PuHuiTi-Regular';
  351. }
  352. .hint{
  353. color: rgba(106, 121, 142, 1);
  354. font-size: 32rpx;
  355. margin-bottom: 44rpx;
  356. }
  357. .img{
  358. width: 75px;
  359. height: 75px;
  360. position: absolute;
  361. right: 24rpx;
  362. bottom: 24rpx;
  363. img{
  364. width: 100%;
  365. height: 100%;
  366. }
  367. }
  368. }
  369. }
  370. // 其他功能
  371. .other-functions{
  372. padding: 0 40rpx;
  373. .title{
  374. color: rgba(255, 255, 255, 1);
  375. font-size: 36rpx;
  376. margin-bottom: 16rpx;
  377. }
  378. .function-gird{
  379. display: flex;
  380. flex-wrap: wrap;
  381. justify-content: space-between;
  382. .item{
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. width: 320rpx;
  387. height: 80rpx;
  388. line-height: 80rpx;
  389. margin-bottom: 24rpx;
  390. color: rgba(255, 255, 255, 1);
  391. border-radius: 8px;
  392. background-color: rgba(255, 255, 255, 0.25);
  393. text-align: center;
  394. border: 1px solid rgba(255, 255, 255, 0.35);
  395. img{
  396. width: 32rpx;
  397. height: 32rpx;
  398. margin-right: 8rpx;
  399. }
  400. }
  401. }
  402. }
  403. </style>