|
@@ -12,164 +12,97 @@
|
12
|
12
|
<link rel="icon" href="${basePath!}/static/logo.png">
|
13
|
13
|
<link rel="stylesheet" href="${basePath!}/static/layui/css/layui.css" media="all" />
|
14
|
14
|
<link rel="stylesheet" href="${basePath!}/static/css/public.css" media="all" />
|
15
|
|
- <!-- 保留一个layui脚本引用即可 -->
|
|
15
|
+ <script src="${basePath!}/static/layui/layui.js" charset="utf-8"></script>
|
16
|
16
|
<script src="${basePath!}/static/layui/layui.all.js" charset="utf-8"></script>
|
|
17
|
+ <script src="${basePath!}/static/layui/lay/modules/jquery.js"></script>
|
17
|
18
|
</head>
|
18
|
19
|
<body>
|
19
|
20
|
<hr>
|
20
|
|
-
|
21
|
|
-<!-- 订单信息区域 -->
|
22
|
21
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
|
23
|
22
|
<legend>订单信息</legend>
|
24
|
|
-
|
25
|
|
- <!-- 物料选择表单 -->
|
26
|
|
- <div class="layui-form material-selection-form">
|
27
|
|
- <div class="form-container">
|
|
23
|
+ <div class="layui-form" style="width: 100%; margin-top: 20px;">
|
|
24
|
+ <center>
|
28
|
25
|
<form class="layui-form" action="">
|
29
|
26
|
<div class="layui-form-item" id="materialchoose">
|
30
|
|
- <label class="layui-form-label">物料信息</label>
|
31
|
|
-
|
32
|
|
- <div class="material-selection-group">
|
33
|
|
- <div class="layui-input-inline select-item">
|
34
|
|
- <select name="materialType"
|
35
|
|
- id="materialType"
|
36
|
|
- class="province-selector"
|
37
|
|
- data-value="品类"
|
38
|
|
- lay-filter="materialType"
|
39
|
|
- lay-search="">
|
40
|
|
- <option value="">品类</option>
|
41
|
|
- </select>
|
42
|
|
- </div>
|
43
|
|
-
|
44
|
|
- <div class="layui-input-inline select-item">
|
45
|
|
- <select name="brand"
|
46
|
|
- id="brand"
|
47
|
|
- class="city-selector"
|
48
|
|
- data-value="品牌"
|
49
|
|
- lay-filter="brand"
|
50
|
|
- lay-search="">
|
51
|
|
- <option value="">品牌</option>
|
52
|
|
- </select>
|
53
|
|
- </div>
|
54
|
|
-
|
55
|
|
- <div class="layui-input-inline select-item">
|
56
|
|
- <select name="materialGroup"
|
57
|
|
- id="materialGroup"
|
58
|
|
- class="county-selector"
|
59
|
|
- data-value="物料组"
|
60
|
|
- lay-filter="materialGroup"
|
61
|
|
- lay-search="">
|
62
|
|
- <option value="">物料组</option>
|
63
|
|
- </select>
|
64
|
|
- </div>
|
65
|
|
-
|
66
|
|
- <div class="layui-input-inline select-item">
|
67
|
|
- <select name="materialdetil"
|
68
|
|
- id="materialdetil"
|
69
|
|
- class="county-selector"
|
70
|
|
- data-value="物料描述"
|
71
|
|
- lay-filter="materialdetil">
|
72
|
|
- <option value="">物料描述</option>
|
73
|
|
- </select>
|
74
|
|
- </div>
|
75
|
|
-
|
76
|
|
- <div class="layui-input-inline select-item">
|
77
|
|
- <select name="materialCode"
|
78
|
|
- id="materialCode"
|
79
|
|
- class="county-selector"
|
80
|
|
- data-value="物料编码"
|
81
|
|
- lay-filter="materialCode">
|
82
|
|
- <option value="">物料编码</option>
|
83
|
|
- </select>
|
84
|
|
- </div>
|
85
|
|
-
|
86
|
|
- <div class="layui-input-inline action-item">
|
87
|
|
- <button type="button"
|
88
|
|
- class="layui-btn layui-btn-primary"
|
89
|
|
- onclick="addtable()">
|
90
|
|
- <i class="layui-icon layui-icon-add-circle"></i>添加
|
91
|
|
- </button>
|
92
|
|
- </div>
|
|
27
|
+ <div class="layui-form-label">物料信息</div>
|
|
28
|
+ <div class="layui-input-inline" style="width: 300px;">
|
|
29
|
+ <select name="materialType" id="materialType" class="province-selector" data-value="品类" lay-filter="materialType" onclick="dele()" lay-search="">
|
|
30
|
+ <option value="">品类</option>
|
|
31
|
+ </select>
|
|
32
|
+ </div>
|
|
33
|
+ <div class="layui-input-inline" style="width: 300px;">
|
|
34
|
+ <select name="brand" id ="brand" class="city-selector" data-value="品牌" lay-filter="brand" onclick="selectbrand()" lay-search="">
|
|
35
|
+ <option value="">品牌</option>
|
|
36
|
+ </select>
|
|
37
|
+ </div>
|
|
38
|
+<#-- <div class="layui-input-inline" style="width: 200px;">
|
|
39
|
+ <select name="materialGroup" id ="materialGroup" class="county-selector" data-value="物料组" lay-filter="materialGroup" lay-search="">
|
|
40
|
+ <option value="">物料组</option>
|
|
41
|
+ </select>
|
|
42
|
+ </div>-->
|
|
43
|
+ <div class="layui-input-inline" style="width: 400px;">
|
|
44
|
+ <select name="productName" id ="productName" class="county-selector" data-value="物料描述" lay-filter="productName">
|
|
45
|
+<#-- <option value="">物料描述</option>-->
|
|
46
|
+ </select>
|
|
47
|
+ </div>
|
|
48
|
+ <div class="layui-input-inline" style="width: 200px;">
|
|
49
|
+ <select name="productCode" id ="productCode" class="county-selector" data-value="物料编码" lay-filter="productCode">
|
|
50
|
+ <option value="">物料编码</option>
|
|
51
|
+ </select>
|
|
52
|
+ </div>
|
|
53
|
+ <div class="layui-input-inline" style="width: 100px;">
|
|
54
|
+ <a class="layui-btn layui-btn add" onclick="addtable()">添加</a>
|
93
|
55
|
</div>
|
94
|
56
|
</div>
|
95
|
57
|
</form>
|
96
|
|
- </div>
|
|
58
|
+ </center>
|
97
|
59
|
</div>
|
98
|
60
|
|
99
|
|
- <!-- 订单数据表格 -->
|
100
|
|
- <form class="layui-form order-form" method="post">
|
101
|
|
- <div class="layui-form-item table-container">
|
102
|
|
- <div class="table-wrapper">
|
103
|
|
- <table class="layui-table order-table"
|
104
|
|
- id="table"
|
105
|
|
- lay-filter="table">
|
|
61
|
+ <form class="layui-form" method="post" >
|
|
62
|
+ <div class="layui-form-item" style="width:5000px;">
|
|
63
|
+ <center>
|
|
64
|
+ <table class="layui-table" style ="width:5000px; overflow:scroll;" id="table" lay-filter="table" border="1">
|
106
|
65
|
<colgroup>
|
107
|
66
|
<col width="150">
|
108
|
67
|
<col width="200">
|
109
|
68
|
<col>
|
110
|
69
|
</colgroup>
|
111
|
|
-
|
112
|
|
- <thead>
|
113
|
|
- <tr>
|
114
|
|
- <th style="width: 200px">操作</th>
|
115
|
|
- <th style="width: 200px">镜片位置</th>
|
116
|
|
- <th style="width: 200px">采购/退货</th>
|
117
|
|
- <th style="width: 200px">用户名</th>
|
118
|
|
- <th style="width: 300px">物料编码</th>
|
119
|
|
- <th style="width: 800px">物料描述</th>
|
120
|
|
- <th style="width: 300px">物料价格</th>
|
121
|
|
- <th style="width: 300px">数量</th>
|
122
|
|
- <th style="width: 300px">球镜</th>
|
123
|
|
- <th style="width: 300px">柱镜</th>
|
124
|
|
- <th style="width: 300px">轴位</th>
|
125
|
|
- <th style="width: 300px">瞳距</th>
|
126
|
|
- <th style="width: 300px">瞳高</th>
|
127
|
|
- <th style="width: 300px">下加光</th>
|
128
|
|
- <th style="width: 300px">通道</th>
|
129
|
|
- <th style="width: 300px">棱镜</th>
|
130
|
|
- <th style="width: 300px">镜片度数</th>
|
131
|
|
- <th style="width: 300px">镜片型号/基弧</th>
|
132
|
|
- <th style="width: 300px">是否染色</th>
|
133
|
|
- <th style="width: 300px">色度</th>
|
134
|
|
- <th style="width: 300px">来板染色</th>
|
135
|
|
- <th style="width: 300px">厂家色板</th>
|
136
|
|
- <th style="width: 300px">标准色号</th>
|
137
|
|
- <th style="width: 300px">美薄加工</th>
|
138
|
|
- <th style="width: 300px">丽薄加工</th>
|
139
|
|
- <th style="width: 300px">镜架框形</th>
|
140
|
|
- <th style="width: 300px">镜架高度</th>
|
141
|
|
- <th style="width: 300px">鼻梁间距</th>
|
142
|
|
- <th style="width: 300px">水平宽度</th>
|
143
|
|
- <th style="width: 300px">加工镜架框形</th>
|
144
|
|
- <th style="width: 300px">颜色</th>
|
145
|
|
- <th style="width: 300px">直径</th>
|
146
|
|
- <th style="width: 300px">片型</th>
|
147
|
|
- <th style="width: 300px">片色</th>
|
148
|
|
- <th style="width: 300px">备注</th>
|
|
70
|
+ <thead style="align: center">
|
|
71
|
+ <tr style="align: center">
|
|
72
|
+ <th style = "width: 200px"> 操作</th>
|
|
73
|
+ <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>
|
|
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>
|
149
|
96
|
</tr>
|
150
|
97
|
</thead>
|
151
|
|
-
|
152
|
98
|
<tbody style="text-align: center">
|
153
|
|
- <!-- 动态数据行将在此处添加 -->
|
154
|
99
|
</tbody>
|
155
|
100
|
</table>
|
156
|
|
- </div>
|
157
|
|
-
|
158
|
|
- <!-- 表单操作按钮 -->
|
159
|
|
- <div class="layui-form-item form-actions">
|
|
101
|
+ </center>
|
|
102
|
+ <div class="layui-form-item">
|
160
|
103
|
<div class="layui-input-block">
|
161
|
|
- <button type="button"
|
162
|
|
- class="layui-btn"
|
163
|
|
- lay-submit
|
164
|
|
- lay-filter="formDemo"
|
165
|
|
- onclick="adddata(); return false;">
|
166
|
|
- <i class="layui-icon layui-icon-ok"></i>立即提交
|
167
|
|
- </button>
|
168
|
|
-
|
169
|
|
- <button type="reset"
|
170
|
|
- class="layui-btn layui-btn-primary">
|
171
|
|
- <i class="layui-icon layui-icon-refresh"></i>重置
|
172
|
|
- </button>
|
|
104
|
+ <button class="layui-btn" lay-submit lay-filter="formDemo" onclick="adddata(); return false;">立即提交</button>
|
|
105
|
+ <button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
173
|
106
|
</div>
|
174
|
107
|
</div>
|
175
|
108
|
</div>
|
|
@@ -177,226 +110,234 @@
|
177
|
110
|
</fieldset>
|
178
|
111
|
|
179
|
112
|
<script>
|
180
|
|
- layui.use(['form', 'table', 'layer', 'jquery'], function () {
|
|
113
|
+ layui.use('form', function(){
|
181
|
114
|
var form = layui.form;
|
182
|
|
- var table = layui.table;
|
183
|
|
- var $ = layui.$;
|
184
|
|
- var layer = layui.layer;
|
185
|
|
-
|
186
|
|
- // 初始化表单
|
187
|
115
|
form.render();
|
188
|
|
-
|
189
|
|
- // 加载物料品类数据
|
|
116
|
+ });
|
|
117
|
+ layui.use(['form', 'table', "laydate", 'layer','jquery'], function () {
|
|
118
|
+ var productName=null;
|
|
119
|
+ var material=null;
|
|
120
|
+ var form = layui.form;
|
|
121
|
+ var table = layui.table;
|
|
122
|
+ var $ = layui.$ //重点处
|
|
123
|
+ ,layer = layui.layer;
|
190
|
124
|
$.ajax({
|
191
|
125
|
url: 'varietyLists',
|
192
|
126
|
type: 'get',
|
193
|
127
|
success: function (data) {
|
194
|
128
|
$("#materialType").empty();
|
195
|
129
|
$.each($.parseJSON(data), function(idx, obj) {
|
196
|
|
- $("#materialType").append("<option value=\"" + obj.varietyId + "\">" + obj.variety + "</option>");
|
197
|
|
- });
|
198
|
|
- form.render("select");
|
199
|
|
- },
|
200
|
|
- error: function (xhr, status, error) {
|
|
130
|
+ $("#materialType").append("<option value=\""+obj.varietyId+"\" data-variety=\""+obj.variety+"\">"+obj.variety+"</option>"); });
|
|
131
|
+ layui.form.render("select");
|
|
132
|
+ },error:function (xhr, status, error) {
|
201
|
133
|
layer.alert('请求失败: ' + error);
|
202
|
|
- }
|
203
|
|
- });
|
204
|
|
-
|
205
|
|
- // 物料品类选择事件
|
206
|
|
- form.on('select(materialType)', function(data) {
|
|
134
|
+ }});
|
|
135
|
+ form.on('select(materialType)', function(data){
|
|
136
|
+ var variety = $(data.elem).find("option:selected").text();
|
207
|
137
|
$.ajax({
|
208
|
138
|
url: 'varietyDetailsLists',
|
209
|
139
|
type: 'post',
|
210
|
|
- data: {'id': data.value},
|
|
140
|
+ data:{'variety':variety},
|
211
|
141
|
success: function (data) {
|
212
|
142
|
$("#brand").empty();
|
213
|
143
|
$("#brand").append('<option value="">品牌</option>');
|
214
|
144
|
$.each($.parseJSON(data), function(idx, obj) {
|
215
|
|
- $("#brand").append("<option value=\"" + obj.id + "\">" + obj.varietyDetails + "</option>");
|
|
145
|
+ $("#brand").append("<option value=\""+obj.id+"\">"+obj.varietyDetails+"</option>");
|
216
|
146
|
});
|
217
|
|
- form.render("select");
|
218
|
|
- },
|
219
|
|
- error: function (xhr, status, error) {
|
|
147
|
+
|
|
148
|
+ layui.form.render("select");
|
|
149
|
+ },error:function (xhr, status, error) {
|
220
|
150
|
layer.alert('请求失败: ' + error);
|
221
|
|
- }
|
222
|
|
- });
|
|
151
|
+ }});
|
223
|
152
|
});
|
224
|
|
-
|
225
|
|
- // 品牌选择事件
|
226
|
|
- form.on('select(brand)', function(data) {
|
|
153
|
+/* form.on('select(brand)', function(data){
|
227
|
154
|
$.ajax({
|
228
|
|
- url: 'productionheader',
|
|
155
|
+ url: 'group',
|
229
|
156
|
type: 'post',
|
230
|
|
- data: {'id': data.value},
|
|
157
|
+ data:{'brand':data.value},
|
231
|
158
|
success: function (data) {
|
232
|
159
|
$("#materialGroup").empty();
|
233
|
160
|
$("#materialGroup").append('<option value="">物料组</option>');
|
234
|
161
|
$.each($.parseJSON(data), function(idx, obj) {
|
235
|
|
- $("#materialGroup").append("<option value=\"" + obj.materialGroupCode + "\">" + obj.materialGroupName + "</option>");
|
|
162
|
+ $("#materialGroup").append("<option value=\""+obj.materialGroupCode+"\">"+obj.materialGroupName+"</option>");
|
236
|
163
|
});
|
237
|
|
- form.render("select");
|
238
|
|
- },
|
239
|
|
- error: function (xhr, status, error) {
|
240
|
|
- layer.alert('请求失败: ' + error);
|
241
|
|
- }
|
242
|
|
- });
|
243
|
|
- });
|
244
|
164
|
|
245
|
|
- // 物料组选择事件
|
246
|
|
- form.on('select(materialGroup)', function(data) {
|
|
165
|
+ layui.form.render("select");
|
|
166
|
+ },error:function (xhr, status, error) {
|
|
167
|
+ layer.alert('请求失败: ' + error);
|
|
168
|
+ }});
|
|
169
|
+ });*/
|
|
170
|
+ form.on('select(brand)', function(data){
|
247
|
171
|
$.ajax({
|
248
|
|
- url: 'price',
|
|
172
|
+ url: 'productionheader',
|
249
|
173
|
type: 'post',
|
250
|
|
- data: {'group': data.value},
|
|
174
|
+ data:{'id':data.value},
|
251
|
175
|
success: function (data) {
|
252
|
|
- $("#materialdetil").empty();
|
253
|
|
- $("#materialdetil").append('<option value="">物料描述</option>');
|
|
176
|
+ layer.alert('请求失败: ' + data);
|
|
177
|
+ $("#productName").empty();$("#productCode").empty();$("#varietyDetailId").empty();
|
|
178
|
+
|
|
179
|
+ // $("#productName").append('<option value="">物料描述</option>');
|
254
|
180
|
$.each($.parseJSON(data), function(idx, obj) {
|
255
|
|
- $("#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>");*/
|
256
|
186
|
});
|
257
|
|
- form.render("select");
|
258
|
|
- },
|
259
|
|
- error: function (xhr, status, error) {
|
|
187
|
+ layui.form.render("select");
|
|
188
|
+ },error:function (xhr, status, error) {
|
260
|
189
|
layer.alert('请求失败: ' + error);
|
261
|
|
- }
|
262
|
|
- });
|
|
190
|
+ }});
|
263
|
191
|
});
|
264
|
192
|
|
265
|
|
- // 物料描述选择事件
|
266
|
|
- form.on('select(materialdetil)', function(data) {
|
|
193
|
+ form.on('select(materialdetil)', function(data){
|
267
|
194
|
$.ajax({
|
268
|
195
|
url: 'code',
|
269
|
196
|
type: 'post',
|
270
|
|
- data: {'code': data.value},
|
|
197
|
+ data:{'code':data.value},
|
271
|
198
|
success: function (data) {
|
272
|
|
- $("#materialCode").empty();
|
273
|
|
- // 注意:原代码中引用了不存在的 materialRealPrice 元素
|
|
199
|
+ $("#materialCode").empty();$("#materialdetil").empty();
|
|
200
|
+ $("#materialRealPrice").empty();
|
274
|
201
|
$.each($.parseJSON(data), function(idx, obj) {
|
275
|
|
- $("#materialCode").append("<option value=\"" + obj.materialCode + "\">" + obj.materialCode + "</option>");
|
|
202
|
+ $("#materialCode").append("<option value=\""+obj.materialCode+"\">"+obj.materialCode+"</option>");
|
|
203
|
+ $("#materialRealPrice").append("<option value=\""+obj.retailPrice+"\">"+obj.retailPrice+"</option>");
|
276
|
204
|
});
|
277
|
|
- form.render("select");
|
278
|
|
- },
|
279
|
|
- error: function (xhr, status, error) {
|
|
205
|
+ layui.form.render("select");
|
|
206
|
+ },error:function (xhr, status, error) {
|
280
|
207
|
layer.alert('请求失败: ' + error);
|
281
|
|
- }
|
282
|
|
- });
|
|
208
|
+ }});
|
283
|
209
|
});
|
284
|
210
|
|
285
|
|
- // 添加表格行
|
286
|
|
- window.addtable = function() {
|
287
|
|
- var selectedMaterialCode = $('#materialCode option:selected').text();
|
288
|
|
- var selectedMaterialDetail = $('#materialdetil option:selected').text();
|
|
211
|
+ //因为动态添加的元素class属性是无效的,所以不能用$('.add').click(function(){});
|
|
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
|
+ });
|
289
|
226
|
|
290
|
|
- var html = '<tr>' +
|
291
|
|
- '<td style="width: 100px"><button type="button" class="layui-btn layui-btn-danger layui-btn-xs" onclick="dele(this)">删除</button></td>' +
|
292
|
|
- '<td style="width:200px">' +
|
293
|
|
- '<select name="WZ" lay-verify="required">' +
|
294
|
|
- '<option value="">--请选择--</option>' +
|
295
|
|
- '<option value="L">L</option>' +
|
296
|
|
- '<option value="R">R</option>' +
|
297
|
|
- '</select>' +
|
298
|
|
- '</td>' +
|
299
|
|
- '<td style="width:300px">' +
|
300
|
|
- '<select name="LY" lay-verify="required">' +
|
301
|
|
- '<option value="">--请选择--</option>' +
|
302
|
|
- '<option value="C">采购</option>' +
|
303
|
|
- '<option value="T">退货</option>' +
|
304
|
|
- '</select>' +
|
305
|
|
- '</td>' +
|
306
|
|
- '<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>' +
|
307
|
|
- '<td style="width: 200px"><input type="text" name="materialCode" required lay-verify="required" placeholder="物料编码" autocomplete="off" class="layui-input" readonly="true" value="' + selectedMaterialCode + '"/></td>' +
|
308
|
|
- '<td style="width: 800px"><input type="text" name="materialDetile" required lay-verify="required" placeholder="物料描述" autocomplete="off" class="layui-input" readonly="true" value="' + selectedMaterialDetail + '"/></td>' +
|
309
|
|
- '<td style="width: 200px"><input type="text" name="price" required lay-verify="required" placeholder="价格" autocomplete="off" class="layui-input" readonly="true"/></td>' +
|
310
|
|
- '<td style="width: 100px"><input type="text" name="NUM" required lay-verify="required" placeholder="数量" autocomplete="off" class="layui-input" value="1"/></td>' +
|
311
|
|
- '<td style="width: 300px"><input type="text" name="SPH" placeholder="球镜" autocomplete="off" class="layui-input"></td>' +
|
312
|
|
- '<td style="width: 300px"><input type="text" name="CYL" placeholder="柱镜" autocomplete="off" class="layui-input"></td>' +
|
313
|
|
- '<td style="width: 300px"><input type="text" name="AXIS" placeholder="轴位" autocomplete="off" class="layui-input"></td>' +
|
314
|
|
- '<td style="width: 300px"><input type="text" name="PDFOD" placeholder="瞳距" autocomplete="off" class="layui-input"></td>' +
|
315
|
|
- '<td style="width: 300px"><input type="text" name="PH" placeholder="瞳高" autocomplete="off" class="layui-input"></td>' +
|
316
|
|
- '<td style="width: 300px"><input type="text" name="XADD" placeholder="下加光" autocomplete="off" class="layui-input"></td>' +
|
317
|
|
- '<td style="width: 300px"><input type="text" name="YULIU1" placeholder="通道" autocomplete="off" class="layui-input"></td>' +
|
318
|
|
- '<td style="width: 300px"><input type="text" name="PRISM" placeholder="棱镜" autocomplete="off" class="layui-input"></td>' +
|
319
|
|
- '<td style="width: 300px"><input type="text" name="CVA" placeholder="镜片度数" autocomplete="off" class="layui-input"></td>' +
|
320
|
|
- '<td style="width: 300px"><input type="text" name="OPTICBC" placeholder="镜片型号/基弧" autocomplete="off" class="layui-input"></td>' +
|
321
|
|
- '<td style="width: 300px"><input type="text" name="RS" placeholder="是否染色" autocomplete="off" class="layui-input"></td>' +
|
322
|
|
- '<td style="width: 300px"><input type="text" name="SD" placeholder="色度" autocomplete="off" class="layui-input"></td>' +
|
323
|
|
- '<td style="width: 300px"><input type="text" name="LRS" placeholder="来板染色" autocomplete="off" class="layui-input"></td>' +
|
324
|
|
- '<td style="width: 300px"><input type="text" name="CRS" placeholder="厂家色板" autocomplete="off" class="layui-input"></td>' +
|
325
|
|
- '<td style="width: 300px"><input type="text" name="BRS" placeholder="标准色号" autocomplete="off" class="layui-input"></td>' +
|
326
|
|
- '<td style="width: 300px"><input type="text" name="MPRO" placeholder="美薄加工" autocomplete="off" class="layui-input"></td>' +
|
327
|
|
- '<td style="width: 300px"><input type="text" name="LBPO" placeholder="丽薄加工" autocomplete="off" class="layui-input"></td>' +
|
328
|
|
- '<td style="width: 300px"><input type="text" name="FRAMESHAPE" placeholder="镜架框形" autocomplete="off" class="layui-input"></td>' +
|
329
|
|
- '<td style="width: 300px"><input type="text" name="FRAMEHEIGHT" placeholder="镜架高度" autocomplete="off" class="layui-input"></td>' +
|
330
|
|
- '<td style="width: 300px"><input type="text" name="FRAMEBRIDGEWIDTH" placeholder="鼻梁间距" autocomplete="off" class="layui-input"></td>' +
|
331
|
|
- '<td style="width: 300px"><input type="text" name="SPK" placeholder="水平宽度" autocomplete="off" class="layui-input"></td>' +
|
332
|
|
- '<td style="width: 300px"><input type="text" name="JFRAMESHAPE" placeholder="加工镜架框形" autocomplete="off" class="layui-input"></td>' +
|
333
|
|
- '<td style="width: 300px"><input type="text" name="COLOR" placeholder="颜色" autocomplete="off" class="layui-input"></td>' +
|
334
|
|
- '<td style="width: 300px"><input type="text" name="lEN_DIAMETER" placeholder="直径" autocomplete="off" class="layui-input"></td>' +
|
335
|
|
- '<td style="width: 300px"><input type="text" name="PX" placeholder="片型" autocomplete="off" class="layui-input"></td>' +
|
336
|
|
- '<td style="width: 300px"><input type="text" name="PS" placeholder="片色" autocomplete="off" class="layui-input"></td>' +
|
337
|
|
- '<td style="width: 300px"><input type="text" name="MARK" placeholder="备注" autocomplete="off" class="layui-input"></td>' +
|
338
|
|
- '</tr>';
|
|
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>");
|
339
|
242
|
|
|
243
|
+ });
|
|
244
|
+ layui.form.render("select");
|
|
245
|
+ },error:function (xhr, status, error) {
|
|
246
|
+ layer.alert('请求失败: ' + error);
|
|
247
|
+ }});
|
|
248
|
+ var html = '<tr>'+
|
|
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>'+
|
|
255
|
+ '<td style="width:200px">'+
|
|
256
|
+ '<select name="WZ" lay-verify="required">'+
|
|
257
|
+ '<option value="">--请选择--</option>'+
|
|
258
|
+ '<option value="L">L</option>'+
|
|
259
|
+ '<option value="R">R</option>'+
|
|
260
|
+ '</select></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>'+
|
|
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
|
+
|
|
281
|
+ '</tr>';
|
|
282
|
+ //添加到表格最后
|
340
|
283
|
$(html).appendTo($('#table tbody:last'));
|
341
|
284
|
form.render();
|
342
|
|
- };
|
343
|
|
-
|
344
|
|
- // 删除表格行
|
345
|
|
- window.dele = function (obj) {
|
|
285
|
+ }
|
|
286
|
+ window.dele= function (obj){
|
|
287
|
+ debugger;
|
346
|
288
|
var otr = obj.parentNode.parentNode;
|
347
|
|
- var tab = otr.parentNode;
|
|
289
|
+// var tab = document.getElementById("tab");
|
|
290
|
+// tab.deleteRow(otr.rowIndex)
|
|
291
|
+ var tab = otr.parentNode; //自己的父节点 就是table
|
348
|
292
|
tab.removeChild(otr);
|
|
293
|
+ }
|
|
294
|
+ window.deltable= function() {
|
|
295
|
+ if ($('#table tbody tr').length === 1) {
|
|
296
|
+ layer.msg('只有一条不允许删除。', {
|
|
297
|
+ time : 2000
|
|
298
|
+ });
|
|
299
|
+ } else {
|
|
300
|
+ //删除当前按钮所在的tr
|
|
301
|
+ $(this).closest('tr').remove();
|
|
302
|
+ }
|
349
|
303
|
};
|
350
|
|
-
|
351
|
|
- // 提交数据
|
352
|
|
- window.adddata = function() {
|
353
|
|
- var tableElement = document.getElementById("table");
|
354
|
|
- var trElements = tableElement.getElementsByTagName("tr");
|
355
|
|
- var dataArray = [];
|
356
|
|
-
|
357
|
|
- for (var i = 0; i < trElements.length; i++) {
|
358
|
|
- var targetElements = trElements[i].querySelectorAll("[name]");
|
359
|
|
- var dataObject = {};
|
360
|
|
-
|
361
|
|
- for (var j = 0; j < targetElements.length; j++) {
|
362
|
|
- if (targetElements[j].value) {
|
363
|
|
- dataObject[targetElements[j].getAttribute("name")] = targetElements[j].value;
|
364
|
|
- } else {
|
365
|
|
- dataObject[targetElements[j].getAttribute("name")] = targetElements[j].getAttribute("value");
|
|
304
|
+ window.adddata= function() {
|
|
305
|
+ table=document.getElementById("table");
|
|
306
|
+ let tr=table.getElementsByTagName("tr");
|
|
307
|
+ var arrayObj = new Array();
|
|
308
|
+ for (var i=0; i<tr.length; i++){
|
|
309
|
+ let target=tr[i].querySelectorAll("[name]"),obj={};
|
|
310
|
+ for (var j=0; j<target.length; j++){
|
|
311
|
+ if(target[j].value){
|
|
312
|
+ obj[target[j].getAttribute("name")]=target[j].value;
|
|
313
|
+ }else{
|
|
314
|
+ obj[target[j].getAttribute("name")]=target[j].getAttribute("value");
|
366
|
315
|
}
|
367
|
316
|
}
|
368
|
|
-
|
369
|
|
- // 只有包含数据的对象才添加到数组中
|
370
|
|
- if (Object.keys(dataObject).length > 0) {
|
371
|
|
- dataArray.push(dataObject);
|
372
|
|
- }
|
|
317
|
+ arrayObj.push(obj);
|
373
|
318
|
}
|
374
|
|
-
|
375
|
|
- var jsonData = JSON.stringify(dataArray);
|
376
|
|
- jsonData = jsonData.replace(/[+]/g, '+');
|
377
|
|
-
|
|
319
|
+ var json=JSON.stringify(arrayObj);
|
|
320
|
+ json = json.replace(/[+]/g, '+');
|
378
|
321
|
$.ajax({
|
379
|
322
|
url: 'insert',
|
380
|
323
|
type: 'post',
|
381
|
|
- data: "list=" + jsonData,
|
|
324
|
+ data: "list="+json,
|
382
|
325
|
async: false,
|
383
|
326
|
dataType: "json",
|
384
|
327
|
success: function (data) {
|
385
|
328
|
layer.msg('提交成功!', {
|
386
|
|
- time: 3000
|
|
329
|
+ time : 5000
|
387
|
330
|
});
|
388
|
|
- },
|
389
|
|
- error: function (xhr, status, error) {
|
|
331
|
+ }, error: function (xhr, status, error) {
|
390
|
332
|
layer.alert('请求失败: ' + error);
|
391
|
333
|
}
|
392
|
334
|
});
|
393
|
|
- };
|
394
|
|
-
|
395
|
|
- // 表单提交事件
|
|
335
|
+ }
|
396
|
336
|
form.on('submit(login)', function (data) {
|
397
|
|
- // 可以在这里处理表单提交逻辑
|
|
337
|
+ //alert(data.value);
|
398
|
338
|
});
|
399
|
339
|
});
|
|
340
|
+
|
400
|
341
|
</script>
|
401
|
342
|
|
402
|
343
|
</body>
|