Commit ad1cb22b104470af4a2df508333e61bedf6800aa

Authored by 谭毅彬
1 parent 5436b708

库存填充度功能提交

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
... ... @@ -3,7 +3,9 @@
3 3 <!-- 操作按钮区域 -->
4 4 <div class="table-operator" v-if="mainId">
5 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 9 <a-upload
8 10 v-has="'inventoryDetail:import'"
9 11 name="file"
... ... @@ -11,18 +13,20 @@
11 13 :multiple="false"
12 14 :headers="tokenHeader"
13 15 :action="importExcelUrl"
14   - @change="handleImportExcel">
  16 + @change="handleImportExcel"
  17 + >
15 18 <a-button type="primary" icon="import">导入</a-button>
16 19 </a-upload>
17 20 <a-dropdown v-if="selectedRowKeys.length > 0">
18 21 <a-menu slot="overlay" v-has="'inventoryDetail:deleteBatch'">
19 22 <a-menu-item key="1" @click="batchDel">
20   - <a-icon type="delete"/>
  23 + <a-icon type="delete" />
21 24 删除
22 25 </a-menu-item>
23 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 30 </a-button>
27 31 </a-dropdown>
28 32 </div>
... ... @@ -30,8 +34,8 @@
30 34 <!-- table区域-begin -->
31 35 <div>
32 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 39 <a style="margin-left: 24px" @click="onClearSelected">清空</a>
36 40 </div>
37 41  
... ... @@ -40,16 +44,16 @@
40 44 size="middle"
41 45 bordered
42 46 rowKey="id"
43   - :scroll="{x:true}"
  47 + :scroll="{ x: true }"
44 48 :columns="columns"
45 49 :dataSource="dataSource"
46 50 :pagination="ipagination"
47 51 :loading="loading"
48   - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
49   - @change="handleTableChange">
50   -
  52 + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  53 + @change="handleTableChange"
  54 + >
51 55 <span slot="companyCode" slot-scope="companyCode">
52   - <a-tag :key="companyCode" color=blue>
  56 + <a-tag :key="companyCode" color="blue">
53 57 {{ solutionCompany(companyCode) }}
54 58 </a-tag>
55 59 </span>
... ... @@ -59,31 +63,27 @@
59 63 </template>
60 64 <template slot="imgSlot" slot-scope="text">
61 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 73 </template>
65 74 <template slot="fileSlot" slot-scope="text">
66 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 78 </a-button>
76 79 </template>
77 80  
78 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 83 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
83 84 <a v-has="'inventoryDetail:delete'">删除</a>
84 85 </a-popconfirm>
85 86 </span>
86   -
87 87 </a-table>
88 88 </div>
89 89  
... ... @@ -92,15 +92,14 @@
92 92 </template>
93 93  
94 94 <script>
95   -
96   -import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  95 +import { JeecgListMixin } from '@/mixins/JeecgListMixin'
97 96 import InventoryDetailModal from './modules/InventoryDetailModal'
98   -import {getCompanyList} from '@/api/api'
  97 +import { getCompanyList } from '@/api/api'
