Commit 22fea1855244a83b8211bc89492174ac9a9c8b5e
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4 into develop
Showing
30 changed files
with
662 additions
and
227 deletions
ant-design-vue-jeecg/src/assets/less/TableExpand.less
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | size="middle" |
25 | 25 | bordered |
26 | 26 | rowKey="id" |
27 | + class="j-table-force-nowrap" | |
27 | 28 | :scroll="{ x: true }" |
28 | 29 | :columns="columns" |
29 | 30 | :dataSource="dataSource" |
... | ... | @@ -129,8 +130,8 @@ export default { |
129 | 130 | title: '库存详情ID', |
130 | 131 | align: 'center', |
131 | 132 | dataIndex: 'id', |
132 | - fixed: "left", | |
133 | - width: 100, | |
133 | + // fixed: "left", | |
134 | + // width: 100, | |
134 | 135 | }, |
135 | 136 | { |
136 | 137 | title: '货主', |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | 8 | <a-form-item label="库区"> |
9 | - <a-form-model-item prop="zoneOptions"> | |
9 | + <a-form-model-item prop="zoneOptions"> | |
10 | 10 | <j-multi-select-tag |
11 | 11 | v-model="queryParam.zoneCode" |
12 | 12 | :options="zoneOptions" |
... | ... | @@ -179,8 +179,8 @@ export default { |
179 | 179 | { |
180 | 180 | title: '库存ID', |
181 | 181 | align: "center", |
182 | - fixed: "left", | |
183 | - width: 100, | |
182 | + // fixed: "left", | |
183 | + // width: 100, | |
184 | 184 | dataIndex: 'id' |
185 | 185 | }, |
186 | 186 | { |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/InventoryMaterialSummaryList.vue
... | ... | @@ -84,6 +84,7 @@ |
84 | 84 | size="middle" |
85 | 85 | :scroll="{ x: true }" |
86 | 86 | bordered |
87 | + class="j-table-force-nowrap" | |
87 | 88 | :rowKey="(record,index) => {return record.zoneCode + '_' + record.materialCode}" |
88 | 89 | :columns="columns" |
89 | 90 | :dataSource="dataSource" |
... | ... | @@ -91,7 +92,6 @@ |
91 | 92 | :loading="loading" |
92 | 93 | :customRow="clickThenSelect" |
93 | 94 | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }" |
94 | - class="j-table-force-nowrap" | |
95 | 95 | @change="handleTableChange" |
96 | 96 | > |
97 | 97 | <span slot="companyCode" slot-scope="companyCode"> |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... | ... | @@ -167,12 +167,12 @@ |
167 | 167 | :scroll="{ x: true }" |
168 | 168 | bordered |
169 | 169 | rowKey="id" |
170 | + class="j-table-force-nowrap" | |
170 | 171 | :columns="columns" |
171 | 172 | :dataSource="dataSource" |
172 | 173 | :pagination="ipagination" |
173 | 174 | :loading="loading" |
174 | 175 | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
175 | - class="j-table-force-nowrap" | |
176 | 176 | @change="handleTableChange" |
177 | 177 | > |
178 | 178 | <span slot="containerStatus_dictText" slot-scope="containerStatus_dictText"> |
... | ... | @@ -265,8 +265,8 @@ export default { |
265 | 265 | title: '库存详情ID', |
266 | 266 | align: 'center', |
267 | 267 | dataIndex: 'id', |
268 | - fixed: "left", | |
269 | - width: 100, | |
268 | + // fixed: "left", | |
269 | + // width: 100, | |
270 | 270 | }, |
271 | 271 | { |
272 | 272 | title: '货主', |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/subTables/InventoryDetailSubTable.vue
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | size="middle" |
14 | 14 | bordered |
15 | 15 | rowKey="id" |
16 | + class="j-table-force-nowrap" | |
16 | 17 | :scroll="{x:true}" |
17 | 18 | :columns="columns" |
18 | 19 | :dataSource="dataSource" |
... | ... | @@ -27,7 +28,6 @@ |
27 | 28 | </span> |
28 | 29 | |
29 | 30 | <span slot="companyCode" slot-scope="companyCode"> |
30 | - | |
31 | 31 | <a-tag :key="companyCode" color="blue"> |
32 | 32 | {{ solutionCompany(companyCode) }} |
33 | 33 | </a-tag> |
... | ... | @@ -72,7 +72,6 @@ export default { |
72 | 72 | if (!this.mainId) { |
73 | 73 | this.clearList() |
74 | 74 | } else { |
75 | - | |
76 | 75 | this.queryParam['zoneCode'] = val.split("_")[0]; |
77 | 76 | this.queryParam['materialCode'] = val.split("_")[1]; |
78 | 77 | this.loadData(1) |
... | ... | @@ -93,8 +92,8 @@ export default { |
93 | 92 | title: '库存详情ID', |
94 | 93 | align: 'center', |
95 | 94 | dataIndex: 'id', |
96 | - fixed: 'left', | |
97 | - width: 100, | |
95 | + // fixed: 'left', | |
96 | + // width: 100, | |
98 | 97 | }, |
99 | 98 | { |
100 | 99 | title: '货主', |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... | ... | @@ -92,6 +92,7 @@ |
92 | 92 | :loading="loading" |
93 | 93 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" |
94 | 94 | :customRow="clickThenSelect" |
95 | + :rowClassName="rowClassName" | |
95 | 96 | @change="handleTableChange"> |
96 | 97 | |
97 | 98 | <span slot="status_dictText" slot-scope="status_dictText"> |
... | ... | @@ -165,6 +166,7 @@ import {createReceiptTask, createReceiptBatchTask} from '@/api/api' |
165 | 166 | import ReceiptContainerSelectModal from "./modules/ReceiptContainerSelectModal"; |
166 | 167 | import ReceiptContainerFillSelectModal from "./modules/ReceiptContainerFillSelectModal"; |
167 | 168 | import ReceiptContainerStatusSelectModal from "./modules/ReceiptContainerStatusSelectModal"; |
169 | +import '@/assets/less/TableExpand.less' | |
168 | 170 | |
169 | 171 | export default { |
170 | 172 | name: "ReceiptContainerHeaderList", |
... | ... | @@ -178,6 +180,7 @@ export default { |
178 | 180 | }, |
179 | 181 | data() { |
180 | 182 | return { |
183 | + selectIndex: null, | |
181 | 184 | description: '入库组盘管理页面', |
182 | 185 | querySource: {}, |
183 | 186 | isorter: { |
... | ... | @@ -302,15 +305,19 @@ export default { |
302 | 305 | }, |
303 | 306 | initDictConfig() { |
304 | 307 | }, |
305 | - clickThenSelect(record) { | |
308 | + clickThenSelect(record,index) { | |
306 | 309 | return { |
307 | 310 | on: { |
308 | 311 | click: () => { |
312 | + this.selectIndex=index | |
309 | 313 | this.onSelectChange(record.id.toString().split(","), [record]); |
310 | 314 | } |
311 | 315 | } |
312 | 316 | } |
313 | 317 | }, |
318 | + rowClassName(record, index) { | |
319 | + return index === this.selectIndex ? 'Rowactive' : '' | |
320 | + }, | |
314 | 321 | onClearSelected() { |
315 | 322 | this.selectedRowKeys = []; |
316 | 323 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailHistoryList.vue
... | ... | @@ -15,6 +15,18 @@ |
15 | 15 | :loading="loading" |
16 | 16 | @change="handleTableChange"> |
17 | 17 | |
18 | + <span slot="status_dictText" slot-scope="status_dictText"> | |
19 | + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)"> | |
20 | + {{ status_dictText }} | |
21 | + </a-tag> | |
22 | + </span> | |
23 | + | |
24 | + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> | |
25 | + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | |
26 | + {{ inventoryStatus_dictText }} | |
27 | + </a-tag> | |
28 | + </span> | |
29 | + | |
18 | 30 | <template slot="htmlSlot" slot-scope="text"> |
19 | 31 | <div v-html="text"></div> |
20 | 32 | </template> |
... | ... | @@ -87,21 +99,21 @@ export default { |
87 | 99 | // return parseInt(index)+1; |
88 | 100 | // } |
89 | 101 | // }, |
90 | - // { | |
91 | - // title:'单据详情ID', | |
92 | - // align:"center", | |
93 | - // dataIndex: 'id' | |
94 | - // }, | |
102 | + { | |
103 | + title:'单据详情ID', | |
104 | + align:"center", | |
105 | + dataIndex: 'id' | |
106 | + }, | |
95 | 107 | // { |
96 | 108 | // title:'入库单ID', |
97 | 109 | // align:"center", |
98 | 110 | // dataIndex: 'receiptId' |
99 | 111 | // }, |
100 | - { | |
101 | - title: '入库单编码', | |
102 | - align: "center", | |
103 | - dataIndex: 'receiptCode' | |
104 | - }, | |
112 | + // { | |
113 | + // title: '入库单编码', | |
114 | + // align: "center", | |
115 | + // dataIndex: 'receiptCode' | |
116 | + // }, | |
105 | 117 | // { |
106 | 118 | // title:'货主编码', |
107 | 119 | // align:"center", |
... | ... | @@ -141,6 +153,7 @@ export default { |
141 | 153 | title: '库存状态', |
142 | 154 | align: "center", |
143 | 155 | dataIndex: 'inventoryStatus_dictText', |
156 | + scopedSlots: {customRender: 'inventoryStatus_dictText'} | |
144 | 157 | }, |
145 | 158 | { |
146 | 159 | title: '批次', |
... | ... | @@ -150,7 +163,8 @@ export default { |
150 | 163 | { |
151 | 164 | title: '单据状态', |
152 | 165 | align: "center", |
153 | - dataIndex: 'status_dictText' | |
166 | + dataIndex: 'status_dictText', | |
167 | + scopedSlots: {customRender: 'status_dictText'} | |
154 | 168 | }, |
155 | 169 | { |
156 | 170 | title: '上游单号', |
... | ... | @@ -199,6 +213,23 @@ export default { |
199 | 213 | } |
200 | 214 | }, |
201 | 215 | methods: { |
216 | + getStatusColor(status) { | |
217 | + const colors = { | |
218 | + '良品': 'green', | |
219 | + '报废品': 'purple', | |
220 | + '待确认 ': 'grey', | |
221 | + '次品': 'red', | |
222 | + '新建': 'green', | |
223 | + '收货': 'Skyblue', | |
224 | + '等待上架': 'blue', | |
225 | + '上架': 'darkorange', | |
226 | + '过账': 'purple', | |
227 | + '回传': 'grey', | |
228 | + '回传失败': 'red', | |
229 | + default: 'blue' | |
230 | + }; | |
231 | + return colors[status] || colors.default; | |
232 | + }, | |
202 | 233 | clearList() { |
203 | 234 | this.dataSource = [] |
204 | 235 | this.selectedRowKeys = [] |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | </span> |
57 | 57 | |
58 | 58 | <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> |
59 | - <a-tag :key="inventoryStatus_dictText" :color="getInventoryStatusColor(inventoryStatus_dictText)"> | |
59 | + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | |
60 | 60 | {{ inventoryStatus_dictText }} |
61 | 61 | </a-tag> |
62 | 62 | </span> |
... | ... | @@ -236,6 +236,10 @@ export default { |
236 | 236 | methods: { |
237 | 237 | getStatusColor(status) { |
238 | 238 | const colors = { |
239 | + '良品': 'green', | |
240 | + '报废品': 'purple', | |
241 | + '待确认 ': 'grey', | |
242 | + '次品': 'red', | |
239 | 243 | '新建': 'green', |
240 | 244 | '收货': 'Skyblue', |
241 | 245 | '等待上架': 'blue', |
... | ... | @@ -247,16 +251,6 @@ export default { |
247 | 251 | }; |
248 | 252 | return colors[status] || colors.default; |
249 | 253 | }, |
250 | - getInventoryStatusColor(status) { | |
251 | - const colors = { | |
252 | - '良品': 'green', | |
253 | - '报废品': 'purple', | |
254 | - '待确认 ': 'grey', | |
255 | - '次品': 'red', | |
256 | - default: 'blue' | |
257 | - }; | |
258 | - return colors[status] || colors.default; | |
259 | - }, | |
260 | 254 | clearList() { |
261 | 255 | this.dataSource = [] |
262 | 256 | this.selectedRowKeys = [] |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue
... | ... | @@ -119,6 +119,7 @@ |
119 | 119 | :loading='loading' |
120 | 120 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
121 | 121 | :customRow='clickThenSelect' |
122 | + :rowClassName="rowClassName" | |
122 | 123 | @change='handleTableChange'> |
123 | 124 | |
124 | 125 | <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> |
... | ... | @@ -206,17 +207,18 @@ export default { |
206 | 207 | }, |
207 | 208 | data() { |
208 | 209 | return { |
210 | + selectIndex: null, | |
209 | 211 | description: '历史入库单管理页面', |
210 | 212 | companyList: [], |
211 | 213 | receiptTypeList: [], |
212 | 214 | supplierList: [], |
213 | 215 | // 表头 |
214 | 216 | columns: [ |
215 | - // { | |
216 | - // title: '单据ID', | |
217 | - // align: 'center', | |
218 | - // dataIndex: 'id' | |
219 | - // }, | |
217 | + { | |
218 | + title: '单据ID', | |
219 | + align: 'center', | |
220 | + dataIndex: 'id' | |
221 | + }, | |
220 | 222 | { |
221 | 223 | title: '入库单编码', |
222 | 224 | align: 'center', |
... | ... | @@ -356,15 +358,19 @@ export default { |
356 | 358 | }, |
357 | 359 | initDictConfig() { |
358 | 360 | }, |
359 | - clickThenSelect(record) { | |
361 | + clickThenSelect(record,index) { | |
360 | 362 | return { |
361 | 363 | on: { |
362 | - click: () => { | |
364 | + click: () => { | |
365 | + this.selectIndex=index | |
363 | 366 | this.onSelectChange(record.id.toString().split(','), [record]) |
364 | 367 | } |
365 | 368 | } |
366 | 369 | } |
367 | 370 | }, |
371 | + rowClassName(record, index) { | |
372 | + return index === this.selectIndex ? 'Rowactive' : '' | |
373 | + }, | |
368 | 374 | onClearSelected() { |
369 | 375 | this.selectedRowKeys = [] |
370 | 376 | this.selectionRows = [] |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -119,6 +119,7 @@ |
119 | 119 | :loading="loading" |
120 | 120 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
121 | 121 | :customRow="clickThenSelect" |
122 | + :rowClassName="rowClassName" | |
122 | 123 | @change="handleTableChange"> |
123 | 124 | |
124 | 125 | |
... | ... | @@ -174,14 +175,15 @@ |
174 | 175 | |
175 | 176 | <span slot="action" slot-scope="text, record"> |
176 | 177 | <a-popconfirm v-has="'receiptHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)"> |
177 | - <a><a-button type="default">回传</a-button><a-divider type="vertical"/></a> | |
178 | + <a><a-button type="default">回传</a-button></a> | |
178 | 179 | </a-popconfirm> |
179 | - <a v-if="(record.lastStatus < 800 && record.firstStatus >= 15 && record.firstStatus != '20') | |
180 | - || (flowOff == '0' && record.lastStatus < 800) " @click="receive(record)" v-has="'receiptHeader:receive'"><a-button type="primary">组盘</a-button><a-divider type="vertical"/></a> | |
180 | + <a v-if="(record.lastStatus < 800 && record.firstStatus >= 15 && record.firstStatus != '20') || (flowOff == '0' && record.lastStatus < 800) " @click="receive(record)" v-has="'receiptHeader:receive'"> | |
181 | + <a-button type="primary">组盘</a-button><a-divider type="vertical"/> | |
182 | + </a> | |
181 | 183 | <a v-if="record.firstStatus == '0' && flowOff == '1'" @click="createAudit(record)"><a-button type="primary">提交审核</a-button><a-divider type="vertical"/></a> |
182 | 184 | <a v-if="record.nextAuditor == username && flowOff == '1'" @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a> |
183 | 185 | <a v-if="record.lastStatus == 850" @click="viewReason(record)"><a-button type="danger">原因</a-button><a-divider type="vertical"/></a> |
184 | - <a-dropdown> | |
186 | + <a-dropdown v-if="(record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1') || (record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null)"> | |
185 | 187 | <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> |
186 | 188 | <a-menu slot="overlay"> |
187 | 189 | <a-menu-item v-if="record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1'"> |
... | ... | @@ -197,7 +199,6 @@ |
197 | 199 | </a-menu-item> |
198 | 200 | </a-menu> |
199 | 201 | </a-dropdown> |
200 | - | |
201 | 202 | </span> |
202 | 203 | |
203 | 204 | </a-table> |
... | ... | @@ -247,6 +248,7 @@ export default { |
247 | 248 | }, |
248 | 249 | data() { |
249 | 250 | return { |
251 | + selectIndex: null, | |
250 | 252 | description: '入库表主表管理页面', |
251 | 253 | companyList: [], |
252 | 254 | receiptTypeList: [], |
... | ... | @@ -418,15 +420,20 @@ export default { |
418 | 420 | description:record.backErrorMsg |
419 | 421 | }) |
420 | 422 | }, |
421 | - clickThenSelect(record) { | |
423 | + clickThenSelect(record,index) { | |
422 | 424 | return { |
423 | 425 | on: { |
424 | 426 | click: () => { |
427 | + this.selectIndex=index | |
425 | 428 | this.onSelectChange(record.id.toString().split(','), [record]); |
426 | 429 | } |
427 | 430 | } |
428 | 431 | } |
429 | 432 | }, |
433 | + | |
434 | + rowClassName(record, index) { | |
435 | + return index === this.selectIndex ? 'Rowactive' : '' | |
436 | + }, | |
430 | 437 | onClearSelected() { |
431 | 438 | this.selectedRowKeys = []; |
432 | 439 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiveModal.vue
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | <a-row> |
15 | 15 | <a-col :span="24"> |
16 | 16 | <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode"> |
17 | - <a-input v-model="model.containerCode" placeholder="请输入容器编码" style="width: 100%" /> | |
17 | + <a-input ref="containerCode" v-model="model.containerCode" placeholder="请输入容器编码" style="width: 100%" /> | |
18 | 18 | </a-form-model-item> |
19 | 19 | </a-col> |
20 | 20 | </a-row> |
... | ... | @@ -24,8 +24,15 @@ |
24 | 24 | <span slot="action" slot-scope="text, record"> |
25 | 25 | <a-input-number placeholder="" v-model="record.taskQty" :value="text" /> |
26 | 26 | </span> |
27 | + | |
28 | + <span slot="action2" slot-scope="text, record"> | |
29 | + <a-button type="primary" @click="selectContainer(record)">选取容器</a-button> | |
30 | + </span> | |
31 | + | |
27 | 32 | </a-table> |
33 | + <select-inv-container-header ref="selectContainerForm" v-on:getContainer="getContainerCode"></select-inv-container-header> | |
28 | 34 | </j-modal> |
35 | + | |
29 | 36 | </template> |
30 | 37 | |
31 | 38 | <script> |
... | ... | @@ -36,10 +43,11 @@ import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
36 | 43 | import { validateDuplicateValue } from '@/utils/util' |
37 | 44 | import { searchMaterialByCode } from '@/api/api' |
38 | 45 | import { listReceiveByReceiptId } from '@/api/api' |
46 | +import SelectInvContainerHeader from "./SelectInvContainerHeader"; | |
39 | 47 | |
40 | 48 | export default { |
41 | 49 | name: 'ReceiveModal', |
42 | - components: {}, | |
50 | + components: {SelectInvContainerHeader}, | |
43 | 51 | props: { |
44 | 52 | mainId: { |
45 | 53 | type: String, |
... | ... | @@ -78,12 +86,6 @@ export default { |
78 | 86 | width: 96 |
79 | 87 | }, |
80 | 88 | { |
81 | - title: '物料规格', | |
82 | - dataIndex: 'materialSpec', | |
83 | - align: 'center', | |
84 | - width: 96 | |
85 | - }, | |
86 | - { | |
87 | 89 | title: '库存状态', |
88 | 90 | dataIndex: 'inventoryStatus', |
89 | 91 | align: 'center', |
... | ... | @@ -106,6 +108,13 @@ export default { |
106 | 108 | align: 'center', |
107 | 109 | key: 'action', |
108 | 110 | scopedSlots: { customRender: 'action' } |
111 | + }, | |
112 | + { | |
113 | + title: '操作', | |
114 | + dataIndex: 'action2', | |
115 | + align:"center", | |
116 | + width:147, | |
117 | + scopedSlots: { customRender: 'action2' } | |
109 | 118 | } |
110 | 119 | ], |
111 | 120 | confirmLoading: false, |
... | ... | @@ -127,6 +136,12 @@ export default { |
127 | 136 | // this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
128 | 137 | }, |
129 | 138 | methods: { |
139 | + getContainerCode(e){ | |
140 | + this.$nextTick(function (){ | |
141 | + let record={containerCode: e} | |
142 | + this.model = Object.assign({}, record) | |
143 | + }) | |
144 | + }, | |
130 | 145 | // add() { |
131 | 146 | // this.edit(this.modelDefault) |
132 | 147 | // this.model.inventoryStatus = 'good' |
... | ... | @@ -140,6 +155,9 @@ export default { |
140 | 155 | // this.model = Object.assign({}, record) |
141 | 156 | // this.visible = true |
142 | 157 | // }, |
158 | + selectContainer(record){ | |
159 | + this.$refs.selectContainerForm.edit(record); | |
160 | + }, | |
143 | 161 | close() { |
144 | 162 | this.$emit('close') |
145 | 163 | this.visible = false |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/modules/SelectInvContainerHeader.vue
0 → 100644
1 | +<template> | |
2 | + <j-modal | |
3 | + :title="title" | |
4 | + :width="width" | |
5 | + :visible="visible" | |
6 | + :confirmLoading="confirmLoading" | |
7 | + switchFullscreen | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel" | |
10 | + cancelText="关闭"> | |
11 | + | |
12 | + <!-- 查询区域 --> | |
13 | + <div class="table-page-search-wrapper"> | |
14 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | |
15 | + <a-row :gutter="24"> | |
16 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
17 | + <a-form-item label="库区"> | |
18 | + <a-form-model-item prop="zoneOptions"> | |
19 | + <j-multi-select-tag | |
20 | + v-model="queryParam.zoneCode" | |
21 | + :options="zoneOptions" | |
22 | + placeholder="请选择库区"> | |
23 | + </j-multi-select-tag> | |
24 | + </a-form-model-item> | |
25 | + </a-form-item> | |
26 | + </a-col> | |
27 | + | |
28 | + | |
29 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
30 | + <a-form-item label="物料编码"> | |
31 | + <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode" disabled=""></a-input> | |
32 | + </a-form-item> | |
33 | + </a-col> | |
34 | + | |
35 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
36 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |
37 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |
38 | + </span> | |
39 | + </a-col> | |
40 | + | |
41 | + </a-row> | |
42 | + </a-form> | |
43 | + </div> | |
44 | + <!-- 查询区域-END --> | |
45 | + | |
46 | + <div> | |
47 | + <a-table | |
48 | + ref="table" | |
49 | + size="middle" | |
50 | + :scroll="{ x: true }" | |
51 | + bordered | |
52 | + :columns="columns" | |
53 | + rowKey="id" | |
54 | + :dataSource="dataSource" | |
55 | + :pagination="ipagination" | |
56 | + :loading="loading" | |
57 | + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" | |
58 | + class="j-table-force-nowrap" | |
59 | + @change="handleTableChange" | |
60 | + :customRow="clickThenSelect" | |
61 | + :rowClassName="rowClassName" | |
62 | + > | |
63 | + <span slot="zoneCode" slot-scope="zoneCode"> | |
64 | + <a-tag :key="zoneCode" color=blue> | |
65 | + {{ solutionZoneCode(zoneCode) }} | |
66 | + </a-tag> | |
67 | + </span> | |
68 | + | |
69 | + <span slot="companyCode" slot-scope="companyCode"> | |
70 | + <a-tag :key="companyCode" color="blue"> | |
71 | + {{ solutionCompany(companyCode) }} | |
72 | + </a-tag> | |
73 | + </span> | |
74 | + | |
75 | + </a-table> | |
76 | + </div> | |
77 | + | |
78 | + <a-tabs defaultActiveKey="1"> | |
79 | + <a-tab-pane tab="库存详情" key="1"> | |
80 | + <InventoryDetailList :mainId="selectedMainId"></InventoryDetailList> | |
81 | + </a-tab-pane> | |
82 | + </a-tabs> | |
83 | + </j-modal> | |
84 | +</template> | |
85 | + | |
86 | +<script> | |
87 | +import {JeecgListMixin} from '@/mixins/JeecgListMixin' | |
88 | +import {mixinDevice} from '@/utils/mixin' | |
89 | +import InventoryDetailList from "../../inventory/InventoryDetailList"; | |
90 | +import {getZoneList, getCompanyList} from "@api/api"; | |
91 | +import '@/assets/less/TableExpand.less' | |
92 | + | |
93 | +export default { | |
94 | + name: "SelectInvContainerHeader", | |
95 | + mixins: [JeecgListMixin, mixinDevice], | |
96 | + components: {InventoryDetailList}, | |
97 | + data() { | |
98 | + return { | |
99 | + title: "选择容器", | |
100 | + width: 1200, | |
101 | + visible: false, | |
102 | + model: {}, | |
103 | + selectedMainId: '', | |
104 | + selectedCode: '', | |
105 | + selectIndex: null, | |
106 | + zoneOptions: [], | |
107 | + companyList: [], | |
108 | + labelCol: { | |
109 | + xs: {span: 24}, | |
110 | + sm: {span: 5}, | |
111 | + }, | |
112 | + wrapperCol: { | |
113 | + xs: {span: 24}, | |
114 | + sm: {span: 16}, | |
115 | + }, | |
116 | + dataSource: [], | |
117 | + ipagination: { | |
118 | + current: 1, | |
119 | + pageSize: 5, | |
120 | + pageSizeOptions: ['5', '10', '20'], | |
121 | + showTotal: (total, range) => { | |
122 | + return range[0] + "-" + range[1] + " 共" + total + "条" | |
123 | + }, | |
124 | + showQuickJumper: true, | |
125 | + showSizeChanger: true, | |
126 | + total: 0 | |
127 | + }, | |
128 | + // 表头 | |
129 | + columns: [ | |
130 | + { | |
131 | + title: '货主', | |
132 | + align: 'center', | |
133 | + dataIndex: 'companyCode', | |
134 | + key: 'companyCode', | |
135 | + scopedSlots: {customRender: 'companyCode'} | |
136 | + }, | |
137 | + { | |
138 | + title: '库区', | |
139 | + align: "center", | |
140 | + dataIndex: 'zoneCode', | |
141 | + key: 'zoneCode', | |
142 | + scopedSlots: {customRender: 'zoneCode'} | |
143 | + }, | |
144 | + { | |
145 | + title: '容器编码', | |
146 | + align: 'center', | |
147 | + dataIndex: 'containerCode' | |
148 | + }, | |
149 | + { | |
150 | + title: '容器状态', | |
151 | + align: "center", | |
152 | + dataIndex: 'containerStatus_dictText', | |
153 | + scopedSlots: {customRender: 'containerStatus_dictText'} | |
154 | + }, | |
155 | + { | |
156 | + title: '库位编码', | |
157 | + align: 'center', | |
158 | + dataIndex: 'locationCode' | |
159 | + }, | |
160 | + { | |
161 | + title: '物料编码', | |
162 | + align: 'center', | |
163 | + dataIndex: 'materialCode' | |
164 | + }, | |
165 | + { | |
166 | + title: '物料名称', | |
167 | + align: 'center', | |
168 | + dataIndex: 'materialName' | |
169 | + }, | |
170 | + { | |
171 | + title: '物料规格', | |
172 | + align: 'center', | |
173 | + dataIndex: 'materialSpec' | |
174 | + }, | |
175 | + { | |
176 | + title: '物料单位', | |
177 | + align: 'center', | |
178 | + dataIndex: 'materialUnit' | |
179 | + }, | |
180 | + { | |
181 | + title: '数量', | |
182 | + align: 'center', | |
183 | + dataIndex: 'qty' | |
184 | + }, | |
185 | + { | |
186 | + title: '任务锁定数量', | |
187 | + align: 'center', | |
188 | + dataIndex: 'taskQty' | |
189 | + }, | |
190 | + // { | |
191 | + // title: '托盘填充度', | |
192 | + // align: 'center', | |
193 | + // dataIndex: 'fillDensity', | |
194 | + // customRender: text => { | |
195 | + // return text == null ? '' : text + '%' | |
196 | + // } | |
197 | + // }, | |
198 | + { | |
199 | + title: '库存状态', | |
200 | + align: 'center', | |
201 | + dataIndex: 'inventoryStatus_dictText', | |
202 | + scopedSlots: {customRender: 'inventoryStatus_dictText'} | |
203 | + }, | |
204 | + // { | |
205 | + // title: '操作', | |
206 | + // dataIndex: 'action', | |
207 | + // align: 'center', | |
208 | + // fixed: 'right', | |
209 | + // width: 147, | |
210 | + // scopedSlots: {customRender: 'action'} | |
211 | + // } | |
212 | + ], | |
213 | + | |
214 | + confirmLoading: false, | |
215 | + url: { | |
216 | + list: "inventory/inventoryDetail/selectContainerlist", | |
217 | + } | |
218 | + | |
219 | + } | |
220 | + }, | |
221 | + created() { | |
222 | + this.loadFrom(); | |
223 | + }, | |
224 | + methods: { | |
225 | + loadFrom() { | |
226 | + getZoneList().then((res) => { | |
227 | + if (res.success) { | |
228 | + this.zoneList = res.result | |
229 | + //延迟半秒执行,避免组件未加载完,数据已经加载完 | |
230 | + setTimeout(() => { | |
231 | + //slice可以在数组的任何位置进行删除/添加操作 | |
232 | + this.zoneOptions.splice(0, 1); | |
233 | + for (let i = 0; i < res.result.length; i++) { | |
234 | + this.zoneOptions.push({value: res.result[i].code, text: res.result[i].name}) | |
235 | + } | |
236 | + }, 500) | |
237 | + } | |
238 | + }); | |
239 | + | |
240 | + getCompanyList().then(res => { | |
241 | + if (res.success) { | |
242 | + this.companyList = res.result | |
243 | + } | |
244 | + }) | |
245 | + | |
246 | + }, | |
247 | + solutionCompany(value) { | |
248 | + var actions = [] | |
249 | + Object.keys(this.companyList).some(key => { | |
250 | + if (this.companyList[key].code == '' + value) { | |
251 | + actions.push(this.companyList[key].name) | |
252 | + return true | |
253 | + } | |
254 | + }) | |
255 | + return actions.join('') | |
256 | + }, | |
257 | + solutionZoneCode(value) { | |
258 | + var actions = [] | |
259 | + Object.keys(this.zoneList).some((key) => { | |
260 | + if (this.zoneList[key].code == ('' + value)) { | |
261 | + actions.push(this.zoneList[key].name) | |
262 | + return true | |
263 | + } | |
264 | + }) | |
265 | + return actions.join('') | |
266 | + }, | |
267 | + edit(record) { | |
268 | + this.queryParam.materialCode = record.materialCode | |
269 | + this.selectedMainId = ''; | |
270 | + this.searchQuery(); | |
271 | + this.visible = true; | |
272 | + }, | |
273 | + handleOk() { | |
274 | + if(this.selectedCode==''){ | |
275 | + this.$message.warning('请选择一条容器数据!') | |
276 | + return falsel | |
277 | + } | |
278 | + this.$emit("getContainer", this.selectedCode); | |
279 | + this.visible = false; | |
280 | + | |
281 | + }, | |
282 | + handleCancel() { | |
283 | + this.visible = false; | |
284 | + }, | |
285 | + clickThenSelect(record,index) { | |
286 | + return { | |
287 | + on: { | |
288 | + click: () => { | |
289 | + this.selectIndex = index | |
290 | + this.onSelectChange(record.inventoryHeaderId.toString().split(','), [record]) | |
291 | + } | |
292 | + } | |
293 | + } | |
294 | + }, | |
295 | + rowClassName(record, index) { | |
296 | + return index === this.selectIndex ? 'Rowactive' : '' | |
297 | + }, | |
298 | + onSelectChange(selectedRowKeys, selectionRows) { | |
299 | + this.selectedMainId = ''+selectionRows[0].inventoryHeaderId+''; | |
300 | + this.selectedCode = selectionRows[0].containerCode; | |
301 | + this.selectedRowKeys = selectedRowKeys; | |
302 | + this.selectRecord = selectionRows; | |
303 | + }, | |
304 | + } | |
305 | +} | |
306 | +</script> | |
307 | + | |
308 | +<style scoped> | |
309 | + | |
310 | +</style> | |
0 | 311 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue
... | ... | @@ -99,6 +99,7 @@ |
99 | 99 | :loading="loading" |
100 | 100 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" |
101 | 101 | :customRow="clickThenSelect" |
102 | + :rowClassName="rowClassName" | |
102 | 103 | @change="handleTableChange"> |
103 | 104 | <span slot="taskType_dictText" slot-scope="taskType_dictText"> |
104 | 105 | <a-tag :key="taskType_dictText" :color="getStatusColor(taskType_dictText)"> |
... | ... | @@ -154,6 +155,7 @@ export default { |
154 | 155 | }, |
155 | 156 | data() { |
156 | 157 | return { |
158 | + selectIndex: null, | |
157 | 159 | description: '出库组盘管理页面', |
158 | 160 | querySource: {}, |
159 | 161 | portList: [], |
... | ... | @@ -271,15 +273,19 @@ export default { |
271 | 273 | }, |
272 | 274 | initDictConfig() { |
273 | 275 | }, |
274 | - clickThenSelect(record) { | |
276 | + clickThenSelect(record,index) { | |
275 | 277 | return { |
276 | 278 | on: { |
277 | 279 | click: () => { |
280 | + this.selectIndex=index | |
278 | 281 | this.onSelectChange(record.id.toString().split(","), [record]); |
279 | 282 | } |
280 | 283 | } |
281 | 284 | } |
282 | 285 | }, |
286 | + rowClassName(record, index) { | |
287 | + return index === this.selectIndex ? 'Rowactive' : '' | |
288 | + }, | |
283 | 289 | onClearSelected() { |
284 | 290 | this.selectedRowKeys = []; |
285 | 291 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailHistoryList.vue
1 | 1 | <template> |
2 | 2 | <a-card :bordered="false" :class="'cust-erp-sub-tab'"> |
3 | 3 | <!-- 操作按钮区域 --> |
4 | - <div class="table-operator" v-if="mainId"> | |
4 | + <!-- <div class="table-operator" v-if="mainId"> --> | |
5 | 5 | <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> |
6 | 6 | <!-- <a-button type="primary" icon="download" @click="handleExportXls('历史出库单明细')">导出</a-button>--> |
7 | - <a-upload | |
7 | + <!-- <a-upload | |
8 | 8 | name="file" |
9 | 9 | :showUploadList="false" |
10 | 10 | :multiple="false" |
11 | 11 | :headers="tokenHeader" |
12 | 12 | :action="importExcelUrl" |
13 | 13 | @change="handleImportExcel"> |
14 | - <!-- <a-button type="primary" icon="import">导入</a-button>--> | |
15 | - </a-upload> | |
16 | - <a-dropdown v-if="selectedRowKeys.length > 0"> | |
14 | + <a-button type="primary" icon="import">导入</a-button> | |
15 | + </a-upload> --> | |
16 | + <!-- <a-dropdown v-if="selectedRowKeys.length > 0"> | |
17 | 17 | <a-menu slot="overlay"> |
18 | 18 | <a-menu-item key="1" @click="batchDel"> |
19 | 19 | <a-icon type="delete"/> |
... | ... | @@ -23,22 +23,23 @@ |
23 | 23 | <a-button style="margin-left: 8px"> 批量操作 |
24 | 24 | <a-icon type="down"/> |
25 | 25 | </a-button> |
26 | - </a-dropdown> | |
27 | - </div> | |
26 | + </a-dropdown> --> | |
27 | + <!-- </div> --> | |
28 | 28 | |
29 | 29 | <!-- table区域-begin --> |
30 | 30 | <div> |
31 | - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
31 | + <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
32 | 32 | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a |
33 | 33 | style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项 |
34 | 34 | <a style="margin-left: 24px" @click="onClearSelected">清空</a> |
35 | - </div> | |
35 | + </div> --> | |
36 | 36 | |
37 | 37 | <a-table |
38 | 38 | ref="table" |
39 | 39 | size="middle" |
40 | 40 | bordered |
41 | 41 | rowKey="id" |
42 | + class='j-table-force-nowrap' | |
42 | 43 | :scroll="{x:true}" |
43 | 44 | :columns="columns" |
44 | 45 | :dataSource="dataSource" |
... | ... | @@ -47,35 +48,17 @@ |
47 | 48 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
48 | 49 | @change="handleTableChange"> |
49 | 50 | |
50 | - <template slot="htmlSlot" slot-scope="text"> | |
51 | - <div v-html="text"></div> | |
52 | - </template> | |
53 | - <template slot="imgSlot" slot-scope="text"> | |
54 | - <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
55 | - <img v-else :src="getImgView(text)" height="25px" alt="" | |
56 | - style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
57 | - </template> | |
58 | - <template slot="fileSlot" slot-scope="text"> | |
59 | - <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
60 | - <a-button | |
61 | - v-else | |
62 | - :ghost="true" | |
63 | - type="primary" | |
64 | - icon="download" | |
65 | - size="small" | |
66 | - @click="downloadFile(text)"> | |
67 | - 下载 | |
68 | - </a-button> | |
69 | - </template> | |
70 | - | |
71 | - <span slot="action" slot-scope="text, record"> | |
72 | - <a @click="handleEdit(record)">编辑</a> | |
73 | - <a-divider type="vertical"/> | |
74 | - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |
75 | - <a>删除</a> | |
76 | - </a-popconfirm> | |
51 | + <span slot="status_dictText" slot-scope="status_dictText"> | |
52 | + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)"> | |
53 | + {{ status_dictText }} | |
54 | + </a-tag> | |
77 | 55 | </span> |
78 | 56 | |
57 | + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> | |
58 | + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | |
59 | + {{ inventoryStatus_dictText }} | |
60 | + </a-tag> | |
61 | + </span> | |
79 | 62 | </a-table> |
80 | 63 | </div> |
81 | 64 | |
... | ... | @@ -128,17 +111,19 @@ export default { |
128 | 111 | // return parseInt(index)+1; |
129 | 112 | // } |
130 | 113 | // }, |
131 | - // { | |
132 | - // title:'出库单ID', | |
133 | - // align:"center", | |
134 | - // dataIndex: 'shipmentId' | |
135 | - // }, | |
136 | 114 | { |
137 | - title: '出库单编码', | |
138 | - align: "center", | |
139 | - dataIndex: 'shipmentCode' | |
115 | + title:'单据详情ID', | |
116 | + align:"center", | |
117 | + dataIndex: 'id', | |
118 | + // fixed: "left", | |
119 | + // width: 100, | |
140 | 120 | }, |
141 | 121 | // { |
122 | + // title: '出库单编码', | |
123 | + // align: "center", | |
124 | + // dataIndex: 'shipmentCode' | |
125 | + // }, | |
126 | + // { | |
142 | 127 | // title:'货主编码', |
143 | 128 | // align:"center", |
144 | 129 | // dataIndex: 'companyCode' |
... | ... | @@ -176,7 +161,8 @@ export default { |
176 | 161 | { |
177 | 162 | title: '库存状态', |
178 | 163 | align: "center", |
179 | - dataIndex: 'inventoryStatus_dictText' | |
164 | + dataIndex: 'inventoryStatus_dictText', | |
165 | + scopedSlots: {customRender: 'inventoryStatus_dictText'} | |
180 | 166 | }, |
181 | 167 | { |
182 | 168 | title: '批次', |
... | ... | @@ -186,18 +172,19 @@ export default { |
186 | 172 | { |
187 | 173 | title: '单据状态', |
188 | 174 | align: "center", |
189 | - dataIndex: 'status_dictText' | |
175 | + dataIndex: 'status_dictText', | |
176 | + scopedSlots: {customRender: 'status_dictText'} | |
190 | 177 | }, |
191 | 178 | { |
192 | 179 | title: '上游单号', |
193 | 180 | align: "center", |
194 | 181 | dataIndex: 'referCode' |
195 | 182 | }, |
196 | - { | |
197 | - title: '上游行号', | |
198 | - align: "center", | |
199 | - dataIndex: 'referLineNum' | |
200 | - }, | |
183 | + // { | |
184 | + // title: '上游行号', | |
185 | + // align: "center", | |
186 | + // dataIndex: 'referLineNum' | |
187 | + // }, | |
201 | 188 | { |
202 | 189 | title: '创建人', |
203 | 190 | align: "center", |
... | ... | @@ -224,14 +211,14 @@ export default { |
224 | 211 | return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) |
225 | 212 | } |
226 | 213 | }, |
227 | - { | |
228 | - title: '操作', | |
229 | - dataIndex: 'action', | |
230 | - align: "center", | |
231 | - fixed: "right", | |
232 | - width: 147, | |
233 | - scopedSlots: {customRender: 'action'}, | |
234 | - } | |
214 | + // { | |
215 | + // title: '操作', | |
216 | + // dataIndex: 'action', | |
217 | + // align: "center", | |
218 | + // fixed: "right", | |
219 | + // width: 147, | |
220 | + // scopedSlots: {customRender: 'action'}, | |
221 | + // } | |
235 | 222 | ], |
236 | 223 | url: { |
237 | 224 | list: "/shipment/shipmentHeaderHistory/listShipmentDetailHistoryByMainId", |
... | ... | @@ -254,6 +241,23 @@ export default { |
254 | 241 | } |
255 | 242 | }, |
256 | 243 | methods: { |
244 | + getStatusColor(status) { | |
245 | + const colors = { | |
246 | + '新建': 'green', | |
247 | + '出库组盘': 'Skyblue', | |
248 | + '等待下架': 'blue', | |
249 | + '下架': 'darkorange', | |
250 | + '过账': 'purple', | |
251 | + '回传': 'grey', | |
252 | + '回传失败': 'red', | |
253 | + '良品': 'green', | |
254 | + '报废品': 'purple', | |
255 | + '待确认 ': 'grey', | |
256 | + '次品': 'red', | |
257 | + default: 'blue' | |
258 | + }; | |
259 | + return colors[status] || colors.default; | |
260 | + }, | |
257 | 261 | clearList() { |
258 | 262 | this.dataSource = [] |
259 | 263 | this.selectedRowKeys = [] |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | </span> |
56 | 56 | |
57 | 57 | <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> |
58 | - <a-tag :key="inventoryStatus_dictText" :color="getInventoryStatusColor(inventoryStatus_dictText)"> | |
58 | + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | |
59 | 59 | {{ inventoryStatus_dictText }} |
60 | 60 | </a-tag> |
61 | 61 | </span> |
... | ... | @@ -248,12 +248,6 @@ export default { |
248 | 248 | '过账': 'purple', |
249 | 249 | '回传': 'grey', |
250 | 250 | '回传失败': 'red', |
251 | - default: 'blue' | |
252 | - }; | |
253 | - return colors[status] || colors.default; | |
254 | - }, | |
255 | - getInventoryStatusColor(status) { | |
256 | - const colors = { | |
257 | 251 | '良品': 'green', |
258 | 252 | '报废品': 'purple', |
259 | 253 | '待确认 ': 'grey', |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderHistoryList.vue
... | ... | @@ -110,11 +110,11 @@ |
110 | 110 | |
111 | 111 | <!-- table区域-begin --> |
112 | 112 | <div> |
113 | - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
113 | + <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
114 | 114 | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a |
115 | 115 | style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项 |
116 | 116 | <a style="margin-left: 24px" @click="onClearSelected">清空</a> |
117 | - </div> | |
117 | + </div> --> | |
118 | 118 | |
119 | 119 | <a-table |
120 | 120 | ref="table" |
... | ... | @@ -129,6 +129,7 @@ |
129 | 129 | :loading="loading" |
130 | 130 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
131 | 131 | :customRow="clickThenSelect" |
132 | + :rowClassName="rowClassName" | |
132 | 133 | @change="handleTableChange"> |
133 | 134 | |
134 | 135 | <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> |
... | ... | @@ -182,7 +183,7 @@ |
182 | 183 | </a-button> |
183 | 184 | </template> |
184 | 185 | |
185 | - <span slot="action" slot-scope="text, record"> | |
186 | + <!-- <span slot="action" slot-scope="text, record"> | |
186 | 187 | <a @click="handleEdit(record)">编辑</a> |
187 | 188 | |
188 | 189 | <a-divider type="vertical"/> |
... | ... | @@ -196,7 +197,7 @@ |
196 | 197 | </a-menu-item> |
197 | 198 | </a-menu> |
198 | 199 | </a-dropdown> |
199 | - </span> | |
200 | + </span> --> | |
200 | 201 | |
201 | 202 | </a-table> |
202 | 203 | </div> |
... | ... | @@ -230,17 +231,20 @@ export default { |
230 | 231 | }, |
231 | 232 | data() { |
232 | 233 | return { |
234 | + selectIndex: null, | |
233 | 235 | description: '历史出库单管理页面', |
234 | 236 | companyList: [], |
235 | 237 | shipmentTypeList: [], |
236 | 238 | customerList: [], |
237 | 239 | // 表头 |
238 | 240 | columns: [ |
239 | - // { | |
240 | - // title: '单据ID', | |
241 | - // align: 'center', | |
242 | - // dataIndex: 'id' | |
243 | - // }, | |
241 | + { | |
242 | + title: '单据ID', | |
243 | + align: 'center', | |
244 | + // fixed: "left", | |
245 | + // width: 100, | |
246 | + dataIndex: 'id' | |
247 | + }, | |
244 | 248 | { |
245 | 249 | title: '出库单编码', |
246 | 250 | align: "center", |
... | ... | @@ -327,14 +331,14 @@ export default { |
327 | 331 | return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) |
328 | 332 | } |
329 | 333 | }, |
330 | - { | |
331 | - title: '操作', | |
332 | - dataIndex: 'action', | |
333 | - align: "center", | |
334 | - fixed: "right", | |
335 | - width: 147, | |
336 | - scopedSlots: {customRender: 'action'}, | |
337 | - } | |
334 | + // { | |
335 | + // title: '操作', | |
336 | + // dataIndex: 'action', | |
337 | + // align: "center", | |
338 | + // fixed: "right", | |
339 | + // width: 147, | |
340 | + // scopedSlots: {customRender: 'action'}, | |
341 | + // } | |
338 | 342 | ], |
339 | 343 | url: { |
340 | 344 | list: "/shipment/shipmentHeaderHistory/list", |
... | ... | @@ -385,15 +389,19 @@ export default { |
385 | 389 | }, |
386 | 390 | initDictConfig() { |
387 | 391 | }, |
388 | - clickThenSelect(record) { | |
392 | + clickThenSelect(record,index) { | |
389 | 393 | return { |
390 | 394 | on: { |
391 | 395 | click: () => { |
396 | + this.selectIndex=index | |
392 | 397 | this.onSelectChange(record.id.toString().split(","), [record]); |
393 | 398 | } |
394 | 399 | } |
395 | 400 | } |
396 | 401 | }, |
402 | + rowClassName(record, index) { | |
403 | + return index === this.selectIndex ? 'Rowactive' : '' | |
404 | + }, | |
397 | 405 | onClearSelected() { |
398 | 406 | this.selectedRowKeys = []; |
399 | 407 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -137,6 +137,7 @@ |
137 | 137 | :loading="loading" |
138 | 138 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" |
139 | 139 | :customRow="clickThenSelect" |
140 | + :rowClassName="rowClassName" | |
140 | 141 | @change="handleTableChange"> |
141 | 142 | |
142 | 143 | <span slot="firstStatus_dictText" slot-scope="firstStatus_dictText"> |
... | ... | @@ -192,13 +193,13 @@ |
192 | 193 | <a v-if="record.firstStatus == '0' && flowOff == '1'" @click="createAudit(record)"><a-button type="primary">提交审核</a-button><a-divider type="vertical"/></a> |
193 | 194 | <a v-if="record.nextAuditor == username && flowOff == '1' " @click="audit(record)"><a-button type="primary">审核</a-button><a-divider type="vertical"/></a> |
194 | 195 | <a-popconfirm v-has="'shipmentHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)"> |
195 | - <a><a-button type="default">回传</a-button><a-divider type="vertical"/></a> | |
196 | + <a><a-button type="default">回传</a-button></a> | |
196 | 197 | </a-popconfirm> |
197 | 198 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus <= 200)) |
198 | 199 | || (flowOff == '0' && record.lastStatus <= 200)" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button> <a-divider type="vertical"/></a> |
199 | 200 | <a v-if="((record.firstStatus >= 15 && record.firstStatus != '20' && record.lastStatus < 800)) |
200 | 201 | || (flowOff == '0' && record.lastStatus < 800)" @click="openAutoShipmentCombine(record)" v-has="'shipmentHeader:autoShipment'"><a-button type="primary">自动出库</a-button> <a-divider type="vertical"/></a> |
201 | - <a-dropdown> | |
202 | + <a-dropdown v-if="(record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1') || (record.firstStatus == 0 && record.lastStatus == 0 && record.referCode == null)"> | |
202 | 203 | <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> |
203 | 204 | <a-menu slot="overlay"> |
204 | 205 | <a-menu-item v-if="record.firstStatus > 0 && record.firstStatus <= 20 && flowOff=='1'"> |
... | ... | @@ -248,6 +249,7 @@ import store from '@/store' |
248 | 249 | import ShipmentAuditModal from "./modules/ShipmentAuditModal"; |
249 | 250 | import FlowProcess from "../flow/FlowProcess"; |
250 | 251 | import AutoShipmentSelectModal from "@views/system/shipment/modules/AutoShipmentSelectModal"; |
252 | +import '@/assets/less/TableExpand.less' | |
251 | 253 | |
252 | 254 | export default { |
253 | 255 | name: "ShipmentHeaderList", |
... | ... | @@ -261,6 +263,7 @@ export default { |
261 | 263 | }, |
262 | 264 | data() { |
263 | 265 | return { |
266 | + selectIndex: null, | |
264 | 267 | description: '出库单管理页面', |
265 | 268 | companyList: [], |
266 | 269 | shipmentTypeList: [], |
... | ... | @@ -449,15 +452,19 @@ export default { |
449 | 452 | }, |
450 | 453 | initDictConfig() { |
451 | 454 | }, |
452 | - clickThenSelect(record) { | |
455 | + clickThenSelect(record,index) { | |
453 | 456 | return { |
454 | 457 | on: { |
455 | 458 | click: () => { |
459 | + this.selectIndex=index | |
456 | 460 | this.onSelectChange(record.id.toString().split(","), [record]); |
457 | 461 | } |
458 | 462 | } |
459 | 463 | } |
460 | 464 | }, |
465 | + rowClassName(record, index) { | |
466 | + return index === this.selectIndex ? 'Rowactive' : '' | |
467 | + }, | |
461 | 468 | onClearSelected() { |
462 | 469 | this.selectedRowKeys = []; |
463 | 470 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/task/AllTaskHeaderList.vue
... | ... | @@ -109,6 +109,7 @@ |
109 | 109 | :loading="loading" |
110 | 110 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
111 | 111 | :customRow="clickThenSelect" |
112 | + :rowClassName="rowClassName" | |
112 | 113 | @change="handleTableChange"> |
113 | 114 | |
114 | 115 | <span slot="status_dictText" slot-scope="status_dictText"> |
... | ... | @@ -208,6 +209,7 @@ export default { |
208 | 209 | }, |
209 | 210 | data() { |
210 | 211 | return { |
212 | + selectIndex: null, | |
211 | 213 | description: '任务表管理页面', |
212 | 214 | zoneList: [], |
213 | 215 | zoneOptions:[], |
... | ... | @@ -372,15 +374,19 @@ export default { |
372 | 374 | }, |
373 | 375 | initDictConfig() { |
374 | 376 | }, |
375 | - clickThenSelect(record) { | |
377 | + clickThenSelect(record,index) { | |
376 | 378 | return { |
377 | 379 | on: { |
378 | 380 | click: () => { |
381 | + this.selectIndex=index | |
379 | 382 | this.onSelectChange(record.id.toString().split(","), [record]); |
380 | 383 | } |
381 | 384 | } |
382 | 385 | } |
383 | 386 | }, |
387 | + rowClassName(record, index) { | |
388 | + return index === this.selectIndex ? 'Rowactive' : '' | |
389 | + }, | |
384 | 390 | onClearSelected() { |
385 | 391 | this.selectedRowKeys = []; |
386 | 392 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue
... | ... | @@ -114,6 +114,7 @@ |
114 | 114 | :loading="loading" |
115 | 115 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
116 | 116 | :customRow="clickThenSelect" |
117 | + :rowClassName="rowClassName" | |
117 | 118 | @change="handleTableChange"> |
118 | 119 | |
119 | 120 | |
... | ... | @@ -208,6 +209,7 @@ export default { |
208 | 209 | }, |
209 | 210 | data() { |
210 | 211 | return { |
212 | + selectIndex: null, | |
211 | 213 | description: '任务表管理页面', |
212 | 214 | zoneList: [], |
213 | 215 | zoneOptions:[], |
... | ... | @@ -371,15 +373,19 @@ export default { |
371 | 373 | }, |
372 | 374 | initDictConfig() { |
373 | 375 | }, |
374 | - clickThenSelect(record) { | |
376 | + clickThenSelect(record,index) { | |
375 | 377 | return { |
376 | 378 | on: { |
377 | 379 | click: () => { |
380 | + this.selectIndex=index | |
378 | 381 | this.onSelectChange(record.id.toString().split(","), [record]); |
379 | 382 | } |
380 | 383 | } |
381 | 384 | } |
382 | 385 | }, |
386 | + rowClassName(record, index) { | |
387 | + return index === this.selectIndex ? 'Rowactive' : '' | |
388 | + }, | |
383 | 389 | onClearSelected() { |
384 | 390 | this.selectedRowKeys = []; |
385 | 391 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -111,6 +111,7 @@ |
111 | 111 | :loading="loading" |
112 | 112 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
113 | 113 | :customRow="clickThenSelect" |
114 | + :rowClassName="rowClassName" | |
114 | 115 | @change="handleTableChange"> |
115 | 116 | |
116 | 117 | <span slot="status_dictText" slot-scope="status_dictText"> |
... | ... | @@ -202,6 +203,7 @@ import MaterialTaskModal from "./modules/MaterialTaskModal"; |
202 | 203 | import CallReceiptBoxModal from "@views/system/task/modules/CallReceiptBoxModal"; |
203 | 204 | import CallReceiptEmptyBoxModal from "@views/system/task/modules/CallReceiptEmptyBoxModal"; |
204 | 205 | |
206 | + | |
205 | 207 | export default { |
206 | 208 | name: "TaskHeaderList", |
207 | 209 | mixins: [JeecgListMixin], |
... | ... | @@ -216,6 +218,7 @@ export default { |
216 | 218 | }, |
217 | 219 | data() { |
218 | 220 | return { |
221 | + selectIndex: null, | |
219 | 222 | description: '任务表管理页面', |
220 | 223 | zoneList: [], |
221 | 224 | zoneOptions:[], |
... | ... | @@ -380,15 +383,19 @@ export default { |
380 | 383 | }, |
381 | 384 | initDictConfig() { |
382 | 385 | }, |
383 | - clickThenSelect(record) { | |
386 | + clickThenSelect(record,index) { | |
384 | 387 | return { |
385 | 388 | on: { |
386 | 389 | click: () => { |
390 | + this.selectIndex=index | |
387 | 391 | this.onSelectChange(record.id.toString().split(","), [record]); |
388 | 392 | } |
389 | 393 | } |
390 | 394 | } |
391 | 395 | }, |
396 | + rowClassName(record, index) { | |
397 | + return index === this.selectIndex ? 'Rowactive' : '' | |
398 | + }, | |
392 | 399 | onClearSelected() { |
393 | 400 | this.selectedRowKeys = []; |
394 | 401 | this.selectionRows = []; |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -109,6 +109,7 @@ |
109 | 109 | :loading="loading" |
110 | 110 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
111 | 111 | :customRow="clickThenSelect" |
112 | + :rowClassName="rowClassName" | |
112 | 113 | @change="handleTableChange"> |
113 | 114 | |
114 | 115 | <span slot="status_dictText" slot-scope="status_dictText"> |
... | ... | @@ -208,6 +209,7 @@ export default { |
208 | 209 | }, |
209 | 210 | data() { |
210 | 211 | return { |
212 | + selectIndex: null, | |
211 | 213 | description: '任务表管理页面', |
212 | 214 | zoneList: [], |
213 | 215 | isorter: { |
... | ... | @@ -371,15 +373,19 @@ export default { |
371 | 373 | }, |
372 | 374 | initDictConfig() { |
373 | 375 | }, |
374 | - clickThenSelect(record) { | |
376 | + clickThenSelect(record,index) { | |
375 | 377 | return { |
376 | 378 | on: { |
377 | 379 | click: () => { |
380 | + this.selectIndex=index | |
378 | 381 | this.onSelectChange(record.id.toString().split(","), [record]); |
379 | 382 | } |
380 | 383 | } |
381 | 384 | } |
382 | 385 | }, |
386 | + rowClassName(record, index) { | |
387 | + return index === this.selectIndex ? 'Rowactive' : '' | |
388 | + }, | |
383 | 389 | onClearSelected() { |
384 | 390 | this.selectedRowKeys = []; |
385 | 391 | this.selectionRows = []; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryDetail/controller/InventoryDetailController.java
... | ... | @@ -2,17 +2,23 @@ package org.jeecg.modules.wms.inventory.inventoryDetail.controller; |
2 | 2 | |
3 | 3 | import java.util.Arrays; |
4 | 4 | import java.util.Date; |
5 | +import java.util.List; | |
5 | 6 | |
6 | 7 | import javax.servlet.http.HttpServletRequest; |
7 | 8 | import javax.servlet.http.HttpServletResponse; |
8 | 9 | |
10 | +import com.baomidou.mybatisplus.core.conditions.Wrapper; | |
11 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
9 | 12 | import org.jeecg.common.api.vo.Result; |
10 | 13 | import org.jeecg.common.aspect.annotation.AutoLog; |
11 | 14 | import org.jeecg.common.system.base.controller.JeecgController; |
12 | 15 | import org.jeecg.common.system.query.QueryGenerator; |
16 | +import org.jeecg.modules.wms.config.container.entity.Container; | |
13 | 17 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
14 | 18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
15 | 19 | import org.jeecg.utils.HuahengJwtUtil; |
20 | +import org.jeecg.utils.StringUtils; | |
21 | +import org.jeecg.utils.constant.QuantityConstant; | |
16 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
17 | 23 | import org.springframework.web.bind.annotation.*; |
18 | 24 | import org.springframework.web.servlet.ModelAndView; |
... | ... | @@ -66,6 +72,26 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, |
66 | 72 | return Result.OK(pageList); |
67 | 73 | } |
68 | 74 | |
75 | + @ApiOperation(value = "库存详情-分页列表查询", notes = "库存详情-分页列表查询") | |
76 | + @GetMapping(value = "/selectContainerlist") | |
77 | + public Result<IPage<InventoryDetail>> selectContainerlist(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
78 | + @RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize, HttpServletRequest req) { | |
79 | + IPage<InventoryDetail> pageList=new Page<>(); | |
80 | + //由于前端页面嵌套,进页面就会加载此接口,加个判断避免不必要的查询 | |
81 | + if (StringUtils.isNotEmpty(inventoryDetail.getMaterialCode())){ | |
82 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
83 | + //查询出符合条件的托盘 | |
84 | + List<String> containerCodeList=inventoryDetailService.containerCodeList(warehouseCode,inventoryDetail.getMaterialCode()); | |
85 | + QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | |
86 | + Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | |
87 | + if (containerCodeList.size()>0){ | |
88 | + queryWrapper.in("container_code",containerCodeList); | |
89 | + } | |
90 | + pageList = inventoryDetailService.page(page, queryWrapper); | |
91 | + } | |
92 | + return Result.OK(pageList); | |
93 | + } | |
94 | + | |
69 | 95 | /** |
70 | 96 | * 添加 |
71 | 97 | * @param inventoryDetail |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
... | ... | @@ -79,4 +79,12 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { |
79 | 79 | * @return |
80 | 80 | */ |
81 | 81 | Result releaseController(List<Integer> inventoryDetailIdList); |
82 | + | |
83 | + /** | |
84 | + * 根据物料编码查询库内符合条件的托盘 | |
85 | + * @param materiacode 物料编码 | |
86 | + * @param warehouseCode 仓库 | |
87 | + * @return | |
88 | + */ | |
89 | + List<String>containerCodeList(String warehouseCode,String materiacode); | |
82 | 90 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
... | ... | @@ -270,4 +270,31 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
270 | 270 | } |
271 | 271 | return Result.ok("批量释放受控库存失败"); |
272 | 272 | } |
273 | + | |
274 | + @Override | |
275 | + public List<String> containerCodeList(String warehouseCode,String materiacode) { | |
276 | + //查询有该物料的托盘 | |
277 | + List<String> codes =new ArrayList<>(); | |
278 | + LambdaQueryWrapper<InventoryDetail>lambdaQueryWrapper=new LambdaQueryWrapper<>(); | |
279 | + lambdaQueryWrapper.eq(InventoryDetail::getMaterialCode,materiacode) | |
280 | + .eq(InventoryDetail::getWarehouseCode,warehouseCode); | |
281 | + List<InventoryDetail>list=this.list(lambdaQueryWrapper); | |
282 | + codes = list.stream().map(InventoryDetail::getContainerCode).collect(Collectors.toList()); | |
283 | + //托盘填充状态 | |
284 | + List<String>fillStatus=new ArrayList<>(); | |
285 | + fillStatus.add(QuantityConstant.STATUS_CONTAINER_FILL_EMPTY); | |
286 | + fillStatus.add(QuantityConstant.STATUS_CONTAINER_FILL_SOME); | |
287 | + //根据有库存的托盘,筛查出符合状态的托盘 | |
288 | + List<Container>containerList=new ArrayList<>(); | |
289 | + List<String>containerCodeList=new ArrayList<>(); | |
290 | + if(codes.size()>0){ | |
291 | + LambdaQueryWrapper<Container>containerWrapper=new LambdaQueryWrapper<>(); | |
292 | + containerWrapper.in(Container::getCode,codes) | |
293 | + .eq(Container::getStatus,QuantityConstant.STATUS_CONTAINER_EMPTY) | |
294 | + .in(Container::getFillStatus,fillStatus); | |
295 | + containerList=containerService.list(containerWrapper); | |
296 | + containerCodeList=containerList.stream().map(Container::getCode).collect(Collectors.toList()); | |
297 | + } | |
298 | + return containerCodeList; | |
299 | + } | |
273 | 300 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/mapper/ReceiptHeaderMapper.java
... | ... | @@ -14,8 +14,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
14 | 14 | */ |
15 | 15 | public interface ReceiptHeaderMapper extends BaseMapper<ReceiptHeader> { |
16 | 16 | |
17 | - @Select("select code from (select r.id, r.code from receipt_header r where r.type = #{receiptType} " | |
18 | - + "union all select h.id, h.code from receipt_header_history h where h.type = #{receiptType}) t order by t.id desc limit 1") | |
17 | + @Select("select code from (select r.code from receipt_header r where r.type = #{receiptType} " | |
18 | + + "union all select h.code from receipt_header_history h where h.type = #{receiptType}) t order by t.code desc limit 1") | |
19 | 19 | ReceiptHeader getMaxReceiptHeaderCode(@Param("receiptType") String receiptType); |
20 | 20 | |
21 | 21 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeaderHistory/service/impl/ReceiptHeaderHistoryServiceImpl.java
... | ... | @@ -79,38 +79,18 @@ public class ReceiptHeaderHistoryServiceImpl extends ServiceImpl<ReceiptHeaderHi |
79 | 79 | public void saveById(String id, String reason) { |
80 | 80 | ReceiptHeader receiptHeader = receiptHeaderService.getById(id); |
81 | 81 | ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory(); |
82 | - receiptHeaderHistory.setCode(receiptHeader.getCode()); | |
83 | - receiptHeaderHistory.setWarehouseCode(receiptHeader.getWarehouseCode()); | |
84 | - receiptHeaderHistory.setCompanyCode(receiptHeader.getCompanyCode()); | |
85 | - receiptHeaderHistory.setType(receiptHeader.getType()); | |
86 | - receiptHeaderHistory.setFirstStatus(receiptHeader.getFirstStatus()); | |
87 | - receiptHeaderHistory.setLastStatus(receiptHeader.getLastStatus()); | |
88 | - receiptHeaderHistory.setReferCode(receiptHeader.getReferCode()); | |
89 | - receiptHeaderHistory.setSupplierCode(receiptHeader.getSupplierCode()); | |
90 | - receiptHeaderHistory.setTotalqty(receiptHeader.getTotalqty()); | |
91 | - receiptHeaderHistory.setTotallines(receiptHeader.getTotallines()); | |
92 | - receiptHeaderHistory.setRemark(receiptHeader.getRemark()); | |
82 | + BeanUtils.copyProperties(receiptHeader, receiptHeaderHistory); | |
93 | 83 | receiptHeaderHistory.setReason(reason); |
94 | - receiptHeaderHistory.setUserdef1(receiptHeader.getUserdef1()); | |
95 | - receiptHeaderHistory.setUserdef2(receiptHeader.getUserdef2()); | |
96 | - receiptHeaderHistory.setUserdef3(receiptHeader.getUserdef3()); | |
97 | - receiptHeaderHistory.setCreateBy(receiptHeader.getCreateBy()); | |
98 | - receiptHeaderHistory.setCreateTime(receiptHeader.getCreateTime()); | |
99 | - receiptHeaderHistory.setUpdateBy(receiptHeader.getUpdateBy()); | |
100 | - receiptHeaderHistory.setUpdateTime(receiptHeader.getUpdateTime()); | |
101 | 84 | receiptHeaderHistoryMapper.insert(receiptHeaderHistory); |
102 | 85 | List<ReceiptDetail> receiptDetailList = |
103 | 86 | receiptDetailService.list(new LambdaQueryWrapper<ReceiptDetail>().eq(ReceiptDetail::getReceiptId, receiptHeader.getId())); |
104 | 87 | if (!CollectionUtils.isEmpty(receiptDetailList)) { |
105 | - List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>(); | |
106 | 88 | for (ReceiptDetail detail : receiptDetailList) { |
107 | 89 | ReceiptDetailHistory receiptDetailHistory = new ReceiptDetailHistory(); |
108 | 90 | BeanUtils.copyProperties(detail, receiptDetailHistory); |
109 | - detail.setReceiptId(receiptHeaderHistory.getId()); | |
110 | - receiptDetailHistoryList.add(receiptDetailHistory); | |
111 | - } | |
112 | - if (!receiptDetailHistoryService.saveBatch(receiptDetailHistoryList)) { | |
113 | - throw new JeecgBootException("批量新增失败"); | |
91 | + if (!receiptDetailHistoryService.save(receiptDetailHistory)) { | |
92 | + throw new JeecgBootException("批量新增失败"); | |
93 | + } | |
114 | 94 | } |
115 | 95 | } |
116 | 96 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -110,6 +110,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
110 | 110 | if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { |
111 | 111 | throw new JeecgBootException("不能删除非新建状态单据"); |
112 | 112 | } |
113 | + shipmentHeaderHistoryService.saveById(id); | |
113 | 114 | shipmentDetailMapper.deleteByMainId(id.toString()); |
114 | 115 | shipmentHeaderMapper.deleteById(id); |
115 | 116 | return true; |
... | ... | @@ -119,12 +120,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
119 | 120 | @Transactional |
120 | 121 | public void delBatchMain(Collection<? extends Serializable> idList) { |
121 | 122 | for (Serializable id : idList) { |
122 | - ShipmentHeader shipmentHeader = getById(id); | |
123 | - if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { | |
124 | - throw new JeecgBootException("不能删除非新建状态单据"); | |
125 | - } | |
126 | - shipmentDetailMapper.deleteByMainId(id.toString()); | |
127 | - shipmentHeaderMapper.deleteById(id); | |
123 | + this.delMain(id.toString()); | |
128 | 124 | } |
129 | 125 | } |
130 | 126 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.impl; |
2 | 2 | |
3 | -import java.math.BigDecimal; | |
4 | -import java.util.Date; | |
3 | +import java.io.Serializable; | |
4 | +import java.util.Collection; | |
5 | +import java.util.List; | |
5 | 6 | |
6 | 7 | import org.jeecg.common.exception.JeecgBootException; |
7 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
8 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | |
9 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | |
10 | -import org.jeecg.modules.wms.receipt.receiptHeaderHistory.entity.ReceiptDetailHistory; | |
11 | -import org.jeecg.modules.wms.receipt.receiptHeaderHistory.entity.ReceiptHeaderHistory; | |
12 | 8 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
13 | 9 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; |
14 | 10 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; |
15 | 11 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; |
16 | -import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory; | |
17 | 12 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentDetailHistory; |
13 | +import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory; | |
18 | 14 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.mapper.ShipmentDetailHistoryMapper; |
19 | 15 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.mapper.ShipmentHeaderHistoryMapper; |
20 | 16 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentDetailHistoryService; |
21 | 17 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentHeaderHistoryService; |
22 | 18 | import org.springframework.beans.BeanUtils; |
23 | -import org.springframework.stereotype.Service; | |
24 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
25 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
20 | +import org.springframework.stereotype.Service; | |
26 | 21 | import org.springframework.transaction.annotation.Transactional; |
27 | -import java.io.Serializable; | |
28 | -import java.util.ArrayList; | |
29 | -import java.util.List; | |
30 | -import java.util.Collection; | |
31 | -import java.util.stream.Collectors; | |
22 | +import org.springframework.util.CollectionUtils; | |
23 | + | |
24 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
25 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
32 | 26 | |
33 | 27 | /** |
34 | 28 | * @Description: 历史出库单 |
... | ... | @@ -41,13 +35,16 @@ public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl<ShipmentHeader |
41 | 35 | |
42 | 36 | @Autowired |
43 | 37 | private ShipmentHeaderHistoryMapper shipmentHeaderHistoryMapper; |
38 | + | |
44 | 39 | @Autowired |
45 | 40 | private ShipmentDetailHistoryMapper shipmentDetailHistoryMapper; |
46 | 41 | |
47 | 42 | @Autowired |
48 | 43 | private IShipmentHeaderService shipmentHeaderService; |
44 | + | |
49 | 45 | @Autowired |
50 | 46 | private IShipmentDetailService shipmentDetailService; |
47 | + | |
51 | 48 | @Autowired |
52 | 49 | private IShipmentDetailHistoryService shipmentDetailHistoryService; |
53 | 50 | |
... | ... | @@ -75,38 +72,18 @@ public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl<ShipmentHeader |
75 | 72 | public void saveById(String id) { |
76 | 73 | ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); |
77 | 74 | ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory(); |
78 | - shipmentHeaderHistory.setCode(shipmentHeader.getCode()); | |
79 | - shipmentHeaderHistory.setWarehouseCode(shipmentHeader.getWarehouseCode()); | |
80 | - shipmentHeaderHistory.setCompanyCode(shipmentHeader.getCompanyCode()); | |
81 | - shipmentHeaderHistory.setType(shipmentHeader.getType()); | |
82 | - shipmentHeaderHistory.setFirstStatus(shipmentHeader.getFirstStatus()); | |
83 | - shipmentHeaderHistory.setLastStatus(shipmentHeader.getLastStatus()); | |
84 | - shipmentHeaderHistory.setReferCode(shipmentHeader.getReferCode()); | |
85 | - shipmentHeaderHistory.setCustomerCode(shipmentHeader.getCompanyCode()); | |
86 | - shipmentHeaderHistory.setTotalQty(shipmentHeader.getTotalQty()); | |
87 | - shipmentHeaderHistory.setTotalLines(shipmentHeader.getTotalLines()); | |
88 | - shipmentHeaderHistory.setRemark(shipmentHeader.getRemark()); | |
89 | - shipmentHeaderHistory.setUserdef1(shipmentHeader.getUserdef1()); | |
90 | - shipmentHeaderHistory.setUserdef2(shipmentHeader.getUserdef2()); | |
91 | - shipmentHeaderHistory.setUserdef3(shipmentHeader.getUserdef3()); | |
92 | - shipmentHeaderHistory.setCreateBy(shipmentHeader.getCreateBy()); | |
93 | - shipmentHeaderHistory.setCreateTime(shipmentHeader.getCreateTime()); | |
94 | - shipmentHeaderHistory.setUpdateBy(shipmentHeader.getUpdateBy()); | |
95 | - shipmentHeaderHistory.setUpdateTime(shipmentHeader.getUpdateTime()); | |
96 | - | |
75 | + BeanUtils.copyProperties(shipmentHeader, shipmentHeaderHistory); | |
97 | 76 | shipmentHeaderHistoryMapper.insert(shipmentHeaderHistory); |
98 | - List<ShipmentDetailHistory> shipmentDetailHistoryList = new ArrayList<>(); | |
99 | 77 | List<ShipmentDetail> shipmentDetailList = |
100 | 78 | shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId())); |
101 | - for (ShipmentDetail detail : shipmentDetailList) { | |
102 | - ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory(); | |
103 | - BeanUtils.copyProperties(detail, shipmentDetailHistory); | |
104 | - shipmentDetailHistoryList.add(shipmentDetailHistory); | |
105 | - } | |
106 | - List<ShipmentDetailHistory> newList = | |
107 | - shipmentDetailHistoryList.stream().peek(detail -> detail.setShipmentId(shipmentHeaderHistory.getId())).collect(Collectors.toList()); | |
108 | - if (!shipmentDetailHistoryService.saveBatch(newList)) { | |
109 | - throw new JeecgBootException("批量新增失败"); | |
79 | + if (!CollectionUtils.isEmpty(shipmentDetailList)) { | |
80 | + for (ShipmentDetail detail : shipmentDetailList) { | |
81 | + ShipmentDetailHistory shipmentDetailHistory = new ShipmentDetailHistory(); | |
82 | + BeanUtils.copyProperties(detail, shipmentDetailHistory); | |
83 | + if (!shipmentDetailHistoryService.save(shipmentDetailHistory)) { | |
84 | + throw new JeecgBootException("批量新增失败"); | |
85 | + } | |
86 | + } | |
110 | 87 | } |
111 | 88 | } |
112 | 89 | |
... | ... |