liangjin
2021-03-22 f4e5a0b03b0cf679e6489d9d47e7fb8ab4672578
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!--
 * @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 => {
                    // console.log(res.body)
                    // 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>