Commit a1a71eb0001dde697cbbb03f75e0742d139e9407
1 parent
7dc4b9e7
库位监控优化
Showing
2 changed files
with
579 additions
and
477 deletions
ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
... | ... | @@ -11,8 +11,10 @@ |
11 | 11 | placeholder="请选择库位类型" |
12 | 12 | option-filter-prop="children" |
13 | 13 | v-model="zoneCode" |
14 | + @change="refresh" | |
14 | 15 | style="width: 200px"> |
15 | - <a-select-option selected="0" id="zoneCode" v-for="item in locationTypeList" :key="item.name" :value="item.code">{{item.name}} | |
16 | + <a-select-option selected="0" id="zoneCode" v-for="item in locationTypeList" :key="item.name" | |
17 | + :value="item.code">{{ item.name }} | |
16 | 18 | </a-select-option> |
17 | 19 | </a-select> |
18 | 20 | </li> |
... | ... | @@ -21,14 +23,14 @@ |
21 | 23 | </select> |
22 | 24 | </li> |
23 | 25 | <li> |
24 | - <select id="editable-select" name="col" style="width: 70px"> | |
26 | + <select id="editable-select" name="col" @click="show" style="width: 70px"> | |
25 | 27 | <option value="row" selected>行</option> |
26 | 28 | <option value="line">列</option> |
27 | 29 | <option value="layer">层</option> |
28 | 30 | </select> |
29 | 31 | </li> |
30 | 32 | <li> |
31 | - <a-button type="primary" @click="Search()" icon="search">查询</a-button> | |
33 | + <a-button type="primary" @click="Search()" icon="search">查询</a-button> | |
32 | 34 | </li> |
33 | 35 | </ul> |
34 | 36 | </div> |
... | ... | @@ -75,9 +77,10 @@ |
75 | 77 | 整盘禁用:<img src="~@/assets/icon/整盘禁用.png"> |
76 | 78 | </li> |
77 | 79 | <li><span style="font-size: 12px">库位统计情况:</span> |
78 | - <input style="width: 400px; font-size: 12px" type="text" id="zone" disabled/> | |
80 | + <input style="width: 400px; font-size: 12px" type="text" id="zone" disabled/> | |
79 | 81 | </li> |
80 | - </ul><br><br> | |
82 | + </ul> | |
83 | + <br><br> | |
81 | 84 | <ul id="info_list"> |
82 | 85 | <li><span>库位:</span><input type="text" id="code" disabled/></li> |
83 | 86 | <li><span>容器编码:</span><input type="text" id="containerCode" disabled/></li> |
... | ... | @@ -93,7 +96,7 @@ |
93 | 96 | </div> |
94 | 97 | </div> |
95 | 98 | <a-spin tip="库位视图生成中..." :spinning="spinning"> |
96 | - <a-skeleton active :loading="loading" :paragraph="{ rows: 5 }"/> | |
99 | + <a-skeleton active :loading="loading" :paragraph="{ rows: 5 }"/> | |
97 | 100 | </a-spin> |
98 | 101 | </div> |
99 | 102 | |
... | ... | @@ -102,522 +105,621 @@ |
102 | 105 | </div> |
103 | 106 | </template> |
104 | 107 | |
105 | - <script> | |
106 | - var prefix = "/location/locationMonitor"; | |
107 | - var grid_row; | |
108 | - var grid_row_first; | |
109 | - var grid_line; | |
110 | - var grid_layer; | |
111 | - var list_info; | |
112 | - var grid_num_1=0; | |
113 | - var grid_num_2=0; | |
114 | - var grid_num_3=0; | |
115 | - var grid_num_4=0; | |
116 | - var grid_num_5=0; | |
117 | - var grid_num_6=0; | |
118 | - var grid_num_7=0; | |
119 | - var grid_num_8=0; | |
120 | - var grid_num_9=0; | |
121 | - var grid_num_10=0; | |
122 | - var grid_num_11=0; | |
123 | - var grid_num_12=0; | |
124 | - var currentContainerCode; | |
125 | - var currentLocationCode=0; | |
126 | - var currentMaterialCode=0; | |
127 | - | |
128 | - import huahengUI from '../../../assets/css/huahengUI.css' | |
129 | - import $ from '../../../assets/js/jquery-1.11.1.min' | |
130 | - import grid_rest from '@/assets/icon/空柜空闲.png' | |
131 | - import grid_empty from '@/assets/icon/空盘空闲.png' | |
132 | - import grid_half from '@/assets/icon/半盘空闲.png' | |
133 | - import grid_all from '@/assets/icon/整盘空闲.png' | |
134 | - import grid_emp_waing from '@/assets/icon/空柜禁用.png' | |
135 | - import grid_empty_waring from '@/assets/icon/空盘禁用.png' | |
136 | - import grid_half_waring from '@/assets/icon/半盘禁用.png' | |
137 | - import grid_all_waring from '@/assets/icon/整盘禁用.png' | |
138 | - import grid_emp_lock from '@/assets/icon/空柜锁定.png' | |
139 | - import grid_empty_lock from '@/assets/icon/空盘锁定.png' | |
140 | - import grid_half_lock from '@/assets/icon/半盘锁定.png' | |
141 | - import grid_all_lock from '@/assets/icon/整盘锁定.png' | |
142 | - import rel_empty from '@/assets/icon/空.png' | |
143 | - import Vue from 'vue' | |
144 | - import {ACCESS_TOKEN} from "@/store/mutation-types" | |
145 | - import {getLocationTypeList} from '@/api/api' | |
146 | - | |
147 | - export default { | |
148 | - name: "locationStatus", | |
149 | - zoneCode:"", | |
150 | - data() { | |
151 | - return { | |
152 | - spinning:true, | |
153 | - loading:true, | |
154 | - showPrise:false, | |
155 | - // loading:true, | |
156 | - zoneCode:'', | |
157 | - locationTypeList: [], | |
158 | - model:{}, | |
159 | - locationContent:'' | |
160 | - } | |
161 | - }, | |
108 | +<script> | |
109 | +var prefix = "/location/locationMonitor"; | |
110 | +var grid_row; | |
111 | +var grid_row_first; | |
112 | +var grid_line; | |
113 | +var grid_layer; | |
114 | +var list_info; | |
115 | +var grid_num_1 = 0; | |
116 | +var grid_num_2 = 0; | |
117 | +var grid_num_3 = 0; | |
118 | +var grid_num_4 = 0; | |
119 | +var grid_num_5 = 0; | |
120 | +var grid_num_6 = 0; | |
121 | +var grid_num_7 = 0; | |
122 | +var grid_num_8 = 0; | |
123 | +var grid_num_9 = 0; | |
124 | +var grid_num_10 = 0; | |
125 | +var grid_num_11 = 0; | |
126 | +var grid_num_12 = 0; | |
127 | +var currentContainerCode; | |
128 | +var currentLocationCode = 0; | |
129 | +var currentMaterialCode = 0; | |
162 | 130 | |
163 | - // setup() { | |
164 | - // const spinning = ref<boolean>(false); | |
131 | +import huahengUI from '../../../assets/css/huahengUI.css' | |
132 | +import $ from '../../../assets/js/jquery-1.11.1.min' | |
133 | +import grid_rest from '@/assets/icon/空柜空闲.png' | |
134 | +import grid_empty from '@/assets/icon/空盘空闲.png' | |
135 | +import grid_half from '@/assets/icon/半盘空闲.png' | |
136 | +import grid_all from '@/assets/icon/整盘空闲.png' | |
137 | +import grid_emp_waing from '@/assets/icon/空柜禁用.png' | |
138 | +import grid_empty_waring from '@/assets/icon/空盘禁用.png' | |
139 | +import grid_half_waring from '@/assets/icon/半盘禁用.png' | |
140 | +import grid_all_waring from '@/assets/icon/整盘禁用.png' | |
141 | +import grid_emp_lock from '@/assets/icon/空柜锁定.png' | |
142 | +import grid_empty_lock from '@/assets/icon/空盘锁定.png' | |
143 | +import grid_half_lock from '@/assets/icon/半盘锁定.png' | |
144 | +import grid_all_lock from '@/assets/icon/整盘锁定.png' | |
145 | +import rel_empty from '@/assets/icon/空.png' | |
146 | +import Vue from 'vue' | |
147 | +import {ACCESS_TOKEN} from "@/store/mutation-types" | |
148 | +import {getLocationTypeList} from '@/api/api' | |
149 | + | |
150 | +export default { | |
151 | + name: "locationStatus", | |
152 | + zoneCode: "", | |
153 | + data() { | |
154 | + return { | |
155 | + spinning: true, | |
156 | + loading: true, | |
157 | + showPrise: false, | |
158 | + // loading:true, | |
159 | + zoneCode: '', | |
160 | + locationTypeList: [], | |
161 | + model: {}, | |
162 | + locationContent: '' | |
163 | + } | |
164 | + }, | |
165 | + | |
166 | + | |
167 | + created() { | |
168 | + let _this = this | |
169 | + _this.loadFrom() | |
170 | + window.gridMsg = _this.gridMsg | |
171 | + window.Mclose = _this.Mclose | |
172 | + window.lays = _this.lays | |
173 | + }, | |
174 | + | |
175 | + mounted() { | |
176 | + //监听浏览器宽度的改变 | |
177 | + // window.onresize = function(){ | |
178 | + // _this.changeMargin(); | |
179 | + // _this.border() | |
180 | + // }; | |
181 | + // | |
182 | + // this.changeMargin(); | |
165 | 183 | // |
166 | - // const changeSpinning = () => { | |
167 | - // spinning.value = !spinning.value; | |
168 | - // }; | |
169 | - | |
170 | - created() { | |
171 | - let _this=this | |
172 | - _this.loadFrom() | |
173 | - window.gridMsg=_this.gridMsg | |
174 | - window.Mclose=_this.Mclose | |
175 | - window.lays=_this.lays | |
184 | + // this.border() | |
185 | + }, | |
186 | + methods: { | |
187 | + loadFrom() { | |
188 | + getLocationTypeList().then((res) => { | |
189 | + if (res.success) { | |
190 | + this.locationTypeList = res.result; | |
191 | + if (this.locationTypeList.length > 0) { | |
192 | + this.zoneCode = this.locationTypeList[0].code; | |
193 | + let _this = this; | |
194 | + this.resetAjax(this.zoneCode); | |
195 | + } | |
196 | + } | |
197 | + }) | |
176 | 198 | }, |
199 | + refresh: function () { | |
200 | + $.ajax({ | |
201 | + url: window._CONFIG['domianURL'] + prefix + "/getAllLocation", | |
202 | + type: "post", | |
203 | + data: { | |
204 | + type: this.zoneCode | |
205 | + }, | |
206 | + headers: { | |
207 | + "X-Access-Token": Vue.ls.get(ACCESS_TOKEN) | |
208 | + }, | |
209 | + success: function (res) { | |
210 | + grid_row = res.result.maxRow; | |
211 | + grid_row_first = res.result.minRow; | |
212 | + grid_line = res.result.maxLine; | |
213 | + grid_layer = res.result.maxLayer; | |
214 | + } | |
215 | + }); | |
216 | + let num = $("#editable-select").val(); | |
217 | + $("#editable-num").children().remove(); | |
218 | + if (num === "row") { | |
219 | + for (let i = grid_row_first; i <= grid_row; i++) { | |
220 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
221 | + } | |
222 | + } else if (num === "line") { | |
223 | + for (let i = 1; i <= grid_line; i++) { | |
224 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
225 | + } | |
226 | + } else if (num === "layer") { | |
227 | + for (let i = 1; i <= grid_layer; i++) { | |
228 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
229 | + } | |
230 | + } | |
231 | + alert($("#editable-select").val()) | |
177 | 232 | |
178 | - mounted() { | |
179 | - //监听浏览器宽度的改变 | |
180 | - // window.onresize = function(){ | |
181 | - // _this.changeMargin(); | |
182 | - // _this.border() | |
183 | - // }; | |
184 | - // | |
185 | - // this.changeMargin(); | |
186 | - // | |
187 | - // this.border() | |
233 | + let type = $("#zoneCode").val(); | |
234 | + this.resetAjax(this.zoneCode); | |
235 | + // this.show(); | |
188 | 236 | }, |
189 | - methods: { | |
190 | - loadFrom() { | |
191 | - getLocationTypeList().then((res) => { | |
192 | - if (res.success) { | |
193 | - this.locationTypeList = res.result; | |
194 | - if (this.locationTypeList.length > 0) { | |
195 | - this.zoneCode = this.locationTypeList[0].code; | |
196 | - let _this=this; | |
197 | - this.resetAjax(this.zoneCode); | |
198 | - } | |
237 | + show: function () { | |
238 | + //库位类型和行列层选择 | |
239 | + $("#editable-select").change(function () { | |
240 | + let num = $("#editable-select").val(); | |
241 | + $("#editable-num").children().remove(); | |
242 | + if (num === "row") { | |
243 | + for (let i = grid_row_first; i <= grid_row; i++) { | |
244 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
199 | 245 | } |
200 | - }) | |
201 | - }, | |
202 | - initEvent() { | |
203 | - //库位类型和行列层选择 | |
204 | - $("#editable-select").change(function () { | |
205 | - let num=$("#editable-select").val(); | |
206 | - $("#editable-num").children().remove(); | |
207 | - if (num === "row") { | |
208 | - for (let i = grid_row_first; i <= grid_row; i++) { | |
209 | - $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
210 | - } | |
246 | + } else if (num === "line") { | |
247 | + for (let i = 1; i <= grid_line; i++) { | |
248 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
211 | 249 | } |
212 | - else if (num === "line") { | |
213 | - for (let i = 1; i <= grid_line; i++) { | |
214 | - $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
215 | - } | |
216 | - } | |
217 | - else if (num === "layer") { | |
218 | - for (let i = 1; i <= grid_layer; i++) { | |
219 | - $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
220 | - } | |
250 | + } else if (num === "layer") { | |
251 | + for (let i = 1; i <= grid_layer; i++) { | |
252 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
221 | 253 | } |
222 | - }); | |
223 | - | |
224 | - $("#zoneCode").change(function () { | |
225 | - let type=$("#zoneCode").val(); | |
226 | - this.resetAjax(type); | |
227 | - }); | |
228 | - }, | |
229 | - //边框高度 | |
230 | - border() { | |
231 | - let box_height=$("#borderCol").offset().top; | |
232 | - let window_height=$(window).height()-20; | |
233 | - $("#borderCol").css({"height":window_height-box_height}); | |
234 | - }, | |
235 | - | |
236 | - //格子宽度 | |
237 | - changeMargin(){ | |
238 | - let box_width=document.getElementById("location").offsetWidth; | |
239 | - box_width=box_width-80; | |
240 | - let num=$("#editable-select").val(); | |
241 | - let grid_width; | |
242 | - if (num === "layer" || num === "row") { | |
243 | - grid_width=box_width/grid_line; | |
244 | 254 | } |
245 | - else if (num === "line") { | |
246 | - grid_width=box_width/grid_row; | |
247 | - } | |
248 | - if (grid_width >= 50) { | |
249 | - $(".grid").css({"width":"50px","height":"50px"}); | |
250 | - } | |
251 | - else if (grid_width <= 20) { | |
252 | - $(".grid").css({"width":"20px","height":"20px"}); | |
253 | - } | |
254 | - else { | |
255 | - $(".grid").css({"width":grid_width,"height":grid_width}); | |
256 | - }}, | |
257 | - | |
258 | - //tips信息 | |
259 | - lays(x){ | |
260 | - let $j=$(x); | |
261 | - let row=$j.attr("data-i"); | |
262 | - let line=$j.attr("data-j"); | |
263 | - let layers=$j.attr("data-k"); | |
264 | - | |
265 | - row=parseInt(row); | |
266 | - line=parseInt(line); | |
267 | - layers=parseInt(layers); | |
268 | - if (list_info) { | |
269 | - for (let i = 0; i < list_info.length; i++) { | |
270 | - if (list_info[i].row === row && list_info[i].icolumn === line && list_info[i].layer === layers) { | |
271 | - let str_info=''; | |
272 | - let container_code=''; | |
273 | - let list_qty=0; | |
274 | - if (list_info[i].containerCode) { | |
275 | - container_code="\n容器编码:"+ list_info[i].containerCode+""; | |
276 | - if (list_info[i].materialName) { | |
277 | - for (let j = 0; j < list_info[i].materialName.length; j++) { | |
278 | - let list_batch=list_info[i].batch[j]===null?"无":list_info[i].batch[j]===""?"无":list_info[i].batch[j]; | |
279 | - list_qty +=list_info[i].qty[j]; | |
280 | - if(j==list_info[i].materialName.length-1){ | |
281 | - str_info=str_info + "\n批次:"+ list_batch +",物料名称:"+ list_info[i].materialName[j] +",物料编码:"+ list_info[i].materialCode[j] + | |
282 | - ",数量:"+ list_qty +"" | |
283 | - } | |
255 | + }); | |
284 | 256 | |
257 | + $("#zoneCode").change(function () { | |
258 | + let type = $("#zoneCode").val(); | |
259 | + this.resetAjax(this.zoneCode); | |
260 | + }); | |
261 | + }, | |
285 | 262 | |
263 | + | |
264 | + //边框高度 | |
265 | + border() { | |
266 | + let box_height = $("#borderCol").offset().top; | |
267 | + let window_height = $(window).height() - 20; | |
268 | + $("#borderCol").css({"height": window_height - box_height}); | |
269 | + }, | |
270 | + | |
271 | + //格子宽度 | |
272 | + changeMargin() { | |
273 | + let box_width = document.getElementById("location").offsetWidth; | |
274 | + box_width = box_width - 80; | |
275 | + let num = $("#editable-select").val(); | |
276 | + let grid_width; | |
277 | + if (num === "layer" || num === "row") { | |
278 | + grid_width = box_width / grid_line; | |
279 | + } else if (num === "line") { | |
280 | + grid_width = box_width / grid_row; | |
281 | + } | |
282 | + if (grid_width >= 50) { | |
283 | + $(".grid").css({"width": "50px", "height": "50px"}); | |
284 | + } else if (grid_width <= 20) { | |
285 | + $(".grid").css({"width": "20px", "height": "20px"}); | |
286 | + } else { | |
287 | + $(".grid").css({"width": grid_width, "height": grid_width}); | |
288 | + } | |
289 | + }, | |
290 | + | |
291 | + //tips信息 | |
292 | + lays(x) { | |
293 | + let $j = $(x); | |
294 | + let row = $j.attr("data-i"); | |
295 | + let line = $j.attr("data-j"); | |
296 | + let layers = $j.attr("data-k"); | |
297 | + | |
298 | + row = parseInt(row); | |
299 | + line = parseInt(line); | |
300 | + layers = parseInt(layers); | |
301 | + if (list_info) { | |
302 | + for (let i = 0; i < list_info.length; i++) { | |
303 | + if (list_info[i].row === row && list_info[i].icolumn === line && list_info[i].layer === layers) { | |
304 | + let str_info = ''; | |
305 | + let container_code = ''; | |
306 | + let list_qty = 0; | |
307 | + if (list_info[i].containerCode) { | |
308 | + container_code = "\n容器编码:" + list_info[i].containerCode + ""; | |
309 | + if (list_info[i].materialName) { | |
310 | + for (let j = 0; j < list_info[i].materialName.length; j++) { | |
311 | + let list_batch = list_info[i].batch[j] === null ? "无" : list_info[i].batch[j] === "" ? "无" : list_info[i].batch[j]; | |
312 | + list_qty += list_info[i].qty[j]; | |
313 | + if (j == list_info[i].materialName.length - 1) { | |
314 | + str_info = str_info + "\n批次:" + list_batch + ",物料名称:" + list_info[i].materialName[j] + ",物料编码:" + list_info[i].materialCode[j] + | |
315 | + ",数量:" + list_qty + "" | |
286 | 316 | } |
317 | + | |
318 | + | |
287 | 319 | } |
288 | 320 | } |
289 | - let code=list_info[i].code===null?"无":list_info[i].code; | |
290 | - $("[data-i='"+row+"']"+"[data-j='"+line+"']"+"[data-k='"+layers+"']").attr({ "title":"第"+row+"行,第"+line+"列,第"+ layers +"层\n库位:"+ code + container_code + str_info}); | |
291 | - // Vue.prototype.$Jnotification.success({message: '系统提示', description: "第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info, duration: 4}) | |
292 | - | |
293 | 321 | } |
322 | + let code = list_info[i].code === null ? "无" : list_info[i].code; | |
323 | + $("[data-i='" + row + "']" + "[data-j='" + line + "']" + "[data-k='" + layers + "']").attr({"title": "第" + row + "行,第" + line + "列,第" + layers + "层\n库位:" + code + container_code + str_info}); | |
324 | + // Vue.prototype.$Jnotification.success({message: '系统提示', description: "第"+row+"行,第"+line+"列,第"+ layers +"层<br>库位:"+ code + container_code + str_info, duration: 4}) | |
325 | + | |
294 | 326 | } |
295 | - }else {return ""} | |
296 | - }, | |
297 | - | |
298 | - | |
299 | - //关闭tips | |
300 | - Mclose(x){ | |
301 | - //关闭 | |
302 | - // Vue.prototype.$Jnotification.error({message: '系统提示', description: "鼠标拿走了", duration: 4}) | |
303 | - }, | |
304 | - | |
305 | - //库位信息请求和状态显示 | |
306 | - ajaxGrid(x, info) { | |
307 | - let _this=this | |
308 | - // let load=layer.msg('加载中', {icon: 16,shade: 0.4,time: false}); | |
309 | - $.ajax({ | |
310 | - url:window._CONFIG['domianURL']+prefix+"/getLocationInfo", | |
311 | - type:"post", | |
312 | - headers:{ | |
313 | - "X-Access-Token":Vue.ls.get(ACCESS_TOKEN) | |
314 | - }, | |
315 | - data:info, | |
316 | - success:function (res) { | |
317 | - if (res.code===200||res.result) { | |
318 | - grid_num_1 = 0; | |
319 | - grid_num_2 = 0; | |
320 | - grid_num_3 = 0; | |
321 | - grid_num_4 = 0; | |
322 | - grid_num_5 = 0; | |
323 | - grid_num_6 = 0; | |
324 | - grid_num_7 = 0; | |
325 | - grid_num_8 = 0; | |
326 | - grid_num_9 = 0; | |
327 | - grid_num_10 = 0; | |
328 | - grid_num_11 = 0; | |
329 | - grid_num_12 = 0; | |
330 | - if (x === "row") { | |
331 | - for (let i = 0; i < res.result.length; i++) { | |
332 | - let index=res.result[i].icolumn+((res.result[i].layer-1)*grid_line); | |
333 | - index=index-1; | |
334 | - _this.resShow(res,index,i); | |
335 | - } | |
336 | - _this.clearLocation(grid_line,grid_layer); | |
337 | - // layer.close(load); | |
327 | + } | |
328 | + } else { | |
329 | + return "" | |
330 | + } | |
331 | + }, | |
332 | + | |
333 | + | |
334 | + //关闭tips | |
335 | + Mclose(x) { | |
336 | + //关闭 | |
337 | + // Vue.prototype.$Jnotification.error({message: '系统提示', description: "鼠标拿走了", duration: 4}) | |
338 | + }, | |
339 | + | |
340 | + //库位信息请求和状态显示 | |
341 | + ajaxGrid(x, info) { | |
342 | + let _this = this | |
343 | + // let load=layer.msg('加载中', {icon: 16,shade: 0.4,time: false}); | |
344 | + $.ajax({ | |
345 | + url: window._CONFIG['domianURL'] + prefix + "/getLocationInfo", | |
346 | + type: "post", | |
347 | + headers: { | |
348 | + "X-Access-Token": Vue.ls.get(ACCESS_TOKEN) | |
349 | + }, | |
350 | + data: info, | |
351 | + success: function (res) { | |
352 | + if (res.code === 200 || res.result) { | |
353 | + grid_num_1 = 0; | |
354 | + grid_num_2 = 0; | |
355 | + grid_num_3 = 0; | |
356 | + grid_num_4 = 0; | |
357 | + grid_num_5 = 0; | |
358 | + grid_num_6 = 0; | |
359 | + grid_num_7 = 0; | |
360 | + grid_num_8 = 0; | |
361 | + grid_num_9 = 0; | |
362 | + grid_num_10 = 0; | |
363 | + grid_num_11 = 0; | |
364 | + grid_num_12 = 0; | |
365 | + if (x === "row") { | |
366 | + for (let i = 0; i < res.result.length; i++) { | |
367 | + let index = res.result[i].icolumn + ((res.result[i].layer - 1) * grid_line); | |
368 | + index = index - 1; | |
369 | + _this.resShow(res, index, i); | |
338 | 370 | } |
339 | - else if (x === "line") { | |
340 | - for (let i = 0; i < res.result.length; i++) { | |
341 | - let index=res.result[i].row+((res.result[i].layer-1)*grid_row); | |
342 | - index=index-1; | |
343 | - _this.resShow(res,index,i); | |
344 | - } | |
345 | - _this.clearLocation(grid_row,grid_layer); | |
346 | - // layer.close(load); | |
371 | + _this.clearLocation(grid_line, grid_layer); | |
372 | + // layer.close(load); | |
373 | + } else if (x === "line") { | |
374 | + for (let i = 0; i < res.result.length; i++) { | |
375 | + let index = res.result[i].row + ((res.result[i].layer - 1) * grid_row); | |
376 | + index = index - 1; | |
377 | + _this.resShow(res, index, i); | |
347 | 378 | } |
348 | - else if (x === "layer") { | |
349 | - for (let i = 0; i < res.result.length; i++) { | |
350 | - let index=res.result[i].icolumn+((res.result[i].row-1)*grid_line); | |
351 | - index=index-1; | |
352 | - _this.resShow(res,index,i); | |
353 | - } | |
354 | - _this.clearLocation(grid_line,grid_row); | |
355 | - // layer.close(load); | |
379 | + _this.clearLocation(grid_row, grid_layer); | |
380 | + // layer.close(load); | |
381 | + } else if (x === "layer") { | |
382 | + for (let i = 0; i < res.result.length; i++) { | |
383 | + let index = res.result[i].icolumn + ((res.result[i].row - 1) * grid_line); | |
384 | + index = index - 1; | |
385 | + _this.resShow(res, index, i); | |
356 | 386 | } |
357 | - } | |
358 | - else if (res.code!==200) { | |
387 | + _this.clearLocation(grid_line, grid_row); | |
359 | 388 | // layer.close(load); |
360 | - // layer.open({ | |
361 | - // title: '错误', | |
362 | - // content: res.msg | |
363 | - // }); | |
364 | 389 | } |
365 | - list_info=res.result; | |
366 | - }, | |
367 | - error:function (req, msg) { | |
368 | - console.log(msg); | |
369 | - } | |
370 | - }) | |
371 | - }, | |
372 | - //库位请求的结果显示 | |
373 | - resShow(res, index ,i) { | |
374 | - // if (res.result[i].deleted === false) { | |
375 | - var row=res.result[i].row; | |
376 | - var jColumn=res.result[i].icolumn; | |
377 | - var kLayer=res.result[i].layer; | |
378 | - if (res.result[i].locationAttribute === "1") { | |
379 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_rest, "isTrue": 1}); | |
380 | - grid_num_1 = grid_num_1 + 1; | |
381 | - } else if (res.result[i].locationAttribute === "2") { | |
382 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_empty, "isTrue": 1}); | |
383 | - grid_num_2 = grid_num_2 + 1; | |
384 | - } else if (res.result[i].locationAttribute === "3") { | |
385 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_half, "isTrue": 1}); | |
386 | - grid_num_3 = grid_num_3 + 1; | |
387 | - } else if (res.result[i].locationAttribute === "4") { | |
388 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_all, "isTrue": 1}); | |
389 | - grid_num_4 = grid_num_4 + 1; | |
390 | - } else if (res.result[i].locationAttribute === "5") { | |
391 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_emp_lock, "isTrue": 1}); | |
392 | - grid_num_5 = grid_num_5 + 1; | |
393 | - } else if (res.result[i].locationAttribute === "6") { | |
394 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_empty_lock, "isTrue": 1}); | |
395 | - grid_num_6 = grid_num_6 + 1; | |
396 | - } else if (res.result[i].locationAttribute === "7") { | |
397 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_half_lock, "isTrue": 1}); | |
398 | - grid_num_7 = grid_num_7 + 1; | |
399 | - } else if (res.result[i].locationAttribute === "8") { | |
400 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_all_lock, "isTrue": 1}); | |
401 | - grid_num_8 = grid_num_8 + 1; | |
402 | - } else if (res.result[i].locationAttribute === "9") { | |
403 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_emp_waing, "isTrue": 1}); | |
404 | - grid_num_9 = grid_num_9 + 1; | |
405 | - } else if (res.result[i].locationAttribute === "10") { | |
406 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_empty_waring, "isTrue": 1}); | |
407 | - grid_num_10 = grid_num_10 + 1; | |
408 | - } else if (res.result[i].locationAttribute === "11") { | |
409 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_half_waring, "isTrue": 1}); | |
410 | - grid_num_11 = grid_num_11 + 1; | |
411 | - } else if (res.result[i].locationAttribute === "12") { | |
412 | - $("[data-i='"+row+"']"+"[data-j='"+jColumn+"']"+"[data-k='"+kLayer+"']").attr({"src": grid_all_waring, "isTrue": 1}); | |
413 | - grid_num_12 = grid_num_12 + 1; | |
414 | - } | |
415 | - // } | |
416 | - // else if (res.result[i].deleted === true) { | |
417 | - // $(".grid").eq(i).attr({"src": rel_empty, "onmouseover": "", "onclick": ""}); | |
418 | - // } | |
419 | - }, | |
420 | - | |
421 | - //清除将数据库中没有的库位 | |
422 | - clearLocation(x, y) { | |
423 | - for (let j = 0; j < x * y; j++) { | |
424 | - let sta=$(".grid").eq(j).attr("isTrue"); | |
425 | - if (sta !== "1") { | |
426 | - $(".grid").eq(j).attr({"src": rel_empty,"onmouseover": "","onclick": ""}); | |
390 | + } else if (res.code !== 200) { | |
391 | + // layer.close(load); | |
392 | + // layer.open({ | |
393 | + // title: '错误', | |
394 | + // content: res.msg | |
395 | + // }); | |
427 | 396 | } |
397 | + list_info = res.result; | |
398 | + }, | |
399 | + error: function (req, msg) { | |
400 | + console.log(msg); | |
428 | 401 | } |
429 | - this.spinning=false; | |
430 | - this.showPrise=true; | |
431 | - this.loading=false; | |
432 | - }, | |
433 | - | |
434 | - //点击显示当前库位信息 | |
435 | - gridMsg(msg) { | |
436 | - let $j=$(msg); | |
437 | - let row=$j.attr("data-i"); | |
438 | - let line=$j.attr("data-j"); | |
439 | - let layers=$j.attr("data-k"); | |
440 | - | |
441 | - row=parseInt(row); | |
442 | - line=parseInt(line); | |
443 | - layers=parseInt(layers); | |
444 | - if (list_info) {//缓存查询 | |
445 | - for (let i = 0; i < list_info.length; i++) { | |
446 | - if (list_info[i].row === row && list_info[i].icolumn === line && list_info[i].layer === layers) { | |
447 | - if (list_info[i].materialName) { | |
448 | - let list_batch=''; | |
449 | - let list_qty=0; | |
450 | - $("#material").children().remove(); | |
451 | - for (let j = 0; j < list_info[i].materialName.length; j++) { | |
452 | - list_batch=list_info[i].batch[j]===null?"无":list_info[i].batch[j]===""?"无":list_info[i].batch[j]; | |
453 | - list_qty +=list_info[i].qty[j]; | |
454 | - let str_info="批次:"+ list_batch +"/ 物料名称:"+ list_info[i].materialName[j] +"/ 物料编码:"+ list_info[i].materialCode[j] + | |
455 | - "/ 数量:"+ list_qty +""; | |
456 | - if (j==list_info[i].materialName.length-1){ | |
457 | - $("#material").append("<option>"+ str_info +"</option>"); | |
458 | - } | |
459 | - currentMaterialCode = list_info[i].materialCode[j] | |
402 | + }) | |
403 | + }, | |
404 | + //库位请求的结果显示 | |
405 | + resShow(res, index, i) { | |
406 | + // if (res.result[i].deleted === false) { | |
407 | + var row = res.result[i].row; | |
408 | + var jColumn = res.result[i].icolumn; | |
409 | + var kLayer = res.result[i].layer; | |
410 | + if (res.result[i].locationAttribute === "1") { | |
411 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
412 | + "src": grid_rest, | |
413 | + "isTrue": 1 | |
414 | + }); | |
415 | + grid_num_1 = grid_num_1 + 1; | |
416 | + } else if (res.result[i].locationAttribute === "2") { | |
417 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
418 | + "src": grid_empty, | |
419 | + "isTrue": 1 | |
420 | + }); | |
421 | + grid_num_2 = grid_num_2 + 1; | |
422 | + } else if (res.result[i].locationAttribute === "3") { | |
423 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
424 | + "src": grid_half, | |
425 | + "isTrue": 1 | |
426 | + }); | |
427 | + grid_num_3 = grid_num_3 + 1; | |
428 | + } else if (res.result[i].locationAttribute === "4") { | |
429 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
430 | + "src": grid_all, | |
431 | + "isTrue": 1 | |
432 | + }); | |
433 | + grid_num_4 = grid_num_4 + 1; | |
434 | + } else if (res.result[i].locationAttribute === "5") { | |
435 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
436 | + "src": grid_emp_lock, | |
437 | + "isTrue": 1 | |
438 | + }); | |
439 | + grid_num_5 = grid_num_5 + 1; | |
440 | + } else if (res.result[i].locationAttribute === "6") { | |
441 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
442 | + "src": grid_empty_lock, | |
443 | + "isTrue": 1 | |
444 | + }); | |
445 | + grid_num_6 = grid_num_6 + 1; | |
446 | + } else if (res.result[i].locationAttribute === "7") { | |
447 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
448 | + "src": grid_half_lock, | |
449 | + "isTrue": 1 | |
450 | + }); | |
451 | + grid_num_7 = grid_num_7 + 1; | |
452 | + } else if (res.result[i].locationAttribute === "8") { | |
453 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
454 | + "src": grid_all_lock, | |
455 | + "isTrue": 1 | |
456 | + }); | |
457 | + grid_num_8 = grid_num_8 + 1; | |
458 | + } else if (res.result[i].locationAttribute === "9") { | |
459 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
460 | + "src": grid_emp_waing, | |
461 | + "isTrue": 1 | |
462 | + }); | |
463 | + grid_num_9 = grid_num_9 + 1; | |
464 | + } else if (res.result[i].locationAttribute === "10") { | |
465 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
466 | + "src": grid_empty_waring, | |
467 | + "isTrue": 1 | |
468 | + }); | |
469 | + grid_num_10 = grid_num_10 + 1; | |
470 | + } else if (res.result[i].locationAttribute === "11") { | |
471 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
472 | + "src": grid_half_waring, | |
473 | + "isTrue": 1 | |
474 | + }); | |
475 | + grid_num_11 = grid_num_11 + 1; | |
476 | + } else if (res.result[i].locationAttribute === "12") { | |
477 | + $("[data-i='" + row + "']" + "[data-j='" + jColumn + "']" + "[data-k='" + kLayer + "']").attr({ | |
478 | + "src": grid_all_waring, | |
479 | + "isTrue": 1 | |
480 | + }); | |
481 | + grid_num_12 = grid_num_12 + 1; | |
482 | + } | |
483 | + | |
484 | + }, | |
485 | + | |
486 | + //清除将数据库中没有的库位 | |
487 | + clearLocation(x, y) { | |
488 | + for (let j = 0; j < x * y; j++) { | |
489 | + let sta = $(".grid").eq(j).attr("isTrue"); | |
490 | + if (sta !== "1") { | |
491 | + $(".grid").eq(j).attr({"src": rel_empty, "onmouseover": "", "onclick": ""}); | |
492 | + } | |
493 | + } | |
494 | + this.spinning = false; | |
495 | + this.showPrise = true; | |
496 | + this.loading = false; | |
497 | + }, | |
498 | + | |
499 | + //点击显示当前库位信息 | |
500 | + gridMsg(msg) { | |
501 | + let $j = $(msg); | |
502 | + let row = $j.attr("data-i"); | |
503 | + let line = $j.attr("data-j"); | |
504 | + let layers = $j.attr("data-k"); | |
505 | + | |
506 | + row = parseInt(row); | |
507 | + line = parseInt(line); | |
508 | + layers = parseInt(layers); | |
509 | + if (list_info) {//缓存查询 | |
510 | + for (let i = 0; i < list_info.length; i++) { | |
511 | + if (list_info[i].row === row && list_info[i].icolumn === line && list_info[i].layer === layers) { | |
512 | + if (list_info[i].materialName) { | |
513 | + let list_batch = ''; | |
514 | + let list_qty = 0; | |
515 | + $("#material").children().remove(); | |
516 | + for (let j = 0; j < list_info[i].materialName.length; j++) { | |
517 | + list_batch = list_info[i].batch[j] === null ? "无" : list_info[i].batch[j] === "" ? "无" : list_info[i].batch[j]; | |
518 | + list_qty += list_info[i].qty[j]; | |
519 | + let str_info = "批次:" + list_batch + "/ 物料名称:" + list_info[i].materialName[j] + "/ 物料编码:" + list_info[i].materialCode[j] + | |
520 | + "/ 数量:" + list_qty + ""; | |
521 | + if (j == list_info[i].materialName.length - 1) { | |
522 | + $("#material").append("<option>" + str_info + "</option>"); | |
460 | 523 | } |
524 | + currentMaterialCode = list_info[i].materialCode[j] | |
461 | 525 | } |
462 | - else { | |
463 | - $("#material").children().remove(); | |
464 | - $("#material").append("<option>无</option>"); | |
465 | - } | |
466 | - $("#code").val(list_info[i].code); | |
467 | - $("#containerCode").val(list_info[i].containerCode===""?"无":list_info[i].containerCode); | |
468 | - currentContainerCode = $("#containerCode").val() | |
469 | - currentLocationCode = $("#code").val() | |
526 | + } else { | |
527 | + $("#material").children().remove(); | |
528 | + $("#material").append("<option>无</option>"); | |
470 | 529 | } |
530 | + $("#code").val(list_info[i].code); | |
531 | + $("#containerCode").val(list_info[i].containerCode === "" ? "无" : list_info[i].containerCode); | |
532 | + currentContainerCode = $("#containerCode").val() | |
533 | + currentLocationCode = $("#code").val() | |
471 | 534 | } |
472 | - }else {return ""} | |
473 | - }, | |
474 | - | |
475 | - //页面初始化请求 | |
476 | - resetAjax(type){ | |
477 | - var _this=this; | |
478 | - $.ajax({ | |
479 | - url:window._CONFIG['domianURL']+prefix+"/getAllLocation", | |
480 | - type:"post", | |
481 | - data:{ | |
482 | - type:type | |
483 | - }, | |
484 | - headers:{ | |
485 | - "X-Access-Token":Vue.ls.get(ACCESS_TOKEN) | |
486 | - }, | |
487 | - success:function (res) { | |
488 | - grid_row=res.result.maxRow; | |
489 | - grid_row_first = res.result.minRow; | |
490 | - grid_line=res.result.maxLine; | |
491 | - grid_layer=res.result.maxLayer; | |
492 | - //初始格子 | |
493 | - $("#location").children().remove(); | |
494 | - for (let i = 1; i <= grid_layer; i++) { | |
495 | - // var index=i+1;<span style='margin-top:30px'>第"+ index +"行</span> | |
496 | - $(".location").append("<br>"); | |
497 | - for (let j = 1; j <= grid_line; j++) { | |
498 | - // $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid'>"); | |
499 | - $(".location").append("<img v-html data-i='1' data-j="+j+" data-k="+ i +" class='grid' onmouseove='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
500 | - } | |
535 | + } | |
536 | + } else { | |
537 | + return "" | |
538 | + } | |
539 | + }, | |
540 | + | |
541 | + //页面初始化请求 | |
542 | + resetAjax(type) { | |
543 | + var _this = this; | |
544 | + $.ajax({ | |
545 | + url: window._CONFIG['domianURL'] + prefix + "/getAllLocation", | |
546 | + type: "post", | |
547 | + data: { | |
548 | + type: type | |
549 | + }, | |
550 | + headers: { | |
551 | + "X-Access-Token": Vue.ls.get(ACCESS_TOKEN) | |
552 | + }, | |
553 | + success: function (res) { | |
554 | + grid_row = res.result.maxRow; | |
555 | + grid_row_first = res.result.minRow; | |
556 | + grid_line = res.result.maxLine; | |
557 | + grid_layer = res.result.maxLayer; | |
558 | + //初始格子 | |
559 | + $("#location").children().remove(); | |
560 | + for (let i = 1; i <= grid_layer; i++) { | |
561 | + // var index=i+1;<span style='margin-top:30px'>第"+ index +"行</span> | |
562 | + $(".location").append("<br>"); | |
563 | + for (let j = 1; j <= grid_line; j++) { | |
564 | + // $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid'>"); | |
565 | + $(".location").append("<img v-html data-i='1' data-j=" + j + " data-k=" + i + " class='grid' onmouseove='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
501 | 566 | } |
502 | - let num=$("#editable-select").val(); | |
503 | - $("#editable-num").children().remove(); | |
504 | - if (num === "row") { | |
505 | - for (let i = grid_row_first; i <= grid_row; i++) { | |
506 | - $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
507 | - } | |
567 | + } | |
568 | + let num = $("#editable-select").val(); | |
569 | + $("#editable-num").children().remove(); | |
570 | + if (num === "row") { | |
571 | + for (let i = grid_row_first; i <= grid_row; i++) { | |
572 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
508 | 573 | } |
509 | - else if (num === "line") { | |
510 | - for (let i = 1; i <= grid_line; i++) { | |
511 | - $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
512 | - } | |
574 | + } else if (num === "line") { | |
575 | + for (let i = 1; i <= grid_line; i++) { | |
576 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
513 | 577 | } |
514 | - else if (num === "layer") { | |
515 | - for (let i = 1; i <= grid_layer; i++) { | |
516 | - $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
517 | - } | |
578 | + } else if (num === "layer") { | |
579 | + for (let i = 1; i <= grid_layer; i++) { | |
580 | + $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") | |
518 | 581 | } |
519 | - _this.changeMargin(); | |
520 | - _this.Search(); | |
521 | 582 | } |
522 | - }); | |
523 | - }, | |
583 | + _this.changeMargin(); | |
584 | + _this.Search(); | |
585 | + } | |
586 | + }); | |
587 | + }, | |
524 | 588 | |
525 | 589 | |
526 | - //搜索平面库位 | |
527 | - Search(){ | |
528 | - this.spinning=true; | |
529 | - this.showPrise=false; | |
530 | - this.loading=true; | |
531 | - let index=$("#editable-select").val(); | |
532 | - let num=$("#editable-num").val(); | |
590 | + //页面初始化请求 | |
591 | + resetAjaxs(type) { | |
592 | + var _this = this; | |
593 | + $.ajax({ | |
594 | + url: window._CONFIG['domianURL'] + prefix + "/getAllLocation", | |
595 | + type: "post", | |
596 | + data: { | |
597 | + type: type | |
598 | + }, | |
599 | + headers: { | |
600 | + "X-Access-Token": Vue.ls.get(ACCESS_TOKEN) | |
601 | + }, | |
602 | + success: function (res) { | |
603 | + grid_row = res.result.maxRow; | |
604 | + grid_row_first = res.result.minRow; | |
605 | + grid_line = res.result.maxLine; | |
606 | + grid_layer = res.result.maxLayer; | |
607 | + //初始格子 | |
608 | + // $("#location").children().remove(); | |
609 | + // for (let i = 1; i <= grid_layer; i++) { | |
610 | + // // var index=i+1;<span style='margin-top:30px'>第"+ index +"行</span> | |
611 | + // $(".location").append("<br>"); | |
612 | + // for (let j = 1; j <= grid_line; j++) { | |
613 | + // // $(".location").append("<img data-i='1' data-j="+j+" data-k="+ i +" class='grid'>"); | |
614 | + // $(".location").append("<img v-html data-i='1' data-j="+j+" data-k="+ i +" class='grid' onmouseove='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
615 | + // } | |
616 | + // } | |
617 | + // let num=$("#editable-select").val(); | |
618 | + // $("#editable-num").children().remove(); | |
619 | + // if (num === "row") { | |
620 | + // for (let i = grid_row_first; i <= grid_row; i++) { | |
621 | + // $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
622 | + // } | |
623 | + // } | |
624 | + // else if (num === "line") { | |
625 | + // for (let i = 1; i <= grid_line; i++) { | |
626 | + // $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
627 | + // } | |
628 | + // } | |
629 | + // else if (num === "layer") { | |
630 | + // for (let i = 1; i <= grid_layer; i++) { | |
631 | + // $("#editable-num").append("<option value='"+i+"'>"+i+"</option>") | |
632 | + // } | |
633 | + // } | |
634 | + // _this.changeMargin(); | |
635 | + } | |
636 | + }); | |
637 | + }, | |
533 | 638 | |
534 | - let zoneCode=""; | |
535 | 639 | |
536 | - if ($("#zoneCode").val()==null) | |
537 | - { | |
538 | - zoneCode=this.locationTypeList[0].zoneCode; | |
539 | - }else | |
540 | - { | |
541 | - zoneCode=this.locationTypeList[$("#zoneCode").val()].zoneCode; | |
542 | - } | |
640 | + //搜索平面库位 | |
641 | + Search() { | |
543 | 642 | |
643 | + // this.resetAjaxs(this.zoneCode); | |
644 | + this.spinning = true; | |
645 | + this.showPrise = false; | |
646 | + this.loading = true; | |
647 | + let index = $("#editable-select").val(); | |
648 | + let num = $("#editable-num").val(); | |
544 | 649 | |
545 | - $("#code").val(""); | |
546 | - $("#containerCode").val(""); | |
547 | - $("#material").children().remove(); | |
548 | - $("#material").append("<option>无</option>"); | |
549 | - let data; | |
550 | - this.seachZone(); | |
551 | - if (index === "row") { | |
552 | - data={type:zoneCode, row:num}; | |
553 | - $("#location").children().remove(); | |
554 | - for (let i = grid_layer; i > 0; i--) { | |
555 | - $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ i+"层</span>"); | |
556 | - for (let j = 1; j <= grid_line; j++) { | |
557 | - $(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
558 | - } | |
650 | + let zoneCode = ""; | |
651 | + | |
652 | + | |
653 | + $("#code").val(""); | |
654 | + $("#containerCode").val(""); | |
655 | + $("#material").children().remove(); | |
656 | + $("#material").append("<option>无</option>"); | |
657 | + let data; | |
658 | + this.seachZone(); | |
659 | + if (index === "row") { | |
660 | + data = {type: this.zoneCode, row: num}; | |
661 | + $("#location").children().remove(); | |
662 | + for (let i = grid_layer; i > 0; i--) { | |
663 | + $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第" + i + "层</span>"); | |
664 | + for (let j = 1; j <= grid_line; j++) { | |
665 | + $(".location").append("<img data-i=" + num + " data-j=" + j + " data-k=" + i + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
559 | 666 | } |
560 | - this.changeMargin(); | |
561 | - this.ajaxGrid(index,data); | |
562 | 667 | } |
563 | - else if (index === "line") { | |
564 | - data={type:zoneCode, line:num}; | |
565 | - $("#location").children().remove(); | |
566 | - for (let k = grid_layer; k > 0; k--) { | |
567 | - $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ k+"层</span>"); | |
568 | - for (let l = 1; l <= grid_row; l++) { | |
569 | - $(".location").append("<img data-i="+l+" data-j="+num+" data-k="+k+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
570 | - } | |
668 | + this.changeMargin(); | |
669 | + this.ajaxGrid(index, data); | |
670 | + } else if (index === "line") { | |
671 | + data = {type: this.zoneCode, line: num}; | |
672 | + $("#location").children().remove(); | |
673 | + for (let k = grid_layer; k > 0; k--) { | |
674 | + $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第" + k + "层</span>"); | |
675 | + for (let l = 1; l <= grid_row; l++) { | |
676 | + $(".location").append("<img data-i=" + l + " data-j=" + num + " data-k=" + k + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
571 | 677 | } |
572 | - this.changeMargin(); | |
573 | - this.ajaxGrid(index,data); | |
574 | 678 | } |
575 | - else if (index === "layer") { | |
576 | - data={type:zoneCode, layer:num}; | |
577 | - $("#location").children().remove(); | |
578 | - for (let m = 1; m <= grid_row; m++) { | |
579 | - $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第"+ m+"行</span>"); | |
580 | - for (let n = 1; n <= grid_line; n++) { | |
581 | - $(".location").append("<img data-i="+m+" data-j="+n+" data-k="+num+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
582 | - } | |
679 | + this.changeMargin(); | |
680 | + this.ajaxGrid(index, data); | |
681 | + } else if (index === "layer") { | |
682 | + data = {type: this.zoneCode, layer: num}; | |
683 | + $("#location").children().remove(); | |
684 | + for (let m = 1; m <= grid_row; m++) { | |
685 | + $(".location").append("<br><span style='display: inline-block;text-align: right;width: 50px; margin-right: 10px;'>第" + m + "行</span>"); | |
686 | + for (let n = 1; n <= grid_line; n++) { | |
687 | + $(".location").append("<img data-i=" + m + " data-j=" + n + " data-k=" + num + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); | |
583 | 688 | } |
584 | - this.changeMargin(); | |
585 | - this.ajaxGrid(index,data); | |
586 | 689 | } |
587 | - }, | |
588 | - seachZone(){ | |
589 | - let _this=this | |
590 | - let zoneCode=""; | |
591 | - if ($("#zoneCode").val()==null) | |
592 | - { | |
593 | - zoneCode=this.locationTypeList[0].zoneCode; | |
594 | - }else | |
595 | - { | |
596 | - zoneCode=this.locationTypeList[$("#zoneCode").val()].zoneCode; | |
597 | - } | |
598 | - $.ajax({ | |
599 | - url:window._CONFIG['domianURL']+prefix+"/getStatus", | |
600 | - data:{ | |
601 | - zoneCode:zoneCode | |
602 | - }, | |
603 | - headers:{ | |
604 | - "X-Access-Token":Vue.ls.get(ACCESS_TOKEN) | |
605 | - }, | |
606 | - success:function (response) { | |
607 | - if (response.code==200){ | |
608 | - $("#zone").val("库位总数:"+response.result.location+", 空闲库位:"+response.result.emptyLocation+ | |
609 | - ", 空托盘库位:"+response.result.haveContainLocation+", 有货库位:"+response.result.haveInventoryLocation) | |
610 | - }else { | |
611 | - alert(response.message) | |
612 | - } | |
613 | - }, | |
614 | - error:function () { | |
615 | - alert("未知的错误") | |
690 | + this.changeMargin(); | |
691 | + this.ajaxGrid(index, data); | |
692 | + } | |
693 | + ; | |
694 | + | |
695 | + | |
696 | + }, | |
697 | + seachZone() { | |
698 | + let _this = this | |
699 | + | |
700 | + $.ajax({ | |
701 | + url: window._CONFIG['domianURL'] + prefix + "/getStatus", | |
702 | + data: { | |
703 | + zoneCode: _this.zoneCode | |
704 | + }, | |
705 | + headers: { | |
706 | + "X-Access-Token": Vue.ls.get(ACCESS_TOKEN) | |
707 | + }, | |
708 | + success: function (response) { | |
709 | + if (response.code == 200) { | |
710 | + $("#zone").val("库位总数:" + response.result.location + ", 空闲库位:" + response.result.emptyLocation + | |
711 | + ", 空托盘库位:" + response.result.haveContainLocation + ", 有货库位:" + response.result.haveInventoryLocation) | |
712 | + } else { | |
713 | + alert(response.message) | |
616 | 714 | } |
617 | - }) | |
618 | - }, | |
619 | - } | |
715 | + }, | |
716 | + error: function () { | |
717 | + alert("未知的错误") | |
718 | + } | |
719 | + }) | |
720 | + }, | |
620 | 721 | } |
722 | +} | |
621 | 723 | </script> |
622 | 724 | |
623 | 725 | <style scoped> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/controller/LocationMonitorController.java
... | ... | @@ -54,7 +54,7 @@ public class LocationMonitorController { |
54 | 54 | public Result getStatus(String zoneCode, HttpServletRequest req) { |
55 | 55 | LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); |
56 | 56 | HuahengJwtUtil.setWarehouseCode(queryWrapper, Location.class, req); |
57 | - queryWrapper.select(Location::getStatus, Location::getContainerCode).eq(Location::getZoneCode, zoneCode); | |
57 | + queryWrapper.select(Location::getStatus, Location::getContainerCode).eq(Location::getLocationTypeCode, zoneCode); | |
58 | 58 | List<Location> locationList = locationService.list(queryWrapper); |
59 | 59 | HashMap<String, Integer> map = new HashMap<>(); |
60 | 60 | map.put("location", locationList.size()); |
... | ... |