index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view class="wrap">
  3. <view class='title'>仓库管理</view>
  4. <view class="dropdown">
  5. <view class="left" @click='show1=true'>
  6. <view>{{warehouseName}}</view>
  7. <u-icon name="arrow-right" color=""></u-icon>
  8. <u-select v-model="show1" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
  9. </u-select>
  10. </view>
  11. <view class="right" @click='show2=true'>
  12. <view>{{positionName}}</view>
  13. <u-icon name="arrow-right" color=""></u-icon>
  14. <u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
  15. </u-select>
  16. </view>
  17. </view>
  18. <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
  19. <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
  20. v-if="index<gridCol*2">
  21. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  22. <image :src="item.src" class="sign"></image>
  23. </view>
  24. <text>{{item.name}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. mapState
  32. } from 'vuex';
  33. export default {
  34. components: {
  35. },
  36. data() {
  37. return {
  38. show1:false,
  39. show2:false,
  40. warehouseName: '鲅鱼圈一号库',
  41. positionName: '102仓位',
  42. warehouseList: [
  43. {
  44. "label": '1',
  45. "value": '1'
  46. }
  47. ],
  48. positionList: [
  49. {
  50. "label": '102仓位',
  51. "value": '1'
  52. }
  53. ],
  54. gridCol: 4,
  55. gridBorder: false,
  56. gridList: [{
  57. num: 0,
  58. name: '入库',
  59. // icon: 'cuIcon-apps',
  60. src: '../../static/img/erp/yaoqingyonghu@3x.png',
  61. tips: 0,
  62. url: '/pages/erp/warehousing/warehousing',
  63. show: true
  64. },
  65. {
  66. num: 1,
  67. name: '待完善入库',
  68. // icon: 'cuIcon-calendar',
  69. src: '../../static/img/erp/shougouzhijian@3x.png',
  70. tips: 0,
  71. url: '/pages/erp/improvedWrehousing/improvedWrehousing',
  72. show: true
  73. },
  74. {
  75. num: 2,
  76. name: '出库',
  77. // icon: 'cuIcon-copy',
  78. src: '../../static/img/erp/shougoujianjin@3x.png',
  79. tips: 0,
  80. url: '/pages/erp/exWarehousing/exWarehousing',
  81. show: true
  82. },
  83. {
  84. num: 3,
  85. name: '待完善出库',
  86. // icon: 'cuIcon-edit',
  87. src: '../../static/img/sign/shezhi@2x.png',
  88. tips: 0,
  89. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  90. show: true
  91. }
  92. ],
  93. }
  94. },
  95. onLoad() {
  96. },
  97. // #ifndef MP
  98. onNavigationBarButtonTap(e) {
  99. const index = e.index;
  100. if (index === 0) {
  101. this.navTo('/pages/set/set');
  102. } else if (index === 1) {
  103. // #ifdef APP-PLUS
  104. const pages = getCurrentPages();
  105. const page = pages[pages.length - 1];
  106. const currentWebview = page.$getAppWebview();
  107. currentWebview.hideTitleNViewButtonRedDot({
  108. index
  109. });
  110. // #endif
  111. uni.navigateTo({
  112. url: '/pages/notice/notice'
  113. })
  114. }
  115. },
  116. // #endif
  117. computed: {
  118. ...mapState(['hasLogin', 'userInfo']),
  119. },
  120. onShow() {
  121. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  122. console.log("checkSession", res)
  123. if (res.data.data == "INVALID") {
  124. uni.showModal({
  125. title: '登录提示',
  126. content: 'Session过期需要重新登录,是否立即登录?',
  127. showCancel: true,
  128. confirmText: '登录',
  129. success: (e) => {
  130. if (e.confirm) {
  131. uni.navigateTo({
  132. url: '/pages/public/login'
  133. })
  134. }
  135. },
  136. fail: () => {},
  137. complete: () => {}
  138. })
  139. }
  140. })
  141. console.log("hasLogin", this.hasLogin)
  142. },
  143. methods: {
  144. /**
  145. * 统一跳转接口,拦截未登录路由
  146. * navigator标签现在默认没有转场动画,所以用view
  147. */
  148. navTo(url) {
  149. if (!this.hasLogin) {
  150. url = '/pages/public/login';
  151. }
  152. uni.navigateTo({
  153. url
  154. })
  155. },
  156. gridClick(item, index) {
  157. var that = this
  158. if (!this.hasLogin) {
  159. uni.showModal({
  160. title: '登录提示',
  161. content: '您尚未登录,是否立即登录?',
  162. showCancel: true,
  163. confirmText: '登录',
  164. success: (e) => {
  165. if (e.confirm) {
  166. uni.navigateTo({
  167. url: '/pages/public/login'
  168. })
  169. }
  170. },
  171. fail: () => {},
  172. complete: () => {}
  173. })
  174. } else {
  175. if (item.url) {
  176. uni.navigateTo({
  177. url: item.url
  178. })
  179. }
  180. }
  181. },
  182. confirmWarehouse(){},
  183. confirmPositon(){}
  184. }
  185. }
  186. </script>
  187. <style lang='scss' scoped>
  188. page {
  189. background: #F5F6FA;
  190. }
  191. .container {
  192. padding-top: 85px;
  193. padding-top: 35px;
  194. background-color: #F5F6FA;
  195. position: relative;
  196. width: 100vw;
  197. height: 100vh;
  198. overflow: hidden;
  199. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  200. background-size: 100% 100%;
  201. margin: 0 auto;
  202. }
  203. .wrap {
  204. background: #fff;
  205. margin: 10px;
  206. border-radius: 10px;
  207. padding: 10px;
  208. .title {
  209. font-size: 16px;
  210. }
  211. }
  212. .cu-list {
  213. /* height: 483rpx;
  214. overflow-y: scroll; */
  215. background: transparent;
  216. }
  217. .cu-list.grid.no-border {
  218. padding: 0;
  219. }
  220. .grid {
  221. display: flex;
  222. align-items: center;
  223. flex-wrap: wrap;
  224. /* border-top: 2upx solid rgba(172,172,172,.2); */
  225. .grid-item-3 {
  226. box-sizing: border-box;
  227. width: calc(100% / 3);
  228. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  229. border-right: 2upx solid rgba(172, 172, 172, .2);
  230. text-align: center;
  231. padding: 40upx 0;
  232. position: relative;
  233. /* view{
  234. font-size: $font-sm;
  235. margin-top: 16upx;
  236. color: $font-color-dark;
  237. } */
  238. .grid_icon {
  239. font-size: 48upx;
  240. margin-bottom: 18upx;
  241. color: #fa436a;
  242. }
  243. .tip_text {
  244. display: block;
  245. padding: 4upx 8upx;
  246. text-align: center;
  247. border-radius: 36upx;
  248. font-size: 24upx;
  249. background-color: #fa436a;
  250. color: rgba(255, 255, 255, 1);
  251. position: absolute;
  252. right: 6upx;
  253. top: 6upx;
  254. }
  255. }
  256. .grid-item-3:nth-child(3n + 3),
  257. .grid-item-4:nth-child(4n + 4) {
  258. border-right: none;
  259. }
  260. }
  261. .sign {
  262. width: 40px;
  263. height: 40px;
  264. top: 4px;
  265. margin-right: 6px;
  266. }
  267. .dropdown{
  268. display: flex;
  269. margin:20rpx 0;
  270. justify-content: space-between;
  271. .left,.right{
  272. display: flex;
  273. }
  274. }
  275. </style>