flagDialog.vue
3.52 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
<!-- 员工标签 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" class="accountDailog"
@handleClick="handleAddConfirm">
<div class="detail-dialog">
<el-form ref="flagFrom" class="flagFrom d2-container-content" :model="infoForm" label-width="250px"
v-loading="$store.state.d2admin.loading.value">
<el-form-item label="员工姓名:" class="flag-div">
{{ info.staffName }}
</el-form-item>
<el-form-item label="服务门店:" class="flag-div">
<el-select v-model="shopMerchant" placeholder="请选择" class="el_select itd" @change="staffLabelDetail">
<el-option v-for="item in info.shopMerchantList" :key="item.merchantId" :value="item.merchantId"
:label="item.merchantName + ' ' + item.merchantId" />
</el-select>
</el-form-item>
<el-form-item label="" v-for="(item, index1) in commLabelUnitList" class="flag-div" :key="index1">
<span class="tips-block" slot="label">
<span class="tips-label">{{ item.commLabelGroupInfo.groupName }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" placement="right">
<div slot="content">{{ item.commLabelGroupInfo.groupDesc }}</div>
<span class="tips-icon" />
</el-tooltip>:
</span>
<span v-for="(obj, index2) in item.commLabelList" class="label-span" :key="index2">{{ obj.labelName }}</span>
</el-form-item>
</el-form>
</div>
</baseDialog>
</template>
<script>
// import { sceneCodeList, transferTypeList } from '@/common/constants.js'
import { Util, deepClone } from '@/common/util'
import { staffLabelDetail } from '@/api/inStoreManage.js'
export default {
name: 'FlagDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
},
dialogConfig: {
title: '员工标签',
width: '1080px'
},
editChildRef: 'editChildRef',
baseData: {
},
commLabelUnitList: [],
shopMerchant: ''
}
},
props: {
flagVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: null
}
},
watch: {
},
computed: {
visible: {
get() {
return this.flagVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'flagVisible' })
}
}
},
mounted() {
if (this.info.shopMerchantList) {
this.shopMerchant = this.info.shopMerchantList[0].merchantId
}
this.staffLabelDetail()
},
methods: {
staffLabelDetail() {
var params = {}
params.staffUuid = this.info.staffUuid
params.merchantId = this.shopMerchant
staffLabelDetail(params).then(res => {
this.commLabelUnitList = deepClone(res.commLabelUnitList)
})
},
handleAddConfirm() {
this.visible = true
}
}
}
</script>
<style lang="scss" scoped>
.flagFrom.d2-container-content {
margin-top: 0 !important;
}
.detail-dialog {
.itd {
width: 400px;
}
.flag-div {
// height: 40rpx;
// font-family: PingFangSC-Regular;
// font-weight: 400;
// font-size: 28rpx;
// line-height: 40rpx;
.label-span {
margin-right: 10px;
max-width: 250px;
height: 26px;
background: #fafbfe;
border: 1px solid #e8e8ea;
border-radius: 4px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #666666;
padding: 4px 8px;
}
}
}
</style>