Commit e71b7dd59af857634530eb0a1d87020f0d889ce4
1 parent
f5c54a76
edit
Showing
4 changed files
with
65 additions
and
15 deletions
src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java
... | ... | @@ -211,8 +211,8 @@ public class ReceiptHeaderController extends BaseController { |
211 | 211 | @ResponseBody |
212 | 212 | public AjaxResult editSave(ReceiptHeader receiptHeader) { |
213 | 213 | // ReceiptHeader receiptHeader1 = receiptHeaderService.getById(receiptHeader.getId()); |
214 | - if (!QuantityConstant.RECEIPT_TYPE_PPI.equals(receiptHeader.getReceiptType())){ | |
215 | - return AjaxResult.error("只有手持入库单可修改"); | |
214 | + if (!QuantityConstant.RECEIPT_TYPE_PPI.equals(receiptHeader.getReceiptType())&&!QuantityConstant.MES_RECEIPT_TYPE_SI.equals(receiptHeader.getReceiptType())){ | |
215 | + return AjaxResult.error("只有手持入库单和產成品入庫可修改"); | |
216 | 216 | } |
217 | 217 | receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
218 | 218 | return toAjax(receiptHeaderService.updateById(receiptHeader)); |
... | ... |
src/main/resources/templates/receipt/finishedProductReceiving/finishedProductReceiving.html
... | ... | @@ -75,6 +75,7 @@ |
75 | 75 | var uWarehouseNames = [[${@warehouseWu.getName()}]]; |
76 | 76 | var company =[[${@companyService.getCode()}]]; |
77 | 77 | var receiptHeaderStatus = [[${@dict.getType('receiptHeaderStatus')}]]; |
78 | + var editFlag = [[${@permission.hasPermi('receipt:receiptHeader:edit')}]]; | |
78 | 79 | var receiptId = ''; |
79 | 80 | var receiptCode = ''; |
80 | 81 | var resubmit = new Date().getTime(); |
... | ... | @@ -163,6 +164,7 @@ |
163 | 164 | $(function() { |
164 | 165 | var options = { |
165 | 166 | url: prefix + "/list", |
167 | + updateUrl: ctx + "receipt/receiptHeader/edit/{id}", | |
166 | 168 | modalName: "产成品入库单", |
167 | 169 | sortName: "created", |
168 | 170 | sortOrder: "desc", |
... | ... | @@ -181,6 +183,15 @@ |
181 | 183 | checkbox: true |
182 | 184 | }, |
183 | 185 | { |
186 | + title: '操作', | |
187 | + align: 'center', | |
188 | + formatter: function(value, row, index) { | |
189 | + var actions = []; | |
190 | + actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> '); | |
191 | + return actions.join(''); | |
192 | + } | |
193 | + }, | |
194 | + { | |
184 | 195 | field : 'id', |
185 | 196 | title : 'id', |
186 | 197 | visible: false |
... | ... |
src/main/resources/templates/receipt/receiptDetail/add.html
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | <input id="qty" name="qty" class="form-control" type="text"> |
70 | 70 | </div> |
71 | 71 | </div> |
72 | - <span style="color: red;display:none;margin-left: 191px;" class="qtyClass" >*超出可收数量</span> | |
72 | +<!-- <span style="color: red;display:none;margin-left: 191px;" class="qtyClass" >*超出可收数量</span>--> | |
73 | 73 | <!--<div class="form-group">--> |
74 | 74 | <!--<label class="col-sm-3 control-label">供应商编码:</label>--> |
75 | 75 | <!--<div class="col-sm-8">--> |
... | ... | @@ -244,18 +244,18 @@ |
244 | 244 | } |
245 | 245 | $.modal.closeLoading(); |
246 | 246 | } |
247 | - $("#qty").blur( | |
248 | - function () { | |
249 | - var qty= $("input[name='qty']").val(); | |
250 | - if(qty > 10){ | |
251 | - $(".qtyClass").css("display","block") | |
252 | - $(".qtyForm").css("margin-bottom","0px"); | |
253 | - }else { | |
254 | - $(".qtyClass").css("display","none") | |
255 | - $(".qtyForm").css("margin-bottom","15px"); | |
256 | - } | |
257 | - } | |
258 | - ); | |
247 | + // $("#qty").blur( | |
248 | + // function () { | |
249 | + // var qty= $("input[name='qty']").val(); | |
250 | + // if(qty > 10){ | |
251 | + // $(".qtyClass").css("display","block") | |
252 | + // $(".qtyForm").css("margin-bottom","0px"); | |
253 | + // }else { | |
254 | + // $(".qtyClass").css("display","none") | |
255 | + // $(".qtyForm").css("margin-bottom","15px"); | |
256 | + // } | |
257 | + // } | |
258 | + // ); | |
259 | 259 | $(function () { |
260 | 260 | layui.use('laydate', function() { |
261 | 261 | var laydate = layui.laydate; |
... | ... |
src/main/resources/templates/receipt/receiptHeader/edit.html
... | ... | @@ -19,6 +19,24 @@ |
19 | 19 | </div> |
20 | 20 | </div> |
21 | 21 | <div class="form-group"> |
22 | + <label class="col-sm-3 control-label">货主编码:</label> | |
23 | + <div class="col-sm-8"> | |
24 | + <select id="companyCode" name="companyCode" class="form-control" th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}"> | |
25 | + <option value="">所有</option> | |
26 | + <option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}" th:attr="code = ${company['code']}"></option> | |
27 | + </select> | |
28 | + </div> | |
29 | + </div> | |
30 | + <div class="form-group"> | |
31 | + <label class="col-sm-3 control-label">u8仓库:</label> | |
32 | + <div class="col-sm-8"> | |
33 | + <select name="uWarehouseCode" id="uWarehouseCode" class="form-control" th:with="warehouse=${@warehouseWu.selectListAndCode()}"> | |
34 | + <option value="">所有</option> | |
35 | + <option th:each="e : ${warehouse}" th:text="${e['uWarehouseName']}" th:value="${e['uWarehouseCode']}"></option> | |
36 | + </select> | |
37 | + </div> | |
38 | + </div> | |
39 | + <div class="form-group"> | |
22 | 40 | <label class="col-sm-3 control-label">入库单备注:</label> |
23 | 41 | <div class="col-sm-8"> |
24 | 42 | <input id="receiptNote" name="receiptNote" class="form-control" type="text" th:field="*{receiptNote}"> |
... | ... | @@ -82,6 +100,27 @@ |
82 | 100 | } |
83 | 101 | } |
84 | 102 | }); |
103 | + | |
104 | + $("select[name='companyCode']").change(function (e) { | |
105 | + let companyCode = $("select[name='companyCode'] option:selected").attr('code'); | |
106 | + $.ajax({ | |
107 | + url: ctx + "receipt/receiptHeader/getwarehouse", | |
108 | + type: 'post', | |
109 | + data: {code: companyCode}, | |
110 | + success: function (response) { | |
111 | + if (response.code === 200) { | |
112 | + $("select[name='uWarehouseCode']").children().remove(); | |
113 | + $("select[name='uWarehouseCode']").append(`<option value="">所有</option>`); | |
114 | + for (let item of response.data) { | |
115 | + let option = `<option value="${item.uWarehouseCode}">${item.uWarehouseName}</option>`; | |
116 | + $("select[name='uWarehouseCode']").append(option); | |
117 | + } | |
118 | + } else { | |
119 | + $.modal.msgError(response.msg) | |
120 | + } | |
121 | + } | |
122 | + }) | |
123 | + }) | |
85 | 124 | }) |
86 | 125 | |
87 | 126 | </script> |
... | ... |