homePage.vue 8.4 KB

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