index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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/erp/shougouzhijian@3x.png',
  88. tips: 0,
  89. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  90. show: true
  91. },
  92. {
  93. num: 4,
  94. name: '开通业务',
  95. // icon: 'cuIcon-edit',
  96. src: '../../static/img/erp/shougouzhijian@3x.png',
  97. tips: 0,
  98. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  99. show: true
  100. },
  101. {
  102. num: 5,
  103. name: '联系客服',
  104. // icon: 'cuIcon-edit',
  105. src: '../../static/img/erp/shougouzhijian@3x.png',
  106. tips: 0,
  107. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  108. show: true
  109. }
  110. ],
  111. }
  112. },
  113. onLoad() {
  114. },
  115. // #ifndef MP
  116. onNavigationBarButtonTap(e) {
  117. const index = e.index;
  118. if (index === 0) {
  119. this.navTo('/pages/set/set');
  120. } else if (index === 1) {
  121. // #ifdef APP-PLUS
  122. const pages = getCurrentPages();
  123. const page = pages[pages.length - 1];
  124. const currentWebview = page.$getAppWebview();
  125. currentWebview.hideTitleNViewButtonRedDot({
  126. index
  127. });
  128. // #endif
  129. uni.navigateTo({
  130. url: '/pages/notice/notice'
  131. })
  132. }
  133. },
  134. // #endif
  135. computed: {
  136. ...mapState(['hasLogin', 'userInfo']),
  137. },
  138. onShow() {
  139. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  140. console.log("checkSession", res)
  141. if (res.data.data == "INVALID") {
  142. uni.showModal({
  143. title: '登录提示',
  144. content: 'Session过期需要重新登录,是否立即登录?',
  145. showCancel: true,
  146. confirmText: '登录',
  147. success: (e) => {
  148. if (e.confirm) {
  149. uni.navigateTo({
  150. url: '/pages/public/login'
  151. })
  152. }
  153. },
  154. fail: () => {},
  155. complete: () => {}
  156. })
  157. }
  158. })
  159. console.log("hasLogin", this.hasLogin)
  160. },
  161. methods: {
  162. /**
  163. * 统一跳转接口,拦截未登录路由
  164. * navigator标签现在默认没有转场动画,所以用view
  165. */
  166. navTo(url) {
  167. if (!this.hasLogin) {
  168. url = '/pages/public/login';
  169. }
  170. uni.navigateTo({
  171. url
  172. })
  173. },
  174. gridClick(item, index) {
  175. var that = this
  176. if (!this.hasLogin) {
  177. uni.showModal({
  178. title: '登录提示',
  179. content: '您尚未登录,是否立即登录?',
  180. showCancel: true,
  181. confirmText: '登录',
  182. success: (e) => {
  183. if (e.confirm) {
  184. uni.navigateTo({
  185. url: '/pages/public/login'
  186. })
  187. }
  188. },
  189. fail: () => {},
  190. complete: () => {}
  191. })
  192. } else {
  193. if (item.url) {
  194. uni.navigateTo({
  195. url: item.url
  196. })
  197. }
  198. }
  199. },
  200. confirmWarehouse(){},
  201. confirmPositon(){}
  202. }
  203. }
  204. </script>
  205. <style lang='scss' scoped>
  206. page {
  207. background: #F5F6FA;
  208. }
  209. .container {
  210. padding-top: 85px;
  211. padding-top: 35px;
  212. background-color: #F5F6FA;
  213. position: relative;
  214. width: 100vw;
  215. height: 100vh;
  216. overflow: hidden;
  217. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  218. background-size: 100% 100%;
  219. margin: 0 auto;
  220. }
  221. .wrap {
  222. background: #fff;
  223. margin: 10px;
  224. border-radius: 10px;
  225. padding: 10px;
  226. .title {
  227. font-size: 16px;
  228. }
  229. }
  230. .cu-list {
  231. /* height: 483rpx;
  232. overflow-y: scroll; */
  233. background: transparent;
  234. }
  235. .cu-list.grid.no-border {
  236. padding: 0;
  237. }
  238. .grid {
  239. display: flex;
  240. align-items: center;
  241. flex-wrap: wrap;
  242. /* border-top: 2upx solid rgba(172,172,172,.2); */
  243. .grid-item-3 {
  244. box-sizing: border-box;
  245. width: calc(100% / 3);
  246. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  247. border-right: 2upx solid rgba(172, 172, 172, .2);
  248. text-align: center;
  249. padding: 40upx 0;
  250. position: relative;
  251. /* view{
  252. font-size: $font-sm;
  253. margin-top: 16upx;
  254. color: $font-color-dark;
  255. } */
  256. .grid_icon {
  257. font-size: 48upx;
  258. margin-bottom: 18upx;
  259. color: #fa436a;
  260. }
  261. .tip_text {
  262. display: block;
  263. padding: 4upx 8upx;
  264. text-align: center;
  265. border-radius: 36upx;
  266. font-size: 24upx;
  267. background-color: #fa436a;
  268. color: rgba(255, 255, 255, 1);
  269. position: absolute;
  270. right: 6upx;
  271. top: 6upx;
  272. }
  273. }
  274. .grid-item-3:nth-child(3n + 3),
  275. .grid-item-4:nth-child(4n + 4) {
  276. border-right: none;
  277. }
  278. }
  279. .sign {
  280. width: 40px;
  281. height: 40px;
  282. top: 4px;
  283. margin-right: 6px;
  284. }
  285. .dropdown{
  286. display: flex;
  287. margin:20rpx 0;
  288. justify-content: space-between;
  289. .left,.right{
  290. display: flex;
  291. }
  292. }
  293. </style>