home.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="home">
  3. <!-- <uni-notice-bar show-icon scrollable
  4. text="uni-app 版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" /> -->
  5. <!-- <uni-card v-for="i in userInfoData.menus" :key="i.id">
  6. <view class="title">
  7. {{i.name}}
  8. </view>
  9. <view class="menu-list-warp">
  10. <view class="menu-list-box" v-for="j in i.children" :key="j.id" @click="toRouter(j)">
  11. <image :src="'../static/' + j.icon" mode=""></image>
  12. <view class="">
  13. {{j.name}}
  14. </view>
  15. </view>
  16. </view>
  17. </uni-card> -->
  18. <uni-card>
  19. <view class="title">
  20. 库存
  21. </view>
  22. <view class="menu-list-warp">
  23. <view class="menu-list-box" @click="toRouter('/submit/submit')">
  24. <image :src="'../static/smck.png'" mode=""></image>
  25. <view class="">
  26. 异常上报
  27. </view>
  28. </view>
  29. <view class="menu-list-box" @click="toRouter('/usedTotal/usedTotal')" v-if="isRoom">
  30. <image :src="'../static/tj.png'" mode=""></image>
  31. <view class="">
  32. 库存统计
  33. </view>
  34. </view>
  35. </view>
  36. </uni-card>
  37. <uni-card>
  38. <view class="title">
  39. 出库管理
  40. </view>
  41. <view class="menu-list-warp">
  42. <view class="menu-list-box" @click="toRouter('/usedTotal/warehouse-list')">
  43. <image :src="'../static/smrk.png'" mode=""></image>
  44. <view class="">
  45. 物料接收
  46. </view>
  47. </view>
  48. <view class="menu-list-box" @click="toRouter('/usedTotal/return-warehouse')">
  49. <image :src="'../static/tc.png'" mode=""></image>
  50. <view class="">
  51. 物料退仓
  52. </view>
  53. </view>
  54. <view class="menu-list-box" @click="toRouter('/usedTotal/fabric-correction')">
  55. <image :src="'../static/kccx.png'" mode=""></image>
  56. <view class="">
  57. 面料修正
  58. </view>
  59. </view>
  60. <view class="menu-list-box" @click="toRouter('/materialTransfer/materialTransfer')">
  61. <image :src="'../static/xcjj.png'" mode=""></image>
  62. <view class="">
  63. 面料转仓
  64. </view>
  65. </view>
  66. <view class="menu-list-box" @click="toRouter('/materialTransfer/transferCompositeList')" v-if="isRoom2">
  67. <image :src="'../static/fh.png'" mode=""></image>
  68. <view class="">
  69. 转仓复核
  70. </view>
  71. </view>
  72. </view>
  73. </uni-card>
  74. <!-- <button style="background: blue;color: #fff;margin: 40rpx;"></button> -->
  75. <view class="logout" @click="logout">
  76. 退出
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import {
  82. getInfo
  83. } from "@/util/api.js";
  84. import Vue from 'vue'
  85. export default {
  86. data() {
  87. return {
  88. userInfoData: [],
  89. notificationData: [],
  90. isRoom: false,
  91. isRoom2:false,
  92. }
  93. },
  94. onLoad() {
  95. // wx.requestSubscribeMessage({
  96. // tmplIds: ['Tt0C6SOrtd2QXIdLqrm0CNdarUE4LG_lNJblUnkqTPM'],
  97. // success(res) {
  98. // },
  99. // fail(err){
  100. // console.log(err)
  101. // }
  102. // })
  103. const v = this
  104. if (
  105. Vue.prototype.$token.role_id == '1552548151620026370' ||
  106. Vue.prototype.$token.role_id == '1552550790307004417' ||
  107. Vue.prototype.$token.role_id == '1552550978346041346') {
  108. this.isRoom = true
  109. }
  110. if (
  111. Vue.prototype.$token.role_id == '1569881723951472642' ||
  112. Vue.prototype.$token.role_id == '1552550978346041346' ||
  113. Vue.prototype.$token.role_id == '1552548151620026370') {
  114. this.isRoom2 = true
  115. }
  116. // v.$post('/wx/login/getUserInfo').then(res => {
  117. // v.userInfoData = res.data
  118. // Vue.prototype.$userInfo = res.data
  119. // uni.setStorage({
  120. // key: "userInfo",
  121. // data: res.data,
  122. // success(res) {
  123. // },
  124. // fail(res) {}
  125. // })
  126. // })
  127. // v.$post('/wx/message/notification',{}).then(res=>{
  128. // v.notificationData = res.data
  129. // })
  130. },
  131. methods: {
  132. logout(){
  133. uni.setStorage({
  134. key: 'automaticLogin',
  135. data: false,
  136. success: function () {
  137. uni.navigateTo({
  138. url: '/pages/user/login'
  139. })
  140. }
  141. });
  142. },
  143. toRouter(j) {
  144. console.log(j)
  145. wx.requestSubscribeMessage({
  146. tmplIds: ['Tt0C6SOrtd2QXIdLqrm0CNdarUE4LG_lNJblUnkqTPM'],
  147. success(res) {
  148. },
  149. fail(err){
  150. console.log(err)
  151. }
  152. })
  153. uni.navigateTo({
  154. url: '/pages' + j
  155. })
  156. },
  157. },
  158. }
  159. </script>
  160. <style lang="less">
  161. .logout{
  162. text-align: center;
  163. position: fixed;
  164. bottom: 0;
  165. left: 0;
  166. right: 0;
  167. line-height: 80rpx;
  168. }
  169. .menu-list-warp {
  170. .menu-list-box {
  171. width: 25%;
  172. text-align: center;
  173. float: left;
  174. padding: 20rpx;
  175. image {
  176. width: 100rpx;
  177. height: 100rpx;
  178. }
  179. }
  180. }
  181. </style>