|
@@ -35,18 +35,18 @@
|
35
|
35
|
<option value="">品牌</option>
|
36
|
36
|
</select>
|
37
|
37
|
</div>
|
38
|
|
- <div class="layui-input-inline" style="width: 200px;">
|
|
38
|
+<#-- <div class="layui-input-inline" style="width: 200px;">
|
39
|
39
|
<select name="materialGroup" id ="materialGroup" class="county-selector" data-value="物料组" lay-filter="materialGroup" lay-search="">
|
40
|
40
|
<option value="">物料组</option>
|
41
|
41
|
</select>
|
42
|
|
- </div>
|
|
42
|
+ </div>-->
|
43
|
43
|
<div class="layui-input-inline" style="width: 400px;">
|
44
|
|
- <select name="materialdetil" id ="materialdetil" class="county-selector" data-value="物料描述" lay-filter="materialdetil">
|
45
|
|
- <option value="">物料描述</option>
|
|
44
|
+ <select name="productName" id ="productName" class="county-selector" data-value="物料描述" lay-filter="productName">
|
|
45
|
+<#-- <option value="">物料描述</option>-->
|
46
|
46
|
</select>
|
47
|
47
|
</div>
|
48
|
48
|
<div class="layui-input-inline" style="width: 200px;">
|
49
|
|
- <select name="materialCode" id ="materialCode" class="county-selector" data-value="物料编码" lay-filter="materialCode">
|
|
49
|
+ <select name="productCode" id ="productCode" class="county-selector" data-value="物料编码" lay-filter="productCode">
|
50
|
50
|
<option value="">物料编码</option>
|
51
|
51
|
</select>
|
52
|
52
|
</div>
|
|
@@ -70,40 +70,29 @@
|
70
|
70
|
<thead style="align: center">
|
71
|
71
|
<tr style="align: center">
|
72
|
72
|
<th style = "width: 200px"> 操作</th>
|
73
|
|
- <th style = "width: 200px"> 镜片位置</th>
|
74
|
|
- <th style = "width: 200px"> 采购/退货</th>
|
75
|
|
- <th style = "width: 200px"> 用户名</th>
|
76
|
73
|
<th style = "width: 300px"> 物料编码</th>
|
77
|
|
- <th style = "width: 800px"> 物料描述</th>
|
78
|
|
- <th style = "width: 300px"> 物料价格</th>
|
79
|
|
- <th style = "width: 300px"> 数量</th>
|
80
|
|
- <th style = "width: 300px"> 球镜</th>
|
81
|
|
- <th style = "width: 300px"> 柱镜</th>
|
82
|
|
- <th style = "width: 300px"> 轴位</th>
|
83
|
|
- <th style = "width: 300px"> 瞳距</th>
|
84
|
|
- <th style = "width: 300px"> 瞳高</th>
|
85
|
|
- <th style = "width: 300px"> 下加光</th>
|
86
|
|
- <th style = "width: 300px"> 通道</th>
|
87
|
|
- <th style = "width: 300px"> 棱镜</th>
|
88
|
|
- <th style = "width: 300px"> 镜片度数</th>
|
89
|
|
- <th style = "width: 300px"> 镜片型号/基弧</th>
|
90
|
|
- <th style = "width: 300px"> 是否染色</th>
|
91
|
|
- <th style = "width: 300px"> 色度</th>
|
92
|
|
- <th style = "width: 300px"> 来板染色</th>
|
93
|
|
- <th style = "width: 300px"> 厂家色板</th>
|
94
|
|
- <th style = "width: 300px"> 标准色号</th>
|
95
|
|
- <th style = "width: 300px"> 美薄加工</th>
|
96
|
|
- <th style = "width: 300px"> 丽薄加工</th>
|
97
|
|
- <th style = "width: 300px"> 镜架框形</th>
|
98
|
|
- <th style = "width: 300px"> 镜架高度</th>
|
99
|
|
- <th style = "width: 300px"> 鼻梁间距</th>
|
100
|
|
- <th style = "width: 300px"> 水平宽度</th>
|
101
|
|
- <th style = "width: 300px"> 加工镜架框形</th>
|
102
|
|
- <th style = "width: 300px"> 颜色</th>
|
103
|
|
- <th style = "width: 300px"> 直径</th>
|
104
|
|
- <th style = "width: 300px"> 片型</th>
|
105
|
|
- <th style = "width: 300px"> 片色</th>
|
|
74
|
+ <th style = "width: 500px"> 物料描述</th>
|
|
75
|
+ <th style = "width: 100px"> 颜色</th>
|
|
76
|
+ <th style = "width: 200px"> 镜片位置</th>
|
|
77
|
+ <th style = "width: 150px"> 球镜</th>
|
|
78
|
+ <th style = "width: 150px"> 柱镜</th>
|
|
79
|
+ <th style = "width: 150px"> 轴位</th>
|
|
80
|
+ <th style = "width: 150px"> 通道</th>
|
|
81
|
+ <th style = "width: 150px"> 下加光</th>
|
106
|
82
|
<th style = "width: 300px">备注</th>
|
|
83
|
+ <th style = "width: 150px"> 零售价格</th>
|
|
84
|
+ <th style = "width: 300px"> 光度范围</th>
|
|
85
|
+ <th style = "width: 150px"> 光度说明</th>
|
|
86
|
+ <th style = "width: 150px"> 单眼瞳距</th>
|
|
87
|
+ <th style = "width: 150px"> 单眼瞳高</th>
|
|
88
|
+ <th style = "width: 150px"> 镜眼间距</th>
|
|
89
|
+ <th style = "width: 150px"> 前倾角</th>
|
|
90
|
+ <th style = "width: 150px"> 镜架面弯</th>
|
|
91
|
+ <th style = "width: 150px"> 习惯阅读距离</th>
|
|
92
|
+ <th style = "width: 150px"> 近用瞳距</th>
|
|
93
|
+ <th style = "width: 150px"> NVB</th>
|
|
94
|
+ <th style = "width: 75px"> 主视眼</th>
|
|
95
|
+ <th style = "width: 150px"> ERCD</th>
|
107
|
96
|
</tr>
|
108
|
97
|
</thead>
|
109
|
98
|
<tbody style="text-align: center">
|
|
@@ -126,7 +115,7 @@
|
126
|
115
|
form.render();
|
127
|
116
|
});
|
128
|
117
|
layui.use(['form', 'table', "laydate", 'layer','jquery'], function () {
|
129
|
|
- var materialdetil=null;
|
|
118
|
+ var productName=null;
|
130
|
119
|
var material=null;
|
131
|
120
|
var form = layui.form;
|
132
|
121
|
var table = layui.table;
|
|
@@ -138,17 +127,17 @@
|
138
|
127
|
success: function (data) {
|
139
|
128
|
$("#materialType").empty();
|
140
|
129
|
$.each($.parseJSON(data), function(idx, obj) {
|
141
|
|
- $("#materialType").append("<option value=\""+obj.varietyId+"\">"+obj.variety+"</option>");
|
142
|
|
- });
|
|
130
|
+ $("#materialType").append("<option value=\""+obj.varietyId+"\" data-variety=\""+obj.variety+"\">"+obj.variety+"</option>"); });
|
143
|
131
|
layui.form.render("select");
|
144
|
132
|
},error:function (xhr, status, error) {
|
145
|
133
|
layer.alert('请求失败: ' + error);
|
146
|
134
|
}});
|
147
|
135
|
form.on('select(materialType)', function(data){
|
|
136
|
+ var variety = $(data.elem).find("option:selected").text();
|
148
|
137
|
$.ajax({
|
149
|
138
|
url: 'varietyDetailsLists',
|
150
|
139
|
type: 'post',
|
151
|
|
- data:{'id':data.value},
|
|
140
|
+ data:{'variety':variety},
|
152
|
141
|
success: function (data) {
|
153
|
142
|
$("#brand").empty();
|
154
|
143
|
$("#brand").append('<option value="">品牌</option>');
|
|
@@ -161,7 +150,7 @@
|
161
|
150
|
layer.alert('请求失败: ' + error);
|
162
|
151
|
}});
|
163
|
152
|
});
|
164
|
|
- form.on('select(brand)', function(data){
|
|
153
|
+/* form.on('select(brand)', function(data){
|
165
|
154
|
$.ajax({
|
166
|
155
|
url: 'group',
|
167
|
156
|
type: 'post',
|
|
@@ -177,17 +166,23 @@
|
177
|
166
|
},error:function (xhr, status, error) {
|
178
|
167
|
layer.alert('请求失败: ' + error);
|
179
|
168
|
}});
|
180
|
|
- });
|
181
|
|
- form.on('select(materialGroup)', function(data){
|
|
169
|
+ });*/
|
|
170
|
+ form.on('select(brand)', function(data){
|
182
|
171
|
$.ajax({
|
183
|
|
- url: 'price',
|
|
172
|
+ url: 'productionheader',
|
184
|
173
|
type: 'post',
|
185
|
|
- data:{'group':data.value},
|
|
174
|
+ data:{'id':data.value},
|
186
|
175
|
success: function (data) {
|
187
|
|
- $("#materialdetil").empty();
|
188
|
|
- $("#materialdetil").append('<option value="">物料描述</option>');
|
|
176
|
+ layer.alert('请求失败: ' + data);
|
|
177
|
+ $("#productName").empty();$("#productCode").empty();$("#varietyDetailId").empty();
|
|
178
|
+
|
|
179
|
+ // $("#productName").append('<option value="">物料描述</option>');
|
189
|
180
|
$.each($.parseJSON(data), function(idx, obj) {
|
190
|
|
- $("#materialdetil").append("<option value=\""+obj.materialCode+"\">"+obj.materialName+"</option>");
|
|
181
|
+ $("#productName").append("<option value=\""+obj.productName+"\" data-variety-detail-id=\""+obj.varietyDetailId+"\">"+obj.productName+"</option>");
|
|
182
|
+ $("#productCode").append("<option value=\""+obj.productCode+"\" data-variety-detail-id=\""+obj.varietyDetailId+"\">"+obj.productCode+"</option>");
|
|
183
|
+
|
|
184
|
+ /*$("#productName").append("<option value=\""+obj.productName+"\">"+obj.productName+"</option>");
|
|
185
|
+ $("#productCode").append("<option value=\""+obj.productCode+"\">"+obj.productCode+"</option>");*/
|
191
|
186
|
});
|
192
|
187
|
layui.form.render("select");
|
193
|
188
|
},error:function (xhr, status, error) {
|
|
@@ -201,7 +196,7 @@
|
201
|
196
|
type: 'post',
|
202
|
197
|
data:{'code':data.value},
|
203
|
198
|
success: function (data) {
|
204
|
|
- $("#materialCode").empty();
|
|
199
|
+ $("#materialCode").empty();$("#materialdetil").empty();
|
205
|
200
|
$("#materialRealPrice").empty();
|
206
|
201
|
$.each($.parseJSON(data), function(idx, obj) {
|
207
|
202
|
$("#materialCode").append("<option value=\""+obj.materialCode+"\">"+obj.materialCode+"</option>");
|
|
@@ -215,52 +210,74 @@
|
215
|
210
|
|
216
|
211
|
//因为动态添加的元素class属性是无效的,所以不能用$('.add').click(function(){});
|
217
|
212
|
window.addtable= function(){
|
|
213
|
+ var selectedVarietyDetailId = $('#productName option:selected').data('variety-detail-id') ||
|
|
214
|
+ $('#productCode option:selected').data('variety-detail-id');
|
|
215
|
+ layer.alert(selectedVarietyDetailId);
|
|
216
|
+ $.ajax({
|
|
217
|
+ url: 'selectColour',
|
|
218
|
+ type: 'post',
|
|
219
|
+ data:{'id':selectedVarietyDetailId},
|
|
220
|
+ success: function (data) {
|
|
221
|
+ $("#colour").empty();
|
|
222
|
+ $("#colour").append('<option value="">颜色</option>');
|
|
223
|
+ $.each($.parseJSON(data), function(idx, obj) {
|
|
224
|
+ $("#colour").append("<option value=\""+obj.id+"\">"+obj.colour+"</option>");
|
|
225
|
+ });
|
|
226
|
+
|
|
227
|
+ layui.form.render("select");
|
|
228
|
+ },error:function (xhr, status, error) {
|
|
229
|
+ layer.alert('请求失败: ' + error);
|
|
230
|
+ }});
|
|
231
|
+ $.ajax({
|
|
232
|
+ url: 'productionheader',
|
|
233
|
+ type: 'post',
|
|
234
|
+ data:{'id':selectedVarietyDetailId},
|
|
235
|
+ success: function (data) {
|
|
236
|
+ layer.alert('请求失败: ' + data);
|
|
237
|
+ $("#productName").empty();$("#productCode").empty();$("#varietyDetailId").empty();
|
|
238
|
+
|
|
239
|
+ $.each($.parseJSON(data), function(idx, obj) {
|
|
240
|
+ $("#productName").append("<option value=\""+obj.productName+"\" data-variety-detail-id=\""+obj.varietyDetailId+"\">"+obj.productName+"</option>");
|
|
241
|
+ $("#productCode").append("<option value=\""+obj.productCode+"\" data-variety-detail-id=\""+obj.varietyDetailId+"\">"+obj.productCode+"</option>");
|
|
242
|
+
|
|
243
|
+ });
|
|
244
|
+ layui.form.render("select");
|
|
245
|
+ },error:function (xhr, status, error) {
|
|
246
|
+ layer.alert('请求失败: ' + error);
|
|
247
|
+ }});
|
218
|
248
|
var html = '<tr>'+
|
219
|
249
|
'<td style = "width: 100px"><input type="button" class="layui-btn layui-btn-radius" onclick="dele(this)" value="删除" /></td>'+
|
|
250
|
+ '<td style = "width: 200px"> <input type="text" name="materialCode" required lay-verify="required" placeholder="物料编码" autocomplete="off" class="layui-input" readonly="true" value="'+ $('#productCode option:selected').text()+'"/></td>'+
|
|
251
|
+ '<td style = "width: 500px"> <input type="text" name="materialDetile" required lay-verify="required" placeholder="物料描述" autocomplete="off" class="layui-input" readonly="true" value="'+$('#productName option:selected').text()+'"/></td>'+
|
|
252
|
+ '<td style = "width: 100px">' +
|
|
253
|
+ '<select name="colour" id ="colour" class="county-selector" placeholder="颜色" lay-filter="productName">'+
|
|
254
|
+ '</select></td>'+
|
220
|
255
|
'<td style="width:200px">'+
|
221
|
256
|
'<select name="WZ" lay-verify="required">'+
|
222
|
257
|
'<option value="">--请选择--</option>'+
|
223
|
258
|
'<option value="L">L</option>'+
|
224
|
259
|
'<option value="R">R</option>'+
|
225
|
260
|
'</select></td>'+
|
226
|
|
- '<td style="width:300px">'+
|
227
|
|
- '<select name="LY" lay-verify="required">'+
|
228
|
|
- '<option value="">--请选择--</option>'+
|
229
|
|
- '<option value="C">采购</option>'+
|
230
|
|
- '<option value="T">退货</option>'+
|
231
|
|
- '</select></td>'+
|
232
|
|
- '<td style = "width: 200px"> <input type="text" name="username" required lay-verify="required" placeholder="用户名字" autocomplete="off" class="layui-input" readonly="true" value="${currentUser.userName!}"+"/></td>'+
|
233
|
|
- '<td style = "width: 200px"> <input type="text" name="materialCode" required lay-verify="required" placeholder="物料编码" autocomplete="off" class="layui-input" readonly="true" value="'+ $('#materialCode option:selected').text()+'"/></td>'+
|
234
|
|
- '<td style = "width: 800px"> <input type="text" name="materialDetile" required lay-verify="required" placeholder="物料描述" autocomplete="off" class="layui-input" readonly="true" value="'+$('#materialdetil option:selected').text()+'"/></td>'+
|
235
|
|
- '<td style = "width: 200px"> <input type="text" name="price" required lay-verify="required" placeholder="价格" autocomplete="off" class="layui-input" readonly="true" value="'+$('#materialRealPrice option:selected').text()+'"/></td>'+
|
236
|
|
- '<td style = "width: 100px"> <input type="text" name="NUM" required lay-verify="required" placeholder="数量" autocomplete="off" class="layui-input" value ="1"/></td>'+
|
237
|
|
- '<td style = "width: 300px"> <input type="text" name="SPH" placeholder="球镜" autocomplete="off" class="layui-input"></td>'+
|
238
|
|
- '<td style = "width: 300px"> <input type="text" name="CYL" placeholder="柱镜" autocomplete="off" class="layui-input"></td>'+
|
239
|
|
- '<td style = "width: 300px"> <input type="text" name="AXIS" placeholder="轴位" autocomplete="off" class="layui-input"></td>'+
|
240
|
|
- '<td style = "width: 300px"> <input type="text" name="PDFOD" placeholder="瞳距" autocomplete="off" class="layui-input"></td>'+
|
241
|
|
- '<td style = "width: 300px"> <input type="text" name="PH" placeholder="瞳高" autocomplete="off" class="layui-input"></td>'+
|
242
|
|
- '<td style = "width: 300px"> <input type="text" name="XADD" placeholder="下加光" autocomplete="off" class="layui-input"></td>'+
|
243
|
|
- '<td style = "width: 300px"> <input type="text" name="YULIU1" placeholder="通道" autocomplete="off" class="layui-input"></td>'+
|
244
|
|
- '<td style = "width: 300px"> <input type="text" name="PRISM" placeholder="棱镜" autocomplete="off" class="layui-input"></td>'+
|
245
|
|
- '<td style = "width: 300px"> <input type="text" name="CVA" placeholder="镜片度数" autocomplete="off" class="layui-input"></td>'+
|
246
|
|
- '<td style = "width: 300px"> <input type="text" name="OPTICBC" placeholder="镜片型号/基弧" autocomplete="off" class="layui-input"></td>'+
|
247
|
|
- '<td style = "width: 300px"> <input type="text" name="RS" placeholder="是否染色" autocomplete="off" class="layui-input"></td>'+
|
248
|
|
- '<td style = "width: 300px"> <input type="text" name="SD" placeholder="色度" autocomplete="off" class="layui-input"></td>'+
|
249
|
|
- '<td style = "width: 300px"> <input type="text" name="LRS" placeholder="来板染色" autocomplete="off" class="layui-input"></td>'+
|
250
|
|
- '<td style = "width: 300px"> <input type="text" name="CRS" placeholder="厂家色板" autocomplete="off" class="layui-input"></td>'+
|
251
|
|
- '<td style = "width: 300px"> <input type="text" name="BRS" placeholder="标准色号" autocomplete="off" class="layui-input"></td>'+
|
252
|
|
- '<td style = "width: 300px"> <input type="text" name="MPRO" placeholder="美薄加工" autocomplete="off" class="layui-input"></td>'+
|
253
|
|
- '<td style = "width: 300px"> <input type="text" name="LBPO" placeholder="丽薄加工" autocomplete="off" class="layui-input"></td>'+
|
254
|
|
- '<td style = "width: 300px"> <input type="text" name="FRAMESHAPE" placeholder="镜架框形" autocomplete="off" class="layui-input"></td>'+
|
255
|
|
- '<td style = "width: 300px"> <input type="text" name="FRAMEHEIGHT" placeholder="镜架高度" autocomplete="off" class="layui-input"></td>'+
|
256
|
|
- '<td style = "width: 300px"> <input type="text" name="FRAMEBRIDGEWIDTH" placeholder="鼻梁间距" autocomplete="off" class="layui-input"></td>'+
|
257
|
|
- '<td style = "width: 300px"> <input type="text" name="SPK" placeholder="水平宽度" autocomplete="off" class="layui-input"></td>'+
|
258
|
|
- '<td style = "width: 300px"> <input type="text" name="JFRAMESHAPE" placeholder="加工镜架框形" autocomplete="off" class="layui-input"></td>'+
|
259
|
|
- '<td style = "width: 300px"> <input type="text" name="COLOR" placeholder="颜色" autocomplete="off" class="layui-input"></td>'+
|
260
|
|
- '<td style = "width: 300px"> <input type="text" name="lEN_DIAMETER" placeholder="直径" autocomplete="off" class="layui-input"></td>'+
|
261
|
|
- '<td style = "width: 300px"> <input type="text" name="PX" placeholder="片型" autocomplete="off" class="layui-input"></td>'+
|
262
|
|
- '<td style = "width: 300px"> <input type="text" name="PS" placeholder="片色" autocomplete="off" class="layui-input"></td>'+
|
|
261
|
+ '<td style = "width: 150px"> <input type="text" name="SPH" placeholder="球镜" autocomplete="off" class="layui-input"></td>'+
|
|
262
|
+ '<td style = "width: 150px"> <input type="text" name="CYL" placeholder="柱镜" autocomplete="off" class="layui-input"></td>'+
|
|
263
|
+ '<td style = "width: 150px"> <input type="text" name="AXIS" placeholder="轴位" autocomplete="off" class="layui-input"></td>'+
|
|
264
|
+ '<td style = "width: 150"> <input type="text" name="YULIU1" placeholder="通道" autocomplete="off" class="layui-input"></td>'+
|
|
265
|
+ '<td style = "width: 150px"> <input type="text" name="XADD" placeholder="下加光" autocomplete="off" class="layui-input"></td>'+
|
263
|
266
|
'<td style = "width: 300px"> <input type="text" name="MARK" placeholder="备注" autocomplete="off" class="layui-input"></td>'+
|
|
267
|
+ '<td style = "width: 150px"> <input type="text" name="NUM" required lay-verify="required" placeholder="零售价" autocomplete="off" class="layui-input" /></td>'+
|
|
268
|
+ '<td style = "width: 300px"> <input type="text" name="CVA" placeholder="光度范围" autocomplete="off" class="layui-input"></td>'+
|
|
269
|
+ '<td style = "width: 150px"> <input type="text" name="SD" placeholder="光度说明" autocomplete="off" class="layui-input"></td>'+
|
|
270
|
+ '<td style = "width: 150px"> <input type="text" name="PDFOD" placeholder="单眼瞳距" autocomplete="off" class="layui-input"></td>'+
|
|
271
|
+ '<td style = "width: 150px"> <input type="text" name="PH" placeholder="单眼瞳高" autocomplete="off" class="layui-input"></td>'+
|
|
272
|
+ '<td style = "width: 150px"> <input type="text" name="FRAMEBRIDGEWIDTH" placeholder="镜眼距离" autocomplete="off" class="layui-input"></td>'+
|
|
273
|
+ '<td style = "width: 150px"> <input type="text" name="OPTICBC" placeholder="前倾角" autocomplete="off" class="layui-input"></td>'+
|
|
274
|
+ '<td style = "width: 150px"> <input type="text" name="FRAMESHAPE" placeholder="镜架面弯" autocomplete="off" class="layui-input"></td>'+
|
|
275
|
+ '<td style = "width: 150px"> <input type="text" name="FRAMEHEIGHT" placeholder="习惯阅读距离" autocomplete="off" class="layui-input"></td>'+
|
|
276
|
+ '<td style = "width: 150px"> <input type="text" name="PRISM" placeholder="近用瞳距" autocomplete="off" class="layui-input"></td>'+
|
|
277
|
+ '<td style = "width: 150px"> <input type="text" name="RS" placeholder="NVB" autocomplete="off" class="layui-input"></td>'+
|
|
278
|
+ '<td style = "width: 75px"> <input type="text" name="LRS" placeholder="主视眼" autocomplete="off" class="layui-input"></td>'+
|
|
279
|
+ '<td style = "width: 150px"> <input type="text" name="CRS" placeholder="ERCD" autocomplete="off" class="layui-input"></td>'+
|
|
280
|
+
|
264
|
281
|
'</tr>';
|
265
|
282
|
//添加到表格最后
|
266
|
283
|
$(html).appendTo($('#table tbody:last'));
|