Commit 16b37ba637ad5a93a1231ed3b08b3fa34ca97c32

Authored by 谭毅彬
1 parent acd4ca86

多仓支持提交(4)

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/config/modules/LocationPrintForm.vue
... ... @@ -8,16 +8,14 @@
8 8  
9 9  
10 10 <div class="row" id="printContent">
11   - <table style=" width:100px;/*height:228px;*/" v-for="source in dataSource">
  11 + <table style=" width:100px;/*height:228px;*/" v-for="source in dataSource" :key="source">
12 12 <tbody>
13 13 <tr style=" width:80px;height:60px;">
14 14 <td>
15   - <barcode :value="source.code" :margin="15" :margin-bottom="20" :margin-top="40" :margin-left="0"
16   - :height="120" font-size="30"></barcode>
  15 + <barcode :value="source.code" :margin="15" :margin-bottom="20" :margin-top="40" :margin-left="0" :height="120" font-size="30"></barcode>
17 16 </td>
18 17 <td>
19   - <barcode :value="source.code" :margin="15" :margin-bottom="20" :margin-top="40" :margin-left="0"
20   - :height="120" font-size="30"></barcode>
  18 + <barcode :value="source.code" :margin="15" :margin-bottom="20" :margin-top="40" :margin-left="0" :height="120" font-size="30"></barcode>
21 19 </td>
22 20 </tr>
23 21 </tbody>
... ...
ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
... ... @@ -12,14 +12,11 @@
12 12 option-filter-prop="children"
13 13 v-model="zoneCode"
14 14 style="width: 200px">
15   - <a-select-option selected="0" id="zoneCode" v-for="item in locationTypeList" :key="item.name" :value="item.code">{{
16   - item.name
17   - }}
  15 + <a-select-option selected="0" id="zoneCode" v-for="item in locationTypeList" :key="item.name" :value="item.code">{{item.name}}
18 16 </a-select-option>
19 17 </a-select>
20 18 </li>
21   - <li>
22   - 第
  19 + <li>第
23 20 <select id="editable-num" name="num" style="width: 70px">
24 21 </select>
25 22 </li>
... ... @@ -91,7 +88,7 @@
91 88 </div>
92 89  
93 90 <div class="col-sm-12 select-info">
94   - <div id="borderCol" style="overflow-y: scroll;white-space:nowrap" v-show="showPrise">
  91 + <div id="borderCol" style="overflow-y: auto;white-space:nowrap" v-show="showPrise">
95 92 <div class="location" id="location">
96 93 </div>
97 94 </div>
... ... @@ -147,11 +144,6 @@
147 144 import {ACCESS_TOKEN} from "@/store/mutation-types"
148 145 import {getLocationTypeList} from '@/api/api'
149 146  
150   -
151   -
152   -
153   -
154   -
155 147 export default {
156 148 name: "locationStatus",
157 149 zoneCode:"",
... ... @@ -175,16 +167,13 @@
175 167 // spinning.value = !spinning.value;
176 168 // };
177 169  
178   -
179   - created() {
  170 + created() {
180 171 let _this=this
181 172 _this.loadFrom()
182 173 window.gridMsg=_this.gridMsg
183 174 window.Mclose=_this.Mclose
184 175 window.lays=_this.lays
185   - },
186   -
187   -
  176 + },
188 177  
189 178 mounted() {
190 179 //监听浏览器宽度的改变
... ... @@ -202,16 +191,15 @@
202 191 getLocationTypeList().then((res) => {
203 192 if (res.success) {
204 193 this.locationTypeList = res.result;
205   - this.zoneCode = this.locationTypeList[0].code;
206   - let _this=this;
207   - this.resetAjax(this.zoneCode);
  194 + if (this.locationTypeList.length > 0) {
  195 + this.zoneCode = this.locationTypeList[0].code;
  196 + let _this=this;
  197 + this.resetAjax(this.zoneCode);
  198 + }
208 199 }
209 200 })
210 201 },
211   -
212   -
213   -
214   - initEvent(){
  202 + initEvent() {
215 203 //库位类型和行列层选择
216 204 $("#editable-select").change(function () {
217 205 let num=$("#editable-select").val();
... ... @@ -381,8 +369,6 @@
381 369 }
382 370 })
383 371 },
384   -
385   -
386 372 //库位请求的结果显示
387 373 resShow(res, index ,i) {
388 374 // if (res.result[i].deleted === false) {
... ... @@ -530,9 +516,8 @@
530 516 $("#editable-num").append("<option value='"+i+"'>"+i+"</option>")
531 517 }
532 518 }
533   -
534 519 _this.changeMargin();
535   - _this.Search();
  520 + _this.Search();
