123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <template>
- <!-- 首页 -->
- <view class="card_index_bgc" :style="{paddingTop:height + 'px'}">
- <view class="company_name" v-if="userInfo.dept">{{userInfo.dept.name || ''}}</view>
- <x-statistics :userType="homeUserType" :orderStatistics="orderStatistics"></x-statistics>
- <view class="card_operate">
- <view class="btn_item_tab" v-for="(item,index) in tableList" :key="index" @click="getOperate(item)">
- <view class="card_image center_in" :style="{backgroundColor:item.color}">
- <span class="iconfont icon_image" :class="item.icon"></span>
- </view>
- <view class="item_title_tab">{{item.title}}</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- height: {
- type: [String,Number],
- default: () => '',
- },
- token: {
- type: String,
- default: () => '',
- },
- userInfo: {
- type: Object,
- default: () => {},
- },
- orderStatistics: {
- type: Object,
- default: () => {},
- }
- },
- data() {
- return {
- homeUserType: 1,
- tableList: [],
- partitionList: [{
- id: 'detailsil',
- title: '车辆信息',
- icon: 'icon-cheliangxinxi',
- color: '#4bc7fc',
- }, {
- id: 'truck',
- title: '扫码装车',
- icon: 'icon-truck',
- color: '#fece56',
- }, {
- id: 'encasement',
- title: '扫码装箱',
- icon: 'icon-fankudengji',
- color: '#fe880e',
- }, {
- id: 'signfor',
- title: '扫码签收',
- icon: 'icon-yidaoda',
- color: '#9ddd54',
- }, {
- id: 'add',
- title: '添加运单',
- icon: 'icon-tianjiadingdan',
- color: '#1cc723',
- }],
- warehouseList: [{
- id: 'details',
- title: '仓库信息',
- icon: 'icon-lenglianku',
- color: '#4bc7fc',
- }, {
- id: 'put',
- title: '扫码入库',
- icon: 'icon-fankudengji',
- color: '#9ddd54',
- }, {
- id: 'encasement',
- title: '扫码装箱',
- icon: 'icon-chukudan',
- color: '#fece56',
- }, {
- id: 'signfor',
- title: '扫码签收',
- icon: 'icon-yidaoda',
- color: '#9ddd54',
- }, {
- id: 'add',
- title: '添加运单',
- icon: 'icon-tianjiadingdan',
- color: '#1cc723',
- }],
- userList: [{
- id: 'add',
- title: '添加运单',
- icon: 'icon-tianjiadingdan',
- color: '#1cc723',
- }],
- }
- },
- created() {
- if (this.userInfo.userType == 'sys') {
- if (this.userInfo.type == 2) {
- this.homeUserType = 1
- // 仓管
- this.tableList = this.warehouseList
- } else if (this.userInfo.type == 3) {
- // 司机
- this.homeUserType = 2
- this.tableList = this.partitionList
- }
- } else {
- this.homeUserType = 3
- this.tableList = this.userList
- }
- },
- methods: {
- getOperate(value) {
- if (this.token) {
- if (['truck', 'unload', 'signfor', 'put', 'out', 'encasement'].includes(value.id)) {
- uni.navigateTo({
- url: '/pages/order/delivery?id=' + value.id + '&title=' + value.title
- });
- } else if (value.id == 'add') {
- uni.navigateTo({
- url: '/pages/order/addWaybill?title=添加订单&type=1'
- });
- } else if (value.id == 'details') {
- uni.navigateTo({
- url: '/pages/home/particulars?title=true'
- });
- } else if (value.id == 'detailsil') {
- uni.navigateTo({
- url: '/pages/home/particulars?title=false'
- });
- }
- } else {
- uni.$u.toast('请先登录')
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .card_index_bgc {
- // padding-top: constant(safe-area-inset-top);
- // padding-top: env(safe-area-inset-top);
- background-image: linear-gradient(#a9e3f1, #f3f4f6);
- }
- .company_name {
- font-size: 36rpx;
- padding: 30rpx 30rpx 20rpx 30rpx;
- font-weight: 600;
- }
- .card_swiper {
- padding: 20rpx 20rpx 0rpx 20rpx;
- }
- .card_operate {
- display: flex;
- flex-wrap: wrap;
- justify-content: flex-start;
- background-color: #fff;
- padding: 20rpx 0rpx;
- margin: 20rpx;
- border-radius: 20rpx;
- }
- .btn_item_tab {
- width: 25%;
- display: flex;
- align-items: center;
- flex-direction: column;
- margin: 10rpx 0rpx;
- }
- .card_image {
- width: 90rpx;
- height: 90rpx;
- border-radius: 30rpx;
- margin-bottom: 10rpx;
- }
- .icon_image {
- font-size: 50rpx;
- color: #fff;
- }
- .item_title_tab {
- font-size: 26rpx;
- color: #606266;
- }
- </style>
|