123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <view class="wrap">
- <view class='title'>仓库管理</view>
- <view class="dropdown">
- <view class="left" @click='show1=true'>
- <view>{{warehouseName}}</view>
- <u-icon name="arrow-right" color=""></u-icon>
- <u-select v-model="show1" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
- </u-select>
- </view>
- <view class="right" @click='show2=true'>
- <view>{{positionName}}</view>
- <u-icon name="arrow-right" color=""></u-icon>
- <u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
- </u-select>
- </view>
- </view>
-
- <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
- <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
- v-if="index<gridCol*2">
- <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
- <image :src="item.src" class="sign"></image>
- </view>
- <text>{{item.name}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- components: {
- },
- data() {
- return {
- show1:false,
- show2:false,
- warehouseName: '鲅鱼圈一号库',
- positionName: '102仓位',
- warehouseList: [
- {
- "label": '1',
- "value": '1'
- }
- ],
- positionList: [
- {
- "label": '102仓位',
- "value": '1'
- }
- ],
- gridCol: 4,
- gridBorder: false,
- gridList: [{
- num: 0,
- name: '入库',
- // icon: 'cuIcon-apps',
- src: '../../static/img/erp/yaoqingyonghu@3x.png',
- tips: 0,
- url: '/pages/erp/warehousing/warehousing',
- show: true
- },
- {
- num: 1,
- name: '待完善入库',
- // icon: 'cuIcon-calendar',
- src: '../../static/img/erp/shougouzhijian@3x.png',
- tips: 0,
- url: '/pages/erp/improvedWrehousing/improvedWrehousing',
- show: true
- },
- {
- num: 2,
- name: '出库',
- // icon: 'cuIcon-copy',
- src: '../../static/img/erp/shougoujianjin@3x.png',
- tips: 0,
- url: '/pages/erp/exWarehousing/exWarehousing',
- show: true
- },
- {
- num: 3,
- name: '待完善出库',
- // icon: 'cuIcon-edit',
- src: '../../static/img/sign/shezhi@2x.png',
- tips: 0,
- url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
- show: true
- }
- ],
- }
- },
- onLoad() {
- },
- // #ifndef MP
- onNavigationBarButtonTap(e) {
- const index = e.index;
- if (index === 0) {
- this.navTo('/pages/set/set');
- } else if (index === 1) {
- // #ifdef APP-PLUS
- const pages = getCurrentPages();
- const page = pages[pages.length - 1];
- const currentWebview = page.$getAppWebview();
- currentWebview.hideTitleNViewButtonRedDot({
- index
- });
- // #endif
- uni.navigateTo({
- url: '/pages/notice/notice'
- })
- }
- },
- // #endif
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- onShow() {
- this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
- console.log("checkSession", res)
- if (res.data.data == "INVALID") {
- uni.showModal({
- title: '登录提示',
- content: 'Session过期需要重新登录,是否立即登录?',
- showCancel: true,
- confirmText: '登录',
- success: (e) => {
- if (e.confirm) {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- }
- },
- fail: () => {},
- complete: () => {}
- })
- }
- })
- console.log("hasLogin", this.hasLogin)
- },
- methods: {
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- if (!this.hasLogin) {
- url = '/pages/public/login';
- }
- uni.navigateTo({
- url
- })
- },
- gridClick(item, index) {
- var that = this
- if (!this.hasLogin) {
- uni.showModal({
- title: '登录提示',
- content: '您尚未登录,是否立即登录?',
- showCancel: true,
- confirmText: '登录',
- success: (e) => {
- if (e.confirm) {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- }
- },
- fail: () => {},
- complete: () => {}
- })
- } else {
- if (item.url) {
- uni.navigateTo({
- url: item.url
- })
- }
- }
- },
- confirmWarehouse(){},
- confirmPositon(){}
- }
- }
- </script>
- <style lang='scss' scoped>
- page {
- background: #F5F6FA;
- }
- .container {
- padding-top: 85px;
- padding-top: 35px;
- background-color: #F5F6FA;
- position: relative;
- width: 100vw;
- height: 100vh;
- overflow: hidden;
- background: url('~@/static/img/login/bg_slices/bg@3x.png');
- background-size: 100% 100%;
- margin: 0 auto;
- }
- .wrap {
- background: #fff;
- margin: 10px;
- border-radius: 10px;
- padding: 10px;
- .title {
- font-size: 16px;
- }
- }
- .cu-list {
- /* height: 483rpx;
- overflow-y: scroll; */
- background: transparent;
- }
- .cu-list.grid.no-border {
- padding: 0;
- }
- .grid {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- /* border-top: 2upx solid rgba(172,172,172,.2); */
- .grid-item-3 {
- box-sizing: border-box;
- width: calc(100% / 3);
- border-bottom: 2upx solid rgba(172, 172, 172, .2);
- border-right: 2upx solid rgba(172, 172, 172, .2);
- text-align: center;
- padding: 40upx 0;
- position: relative;
- /* view{
- font-size: $font-sm;
- margin-top: 16upx;
- color: $font-color-dark;
- } */
- .grid_icon {
- font-size: 48upx;
- margin-bottom: 18upx;
- color: #fa436a;
- }
- .tip_text {
- display: block;
- padding: 4upx 8upx;
- text-align: center;
- border-radius: 36upx;
- font-size: 24upx;
- background-color: #fa436a;
- color: rgba(255, 255, 255, 1);
- position: absolute;
- right: 6upx;
- top: 6upx;
- }
- }
- .grid-item-3:nth-child(3n + 3),
- .grid-item-4:nth-child(4n + 4) {
- border-right: none;
- }
- }
- .sign {
- width: 40px;
- height: 40px;
- top: 4px;
- margin-right: 6px;
- }
- .dropdown{
- display: flex;
- margin:20rpx 0;
- justify-content: space-between;
- .left,.right{
- display: flex;
- }
- }
- </style>
|