<!--
|
* @Author: 小明丶
|
* @Date: 2019-08-30 18:04:49
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2020-12-29 10:17:39
|
* @Description:
|
-->
|
<template>
|
<div class="productManagement-page">
|
<x-header title="产品管理" :left-options="{backText: '', preventGoBack: true}" @on-click-back="goBackPage">
|
</x-header>
|
<!--<x-header slot="header" title="产品管理" :left-options="{backText:'',preventGoBack:true}"-->
|
<!--@on-click-back="pageGoBack()"></x-header>-->
|
<div class="productManagement-header" v-if="productList.length">
|
<ul class="productManagement-list">
|
<li @click="handleJump(i)" v-for="(i,index) in productList" :key="index">
|
<!-- <i class="iconfont usable" :class="i.icon"></i> -->
|
<img class="item-logo" :src="i.icon" :alt="i.typeName">
|
<p>{{i.typeName}}</p>
|
</li>
|
</ul>
|
</div>
|
<f-no-data v-else></f-no-data>
|
</div>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex';
|
export default {
|
name: 'productManagement',
|
data() {
|
return {
|
productList: [],
|
statusType: '',
|
orgType:'',
|
};
|
},
|
created(){
|
this.init();
|
},
|
computed:{
|
...mapState(['userinfo']),
|
},
|
methods: {
|
goBackPage() {
|
this.$router.push({
|
path: '/main/mine'
|
});
|
},
|
handleJump(productItem) {
|
let {
|
typeId,
|
openStatus
|
} = productItem,
|
path = '',
|
title = '',
|
query = {
|
typeId
|
};
|
if(typeId == '200014'){
|
if(openStatus == 2){
|
path = '/huabei/staging_hbjl'
|
}
|
query={
|
typeId,
|
orgType: this.orgType,
|
orgId: this.userinfo.orgId
|
}
|
}
|
if (typeId === '200005') {
|
if (this.orgType === 5) {
|
// 0-待开通,1-开通中,2-已开通,3-开通失败
|
switch (openStatus) {
|
case 0:
|
path = '/heyd/mgrOpen';
|
break;
|
case 1:
|
case 2:
|
case 3:
|
path = '/heyd/open-result';
|
break;
|
case 4:
|
path = '/heyd/open-result';
|
break;
|
default:
|
path = '/heyd/mgrOpen';
|
break;
|
}
|
if(this.statusType == 4 && openStatus == 1 && this.mgrIsOpen == 0){
|
path = '/heyd/mgrOpen';
|
}
|
|
}else{
|
switch (openStatus) {
|
case 0:
|
path = '/heyd/storeOpen';
|
break;
|
case 1:
|
case 2:
|
case 3:
|
path = '/heyd/open-result';
|
break;
|
case 4:
|
path = '/heyd/open-result';
|
break;
|
default:
|
path = '/heyd/storeOpen';
|
break;
|
}
|
}
|
query = {
|
typeId,
|
orgType: this.orgType,
|
openStatus: openStatus,
|
icon: productItem.icon,
|
}
|
}else if(typeId === '200011') {
|
if (this.orgType === 5) {
|
// 0-待开通,1-开通中,2-已开通,3-开通失败
|
switch (openStatus) {
|
case 0:
|
path = '/xyg/mgrOpen';
|
break;
|
case 1:
|
case 2:
|
case 3:
|
path = '/xyg/open-result';
|
break;
|
case 4:
|
path = '/xyg/open-result';
|
break;
|
default:
|
path = '/xyg/mgrOpen';
|
break;
|
}
|
if(this.statusType == 4 && openStatus == 1 && this.mgrIsOpen == 0){
|
path = '/xyg/mgrOpen';
|
}
|
|
}else{
|
switch (openStatus) {
|
case 0:
|
path = '/xyg/storeOpen';
|
break;
|
case 1:
|
case 2:
|
case 3:
|
path = '/xyg/open-result';
|
break;
|
case 4:
|
path = '/xyg/open-result';
|
break;
|
default:
|
path = '/xyg/storeOpen';
|
break;
|
}
|
}
|
query = {
|
typeId,
|
orgType: this.orgType,
|
openStatus: openStatus,
|
icon: productItem.icon,
|
}
|
}else if (typeId === '200017') {
|
if (this.orgType === 5) {
|
// 0-待开通,1-开通中,2-已开通,3-开通失败
|
switch (openStatus) {
|
case 0:
|
path = '/gzzj/mgrOpen';
|
break;
|
case 1:
|
case 2:
|
case 3:
|
path = '/gzzj/open-result';
|
break;
|
case 4:
|
path = '/gzzj/open-result';
|
break;
|
default:
|
path = '/gzzj/mgrOpen';
|
break;
|
}
|
if(this.statusType == 4 && openStatus == 1 && this.mgrIsOpen == 0){
|
path = '/gzzj/mgrOpen';
|
}
|
|
}else{
|
switch (openStatus) {
|
case 0:
|
path = '/gzzj/storeOpen';
|
break;
|
case 1:
|
case 2:
|
case 3:
|
path = '/gzzj/open-result';
|
break;
|
case 4:
|
path = '/gzzj/open-result';
|
break;
|
default:
|
path = '/gzzj/storeOpen';
|
break;
|
}
|
}
|
query = {
|
typeId,
|
orgType: this.orgType,
|
openStatus: openStatus,
|
icon: productItem.icon,
|
}
|
}
|
let val='';
|
if (this.statusType === 5) {
|
val = '营业员'
|
} else if (this.statusType === 3) {
|
val = '商户'
|
} else if (this.statusType === 4) {
|
val = '门店'
|
} else {
|
val = this.productList[0].statusType;
|
}
|
query.title = title;
|
query.statusType = val;
|
this.$router.push({
|
path,
|
query
|
});
|
},
|
//初始化
|
init() {
|
this.$api.storeProdList({
|
}).then(res => {
|
// this.prodTypeList=[]
|
this.mgrIsOpen = res.body.mgrIsOpen;
|
this.orgType = res.body.orgType;
|
this.statusType = res.body.prodTypeList[0].statusType || '';
|
this.productList = res.body.prodTypeList;
|
});
|
}
|
},
|
};
|
|
</script>
|
|
<style lang="less">
|
.item-logo{
|
display: block-line;
|
vertical-align: middle;
|
width: 45px;
|
height: 45px;
|
margin-left: auto;
|
}
|
.productManagement-page {
|
padding-top: 54px;
|
|
height: 100%;
|
padding-top: 44px;
|
|
.productManagement-header {
|
height: 100%;
|
background: @color-white;
|
margin-top: 15px;
|
|
.productManagement-list {
|
overflow: hidden;
|
height: 100%;
|
|
.iconfont {
|
font-size: 36px;
|
color: @color-text-placeholder;
|
}
|
|
.usable {
|
color: @color-text-three !important;
|
}
|
|
li {
|
list-style: none;
|
float: left;
|
width: 33%;
|
text-align: center;
|
padding: 20px 0;
|
|
p {
|
font-size: @font-size-small;
|
}
|
}
|
}
|
}
|
}
|
|
</style>
|