home.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 class="menu-list-box" @click="toRouter('/total/personalStat')">
  36. <image :src="'../static/czzj.png'" mode=""></image>
  37. <view class="">
  38. 个人面料概况
  39. </view>
  40. </view>
  41. </view>
  42. </uni-card>
  43. <uni-card>
  44. <view class="title">
  45. 出库管理
  46. </view>
  47. <view class="menu-list-warp">
  48. <view class="menu-list-box" @click="toRouter('/usedTotal/warehouse-list')">
  49. <image :src="'../static/smrk.png'" mode=""></image>
  50. <view class="">
  51. 物料接收
  52. </view>
  53. </view>
  54. <view class="menu-list-box" @click="toRouter('/usedTotal/materialReceiving')" v-if="isRoom3">
  55. <image :src="'../static/kcpd.png'" mode=""></image>
  56. <view class="">
  57. 待物料接收
  58. </view>
  59. </view>
  60. <view class="menu-list-box" @click="toRouter('/usedTotal/return-warehouse')">
  61. <image :src="'../static/tc.png'" mode=""></image>
  62. <view class="">
  63. 物料退仓
  64. </view>
  65. </view>
  66. <view class="menu-list-box" @click="toRouter('/usedTotal/fabric-correction')">
  67. <image :src="'../static/kccx.png'" mode=""></image>
  68. <view class="">
  69. 面料修正
  70. </view>
  71. </view>
  72. <!-- <view class="menu-list-box" @click="toRouter('/materialTransfer/materialTransfer')">
  73. <image :src="'../static/xcjj.png'" mode=""></image>
  74. <view class="">
  75. 面料转仓
  76. </view>
  77. </view> -->
  78. <view class="menu-list-box" @click="toRouter('/materialTransfer/transferCompositeList')" v-if="isRoom2">
  79. <image :src="'../static/fh.png'" mode=""></image>
  80. <view class="">
  81. 转仓复核
  82. </view>
  83. </view>
  84. </view>
  85. </uni-card>
  86. <!-- <button style="background: blue;color: #fff;margin: 40rpx;"></button> -->
  87. <view class="logout" @click="logout">
  88. 退出
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. getInfo
  95. } from "@/util/api.js";
  96. import Vue from 'vue'
  97. export default {
  98. data() {
  99. return {
  100. userInfoData: [],
  101. notificationData: [],
  102. isRoom: false,
  103. isRoom2:false,
  104. isRoom3:false,
  105. }
  106. },
  107. onLoad() {
  108. // wx.requestSubscribeMessage({
  109. // tmplIds: ['Tt0C6SOrtd2QXIdLqrm0CNdarUE4LG_lNJblUnkqTPM'],
  110. // success(res) {
  111. // },
  112. // fail(err){
  113. // console.log(err)
  114. // }
  115. // })
  116. const v = this
  117. if (
  118. Vue.prototype.$token.role_id == '1552548151620026370' ||
  119. Vue.prototype.$token.role_id == '1552550790307004417' ||
  120. Vue.prototype.$token.role_id == '1552550978346041346') {
  121. this.isRoom = true
  122. }
  123. if (
  124. Vue.prototype.$token.role_id == '1569881723951472642' ||
  125. Vue.prototype.$token.role_id == '1552550978346041346' ||
  126. Vue.prototype.$token.role_id == '1552548151620026370') {
  127. this.isRoom2 = true
  128. }
  129. if (
  130. Vue.prototype.$token.role_id == '1552548151620026370' ||
  131. Vue.prototype.$token.role_id == '1552550978346041346' ||
  132. Vue.prototype.$token.role_id == '1580170639715688449') {
  133. this.isRoom3 = true
  134. }
  135. // v.$post('/wx/login/getUserInfo').then(res => {
  136. // v.userInfoData = res.data
  137. // Vue.prototype.$userInfo = res.data
  138. // uni.setStorage({
  139. // key: "userInfo",
  140. // data: res.data,
  141. // success(res) {
  142. // },
  143. // fail(res) {}
  144. // })
  145. // })
  146. // v.$post('/wx/message/notification',{}).then(res=>{
  147. // v.notificationData = res.data
  148. // })
  149. },
  150. methods: {
  151. logout(){
  152. uni.setStorage({
  153. key: 'automaticLogin',
  154. data: false,
  155. success: function () {
  156. uni.navigateTo({
  157. url: '/pages/user/login'
  158. })
  159. }
  160. });
  161. },
  162. toRouter(j) {
  163. console.log(j)
  164. wx.requestSubscribeMessage({
  165. tmplIds: ['Tt0C6SOrtd2QXIdLqrm0CNdarUE4LG_lNJblUnkqTPM'],
  166. success(res) {
  167. },
  168. fail(err){
  169. console.log(err)
  170. }
  171. })
  172. uni.navigateTo({
  173. url: '/pages' + j
  174. })
  175. },
  176. },
  177. }
  178. </script>
  179. <style lang="less">
  180. .logout{
  181. text-align: center;
  182. position: fixed;
  183. bottom: 0;
  184. left: 0;
  185. right: 0;
  186. line-height: 80rpx;
  187. }
  188. .menu-list-warp {
  189. .menu-list-box {
  190. width: 25%;
  191. text-align: center;
  192. float: left;
  193. padding: 20rpx;
  194. image {
  195. width: 100rpx;
  196. height: 100rpx;
  197. }
  198. }
  199. }
  200. </style>