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
| <template>
| <div>
| <div v-loading="statisticLoading">
|
| <el-row :gutter="20">
| <el-col :span="4" class="mb-10">
| <el-card>
| <div class="statistic-title">供应商数量</div>
| <div class="statistic-num">
| <!-- {{ statistic.discountTotalFee || 0 }} -->
| {{ statistic.supplierAmount || 0 }}
| </div>
| </el-card>
| </el-col>
| <el-col :span="4" class="mb-10">
| <el-card>
| <div class="statistic-title">商品总数</div>
| <div class="statistic-num">
| {{ statistic.flowerAmount || 0 }}
| </div>
| </el-card>
| </el-col>
| <el-col :span="4" class="mb-10">
| <el-card>
| <div class="statistic-title">库存</div>
| <div class="statistic-num">
| {{ statistic.flowerStockAmount || 0 }}
| </div>
| </el-card>
| </el-col>
| </el-row>
|
| </div>
| <el-bus-crud ref="crud" v-bind="tableConfig" />
| </div>
| </template>
|
| <script>
| import dayjs from 'dayjs'
| import 'dayjs/locale/zh-cn'
| import { getSupplierListWithIdConfig,getStationListConfig } from '@/utils/form-item-config'
| dayjs.locale('zh-cn')
| export default {
| data() {
| return {
| statistic: {},
| statisticLoading: false,
| tableConfig: {
| url: 'flower/v2/statistic-analysis/flower-material/page',
| hasNew: false,
| hasEdit: false,
| hasDelete: false,
| viewText: '明细',
| hasExport: true,
| hasOperation: false,
| exportUrl: 'flower/v2/statistic-analysis/flower-material/export',
| exportText: '导出',
| onResetView: (row) => {
| const searchFormRef = this.$refs.crud.$refs.searchForm
| const searchFormValue = searchFormRef.getFormValue()
| const url = this.$router.resolve(
| `/report/finance/${row.orderDate}?partnerId=${
| searchFormValue?.partnerId || ''
| }`
| ).href
| window.open(url, '_blank')
| },
| // operationAttrs: {
| // width: 80,
| // fixed: 'right',
| // },
| beforeRequest: async (params) => {
| this.statisticLoading = true
| // eslint-disable-next-line
| let { code, data } = await this.$elBusHttp.request(
| `flower/v2/statistic-analysis/flower-material/statis`,
| { params }
| )
| if (code === 0) {
| data = data || {}
| this.statistic = data || {}
| }
| this.statisticLoading = false
| },
| columns: [
| { label: '供应商ID', prop: 'supplierId', minWidth: '120px' },
| { label: '供应商名称',prop: 'supplierName', minWidth: '120px',
| // fixed: 'left',
| },
| { label: '注册手机号', prop: 'loginName', minWidth: '120px' },
| { label: '联系方式', prop: 'contactTel', minWidth: '120px' },
| { label: '所属集货站', prop: 'stationName', minWidth: '120px' },
| // { label: '品类', prop: 'categoryName', minWidth: '120px' },
| { label: '品类', prop: 'parentCategoryName', minWidth: '120px' },
|
| { label: '商品名称', prop: 'flowerName', minWidth: 150, },
| { label: '等级', prop: 'flowerLevelStr', minWidth: 80 },
| { label: '商品规格', prop: 'flowerUnit', minWidth: 80 },
| { label: '价格', prop: 'flowerPrice', minWidth: 120 },
| { label: '库存', prop: 'flowerStock', minWidth: 120 },
| { label: '状态', prop: 'flowerStatusStr', minWidth: 120 },
|
| ],
| searchFormAttrs: {
| labelWidth: 'auto',
| },
| searchForm: [
| {
| type: 'row',
| items: [
| {
| label: '商品状态:',
| id: 'flowerStatus',
| type: 'bus-radio',
| el: {
| code: 'FLOWER_STATUS',
| hasAll: true,
| childType: 'el-radio-button',
| },
| default: this.$route.query.status || '',
| span: 24,
| searchImmediately: true,
| },
| // { ...getSupplierListWithIdConfig(), label: '供应商' },
| { label: '供应商名称', id: 'supplierName', type: 'input' },
| { label: '供应商ID', id: 'supplierId', type: 'input' },
| { label: '注册手机号', id: 'loginName', type: 'input' },
| { label: '联系方式', id: 'contactTel',type: 'input'},
| {
| ...getStationListConfig(),
| label: '所属集货站',
| },
| {
| label: '商品分类',
| id: 'flowerCategory',
| type: 'bus-cascader',
| el: {
| otherInterfaceUri: 'flower/api/flower/category/tree',
| props: {
| label: 'name',
| value: 'id',
| emitPath: false,
| checkStrictly: true,
| },
| clearable: true,
| filterable: true,
| style: 'width:100%',
| },
| },
| {
| label: '等级',
| id: 'flowerLevel',
| type: 'bus-select-dict',
| el: {
| code: 'FLOWER_LEVEL',
| // multiple: true,
| clearable: true,
| filterable: true,
| style: 'width:100%',
| },
|
| },
| {
| label: '排序字段',
| id: 'orderField',
| type: 'bus-select-dict',
| el: {
| code: 'FLOWER_MATERIAL_FIELD',
| // multiple: true,
| clearable: true,
| filterable: true,
| style: 'width:100%',
| },
|
| },
| {
| label: '排序方式',
| id: 'orderType',
| type: 'bus-select-dict',
| el: {
| code: 'ORDER_BY',
| // multiple: true,
| clearable: true,
| filterable: true,
| style: 'width:100%',
| },
|
| },
|
| ],
| },
| ],
| },
| }
| },
| head() {
| return {
| title: '财务报表',
| }
| },
| }
| </script>
|
| <style lang="scss" scoped>
| @import '@/assets/statistic/index.scss';
|
| .statistic-title {
| text-align: center;
| font-size: 16px;
| color: $main-title-color;
| font-weight: bold;
| margin-bottom: 6px;
| }
| .statistic-num {
| text-align: center;
| font-size: 16px;
| color: $primary-color;
| }
|
| </style>
|
|