index.vue
9.29 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
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<template>
<div class="NCC-common-layout">
<div class="NCC-common-layout-center">
<!-- 搜索区域 -->
<el-row class="NCC-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="5">
<el-form-item label="门店编码">
<el-input
v-model="query.mdbm"
placeholder="请输入门店编码"
clearable
prefix-icon="el-icon-search"
style="border-radius: 6px;"
/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="门店名称">
<el-input
v-model="query.dm"
placeholder="请输入门店名称"
clearable
prefix-icon="el-icon-search"
style="border-radius: 6px;"
/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="单据门店">
<el-input
v-model="query.djmd"
placeholder="请输入单据门店"
clearable
prefix-icon="el-icon-search"
style="border-radius: 6px;"
/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="城市">
<el-input
v-model="query.cs"
placeholder="请输入城市"
clearable
prefix-icon="el-icon-search"
style="border-radius: 6px;"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<div class="search-buttons" style="height: 32px;">
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
</div>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="NCC-common-layout-main NCC-flex-main">
<div class="NCC-common-head">
<div class="NCC-common-head-left">
<h3 class="NCC-common-head-title">
<i class="el-icon-target"></i>
门店目标设置
</h3>
</div>
<div class="NCC-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" />
</el-tooltip>
<screenfull isContainer />
</div>
</div>
<NCC-table
v-loading="listLoading"
:data="list"
>
<el-table-column prop="mdbm" label="门店编码" align="left" width="120" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag size="small" type="primary">{{ scope.row.mdbm }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="dm" label="门店名称" align="left" min-width="150" show-overflow-tooltip>
<template slot-scope="scope">
<span class="store-name">{{ scope.row.dm }}</span>
</template>
</el-table-column>
<el-table-column prop="djmd" label="单据门店" align="left" width="150" show-overflow-tooltip />
<el-table-column prop="cs" label="城市" align="left" width="100" show-overflow-tooltip />
<!-- 目标字段列 -->
<el-table-column label="固定-生命线" align="center" width="120">
<template slot-scope="scope">
<span v-if="scope.row.xsyj" class="target-value">{{ formatMoney(scope.row.xsyj) }}元</span>
<span v-else class="no-data">未设置</span>
</template>
</el-table-column>
<el-table-column label="固定-消耗业绩" align="center" width="120">
<template slot-scope="scope">
<span v-if="scope.row.xhyj" class="target-value">{{ formatMoney(scope.row.xhyj) }}元</span>
<span v-else class="no-data">未设置</span>
</template>
</el-table-column>
<el-table-column label="固定-项目数" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.xms" class="target-value">{{ scope.row.xms }}个</span>
<span v-else class="no-data">-</span>
</template>
</el-table-column>
<el-table-column label="固定-人头" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.rc" class="target-value">{{ scope.row.rc }}次</span>
<span v-else class="no-data">-</span>
</template>
</el-table-column>
<el-table-column label="阶段一人头" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.rt1" class="target-value">{{ scope.row.rt1 }}人</span>
<span v-else class="no-data">-</span>
</template>
</el-table-column>
<el-table-column label="阶段二人头" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.rt2" class="target-value">{{ scope.row.rt2 }}人</span>
<span v-else class="no-data">-</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="120" align="center">
<template slot-scope="scope">
<el-button
type="text"
icon="el-icon-edit"
@click="editHandle(scope.row)"
class="action-btn"
>
设置目标
</el-button>
</template>
</el-table-column>
</NCC-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
</div>
<!-- 目标设置弹窗 -->
<TargetSettingDialog
:visible.sync="dialogVisible"
:store-data="currentStoreData"
@refresh="initData"
/>
</div>
</template>
<script>
import request from '@/utils/request'
import TargetSettingDialog from './components/TargetSettingDialog.vue'
export default {
components: {
TargetSettingDialog
},
data() {
return {
query: {
mdbm: undefined,
dm: undefined,
djmd: undefined,
cs: undefined
},
list: [],
listLoading: true,
total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
dialogVisible: false,
currentStoreData: {}
}
},
computed: {},
created() {
this.initData()
},
methods: {
// 格式化金额显示
formatMoney(value) {
if (!value) return '0.00'
return parseFloat(value).toFixed(2)
},
// 编辑处理
editHandle(row) {
this.currentStoreData = { ...row }
this.dialogVisible = true
},
async initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query
};
let query = {}
for (let key in _query) {
if (Array.isArray(_query[key])) {
query[key] = _query[key].join()
} else {
query[key] = _query[key]
}
}
try {
const res = await request({
url: `/api/Extend/LqMdxx`,
method: 'GET',
data: query
})
this.list = res.data.list
this.total = res.data.pagination.total
} catch (error) {
console.error('加载门店数据失败:', error)
} finally {
this.listLoading = false
}
},
search() {
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
}
}
}
</script>
<style lang="scss" scoped>
// 页面头部样式
.NCC-common-head-left {
display: flex;
align-items: center;
gap: 12px;
}
.NCC-common-head-title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #303133;
display: flex;
align-items: center;
gap: 8px;
i {
color: #409EFF;
font-size: 20px;
}
}
// 表格样式
.store-name {
font-weight: 500;
color: #303133;
}
.target-value {
font-weight: 500;
color: #67C23A;
}
.no-data {
color: #C0C4CC;
font-style: italic;
}
.action-btn {
padding: 4px 8px;
margin: 0 2px;
&:hover {
background-color: #f5f7fa;
}
}
// 搜索区域样式
.search-buttons {
display: flex;
align-items: center;
gap: 8px;
}
// 响应式设计
@media (max-width: 768px) {
.NCC-common-head {
flex-direction: column;
align-items: flex-start;
gap: 12px;
.NCC-common-head-right {
width: 100%;
justify-content: flex-start;
}
}
.el-col {
margin-bottom: 16px;
}
}
// 表格响应式
@media (max-width: 1200px) {
.NCC-table {
.el-table {
font-size: 12px;
}
}
}
</style>