homePage.vue 8.1 KB

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