1
<!DOCTYPE HTML>
周鸿
authored
about a year ago
2
<html lang= "zh" xmlns:th= "http://www.thymeleaf.org" >
3
<meta charset= "utf-8" >
4
<head>
周鸿
authored
about a year ago
5
6
<th:block th:include= "include :: header" />
<th:block th:include= "include :: select2-css" />
7
</head>
8
<body class= "white-bg" >
9
10
11
12
13
<div class= "wrapper wrapper-content animated fadeInRight ibox-content" >
<form class= "form-horizontal m" id= "form-receiptDetail-add" >
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 入库单id:</label>
<div class= "col-sm-8" >
周鸿
authored
about a year ago
14
15
16
<input id= "receiptId" name= "receiptId" class= "form-control" type= "text" th:value= "${receiptId}"
readonly= "readonly" >
<input id= "companyCode" name= "companyCode" type= "hidden" th:value= "${companyCode}" >
17
18
19
20
21
</div>
</div>
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 入库单号:</label>
<div class= "col-sm-8" >
周鸿
authored
about a year ago
22
23
<input id= "receiptCode" name= "receiptCode" class= "form-control" type= "text" th:value= "${receiptCode}"
readonly= "readonly" >
24
25
</div>
</div>
26
27
28
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 上游系统行号:</label>
<div class= "col-sm-8" >
周鸿
authored
about a year ago
29
30
<input id= "sourceLine" name= "sourceLine" class= "form-control" type= "text"
onkeyup= " this.value=this.value.replace(/^\s+|\s+$/g,'')" >
31
32
</div>
</div>
33
34
35
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 物料编码:</label>
36
37
<div class= "col-sm-6" >
周鸿
authored
about a year ago
38
39
<input id= "materialCode" name= "materialCode" class= "form-control" type= "text"
onkeyup= " this.value=this.value.replace(/^\s+|\s+$/g,'')" autofocus >
40
41
</div>
42
<!--<a class="btn btn-primary btn-rounded " onclick="selectMaterial()">
43
选择物料
44
</a>-->
45
46
47
</div>
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 物料名称:</label>
48
<div class= "col-sm-8" >
周鸿
authored
about a year ago
49
<input id= "materialName" name= "materialName" class= "form-control" type= "text" readonly= "readonly" >
50
51
52
53
54
</div>
</div>
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 物料规格:</label>
<div class= "col-sm-8" >
周鸿
authored
about a year ago
55
<input id= "materialSpec" name= "materialSpec" class= "form-control" type= "text" readonly= "readonly" >
56
57
</div>
</div>
58
<!--<div class="form-group">
59
60
61
<label class="col-sm-3 control-label">物料单位:</label>
<div class="col-sm-8">
<input id="materialUnit" name="materialUnit" class="form-control" type="text" readonly="readonly">
62
</div>
63
64
65
66
67
68
</div>-->
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 库存数量:</label>
<div class= "col-sm-8" >
<input id= "inventoryQty" name= "inventoryQty" class= "form-control" type= "text" readonly >
</div>
69
</div>
周鸿
authored
about a year ago
70
<div class= "form-group qtyForm" >
71
<label class= "col-sm-3 control-label" > 数量:</label>
72
<div class= "col-sm-8" >
73
<input id= "qty" name= "qty" class= "form-control" type= "text" >
74
75
</div>
</div>
周鸿
authored
about a year ago
76
77
78
79
80
81
82
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 颜色:</label>
<div class= "col-sm-8" >
<input id= "color" name= "color" maxlength= "10" class= "form-control" type= "text" >
</div>
</div>
<!-- <span style="color: red;display:none;margin-left: 191px;" class="qtyClass" >*超出可收数量</span>-->
83
<!--<div class="form-group">-->
周鸿
authored
about a year ago
84
85
86
87
<!--<label class="col-sm-3 control-label">供应商编码:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="supplierCode" name="supplierCode" class="form-control" type="text">-->
<!--</div>-->
88
<!--</div>-->
89
<!--<div class="form-group">
90
91
92
93
94
<label class="col-sm-3 control-label">批次:</label>
<div class="col-sm-8">
<input id="batch" name="batch" class="form-control" type="text">
</div>
</div>
95
96
97
98
99
100
<div class="form-group">
<label class="col-sm-3 control-label">批号:</label>
<div class="col-sm-8">
<input id="lot" name="lot" class="form-control" type="text">
</div>
101
102
</div>-->
<!--<div class="form-group">
103
104
<label class="col-sm-3 control-label">项目号:</label>
<div class="col-sm-8">
105
<input id="projectNo" name="projectNo" class="form-control" type="text">
106
107
108
109
110
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否质检:</label>
<div class="col-sm-8">
111
112
113
114
<select id="qcCheck" name="qcCheck" class="form-control">
<option value="1">否</option>
<option value="0">是</option>
</select>
115
</div>
116
117
</div>-->
<!--<div class="form-group">
118
119
120
121
122
123
124
125
126
127
<label class="col-sm-3 control-label">生产日期:</label>
<div class="col-sm-8">
<input id="manufactureDate" name="manufactureDate" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">失效日期:</label>
<div class="col-sm-8">
<input id="expirationDate" name="expirationDate" class="form-control" type="text">
</div>
128
</div>-->
129
130
131
<div class= "form-group" >
<label class= "col-sm-3 control-label" > 库存状态:</label>
<div class= "col-sm-8" >
周鸿
authored
about a year ago
132
133
134
135
<select id= "inventorySts" name= "inventorySts" class= "form-control"
th:with= "inventoryStatus=${@dict.getType('inventorySts')}" >
<option th:each= "dict : ${inventoryStatus}" th:text= "${dict['dictLabel']}"
th:value= "${dict['dictValue']}" ></option>
136
137
138
</select>
</div>
</div>
139
<!--<div class="form-group">
140
141
<label class="col-sm-3 control-label">定位规则:</label>
<div class="col-sm-8">
142
<select id="locatingRule" name="locatingRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('locationRule')}">
143
144
145
<option value="">请选择</option>
<option th:each="item : ${list}" th:text="${item['description']}" th:value="${item['code']}"></option>
</select>
146
147
</div>
</div>
148
149
150
151
152
153
154
155
<div class="form-group">
<label class="col-sm-3 control-label">入库流程:</label>
<div class="col-sm-8">
<select id="statusFlowCode" name="statusFlowCode" class="form-control" th:with="statusFlowList=${@StatusFlow.flowList('receivingFlow')}">
<option value="">请选择</option>
<option th:each="flow : ${statusFlowList}" th:text="${flow['name']}" th:value="${flow['code']}"></option>
</select>
</div>
156
</div>-->
周鸿
authored
about a year ago
157
158
159
160
161
162
163
164
165
166
167
168
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">标价:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input id="itemListPrice" name="itemListPrice" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">净价:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input id="itemNetPrice" name="itemNetPrice" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!--<div class="form-group">-->
<!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="userDef1" name="userDef1" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label">自定义字段2:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="userDef2" name="userDef2" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group"> -->
<!--<label class="col-sm-3 control-label">自定义字段3:</label>-->
<!--<div class="col-sm-8">-->
<!--<input id="userDef3" name="userDef3" class="form-control" type="text">-->
<!--</div>-->
<!--</div>-->
<div class= "form-group" >
188
189
190
191
192
193
<label class= "col-sm-3 control-label" > 工作令号:</label>
<div class= "col-sm-8" >
<input id= "moCode" name= "moCode" class= "form-control" type= "text" >
</div>
</div>
<div class= "form-group" >
194
<div class= "form-control-static col-sm-offset-9" >
周鸿
authored
about a year ago
195
<button type= "submit" class= "btn btn-primary" > 提交</button>
196
<button onclick= "$.modal.close()" class= "btn btn-danger" type= "button" > 关闭</button>
197
198
199
200
</div>
</div>
</form>
</div>
周鸿
authored
about a year ago
201
202
<th:block th:include= "include :: footer" />
<th:block th:include= "include :: select2-js" />
203
204
<script type= "text/javascript" >
var prefix = ctx + "receipt/receiptDetail";
205
var prefix_material = ctx + "config/material"
206
var prefix_m = ctx + "shipment/shipmentDetail"
207
$("#form-receiptDetail-add").validate({
周鸿
authored
about a year ago
208
209
210
rules: {
receiptId: {
required: true
211
},
周鸿
authored
about a year ago
212
213
receiptCode: {
required: true
214
},
周鸿
authored
about a year ago
215
216
materialCode: {
required: true
217
},
周鸿
authored
about a year ago
218
219
qty: {
required: true,
220
number: true
221
}
222
},
周鸿
authored
about a year ago
223
submitHandler: function (form) {
224
$.ajax({
周鸿
authored
about a year ago
225
226
227
228
229
230
cache: true,
type: "POST",
url: prefix + "/add",
data: $("#form-receiptDetail-add").serializeArray(),
async: false,
error: function (request) {
231
232
$.modal.alertError("请求失败!");
},
周鸿
authored
about a year ago
233
success: function (data) {
234
// $.operate.saveSuccess(data);
235
236
237
238
debugger;
if (data.code == 200) {
$.modal.msgSuccess(data.msg);
window.parent.loadDetail();
239
} else {
240
$.modal.alertError(data.msg);
241
}
242
243
}
});
244
}
245
});
246
247
var receiptId = $("input[name='receiptId']").val();
var receiptCode = $("input[name='receiptCode']").val();
周鸿
authored
about a year ago
248
249
250
251
252
253
function ajaxSuccess(result) {
if (result.code == web_status.SUCCESS) {
$.modal.msgSuccess(result.msg);
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
周鸿
authored
about a year ago
254
window.parent.loadDetail(receiptId, receiptCode);
255
256
257
258
259
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
}
周鸿
authored
about a year ago
260
261
262
263
264
265
266
267
268
269
270
271
272
// $("#qty").blur(
// function () {
// var qty= $("input[name='qty']").val();
// if(qty > 10){
// $(".qtyClass").css("display","block")
// $(".qtyForm").css("margin-bottom","0px");
// }else {
// $(".qtyClass").css("display","none")
// $(".qtyForm").css("margin-bottom","15px");
// }
// }
// );
273
$(function () {
周鸿
authored
about a year ago
274
layui.use('laydate', function () {
275
var laydate = layui.laydate;
周鸿
authored
about a year ago
276
277
laydate.render({elem: '#manufactureDate', theme: 'molv', format: 'yyyy-MM-dd HH:mm:ss'});
laydate.render({elem: '#expirationDate', theme: 'molv', format: 'yyyy-MM-dd HH:mm:ss'});
278
});
279
//物料input
周鸿
authored
about a year ago
280
$("#materialCode").bind('input propertychange keypress', function (e) {
281
282
283
284
285
286
287
288
289
let theEvent = e || window.event;
let code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code === 13) {
e.preventDefault();
//回车执行查询
getMaterail()
}
});
/*$('#materialCode').select2({
290
291
292
293
294
295
296
297
298
299
300
ajax: {
url: ctx+'config/material/getData',
dataType: 'json',
type: 'post',
data: function (params) {
let query = {
materialName: params.term,
}
return query;
}
}
301
});*/
302
});
周鸿
authored
about a year ago
303
304
305
306
307
308
309
310
311
312
313
314
function getMaterail() {
let materialCode = $("#materialCode").val();
if (materialCode) {
$.ajax({
url: prefix_m + '/getMaterial',
type: 'post',
data: {
materialCode: materialCode,
companyCode: $("input[name='companyCode']").val(),
},
success: function (res) {
周鸿
authored
about a year ago
315
if (res.code === 200) {
316
317
318
319
320
321
322
323
324
// $("#barCode").val(res.data.barCode);
$("#materialName").val(res.data.materialName);
$("#materialSpec").val(res.data.materialSpec);
$("#inventoryQty").val(res.data.inventoryQty);
}
}
})
}
}
周鸿
authored
about a year ago
325
326
327
/* 选择物料 */
function selectMaterial() {
周鸿
authored
about a year ago
328
var url = prefix_material + '/materialSelect';
329
330
$.modal.open("选择物料", url);
}
331
</script>
332
333
</body>
</html>