home.vue 5.7 KB

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