homePage.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  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" v-if="false" >
  31. <u-notice-bar mode="horizontal"
  32. bg-color="#6290f7" color="#fff"
  33. :list="['库存PDA设备将于2023年4月1日升级维护']"></u-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. export default {
  150. data() {
  151. return {
  152. show:false,
  153. badgeexportProcess:0,
  154. userInfo:{
  155. name:""
  156. }
  157. }
  158. },
  159. onLoad() {
  160. this.userInfo=this.carhelp.getPersonInfo()
  161. //this.getUserDepartmentList()
  162. this.getInfo()
  163. },
  164. onShow(){
  165. if(this.role("3")){
  166. API.outApproveList({
  167. pageIndex: 1,
  168. pageSize: 1,
  169. status: 0,
  170. }).then((res) => {
  171. this.badgeexportProcess=res.data.recordsTotal
  172. }).catch(error => {
  173. uni.showToast({
  174. title: error
  175. })
  176. })
  177. }
  178. },
  179. methods: {
  180. role(val){
  181. if(this.userInfo.type!=null&&this.userInfo.type!=undefined){
  182. var index=this.userInfo.type.split(',').indexOf(val)
  183. return index>-1
  184. }else{
  185. return false
  186. }
  187. },
  188. getInfo(){
  189. API.findByOpenId({
  190. openId: this.carhelp.getOpenId(),
  191. noerror:true,
  192. }).then((res) => {
  193. this.carhelp.setPersonInfo(res.data.regUser );
  194. this.userInfo=this.carhelp.getPersonInfo()
  195. }).catch(error => {
  196. uni.hideLoading();
  197. //this.getPhone()
  198. })
  199. },
  200. logout(){
  201. this.changeShow()
  202. uni.showModal({
  203. title: '提示',
  204. content: '确认是否退出?',
  205. success: res=> {
  206. if (res.confirm) {
  207. //付钱 改为组件
  208. this.logoutApi();
  209. } else if (res.cancel) {
  210. console.log('用户点击取消');
  211. }
  212. }
  213. });
  214. },
  215. logoutApi(){
  216. uni.showLoading({
  217. title: "加载中",
  218. mask: true,
  219. })
  220. var data = {
  221. };
  222. API.logout(data).then((res) => {
  223. this.carhelp.logoff();
  224. uni.redirectTo({
  225. url:"/"
  226. })
  227. }).catch(error => {
  228. uni.showToast({
  229. title: error
  230. })
  231. })
  232. },
  233. changeShow(){
  234. this.show=!this.show
  235. }
  236. }
  237. }
  238. </script>
  239. <style >
  240. page{
  241. background-color: rgba(1,122,255,1);
  242. padding-bottom: 100rpx;
  243. }
  244. </style>
  245. <style lang="scss" scoped>
  246. .options{
  247. width: 260rpx;
  248. line-height: 60rpx;
  249. //text-align: center;
  250. padding:8rpx 0px 8rpx 16rpx;
  251. background-color: #fff;
  252. color: rgba(65, 80, 88, 1);
  253. font-family: Microsoft Yahei;
  254. position: absolute;
  255. top: 228rpx;
  256. border-radius: 1px;
  257. //right: 24rpx;
  258. box-shadow:5px 5px 10px gray;
  259. }
  260. .headerView{
  261. //background:linear-gradient(180deg, rgba(0,45,194,1) 0%,rgba(0,59,254,1) 49%,rgba(1,122,255,1) 100%);
  262. background-color: rgba(1,122,255,1);
  263. }
  264. page{
  265. background-color: rgba(1,122,255,1);
  266. padding-bottom: 100rpx;
  267. }
  268. // 头部
  269. .header{
  270. width: 100%;
  271. height: 289px;
  272. background:linear-gradient(180deg, rgba(0,45,194,1) 0%,rgba(0,59,254,1) 49%,rgba(1,122,255,1) 100%);
  273. padding: 0 40rpx;
  274. .main{
  275. width: 100%;
  276. height: 100%;
  277. background: url(@/assets/img/background.png) no-repeat;
  278. background-position: top -70rpx right -50rpx;
  279. position: relative;
  280. background-position-y: 20px;
  281. padding-top: 20rpx;
  282. }
  283. .title{
  284. //margin-top: 60px;
  285. padding-top: 60px;
  286. display: flex;
  287. justify-content: space-between;
  288. align-items: center;
  289. color: rgba(255, 255, 255, 1);
  290. line-height: 88rpx;
  291. .name{
  292. display: flex;
  293. font-size: 40rpx;
  294. }
  295. .qr-code{
  296. display: flex;
  297. }
  298. }
  299. }
  300. // 宫格
  301. .gird{
  302. // 公告
  303. .notice{
  304. overflow: hidden;
  305. width: 100%;
  306. display: flex;
  307. align-items: center;
  308. background-color: #6290f7;
  309. color: rgba(255, 255, 255, 1);
  310. font-weight: bold;
  311. border-radius: 8px;
  312. height: 80rpx;
  313. line-height: 80rpx;
  314. padding: 0 24rpx;
  315. // position: absolute;
  316. bottom: 260rpx;
  317. left: 0;
  318. right: 0;
  319. margin-bottom: 40rpx;
  320. text{
  321. font-size: 28rpx;
  322. width: 542px;
  323. margin-left: 16rpx;
  324. white-space: nowrap;
  325. overflow: hidden;
  326. text-overflow: ellipsis;
  327. }
  328. }
  329. padding: 0 40rpx;
  330. display: flex;
  331. justify-content: space-between;
  332. flex-wrap: wrap;
  333. margin-top: -124rpx;
  334. .item{
  335. width: 720rpx;
  336. height: 100px;
  337. background-color: rgba(255, 255, 255, 1);
  338. border-radius: 8px;
  339. padding: 32rpx 24rpx;
  340. position: relative;
  341. margin-bottom: 30rpx;
  342. .title{
  343. color: rgba(16, 16, 16, 1);
  344. font-size: 44rpx;
  345. margin-bottom: 8rpx;
  346. font-family: 'Alibaba-PuHuiTi-Regular';
  347. }
  348. .hint{
  349. color: rgba(106, 121, 142, 1);
  350. font-size: 32rpx;
  351. margin-bottom: 44rpx;
  352. }
  353. .img{
  354. width: 75px;
  355. height: 75px;
  356. position: absolute;
  357. right: 24rpx;
  358. bottom: 24rpx;
  359. img{
  360. width: 100%;
  361. height: 100%;
  362. }
  363. }
  364. }
  365. }
  366. // 其他功能
  367. .other-functions{
  368. padding: 0 40rpx;
  369. .title{
  370. color: rgba(255, 255, 255, 1);
  371. font-size: 36rpx;
  372. margin-bottom: 16rpx;
  373. }
  374. .function-gird{
  375. display: flex;
  376. flex-wrap: wrap;
  377. justify-content: space-between;
  378. .item{
  379. display: flex;
  380. align-items: center;
  381. justify-content: center;
  382. width: 320rpx;
  383. height: 80rpx;
  384. line-height: 80rpx;
  385. margin-bottom: 24rpx;
  386. color: rgba(255, 255, 255, 1);
  387. border-radius: 8px;
  388. background-color: rgba(255, 255, 255, 0.25);
  389. text-align: center;
  390. border: 1px solid rgba(255, 255, 255, 0.35);
  391. img{
  392. width: 32rpx;
  393. height: 32rpx;
  394. margin-right: 8rpx;
  395. }
  396. }
  397. }
  398. }
  399. </style>