_goods.html
103 KB
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
<include file="public/layout"/>
<script src="__PUBLIC__/static/js/layer/laydate/laydate.js"></script>
<script src="__PUBLIC__/js/drag-arrange.js"></script>
<!--物流配置 css -start-->
<!--物流配置 css -start-->
<style>
ul.group-list {
width: 96%;
min-width: 1000px;
margin: auto 5px;
list-style: disc outside none;
}
ul.group-list li {
white-space: nowrap;
float: left;
width: 150px;
height: 25px;
padding: 3px 5px;
list-style-type: none;
list-style-position: outside;
border: 0px;
margin: 0px;
}
.row .table-bordered td .btn, .row .table-bordered td img {
vertical-align: middle;
}
.row .table-bordered td {
padding: 8px;
line-height: 1.42857143;
}
.table-bordered {
width: 100%
}
.table-bordered tr td {
border: 1px solid #f4f4f4;
}
.btn-success {
color: #fff;
background-color: #449d44;
border: #398439 solid 1px;
}
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.red {
border: 1px #ddd solid;
color: #666;
padding: 3px 12px;
}
.red:hover {
background-color: red;
border: 1px red solid;
color: #fff;
}
.col-xs-8 {
width: 66.66666667%;
}
.col-xs-4 {
width: 33.33333333%;
}
.col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
float: left;
}
.row .tab-pane h4 {
padding: 10px 0;
}
.row .tab-pane h4 input {
vertical-align: middle;
}
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #f9f9f9;
}
.ncap-form-default .title {
border-bottom: 0
}
.ncap-form-default dl.row, .ncap-form-all dd.opt {
/*border-color: #F0F0F0;*/
border: none;
}
.ncap-form-default dl.row:hover, .ncap-form-all dd.opt:hover {
border: none;
box-shadow: inherit;
}
.mtb10 { margin: 10px 0; }
.mainspan {
width: 40px;
height: 20px;
line-height: 20px;
font-size: 12px;
color: #fff; background: red;
position: absolute;
top: 0; left: 0
}
.newlist_ware {
max-width: 1800px;
overflow-x: auto;
}
.newlist {
border: 1px #ddd solid;
}
.newlist thead tr, .newlist tbody tr {
white-space: nowrap;
font-size: 0;
border-bottom: 1px #ddd solid;
}
.newlist tr td {
width: 100px;
display: inline-block;
border-right: 1px #ddd solid;
text-align: center;
padding: 5px 10px;
/*!*white-space: initial;*!允许换行*/
height: 48px;
line-height: 48px;
}
.newlist thead tr td:last-child {
border-right: 0;
}
.newlist tbody tr td:last-child {
border-right: 0;
}
.newlist thead tr td {
font-size: 14px;
background-color: #F5F5F5;
color: #000;
}
.newlist tbody tr td {
font-size: 12px;
color: #666;
height: 60px;
line-height: 60px;
}
.newlist tbody tr td img {
max-width: 100%;
max-height: 55px;;
}
.newlist tbody tr td input, .newlist tbody tr td input:hover, .newlist tbody tr td input:active, .newlist tbody tr td input:focus {
width: 100%;
border: 0;
text-align: center;
}
.goodsize {
color: #999;
font-size: 12px;
display: block;
}
.newlist .dn {
display: none;
}
.layui-layer-tips .layui-layer-content{
padding: 0;
line-height: 0;
}
.layui-layer-TipsG{
display: none;
}
.goods_xc .click_big_img{position: absolute; top:0;right:0; display: none}
.gd_title{font-weight: bolder }
.show_video{ width: 300px; height: 200px;position: relative; display: none}
.show_video img{width: 100%; height: 100%; }
.show_video .men{position: absolute; width: 100%; height: 100%;
top:0; left: 0; background-color: rgba(0,0,0,0.2);}
.show_video .play_btn{position: absolute;
top:0; left: 0; width: 44px; left: 50%; top: 50%; margin-left:-22px; margin-top: -22px ;
height:44px;}
.show_video .del{
position: absolute; width: 100%; height: 100%; text-align: center; font-size: 14px;
left: 0; width: 100px; left:40px; top: 80%; height:44px; color: #fff;
}
.show_video .del2{
position: absolute; width: 100%; height: 100%; text-align: center; font-size: 14px;
top:0; left: 0; width: 100px; left:140px; top: 80%;
height:44px; color: #fff;
}
.buttons{
border-radius: 5px; height: 28px;
}
.rates{
width: 100%;
height: 40px;
padding-top: 10px;
text-align: center;
}
.mongolia{
width:100%;
height:100%;
left:0;top:0;
position:fixed;
background:rgba(0,0,0,0.1);
z-index: 999;
display:none;
}
.point{
position: fixed;
left: 50%;
top: 50%;
width: 300px;
height: 200px;
margin: -100px 0px 0px -150px;
z-index: 1;
}
.pop{
width: 300px;
height: 200px;
background: #f5f5f5;
padding: 20px;
background-clip: padding-box;
}
.close{
width: 20px;
height: 20px;
float: right;
}
.td-number{
width: 133px;
height: 35px;
text-align: center;
line-height: 35px;
}
.confirm{
width: 88px;
border-radius: 5px;
height:35px;
border: 1px solid;
background-color: #fff;
}
.inputs{
width: 130px;
height: 30px;
}
.add-goods{
width: 86px;
height: 26px;
border-radius: 5px;
font-family: 'Arial Normal', 'Arial';
border: 1px solid #D7D7D7;
margin-left: 7px;
font-size: 13px;
text-align: center;
margin-top: 2px;
}
</style>
<!--物流配置 css -end-->
<!--以下是在线编辑器 代码 -->
<script type="text/javascript">
/*
* 在线编辑器相 关配置 js
* 参考 地址 http://fex.baidu.com/ueditor/
*/
window.UEDITOR_Admin_URL = "/public/plugins/Ueditor/";
var URL_upload = "{$URL_upload}";
var URL_fileUp = "{$URL_fileUp}";
var URL_scrawlUp = "{$URL_scrawlUp}";
var URL_getRemoteImage = "{$URL_getRemoteImage}";
var URL_imageManager = "{$URL_imageManager}";
var URL_imageUp = "{$URL_imageUp}";
var URL_getMovie = "{$URL_getMovie}";
var URL_home = "{$URL_home}";
</script>
<script type="text/javascript" charset="utf-8"
src="/public/plugins/Ueditor/ueditor.config.js?v=__CSSVERSION__"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/lang/en/en.js"></script>
<script type="text/javascript">
var url = "{:url('Ueditor/index',array('savepath'=>'goods'))}";
var editor;
$(function () {
//具体参数配置在 editor_config.js 中
var options = {
zIndex: 999,
initialFrameWidth: "95%", //初化宽度
initialFrameHeight: 400, //初化高度
focus: false, //初始化时,是否让编辑器获得焦点true或false
maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign'
, //允许的最大字符数 'fullscreen',
pasteplain: false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
autoHeightEnabled: true
, serverUrl: url
};
editor = new UE.ui.Editor(options);
editor.render("goods_content"); // 指定 textarea 的 id 为 goods_content
});
</script>
<!--以上是在线编辑器 代码 end-->
<body style="background-color: #FFF; overflow: auto;" ondragstart="return false">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
<div class="fixed-bar">
<div class="item-title">
<div class="fixed-bar">
<div class="item-title">
<a class="back" href="javascript:window.history.back()" title="返回列表">
<i class="fa fa-arrow-circle-o-left"></i>
</a>
<div class="subject">
<h3>商品管理</h3>
<h5>商城所有商品索引及管理</h5>
</div>
<ul class="tab-base nc-row">
<li><a href="javascript:void(0);" data-index='1' class="tab current"><span>通用信息</span></a></li>
<li><a href="javascript:void(0);" data-index='2' class="tab"><span>商品相册</span></a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- 操作说明 -->
<div class="explanation" id="explanation">
<div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
<h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
<span id="explanationZoom" title="收起提示"></span></div>
<ul>
<li>异常商品修复:关键字搜索未添加的商品,若搜索不到,点击此项后再添加即可。</li>
</ul>
</div>
<!--表单数据-->
<form method="post" id="goods_data">
<input type="hidden" name="oldurl" value="{$oldurl}" class="input-txt">
<!--通用信息-->
<div class="ncap-form-default tab_div_1">
<if condition="empty($goodsInfo.goods_id) && $p_erpid">
<dl class="row">
<dt class="tit">
<label for="key">关键字搜索</label>
</dt>
<dd class="opt">
<input type="text" onkeydown="strkeydown(event, this, 'search')" id="key" class="input-txt" placeholder="请输入名称/编号/条码"
onblur="if(this.value != ''){$(this).next().next().addClass('dn')}">
<input id="search" type="button" value="点击搜索商品" onclick="search_goods('#key')" class="input-btn">
<input id="updateerp" type="button" value="异常商品修复" onclick="updateerp_goods('#key')" class="input-btn">
<span class="err cr dn"></span>
</dd>
</dl>
</if>
<dl class="row">
<dt class="tit">
<label for="goods_name">商品名称</label>
</dt>
<dd class="opt">
<input id="goods_name" type="text" value="{$goodsInfo.goods_name}" maxlength="180"
onkeydown="strkeydown(event, this, 'sumbbtn')" name="goods_name" class="input-txt">
<span class="err cr"></span>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="sku">商品条码</label>
</dt>
<dd class="opt">
<input type="text" value="{$goodsInfo.sku}" name="sku" class="input-txt" id="sku" <if condition="empty($goodsInfo.goods_id) && $p_erpid">readonly</if>>
<span class="err cr"></span>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="goods_remark">分享描述</label>
</dt>
<dd class="opt">
<input type="text" name="goods_remark" class="" style="width: 600px;" id="goods_remark" value="{$goodsInfo.goods_remark}"> <span class="err cr"></span> <p class="notic">微信分享给好友时会显示,建议36个字以内<a href="javascript:;" onclick="sharetest()" style="margin-left: 5px;" >查看示例</a></p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="keywords">商品关键词</label>
</dt>
<dd class="opt">
<input type="text" value="{$goodsInfo.keywords}" name="keywords" class="input-txt" id="keywords"
onkeydown="strkeydown(event, this, 'sumbbtn')">
<span class="err cr"></span>
</dd>
</dl>
<dl class="row">
<dt class="tit">图片上传</dt>
<dd class="opt">
<div class="ncsc-goods-default-pic">
<div class="goodspic-uplaod">
<img id="original_img2" style="width: 240px; border:#eee solid 1px" onmouseout="layer.closeAll();"
onmouseover="layer.tips('<img src='+this.src+'>',this, {tips: [1, '#fff'],time:10000});"
src="{:getImg($goodsInfo.original_img,'/public/images/default_goods_image_240.gif')}">
<input type="hidden" id="original_img" name="original_img"
value="{$goodsInfo.original_img}">
<p class="hint">请上传图片格式文件,<Font color="red">大小建议为:600*600像素。</Font></p>
<div class="handle">
<if condition="$isnowater eq 1">
<p style="color: red">请到系统水印配置上传水印图片!</p>
<else/>
<div class="ncsc-upload-btn">
<a onClick="GetUploadify_new(1,'original_img','goods','{$erpid}','goods','goods_id','original_img','{$goodsInfo.goods_id}','call_back')">
<p><i class="icon-upload-alt"></i>图片上传</p>
</a>
</div>
</if>
</div>
</div>
</div>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="cat_id">规格明细{$rank_switch}</label>
</dt>
<dd class="opt">
<div class="newlist_ware">
<table class="newlist">
<thead>
<tr>
<td>商品信息</td>
<td>市场价</td>
<td>手店价</td>
<td class="<if condition='empty($mz_switch)'>dn</if>">美妆价</td>
<td>库存</td>
<td>已售</td>
<td>限购</td>
<if condition="$pattern eq 0">
<td>佣金</td>
</if>
<if condition="$pattern eq 1">
<td>一级分成</td>
<td>二级分成</td>
<td>三级分成</td>
</if>
<td>重量</td>
<td class="<if condition='empty($rank_switch)'>dn</if>">售价(一)</td>
<td class="<if condition='empty($rank_switch)'>dn</if>">售价(二)</td>
<td class="<if condition='empty($rank_switch)'>dn</if>">售价(三)</td>
<td style="width: 150px;">规格图片</td>
<td>是否显示</td>
<td>操作</td>
</tr>
</thead>
<tbody id="goods_list">
<volist name="$goodsInfo.goods_list" id="vv" key="k">
<tr>
<td style="display: none">
<input type="hidden" name="data[{$k}][goods_id]" value="{$vv.goods_id}">
<input type="hidden" name="data[{$k}][goods_sn]" value="{$vv.goods_sn}">
<input type="hidden" name="data[{$k}][erpwareid]" value="{$vv.erpwareid}">
</td>
<td style="line-height: 24px;text-align: left">
<if condition="$p_erpid"> {$vv.goods_sn}
<else/>
<input type="text" name="data[{$k}][goods_sn]"
onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
value="{$vv.goods_sn}" placeholder="商品编号" style="width:60px">
</if>
<em class="goodsize"><input type="text" name="data[{$k}][goods_spec]" value="{$vv.goods_spec}" placeholder="规格" style="width:40px"> /
<input type="text" name="data[{$k}][goods_color]" value="{$vv.goods_color}" placeholder="颜色" style="width:40px">
</em>
</td>
<td>
<input type="text" placeholder="必填" value="{$vv.market_price}"
name="data[{$k}][market_price]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td>
<input type="text" placeholder="必填" value="{$vv.shop_price}"
name="data[{$k}][shop_price]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td class="<if condition='empty($mz_switch)'>dn</if>">
<input type="text" placeholder="必填" value="{$vv.mz_price}"
name="data[{$k}][mz_price]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td>
<input type="text" placeholder="必填" value="{$vv.store_count}"
name="data[{$k}][store_count]" autocomplete="off"
onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
<if condition="$vv.prom_type eq 1 || $vv.prom_type eq 2 || $vv.prom_type eq 4">readonly</if>>
</td>
<td>
<input type="text" placeholder="必填" value="{$vv.sales_sum}"
name="data[{$k}][sales_sum]" autocomplete="off"
onkeyup="this.value=this.value.replace(/[^\d]/g,'')">
</td>
<td>
<input type="text" placeholder="必填" value="{$vv.viplimited}"
name="data[{$k}][viplimited]" autocomplete="off"
onkeyup="this.value=this.value.replace(/[^\d]/g,'')">
</td>
<if condition="$pattern eq 0">
<td>
<input type="text" placeholder="分佣" value="{$vv.commission}"
name="data[{$k}][commission]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
</if>
<if condition="$pattern eq 1">
<td>
<input type="text" placeholder="一级分成" value="{$vv.fir_rate}"
name="data[{$k}][fir_rate]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td>
<input type="text" placeholder="二级分成" value="{$vv.sec_rate}"
name="data[{$k}][sec_rate]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td>
<input type="text" placeholder="三级分成" value="{$vv.thi_rate}"
name="data[{$k}][thi_rate]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')" onclick="distributnotic(this)">
</td>
</if>
<td>
<input type="text" placeholder="必填" value="{$vv.weight}"
name="data[{$k}][weight]" autocomplete="off"
onkeyup="this.value=this.value.replace(/[^\d]/g,'')">
</td>
<td class="<if condition='empty($rank_switch)'>dn</if>">
<input type="text" placeholder="必填" value="{$vv.cardprice1}"
name="data[{$k}][cardprice1]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td class="<if condition='empty($rank_switch)'>dn</if>">
<input type="text" placeholder="必填" value="{$vv.cardprice2}"
name="data[{$k}][cardprice2]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td class="<if condition='empty($rank_switch)'>dn</if>">
<input type="text" placeholder="必填" value="{$vv.cardprice3}"
name="data[{$k}][cardprice3]" autocomplete="off"
onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">
</td>
<td style="line-height: normal;width: 150px;color: red;">
<img src="{:getImg($vv.spec_img,'__PUBLIC__/images/default_goods_image_240.gif')}" onmouseout="layer.closeAll('tips');"
onmouseover="layer.tips('<img src='+this.src+' width=300px height=300px>',this, {tips: [1, '#fff'],time:10000});"
onclick="GetUploadify_new(1,'spec_img{$k}','goods','{$erpid}','goods','goods_id','spec_img','{$vv.goods_id}','call_back')">
<input type="hidden" value="{$vv.spec_img}" name="data[{$k}][spec_img]" id="spec_img{$k}">
</td>
<td>
<input type="checkbox" name="data[{$k}][is_mainshow]" value="1" <if condition="$vv.is_mainshow eq 1">checked</if>>
</td>
<td>
<if condition="$k neq 1">
<a class="btn red" data-id="{$vv.goods_id}" onclick="del_goods(this)">删除</a>
</if>
</td>
</tr>
</volist>
</tbody>
</table>
</div>
<div class="mtb10">
<if condition = "empty($p_erpid)" >
<input style="margin-top: 2px;" type="button" value="添加相同条码商品" onclick="addnewsgoods()" class="input-btn"/>
<else/>
<input style="margin-top: 2px;" type="button" value="添加相同条码商品" onclick="search_all()" class="input-btn"/>
</if>
</div>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="cat_id">商品分类</label>
</dt>
<dd class="opt">
<select name="cat_id" id="cat_id" onChange="get_category(this.value,'cat_id_2','0');"
class="small form-control">
<option value="0">请选择商品分类</option>
<foreach name="cat_list" item="v" key="k">
<option value="{$v['id']}"
<if condition="$v.id eq $level_cat['1']">selected</if>>
{$v.mobile_name}
</option>
</foreach>
</select>
<select name="cat_id_2" id="cat_id_2" onChange="get_category(this.value,'cat_id_3','0');"
class="small form-control">
<option value="0">请选择商品分类</option>
</select>
<select name="cat_id_3" id="cat_id_3" class="small form-control">
<option value="0">请选择商品分类</option>
</select>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="brand_id">商品品牌</label>
</dt>
<dd class="opt">
<select name="brand_id" id="brand_id" class="small form-control">
<option value="0">所有品牌</option>
<foreach name="brandList" item="v" key="k">
<option value="{$v.id}"
<if condition="$v.id eq $goodsInfo.brand_id">selected</if>>
{$v.name}
</option>
</foreach>
</select>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="nation_id">商品国别</label>
</dt>
<dd class="opt">
<select name="nation_id" id="nation_id" class="small form-control">
<option value="">所有国别</option>
<foreach name="nationList" item="v" key="k">
<option value="{$v.id}"
<if condition="$v.id eq $goodsInfo.nation_id">selected</if>>
{$v.name}
</option>
</foreach>
</select>
</dd>
</dl>
<dl class="row">
<dt class="tit">
是否积分
</dt>
<dd class="opt">
<input id="give_integral1" type="radio" name="give_integral" value="1"
<if condition="$goodsInfo.give_integral eq 1">checked</if>>
<label for="give_integral1">是</label>
<input id="give_integral0" type="radio" name="give_integral" value="0"
<if condition="$goodsInfo.give_integral eq 0">checked</if>>
<label for="give_integral0">否</label>
</dd>
</dl>
<dl class="row">
<dt class="tit">
配送方式
</dt>
<dd class="opt">
<input id="distr_type0" type="radio" name="distr_type" value="0"
<if condition="$goodsInfo.distr_type eq 0"> checked</if>>
<label for="distr_type0">用户自选</label>
<input id="distr_type1" type="radio" name="distr_type" value="1"
<if condition="$goodsInfo[distr_type] eq 1"> checked</if>>
<label for="distr_type1">自提</label>
<input id="distr_type2" type="radio" name="distr_type" value="2"
<if condition="$goodsInfo[distr_type] eq 2"> checked</if>>
<label for="distr_type2">物流</label>
</dd>
</dl>
<dl class="row">
<dt class="tit">
分销类型
</dt>
<dd class="opt">
<input id="dis_type0" type="radio" name="dis_type" value="0"
<if condition="$goodsInfo.dis_type eq 0"> checked</if>>
<label for="dis_type0">必经营</label>
<input id="dis_type1" type="radio" name="dis_type" value="1"
<if condition="$goodsInfo.dis_type eq 1"> checked</if>>
<label for="dis_type1">可选</label>
</dd>
</dl>
<!--运费设置-->
<dl class="row">
<dt class="tit">
运费设置
</dt>
<dd class="opt">
<input id="exp_sum_type3" onclick="showfir(0)" type="radio" name="exp_sum_type" value="3"
<if condition="$goodsInfo[exp_sum_type] eq 3"> checked</if>>
<label for="exp_sum_type3">按件数</label>
<input id="exp_sum_type2" onclick="showfir(0)" type="radio" name="exp_sum_type" value="2"
<if condition="$goodsInfo[exp_sum_type] eq 2"> checked</if>>
<label for="exp_sum_type2">按重量 </label>
<input id="exp_sum_type1" onclick="showfir(1)" type="radio" name="exp_sum_type" value="1"
<if condition="$goodsInfo[exp_sum_type] eq 1"> checked</if>>
<label for="exp_sum_type1">统一运费</label>
</dd>
</dl>
<!---如果统一运费--->
<dl class="row <if condition=' $goodsInfo[exp_sum_type] neq 1'>dn</if>" id="expfir">
<dt class="tit">
<label for="uniform_exp_sum">统一运费费用</label>
</dt>
<dd class="opt">
<input type="text" value="{$goodsInfo.uniform_exp_sum}" name="uniform_exp_sum" class="t_mane"
id="uniform_exp_sum" onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
onkeydown="strkeydown(event, this, 'sumbbtn')">元
<p class="notic">用于统一运费费用</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<em>*</em>上架时间
</dt>
<dd class="opt">
<input type="text" id="on_time" name="on_time" class="input-txt"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="{$goodsInfo.on_time|date='Y-m-d H:i:s',###}">
<span class="err cr"></span>
</dd>
</dl>
<dl class="row">
<dt class="tit">
下架时间
</dt>
<dd class="opt">
<input type="text" id="down_time" name="down_time" onkeydown="strkeydown(event, this, 'sumbitbtn')"
class="input-txt"
value="<if condition='$goodsInfo.down_time neq 0'>{$goodsInfo.down_time|date='Y-m-d H:i:s',###}</if>">
<span class="err cr"></span>
<p class="notic">下架时间为空或0的时候,代表不限</p>
</dd>
</dl>
<if condition='$goodsInfo.edit_time neq 0'>
<dl class="row">
<dt class="tit">
最后修改时间
</dt>
<dd class="opt">
{$goodsInfo.edit_time|date='Y-m-d H:i:s',###}
</dd>
</dl>
</if>
<dl class="row dn" style="">
<dt class="tit">
<label for="exchange_integral">兑换积分</label>
</dt>
<dd class="opt">
<input type="text" value="{$goodsInfo.exchange_integral|default=0}" name="exchange_integral"
onkeydown="strkeydown(event, this, 'sumbbtn')" class="t_mane"
onKeyUp="this.value=this.value.replace(/[^\d]/g,'')"
onpaste="this.value=this.value.replace(/[^\d]/g,'')"/>
<span class="err" id="err_exchange_integral"></span>
</dd>
</dl>
<if condition="empty($p_erpid)">
<dl class="row">
<dt class="tit">
虚拟商品
</dt>
<dd class="opt">
<input id="is_virtual0" type="radio" name="is_virtual" value="0"
<if condition="$goodsInfo.is_virtual eq 0 || empty($goodsInfo.is_virtual)"> checked</if>>
<label for="is_virtual0">否</label>
<input id="is_virtual1" type="radio" name="is_virtual" value="1"
<if condition="$goodsInfo.is_virtual eq 1"> checked</if>>
<label for="is_virtual1">是</label>
</dd>
</dl>
</if>
<dl class="row">
<dt class="tit">
<label for="goods_content">商品详情</label>
</dt>
<dd class="opt">
<input type="radio" id="radio0" name="pic_radio" placeholder="" checked>
<label for="radio0">淘宝一键搬家</label>
<input type="radio" id="radio1" name="pic_radio" placeholder="">
<label for="radio1">美妆图库获取</label>
<!--淘宝一键搬家-->
<div id="taobao">
<input type="text" style="width: 700px" id="move" autocomplete="off" placeholder="http://"/>
<a class="ncap-btn" onclick="move()">开始搬家</a>
<p class="notic" style="color:red">因近期淘宝图片搬家的规则有所改动导致很多商品的图片详情未能获取,建议先使用美妆图库获取或手动添加,技术调试可用后再另行通知!</p>
</div>
<!--美妆图库获取-->
<div id="meizhuang" class="dn">
<p class="mtb10"><a class="ncap-btn" onclick="snap()">商品描述快照</a></p>
</div>
<textarea class="span12 ckeditor" id="goods_content" name="goods_content" title="">{$goodsInfo.goods_content}</textarea>
</dd>
</dl>
</div>
<!--通用信息-->
<!-- 商品相册-->
<div class="ncap-form-default tab_div_2" style="display:none;">
<!---商品图片-->
<div class="gd_title">上传产品主图</div>
<dl class="row">
<div class="tab-pane" id="tab_goods_images">
<table class="table table-bordered">
<tbody>
<tr>
<td>
<foreach name="goodsImages" item="vo" key="k">
<div style="width:100px; text-align:center; margin: 5px; display:inline-block; position: relative"
class="goods_xc">
<if condition="$vo['ismain'] eq 1"><span class="mainspan">主图</span></if>
<img onclick="go_show_big(this)" class="click_big_img"
img_href="{:getImg($vo.image_url,'__PUBLIC__/images/default_goods_image_240.gif')}" src="__PUBLIC__/static/images/model/select1.png">
<input type="hidden" value="{$vo['image_url']}" name="goods_images[]">
<!--<a onClick="" target="_blank" href="{:getImg($vo.image_url,'__PUBLIC__/images/default_goods_image_240.gif')}">-->
<img class="m_img" width="100" height="100" src="{:getImg($vo.image_url,'__PUBLIC__/images/default_goods_image_240.gif')}">
<!--</a>-->
<br>
<a href="javascript:void(0)" ismain="{$vo['ismain']}" onClick="ClearPicArr2(this,'{$vo['image_url']}')">删除</a>
<if condition="$vo.ismain eq 0">
| <a href="javascript:void(0)" ismain="{$vo['ismain']}" onClick="updateimgmain(this,'{$vo['image_url']}',{$vo['img_id']})">设为主图</a>
</if>
</div>
</foreach>
<div class="goods_xc"
style="width:100px; text-align:center; margin: 5px; display:inline-block;">
<input type="hidden" name="goods_images[]" value=""/>
<a href="javascript:void(0);"
onClick="GetUploadify_new(5,'','goods','{$erpid}','goods_images','goods_id','','','call_back2')">
<img src="__PUBLIC__/images/add-button.jpg" width="100" height="100"/></a>
<br/>
<a href="javascript:void(0)"> </a>
<a href="javascript:void(0)" id="mainset"> </a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</dl>
<!---商品视频-->
<div class="gd_title">上传产品视频</div>
<dl class="row">
<div class="tab-pane" id="tab_goods_images">
<table class="table table-bordered">
<tbody>
<tr>
<td>
<!---判断地址是否存在--->
<if condition="empty($v_url)">
<input id="v_img" name="v_img[]" type="hidden"/>
<input id="v_url" name="v_url[]" type="hidden"/>
<input id="v_id" name="up_video_id[]" type="hidden"/>
<!---显示上传视频结果的层--->
<div class="show_video"></div>
<!---显示上传图片的按钮--->
<div id="add_v_div">
<a href="javascript:void(0);"
onClick="open_video()">
<img src="__PUBLIC__/images/add-button.jpg" width="100" height="100"/></a>
</div>
<else/>
<foreach name="$v_url" item="v" key="k">
<input id="v_img{$k}" name="v_img[]" value="{$v.video_img}" type="hidden"/>
<input id="v_url{$k}" name="v_url[]" value="{$v.video_url}" type="hidden"/>
<input id="v_id{$k}" name="up_video_id[]" value="{$v.up_video_id}" type="hidden"/>
<div class="show_video" style="display: block">
<img src='{$qclurl.$v.video_img}'/>
<div class='men'></div>
<img kk="{$k}" onclick='play_video(this)' class='play_btn' src='__PUBLIC__/images/v_btn.png'/>
<div kk="{$k}" onclick='del_video(this)' class='del'><i class='icon-trash'></i> 删除视频 </div>
<div kk="{$k}" onclick='edit_video(this)' class='del2'><i class='fa fa-edit'></i> 编辑视频 </div>
</div>
</foreach>
<!---显示上传图片的按钮--->
<div id="add_v_div" style="display: none">
<a href="javascript:void(0);"
onClick="open_video()">
<img src="__PUBLIC__/images/add-button.jpg" width="100" height="100"/></a>
</div>
</if>
</td>
</tr>
<tr>
<td style="border: none">小提示:视频大小仅支持在手机端播放,建议时长9-30秒,建议视频宽高比16:9</td>
</tr>
</tbody>
</table>
</div>
</dl>
</div>
<!-- 确认提交-->
<div class="ncap-form-default">
<div class="bot">
<a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" id="sumbbtn" onClick="ajax_submit_form()">确认提交</a>
</div>
</div>
<input type="hidden" id="iseditimg" name="iseditimg" value="0">
</form>
<!--表单数据-->
<input type="hidden" id="ueditPath" value="goods">
<input type="hidden" id="qclurl" value="{$qclurl}">
<input type="hidden" id="pattern" value="{$pattern}">
<!--专门用来添加图片的div层-->
<div id="copy_img_div" style="display: none">
<div style="width:100px; text-align:center; margin: 5px; display:inline-block; position: relative"
class="goods_xc">
<img class="click_big_img" onclick="go_show_big(this)" img_href="" src="__PUBLIC__/static/images/model/select1.png">
<input type="hidden" value="" name="goods_images[]">
<img class="m_img" width="100" height="100" src="{:getImg($vo.image_url,'__PUBLIC__/images/default_goods_image_240.gif')}">
<br>
<a href="javascript:void(0)" onClick="ClearPicArr2(this,'{$vo['image_url']}')">删除</a>
<a href="javascript:void(0)" onClick="updateimgmain(this,'{$vo['image_url']}',{$vo['img_id']})">设为主图</a>
</div>
</div>
<!---弹出视频播放--->
<div class="laybox" hidden>
<video id="play_video" width="640" height="360" src="" controls autobuffer></video>
</div>
</div>
<div id="goTop">
<a href="JavaScript:void(0);" id="btntop"><i class="fa fa-angle-up"></i></a>
<a href="JavaScript:void(0);" id="btnbottom"><i class="fa fa-angle-down"></i></a>
</div>
<script type="text/javascript">
var mokun="{$mokun}";
var key = '';//关键字
var seardata = '';//接口返回数据
var count = '';//接口返回的个数
var sku = $('#sku').val();//sku值
var mz = "{$mz_switch}";//是否开启美妆
var rank = "{$rank_switch}";//是否开启等级
var leng = $('#goods_list tr').length + 1;//获取table行数
var sta_con = false;//提交验证数据
var sta_msg = '';//提交验证数据
//搬家
function move() {
var str = $('#move').val();
var objExp = new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/);
if (objExp.test(str) == false) {
layer.msg("请输入正确的网址格式!", {icon: 2, time: 2000});
$("#move").focus();
return;
}
var res = str.match(/http(s)?:\/\/([^\/]+)\//i);
var name = '';
if (res[0].indexOf('taobao') > 0) {
name = 'taobao';
} else if (res[0].indexOf('tmall') > 0) {
name = 'tmall';
} else if (res[0].indexOf('1688') > 0) {
name = '1688';
} else if (res[0].indexOf('liangxinyao') > 0){
name = 'liangxinyao';
} else{
layer.msg("请输入天猫、淘宝、阿里巴巴商品网页", {icon: 2, time: 2000});
return;
}
$.ajax({
type: 'GET',
url: "{:U('Admin/Goods/goods_move')}",
data: {
url: $('#move').val(),
name: name
},
beforeSend: function () {
index = layer.msg('网页抓取中...', {
icon: 16,
shade: [0.5, '#f5f5f5'],
scrollbar: false,
offset: '200px',
time: 0
});
},
success: function (data) {
var getqclurl = $("#qclurl").val();
$('textarea[name="goods_content"]').text(data.html);
editor.setContent(data.html, false);
$('#original_img2').attr('src', getqclurl + data.img[0]);
$('#original_img').val(data.img[0]);
var last_div = $("#copy_img_div").html();
//按钮以前都删除掉
var len=$("td .goods_xc").length;
for(var i=0;i<len-1;i++){
$(".goods_xc:eq(0)").remove();
}
for (i = 1; i < data.img.length; i++) {
//$(".goods_xc:last").after(last_div); //插入一个新图片
$(".goods_xc:eq(0)").before(last_div); // 插入一个 新图片
$(".goods_xc:eq(0)").find('img.click_big_img').attr('href', getqclurl + data.img[i]);// 修改他的链接地址
$(".goods_xc:eq(0)").find('img.m_img').attr('src', getqclurl + data.img[i]);// 修改他的图片路径
$(".goods_xc:eq(0)").find('a:eq(0)').attr('onclick', "ClearPicArr2(this,'" + data.img[i] + "')").text('删除');
$(".goods_xc:eq(0)").find('a:eq(1)').attr('onclick', "updateimgmain1(this,'" + data.img[i] + "')").text('设为主图');
$(".goods_xc:eq(0)").find('input').val(data.img[i]); // 设置隐藏域 要提交的值
}
//拖动事件
$('.goods_xc').arrangeable();
$(".goods_xc").hover(function () {
$(this).find(".click_big_img").show();
},function () {
$(this).find(".click_big_img").hide();
})
layer.close(index);
},
error: function () {
layer.closeAll();
layer.msg('该宝贝链接地址无法获取,请重新换个链接地址!', {icon: 2});
return;
}
});
}
//-----------美妆图库------------
function snap() {
var sku = $('input[name="sku"]').val();
if (sku == '') {
layer.msg("商品条形码为空,请先选择商品", {icon: 2});
return;
}
$.ajax({
type: 'GET',
url: "{:U('Admin/Goods/goods_snap')}",
data: {sku: sku},
beforeSend: function () {
index = layer.msg('处理中...', {
icon: 16,
shade: [0.5, '#f5f5f5'],
scrollbar: false,
offset: '200px',
time: 0
});
},
success: function (data) {
layer.closeAll();
if (data.code == -1) {
layer.msg(data.msg, {icon: 2});
return;
}
// if (data.code==0){
// $("input[name='goods_sn']").val(data.des['goods_sn']);
// $("input[name='goods_name']").val(data.des['goods_name']);
// $('textarea[name="goods_content"]').text(data.des['goods_content']);
// editor.setContent(data.des['goods_content'], false);
// $('#original_img2').attr('src', 'https://mshopimg.yolipai.net' + data.des['original_img']);
// $('#original_img').val(data.des['original_img']);
// layer.msg(data.msg,{icon:2});return;
// }
if (data.code == 1) {
var getqclurl = $("#qclurl").val();
// $("input[name='goods_sn']").val(data.des['goods_sn']);
// $("input[name='goods_name']").val(data.des['goods_name']);
$('textarea[name="goods_content"]').text(data.des['goods_content']);
editor.setContent(data.des['goods_content'], false);
$('#original_img2').attr('src', getqclurl + data.des['original_img']);
$('#original_img').val(data.des['original_img']);
var last_div = $("#copy_img_div").html();
//按钮以前都删除掉
//按钮以前都删除掉
var len=$("td .goods_xc").length;
for(var i=0;i<len-1;i++){
$(".goods_xc:eq(0)").remove();
}
for (i = 0; i < data.img.length; i++) {
$(".goods_xc:eq(0)").before(last_div); // 插入一个 新图片
$(".goods_xc:eq(0)").find('img.click_big_img').attr('href', getqclurl + data.img[i]['image_url']);// 修改他的链接地址
$(".goods_xc:eq(0)").find('img.m_img').attr('src', getqclurl + data.img[i]['image_url']);// 修改他的图片路径
$(".goods_xc:eq(0)").find('a:eq(0)').attr('onclick', "ClearPicArr2(this,'" + data.img[i]['image_url'] + "')").text('删除');
$(".goods_xc:eq(0)").find('a:eq(1)').attr('onclick', "updateimgmain1(this,'" + data.img[i]['image_url'] + "')").text('设为主图');
$(".goods_xc:eq(0)").find('input').val(data.img[i]['image_url']); // 设置隐藏域 要提交的值
}
//拖动事件
$('.goods_xc').arrangeable();
$(".goods_xc").hover(function () {
$(this).find(".click_big_img").show();
},function () {
$(this).find(".click_big_img").hide();
})
layer.msg(data.msg, {icon: 1});
return;
}
},
error: function () {
layer.closeAll();
layer.msg('请联系管理员', {icon: 2});
return;
}
});
}
$(document).ready(function () {
$('#on_time').layDate();
$('#down_time').layDate();
$("input[name='exchange_integral']").blur(function () {
var shop_price = parseInt($("input[name='shop_price']").val());
var exchange_integral = parseInt($(this).val());
if (shop_price * 100 < exchange_integral) {
}
});
//插件切换列表
$('.tab-base').find('.tab').click(function () {
$('.tab-base').find('.tab').each(function () {
$(this).removeClass('current');
});
$(this).addClass('current');
var tab_index = $(this).data('index');
$(".tab_div_1, .tab_div_2, .tab_div_3, .tab_div_4").hide();
$(".tab_div_" + tab_index).show();
});
$('#radio0').click(function () {
$('#taobao').removeClass('dn');
$('#meizhuang').addClass('dn');
});
$('#radio1').click(function () {
$('#meizhuang').removeClass('dn');
$('#taobao').addClass('dn');
});
//
<if condition = "empty($p_erpid) and empty($goodsInfo.sku)" >
addnewsgoods();
</if>
// $(window).scroll(function () {
// if ($(".edui-editor-toolbarbox").css('position') == "fixed") {
// $(".edui-editor-toolbarbox").css('top', '58px');
// }
// });
});
//以下是图片上传方法
//上传商品图片成功回调函数
function call_back(fileurl_tmp, obj) {
var getqclurl = $("#qclurl").val();
$(obj).val(fileurl_tmp);
$(obj).prev().attr('src', getqclurl + fileurl_tmp);
if($('#spec_img1').length>0) {
if (obj == '#original_img' && $('#spec_img1').prev()[0].src.indexOf('default_goods_image_240')) {
$('#spec_img1').val(fileurl_tmp);
$('#spec_img1').prev().attr('src', getqclurl + fileurl_tmp);
}
}
//拖动事件
$('.goods_xc').arrangeable();
}
//上传商品相册回调函数
function call_back2(paths) {
var getqclurl = $("#qclurl").val();
var last_div = $("#copy_img_div").html();
console.log(last_div);
var obj=$("td .goods_xc:last");
for (i = 0; i < paths.length; i++) {
obj.before(last_div); // 插入一个 新图片
obj.prev().find('img.click_big_img').attr('href', getqclurl + paths[i]);// 修改他的链接地址
obj.prev().find('img.m_img').attr('src', getqclurl + paths[i]);// 修改他的图片路径
obj.prev().find('a:eq(0)').attr('onclick', "ClearPicArr2(this,'" + paths[i] + "')").text('删除');
obj.prev().find('a:eq(1)').attr('onclick', "updateimgmain1(this,'" + paths[i] + "')").text('设为主图');
obj.prev().find('input').val(paths[i]); // 设置隐藏域 要提交的值
}
$("#iseditimg").val(1);
//拖动事件
$('.goods_xc').arrangeable();
$(".goods_xc").hover(function () {
$(this).find(".click_big_img").show();
},function () {
$(this).find(".click_big_img").hide();
})
}
/*
* 上传之后删除组图input
* @access public
* @val string 删除的图片input
*/
function ClearPicArr2(obj, path) {
var sku = $("#sku").val();
var im = $(obj).attr('ismain');
if (im == "1") {
if (!confirm("此图片是商品主图,确认要删除吗")) {
return;
}
} else {
if (!confirm("您确定要删除该图片吗")) return;
im = 0;
}
$("#iseditimg").val(1);
$.ajax({
type: 'GET',
url: "{:U('Admin/Uploadify/delupload')}",
data: {action: "del", filename: path, delqclo: 1, delsmall: 1},//如果是主图要删除小图
success: function () {
$(obj).parent().remove(); // 删除完服务器的, 再删除 html上的图片
if (im == "1") {
$("#original_img").val("");
$("#original_img2").attr("src", "__PUBLIC__/images/default_goods_image_240.gif");
$("#original_img2").removeAttr("onmouseover");
$("#original_img2").removeAttr("onmouseout");
$("#iseditimg").val(1);
}
}
});
// 删除数据库记录
$.ajax({
type: 'GET',
url: "{:U('Admin/Goods/del_goods_images')}",
data: {filename: path, sku: sku},
success: function () {
//
}
});
}
//新增设置主图
function updateimgmain1(obj,path) {
//
var goods_xc_len=$("#tab_goods_images").find('.goods_xc').length;
for (var i=0;i<goods_xc_len-1;i++)
{
$("#tab_goods_images").find('.goods_xc').find("#mainset").show();
}
$(obj).hide();
$("#iseditimg").val(1);
var getqclurl = $("#qclurl").val();
$("#original_img2").attr("src", getqclurl+path);
$("#original_img").val(path);
layer.msg("设置成功", {icon: 1, time: 1000});
}
//修改设置主图
function updateimgmain(obj,path,img_id)
{
$.ajax({
type: 'GET',
url: "{:U('Admin/Goods/updateimgmain')}",
data: {filename: path, img_id: img_id, sku: $("#sku").val()},
success: function () {
//
$("#iseditimg").val(1);
layer.msg("设置成功", {icon: 1, time: 1000});
setTimeout(function () {
location.href=location.href;
},1000)
}
});
}
function search_all() {
if (sku == '') {
layer.msg("请先搜索商品", {icon: 2, time: 1000});
$('#key').focus();
return false;
}
var a = [];
$("input[name*='goods_sn']").each(function () {
a[a.length] = $(this).val();
});
layer.msg('加载中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '200px', time: 0});
$.ajax({
type: 'get',
url: "{:U('admin/goods/select_all')}",
dataType: 'json',
data: {sku: sku},
error: function () {
layer.closeAll();
layer.msg("服务器繁忙, 请联系管理员!", {icon: 2, time: 1000});
},
success: function (data) {
layer.closeAll();
if (data.code == 1 || data.code == '1') {
if (data.count == undefined || data.count == 0) {
layer.msg("未找到商品", {icon: 2, time: 1000});
return false;
}
var s_data = data.data;
var pattern=$("#pattern").val();
for (var i = 0; i < data.count; i++) {
var row = s_data[i];
++leng;
if ($.inArray(row.WareNo, a) == -1) {
if(pattern==0) {
$('#goods_list').append('<tr><td style="display: none">' +
'<input type="hidden" name="data[' + leng + '][erpwareid]" value="' + row.Id + '">' + '<input type="hidden" name="data[' + leng + '][goods_sn]" value="' + row.WareNo + '"></td>' +
'<td style="line-height: 24px;text-align: left">' + row.WareNo + '<em class="goodsize">' + '<input type="text" name="data[' + leng + '][goods_spec]" value="' + row.SpecName + '" placeholder="规格" style="width:40px">' +
'/<input type="text" name="data[' + leng + '][goods_color]" value="' + row.ColorName + '" placeholder="颜色" style="width:40px">' + '</em></td>' +
'<td><input type="text" placeholder="市场价" value="' + row.PosPrice + '" name="data[' + leng + '][market_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\'"></td>' +
'<td><input type="text" placeholder="手店价" value="0" name="data[' + leng + '][shop_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td class="mz"><input type="text" placeholder="美妆价" value="0" name="data[' + leng + '][mz_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\'"></td>' +
'<td><input type="text" placeholder="库存" value="' + mokun + '" name="data[' + leng + '][store_count]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="销售" value="0" name="data[' + leng + '][sales_sum]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="限购" value="0" name="data[' + leng + '][viplimited]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="佣金" value="0" name="data[' + leng + '][commission]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="重量" value="0" name="data[' + leng + '][weight]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格1" value="0" name="data[' + leng + '][cardprice1]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格2" value="0" name="data[' + leng + '][cardprice2]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格3" value="0" name="data[' + leng + '][cardprice3]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td style="line-height: normal;width: 150px;color: red;">' +
'<img src="__PUBLIC__/images/default_goods_image_240.gif" onclick="GetUploadify_new(1,\'spec_img' + leng + '\',\'goods\',\'{$erpid}\',\'goods\',\'goods_id\',\'spec_img\',0,\'call_back\')"> ' +
'<input type="hidden" value="" name="data[' + leng + '][spec_img]" id="spec_img' + leng + '"></td>' +
'<td><input type="checkbox" name="data[' + leng + '][is_mainshow]" value="1" checked></td>' +
'<td><a class="btn red" data-id="0" onclick="del_goods(this)">删除</a></td></tr>');
}
else if(pattern==1) {
$('#goods_list').append('<tr><td style="display: none">' +
'<input type="hidden" name="data[' + leng + '][erpwareid]" value="' + row.Id + '">' + '<input type="hidden" name="data[' + leng + '][goods_sn]" value="' + row.WareNo + '"></td>' +
'<td style="line-height: 24px;text-align: left">' + row.WareNo + '<em class="goodsize">' + '<input type="text" name="data[' + leng + '][goods_spec]" value="' + row.SpecName + '" placeholder="规格" style="width:40px">' +
'/<input type="text" name="data[' + leng + '][goods_color]" value="' + row.ColorName + '" placeholder="颜色" style="width:40px">' + '</em></td>' +
'<td><input type="text" placeholder="市场价" value="' + row.PosPrice + '" name="data[' + leng + '][market_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="手店价" value="0" name="data[' + leng + '][shop_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td class="mz"><input type="text" placeholder="美妆价" value="0" name="data[' + leng + '][mz_price]" autocomplete="off"' +
' onkeyup="this.value=this.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="库存" value="' + mokun + '" name="data[' + leng + '][store_count]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="销售" value="0" name="data[' + leng + '][sales_sum]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="限购" value="0" name="data[' + leng + '][viplimited]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="一级分成" value="0" name="data[' + leng + '][fir_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="二级分成" value="0" name="data[' + leng + '][sec_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="三级分成" value="0" name="data[' + leng + '][thi_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="重量" value="0" name="data[' + leng + '][weight]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格1" value="0" name="data[' + leng + '][cardprice1]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格2" value="0" name="data[' + leng + '][cardprice2]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格3" value="0" name="data[' + leng + '][cardprice3]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td style="line-height: normal;width: 150px;color: red;">' +
'<img src="__PUBLIC__/images/default_goods_image_240.gif" onclick="GetUploadify_new(1,\'spec_img' + leng + '\',\'goods\',\'{$erpid}\',\'goods\',\'goods_id\',\'spec_img\',0,\'call_back\')"> ' +
'<input type="hidden" value="" name="data[' + leng + '][spec_img]" id="spec_img' + leng + '"></td>' +
'<td><input type="checkbox" name="data[' + leng + '][is_mainshow]" value="1" checked></td>' +
'<td><a class="btn red" data-id="0" onclick="del_goods(this)">删除</a></td></tr>');
}
}
}
if (mz != "1") {
$('.mz').hide();
}
if (rank != "1" && rank != "2" ) {
$('.rank').hide();
}
} else {
layer.msg(data.msg, {icon: 2, time: 1000});
}
}
});
}
function search_goods(obj) {
key = $(obj).val();
if (key == "") {
layer.msg("请输入关键字!", {icon: 2, time: 1000});
$(obj).focus();
$(obj).parent().find("span").removeClass('dn');
return false;
}
var url = "/index.php/admin/goods/SelectGood/key/" + key;
var url2 = "/index.php/admin/goods/getGoods";
layer.msg('加载中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '200px', time: 0});
$.ajax({
type: "get",
url: url,
dataType: 'json',
error: function () {
layer.closeAll();
layer.msg("服务器繁忙, 请联系管理员!", {icon: 2, time: 1000});
},
success: function (data) {
layer.closeAll();
if (data == "") {
layer.msg(data.msg, {icon: 2, time: 1000});
return false;
}
if (data.code == "1" || data.code == 1) {
if (data.count == undefined || data.count == 0) {
layer.msg("未找到商品", {icon: 2, time: 1000});
return false;
}
seardata = data.data;
count = data.count;
if (seardata.length == 1) {
m_call_back(seardata[0]);
} else {
layer.open({
type: 2,
title: '选择商品',
shadeClose: true,
shade: 0.2,
area: ['96%', '70%'],
content: url2
});
}
} else {
layer.msg(data.msg, {icon: 2, time: 1000});
}
}
});
}
function updateerp_goods(obj)
{
key = $(obj).val();
if (key == "") {
layer.msg("请输入关键字!", {icon: 2, time: 1000});
$(obj).focus();
$(obj).parent().find("span").removeClass('dn');
return false;
}
$.ajax({
url: "/index.php?m=Admin&c=goods&a=updateerpgoods&key=" + key,
success: function (v) {
var v = eval('(' + v + ')');
if (v.hasOwnProperty('status')) {
if (v.status == 1) {
layer.msg(v.msg, {icon: 1, time: 1000});
// $(obj).parent().parent().remove();
} else {
layer.msg(v.msg, {icon: 2, time: 1000});
}
}
}
});
}
//删除商品
function del_goods(obj) {
var del_id = $(obj).attr('data-id');
if (del_id > 0) {
$.ajax({
url: "/index.php?m=Admin&c=goods&a=delGoods&id=" + del_id,
success: function (v) {
var v = eval('(' + v + ')');
if (v.hasOwnProperty('status')) {
if (v.status == 1) {
layer.msg(v.msg, {icon: 1, time: 1000});
$(obj).parent().parent().remove();
} else {
layer.msg(v.msg, {icon: 2, time: 1000});
}
}
}
});
} else {
$(obj).parent().parent().remove();
}
}
//商品搜索页面
function getSearDate() {
return seardata;
}
function getCount() {
return count;
}
function getSearKey() {
return key;
}
//验证选择商品
function m_call_back(data) {
var url = "/index.php/admin/goods/checkisok/sku/" + data.BarCode;
$.ajax({
type: "get",
url: url,
dataType: 'json',
error: function () {
layer.closeAll();
layer.msg("服务器繁忙, 请联系管理员!", {icon: 2});
},
success: function (data1) {
var img_val = $('#original_img').val();
var img_src = $('#original_img2')[0].src;
if (data1.code == 0) {
// layer.msg(data1.msg, {icon: 2, time: 1000});
//信息框-例2
layer.msg(data1.msg, {
time: 0 //不自动关闭
,btn: ['确定', '取消']
,icon: 6
,yes: function(index){
layer.close(index);
location.href="/Admin/Goods/addEditGoods/sku/"+data.BarCode;
}
});
} else {
$("#goods_name").val(data.WareName);
$("#sku").val(data.BarCode);
sku = data.BarCode;
var pattern=$("#pattern").val();
if(pattern==0) {
$('#goods_list').html('<tr><td style="display: none">' +
'<input type="hidden" name="data[1][erpwareid]" value="' + data.Id + '">' +
'<input type="hidden" name="data[1][goods_sn]" value="' + data.WareNo + '"></td>' +
'<td style="line-height: 24px;text-align: left">' + data.WareNo + '<em class="goodsize">' + '<input type="text" name="data[1][goods_spec]" value="' + data.SpecName + '" placeholder="规格" style="width:40px">' +
'/ <input type="text" name="data[1][goods_color]" value="' + data.ColorName + '" placeholder="颜色 " style="width:40px">' + '</em></td>' +
'<td><input type="text" placeholder="市场价" value="' + data.PosPrice + '" name="data[1][market_price]" autocomplete="off"' +
' onkeyup="this.value=this.value..replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="手店价" value="0" name="data[1][shop_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td class="mz"><input type="text" placeholder="美妆价" value="0" name="data[1][mz_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="库存" value="' + mokun + '" name="data[1][store_count]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="销售" value="0" name="data[1][sales_sum]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="限购" value="0" name="data[1][viplimited]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="佣金" value="0" name="data[1][commission]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td> <input type="text" placeholder="重量" value="0" name="data[1][weight]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格1" value="0" name="data[1][cardprice1]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格2" value="0" name="data[1][cardprice2]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格3" value="0" name="data[1][cardprice3]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td style="line-height: normal;width: 150px;color: red;">' +
'<img src="' + img_src + '" onclick="GetUploadify_new(1,\'spec_img1\',\'goods\',\'{$erpid}\',\'goods\',\'goods_id\',\'spec_img\',0,\'call_back\')"> ' +
'<input type="hidden" value="' + img_val + '" name="data[1][spec_img]" id="spec_img1"></td>' +
'<td><input type="checkbox" name="data[1][is_mainshow]" value="1" checked></td>' +
'<td></td></tr>');
}
else if(pattern==1){
$('#goods_list').html('<tr><td style="display: none">' +
'<input type="hidden" name="data[1][erpwareid]" value="' + data.Id + '">' +
'<input type="hidden" name="data[1][goods_sn]" value="' + data.WareNo + '"></td>' +
'<td style="line-height: 24px;text-align: left">' + data.WareNo + '<em class="goodsize">' + '<input type="text" name="data[1][goods_spec]" value="' + data.SpecName + '" placeholder="规格" style="width:40px">' +
'/ <input type="text" name="data[1][goods_color]" value="' + data.ColorName + '" placeholder="颜色 " style="width:40px">' + '</em></td>' +
'<td><input type="text" placeholder="市场价" value="' + data.PosPrice + '" name="data[1][market_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="手店价" value="0" name="data[1][shop_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td class="mz"><input type="text" placeholder="美妆价" value="0" name="data[1][mz_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="库存" value="' + mokun + '" name="data[1][store_count]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="销售" value="0" name="data[1][sales_sum]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="限购" value="0" name="data[1][viplimited]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="一级分成" value="0" name="data[1][fir_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="二级分成" value="0" name="data[1][sec_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="三级分成" value="0" name="data[1][thi_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')" onclick="distributnotic(this)"></td>' +
'<td> <input type="text" placeholder="重量" value="0" name="data[1][weight]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格1" value="0" name="data[1][cardprice1]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格2" value="0" name="data[1][cardprice2]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格3" value="0" name="data[1][cardprice3]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td style="line-height: normal;width: 150px;color: red;">' +
'<img src="' + img_src + '" onclick="GetUploadify_new(1,\'spec_img1\',\'goods\',\'{$erpid}\',\'goods\',\'goods_id\',\'spec_img\',0,\'call_back\')"> ' +
'<input type="hidden" value="' + img_val + '" name="data[1][spec_img]" id="spec_img1"></td>' +
'<td><input type="checkbox" name="data[1][is_mainshow]" value="1" checked></td>' +
'<td></td></tr>');
}
if (mz != "1") {
$('.mz').hide();
}
if (rank != "1" && rank != "2") {
$('.rank').hide();
}
layer.closeAll('iframe');
}
}
});
}
//非ERP新增商品
function addnewsgoods() {
leng = $('#goods_list tr').length + 1;
var delhtml="<td></td>";
if (leng>1) {
delhtml='<td><a class="btn red" data-id="0" onclick="del_goods(this)">删除</a></td>';
}
var pattern=$("#pattern").val();
if(pattern==0) {
$('#goods_list').append('<tr><td style="display: none">' +
'<input type="hidden" name="data[' + leng + '][erpwareid]" value=""> </td>' +
'<td style="line-height: 24px;text-align: left"><input type="text" name="data[' + leng + '][goods_sn]" value="" placeholder="商品编号"><em class="goodsize">' + '<input type="text" name="data[' + leng + '][goods_spec]" value="" placeholder="规格" style="width:40px">' +
'/<input type="text" name="data[' + leng + '][goods_color]" value="" placeholder="颜色" style="width:40px">' + '</em></td>' +
'<td><input type="text" placeholder="市场价" value="" name="data[' + leng + '][market_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="手店价" value="0" name="data[' + leng + '][shop_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td class="mz"><input type="text" placeholder="美妆价" value="0" name="data[1][mz_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="库存" value="' + mokun + '" name="data[' + leng + '][store_count]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="销售" value="0" name="data[' + leng + '][sales_sum]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="限购" value="0" name="data[' + leng + '][viplimited]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="佣金" value="0" name="data[' + leng + '][commission]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="重量" value="0" name="data[' + leng + '][weight]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格1" value="0" name="data[' + leng + '][cardprice1]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格2" value="0" name="data[' + leng + '][cardprice2]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格3" value="0" name="data[' + leng + '][cardprice3]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td style="line-height: normal;width: 150px;color: red;">' +
'<img src="__PUBLIC__/images/default_goods_image_240.gif" onclick="GetUploadify_new(1,\'spec_img' + leng + '\',\'goods\',\'{$erpid}\',\'goods\',\'goods_id\',\'spec_img\',0,\'call_back\')"> ' +
'<input type="hidden" value="" name="data[' + leng + '][spec_img]" id="spec_img' + leng + '"></td>' +
'<td><input type="checkbox" name="data[' + leng + '][is_mainshow]" value="1" checked></td>' + delhtml +
'</tr>');
}else{
$('#goods_list').append('<tr><td style="display: none">' +
'<input type="hidden" name="data[' + leng + '][erpwareid]" value=""> </td>' +
'<td style="line-height: 24px;text-align: left"><input type="text" name="data[' + leng + '][goods_sn]" value="" placeholder="商品编号"><em class="goodsize">' + '<input type="text" name="data[' + leng + '][goods_spec]" value="" placeholder="规格" style="width:40px">' +
'/<input type="text" name="data[' + leng + '][goods_color]" value="" placeholder="颜色" style="width:40px">' + '</em></td>' +
'<td><input type="text" placeholder="市场价" value="" name="data[' + leng + '][market_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="手店价" value="0" name="data[' + leng + '][shop_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td class="mz"><input type="text" placeholder="美妆价" value="0" name="data[1][mz_price]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^0-9.]/g,\'\')"></td>' +
'<td><input type="text" placeholder="库存" value="' + mokun + '" name="data[' + leng + '][store_count]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="销售" value="0" name="data[' + leng + '][sales_sum]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +
'<td><input type="text" placeholder="限购" value="0" name="data[' + leng + '][viplimited]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')"></td>' +'<td><input type="text" placeholder="一级分成" value="0" name="data[1][fir_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="二级分成" value="0" name="data[1][sec_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td><input type="text" placeholder="三级分成" value="0" name="data[1][thi_rate]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')" onclick="distributnotic(this)"></td>' +
'<td><input type="text" placeholder="重量" value="0" name="data[' + leng + '][weight]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/[^\\d]/g,\'\')" ></td>' +
'<td class="rank"><input type="text" placeholder="价格1" value="0" name="data[' + leng + '][cardprice1]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格2" value="0" name="data[' + leng + '][cardprice2]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td class="rank"><input type="text" placeholder="价格3" value="0" name="data[' + leng + '][cardprice3]" autocomplete="off"' +
' onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')"></td>' +
'<td style="line-height: normal;width: 150px;color: red;">' +
'<img src="__PUBLIC__/images/default_goods_image_240.gif" onclick="GetUploadify_new(1,\'spec_img' + leng + '\',\'goods\',\'{$erpid}\',\'goods\',\'goods_id\',\'spec_img\',0,\'call_back\')"> ' +
'<input type="hidden" value="" name="data[' + leng + '][spec_img]" id="spec_img' + leng + '"></td>' +
'<td><input type="checkbox" name="data[' + leng + '][is_mainshow]" value="1" checked></td>' + delhtml +
'</tr>');
}
if (mz != "1") {
$('.mz').hide();
}
if (rank != "1" && rank != "2") {
$('.rank').hide();
}
}
<if condition = "empty($p_erpid)" >
$("#sku").bind("input propertychange change",function(event){
var input_numinit=0;
$('#goods_list tr').each(function (i, e) {
$(e).find('input[type="text"]').eq(0+input_numinit).val($("#sku").val());
});
});
</if>
/*--商品提交--*/
function ajax_submit_form() {
<if condition = "$p_erpid" >
var input_numinit=0;
if (sku == '') {
layer.msg('请先搜索商品', {icon: 2, time: 1000});
return false;
}
<else/>
var input_numinit=1;
</if>
if ($('#goods_name').val() == '') {
layer.msg('商品名称不能为空', {icon: 2, time: 1000});
$('#goods_name').focus();
return false;
}
if ($('#sku').val() == '') {
layer.msg('商品条码不能为空', {icon: 2, time: 1000});
$('#sku').focus();
return false;
}
var input_val = '';
$('#goods_list tr').each(function (i, e) {
<if condition = "empty($p_erpid)" >
input_val = $(e).find('input[type="text"]').eq(input_numinit-1).val();
if (isNaN(input_val)) {
sta_msg = '商品编号不能为空';
sta_con = true;
return false;
}
</if>
input_val = $(e).find('input[type="text"]').eq(2+input_numinit).val();
if (isNaN(input_val) || input_val == 0) {
sta_msg = '市场价不能为空';
sta_con = true;
return false;
}
input_val = $(e).find('input[type="text"]').eq(3+input_numinit).val();
if (isNaN(input_val) || input_val == 0) {
sta_msg = '手店价不能为空';
sta_con = true;
return false;
}
<if condition='$mz_switch'>
input_val = $(e).find('input[type="text"]').eq(4+input_numinit).val();
if (isNaN(input_val)) {
sta_msg = '请输入数字(美妆价)';
sta_con = true;
return false;
}
</if>
input_val = $(e).find('input[type="text"]').eq(5+input_numinit).val();
if (input_val == '') {
sta_msg = '库存不能为空';
sta_con = true;
return false;
}
input_val = $(e).find('input[type="text"]').eq(8+input_numinit).val();
if (isNaN(input_val)) {
sta_msg = '请输入数字(佣金)';
sta_con = true;
return false;
}
if ( (parseFloat($(e).find('input[type="text"]').eq(8+input_numinit).val())>=parseFloat($(e).find('input[type="text"]').eq(3+input_numinit).val())) ) {
sta_msg = '佣金必须小于手店价';
sta_con = true;
return false;
}
<if condition='$rank_switch'>
input_val = $(e).find('input[type="text"]').eq(9+input_numinit).val();
if (isNaN(input_val)) {
sta_msg = '请输入数字(售价一)';
sta_con = true;
return false;
}
input_val = $(e).find('input[type="text"]').eq(10+input_numinit).val();
if (isNaN(input_val)) {
sta_msg = '请输入数字(售价二)';
sta_con = true;
return false;
}
input_val = $(e).find('input[type="text"]').eq(11+input_numinit).val();
if (isNaN(input_val)) {
sta_msg = '请输入数字(售价三)';
sta_con = true;
return false;
}
</if>
});
if (sta_con) {
layer.msg(sta_msg, {icon: 2, time: 1000});
sta_con = false;
sta_msg = '';
return false;
}
if ($('#cat_id').val() == 0) {
layer.msg('请先选择商品分类', {icon: 2, time: 1000});
return false;
}
if ($('#on_time').val() == '') {
layer.msg('请选择上架时间', {icon: 2, time: 1000});
return false;
}
if ($('input[type="checkbox"]:checked').length == 0){
layer.msg('请选择一件商品', {icon: 2, time: 1000});
return false;
}
var ai = layer.msg('提交中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '200px', time: 0});
$.ajax({
type: "POST",
url: "{:U('Goods/goods_handle')}",
data: $('#goods_data').serialize(),// 你的formid
error: function () {
layer.close(ai);
alert("服务器繁忙, 请联系管理员!");
},
success: function (data) {
layer.close(ai);
if (data.code == 1) {
layer.msg(data.msg, {icon: 1, time: 1000});
if (data.url != "" && data.url != undefined) {
setTimeout(function () {
location.href = data.url;
}, 1000);
} else {
setTimeout(function () {
location.href = "/index.php/admin/goods/goodsList";
}, 1000);
}
}
}
});
}
function showfir(ind) {
if (ind == 1) {
$("#expfir").fadeIn(3);
} else {
$("#expfir").fadeOut(3);
}
}
/** 以下是编辑时默认选中某个商品分类*/
$(document).ready(function () {
<if condition = "$level_cat['2'] gt 0" >
// 商品分类第二个下拉菜单
get_category('{$level_cat[1]}', 'cat_id_2', '{$level_cat[2]}');
get_category('{$level_cat[2]}', 'cat_id_3', '');
<else/>
get_category('{$level_cat[1]}', 'cat_id_2', '');
</if>
<if condition = "$level_cat['3'] gt 0" >
// 商品分类第二个下拉菜单
get_category('{$level_cat[2]}', 'cat_id_3', '{$level_cat[3]}');
</if>
// 扩展分类
<if condition = "$level_cat2['2'] gt 0" >
// 商品分类第二个下拉菜单
get_category('{$level_cat2[1]}', 'extend_cat_id_2', '{$level_cat2[2]}');
</if>
<if condition = "$level_cat2['3'] gt 0" >
// 商品分类第二个下拉菜单
get_category('{$level_cat2[2]}', 'extend_cat_id_3', '{$level_cat2[3]}');
</if>
//让图片能够拖动
$('.goods_xc').arrangeable();
});
//分享示例
function sharetest() {
layer.alert('将商品在微信分享给朋友时,该处填写的内容会展示在商品名称下面<img src="__WEBPUBLIC__/static/images/wxsharetest.jpg?v=1" width="320">', {
title:'查看示例',
skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则,去这里查阅
})
}
//设置弹窗
function distributnotic(thi_rate) {
layer.confirm('<div style="padding: 10px; line-height: 28px; font-size: 14px; background-color: #fff; color: #000; font-weight: 300;"> 您已设置直接奖励,如设间接奖励将违反国家发布的《禁止传销条例》<br>第7条规定,将存在公众号查封的危险性,请慎重考虑!<br><b>详情查看:<a href="http://law.npc.gov.cn/FLFG/flfgByID.action?flfgID=197880&showDetailType=QW&zlsxid=23" target="_blank"><font color=blue>中国普法网—《禁止传销条例》</font></a></b> </div>', {
btn: ['继续设置', '取消设置'],//按钮
title: '<span class="fa fa-warning"></span>危险提示'
}, function () {
layer.closeAll();
$(thi_rate).focus();
}, function () {
layer.msg('已经把值设置为0了', {icon: 1});
$(thi_rate).val("0");
});
}
//跳转到大图
function go_show_big(ob) {
var url=$(ob).attr("img_href");
window.open(url,"_blank");
}
$(".goods_xc").hover(function () {
$(this).find(".click_big_img").show();
},function () {
$(this).find(".click_big_img").hide();
})
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
}
var v_id=0;
function open_video() {
var url0 = "/index.php/admin/uploadify/up_my_video";
v_id=layer.open({
type: 2,
title: '选择视频',
shadeClose: true,
shade: 0.2,
area: ['96%', '90%'],
content: url0,
});
}
var del_key=null;
//--返回视频--
function call_back_video(sele_url,sele_img,sele_id) {
var host=$("#qclurl").val()
layer.close(v_id);
$(".show_video").html();
var htm="<img src='"+host+sele_img+"'/><div class='men'></div>" +
"<img onclick='play_video()' class='play_btn' src='__PUBLIC__/images/v_btn.png'/>" +
"<div onclick='del_video()' class='del'><i class='icon-trash'></i> 删除视频</div>"+" <div onclick='edit_video(this)' class='del2'><i class='fa fa-edit'></i> 编辑视频 </div>"
$(".show_video").html(htm);
$(".show_video").show(); //视频层显示
$("#add_v_div").hide(); //添加层掩藏
if(del_key==null){
$("#v_url").val(sele_url);
$("#v_img").val(sele_img);
$("#v_id").val(sele_id);
}else{
$("#v_url"+del_key).val(sele_url);
$("#v_img"+del_key).val(sele_img);
$("#v_id"+del_key).val(sele_id);
del_key=null;
}
}
//--播放视频--
function play_video(ob) {
var key=$(ob).attr('kk');
var host=$("#qclurl").val()
var v_url="";
if(key!=undefined)
v_url=$("#v_url"+key).val();
else
v_url=$("#v_url").val();
layer.open({
type: 1,
title: ['播放视频', 'font-size:14px;'],
skin: 'layui-layer-rim', //加上边框
area: ['650px', 'auto'], //宽高
content: $('.laybox'),
cancel: function () {
}
});
$("#play_video").show();
$("#play_video").attr('src',host+v_url);
$("#play_video").trigger('play');
}
//--删除视频--
function del_video(ob) {
var key=$(ob).attr('kk');
$("#v_url"+key).val("");
$("#v_img"+key).val("");
$(".show_video").html("");
$(".show_video").hide(); //视频层掩藏
$("#add_v_div").show(); //添加层显示
del_key=key;
}
//--删除视频--
function edit_video(ob) {
var key=$(ob).attr('kk');
var up_id=0;
if(key!=undefined && key!=null)
up_id= $("#v_id"+key).val();
else
up_id= $("#v_id").val();
var url0 = "/index.php/admin/uploadify/edit_up_video?id="+up_id;
v_id=layer.open({
type: 2,
title: '编辑视频',
shadeClose: true,
shade: 0.2,
area: ['96%', '90%'],
content: url0,
});
}
</script>
</body>
</html>