99 98  
100 99 export default {
101   - name: "InventoryDetailList",
  100 + name: 'InventoryDetailList',
102 101 mixins: [JeecgListMixin],
103   - components: {InventoryDetailModal},
  102 + components: { InventoryDetailModal },
104 103 props: {
105 104 mainId: {
106 105 type: String,
... ... @@ -116,7 +115,7 @@ export default {
116 115 this.clearList()
117 116 } else {
118 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 129 columns: [
131 130 {
132 131 title: '库存详情ID',
133   - align: "center",
  132 + align: 'center',
134 133 dataIndex: 'id'
135 134 },
136 135 {
137 136 title: '货主',
138   - align: "center",
  137 + align: 'center',
139 138 dataIndex: 'companyCode',
140 139 key: 'companyCode',
141   - scopedSlots: {customRender: 'companyCode'}
  140 + scopedSlots: { customRender: 'companyCode' }
142 141 },
143 142 // {
144 143 // title: '库区',
... ... @@ -147,52 +146,60 @@ export default {
147 146 // },
148 147 {
149 148 title: '容器编码',
150   - align: "center",
  149 + align: 'center',
151 150 dataIndex: 'containerCode'
152 151 },
153 152 {
154 153 title: '库位编码',
155   - align: "center",
  154 + align: 'center',
156 155 dataIndex: 'locationCode'
157 156 },
158 157 {
159 158 title: '物料编码',
160   - align: "center",
  159 + align: 'center',
161 160 dataIndex: 'materialCode'
162 161 },
163 162 {
164 163 title: '物料名称',
165   - align: "center",
  164 + align: 'center',
166 165 dataIndex: 'materialName'
167 166 },
168 167 {
169 168 title: '物料规格',
170   - align: "center",
  169 + align: 'center',
171 170 dataIndex: 'materialSpec'
172 171 },
173 172 {
174 173 title: '物料单位',
175   - align: "center",
  174 + align: 'center',
176 175 dataIndex: 'materialUnit'
177 176 },
178 177 {
179 178 title: '数量',
180   - align: "center",
  179 + align: 'center',
181 180 dataIndex: 'qty'
182 181 },
183 182 {
184 183 title: '任务锁定数量',
185   - align: "center",
  184 + align: 'center',
186 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 196 title: '库存状态',
190   - align: "center",
191   - dataIndex: 'inventoryStatus_dictText',
  197 + align: 'center',
  198 + dataIndex: 'inventoryStatus_dictText'
192 199 },
193 200 {
194 201 title: '批次',
195   - align: "center",
  202 + align: 'center',
196 203 dataIndex: 'batch'
197 204 },
198 205 // {
... ... @@ -202,75 +209,75 @@ export default {
202 209 // },
203 210 {
204 211 title: '入库日期',
205   - align: "center",
  212 + align: 'center',
206 213 dataIndex: 'receiptDate'
207 214 },
208 215 {
209 216 title: '库龄(天)',
210   - align: "center",
  217 + align: 'center',
211 218 dataIndex: 'inventoryAge'
212 219 },
213 220 {
214 221 title: '创建人',
215   - align: "center",
  222 + align: 'center',
216 223 dataIndex: 'createBy'
217 224 },
218 225 {
219 226 title: '创建日期',
220   - align: "center",
  227 + align: 'center',
221 228 dataIndex: 'createTime'
222 229 },
223 230 {
224 231 title: '更新人',
225   - align: "center",
  232 + align: 'center',
226 233 dataIndex: 'updateBy'
227 234 },
228 235 {
229 236 title: '更新日期',
230   - align: "center",
  237 + align: 'center',
231 238 dataIndex: 'updateTime'
232 239 },
233 240 {
234 241 title: '操作',
235 242 dataIndex: 'action',
236   - align: "center",
237   - fixed: "right",
  243 + align: 'center',
  244 + fixed: 'right',
238 245 width: 147,
239   - scopedSlots: {customRender: 'action'},
  246 + scopedSlots: { customRender: 'action' }
240 247 }
241 248 ],
242 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 256 dictOptions: {
250   - containerStatus: [],
  257 + containerStatus: []
251 258 }
252 259 }
253 260 },
254 261 created() {
255   - this.loadFrom();
  262 + this.loadFrom()
256 263 },
257 264 computed: {
258 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 269 methods: {
263 270 loadFrom() {
264   - getCompanyList().then((res) => {
  271 + getCompanyList().then(res => {
265 272 if (res.success) {
266 273 this.companyList = res.result
267 274 }
268   - });
  275 + })
269 276 },
270 277 solutionCompany(value) {
271 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 281 actions.push(this.companyList[key].name)
275 282 return true
276 283 }
... ... @@ -282,10 +289,9 @@ export default {
282 289 this.selectedRowKeys = []
283 290 this.ipagination.current = 1
284 291 }
285   -
286 292 }
287 293 }
288 294 </script>
289 295 <style scoped>
290   -@import '~@assets/less/common.less'
  296 +@import '~@assets/less/common.less';
291 297 </style>
... ...
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... ... @@ -47,7 +47,11 @@
47 47 </a-col>
48 48 <a-col :xl="6" :lg="7" :md="8" :sm="24">
49 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 55 </a-form-item>
52 56 </a-col>
53 57 <a-col :xl="6" :lg="7" :md="8" :sm="24">
... ... @@ -62,7 +66,12 @@
62 66 </a-col> -->
63 67 <a-col :xl="6" :lg="7" :md="8" :sm="24">
64 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 75 </a-form-item>
67 76 </a-col>
68 77 <a-col :xl="6" :lg="7" :md="8" :sm="24">
... ... @@ -77,7 +86,7 @@
77 86 <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
78 87 <a @click="handleToggleSearch" style="margin-left: 8px">
79 88 {{ toggleSearchStatus ? '收起' : '展开' }}
80   - <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  89 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
81 90 </a>
82 91 </span>
83 92 </a-col>
... ... @@ -89,67 +98,81 @@
89 98 <!-- 操作按钮区域 -->
90 99 <div class="table-operator">
91 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 113 <a-button type="primary" icon="import">导入</a-button>
95 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 128 </div>
105 129  
106 130 <!-- table区域-begin -->
107 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 137 <a-table
114 138 ref="table"
115 139 size="middle"
116   - :scroll="{x:true}"
  140 + :scroll="{ x: true }"
117 141 bordered
118 142 rowKey="id"
119 143 :columns="columns"
120 144 :dataSource="dataSource"
121 145 :pagination="ipagination"
122 146 :loading="loading"
123   - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  147 + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
124 148 class="j-table-force-nowrap"
125   - @change="handleTableChange">
126   -
  149 + @change="handleTableChange"
  150 + >
127 151 <template slot="htmlSlot" slot-scope="text">
128 152 <div v-html="text"></div>
129 153 </template>
130 154 <template slot="imgSlot" slot-scope="text">
131 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 163 </template>
134 164 <template slot="fileSlot" slot-scope="text">
135 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 168 </a-button>
145 169 </template>
146 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 172 <a-popconfirm v-has="'inventoryDetail:delete'" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
149 173 <a>删除</a>
150 174 </a-popconfirm>
151 175 </span>
152   -
153 176 </a-table>
154 177 </div>
155 178  
... ... @@ -158,187 +181,192 @@
158 181 </template>
159 182  
160 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 369 </script>
342 370 <style scoped>
343   - @import '~@assets/less/common.less';
  371 +@import '~@assets/less/common.less';
344 372 </style>
345 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&lt;Container&gt; {
45 45 */
46 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&lt;ContainerMapper, Container
159 159 }
160 160  
161 161 @Override
162   - public List<Container> getContainerListByCodeList(List<String> containCodeList, String warehouseCode) {
  162 + public List<Container> getContainerListByCodeList(List<String> containerCodeList, String warehouseCode) {
163 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 165 List<Container> containerList = list(containerLambdaQueryWrapper);
166 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 11 import org.jeecg.common.system.query.QueryGenerator;
12 12 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
13 13 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
  14 +import org.jeecg.utils.HuahengJwtUtil;
14 15 import org.springframework.beans.factory.annotation.Autowired;
15 16 import org.springframework.web.bind.annotation.*;
16 17 import org.springframework.web.servlet.ModelAndView;
... ... @@ -50,10 +51,10 @@ public class InventoryDetailController extends JeecgController&lt;InventoryDetail,
50 51 @GetMapping(value = "/list")
51 52 public Result<IPage<InventoryDetail>> queryPageList(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
52 53 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  54 + HuahengJwtUtil.setWarehouseCode(req, inventoryDetail);
53 55 QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap());
54 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 22 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
23 23 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
24 24 import org.jeecg.utils.HuahengJwtUtil;
25   -import org.jeecg.utils.StringUtils;
26 25 import org.jeecg.utils.constant.QuantityConstant;
27 26 import org.jeecgframework.poi.excel.ExcelImportUtil;
28 27 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
... ... @@ -30,7 +29,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
30 29 import org.jeecgframework.poi.excel.entity.ImportParams;
31 30 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
32 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 41 import org.springframework.web.multipart.MultipartFile;
35 42 import org.springframework.web.multipart.MultipartHttpServletRequest;
36 43 import org.springframework.web.servlet.ModelAndView;
... ... @@ -167,11 +174,11 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
167 174 @GetMapping(value = "/listInventoryDetailByMainId")
168 175 public Result<IPage<InventoryDetail>> listInventoryDetailByMainId(InventoryDetail inventoryDetail,
169 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 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 7 import org.jeecgframework.poi.excel.annotation.Excel;
8 8  
9 9 import com.baomidou.mybatisplus.annotation.IdType;
  10 +import com.baomidou.mybatisplus.annotation.TableField;
10 11 import com.baomidou.mybatisplus.annotation.TableId;
11 12 import com.baomidou.mybatisplus.annotation.TableName;
12 13  
... ... @@ -82,6 +83,10 @@ public class InventoryDetail implements Serializable {
82 83 @Excel(name = "任务锁定数量", width = 15)
83 84 @ApiModelProperty(value = "任务锁定数量")
84 85 private java.math.BigDecimal taskQty;
  86 + /** 托盘填充度 */
  87 + @ApiModelProperty(value = "托盘填充度")
  88 + @TableField(exist = false)
  89 + private java.math.BigDecimal fillDensity;
85 90 /** 库存状态 */
86 91 @Excel(name = "库存状态", width = 15)
87 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 3 import java.math.BigDecimal;
4 4 import java.util.List;
5 5  
  6 +import javax.servlet.http.HttpServletRequest;
  7 +
6 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 13 import com.baomidou.mybatisplus.extension.service.IService;
9 14  
10 15 /**
... ... @@ -26,4 +31,14 @@ public interface IInventoryDetailService extends IService&lt;InventoryDetail&gt; {
26 31  
27 32 // 求一种物料的可出库存之和
28 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 1 package org.jeecg.modules.wms.inventory.inventoryHeader.service.impl;
2 2  
3 3 import java.math.BigDecimal;
  4 +import java.math.RoundingMode;
4 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 20 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
7 21 import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryDetailMapper;
8 22 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
9 23 import org.jeecg.utils.StringUtils;
10 24 import org.springframework.beans.factory.annotation.Autowired;
11 25 import org.springframework.stereotype.Service;
  26 +import org.springframework.util.CollectionUtils;
  27 +import org.springframework.web.bind.annotation.RequestParam;
12 28  
13 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 32 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  33 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
15 34 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 35  
17 36 /**
... ... @@ -26,6 +45,12 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
26 45 @Autowired
27 46 private InventoryDetailMapper inventoryDetailMapper;
28 47  
  48 + @Autowired
  49 + private IContainerService containerService;
  50 +
  51 + @Autowired
  52 + private IContainerCapacityService containerCapacityService;
  53 +
29 54 @Override
30 55 public List<InventoryDetail> selectByMainId(String mainId) {
31 56 return inventoryDetailMapper.selectByMainId(mainId);
... ... @@ -82,4 +107,47 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
82 107 BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add);
83 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 }
... ...