index.vue
4.92 KB
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
<template>
<div class="out_main">
<!-- <div class="base-info-index"> -->
<div class="top_baceInfo">
<img class="sign_icon" src="../../assets/scrm_base_info_icon_one.png" />
<div class="info_widget">
<div style="display: flex">
<div class="title_text">
{{ blocInfo.merchantName }}
<span class="min_text">(商户号:{{ blocInfo.merchantNo }})</span>
</div>
<GLButton type="primary" :size="size" @click="editInfo" fn="修改企业信息">编辑</GLButton>
<!-- <el-button type="primary" :size="size" @click="editInfo">修改企业信息</el-button> -->
</div>
<div class="sec_title_text dr_top_1">
<span>关联企微:{{ blocInfo.entmicroName || '--' }}</span>
<div v-if="blocInfo.entmicroName" class="auth_btn" :class="accountLevel != 4 ? 'auth_btn_cp' : ''">已授权</div>
</div>
<div v-if="accountLevel == 1" class="min_text dr_top_1">所属企业:--</div>
<div v-if="accountLevel != 1" class="min_text dr_top_1">所属企业:{{ blocInfo.parentName }}</div>
<div v-if="blocInfo.channelId == 2" class="min_text">商户SAP编码:{{ blocInfo.sapCode ? blocInfo.sapCode : '--' }}</div>
<div v-if="accountLevel == 4" class="min_text">企微员工:{{ blocInfo.entMicroEmployeeCount }}人</div>
</div>
</div>
<blocModule :bloc="blocInfo" :list.sync="storesList" v-if="accountLevel != 4"></blocModule>
<shopModule :bloc="blocInfo" v-if="accountLevel == 4"></shopModule>
<!-- </div> -->
</div>
</template>
<script>
import shopModule from './shop.vue'
import blocModule from './bloc.vue'
// import { merchantInfo } from '../../api/modules/baseinfoApi'
export default {
name: 'index',
components: {
shopModule,
blocModule
},
data() {
return {
platform: 1, //1 集团 2 门店
accountLevel: 1, //1-工厂;2-省代;3-市代;4-门店
blocInfo: {
merchantName: ''
},
storesList: []
}
},
created() {
//this.$globalState.accountLevel
const { session } = this.$globalState
this.platform = session.merchantModel
this.loginInfo = session
this.accountLevel = session.accountLevel
this.getBlocData()
},
methods: {
getBlocData() {
let para = {
merchantId: this.loginInfo.merchantId
}
this.$apis.baseInfo.merchantInfo(para).then(res => {
this.blocInfo = res
if (res.stores) {
this.storesList = res.stores.map(item => {
item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}`
return item
})
}
})
},
dateFormat: function(dateTime, format = 'yyyy-MM-dd') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
},
editInfo() {
this.$router.push({ path: '/baseInfo/editInfo' })
}
}
}
</script>
<style lang="scss" scoped>
.out_main {
box-sizing: border-box;
height: 100%;
// margin: 0 20px 64px 40px;
background: #fff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// min-height: calc(100vh - 144px);
}
.base-info-index {
width: 100%;
height: calc(100vh - 144px);
background: #fff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
overflow: hidden;
overflow-y: scroll;
}
.out_main::-webkit-scrollbar {
height: 1px;
width: 8px;
}
.out_main::-webkit-scrollbar-thumb {
background: #e9e8ff;
border-radius: 7px;
}
.top_baceInfo {
width: 100%;
box-sizing: border-box;
padding: 40px 40px 0 40px;
display: flex;
.sign_icon {
width: 64px;
height: 64px;
border-radius: 50%;
}
.info_widget {
margin-left: 15px;
width: 100%;
.title_text {
color: #333333;
font-size: 16px;
font-weight: 500;
width: 100%;
}
.min_text {
color: #999999;
font-size: 12px;
line-height: 20px;
}
.sec_title_text {
color: #333333;
font-size: 14px;
font-weight: 400;
.auth_btn {
width: 48px;
height: 20px;
text-align: center;
line-height: 20px;
border-radius: 1px;
border: 1px solid rgba(44, 202, 116, 0.35);
font-size: 12px;
font-weight: 400;
color: #2cca74;
display: inline-block;
margin-left: 16px;
}
.auth_btn_cp {
color: #2cca74;
background: rgba(44, 202, 116, 0.06);
border-radius: 2px;
border: 1px solid rgba(44, 202, 116, 0.35);
}
}
.dr_top_1 {
margin-top: 8px;
}
}
}
</style>