|
|
@@ -1,60 +1,504 @@
|
|
1
|
1
|
<template>
|
|
2
|
|
- <div>
|
|
3
|
|
- <SearchBox ref="SearchBoxRef" formName="selectTop" :formData="query" @showPop="showPop" @reset="reset"></SearchBox>
|
|
4
|
|
- <ButtonBox @search="handleSearch" @add="insertDialog" @start="start('0')" @remove="shutdwon('1')"></ButtonBox>
|
|
5
|
|
- </div>
|
|
|
2
|
+ <div>
|
|
|
3
|
+ <el-card :body-style="cardBodyStyle">
|
|
|
4
|
+ <el-form :model="query" label-width="90px" label-position="right">
|
|
|
5
|
+ <el-row :gutter="10">
|
|
|
6
|
+ <el-col :span="6">
|
|
|
7
|
+ <el-form-item label="库房名称">
|
|
|
8
|
+ <el-select
|
|
|
9
|
+ v-model="query.wareId"
|
|
|
10
|
+ clearable
|
|
|
11
|
+ filterable
|
|
|
12
|
+ placeholder="请选择库房"
|
|
|
13
|
+ style="width: 100%;"
|
|
|
14
|
+ @visible-change="handleWareVisible"
|
|
|
15
|
+ >
|
|
|
16
|
+ <el-option
|
|
|
17
|
+ v-for="item in wareOptions"
|
|
|
18
|
+ :key="item.value"
|
|
|
19
|
+ :label="item.label"
|
|
|
20
|
+ :value="item.value"
|
|
|
21
|
+ />
|
|
|
22
|
+ </el-select>
|
|
|
23
|
+ </el-form-item>
|
|
|
24
|
+ </el-col>
|
|
|
25
|
+ <el-col :span="6">
|
|
|
26
|
+ <el-form-item label="垛位名称">
|
|
|
27
|
+ <el-input v-model="query.stackName" clearable placeholder="请输入垛位名称" />
|
|
|
28
|
+ </el-form-item>
|
|
|
29
|
+ </el-col>
|
|
|
30
|
+ <el-col :span="6">
|
|
|
31
|
+ <el-form-item label="品名">
|
|
|
32
|
+ <el-input v-model="query.materialName" clearable placeholder="请输入品名" />
|
|
|
33
|
+ </el-form-item>
|
|
|
34
|
+ </el-col>
|
|
|
35
|
+ <el-col :span="6">
|
|
|
36
|
+ <el-form-item label="钢种">
|
|
|
37
|
+ <el-input v-model="query.stGrade" clearable placeholder="请输入钢种" />
|
|
|
38
|
+ </el-form-item>
|
|
|
39
|
+ </el-col>
|
|
|
40
|
+ </el-row>
|
|
6
|
41
|
|
|
|
42
|
+ <el-row :gutter="10">
|
|
|
43
|
+ <el-col :span="6">
|
|
|
44
|
+ <el-form-item label="规格型号">
|
|
|
45
|
+ <el-input v-model="query.materialStandard" clearable placeholder="请输入规格型号" />
|
|
|
46
|
+ </el-form-item>
|
|
|
47
|
+ </el-col>
|
|
|
48
|
+ <el-col :span="6">
|
|
|
49
|
+ <el-form-item label="捆包号">
|
|
|
50
|
+ <el-input v-model="query.bundleNo" clearable placeholder="请输入捆包号" />
|
|
|
51
|
+ </el-form-item>
|
|
|
52
|
+ </el-col>
|
|
|
53
|
+ <el-col :span="6">
|
|
|
54
|
+ <el-form-item label="材料号">
|
|
|
55
|
+ <el-input v-model="query.inProdNo" clearable placeholder="请输入材料号" />
|
|
|
56
|
+ </el-form-item>
|
|
|
57
|
+ </el-col>
|
|
|
58
|
+ <el-col :span="6">
|
|
|
59
|
+ <el-form-item label="订单号">
|
|
|
60
|
+ <el-input v-model="query.orderNo" clearable placeholder="请输入订单号" />
|
|
|
61
|
+ </el-form-item>
|
|
|
62
|
+ </el-col>
|
|
|
63
|
+ </el-row>
|
|
|
64
|
+
|
|
|
65
|
+ <el-row :gutter="10">
|
|
|
66
|
+ <el-col :span="6">
|
|
|
67
|
+ <el-form-item label="合约号">
|
|
|
68
|
+ <el-input v-model="query.contractNo" clearable placeholder="请输入合约号" />
|
|
|
69
|
+ </el-form-item>
|
|
|
70
|
+ </el-col>
|
|
|
71
|
+ <el-col :span="6">
|
|
|
72
|
+ <el-form-item label="货权单位">
|
|
|
73
|
+ <el-select
|
|
|
74
|
+ v-model="query.ownerCompany"
|
|
|
75
|
+ clearable
|
|
|
76
|
+ filterable
|
|
|
77
|
+ placeholder="请选择货权单位"
|
|
|
78
|
+ style="width: 100%;"
|
|
|
79
|
+ @visible-change="handleOwnerVisible"
|
|
|
80
|
+ >
|
|
|
81
|
+ <el-option
|
|
|
82
|
+ v-for="item in ownerCompanyOptions"
|
|
|
83
|
+ :key="item.value"
|
|
|
84
|
+ :label="item.label"
|
|
|
85
|
+ :value="item.value"
|
|
|
86
|
+ />
|
|
|
87
|
+ </el-select>
|
|
|
88
|
+ </el-form-item>
|
|
|
89
|
+ </el-col>
|
|
|
90
|
+ <el-col :span="6">
|
|
|
91
|
+ <el-form-item label="客户名称">
|
|
|
92
|
+ <el-select
|
|
|
93
|
+ v-model="query.customerCompany"
|
|
|
94
|
+ clearable
|
|
|
95
|
+ filterable
|
|
|
96
|
+ placeholder="请选择客户名称"
|
|
|
97
|
+ style="width: 100%;"
|
|
|
98
|
+ @visible-change="handleCustomerVisible"
|
|
|
99
|
+ >
|
|
|
100
|
+ <el-option
|
|
|
101
|
+ v-for="item in customerCompanyOptions"
|
|
|
102
|
+ :key="item.value"
|
|
|
103
|
+ :label="item.label"
|
|
|
104
|
+ :value="item.value"
|
|
|
105
|
+ />
|
|
|
106
|
+ </el-select>
|
|
|
107
|
+ </el-form-item>
|
|
|
108
|
+ </el-col>
|
|
|
109
|
+ <el-col :span="6">
|
|
|
110
|
+ <el-form-item label="出库车号">
|
|
|
111
|
+ <el-input v-model="query.outTruckNo" clearable placeholder="请输入出库车号" />
|
|
|
112
|
+ </el-form-item>
|
|
|
113
|
+ </el-col>
|
|
|
114
|
+ </el-row>
|
|
|
115
|
+
|
|
|
116
|
+ <el-row :gutter="10">
|
|
|
117
|
+ <el-col :span="8">
|
|
|
118
|
+ <el-form-item label="出库时间">
|
|
|
119
|
+ <el-date-picker
|
|
|
120
|
+ v-model="query.outDtmRange"
|
|
|
121
|
+ type="datetimerange"
|
|
|
122
|
+ range-separator="至"
|
|
|
123
|
+ start-placeholder="开始时间"
|
|
|
124
|
+ end-placeholder="结束时间"
|
|
|
125
|
+ :default-time="defaultRangeTime"
|
|
|
126
|
+ style="width: 100%;"
|
|
|
127
|
+ />
|
|
|
128
|
+ </el-form-item>
|
|
|
129
|
+ </el-col>
|
|
|
130
|
+ <el-col :span="8">
|
|
|
131
|
+ <el-form-item label=" ">
|
|
|
132
|
+ <el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
133
|
+ <el-button @click="handleReset">重置</el-button>
|
|
|
134
|
+ </el-form-item>
|
|
|
135
|
+ </el-col>
|
|
|
136
|
+ </el-row>
|
|
|
137
|
+ </el-form>
|
|
|
138
|
+ </el-card>
|
|
|
139
|
+
|
|
|
140
|
+ <el-card :body-style="cardBodyStyle" class="summary-card">
|
|
|
141
|
+ <el-row :gutter="20">
|
|
|
142
|
+ <el-col :span="6">
|
|
|
143
|
+ <div class="summary-item">
|
|
|
144
|
+ <span class="summary-label">出库数量统计:</span>
|
|
|
145
|
+ <span class="summary-value">{{ statistics.totalQuantity ?? '-' }}</span>
|
|
|
146
|
+ </div>
|
|
|
147
|
+ </el-col>
|
|
|
148
|
+ <el-col :span="6">
|
|
|
149
|
+ <div class="summary-item">
|
|
|
150
|
+ <span class="summary-label">出库重量统计:</span>
|
|
|
151
|
+ <span class="summary-value">{{ statistics.totalWeight ?? '-' }}</span>
|
|
|
152
|
+ </div>
|
|
|
153
|
+ </el-col>
|
|
|
154
|
+ </el-row>
|
|
|
155
|
+ </el-card>
|
|
|
156
|
+
|
|
|
157
|
+ <el-card :body-style="cardBodyStyle">
|
|
|
158
|
+ <el-table
|
|
|
159
|
+ v-loading="tableLoading"
|
|
|
160
|
+ :data="tableData"
|
|
|
161
|
+ border
|
|
|
162
|
+ highlight-current-row
|
|
|
163
|
+ >
|
|
|
164
|
+ <el-table-column type="index" label="序号" align="center" width="60">
|
|
|
165
|
+ <template #default="scope">
|
|
|
166
|
+ <span>{{ scope.$index + (currentPage - 1) * pageSize + 1 }}</span>
|
|
|
167
|
+ </template>
|
|
|
168
|
+ </el-table-column>
|
|
|
169
|
+ <el-table-column label="仓库名称" min-width="140" header-align="center" align="center">
|
|
|
170
|
+ <template #default="{ row }">
|
|
|
171
|
+ {{ row.outWareName ?? row.wareName ?? '-' }}
|
|
|
172
|
+ </template>
|
|
|
173
|
+ </el-table-column>
|
|
|
174
|
+ <el-table-column label="垛位名称" min-width="140" header-align="center" align="center">
|
|
|
175
|
+ <template #default="{ row }">
|
|
|
176
|
+ {{ row.outStackName ?? row.stackName ?? '-' }}
|
|
|
177
|
+ </template>
|
|
|
178
|
+ </el-table-column>
|
|
|
179
|
+ <el-table-column label="层号" width="100" header-align="center" align="center">
|
|
|
180
|
+ <template #default="{ row }">
|
|
|
181
|
+ {{ row.outLayerNo ?? row.layerNo ?? '-' }}
|
|
|
182
|
+ </template>
|
|
|
183
|
+ </el-table-column>
|
|
|
184
|
+ <el-table-column label="物料名称" min-width="160" header-align="center" align="center">
|
|
|
185
|
+ <template #default="{ row }">
|
|
|
186
|
+ {{ row.materialName ?? '-' }}
|
|
|
187
|
+ </template>
|
|
|
188
|
+ </el-table-column>
|
|
|
189
|
+ <el-table-column label="钢种" width="140" header-align="center" align="center">
|
|
|
190
|
+ <template #default="{ row }">
|
|
|
191
|
+ {{ row.ST_GRADE ?? row.stGrade ?? '-' }}
|
|
|
192
|
+ </template>
|
|
|
193
|
+ </el-table-column>
|
|
|
194
|
+ <el-table-column prop="inDtm" label="入库时间" min-width="180" header-align="center" align="center" show-overflow-tooltip />
|
|
|
195
|
+ <el-table-column prop="ownerCompany" label="货权公司" min-width="160" header-align="center" align="center" show-overflow-tooltip />
|
|
|
196
|
+ <el-table-column prop="receivingCompany" label="收货公司" min-width="160" header-align="center" align="center" show-overflow-tooltip />
|
|
|
197
|
+ <el-table-column label="最终客户公司" min-width="180" header-align="center" align="center" show-overflow-tooltip>
|
|
|
198
|
+ <template #default="{ row }">
|
|
|
199
|
+ {{ row.customerCompany ?? row.CustomerCompany ?? '-' }}
|
|
|
200
|
+ </template>
|
|
|
201
|
+ </el-table-column>
|
|
|
202
|
+ <el-table-column prop="inProdNo" label="材料号" min-width="140" header-align="center" align="center" show-overflow-tooltip />
|
|
|
203
|
+ <el-table-column label="出库车号" min-width="140" header-align="center" align="center" show-overflow-tooltip>
|
|
|
204
|
+ <template #default="{ row }">
|
|
|
205
|
+ {{ row.outTruckNo ?? row.carNo ?? '-' }}
|
|
|
206
|
+ </template>
|
|
|
207
|
+ </el-table-column>
|
|
|
208
|
+ <el-table-column prop="orderNo" label="订单号" min-width="160" header-align="center" align="center" show-overflow-tooltip />
|
|
|
209
|
+ <el-table-column prop="contractNo" label="合约号" min-width="160" header-align="center" align="center" show-overflow-tooltip />
|
|
|
210
|
+ <el-table-column label="出库重量" min-width="140" header-align="center" align="right" show-overflow-tooltip>
|
|
|
211
|
+ <template #default="{ row }">
|
|
|
212
|
+ {{ row.outWeight ?? row.OUT_WEIGHT ?? '-' }}
|
|
|
213
|
+ </template>
|
|
|
214
|
+ </el-table-column>
|
|
|
215
|
+ <el-table-column label="出库数量" min-width="140" header-align="center" align="right" show-overflow-tooltip>
|
|
|
216
|
+ <template #default="{ row }">
|
|
|
217
|
+ {{ row.outQuantity ?? row.OUT_QUANTITY ?? '-' }}
|
|
|
218
|
+ </template>
|
|
|
219
|
+ </el-table-column>
|
|
|
220
|
+ <el-table-column label="出库标记" width="140" header-align="center" align="center">
|
|
|
221
|
+ <template #default="{ row }">
|
|
|
222
|
+ <el-tag :type="flagTagType(row.outFlag)" effect="plain">
|
|
|
223
|
+ {{ flagLabel(row.outFlag) }}
|
|
|
224
|
+ </el-tag>
|
|
|
225
|
+ </template>
|
|
|
226
|
+ </el-table-column>
|
|
|
227
|
+ <el-table-column prop="deliveryAddress" label="收货地址" min-width="200" header-align="center" align="center" show-overflow-tooltip />
|
|
|
228
|
+ <el-table-column prop="outDtm" label="出库时间" min-width="180" header-align="center" align="center" show-overflow-tooltip />
|
|
|
229
|
+ </el-table>
|
|
|
230
|
+ </el-card>
|
|
|
231
|
+
|
|
|
232
|
+ <el-card :body-style="cardBodyStyle">
|
|
|
233
|
+ <el-pagination
|
|
|
234
|
+ :current-page="currentPage"
|
|
|
235
|
+ :page-size="pageSize"
|
|
|
236
|
+ :page-sizes="pageSizes"
|
|
|
237
|
+ :total="totalRows"
|
|
|
238
|
+ background="background"
|
|
|
239
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
240
|
+ @size-change="handleSizeChange"
|
|
|
241
|
+ @current-change="handleCurrentChange"
|
|
|
242
|
+ />
|
|
|
243
|
+ </el-card>
|
|
|
244
|
+ </div>
|
|
7
|
245
|
</template>
|
|
8
|
246
|
|
|
9
|
247
|
<script setup>
|
|
10
|
|
-import ButtonBar from '@/components/ButtonBar.vue'
|
|
11
|
|
-
|
|
12
|
248
|
import {getCurrentInstance, onMounted, reactive, ref} from 'vue'
|
|
13
|
249
|
import tools from '@/tools'
|
|
14
|
|
-import Attachment from '@/components/Attachment.vue'
|
|
15
|
|
-import ButtonBox from "@/components/ButtonBox.vue";
|
|
16
|
|
-import SearchBox from "@/components/SearchBox.vue";
|
|
17
|
|
-import SelectorComponent from "@/views/sal/components/Selector_component.vue";
|
|
18
|
250
|
|
|
19
|
|
-const {
|
|
20
|
|
- proxy
|
|
21
|
|
-} = getCurrentInstance()
|
|
|
251
|
+const {proxy} = getCurrentInstance()
|
|
22
|
252
|
|
|
23
|
253
|
const cardBodyStyle = ref(tools.style.card)
|
|
24
|
|
-const inputStyle = ref(tools.style.input)
|
|
|
254
|
+const tableLoading = ref(false)
|
|
|
255
|
+const tableData = ref([])
|
|
|
256
|
+const currentPage = ref(1)
|
|
|
257
|
+const totalRows = ref(0)
|
|
|
258
|
+const pageSizes = ref([10, 20, 50, 100])
|
|
|
259
|
+const pageSize = ref(10)
|
|
25
|
260
|
|
|
|
261
|
+const listUrl = ref('sto/OutRecord/query')
|
|
|
262
|
+const statisticsUrl = ref('sto/OutRecord/statistics')
|
|
26
|
263
|
|
|
|
264
|
+const wareOptions = ref([])
|
|
|
265
|
+const ownerCompanyOptions = ref([])
|
|
|
266
|
+const customerCompanyOptions = ref([])
|
|
|
267
|
+const statistics = reactive({
|
|
|
268
|
+ totalQuantity: 0,
|
|
|
269
|
+ totalWeight: 0
|
|
|
270
|
+})
|
|
|
271
|
+const defaultRangeTime = [
|
|
|
272
|
+ new Date(0, 0, 0, 0, 0, 0),
|
|
|
273
|
+ new Date(0, 0, 0, 23, 59, 59)
|
|
|
274
|
+]
|
|
27
|
275
|
|
|
28
|
|
-const PopupMenuTreeRef = ref(null)
|
|
29
|
|
-const showPop = () => {
|
|
30
|
|
- console.log('showPop')
|
|
31
|
|
- PopupMenuTreeRef.value.show()
|
|
32
|
|
-}
|
|
33
|
|
-const url = ref('sto/Config/query')
|
|
34
|
|
-const pageType = ref(true)
|
|
|
276
|
+const toOptions = (list, labelKey, valueKey) =>
|
|
|
277
|
+ (list || []).map((item) => {
|
|
|
278
|
+ if (typeof item === 'string') {
|
|
|
279
|
+ return {
|
|
|
280
|
+ label: item,
|
|
|
281
|
+ value: item
|
|
|
282
|
+ }
|
|
|
283
|
+ }
|
|
|
284
|
+ return {
|
|
|
285
|
+ label: item?.[labelKey] ?? item?.label ?? item?.name ?? item?.value ?? '',
|
|
|
286
|
+ value: item?.[valueKey] ?? item?.value ?? item?.id ?? item?.code ?? item?.label ?? ''
|
|
|
287
|
+ }
|
|
|
288
|
+ }).filter((item) => item.label !== '' && item.value !== '')
|
|
35
|
289
|
|
|
36
|
|
-var now = new Date();
|
|
37
|
|
-const query = ref({
|
|
38
|
|
- wareName: '',
|
|
|
290
|
+const createDefaultQuery = () => {
|
|
|
291
|
+ const today = new Date()
|
|
|
292
|
+ const start = new Date(today.getFullYear(), today.getMonth(), today.getDate())
|
|
|
293
|
+ const end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 23, 59, 59, 999)
|
|
|
294
|
+ return {
|
|
|
295
|
+ wareId: '',
|
|
39
|
296
|
stackName: '',
|
|
40
|
297
|
materialName: '',
|
|
|
298
|
+ stGrade: '',
|
|
41
|
299
|
materialStandard: '',
|
|
42
|
|
- startDtm: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
|
|
43
|
|
- endDtm: new Date(now.getFullYear(), now.getMonth(), now.getDate()+1),
|
|
|
300
|
+ bundleNo: '',
|
|
|
301
|
+ inProdNo: '',
|
|
|
302
|
+ orderNo: '',
|
|
|
303
|
+ contractNo: '',
|
|
44
|
304
|
ownerCompany: '',
|
|
45
|
|
- receivingCompany: '',
|
|
46
|
|
- CustomerCompany: '',
|
|
47
|
|
- prodNo: '',
|
|
48
|
|
- carNo: '',
|
|
49
|
|
- orderNo: '',
|
|
50
|
|
- contractNo: ''
|
|
51
|
|
-})
|
|
|
305
|
+ customerCompany: '',
|
|
|
306
|
+ outTruckNo: '',
|
|
|
307
|
+ outFlag: '',
|
|
|
308
|
+ outDtmRange: [start, end]
|
|
|
309
|
+ }
|
|
|
310
|
+}
|
|
|
311
|
+const query = reactive(createDefaultQuery())
|
|
52
|
312
|
|
|
|
313
|
+const formatDateTime = (value, isEnd = false) => {
|
|
|
314
|
+ if (!value) return ''
|
|
|
315
|
+ const date = new Date(value)
|
|
|
316
|
+ if (Number.isNaN(date.getTime())) return ''
|
|
|
317
|
+ if (isEnd && date.getHours() === 0 && date.getMinutes() === 0 && date.getSeconds() === 0) {
|
|
|
318
|
+ date.setHours(23, 59, 59, 999)
|
|
|
319
|
+ }
|
|
|
320
|
+ const pad = (num) => String(num).padStart(2, '0')
|
|
|
321
|
+ const yyyy = date.getFullYear()
|
|
|
322
|
+ const mm = pad(date.getMonth() + 1)
|
|
|
323
|
+ const dd = pad(date.getDate())
|
|
|
324
|
+ const hh = pad(date.getHours())
|
|
|
325
|
+ const mi = pad(date.getMinutes())
|
|
|
326
|
+ const ss = pad(date.getSeconds())
|
|
|
327
|
+ return `${yyyy}-${mm}-${dd} ${hh}:${mi}:${ss}`
|
|
|
328
|
+}
|
|
|
329
|
+
|
|
|
330
|
+const buildQueryParams = () => {
|
|
|
331
|
+ const [startOut, endOut] = query.outDtmRange || []
|
|
|
332
|
+ return {
|
|
|
333
|
+ wareId: query.wareId,
|
|
|
334
|
+ stackName: query.stackName,
|
|
|
335
|
+ materialName: query.materialName,
|
|
|
336
|
+ stGrade: query.stGrade,
|
|
|
337
|
+ materialStandard: query.materialStandard,
|
|
|
338
|
+ bundleNo: query.bundleNo,
|
|
|
339
|
+ inProdNo: query.inProdNo,
|
|
|
340
|
+ orderNo: query.orderNo,
|
|
|
341
|
+ contractNo: query.contractNo,
|
|
|
342
|
+ ownerCompany: query.ownerCompany,
|
|
|
343
|
+ customerCompany: query.customerCompany,
|
|
|
344
|
+ outTruckNo: query.outTruckNo,
|
|
|
345
|
+ outFlag: query.outFlag,
|
|
|
346
|
+ startDtm: formatDateTime(startOut),
|
|
|
347
|
+ endDtm: formatDateTime(endOut, true)
|
|
|
348
|
+ }
|
|
|
349
|
+}
|
|
|
350
|
+
|
|
|
351
|
+const getTableData = () => {
|
|
|
352
|
+ tableLoading.value = true
|
|
|
353
|
+ const param = {
|
|
|
354
|
+ page: currentPage.value,
|
|
|
355
|
+ rows: pageSize.value,
|
|
|
356
|
+ params: JSON.stringify(buildQueryParams())
|
|
|
357
|
+ }
|
|
|
358
|
+ proxy.$axios.get(listUrl.value, param).then((response) => {
|
|
|
359
|
+ if (response.data.code === '0') {
|
|
|
360
|
+ tableData.value = response.data.data.records || []
|
|
|
361
|
+ totalRows.value = response.data.data.total || 0
|
|
|
362
|
+ } else {
|
|
|
363
|
+ ElMessage.error(`查询失败:${response.data.msg || ''}`)
|
|
|
364
|
+ }
|
|
|
365
|
+ }).catch((error) => {
|
|
|
366
|
+ ElMessage.error(`查询失败:${error.message || ''}`)
|
|
|
367
|
+ }).finally(() => {
|
|
|
368
|
+ tableLoading.value = false
|
|
|
369
|
+ })
|
|
|
370
|
+}
|
|
|
371
|
+
|
|
|
372
|
+const getStatistics = () => {
|
|
|
373
|
+ const param = {
|
|
|
374
|
+ params: JSON.stringify(buildQueryParams())
|
|
|
375
|
+ }
|
|
|
376
|
+ proxy.$axios
|
|
|
377
|
+ .get(statisticsUrl.value, param)
|
|
|
378
|
+ .then((response) => {
|
|
|
379
|
+ if (response.data.code === '0' || response.data.code === 0) {
|
|
|
380
|
+ const data = response.data.data || {}
|
|
|
381
|
+ statistics.totalQuantity =
|
|
|
382
|
+ data.totalQuantity ??
|
|
|
383
|
+ data.outQuantity ??
|
|
|
384
|
+ data.OUT_QUANTITY ??
|
|
|
385
|
+ data.totalQty ??
|
|
|
386
|
+ 0
|
|
|
387
|
+ statistics.totalWeight =
|
|
|
388
|
+ data.totalWeight ??
|
|
|
389
|
+ data.outWeight ??
|
|
|
390
|
+ data.OUT_WEIGHT ??
|
|
|
391
|
+ data.totalWgt ??
|
|
|
392
|
+ 0
|
|
|
393
|
+ } else {
|
|
|
394
|
+ ElMessage.error(`统计失败:${response.data.msg || ''}`)
|
|
|
395
|
+ }
|
|
|
396
|
+ })
|
|
|
397
|
+ .catch((error) => {
|
|
|
398
|
+ ElMessage.error(`统计失败:${error.message || ''}`)
|
|
|
399
|
+ })
|
|
|
400
|
+}
|
|
53
|
401
|
|
|
54
|
|
-const tableData = ref([])
|
|
55
|
|
-const TableBoxRef = ref(null)
|
|
56
|
402
|
const handleSearch = () => {
|
|
57
|
|
- // TableBoxRef.value.search()
|
|
|
403
|
+ currentPage.value = 1
|
|
|
404
|
+ getTableData()
|
|
|
405
|
+ getStatistics()
|
|
|
406
|
+}
|
|
|
407
|
+
|
|
|
408
|
+const handleReset = () => {
|
|
|
409
|
+ Object.assign(query, createDefaultQuery())
|
|
|
410
|
+ handleSearch()
|
|
|
411
|
+}
|
|
|
412
|
+
|
|
|
413
|
+const handleSizeChange = (val) => {
|
|
|
414
|
+ pageSize.value = val
|
|
|
415
|
+ getTableData()
|
|
|
416
|
+}
|
|
|
417
|
+
|
|
|
418
|
+const handleCurrentChange = (val) => {
|
|
|
419
|
+ currentPage.value = val
|
|
58
|
420
|
getTableData()
|
|
59
|
421
|
}
|
|
60
|
|
-</script>
|
|
|
422
|
+
|
|
|
423
|
+const flagLabel = (val) => {
|
|
|
424
|
+ if (val === '1' || val === 1) return '正常'
|
|
|
425
|
+ if (val === '2' || val === 2) return '取消出库'
|
|
|
426
|
+ return val ?? '-'
|
|
|
427
|
+}
|
|
|
428
|
+const flagTagType = (val) => {
|
|
|
429
|
+ if (val === '1' || val === 1) return 'success'
|
|
|
430
|
+ if (val === '2' || val === 2) return 'danger'
|
|
|
431
|
+ return 'info'
|
|
|
432
|
+}
|
|
|
433
|
+
|
|
|
434
|
+const fetchWareOptions = () => {
|
|
|
435
|
+ proxy.$axios.get('sto/Ware/options', {}).then((response) => {
|
|
|
436
|
+ if (response.data.code === 0 || response.data.code === '0') {
|
|
|
437
|
+ wareOptions.value = toOptions(response.data.data, 'label', 'value')
|
|
|
438
|
+ }
|
|
|
439
|
+ })
|
|
|
440
|
+}
|
|
|
441
|
+
|
|
|
442
|
+const fetchOwnerCompanyOptions = () => {
|
|
|
443
|
+ proxy.$axios.get('sto/OutRecord/ownerCompanyOptions', {}).then((response) => {
|
|
|
444
|
+ if (response.data.code === 0 || response.data.code === '0') {
|
|
|
445
|
+ ownerCompanyOptions.value = toOptions(response.data.data, 'label', 'value')
|
|
|
446
|
+ }
|
|
|
447
|
+ })
|
|
|
448
|
+}
|
|
|
449
|
+
|
|
|
450
|
+const fetchCustomerOptions = () => {
|
|
|
451
|
+ proxy.$axios.get('sto/OutRecord/customerCompanyOptions', {}).then((response) => {
|
|
|
452
|
+ if (response.data.code === 0 || response.data.code === '0') {
|
|
|
453
|
+ customerCompanyOptions.value = toOptions(response.data.data, 'label', 'value')
|
|
|
454
|
+ }
|
|
|
455
|
+ })
|
|
|
456
|
+}
|
|
|
457
|
+
|
|
|
458
|
+const handleWareVisible = (visible) => {
|
|
|
459
|
+ if (visible && wareOptions.value.length === 0) {
|
|
|
460
|
+ fetchWareOptions()
|
|
|
461
|
+ }
|
|
|
462
|
+}
|
|
|
463
|
+
|
|
|
464
|
+const handleOwnerVisible = (visible) => {
|
|
|
465
|
+ if (visible && ownerCompanyOptions.value.length === 0) {
|
|
|
466
|
+ fetchOwnerCompanyOptions()
|
|
|
467
|
+ }
|
|
|
468
|
+}
|
|
|
469
|
+
|
|
|
470
|
+const handleCustomerVisible = (visible) => {
|
|
|
471
|
+ if (visible && customerCompanyOptions.value.length === 0) {
|
|
|
472
|
+ fetchCustomerOptions()
|
|
|
473
|
+ }
|
|
|
474
|
+}
|
|
|
475
|
+
|
|
|
476
|
+onMounted(() => {
|
|
|
477
|
+ fetchWareOptions()
|
|
|
478
|
+ fetchOwnerCompanyOptions()
|
|
|
479
|
+ fetchCustomerOptions()
|
|
|
480
|
+ getTableData()
|
|
|
481
|
+ getStatistics()
|
|
|
482
|
+})
|
|
|
483
|
+</script>
|
|
|
484
|
+
|
|
|
485
|
+<style scoped>
|
|
|
486
|
+.summary-card {
|
|
|
487
|
+ margin-top: 10px;
|
|
|
488
|
+}
|
|
|
489
|
+.summary-item {
|
|
|
490
|
+ display: flex;
|
|
|
491
|
+ align-items: center;
|
|
|
492
|
+ height: 40px;
|
|
|
493
|
+}
|
|
|
494
|
+.summary-label {
|
|
|
495
|
+ color: #606266;
|
|
|
496
|
+ margin-right: 6px;
|
|
|
497
|
+ font-weight: 500;
|
|
|
498
|
+}
|
|
|
499
|
+.summary-value {
|
|
|
500
|
+ font-size: 18px;
|
|
|
501
|
+ font-weight: 600;
|
|
|
502
|
+ color: #303133;
|
|
|
503
|
+}
|
|
|
504
|
+</style>
|