yusijie
2023-04-16 22ae2a27d1f66c6acbb126fdbd3d1446b6837acb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>工序流转卡</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
            height: 30px;
            line-height: 30px;
        }
 
        .btn-title {
            font-size: 16px;
        }
        /* 防止下拉框的下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* 使得下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
 
        .layui-form-item .layui-inline {
            margin-top: 0px;
            margin-bottom: 5px;
            margin-right: 0px;
        }
 
        .layui-form-label {
            width: 25%;
        }
 
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 5px;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" lay-filter="component-form-group" action="">
                    <div class="layui-card-header">
                        <div class="layui-btn-group">
                            <button type="button" id="set_SaveBill" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="btnSave">保存</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Cancel">退出</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="btn_print">打印</button>
                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">隐藏列设置</button>
                        </div>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
                            <li lay-id="5" style="padding:1px;">羊毛信息</li>
                            <li lay-id="2" style="padding:1px;">其他信息</li>
                            <li lay-id="3" style="padding:1px;">检移票信息</li>
                            <li lay-id="4" style="padding:1px;">制单信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--基本信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item" style="padding-top: 3px;">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">单据号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" value="0">
                                                <input type="hidden" name="HPRDORGID" id="HPRDORGID" lay-verify="HPRDORGID"><!--HSTOCKORGID-->
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">日期</label>
                                            <div class="layui-input-inline">
                                                <input type="datetime" class="layui-input" name="HDate" id="HDate">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">染色要求</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HColorRemark" id="HColorRemark" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <!--<div class="layui-col-xs3 layui-inline">
        <label class="layui-form-label">订单跟踪号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="HOrderProcNO" id="HOrderProcNO" style="background-color:#efefef4d;" readonly>
        </div>
    </div>-->
                                        <!--<div class="layui-col-xs3 layui-inline">
        <label class="layui-form-label">图号版本</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="HPicNumVer" id="HPicNumVer" style="background-color:#efefef4d;" readonly>
        </div>
    </div>-->
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">产品名称</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterName2" id="HMaterName2" onmouseover="this.title=this.value" style="float: left; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" name="HMaterID2" id="HMaterID2" value="0">
                                                <!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater2" id="btnSearchMater2" style="width: 40px;">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                </button>-->
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">产品代码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterNumber2" id="HMaterNumber2" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">产品规格</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterModel2" id="HMaterModel2" onmouseover="this.title=this.value" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <!--<div class="layui-col-xs3 layui-inline">
            <label class="layui-form-label">总装图号</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="HPicNumAssemble" id="HPicNumAssemble" onmouseover="this.title=this.value" style="background-color:#efefef4d;" readonly>
            </div>
        </div>-->
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">生产订单号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HICMOInterID" id="HICMOInterID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">流转卡数量</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HQty" id="HQty">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">单位</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HUnitName" id="HUnitName" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HUnitID" id="HUnitID" value="0">
                                            </div>
                                        </div>
                                        <!--<div class="layui-col-xs3 layui-inline">
            <label class="layui-form-label">材质</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="HMaterTexture" id="HMaterTexture">
            </div>
        </div>-->
                                    </div>
                                    <div class="layui-row">
                                        <!--<div class="layui-col-xs3 layui-inline">
            <label class="layui-form-label">计划开工日期</label>
            <div class="layui-input-inline">
                <input type="date" class="layui-input" name="HPlanBeginDate" id="HPlanBeginDate" style="padding-left: 32px;">
            </div>
        </div>
        <div class="layui-col-xs3 layui-inline">
            <label class="layui-form-label">计划完工日期</label>
            <div class="layui-input-inline">
                <input type="date" class="layui-input" name="HPlanEndDate" id="HPlanEndDate" style="padding-left: 32px;">
            </div>
        </div>-->
 
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">选单号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="textBox2" id="textBox2" style="float: left; background-color: #efefef4d; display: inline-block;" readonly>
                                                <!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchICMOBill" id="btnSearchICMOBill" style="width: 40px;">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                </button>-->
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">工艺路线</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="RoutingBill" id="RoutingBill" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HRoutingBillID" id="HRoutingBillID">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnRoutingBill" id="btnRoutingBill" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">幅宽</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HWidth" id="HWidth" style="float: left; background-color: #efefef4d; display: inline-block;" readonly>
                                            </div>
                                        </div>
 
                                        <!--<div class="layui-col-xs3 layui-inline">
            <label class="layui-form-label">成品编号</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="HProductNum" id="HProductNum" onmouseover="this.title=this.value">
            </div>
        </div>-->
                                    </div>
 
                                    <div class="layui-row">
                                        <!--<div class="layui-col-xs6 layui-inline">
            <label class="layui-form-label" style="width:12.5%">备注</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="HRemark" id="HRemark" placeholder="请输入内容" onmouseover="this.title=this.value" style="width:610px;">
            </div>
        </div>
        <div class="layui-col-xs3 layui-inline">
            <label class="layui-form-label">日计划工单选单号</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="HWorkBillSortNo" id="HWorkBillSortNo" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchWorkBillSort" id="btnSearchWorkBillSort" style="width: 40px;">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                </button>
            </div>
        </div>-->
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">辅数量</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HAuxQty" id="HAuxQty" style="float: left;" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">拆分号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HSplitNo" id="HSplitNo" style="float: left;" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">辅助单位</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HAuxUnitName" id="HAuxUnitName" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HAuxUnit" id="HAuxUnit" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHAuxUnit" id="btnHAuxUnit" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <!--<div class="layui-col-xs3 layui-inline">
        <label class="layui-form-label">补料原因</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="HExplanation" id="HExplanation" placeholder="请输入内容" onmouseover="this.title=this.value">
        </div>
    </div>-->
                                        <!--<div class="layui-col-xs3 layui-inline">
        <label class="layui-form-label">补料标记</label>
        <div class="layui-input-block">
            <input type="checkbox" name="HBLFlag" id="HBLFlag" lay-skin="primary" title="" checked="">
        </div>
    </div>-->
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">克重</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HWeight" id="HWeight" style="float: left; background-color: #efefef4d; display: inline-block;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">业务员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HEmpName" id="HEmpName" style="float: left; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HEmpID" id="HEmpID">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">客户</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HCusNames" id="HCusNames" style="float: left; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HCusID" id="HCusID">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs6 layui-inline">
                                            <label class="layui-form-label" style="width:12.5%">备注</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" placeholder="请输入内容" onmouseover="this.title=this.value" style="width: 610px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs6 layui-inline">
                                            <label class="layui-form-label" style="width:12.5%">备注2</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HRemark2" id="HRemark2" placeholder="请输入内容" onmouseover="this.title=this.value" style="width: 610px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs6 layui-inline">
                                            <label class="layui-form-label" style="width:12.5%">底部备注</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HRemark3" id="HRemark3" placeholder="请输入内容" onmouseover="this.title=this.value" style="width: 610px;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--羊毛信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">毛高</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HHeight" id="HHeight">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">寸数组织</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HInches" id="HInches">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">全毛长</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HAl1Long" id="HAl1Long">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">坯布密度</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDensity" id="HDensity">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">毛纱名称及规格</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HTela" id="HTela">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">底丝</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUnderTela" id="HUnderTela">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">定型浆料</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HSizing" id="HSizing">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">交货日期</label>
                                            <div class="layui-input-inline">
                                                <input type="date" class="layui-input" name="HSellDate" id="HSellDate" style="padding-left: 32px;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--其他信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">生产车间</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HWorkShopName" id="HWorkShopName" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" name="HWorkShopID" id="HWorkShopID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="HWorkShopList" id="HWorkShopList" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">项目编号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HProjectNum" id="HProjectNum" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
 
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">委外加工单位</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HSupName" id="HSupName" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" name="HSupID" id="HSupID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHSup" id="btnSearchHSup" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">订单跟踪号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HOrderProcNO" id="HOrderProcNO" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">子件名称</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" name="HMaterID" id="HMaterID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">子件代码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">子件规格</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterModel1" id="HMaterModel1" onmouseover="this.title=this.value" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">图号版本</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HPicNumVer" id="HPicNumVer" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">单位代码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HUnitNumber" id="HUnitNumber" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">主要材料</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMainMaterID" id="HMainMaterID" value="0" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">生产数量</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HPlanQty" id="HPlanQty" value="0" style=" background-color: #efefef4d; width: 90px; float: left; margin-right: 4px;" readonly>
                                                <input type="text" class="layui-input" name="HprocExQty" id="HprocExQty" style="background-color:#efefef4d; width: 90px;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">总装图号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HPicNumAssemble" id="HPicNumAssemble" onmouseover="this.title=this.value" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">关键材料</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HKeyMaterID" id="HKeyMaterID" value="0" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">HICMOEntryID</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HICMOEntryID" id="HICMOEntryID" value="0" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">原料批次</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMateOutBatchNo" id="HMateOutBatchNo" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">材质</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterTexture" id="HMaterTexture">
                                            </div>
                                        </div>
                                        <!--<div class="layui-col-xs3 layui-inline">
                    <label class="layui-form-label">流转卡类型</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" name="HWorkTypeName" id="HWorkTypeName" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                        <input type="hidden" name="HWorkTypeID" id="HWorkTypeID" value="0">
                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHWorkType" id="btnSearchHWorkType" style="width: 40px;">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                        </button>
                    </div>
                </div>-->
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">版本</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HVerNum" id="HVerNum" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <!--<div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">版本</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HVerNum" id="HVerNum" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">版本</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HVerNum" id="HVerNum" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>-->
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">芯体物料代码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HXTNumber" id="HXTNumber">
                                            </div>
                                        </div>
 
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">计划开工日期</label>
                                            <div class="layui-input-inline">
                                                <input type="date" class="layui-input" name="HPlanBeginDate" id="HPlanBeginDate" style="padding-left: 32px;">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">计划完工日期</label>
                                            <div class="layui-input-inline">
                                                <input type="date" class="layui-input" name="HPlanEndDate" id="HPlanEndDate" style="padding-left: 32px;">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">补料原因</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HExplanation" id="HExplanation" placeholder="请输入内容" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">芯体规格型号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HXTModel" id="HXTModel">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">模具设备</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HEquipMentName" id="HEquipMentName" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <input type="hidden" name="HEquipMentID" id="HEquipMentID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEquipMent" id="btnHEquipMent" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label"> 材料规格</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" style="float: left;">
                                            </div>
                                        </div>
                                        
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">日计划工单选单号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HWorkBillSortNo" id="HWorkBillSortNo" style="float: left; width: 150px; background-color: #efefef4d; display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchWorkBillSort" id="btnSearchWorkBillSort" style="width: 40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label">补料标记</label>
                                            <div class="layui-input-inline">
                                                <input type="checkbox" name="isHBLFlag" id="isHBLFlag" value="false" lay-skin="primary" lay-filter="isHBLFlag">
                                                <input type="hidden" name="HBLFlag" id="HBLFlag" value="false" lay-skin="primary" lay-filter="HBLFlag">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs6 layui-inline">
                                            <label class="layui-form-label" style="width:12.5%">源单客户代码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HCusNumber" id="HCusNumber" placeholder="请输入内容" onmouseover="this.title=this.value" style="width:610px;">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs6 layui-inline">
                                            <label class="layui-form-label" style="width:12.5%">包装标识</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HPickLabel" id="HPickLabel" placeholder="请输入内容" onmouseover="this.title=this.value" style="width:610px;">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs6 layui-inline">
                                            <label class="layui-form-label" style="width:12.5%">包装标识编码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HPickLabelNumber" id="HPickLabelNumber" placeholder="请输入内容" onmouseover="this.title=this.value" style="width:610px;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--检移票信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">产品CODE</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProdMaterCode" id="HProdMaterCode">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">销售订单号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HSeOrderBillNo" id="HSeOrderBillNo">
                                                <!--<input type="hidden" class="layui-input" name="HSeOrderEntryID" id="HSeOrderEntryID">
                        <input type="hidden" class="layui-input" name="HSeOrderInterID" id="HSeOrderInterID">-->
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">客户简称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCusShortName" id="HCusShortName">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 115px;padding: 9px 0px;">客户要求材料成分</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCusNeedMaterial" id="HCusNeedMaterial">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">预计出货日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="date" class="layui-input" name="HPlanSendGoodsDate" id="HPlanSendGoodsDate" style="padding-left: 32px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">产品名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProdMaterName" id="HProdMaterName">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">客户名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCusName" id="HCusName">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">生产备注</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HWorkRemark" id="HWorkRemark">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">重要提示</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HImportNote" id="HImportNote">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料编号A</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterNumber_A" id="HMaterNumber_A">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料编号B</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterNumber_B" id="HMaterNumber_B">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料编号C</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterNumber_C" id="HMaterNumber_C">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料编号D</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterNumber_D" id="HMaterNumber_D">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">生产类型</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProdType" id="HProdType">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料简称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterShortName" id="HMaterShortName">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料内码A</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterIDA" id="HMaterIDA">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料内码B</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterIDB" id="HMaterIDB">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料内码C</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterIDC" id="HMaterIDC">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">原材料内码D</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterIDD" id="HMaterIDD">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--制单信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">制单人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">审核人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">关闭人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">制单日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">审核日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">关闭日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>-->
                    <div class="layui-tab layui-tab-card">
                        <ul class="layui-tab-title">
                            <li class="layui-this">工艺流程</li>
                            <li>器具清单</li>
                            <li>工艺参数清单</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <!--工艺流程-->
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                            <div class="layui-tab-item">
                                <!--器具清单-->
                                <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
                            </div>
                            <div class="layui-tab-item">
                                <!--工艺参数清单-->
                                <table class="layui-hide" id="mainTable3" lay-filter="mainTable3"></table>
                            </div>
                        </div>
                    </div>
 
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                        </div>
                    </script>
                    <input id="HItemID" name="HItemID" type="hidden" />
                    <input id="HEntryID" name="HEntryID" type="hidden" />
                </form>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <!--行下拉选择(是否委外)-->
    <script type="text/html" id="HSupFlag">
        <select name="HSupFlag" lay-filter="HSupFlag" id="HSupFlag{{d.LAY_TABLE_INDEX+1}}">
            <option value="false">否</option>
            <option value="true">是</option>
        </select>
    </script>
    <script>
 
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var option;
            var btnHMaterID = "";
            var HModName = "Sc_ProcessExchangeBill";
            var HLZQty = 0;
 
            titleData2 = ["HEntryID", "HMouldID", "HMaterID", "HUnitID", "hmainid", "hicmointerid"];  //隐藏字段(器具清单)
            titleData3 = ["HItemID"];  //隐藏字段(工艺参数清单)
            //判断是否登录 未登录则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
            //        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
 
            //获取页面跳转参数
            var params = get_UrlVars();
            if (typeof (params[params[0]]) == "undefined") {
                var OperationType = 1;//操作类型
            } else {
                var OperationType = params[params[0]];//操作类型
                var linterid = params[params[1]];//源单id
                var HEntryID = params[params[2]];//源单子id
                var HSouceBillType = params[params[3]];//源单类型
            }
 
            //#region 进入页面即加载
 
            $("#HPlanBeginDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
            $("#HPlanEndDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
            $("#HPlanSendGoodsDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
            $("#HSellDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
 
            //初始化表格
            set_InitGrid();
            DisPlay_HideColumn();
 
            //判断操作类型
            if (OperationType == 1) {//无源单新增
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3772' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
                        $("#HMaker").val(sessionStorage["HUserName"]);
                    }
                });
                option.data = [{
                    "HProcNo": "", "HProcID": 0, "HProcNumber": "", "HProcName": "", "HWorkRemark": "",
                    "HCenterID": 0, "HCenterNumber": "", "HCenterName": "",
                    "HDeptID": 0, "HDeptNumber": "", "HDeptName": "",
                    "HSupID": 0, "HSupNumber": "", "HSupName": "", "HSupFlag": "false",
                    "HQty": 0, "HOutPrice": 0, "HRemark": "", "HRelationQty_In": 0, "HRelationQty_Out": 0,
                    "HRelationQty_WWOrder": 0, "HRelationQty_Bad": 0, "HOverRate": 0, "HMaxQty": 0,
                    "HPassRate": 0, "HSumPassRate": 0, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                }];
                table.render(option);
            }
            else if (OperationType == 2) {//有源单新增
                $("#HItemID").val(linterid);//修改时主表ID
                $("#HEntryID").val(HEntryID);//修改时子表ID
 
                //判断生产订单是否审核
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/LEMS/ICMOBillCheck",
                    data: { "hmainid": linterid, "HEntryID": HEntryID, "OrganizationID": sessionStorage["OrganizationID"]  },
                    async: false,
                    success: function (result) {
                        if (result.count == 0) { // 说明验证成功了,
                            layer.alert(result.Message, { icon: 5 });
                        } else {
                            $.ajax({
                                url: GetWEBURL() + "/Web/GetMAXNum",
                                type: "GET",
                                data: { "HBillType": '3772' },
                                success: function (d) {
                                    //console.log(d.data);
                                    $("#HInterID").val(d.data[0].HInterID);
                                    $("#HBillNo").val(d.data[0].HBillNo);
                                    $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                                    $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
                                    $("#HMaker").val(sessionStorage["HUserName"]);
                                }
                            });
 
                            $.ajax({
                                url: GetWEBURL() + "/Sc_WorkBillSortBill/Sc_WorkBillSortBillList",
                                type: "GET",
                                data: { "sWhere": " and 源单主内码='" + linterid + "' and 源单子内码='" + HEntryID + "' ", "user": sessionStorage["HUserName"] },
                                success: function (d) {
                                    if (d.data[0] != null) {
                                        $("#HWorkBillSortNo").val(d.data[0].单据号);
                                    }
                                }
                            })
 
 
 
                            GetICMOBillValue(linterid, HEntryID);
                            option.data = [{
                                "HProcNo": "", "HProcID": 0, "HProcNumber": "", "HProcName": "", "HWorkRemark": "",
                                "HCenterID": 0, "HCenterNumber": "", "HCenterName": "",
                                "HDeptID": 0, "HDeptNumber": "", "HDeptName": "",
                                "HSupID": 0, "HSupNumber": "", "HSupName": "", "HSupFlag": "false",
                                "HQty": 0, "HOutPrice": 0, "HRemark": "", "HRelationQty_In": 0, "HRelationQty_Out": 0,
                                "HRelationQty_WWOrder": 0, "HRelationQty_Bad": 0, "HOverRate": 0, "HMaxQty": 0,
                                "HPassRate": 0, "HSumPassRate": 0, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                            }];
                            table.render(option);
                        }
                        layer.closeAll("loading");
                    }
                })
            }
            else if (OperationType == 3) {//编辑
                $("#HItemID").val(linterid);//修改时主表ID
                set_EditFromGrid();
 
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
            //#endregion
 
 
            //初始化表格
            function set_InitGrid() {
                //表头
                columns = [ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HProcNo', title: '流水号', edit: 'text' }
                    , { field: 'HProcID', title: '工序ID', hide: true }
                    , { field: 'HProcNumber', title: '工序代码', edit: 'text', event: "HProcCheck" }
                    , { field: 'HProcName', title: '工序名称' }
                    , { field: 'HCenterID', title: '工作中心ID', hide: true }
                    , { field: 'HCenterNumber', title: '工作中心代码', edit: 'text', event: "HWorkCenterCheck" }
                    , { field: 'HCenterName', title: '工作中心名称' }
                    , { field: 'HTechnologyParameter', title: '工艺参数', width: 500, edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { field: 'HSupID', title: '供应商ID', hide: true }
                    , { field: 'HSupNumber', title: '供应商代码', edit: 'text', event: "HSupCheck" }
                    , { field: 'HSupName', title: '供应商' }
                    , { field: 'HSupFlag', title: '是否委外', templet: '#HSupFlag' }
                    , { field: 'HQty', title: '流转卡数量', edit: 'text' }
 
                    //, { field: 'HWorkRemark', title: '加工说明', edit: 'text' }
                    //, { field: 'HDeptID', title: '部门ID', hide: true }
                    //, { field: 'HDeptNumber', title: '部门代码', edit: 'text', event: "HDeptCheck" }
                    //, { field: 'HDeptName', title: '部门' }
                    //, { field: 'HOutPrice', title: '加工单价', edit: 'text' }
                    //, { field: 'HRelationQty_In', title: '进站数量', style:"background-color: #e6e6e6" }
                    //, { field: 'HRelationQty_Out', title: '出站数量', style: "background-color: #e6e6e6"}
                    //, { field: 'HRelationQty_WWOrder', title: '委外工单数量', style: "background-color: #e6e6e6" }
                    //, { field: 'HRelationQty_Bad', title: '不合格数量', style: "background-color: #e6e6e6" }
                    //, { field: 'HOverRate', title: '超额比例', event: "HOverRate", style: "background-color: #e6e6e6"}
                    //, { field: 'HMaxQty', title: '最高上限', style: "background-color: #e6e6e6" }
                    //, { field: 'HPassRate', title: '良率', style: "background-color: #e6e6e6" }
                    //, { field: 'HSumPassRate', title: '累计良率', style: "background-color: #e6e6e6" }
                    //, { field: 'HPicNum', title: '图纸编号', style: "background-color: #e6e6e6"}
                    //, { field: 'HProcCheckNote', title: '本工序确认记录', width: 500, style: "background-color: #e6e6e6"}
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
                option = {
                    id: 'mainTable'
                    , elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , height: 400
                    , cols: [columns]
                    , limit: Number.MAX_VALUE//默认显示全部
                    , done: function (res, curr, count) {
                        option.data = res.data;
                        //去掉下拉框失焦事件否则在下拉框里输入值
                        $('.layui-form-select').find('input').unbind("blur");
                        //表格重载回显下拉框里的数据
                        $('tr').each(function (e) {
                            var $cr = $(this);
                            var dataIndex = $cr.attr("data-index");
                            $.each(option.data, function (index, value) {
                                if (value.LAY_TNDEX == dataIndex) {
                                    $cr.find('input').val(value.HSupFlag);
                                }
                            });
                        });
                    }
                    , done: function (res, curr, count) {
 
                    }
                };
 
            }
 
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HProcNo": "", "HProcID": 0, "HProcNumber": "", "HProcName": "", "HWorkRemark": "",
                    "HCenterID": 0, "HCenterNumber": "", "HCenterName": "",
                    "HDeptID": 0, "HDeptNumber": "", "HDeptName": "",
                    "HSupID": 0, "HSupNumber": "", "HSupName": "", "HSupFlag": "false",
                    "HQty": 0, "HOutPrice": 0, "HRemark": "", "HRelationQty_In": 0, "HRelationQty_Out": 0,
                    "HRelationQty_WWOrder": 0, "HRelationQty_Bad": 0, "HOverRate": 0, "HMaxQty": 0,
                    "HPassRate": 0, "HSumPassRate": 0, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                };
                switch (obj.event) {
                    case 'btn-AddLine':
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        for (var i = 1; i <= option.data.length; i++) {
                            $('#HSupFlag' + i + '').find("option[value='" + option.data[i - 1].HSupFlag + "']").attr("selected", true);
                        }
                        form.render('select');
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
                        if (data.length <= 0) {
                            layer.msg("请选择需要复制的一行!");
                        }
                        else if (data.length > 1) {
                            layer.msg("只能选择复制一行!");
                        }
                        else {
                            var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                            var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            for (var i = 1; i <= option.data.length; i++) {
                                $('#HSupFlag' + i + '').find("option[value='" + option.data[i - 1].HSupFlag + "']").attr("selected", true);
                            }
                            form.render('select');
                        }
                        break;
                }
            });
 
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
 
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event == 'HProcCheck') {
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '工序列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index];
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }                                   
                                    obj.update({
                                        HProcName: checkStatus.data[0].工序
                                        , HProcID: checkStatus.data[0].HItemID
                                        , HProcNumber: checkStatus.data[0].工序代码
                                        , HCenterID: checkStatus.data[0].工作中心ID
                                        , HCenterNumber: checkStatus.data[0].工作中心代码
                                        , HCenterName: checkStatus.data[0].工作中心
                                        //, HDeptID: checkStatus.data[0].部门ID
                                        //, HDeptNumber: checkStatus.data[0].部门代码
                                        //, HDeptName: checkStatus.data[0].部门
                                    });
 
                                    layer.close(layer.index);
                                }
                                , btn2: function (index, layero) {
                                },
                                end: function () {
 
                                }
                            });
                        }
                        if (obj.event === 'HWorkCenterCheck') {//工作中心
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '加工中心列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_WorkCenterList.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index];
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        HCenterName: checkStatus.data[0].工作中心
                                        , HCenterID: checkStatus.data[0].HItemID
                                        , HCenterNumber: checkStatus.data[0].工作中心代码
                                    });
                                    layer.close(layer.index);
                                }
                                , btn2: function (index, layero) {
                                },
                                end: function () {
 
                                }
                            });
                        }
                        if (obj.event === 'HSupCheck') {//供应商
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '供应商列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../../views/基础资料/采购基础资料/Gy_Supplier.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index];
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        HSupName: checkStatus.data[0].供应商名称
                                        , HSupID: checkStatus.data[0].HItemID
                                        , HSupNumber: checkStatus.data[0].供应商代码
                                    });
                                    layer.close(layer.index);
                                }
                                , btn2: function (index, layero) {
                                },
                                end: function () {
 
                                }
                            });
                        }
                        if (obj.event === 'HDeptCheck') {//部门
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '部门列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/基础资料/公用基础资料/Gy_DepartmentList.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index];
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        HDeptName: checkStatus.data[0].部门名称
                                        , HDeptID: checkStatus.data[0].HItemID
                                        , HDeptNumber: checkStatus.data[0].部门代码
                                    });
                                    layer.close(layer.index);
                                }
                                , btn2: function (index, layero) {
                                },
                                end: function () {
 
                                }
                            });
                        }
                        obj.event = "";
                        return false;
                    }
                })
                //单击改变不可编辑值
                if (obj.event === 'isEditCheck') {
                    var flag = obj.data.isEdit;
                    var flagValue = obj.data.isEditValue;
                    if (flagValue === "false") {
                        flagValue = "true";
                        flag = "是";
                    }
                    else if (flagValue === "true") {
                        flagValue = "false";
                        flag = "否";
                    }
                    else {
                        flagValue = "false";
                        flag = "否";
                    }
                    obj.update({
                        isEdit: flag
                        , isEditValue: flagValue
                    });
                }
            });
 
            $("#HQty").on("input", function (e) {
                //获取input输入的值
                if (parseInt(e.delegateTarget.value)> parseInt($("#HPlanQty").val())) {
                    return layer.msg("拆分数量不能超过可拆分数量!");
                }
                else {
                    for (var i = 0; i < option.data.length; i++) {
                        option.data[i]["HQty"] = e.delegateTarget.value;
                    }
                }
                table.render(option);
            });
 
            //监听单元格编辑  单元格编辑后 变更
            table.on('edit(mainTable)', function (obj) {
                // 单元格编辑之前的值
                //第一行计划数量=流转卡数量;之后的计划数量=上一行数量*良率/ 100
                //最高上限=流转卡数量*(100+超额比例)/100
 
 
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
 
                switch (field) {
                    case "HOverRate":
                        var HQty = parseInt(isNaN(data.HQty) ? 0 : data.HQty);
                        var HOverRate = parseFloat(isNaN(data.HOverRate) ? 0 : data.HOverRate);
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMaxQty: HQty * (100 + HOverRate) / 100                         //最小包装数
                        });
                        break;
                    default:
                }
            });
 
            //隐藏列设置
            form.on('submit(HideColumn)', function (data) {
                get_HideColumn();
            });
 
            //选择辅助单位按钮
            form.on('submit(btnHAuxUnit)', function () {
                get_btnHAuxUnit();
            });
 
            //选择产品弹窗
            form.on('submit(btnSearchMater2)', function () {//产品
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '物料'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_MaterialList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {
 
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HMaterName2").val(checkStatus.data[0].HName);
                        $("#HMaterID2").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                })
            });
 
            //打印
            form.on('submit(btn_print)', function () {//产品
 
                var sWhere = " and HPRDORGID=" + sessionStorage["OrganizationID"] + " and 单据号='" + $("#HBillNo").val() + "' ";
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/LEMS/MES_Sc_ProcessExchangeBillQuery_Json',
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            var hinterid = "";
                            if (data1.data.length != 0) {
                                hinterid = data1.data[0]["hmainid"];
                            }
                            layer.close(ajaxLoad);
 
                            if (hinterid != "") {
                                $.ajax({
                                    url: GetWEBURL() + '/Sc_ProcessExchangeBillList/QJQD',
                                    type: "GET",
                                    data: { "HProcExchHinteID": hinterid },
                                    success: function (res) {
                                        if (res.count == 1) {
                                            if (res.data.length != 0) {
                                                hinterid += ",1";
                                            } else {
                                                hinterid += ",0";
                                            }
 
                                            layer.open({
                                                type: 2
                                                , area: ['50%', '50%']
                                                , title: '打印模版选择'
                                                , shade: 0.6 //遮罩透明度
                                                , maxmin: false //允许全屏最小化
                                                , anim: 0 //0-6的动画形式,-1不开启
                                                , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + hinterid + '&MyMsg=' + hinterid + '&Type=HProcessExchange', 'yes']
                                                , resize: false
                                            })
 
                                        } else {
                                            layer.close(ajaxLoad);
                                        }
                                    }, error: function () {
                                        layer.close(ajaxLoad);
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                })
 
                            } else {
                                layer.msg("请先保存,在进行打印!");
                            }
                        } else {
                            layer.close(ajaxLoad);
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
               
            });
 
            //选择子件弹窗PartInformation.html
            form.on('submit(btnSearchMater)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '子件列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/PartInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
 
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HMaterModel1").val(checkStatus.data[0].HModel);
                        $("#HMaterNumber").val(checkStatus.data[0].HNumber);
                        $("#HMaterName").val(checkStatus.data[0].HName);
                        $("#HMaterID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                });
            });
 
            //模具设备弹窗
            form.on('submit(btnHEquipMent)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '设备列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/EqpInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
 
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HEquipMentName").val(checkStatus.data[0].HName);
                        $("#HEquipMentID").val(checkStatus.data[0].HInterID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                });
            });
 
            //补料标记
            form.on('checkbox(isHBLFlag)', function (data) {
                $("#HBLFlag").val(data.elem.checked);
            });
 
            //车间弹窗
            form.on('submit(HWorkShopList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '车间列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/DeptInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
 
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HWorkShopName").val(checkStatus.data[0].HName);
                        $("#HWorkShopID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                });
            });
 
            //委外加工单位弹窗
            form.on('submit(btnSearchHSup)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '供应商列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/SupplierInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
 
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HSupName").val(checkStatus.data[0].HName);
                        $("#HSupID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false 开启该代码可禁止点击该按钮关闭
                    },
                    end: function () {
 
                    },
                    success: function (layero, index) {
 
                    }
                });
            });
 
            //选择生产任务单
            form.on('submit(btnSearchICMOBill)', function () {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '生产任务单列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../../views/Baseset/基础资料/Sc_ICMOBillListView.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
 
                        GetICMOBillValue(checkStatus.data[0].hmainid, checkStatus.data[0].HEntryID)
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            });
 
            //选择日计划工单
            form.on('submit(btnSearchWorkBillSort)', function () {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '日计划工单列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../../views/生产管理/生产日计划工单/JIT_DayPlanBillList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HWorkBillSortNo").val(checkStatus.data[0].单据号);
                        GetICMOBillValue(checkStatus.data[0].源单主内码, checkStatus.data[0].源单子内码)
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            });
 
            //选择工艺路线
            form.on('submit(btnRoutingBill)', function () {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '70%']//大小
                    , title: '工艺路线列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_RoutingBillList.html?HMaterID=' + btnHMaterID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        getRoutingBill(checkStatus.data[0].单据号);
 
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            });
 
            function getRoutingBill(HBillNo) {
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "LEMS/MES_Gy_RoutingBillList_Json",
                    async: true,
                    data: { "sWhere": " and 单据号='" + HBillNo + "'" + " and 工序代码 !='" + 9999 + "'", "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data;
                            var Tablerow = [];
 
                            $("#RoutingBill").val(data[0].单据号)
                            $("#HRoutingBillID").val(data[0].hmainid)
 
                            for (var i = 0; i < data.length; i++) {
                                Tablerow.push({
                                    "HProcNo": data[i].工序号, "HProcID": data[i].hprocid, "HProcNumber": data[i].工序代码, "HProcName": data[i].工序, "HWorkRemark": data[i].表体备注,
                                    "HCenterID": data[i].HCenterID, "HCenterNumber": data[i].工作中心代码, "HCenterName": data[i].工作中心名称,
                                    "HDeptID": 0, "HDeptNumber": "", "HDeptName": "",
                                    "HSupID": data[i].HSupID, "HSupNumber": data[i].供应商代码, "HSupName": data[i].供应商, "HSupFlag": data[i].委外标记 == 0 ? "false" : "true",
                                    "HQty": HLZQty, "HOutPrice": 0, "HRemark": "", "HRelationQty_In": 0, "HRelationQty_Out": 0,
                                    "HRelationQty_WWOrder": 0, "HRelationQty_Bad": 0, "HOverRate": 0, "HMaxQty": 0,
                                    "HPassRate": 0, "HSumPassRate": 0, "HTechnologyParameter": data[i].工艺参数, "HPicNum": data[i].图纸编号, "HProcCheckNote": data[i].本工序确认记录
                                });
                            }
                            option.data = Tablerow;
                            table.render(option);
                            for (var i = 1; i <= data.length; i++) {
                                $('#HSupFlag' + i + '').find("option[value='" + (data[i - 1].委外标记 == "0" ? "false" : "true") + "']").attr("selected", true);
                            }
                            form.render('select');
                    },
                    error: function (result) {
                        layer.close(index);
                        console.log(result);
                        //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                    }
                })
            }
 
 
            //保存提交
            form.on('submit(btnSave)', function (data) {//提交
                if ($("#HICMOInterID").val() == 0) {
                    layer.msg("请选择任务单!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HQty").val() == "" || $("#HQty").val() <= 0) {
                    layer.msg("基本信息中流转卡数量不能为空且不能小于等于0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if (!$("#HPlanBeginDate").val()) {
                    layer.msg("请选择计划开工日期!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if (!$("#HPlanEndDate").val()) {
                    layer.msg("请选择计划完工日期!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
 
                var HAuxQty = $('#HAuxQty').val();
                if (HAuxQty.substring(HAuxQty.length - 1, HAuxQty.length) == ".") {
                    layer.msg("辅数量的结尾不能是.!");
                    return;
                } else {
                    var ref = /^[0-9]+\.?[0-9]*$/;
                    if (!ref.test(HAuxQty)) {
                        layer.msg("辅数量请输正确入数字!");
                        return;
                    }
                }
 
                var HSplitNo = $('#HSplitNo').val();
                if (HSplitNo.substring(HSplitNo.length - 1, HSplitNo.length) == ".") {
                    layer.msg("拆分号的结尾不能是.!");
                    return;
                } else {
                    var ref = /^[0-9]+\.?[0-9]*$/;
                    if (!ref.test(HSplitNo)) {
                        layer.msg("拆分号请输正确入数字!");
                        return;
                    }
                }
 
                
 
                //删除子表数据时 会占用数组的位置,需要重新排一下顺序
                var sSubTable = [];
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
                    if (table.cache["mainTable"][i] != "") {
                        table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                        sSubTable.push(table.cache["mainTable"][i])
                    }
                }
                for (var i = 0; i < sSubTable.length; i++) {
                    if (!sSubTable[i].HProcNo) {
                        var indexRow = i + 1;
                        layer.msg("第" + indexRow + "行,流水号不能为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                    if (sSubTable[i].HProcNo == 0) {
                        var indexRow = i + 1;
                        layer.msg("第" + indexRow + "行,流水号不能为0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                    if (!sSubTable[i].HProcID) {
                        var indexRow = i + 1;
                        layer.msg("第" + indexRow + "行,工序不能为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                    if (!sSubTable[i].HCenterID) {
                        var indexRow = i + 1;
                        layer.msg("第" + indexRow + "行,工作中心不能为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                    if (sSubTable[i].HSupFlag == "true") {
                        if (!sSubTable[i].HSupID) {
                            var indexRow = i + 1;
                            layer.msg("第" + indexRow + "行,供应商不能为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return;
                        }
                    }
                }
                data.field.HPRDORGID = sessionStorage["OrganizationID"];//组织
                //var HBLFlag = data.field.HBLFlag;
                //HBLFlag == "on" ? data.field.HBLFlag = 'true' : data.field.HBLFlag = 'false';//将数组合并成字符串
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(sSubTable);
                var flag = "xz";
                if (OperationType == 3) {
                    flag = "xg";
                }
                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] + ";" + flag;
                var index = layer.load();
 
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_ProcessExchangeBill/AddBill",
                    async: true,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            layer.close(index);
                            layer.msg("提交成功");
                            $('#set_SaveBill').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
                        }
                        else {
                            layer.close(index);
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            });
 
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
 
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 的 样式
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
          
 
            //显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
 
 
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["工序ID", "工作中心ID","部门ID","供应商ID"];//不需要显示的字段 可扩展
 
                            dataCol = data1.data[0].HGridString.split(',');
 
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] = "font-size:100%";
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(左 居中 右)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                            }
 
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
 
 
            //退出
            form.on('submit(Cancel)', function () {
                if (linterid == undefined) {
                    //关闭页签
                    Pub_Close(2);
                }
                else {
                    //关闭页签
                    Pub_Close(1);
                }
            })
 
            //编辑方法
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                get_DisplayHMainID(linterid);  //编辑获取表体(器具清单)
                get_Display3(linterid);  //编辑获取表体(工艺参数清单)
                option.data = [{
                    "HProcNo": "", "HProcID": 0, "HProcNumber": "", "HProcName": "", "HWorkRemark": "",
                    "HCenterID": 0, "HCenterNumber": "", "HCenterName": "",
                    "HDeptID": 0, "HDeptNumber": "", "HDeptName": "",
                    "HSupID": 0, "HSupNumber": "", "HSupName": "", "HSupFlag": "false",
                    "HQty": 0, "HOutPrice": 0, "HRemark": "", "HRelationQty_In": 0, "HRelationQty_Out": 0,
                    "HRelationQty_WWOrder": 0, "HRelationQty_Bad": 0, "HOverRate": 0, "HMaxQty": 0,
                    "HPassRate": 0, "HSumPassRate": 0, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                }];
                table.render(option);
            }
            //编辑获取表头
            function set_EditForm(linterid) {
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "Sc_ProcessExchangeBill/GetProcessExchangeBillMain",
                    type: "GET",
                    data: {
                        "HInterID": linterid
                    },
                    success: function (result) {
                        if (result.code == 1) { // 说明验证成功了,
                            var data = result.data.h_v_Sc_ProcessExchangeBillQuery[0];
                            form.val("component-form-group", {
                                "HBillNo": data.单据号
                                , "HInterID": data.hmainid
                                , "HPRDORGID": data.HPRDORGID
                                , "HDate": formatDate(data.日期)
                                , "HOrderProcNO": data.订单跟踪号
                                , "HPicNumVer": data.图号版本
                                , "HMaterName2": data.产品名称
                                , "HMaterID2": data.HMaterID2
                                , "HMaterNumber2": data.产品代码
                                , "HMaterModel2": data.产品规格
                                , "HPicNumAssemble": data.总装图号
                                , "HICMOBillNo": data.任务单号
                                , "HICMOInterID": data.hicmointerid
                                , "HQty": data.流转卡数量
                                , "HUnitName": data.单位
                                , "HUnitID": data.HUnitID
                                , "HMaterTexture": data.材质
                                , "HPlanBeginDate": formatDate(data.计划开工日期)
                                , "HPlanEndDate": formatDate(data.计划完工日期)
                                , "HEquipMentName": data.设备名称
                                , "HEquipMentID": data.HEquipMentID
                                , "HProductNum": data.成品编号
                                , "HExplanation": data.摘要
                                , "HMaterModel": data.材料规格
                                , "HWidth": data.幅宽
                                , "HWeight": data.克重
                                , "HAuxQty": data.辅数量
                                , "HAuxUnit": data.HAuxUnit
                                , "HAuxUnitName": data.辅助单位
                                , "HSplitNo": data.拆分号
                                , "HRemark2": data.备注2
                                , "HRemark3": data.底部备注
                                , "HEmpID": data.HEmpID
                                , "HEmpName": data.业务员
                                , "HCusID": data.HCusID
                                , "HCusNames": data.客户
                                , "HColorRemark": data.染色要求
                               
                                , "HProjectNum": data.项目编号
                                , "HVerNum": data.版本
                                , "HRemark": data.表头备注
                                , "HMateOutBatchNo": data.原料批次
                                , "HXTNumber": data.芯体物料代码
                                , "HXTModel": data.芯体规格型号
                                , "HCusNumber": data.源单客户代码
                                , "HRoutingBillID": data.HRoutingBillID
                                , "RoutingBill": data.工艺路线
 
 
                                , "HWorkShopName": data.生产车间
                                , "HWorkShopID": data.HWorkShopID
                                , "textBox2": data.任务单号
                                , "HWorkBillSortNo": data.日计划工单号
                                , "HSupName": data.委外加工单位
                                , "HSupID": data.HSupID
                                , "HMaterName": data.子件名称
                                , "HMaterID": data.HMaterID
                                , "HMaterNumber": data.子件代码
                                , "HMaterModel1": data.子件规格
                                , "HUnitNumber": data.单位代码
                                , "HMainMaterID": data.主要材料
                                , "HPlanQty": data.生产数量
                                , "HprocExQty": data.生产数量
                                , "HKeyMaterID": data.关键材料
                                , "HICMOEntryID": data.HICMOEntryID
 
 
                                , "HProdMaterCode": data.产品CODE
                                , "HSeOrderBillNo": data.销售订单号
                                //, "HSeOrderEntryID": data.HSeOrderEntryID
                                //, "HSeOrderInterID": data.HSeOrderInterID
                                , "HCusShortName": data.客户简称
                                , "HCusNeedMaterial": data.客户要求材料成分
                                , "HPlanSendGoodsDate": formatDate(data.预计出货日期)
                                , "HProdMaterName": data.产品名称2
                                , "HCusName": data.客户名称
                                , "HWorkRemark": data.生产备注
                                , "HImportNote": data.重要提示
                                , "HMaterNumber_A": data.原材料编号A
                                , "HMaterNumber_B": data.原材料编号B
                                , "HMaterNumber_C": data.原材料编号C
                                , "HMaterNumber_D": data.原材料编号D
                                , "HProdType": data.生产类型
                                , "HMaterShortName": data.原材料简称
                                , "HMaterIDA": data.原材料内码A
                                , "HMaterIDB": data.原材料内码B
                                , "HMaterIDC": data.原材料内码C
                                , "HMaterIDD": data.原材料内码D
 
 
                                //羊毛信息
                                , "HHeight": data.毛高
                                , "HInches": data.寸数组织
                                , "HAl1Long": data.全毛长
                                , "HDensity": data.坯布密度
                                , "HTela": data.毛纱名称及规格
                                , "HUnderTela": data.底丝
                                , "HSizing": data.定型浆料
                                , "HSellDate": data.交货日期
 
 
                                , "HMaker": data.制单人
                                , "HChecker": data.审核人
                                , "HCloseMan": data.关闭人
                                , "HMakeDate": formatDate(data.制单日期)
                                , "HCheckDate": data.审核人 == "" ? "" : formatDate(data.审核日期)
                                , "HCloseDate": data.关闭人 == "" ? "" : formatDate(data.关闭日期)
                                , "HUpDater": data.修改人
                                , "HDeleteMan": data.作废人
                                , "HUpDateDate": data.修改人 == "" ? "" : formatDate(data.修改日期)
                                , "HDeleteDate": data.作废人 == "" ? "" : formatDate(data.作废日期)
                                , "HPickLabel": data.包装标识
                                , "HPickLabelNumber": data.包装标识编码
                            });
                            btnHMaterID = data.HMaterID2;
                            HLZQty = data.流转卡数量;
                            $("#HBLFlag").val(data.补料标记 ? "true" : "false");
                            $("input[name='isHBLFlag']").prop("checked", data.补料标记);//true:选中 false:不选中
                            form.render("checkbox");
 
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
            }
            // 编辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
 
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
 
                return [year, month, day].join('-');
            }
            // 编辑获取表体
            function set_EditGrid(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_ProcessExchangeBill/GetProcessExchangeBillSub',
                    type: "GET",
                    data: { "HInterID": linterid },
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                            for (var i = 0; i < result.data.length; i++) {
                                $('#HSupFlag' + (i + 1)).find("option[value='" + result.data[i].HSupFlag + "']").attr("selected", true);
                            }
                            form.render('select');
 
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
 
            //辅助单位
            function get_btnHAuxUnit() {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: "计量单位列表"  //标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_UnitList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        //获取数据
                        $("#HAuxUnit").val(checkStatus.data[0].HItemID);
                        $("#HAuxUnitName").val(checkStatus.data[0].HName);
 
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
 
            //#region 查询 (器具清单)
            function get_DisplayHMainID(linterid) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_ProcessExchangeBillList/QJQD',
                    type: "GET",
                    data: { "HProcExchHinteID": linterid },
                    success: function (data1) {
                        if (data1.count == 1) {
                            var data = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            }
                            var col = [];
                            for (var i = 0; i < data.length; i++) {
                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                if ($.inArray(data[i].name, titleData2) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                    }
                                }
                            }
 
                            //动态显示列名
                            table.render({
                                elem: '#mainTable2'
                                , toolbar: '#toolbarDemo'
                                , cols: [col]
                                , data: data1.data
                                , height: 550
                                , page: true
                                , cellMinWidth: 90
                                , limit: 50
                                , limits: [50, 500, 5000, 20000]
                            });
 
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
 
            //#region 查询 工艺参数
            function get_Display3(linterid) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_ProcessExchangeBill/GetProcessExchangeBillSubTech',
                    type: "GET",
                    data: { "HInterID": linterid},
                    success: function (data1) {
                        if (data1.count == 1) {
                            var data = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            }
                            var col = [];
                            for (var i = 0; i < data.length; i++) {
                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                if ($.inArray(data[i].name, titleData3) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                    }
                                }
                            }
                            //动态显示列名
                            table.render({
                                elem: '#mainTable3'
                                , toolbar: '#toolbarDemo'
                                , cols: [col]
                                , data: data1.data
                                , height: 550
                                , page: true
                                , cellMinWidth: 90
                                , limit: 50
                                , limits: [50, 500, 5000, 20000]
                            });
 
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
 
            //返回生产任务单
            function GetICMOBillValue(hmainid, HEntryID) {
                $.ajax({
                    url: GetWEBURL() + "/Sc_ProcessExchangeBill/GetICMOBillDetail",
                    type: "GET",
                    data: { "hmainid": hmainid, "HEntryID": HEntryID, "OrganizationID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[result.data.length - 1];
                            $("#HICMOInterID").val(data.hmainid);
                            $("#HICMOBillNo").val(data.生产订单号);
                            $("#textBox2").val(data.生产订单号);
                            $("#HICMOEntryID").val(data.HEntryID);
                            $("#HOrderProcNO").val(data.订单跟踪号);
                            $("#HMaterID").val(data.hmaterid);
                            $("#HMaterName").val(data.物料名称);
                            $("#HMaterID2").val(data.hmaterid);
                            $("#HMaterName2").val(data.物料名称);
                            $("#HMaterNumber").val(data.物料代码);
                            $("#HMaterNumber2").val(data.物料代码);
                            $("#HMaterModel").val(data.规格型号);
                            $("#HMaterModel2").val(data.规格型号);
                            $("#HBatchNo").val(data.批号);
                            $("#HUnitID").val(data.hunitid);
                            $("#HUnitName").val(data.计量单位名称);
                            $("#HUnitNumber").val(data.计量单位代码);
                            $("#HPlanQty").val(data.计划生产数量);
                            $("#HQty").val(data.流转卡数量);
                            $("#HprocExQty").val(data.流转卡数量);
                            $("#HPlanBeginDate").val(data.计划开工日期);
                            $("#HPlanEndDate").val(data.计划完工日期);
                            $("#HWorkShopID").val(data.hdeptid);
                            $("#HWorkShopName").val(data.生产车间名称);
                            $("#HProdMaterCode").val(data.产品CODE);
                            $("#HSeOrderBillNo").val(data.销售订单号);
                            $("#HCusShortName").val(data.客户简称);
                            $("#HCusNeedMaterial").val(data.客户要求材料成分);
                            $("#HPlanSendGoodsDate").val(data.预计出货日期);
                            $("#HProdMaterName").val(data.产品名称);
                            $("#HCusName").val(data.客户名称);
                            $("#HWorkRemark").val(data.生产备注);
                            $("#HImportNote").val(data.重要提示);
                            $("#HPicNumVer").val(data.图号版本);
                            $("#HPicNumAssemble").val(data.总装图号);
                            $("#HMaterTexture").val(data.材质);
                            $("#HProductNum").val(data.成品编号);
                            $("#HVerNum").val(data.版本);
                            $("#HCusNumber").val(data.源单客户编码);
                            $("#HPickLabel").val(data.包装标识);
                            $("#HPickLabelNumber").val(data.包装标识编码);
                            $("#HXTNumber").val(data.芯体物料代码);
                            $("#HXTModel").val(data.芯体规格型号);
                            $("#HWidth").val(data.HWidth);
                            $("#HWeight").val(data.HWeight);
                            $("#HAuxUnitName").val(data.HAuxUnitName);
                            $("#HAuxUnit").val(data.HAuxUnit);
                            $("#HRemark2").val(data.备注);
                            $("#HEmpID").val(data.HEmpID);
                            $("#HEmpName").val(data.业务员);
                            $("#HCusID").val(data.HCusID);
                            $("#HCusNames").val(data.客户);
                            $("#HColorRemark").val(data.染色要求);
                            $("#HBLFlag").val(result.data[0].HBLFlag == 0 ? false : true);
                            $("input[name='isHBLFlag']").prop("checked", result.data[0].HBLFlag);//true:选中 false:不选中
                            form.render("checkbox");
                            btnHMaterID = data.hmaterid;
 
                            $.ajax({
                                type: "get",
                                url: GetWEBURL() + "LEMS/Gy_RoutingBillList",
                                async: true,
                                data: { "sWhere": "and HMaterID=" + btnHMaterID + " and HOrgID = " + sessionStorage["OrganizationID"], "user": sessionStorage["HUserName"] },
                                success: function (result) {
                                    if (result.data.length != 0) {
                                        var hbillno = result.data[0].单据号
                                        HLZQty = data.流转卡数量;
                                        getRoutingBill(hbillno);
                                    } else {
                                        option.data = [{
                                            "HProcNo": "", "HProcID": 0, "HProcNumber": "", "HProcName": "", "HWorkRemark": "",
                                            "HCenterID": 0, "HCenterNumber": "", "HCenterName": "",
                                            "HDeptID": 0, "HDeptNumber": "", "HDeptName": "",
                                            "HSupID": 0, "HSupNumber": "", "HSupName": "", "HSupFlag": "false",
                                            "HQty": 0, "HOutPrice": 0, "HRemark": "", "HRelationQty_In": 0, "HRelationQty_Out": 0,
                                            "HRelationQty_WWOrder": 0, "HRelationQty_Bad": 0, "HOverRate": 0, "HMaxQty": 0,
                                            "HPassRate": 0, "HSumPassRate": 0, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                                        }];
                                        table.render(option);
                                    }
                                },
                                error: function (result) {
                                    layer.close(index);
                                    console.log(result);
                                    //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                                }
                            })
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    }
                })
                //txtHBillNo.Text = sBillNo;
                //GetICMOBillDetail(hmainid, HEntryID);
 
            }
 
            function GetICMOBillDetail(hmainid, HEntryID) {
                $.ajax({
                    url: GetWEBURL() + "/Sc_ProcessExchangeBill/GetICMOBillList",
                    type: "GET",
                    data: { "hmainid": hmainid, "HEntryID": HEntryID, "OrganizationID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                            for (var i = 1; i <= option.data.length; i++) {
                                $('#HSupFlag' + i + '').find("option[value='" + option.data[i - 1].HSupFlag + "']").attr("selected", true);
                            }
                            form.render('select');
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    }
                })
            }
 
            //行选择处理(是否委外)
            form.on('select(HSupFlag)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HSupFlag = data.value;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //以上为layui模块
        });
 
 
        //定义全局变量HMainMaterID
        var subProcName, subProcNumber, subProcID,
            subWorkCenterName, subWorkCenterNumber, subWorkCenterID,
            subSupName, subSupNumber, subSupID,
            HReasonName, ReasonID, EmpName,
            ZRProcName, QRName;
 
 
    </script>
</body>
</html>