Commit ad1cb22b104470af4a2df508333e61bedf6800aa
1 parent
5436b708
库存填充度功能提交
Signed-off-by: TanYibin <5491541@qq.com>
Showing
9 changed files
with
414 additions
and
284 deletions
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
@@ -3,7 +3,9 @@ | @@ -3,7 +3,9 @@ | ||
3 | <!-- 操作按钮区域 --> | 3 | <!-- 操作按钮区域 --> |
4 | <div class="table-operator" v-if="mainId"> | 4 | <div class="table-operator" v-if="mainId"> |
5 | <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> | 5 | <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
6 | - <a-button v-has="'inventoryDetail:export'" type="primary" icon="download" @click="handleExportXls('库存详情')">导出</a-button> | 6 | + <a-button v-has="'inventoryDetail:export'" type="primary" icon="download" @click="handleExportXls('库存详情')" |
7 | + >导出</a-button | ||
8 | + > | ||
7 | <a-upload | 9 | <a-upload |
8 | v-has="'inventoryDetail:import'" | 10 | v-has="'inventoryDetail:import'" |
9 | name="file" | 11 | name="file" |
@@ -11,18 +13,20 @@ | @@ -11,18 +13,20 @@ | ||
11 | :multiple="false" | 13 | :multiple="false" |
12 | :headers="tokenHeader" | 14 | :headers="tokenHeader" |
13 | :action="importExcelUrl" | 15 | :action="importExcelUrl" |
14 | - @change="handleImportExcel"> | 16 | + @change="handleImportExcel" |
17 | + > | ||
15 | <a-button type="primary" icon="import">导入</a-button> | 18 | <a-button type="primary" icon="import">导入</a-button> |
16 | </a-upload> | 19 | </a-upload> |
17 | <a-dropdown v-if="selectedRowKeys.length > 0"> | 20 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
18 | <a-menu slot="overlay" v-has="'inventoryDetail:deleteBatch'"> | 21 | <a-menu slot="overlay" v-has="'inventoryDetail:deleteBatch'"> |
19 | <a-menu-item key="1" @click="batchDel"> | 22 | <a-menu-item key="1" @click="batchDel"> |
20 | - <a-icon type="delete"/> | 23 | + <a-icon type="delete" /> |
21 | 删除 | 24 | 删除 |
22 | </a-menu-item> | 25 | </a-menu-item> |
23 | </a-menu> | 26 | </a-menu> |
24 | - <a-button style="margin-left: 8px"> 批量操作 | ||
25 | - <a-icon type="down"/> | 27 | + <a-button style="margin-left: 8px"> |
28 | + 批量操作 | ||
29 | + <a-icon type="down" /> | ||
26 | </a-button> | 30 | </a-button> |
27 | </a-dropdown> | 31 | </a-dropdown> |
28 | </div> | 32 | </div> |
@@ -30,8 +34,8 @@ | @@ -30,8 +34,8 @@ | ||
30 | <!-- table区域-begin --> | 34 | <!-- table区域-begin --> |
31 | <div> | 35 | <div> |
32 | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | 36 | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
33 | - <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a | ||
34 | - style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项 | 37 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 |
38 | + <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项 | ||
35 | <a style="margin-left: 24px" @click="onClearSelected">清空</a> | 39 | <a style="margin-left: 24px" @click="onClearSelected">清空</a> |
36 | </div> | 40 | </div> |
37 | 41 | ||
@@ -40,16 +44,16 @@ | @@ -40,16 +44,16 @@ | ||
40 | size="middle" | 44 | size="middle" |
41 | bordered | 45 | bordered |
42 | rowKey="id" | 46 | rowKey="id" |
43 | - :scroll="{x:true}" | 47 | + :scroll="{ x: true }" |
44 | :columns="columns" | 48 | :columns="columns" |
45 | :dataSource="dataSource" | 49 | :dataSource="dataSource" |
46 | :pagination="ipagination" | 50 | :pagination="ipagination" |
47 | :loading="loading" | 51 | :loading="loading" |
48 | - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | ||
49 | - @change="handleTableChange"> | ||
50 | - | 52 | + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
53 | + @change="handleTableChange" | ||
54 | + > | ||
51 | <span slot="companyCode" slot-scope="companyCode"> | 55 | <span slot="companyCode" slot-scope="companyCode"> |
52 | - <a-tag :key="companyCode" color=blue> | 56 | + <a-tag :key="companyCode" color="blue"> |
53 | {{ solutionCompany(companyCode) }} | 57 | {{ solutionCompany(companyCode) }} |
54 | </a-tag> | 58 | </a-tag> |
55 | </span> | 59 | </span> |
@@ -59,31 +63,27 @@ | @@ -59,31 +63,27 @@ | ||
59 | </template> | 63 | </template> |
60 | <template slot="imgSlot" slot-scope="text"> | 64 | <template slot="imgSlot" slot-scope="text"> |
61 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | 65 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
62 | - <img v-else :src="getImgView(text)" height="25px" alt="" | ||
63 | - style="max-width:80px;font-size: 12px;font-style: italic;"/> | 66 | + <img |
67 | + v-else | ||
68 | + :src="getImgView(text)" | ||
69 | + height="25px" | ||
70 | + alt="" | ||
71 | + style="max-width:80px;font-size: 12px;font-style: italic;" | ||
72 | + /> | ||
64 | </template> | 73 | </template> |
65 | <template slot="fileSlot" slot-scope="text"> | 74 | <template slot="fileSlot" slot-scope="text"> |
66 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | 75 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
67 | - <a-button | ||
68 | - v-else | ||
69 | - :ghost="true" | ||
70 | - type="primary" | ||
71 | - icon="download" | ||
72 | - size="small" | ||
73 | - @click="downloadFile(text)"> | 76 | + <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)"> |
74 | 下载 | 77 | 下载 |
75 | </a-button> | 78 | </a-button> |
76 | </template> | 79 | </template> |
77 | 80 | ||
78 | <span slot="action" slot-scope="text, record"> | 81 | <span slot="action" slot-scope="text, record"> |
79 | - <a v-has="'inventoryDetail:edit'" @click="handleEdit(record)">编辑</a> | ||
80 | - <a-divider type="vertical"/> | ||
81 | - | 82 | + <a v-has="'inventoryDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> |
82 | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | 83 | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
83 | <a v-has="'inventoryDetail:delete'">删除</a> | 84 | <a v-has="'inventoryDetail:delete'">删除</a> |
84 | </a-popconfirm> | 85 | </a-popconfirm> |
85 | </span> | 86 | </span> |
86 | - | ||
87 | </a-table> | 87 | </a-table> |
88 | </div> | 88 | </div> |
89 | 89 | ||
@@ -92,15 +92,14 @@ | @@ -92,15 +92,14 @@ | ||
92 | </template> | 92 | </template> |
93 | 93 | ||
94 | <script> | 94 | <script> |
95 | - | ||
96 | -import {JeecgListMixin} from '@/mixins/JeecgListMixin' | 95 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
97 | import InventoryDetailModal from './modules/InventoryDetailModal' | 96 | import InventoryDetailModal from './modules/InventoryDetailModal' |
98 | -import {getCompanyList} from '@/api/api' | 97 | +import { getCompanyList } from '@/api/api' |
99 | 98 | ||
100 | export default { | 99 | export default { |
101 | - name: "InventoryDetailList", | 100 | + name: 'InventoryDetailList', |
102 | mixins: [JeecgListMixin], | 101 | mixins: [JeecgListMixin], |
103 | - components: {InventoryDetailModal}, | 102 | + components: { InventoryDetailModal }, |
104 | props: { | 103 | props: { |
105 | mainId: { | 104 | mainId: { |
106 | type: String, | 105 | type: String, |
@@ -116,7 +115,7 @@ export default { | @@ -116,7 +115,7 @@ export default { | ||
116 | this.clearList() | 115 | this.clearList() |
117 | } else { | 116 | } else { |
118 | this.queryParam['inventoryHeaderId'] = val | 117 | this.queryParam['inventoryHeaderId'] = val |
119 | - this.loadData(1); | 118 | + this.loadData(1) |
120 | } | 119 | } |
121 | } | 120 | } |
122 | } | 121 | } |
@@ -130,15 +129,15 @@ export default { | @@ -130,15 +129,15 @@ export default { | ||
130 | columns: [ | 129 | columns: [ |
131 | { | 130 | { |
132 | title: '库存详情ID', | 131 | title: '库存详情ID', |
133 | - align: "center", | 132 | + align: 'center', |
134 | dataIndex: 'id' | 133 | dataIndex: 'id' |
135 | }, | 134 | }, |
136 | { | 135 | { |
137 | title: '货主', | 136 | title: '货主', |
138 | - align: "center", | 137 | + align: 'center', |
139 | dataIndex: 'companyCode', | 138 | dataIndex: 'companyCode', |
140 | key: 'companyCode', | 139 | key: 'companyCode', |
141 | - scopedSlots: {customRender: 'companyCode'} | 140 | + scopedSlots: { customRender: 'companyCode' } |
142 | }, | 141 | }, |
143 | // { | 142 | // { |
144 | // title: '库区', | 143 | // title: '库区', |
@@ -147,52 +146,60 @@ export default { | @@ -147,52 +146,60 @@ export default { | ||
147 | // }, | 146 | // }, |
148 | { | 147 | { |
149 | title: '容器编码', | 148 | title: '容器编码', |
150 | - align: "center", | 149 | + align: 'center', |
151 | dataIndex: 'containerCode' | 150 | dataIndex: 'containerCode' |
152 | }, | 151 | }, |
153 | { | 152 | { |
154 | title: '库位编码', | 153 | title: '库位编码', |
155 | - align: "center", | 154 | + align: 'center', |
156 | dataIndex: 'locationCode' | 155 | dataIndex: 'locationCode' |
157 | }, | 156 | }, |
158 | { | 157 | { |
159 | title: '物料编码', | 158 | title: '物料编码', |
160 | - align: "center", | 159 | + align: 'center', |
161 | dataIndex: 'materialCode' | 160 | dataIndex: 'materialCode' |
162 | }, | 161 | }, |
163 | { | 162 | { |
164 | title: '物料名称', | 163 | title: '物料名称', |
165 | - align: "center", | 164 | + align: 'center', |
166 | dataIndex: 'materialName' | 165 | dataIndex: 'materialName' |
167 | }, | 166 | }, |
168 | { | 167 | { |
169 | title: '物料规格', | 168 | title: '物料规格', |
170 | - align: "center", | 169 | + align: 'center', |
171 | dataIndex: 'materialSpec' | 170 | dataIndex: 'materialSpec' |
172 | }, | 171 | }, |
173 | { | 172 | { |
174 | title: '物料单位', | 173 | title: '物料单位', |
175 | - align: "center", | 174 | + align: 'center', |
176 | dataIndex: 'materialUnit' | 175 | dataIndex: 'materialUnit' |
177 | }, | 176 | }, |
178 | { | 177 | { |
179 | title: '数量', | 178 | title: '数量', |
180 | - align: "center", | 179 | + align: 'center', |
181 | dataIndex: 'qty' | 180 | dataIndex: 'qty' |
182 | }, | 181 | }, |
183 | { | 182 | { |
184 | title: '任务锁定数量', | 183 | title: '任务锁定数量', |
185 | - align: "center", | 184 | + align: 'center', |
186 | dataIndex: 'taskQty' | 185 | dataIndex: 'taskQty' |
187 | }, | 186 | }, |
188 | { | 187 | { |
188 | + title: '托盘填充度', | ||
189 | + align: 'center', | ||
190 | + dataIndex: 'fillDensity', | ||
191 | + customRender: text => { | ||
192 | + return text == null ? '' : text + '%' | ||
193 | + } | ||
194 | + }, | ||
195 | + { | ||
189 | title: '库存状态', | 196 | title: '库存状态', |
190 | - align: "center", | ||
191 | - dataIndex: 'inventoryStatus_dictText', | 197 | + align: 'center', |
198 | + dataIndex: 'inventoryStatus_dictText' | ||
192 | }, | 199 | }, |
193 | { | 200 | { |
194 | title: '批次', | 201 | title: '批次', |
195 | - align: "center", | 202 | + align: 'center', |
196 | dataIndex: 'batch' | 203 | dataIndex: 'batch' |
197 | }, | 204 | }, |
198 | // { | 205 | // { |
@@ -202,75 +209,75 @@ export default { | @@ -202,75 +209,75 @@ export default { | ||
202 | // }, | 209 | // }, |
203 | { | 210 | { |
204 | title: '入库日期', | 211 | title: '入库日期', |
205 | - align: "center", | 212 | + align: 'center', |
206 | dataIndex: 'receiptDate' | 213 | dataIndex: 'receiptDate' |
207 | }, | 214 | }, |
208 | { | 215 | { |
209 | title: '库龄(天)', | 216 | title: '库龄(天)', |
210 | - align: "center", | 217 | + align: 'center', |
211 | dataIndex: 'inventoryAge' | 218 | dataIndex: 'inventoryAge' |
212 | }, | 219 | }, |
213 | { | 220 | { |
214 | title: '创建人', | 221 | title: '创建人', |
215 | - align: "center", | 222 | + align: 'center', |
216 | dataIndex: 'createBy' | 223 | dataIndex: 'createBy' |
217 | }, | 224 | }, |
218 | { | 225 | { |
219 | title: '创建日期', | 226 | title: '创建日期', |
220 | - align: "center", | 227 | + align: 'center', |
221 | dataIndex: 'createTime' | 228 | dataIndex: 'createTime' |
222 | }, | 229 | }, |
223 | { | 230 | { |
224 | title: '更新人', | 231 | title: '更新人', |
225 | - align: "center", | 232 | + align: 'center', |
226 | dataIndex: 'updateBy' | 233 | dataIndex: 'updateBy' |
227 | }, | 234 | }, |
228 | { | 235 | { |
229 | title: '更新日期', | 236 | title: '更新日期', |
230 | - align: "center", | 237 | + align: 'center', |
231 | dataIndex: 'updateTime' | 238 | dataIndex: 'updateTime' |
232 | }, | 239 | }, |
233 | { | 240 | { |
234 | title: '操作', | 241 | title: '操作', |
235 | dataIndex: 'action', | 242 | dataIndex: 'action', |
236 | - align: "center", | ||
237 | - fixed: "right", | 243 | + align: 'center', |
244 | + fixed: 'right', | ||
238 | width: 147, | 245 | width: 147, |
239 | - scopedSlots: {customRender: 'action'}, | 246 | + scopedSlots: { customRender: 'action' } |
240 | } | 247 | } |
241 | ], | 248 | ], |
242 | url: { | 249 | url: { |
243 | - list: "/inventory/inventoryHeader/listInventoryDetailByMainId", | ||
244 | - delete: "/inventory/inventoryHeader/deleteInventoryDetail", | ||
245 | - deleteBatch: "/inventory/inventoryHeader/deleteBatchInventoryDetail", | ||
246 | - exportXlsUrl: "/inventory/inventoryHeader/exportInventoryDetail", | ||
247 | - importUrl: "/inventory/inventoryHeader/importInventoryDetail", | 250 | + list: '/inventory/inventoryHeader/listInventoryDetailByMainId', |
251 | + delete: '/inventory/inventoryHeader/deleteInventoryDetail', | ||
252 | + deleteBatch: '/inventory/inventoryHeader/deleteBatchInventoryDetail', | ||
253 | + exportXlsUrl: '/inventory/inventoryHeader/exportInventoryDetail', | ||
254 | + importUrl: '/inventory/inventoryHeader/importInventoryDetail' | ||
248 | }, | 255 | }, |
249 | dictOptions: { | 256 | dictOptions: { |
250 | - containerStatus: [], | 257 | + containerStatus: [] |
251 | } | 258 | } |
252 | } | 259 | } |
253 | }, | 260 | }, |
254 | created() { | 261 | created() { |
255 | - this.loadFrom(); | 262 | + this.loadFrom() |
256 | }, | 263 | }, |
257 | computed: { | 264 | computed: { |
258 | importExcelUrl() { | 265 | importExcelUrl() { |
259 | - return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; | 266 | + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}` |
260 | } | 267 | } |
261 | }, | 268 | }, |
262 | methods: { | 269 | methods: { |
263 | loadFrom() { | 270 | loadFrom() { |
264 | - getCompanyList().then((res) => { | 271 | + getCompanyList().then(res => { |
265 | if (res.success) { | 272 | if (res.success) { |
266 | this.companyList = res.result | 273 | this.companyList = res.result |
267 | } | 274 | } |
268 | - }); | 275 | + }) |
269 | }, | 276 | }, |
270 | solutionCompany(value) { | 277 | solutionCompany(value) { |
271 | var actions = [] | 278 | var actions = [] |
272 | - Object.keys(this.companyList).some((key) => { | ||
273 | - if (this.companyList[key].code == ('' + value)) { | 279 | + Object.keys(this.companyList).some(key => { |
280 | + if (this.companyList[key].code == '' + value) { | ||
274 | actions.push(this.companyList[key].name) | 281 | actions.push(this.companyList[key].name) |
275 | return true | 282 | return true |
276 | } | 283 | } |
@@ -282,10 +289,9 @@ export default { | @@ -282,10 +289,9 @@ export default { | ||
282 | this.selectedRowKeys = [] | 289 | this.selectedRowKeys = [] |
283 | this.ipagination.current = 1 | 290 | this.ipagination.current = 1 |
284 | } | 291 | } |
285 | - | ||
286 | } | 292 | } |
287 | } | 293 | } |
288 | </script> | 294 | </script> |
289 | <style scoped> | 295 | <style scoped> |
290 | -@import '~@assets/less/common.less' | 296 | +@import '~@assets/less/common.less'; |
291 | </style> | 297 | </style> |
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
@@ -47,7 +47,11 @@ | @@ -47,7 +47,11 @@ | ||
47 | </a-col> | 47 | </a-col> |
48 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 48 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
49 | <a-form-item label="库存状态"> | 49 | <a-form-item label="库存状态"> |
50 | - <j-dict-select-tag placeholder="请选择库存状态" v-model="queryParam.inventoryStatus" dictCode="inventory_status"/> | 50 | + <j-dict-select-tag |
51 | + placeholder="请选择库存状态" | ||
52 | + v-model="queryParam.inventoryStatus" | ||
53 | + dictCode="inventory_status" | ||
54 | + /> | ||
51 | </a-form-item> | 55 | </a-form-item> |
52 | </a-col> | 56 | </a-col> |
53 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 57 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
@@ -62,7 +66,12 @@ | @@ -62,7 +66,12 @@ | ||
62 | </a-col> --> | 66 | </a-col> --> |
63 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 67 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
64 | <a-form-item label="入库日期"> | 68 | <a-form-item label="入库日期"> |
65 | - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择入库日期" v-model="queryParam.receiptDate"></j-date> | 69 | + <j-date |
70 | + :show-time="true" | ||
71 | + date-format="YYYY-MM-DD HH:mm:ss" | ||
72 | + placeholder="请选择入库日期" | ||
73 | + v-model="queryParam.receiptDate" | ||
74 | + ></j-date> | ||
66 | </a-form-item> | 75 | </a-form-item> |
67 | </a-col> | 76 | </a-col> |
68 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 77 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
@@ -77,7 +86,7 @@ | @@ -77,7 +86,7 @@ | ||
77 | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | 86 | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
78 | <a @click="handleToggleSearch" style="margin-left: 8px"> | 87 | <a @click="handleToggleSearch" style="margin-left: 8px"> |
79 | {{ toggleSearchStatus ? '收起' : '展开' }} | 88 | {{ toggleSearchStatus ? '收起' : '展开' }} |
80 | - <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | 89 | + <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> |
81 | </a> | 90 | </a> |
82 | </span> | 91 | </span> |
83 | </a-col> | 92 | </a-col> |
@@ -89,67 +98,81 @@ | @@ -89,67 +98,81 @@ | ||
89 | <!-- 操作按钮区域 --> | 98 | <!-- 操作按钮区域 --> |
90 | <div class="table-operator"> | 99 | <div class="table-operator"> |
91 | <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> | 100 | <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
92 | - <a-button v-has="'inventoryDetail:export'" type="primary" icon="download" @click="handleExportXls('库存详情')">导出</a-button> | ||
93 | - <a-upload v-has="'inventoryDetail:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | 101 | + <a-button v-has="'inventoryDetail:export'" type="primary" icon="download" @click="handleExportXls('库存详情')" |
102 | + >导出</a-button | ||
103 | + > | ||
104 | + <a-upload | ||
105 | + v-has="'inventoryDetail:import'" | ||
106 | + name="file" | ||
107 | + :showUploadList="false" | ||
108 | + :multiple="false" | ||
109 | + :headers="tokenHeader" | ||
110 | + :action="importExcelUrl" | ||
111 | + @change="handleImportExcel" | ||
112 | + > | ||
94 | <a-button type="primary" icon="import">导入</a-button> | 113 | <a-button type="primary" icon="import">导入</a-button> |
95 | </a-upload> | 114 | </a-upload> |
96 | <!-- 高级查询区域 --> | 115 | <!-- 高级查询区域 --> |
97 | - <j-super-query :fieldList="superFieldList" v-has="'inventoryDetail:superSearch'" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | ||
98 | -<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> | ||
99 | -<!-- <a-menu slot="overlay">--> | ||
100 | -<!-- <a-menu-item v-has="'inventoryDetail:delete'" key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> | ||
101 | -<!-- </a-menu>--> | ||
102 | -<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> | ||
103 | -<!-- </a-dropdown>--> | 116 | + <j-super-query |
117 | + :fieldList="superFieldList" | ||
118 | + v-has="'inventoryDetail:superSearch'" | ||
119 | + ref="superQueryModal" | ||
120 | + @handleSuperQuery="handleSuperQuery" | ||
121 | + ></j-super-query> | ||
122 | + <!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> | ||
123 | + <!-- <a-menu slot="overlay">--> | ||
124 | + <!-- <a-menu-item v-has="'inventoryDetail:delete'" key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> | ||
125 | + <!-- </a-menu>--> | ||
126 | + <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> | ||
127 | + <!-- </a-dropdown>--> | ||
104 | </div> | 128 | </div> |
105 | 129 | ||
106 | <!-- table区域-begin --> | 130 | <!-- table区域-begin --> |
107 | <div> | 131 | <div> |
108 | -<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> | ||
109 | -<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | ||
110 | -<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | ||
111 | -<!-- </div>--> | 132 | + <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> |
133 | + <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | ||
134 | + <!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | ||
135 | + <!-- </div>--> | ||
112 | 136 | ||
113 | <a-table | 137 | <a-table |
114 | ref="table" | 138 | ref="table" |
115 | size="middle" | 139 | size="middle" |
116 | - :scroll="{x:true}" | 140 | + :scroll="{ x: true }" |
117 | bordered | 141 | bordered |
118 | rowKey="id" | 142 | rowKey="id" |
119 | :columns="columns" | 143 | :columns="columns" |
120 | :dataSource="dataSource" | 144 | :dataSource="dataSource" |
121 | :pagination="ipagination" | 145 | :pagination="ipagination" |
122 | :loading="loading" | 146 | :loading="loading" |
123 | - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | 147 | + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
124 | class="j-table-force-nowrap" | 148 | class="j-table-force-nowrap" |
125 | - @change="handleTableChange"> | ||
126 | - | 149 | + @change="handleTableChange" |
150 | + > | ||
127 | <template slot="htmlSlot" slot-scope="text"> | 151 | <template slot="htmlSlot" slot-scope="text"> |
128 | <div v-html="text"></div> | 152 | <div v-html="text"></div> |
129 | </template> | 153 | </template> |
130 | <template slot="imgSlot" slot-scope="text"> | 154 | <template slot="imgSlot" slot-scope="text"> |
131 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | 155 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
132 | - <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | 156 | + <img |
157 | + v-else | ||
158 | + :src="getImgView(text)" | ||
159 | + height="25px" | ||
160 | + alt="" | ||
161 | + style="max-width:80px;font-size: 12px;font-style: italic;" | ||
162 | + /> | ||
133 | </template> | 163 | </template> |
134 | <template slot="fileSlot" slot-scope="text"> | 164 | <template slot="fileSlot" slot-scope="text"> |
135 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | 165 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
136 | - <a-button | ||
137 | - v-else | ||
138 | - :ghost="true" | ||
139 | - type="primary" | ||
140 | - icon="download" | ||
141 | - size="small" | ||
142 | - @click="downloadFile(text)"> | 166 | + <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)"> |
143 | 下载 | 167 | 下载 |
144 | </a-button> | 168 | </a-button> |
145 | </template> | 169 | </template> |
146 | <span slot="action" slot-scope="text, record"> | 170 | <span slot="action" slot-scope="text, record"> |
147 | - <a v-has="'inventoryDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical" /></a> | 171 | + <a v-has="'inventoryDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> |
148 | <a-popconfirm v-has="'inventoryDetail:delete'" title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | 172 | <a-popconfirm v-has="'inventoryDetail:delete'" title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
149 | <a>删除</a> | 173 | <a>删除</a> |
150 | </a-popconfirm> | 174 | </a-popconfirm> |
151 | </span> | 175 | </span> |
152 | - | ||
153 | </a-table> | 176 | </a-table> |
154 | </div> | 177 | </div> |
155 | 178 | ||
@@ -158,187 +181,192 @@ | @@ -158,187 +181,192 @@ | ||
158 | </template> | 181 | </template> |
159 | 182 | ||
160 | <script> | 183 | <script> |
184 | +import '@/assets/less/TableExpand.less' | ||
185 | +import { mixinDevice } from '@/utils/mixin' | ||
186 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
187 | +import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' | ||
188 | +import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' | ||
161 | 189 | ||
162 | - import '@/assets/less/TableExpand.less' | ||
163 | - import { mixinDevice } from '@/utils/mixin' | ||
164 | - import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
165 | - import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' | ||
166 | - import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | ||
167 | - | ||
168 | - export default { | ||
169 | - name: 'InventoryDetailList', | ||
170 | - mixins:[JeecgListMixin, mixinDevice], | ||
171 | - components: { | ||
172 | - SimpleInventoryDetailModal | ||
173 | - }, | ||
174 | - data () { | ||
175 | - return { | ||
176 | - description: '库存详情管理页面', | ||
177 | - // 表头 | ||
178 | - columns: [ | ||
179 | - { | ||
180 | - title: '#', | ||
181 | - dataIndex: '', | ||
182 | - key:'rowIndex', | ||
183 | - width:60, | ||
184 | - align:"center", | ||
185 | - customRender:function (t,r,index) { | ||
186 | - return parseInt(index)+1; | ||
187 | - } | ||
188 | - }, | ||
189 | - { | ||
190 | - title:'货主', | ||
191 | - align:"center", | ||
192 | - dataIndex: 'companyCode' | ||
193 | - }, | ||
194 | - { | ||
195 | - title:'库区', | ||
196 | - align:"center", | ||
197 | - dataIndex: 'zoneCode' | ||
198 | - }, | ||
199 | - { | ||
200 | - title:'容器编码', | ||
201 | - align:"center", | ||
202 | - dataIndex: 'containerCode' | ||
203 | - }, | ||
204 | - { | ||
205 | - title:'库位编码', | ||
206 | - align:"center", | ||
207 | - dataIndex: 'locationCode' | ||
208 | - }, | ||
209 | - { | ||
210 | - title:'物料编码', | ||
211 | - align:"center", | ||
212 | - dataIndex: 'materialCode' | ||
213 | - }, | ||
214 | - { | ||
215 | - title:'物料名称', | ||
216 | - align:"center", | ||
217 | - dataIndex: 'materialName' | ||
218 | - }, | ||
219 | - { | ||
220 | - title:'物料规格', | ||
221 | - align:"center", | ||
222 | - dataIndex: 'materialSpec' | ||
223 | - }, | ||
224 | - { | ||
225 | - title:'物料单位', | ||
226 | - align:"center", | ||
227 | - dataIndex: 'materialUnit' | ||
228 | - }, | ||
229 | - { | ||
230 | - title:'数量', | ||
231 | - align:"center", | ||
232 | - dataIndex: 'qty' | ||
233 | - }, | ||
234 | - { | ||
235 | - title:'任务锁定数量', | ||
236 | - align:"center", | ||
237 | - dataIndex: 'taskQty' | ||
238 | - }, | ||
239 | - { | ||
240 | - title:'库存状态', | ||
241 | - align:"center", | ||
242 | - dataIndex: 'inventoryStatus_dictText' | ||
243 | - }, | ||
244 | - { | ||
245 | - title:'批次', | ||
246 | - align:"center", | ||
247 | - dataIndex: 'batch' | ||
248 | - }, | ||
249 | - // { | ||
250 | - // title:'唯一号', | ||
251 | - // align:"center", | ||
252 | - // dataIndex: 'uniqueCode' | ||
253 | - // }, | ||
254 | - { | ||
255 | - title:'入库日期', | ||
256 | - align:"center", | ||
257 | - dataIndex: 'receiptDate' | ||
258 | - }, | ||
259 | - { | ||
260 | - title:'库龄(天)', | ||
261 | - align:"center", | ||
262 | - dataIndex: 'inventoryAge' | ||
263 | - }, | ||
264 | - { | ||
265 | - title:'创建人', | ||
266 | - align:"center", | ||
267 | - dataIndex: 'createBy' | ||
268 | - }, | ||
269 | - { | ||
270 | - title:'创建日期', | ||
271 | - align:"center", | ||
272 | - dataIndex: 'createTime' | ||
273 | - }, | ||
274 | - { | ||
275 | - title:'更新人', | ||
276 | - align:"center", | ||
277 | - dataIndex: 'updateBy' | ||
278 | - }, | ||
279 | - { | ||
280 | - title:'更新日期', | ||
281 | - align:"center", | ||
282 | - dataIndex: 'updateTime' | ||
283 | - }, | ||
284 | - { | ||
285 | - title: '操作', | ||
286 | - dataIndex: 'action', | ||
287 | - align:"center", | ||
288 | - fixed:"right", | ||
289 | - width:147, | ||
290 | - scopedSlots: { customRender: 'action' } | 190 | +export default { |
191 | + name: 'InventoryDetailList', | ||
192 | + mixins: [JeecgListMixin, mixinDevice], | ||
193 | + components: { | ||
194 | + SimpleInventoryDetailModal | ||
195 | + }, | ||
196 | + data() { | ||
197 | + return { | ||
198 | + description: '库存详情管理页面', | ||
199 | + // 表头 | ||
200 | + columns: [ | ||
201 | + { | ||
202 | + title: '#', | ||
203 | + dataIndex: '', | ||
204 | + key: 'rowIndex', | ||
205 | + width: 60, | ||
206 | + align: 'center', | ||
207 | + customRender: function(t, r, index) { | ||
208 | + return parseInt(index) + 1 | ||
291 | } | 209 | } |
292 | - ], | ||
293 | - url: { | ||
294 | - list: "/inventory/inventoryDetail/list", | ||
295 | - delete: "/inventory/inventoryDetail/delete", | ||
296 | - deleteBatch: "/inventory/inventoryDetail/deleteBatch", | ||
297 | - exportXlsUrl: "/inventory/inventoryDetail/exportXls", | ||
298 | - importExcelUrl: "inventory/inventoryDetail/importExcel", | ||
299 | - | ||
300 | }, | 210 | }, |
301 | - dictOptions:{}, | ||
302 | - superFieldList:[], | ||
303 | - } | ||
304 | - }, | ||
305 | - created() { | ||
306 | - this.getSuperFieldList(); | ||
307 | - }, | ||
308 | - computed: { | ||
309 | - importExcelUrl: function(){ | ||
310 | - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | ||
311 | - }, | ||
312 | - }, | ||
313 | - methods: { | ||
314 | - initDictConfig(){ | 211 | + { |
212 | + title: '货主', | ||
213 | + align: 'center', | ||
214 | + dataIndex: 'companyCode' | ||
215 | + }, | ||
216 | + { | ||
217 | + title: '库区', | ||
218 | + align: 'center', | ||
219 | + dataIndex: 'zoneCode' | ||
220 | + }, | ||
221 | + { | ||
222 | + title: '容器编码', | ||
223 | + align: 'center', | ||
224 | + dataIndex: 'containerCode' | ||
225 | + }, | ||
226 | + { | ||
227 | + title: '库位编码', | ||
228 | + align: 'center', | ||
229 | + dataIndex: 'locationCode' | ||
230 | + }, | ||
231 | + { | ||
232 | + title: '物料编码', | ||
233 | + align: 'center', | ||
234 | + dataIndex: 'materialCode' | ||
235 | + }, | ||
236 | + { | ||
237 | + title: '物料名称', | ||
238 | + align: 'center', | ||
239 | + dataIndex: 'materialName' | ||
240 | + }, | ||
241 | + { | ||
242 | + title: '物料规格', | ||
243 | + align: 'center', | ||
244 | + dataIndex: 'materialSpec' | ||
245 | + }, | ||
246 | + { | ||
247 | + title: '物料单位', | ||
248 | + align: 'center', | ||
249 | + dataIndex: 'materialUnit' | ||
250 | + }, | ||
251 | + { | ||
252 | + title: '数量', | ||
253 | + align: 'center', | ||
254 | + dataIndex: 'qty' | ||
255 | + }, | ||
256 | + { | ||
257 | + title: '任务锁定数量', | ||
258 | + align: 'center', | ||
259 | + dataIndex: 'taskQty' | ||
260 | + }, | ||
261 | + { | ||
262 | + title: '托盘填充度', | ||
263 | + align: 'center', | ||
264 | + dataIndex: 'fillDensity', | ||
265 | + customRender: text => { | ||
266 | + return text == null ? '' : text + '%' | ||
267 | + } | ||
268 | + }, | ||
269 | + { | ||
270 | + title: '库存状态', | ||
271 | + align: 'center', | ||
272 | + dataIndex: 'inventoryStatus_dictText' | ||
273 | + }, | ||
274 | + { | ||
275 | + title: '批次', | ||
276 | + align: 'center', | ||
277 | + dataIndex: 'batch' | ||
278 | + }, | ||
279 | + // { | ||
280 | + // title:'唯一号', | ||
281 | + // align:"center", | ||
282 | + // dataIndex: 'uniqueCode' | ||
283 | + // }, | ||
284 | + { | ||
285 | + title: '入库日期', | ||
286 | + align: 'center', | ||
287 | + dataIndex: 'receiptDate' | ||
288 | + }, | ||
289 | + { | ||
290 | + title: '库龄(天)', | ||
291 | + align: 'center', | ||
292 | + dataIndex: 'inventoryAge' | ||
293 | + }, | ||
294 | + { | ||
295 | + title: '创建人', | ||
296 | + align: 'center', | ||
297 | + dataIndex: 'createBy' | ||
298 | + }, | ||
299 | + { | ||
300 | + title: '创建日期', | ||
301 | + align: 'center', | ||
302 | + dataIndex: 'createTime' | ||
303 | + }, | ||
304 | + { | ||
305 | + title: '更新人', | ||
306 | + align: 'center', | ||
307 | + dataIndex: 'updateBy' | ||
308 | + }, | ||
309 | + { | ||
310 | + title: '更新日期', | ||
311 | + align: 'center', | ||
312 | + dataIndex: 'updateTime' | ||
313 | + }, | ||
314 | + { | ||
315 | + title: '操作', | ||
316 | + dataIndex: 'action', | ||
317 | + align: 'center', | ||
318 | + fixed: 'right', | ||
319 | + width: 147, | ||
320 | + scopedSlots: { customRender: 'action' } | ||
321 | + } | ||
322 | + ], | ||
323 | + url: { | ||
324 | + list: '/inventory/inventoryDetail/list', | ||
325 | + delete: '/inventory/inventoryDetail/delete', | ||
326 | + deleteBatch: '/inventory/inventoryDetail/deleteBatch', | ||
327 | + exportXlsUrl: '/inventory/inventoryDetail/exportXls', | ||
328 | + importExcelUrl: 'inventory/inventoryDetail/importExcel' | ||
315 | }, | 329 | }, |
316 | - getSuperFieldList(){ | ||
317 | - let fieldList=[]; | ||
318 | - fieldList.push({type:'string',value:'companyCode',text:'货主',dictCode:''}) | ||
319 | - fieldList.push({type:'string',value:'zoneCode',text:'库区',dictCode:''}) | ||
320 | - fieldList.push({type:'string',value:'containerCode',text:'容器编码',dictCode:''}) | ||
321 | - fieldList.push({type:'string',value:'locationCode',text:'库位编码',dictCode:''}) | ||
322 | - fieldList.push({type:'string',value:'materialCode',text:'物料编码',dictCode:''}) | ||
323 | - fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''}) | ||
324 | - fieldList.push({type:'string',value:'materialSpec',text:'物料规格',dictCode:''}) | ||
325 | - fieldList.push({type:'string',value:'materialUnit',text:'物料单位',dictCode:''}) | ||
326 | - fieldList.push({type:'BigDecimal',value:'qty',text:'数量',dictCode:''}) | ||
327 | - fieldList.push({type:'BigDecimal',value:'taskQty',text:'任务锁定数量',dictCode:''}) | ||
328 | - fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态',dictCode:'inventory_status'}) | ||
329 | - fieldList.push({type:'string',value:'batch',text:'批次',dictCode:''}) | ||
330 | - // fieldList.push({type:'string',value:'uniqueCode',text:'唯一号',dictCode:''}) | ||
331 | - fieldList.push({type:'datetime',value:'receiptDate',text:'入库日期'}) | ||
332 | - fieldList.push({type:'int',value:'inventoryAge',text:'库龄(天)',dictCode:''}) | ||
333 | - fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) | ||
334 | - fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | ||
335 | - fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''}) | ||
336 | - fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) | ||
337 | - this.superFieldList = fieldList | ||
338 | - } | 330 | + dictOptions: {}, |
331 | + superFieldList: [] | ||
332 | + } | ||
333 | + }, | ||
334 | + created() { | ||
335 | + this.getSuperFieldList() | ||
336 | + }, | ||
337 | + computed: { | ||
338 | + importExcelUrl: function() { | ||
339 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` | ||
340 | + } | ||
341 | + }, | ||
342 | + methods: { | ||
343 | + initDictConfig() {}, | ||
344 | + getSuperFieldList() { | ||
345 | + let fieldList = [] | ||
346 | + fieldList.push({ type: 'string', value: 'companyCode', text: '货主', dictCode: '' }) | ||
347 | + fieldList.push({ type: 'string', value: 'zoneCode', text: '库区', dictCode: '' }) | ||
348 | + fieldList.push({ type: 'string', value: 'containerCode', text: '容器编码', dictCode: '' }) | ||
349 | + fieldList.push({ type: 'string', value: 'locationCode', text: '库位编码', dictCode: '' }) | ||
350 | + fieldList.push({ type: 'string', value: 'materialCode', text: '物料编码', dictCode: '' }) | ||
351 | + fieldList.push({ type: 'string', value: 'materialName', text: '物料名称', dictCode: '' }) | ||
352 | + fieldList.push({ type: 'string', value: 'materialSpec', text: '物料规格', dictCode: '' }) | ||
353 | + fieldList.push({ type: 'string', value: 'materialUnit', text: '物料单位', dictCode: '' }) | ||
354 | + fieldList.push({ type: 'BigDecimal', value: 'qty', text: '数量', dictCode: '' }) | ||
355 | + fieldList.push({ type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: '' }) | ||
356 | + fieldList.push({ type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status' }) | ||
357 | + fieldList.push({ type: 'string', value: 'batch', text: '批次', dictCode: '' }) | ||
358 | + // fieldList.push({type:'string',value:'uniqueCode',text:'唯一号',dictCode:''}) | ||
359 | + fieldList.push({ type: 'datetime', value: 'receiptDate', text: '入库日期' }) | ||
360 | + fieldList.push({ type: 'int', value: 'inventoryAge', text: '库龄(天)', dictCode: '' }) | ||
361 | + fieldList.push({ type: 'string', value: 'createBy', text: '创建人', dictCode: '' }) | ||
362 | + fieldList.push({ type: 'datetime', value: 'createTime', text: '创建日期' }) | ||
363 | + fieldList.push({ type: 'string', value: 'updateBy', text: '更新人', dictCode: '' }) | ||
364 | + fieldList.push({ type: 'datetime', value: 'updateTime', text: '更新日期' }) | ||
365 | + this.superFieldList = fieldList | ||
339 | } | 366 | } |
340 | } | 367 | } |
368 | +} | ||
341 | </script> | 369 | </script> |
342 | <style scoped> | 370 | <style scoped> |
343 | - @import '~@assets/less/common.less'; | 371 | +@import '~@assets/less/common.less'; |
344 | </style> | 372 | </style> |
345 | \ No newline at end of file | 373 | \ No newline at end of file |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
@@ -45,5 +45,5 @@ public interface IContainerService extends IService<Container> { | @@ -45,5 +45,5 @@ public interface IContainerService extends IService<Container> { | ||
45 | */ | 45 | */ |
46 | boolean havaLocationCodeByContainer(String locationCode, String containerCode, String warehouseCode); | 46 | boolean havaLocationCodeByContainer(String locationCode, String containerCode, String warehouseCode); |
47 | 47 | ||
48 | - List<Container> getContainerListByCodeList(List<String> containCodeList, String warehouseCode); | 48 | + List<Container> getContainerListByCodeList(List<String> containerCodeList, String warehouseCode); |
49 | } | 49 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
@@ -159,9 +159,9 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container | @@ -159,9 +159,9 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container | ||
159 | } | 159 | } |
160 | 160 | ||
161 | @Override | 161 | @Override |
162 | - public List<Container> getContainerListByCodeList(List<String> containCodeList, String warehouseCode) { | 162 | + public List<Container> getContainerListByCodeList(List<String> containerCodeList, String warehouseCode) { |
163 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | 163 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
164 | - containerLambdaQueryWrapper.in(Container::getCode, containCodeList).eq(Container::getWarehouseCode, warehouseCode); | 164 | + containerLambdaQueryWrapper.in(Container::getCode, containerCodeList).eq(Container::getWarehouseCode, warehouseCode); |
165 | List<Container> containerList = list(containerLambdaQueryWrapper); | 165 | List<Container> containerList = list(containerLambdaQueryWrapper); |
166 | return containerList; | 166 | return containerList; |
167 | } | 167 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryDetail/controller/InventoryDetailController.java
@@ -11,6 +11,7 @@ import org.jeecg.common.system.base.controller.JeecgController; | @@ -11,6 +11,7 @@ import org.jeecg.common.system.base.controller.JeecgController; | ||
11 | import org.jeecg.common.system.query.QueryGenerator; | 11 | import org.jeecg.common.system.query.QueryGenerator; |
12 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 12 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
13 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 13 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
14 | +import org.jeecg.utils.HuahengJwtUtil; | ||
14 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
15 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
16 | import org.springframework.web.servlet.ModelAndView; | 17 | import org.springframework.web.servlet.ModelAndView; |
@@ -50,10 +51,10 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | @@ -50,10 +51,10 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | ||
50 | @GetMapping(value = "/list") | 51 | @GetMapping(value = "/list") |
51 | public Result<IPage<InventoryDetail>> queryPageList(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 52 | public Result<IPage<InventoryDetail>> queryPageList(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
52 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 53 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
54 | + HuahengJwtUtil.setWarehouseCode(req, inventoryDetail); | ||
53 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | 55 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); |
54 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | 56 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
55 | - IPage<InventoryDetail> pageList = inventoryDetailService.page(page, queryWrapper); | ||
56 | - return Result.OK(pageList); | 57 | + return Result.OK(inventoryDetailService.queryInventoryDetailPage(page, queryWrapper)); |
57 | } | 58 | } |
58 | 59 | ||
59 | /** | 60 | /** |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
@@ -22,7 +22,6 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; | @@ -22,7 +22,6 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; | ||
22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
23 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; | 23 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
24 | import org.jeecg.utils.HuahengJwtUtil; | 24 | import org.jeecg.utils.HuahengJwtUtil; |
25 | -import org.jeecg.utils.StringUtils; | ||
26 | import org.jeecg.utils.constant.QuantityConstant; | 25 | import org.jeecg.utils.constant.QuantityConstant; |
27 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 26 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
28 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | 27 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
@@ -30,7 +29,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams; | @@ -30,7 +29,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams; | ||
30 | import org.jeecgframework.poi.excel.entity.ImportParams; | 29 | import org.jeecgframework.poi.excel.entity.ImportParams; |
31 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | 30 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
32 | import org.springframework.beans.factory.annotation.Autowired; | 31 | import org.springframework.beans.factory.annotation.Autowired; |
33 | -import org.springframework.web.bind.annotation.*; | 32 | +import org.springframework.web.bind.annotation.DeleteMapping; |
33 | +import org.springframework.web.bind.annotation.GetMapping; | ||
34 | +import org.springframework.web.bind.annotation.PathVariable; | ||
35 | +import org.springframework.web.bind.annotation.PostMapping; | ||
36 | +import org.springframework.web.bind.annotation.RequestBody; | ||
37 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
38 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
39 | +import org.springframework.web.bind.annotation.RequestParam; | ||
40 | +import org.springframework.web.bind.annotation.RestController; | ||
34 | import org.springframework.web.multipart.MultipartFile; | 41 | import org.springframework.web.multipart.MultipartFile; |
35 | import org.springframework.web.multipart.MultipartHttpServletRequest; | 42 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
36 | import org.springframework.web.servlet.ModelAndView; | 43 | import org.springframework.web.servlet.ModelAndView; |
@@ -167,11 +174,11 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | @@ -167,11 +174,11 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | ||
167 | @GetMapping(value = "/listInventoryDetailByMainId") | 174 | @GetMapping(value = "/listInventoryDetailByMainId") |
168 | public Result<IPage<InventoryDetail>> listInventoryDetailByMainId(InventoryDetail inventoryDetail, | 175 | public Result<IPage<InventoryDetail>> listInventoryDetailByMainId(InventoryDetail inventoryDetail, |
169 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 176 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
170 | - HttpServletRequest req) { | ||
171 | - QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | 177 | + HttpServletRequest request) { |
178 | + HuahengJwtUtil.setWarehouseCode(request, inventoryDetail); | ||
179 | + QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, request.getParameterMap()); | ||
172 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | 180 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
173 | - IPage<InventoryDetail> pageList = inventoryDetailService.page(page, queryWrapper); | ||
174 | - return Result.OK(pageList); | 181 | + return Result.OK(inventoryDetailService.queryInventoryDetailPage(page, queryWrapper)); |
175 | } | 182 | } |
176 | 183 | ||
177 | /** | 184 | /** |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java
@@ -7,6 +7,7 @@ import org.jeecg.common.aspect.annotation.Dict; | @@ -7,6 +7,7 @@ import org.jeecg.common.aspect.annotation.Dict; | ||
7 | import org.jeecgframework.poi.excel.annotation.Excel; | 7 | import org.jeecgframework.poi.excel.annotation.Excel; |
8 | 8 | ||
9 | import com.baomidou.mybatisplus.annotation.IdType; | 9 | import com.baomidou.mybatisplus.annotation.IdType; |
10 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
10 | import com.baomidou.mybatisplus.annotation.TableId; | 11 | import com.baomidou.mybatisplus.annotation.TableId; |
11 | import com.baomidou.mybatisplus.annotation.TableName; | 12 | import com.baomidou.mybatisplus.annotation.TableName; |
12 | 13 | ||
@@ -82,6 +83,10 @@ public class InventoryDetail implements Serializable { | @@ -82,6 +83,10 @@ public class InventoryDetail implements Serializable { | ||
82 | @Excel(name = "任务锁定数量", width = 15) | 83 | @Excel(name = "任务锁定数量", width = 15) |
83 | @ApiModelProperty(value = "任务锁定数量") | 84 | @ApiModelProperty(value = "任务锁定数量") |
84 | private java.math.BigDecimal taskQty; | 85 | private java.math.BigDecimal taskQty; |
86 | + /** 托盘填充度 */ | ||
87 | + @ApiModelProperty(value = "托盘填充度") | ||
88 | + @TableField(exist = false) | ||
89 | + private java.math.BigDecimal fillDensity; | ||
85 | /** 库存状态 */ | 90 | /** 库存状态 */ |
86 | @Excel(name = "库存状态", width = 15) | 91 | @Excel(name = "库存状态", width = 15) |
87 | @Dict(dicCode = "inventory_status") | 92 | @Dict(dicCode = "inventory_status") |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
@@ -3,8 +3,13 @@ package org.jeecg.modules.wms.inventory.inventoryHeader.service; | @@ -3,8 +3,13 @@ package org.jeecg.modules.wms.inventory.inventoryHeader.service; | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | import java.util.List; | 4 | import java.util.List; |
5 | 5 | ||
6 | +import javax.servlet.http.HttpServletRequest; | ||
7 | + | ||
6 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 8 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
7 | 9 | ||
10 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
11 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
12 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
8 | import com.baomidou.mybatisplus.extension.service.IService; | 13 | import com.baomidou.mybatisplus.extension.service.IService; |
9 | 14 | ||
10 | /** | 15 | /** |
@@ -26,4 +31,14 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | @@ -26,4 +31,14 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | ||
26 | 31 | ||
27 | // 求一种物料的可出库存之和 | 32 | // 求一种物料的可出库存之和 |
28 | BigDecimal getAvailSumQty(InventoryDetail inventoryDetail); | 33 | BigDecimal getAvailSumQty(InventoryDetail inventoryDetail); |
34 | + | ||
35 | + /** | ||
36 | + * 分页查询库存明细,组装容器填充度 | ||
37 | + * @author TanYibin | ||
38 | + * @createDate 2023年4月7日 | ||
39 | + * @param page | ||
40 | + * @param queryWrapper | ||
41 | + * @return | ||
42 | + */ | ||
43 | + IPage<InventoryDetail> queryInventoryDetailPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper); | ||
29 | } | 44 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
1 | package org.jeecg.modules.wms.inventory.inventoryHeader.service.impl; | 1 | package org.jeecg.modules.wms.inventory.inventoryHeader.service.impl; |
2 | 2 | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | +import java.math.RoundingMode; | ||
4 | import java.util.List; | 5 | import java.util.List; |
6 | +import java.util.Map; | ||
7 | +import java.util.Set; | ||
8 | +import java.util.function.Function; | ||
9 | +import java.util.stream.Collectors; | ||
5 | 10 | ||
11 | +import javax.servlet.http.HttpServletRequest; | ||
12 | + | ||
13 | +import org.jeecg.common.system.query.QueryGenerator; | ||
14 | +import org.jeecg.modules.wms.config.container.entity.Container; | ||
15 | +import org.jeecg.modules.wms.config.container.service.IContainerService; | ||
16 | +import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; | ||
17 | +import org.jeecg.modules.wms.config.containerCapacity.service.IContainerCapacityService; | ||
18 | +import org.jeecg.modules.wms.config.location.entity.Location; | ||
19 | +import org.jeecg.modules.wms.config.material.entity.Material; | ||
6 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 20 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
7 | import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryDetailMapper; | 21 | import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryDetailMapper; |
8 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
9 | import org.jeecg.utils.StringUtils; | 23 | import org.jeecg.utils.StringUtils; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
26 | +import org.springframework.util.CollectionUtils; | ||
27 | +import org.springframework.web.bind.annotation.RequestParam; | ||
12 | 28 | ||
13 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 29 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
30 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
31 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
14 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 32 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
33 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
15 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 34 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
16 | 35 | ||
17 | /** | 36 | /** |
@@ -26,6 +45,12 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -26,6 +45,12 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
26 | @Autowired | 45 | @Autowired |
27 | private InventoryDetailMapper inventoryDetailMapper; | 46 | private InventoryDetailMapper inventoryDetailMapper; |
28 | 47 | ||
48 | + @Autowired | ||
49 | + private IContainerService containerService; | ||
50 | + | ||
51 | + @Autowired | ||
52 | + private IContainerCapacityService containerCapacityService; | ||
53 | + | ||
29 | @Override | 54 | @Override |
30 | public List<InventoryDetail> selectByMainId(String mainId) { | 55 | public List<InventoryDetail> selectByMainId(String mainId) { |
31 | return inventoryDetailMapper.selectByMainId(mainId); | 56 | return inventoryDetailMapper.selectByMainId(mainId); |
@@ -82,4 +107,47 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -82,4 +107,47 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
82 | BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); | 107 | BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); |
83 | return totalQty; | 108 | return totalQty; |
84 | } | 109 | } |
110 | + | ||
111 | + @Override | ||
112 | + public IPage<InventoryDetail> queryInventoryDetailPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper) { | ||
113 | + IPage<InventoryDetail> pageResult = this.page(page, queryWrapper); | ||
114 | + List<InventoryDetail> inventoryDetailList = pageResult.getRecords(); | ||
115 | + if (!CollectionUtils.isEmpty(inventoryDetailList)) { | ||
116 | + this.calculateFillDensity(inventoryDetailList); | ||
117 | + } | ||
118 | + return pageResult; | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * 计算库存明细托盘填充度 | ||
123 | + * @author TanYibin | ||
124 | + * @createDate 2023年4月7日 | ||
125 | + * @param inventoryDetailList | ||
126 | + */ | ||
127 | + private void calculateFillDensity(List<InventoryDetail> inventoryDetailList) { | ||
128 | + // 根据仓库编码分组库存明细 | ||
129 | + Map<String, List<InventoryDetail>> warehouseInventoryDetailMap = | ||
130 | + inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getWarehouseCode)); | ||
131 | + for (String warehouseCode : warehouseInventoryDetailMap.keySet()) { | ||
132 | + List<InventoryDetail> warehouseInventoryDetailList = warehouseInventoryDetailMap.get(warehouseCode); | ||
133 | + List<String> containerCodeList = warehouseInventoryDetailList.stream().filter(t -> StringUtils.isNotEmpty(t.getContainerCode())) | ||
134 | + .map(t -> t.getContainerCode()).collect(Collectors.toList()); | ||
135 | + // 获取 容器信息 | ||
136 | + List<Container> containerList = containerService.getContainerListByCodeList(containerCodeList, warehouseCode); | ||
137 | + Map<String, Container> containerMap = containerList.stream().collect(Collectors.toMap(Container::getCode, Function.identity(), (key1, key2) -> key2)); | ||
138 | + for (InventoryDetail inventoryDetail : warehouseInventoryDetailList) { | ||
139 | + Container container = containerMap.get(inventoryDetail.getContainerCode()); | ||
140 | + LambdaQueryWrapper<ContainerCapacity> containerCapacityWrapper = Wrappers.lambdaQuery(); | ||
141 | + containerCapacityWrapper.eq(ContainerCapacity::getWarehouseCode, warehouseCode) | ||
142 | + .eq(StringUtils.isNotEmpty(container.getContainerTypeCode()), ContainerCapacity::getContainerTypeCode, container.getContainerTypeCode()) | ||
143 | + .eq(StringUtils.isNotEmpty(inventoryDetail.getMaterialCode()), ContainerCapacity::getMaterialCode, inventoryDetail.getMaterialCode()); | ||
144 | + ContainerCapacity containerCapacity = containerCapacityService.getOne(containerCapacityWrapper); | ||
145 | + if (containerCapacity != null && containerCapacity.getQty() != null && containerCapacity.getQty().compareTo(BigDecimal.ZERO) > 0) { | ||
146 | + // 进行填充度计算 保留2位小数 | ||
147 | + BigDecimal fillDensity = inventoryDetail.getQty().divide(containerCapacity.getQty(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); | ||
148 | + inventoryDetail.setFillDensity(fillDensity); | ||
149 | + } | ||
150 | + } | ||
151 | + } | ||
152 | + } | ||
85 | } | 153 | } |