536 521 }
537 522 });
538 523 },
... ... @@ -572,8 +557,6 @@
572 557 $(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
573 558 }
574 559 }
575   -
576   -
577 560 this.changeMargin();
578 561 this.ajaxGrid(index,data);
579 562 }
... ... @@ -601,11 +584,7 @@
601 584 this.changeMargin();
602 585 this.ajaxGrid(index,data);
603 586 }
604   - },
605   -
606   -
607   -
608   -
  587 + },
609 588 seachZone(){
610 589 let _this=this
611 590 let zoneCode="";
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java
... ... @@ -35,13 +35,13 @@ public class HuahengJwtUtil {
35 35 public static final long EXPIRE_TIME = 12 * 60 * 60 * 1000;
36 36  
37 37 public static final String HUAHENG_SYSTEM_ID = "HUAHENG-WMS4";
38   -
  38 +
39 39 /** 仓库视察员角色 */
40 40 public static final String USER_ROLE_INSPECTOR = "inspector";
41   -
  41 +
42 42 /** 全仓中文名称 */
43 43 public static final String ALL_WAREHOUSE_NAME = "全部仓库";
44   -
  44 +
45 45 /** 全仓CODE */
46 46 public static final String ALL_WAREHOUSE_CODE = "ALL_WAREHOUSE";
47 47  
... ... @@ -72,7 +72,7 @@ public class HuahengJwtUtil {
72 72 return null;
73 73 }
74 74 }
75   -
  75 +
76 76 /**
77 77 * 获得token中的信息无需secret解密也能获得
78 78 * @return token中包含的角色信息
... ... @@ -112,28 +112,28 @@ public class HuahengJwtUtil {
112 112  
113 113 public static <T> void setWarehouseCode(HttpServletRequest request, T t) {
114 114 List<String> roles = HuahengJwtUtil.getRolesByToken(request);
115   - if (roles.contains("inspector")) {
  115 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(request);
  116 + if (roles.contains(USER_ROLE_INSPECTOR) && warehouseCode.equals(ALL_WAREHOUSE_CODE)) {
116 117 return;
117 118 }
118 119 Field warehouseCodeField = ReflectUtil.getField(t.getClass(), "warehouseCode");
119 120 if (warehouseCodeField != null) {
120   - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(request);
121 121 ReflectUtil.setFieldValue(t, "warehouseCode", warehouseCode);
122 122 }
123 123 }
124   -
  124 +
125 125 public static <T> void setWarehouseCode(LambdaQueryWrapper<T> lambdaQueryWrapper, Class<T> clazz, HttpServletRequest request) {
126 126 List<String> roles = HuahengJwtUtil.getRolesByToken(request);
127   - if (roles.contains("inspector")) {
  127 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(request);
  128 + if (roles.contains(USER_ROLE_INSPECTOR) && warehouseCode.equals(ALL_WAREHOUSE_CODE)) {
128 129 return;
129 130 }
130 131 Field warehouseCodeField = ReflectUtil.getField(clazz, "warehouseCode");
131 132 if (warehouseCodeField != null) {
132   - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(request);
133 133 lambdaQueryWrapper.apply("warehouse_code = {0}", warehouseCode);
134 134 }
135 135 }
136   -
  136 +
137 137 /**
138 138 * 生成签名
139 139 * @param username 用户名
... ...