|
@@ -508,4 +508,135 @@ $(document).on("click", "#sub_btn", function() { |
|
@@ -508,4 +508,135 @@ $(document).on("click", "#sub_btn", function() { |
508
|
console.log(res.data);
|
508
|
console.log(res.data);
|
509
|
window.location.href=window.location.href;
|
509
|
window.location.href=window.location.href;
|
510
|
});
|
510
|
});
|
|
|
511
|
+});
|
|
|
512
|
+
|
|
|
513
|
+
|
|
|
514
|
+/****************************************************************************************************/
|
|
|
515
|
+/*商品,商品组*/
|
|
|
516
|
+
|
|
|
517
|
+/*选择商品表格*/
|
|
|
518
|
+var goodsgird = new common.grid({
|
|
|
519
|
+ el: '#goodsgird',
|
|
|
520
|
+ parms: function () {
|
|
|
521
|
+ var beginPrice = 0, endPrice = 1000000;
|
|
|
522
|
+ if (common.util.__input('beginPrice')) {
|
|
|
523
|
+ beginPrice = common.util.__input('beginPrice');
|
|
|
524
|
+ }
|
|
|
525
|
+ if (common.util.__input('endPrice')) {
|
|
|
526
|
+ endPrice = common.util.__input('endPrice')
|
|
|
527
|
+ }
|
|
|
528
|
+ return {
|
|
|
529
|
+ query: common.util.__input('skns'),
|
|
|
530
|
+ price: beginPrice + "," + endPrice
|
|
|
531
|
+ };
|
|
|
532
|
+ },
|
|
|
533
|
+ columns: [
|
|
|
534
|
+ {
|
|
|
535
|
+ display: "选择",
|
|
|
536
|
+ type: "checkbox"
|
|
|
537
|
+ }, {
|
|
|
538
|
+ display: "产品图片",
|
|
|
539
|
+ render: function (item) {
|
|
|
540
|
+ if (item.images_url) {
|
|
|
541
|
+ item.images_url = common.util.__joinImg("goodsimg", item.images_url);
|
|
|
542
|
+ }
|
|
|
543
|
+ else {
|
|
|
544
|
+ item.images_url = "";
|
|
|
545
|
+ }
|
|
|
546
|
+ return "<img width=120 height=60 src='" + item.images_url + "?imageView/2/w/100/h/100'/>";
|
|
|
547
|
+ }
|
|
|
548
|
+ }, {
|
|
|
549
|
+ display: "产品名称",
|
|
|
550
|
+ name: "product_name"
|
|
|
551
|
+ }, {
|
|
|
552
|
+ display: "品牌",
|
|
|
553
|
+ name: "brand_name"
|
|
|
554
|
+ }, {
|
|
|
555
|
+ display: "现价",
|
|
|
556
|
+ name: "sales_price"
|
|
|
557
|
+ }, {
|
|
|
558
|
+ display: "牌价",
|
|
|
559
|
+ name: "market_price"
|
|
|
560
|
+ }, {
|
|
|
561
|
+ display: "预售",
|
|
|
562
|
+ name: "stock_number"
|
|
|
563
|
+ }, {
|
|
|
564
|
+ display: "库存",
|
|
|
565
|
+ name: "storage_num"
|
|
|
566
|
+ }]
|
|
|
567
|
+});
|
|
|
568
|
+//搜索按钮
|
|
|
569
|
+$(document).on("click", "#search", function() {
|
|
|
570
|
+ goodsgird.reload();
|
|
|
571
|
+});
|
|
|
572
|
+//点击“选择标签”按钮(添加商品)
|
|
|
573
|
+$(document).on("click", "#goodsSelectBtn", function () {
|
|
|
574
|
+ new common.dialog({
|
|
|
575
|
+ title: "选择商品",
|
|
|
576
|
+ content: $("#template_dialog_goodsgird").html(),
|
|
|
577
|
+ width: '80%',
|
|
|
578
|
+ button: [{
|
|
|
579
|
+ value: "确定",
|
|
|
580
|
+ callback: function () {
|
|
|
581
|
+ Bll.module.contentData.data = goodsgird.selected.map(function (item, index) {
|
|
|
582
|
+ return {
|
|
|
583
|
+ src: item.images_url,
|
|
|
584
|
+ id: item.product_skn,
|
|
|
585
|
+ product_skc: item.product_skc
|
|
|
586
|
+ }
|
|
|
587
|
+ });
|
|
|
588
|
+ // Bll.module.data=goodsgird.selected;
|
|
|
589
|
+ Bll.__render("#goodspic", "template_dialog_goodsimgs", {
|
|
|
590
|
+ datas: Bll.module.contentData.data
|
|
|
591
|
+ });
|
|
|
592
|
+ },
|
|
|
593
|
+ css: "btn-primary"
|
|
|
594
|
+ }]
|
|
|
595
|
+ });
|
|
|
596
|
+ goodsgird.init('/yohosearch/search');
|
|
|
597
|
+});
|
|
|
598
|
+//点击“添加组”按钮(添加商品组)
|
|
|
599
|
+$(document).on("click", "#goodsaddBtn", function () {
|
|
|
600
|
+ if(Bll.module.contentData.data[0].list.length){
|
|
|
601
|
+ Bll.module.contentData.data.push(Button[5].data[0]);
|
|
|
602
|
+ }
|
|
|
603
|
+ Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
|
|
|
604
|
+});
|
|
|
605
|
+//点击“选择标签”按钮(添加商品组)
|
|
|
606
|
+$(document).on("click", ".goodsSelectBtn", function () {
|
|
|
607
|
+ var index = $(this).data("index");
|
|
|
608
|
+ new common.dialog({
|
|
|
609
|
+ title: "选择商品",
|
|
|
610
|
+ content: $("#template_dialog_goodsgird").html(),
|
|
|
611
|
+ width: '80%',
|
|
|
612
|
+ button: [{
|
|
|
613
|
+ value: "确定",
|
|
|
614
|
+ callback: function () {
|
|
|
615
|
+ goodsgird.selected.forEach(function (item, i) {
|
|
|
616
|
+ Bll.module.contentData.data[index].list[i] = {
|
|
|
617
|
+ src: item.images_url,
|
|
|
618
|
+ id: item.product_skn,
|
|
|
619
|
+ product_skc: item.product_skc,
|
|
|
620
|
+ maxSortId: item.max_sort_id
|
|
|
621
|
+ };
|
|
|
622
|
+ if (!i) {
|
|
|
623
|
+ Bll.module.contentData.data[index].cover = {
|
|
|
624
|
+ cover: item.images_url,
|
|
|
625
|
+ maxSortId: item.max_sort_id
|
|
|
626
|
+ };
|
|
|
627
|
+ }
|
|
|
628
|
+ });
|
|
|
629
|
+ Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
|
|
|
630
|
+ },
|
|
|
631
|
+ css: "btn-primary"
|
|
|
632
|
+ }]
|
|
|
633
|
+ });
|
|
|
634
|
+ goodsgird.init('/yohosearch/search');
|
|
|
635
|
+});
|
|
|
636
|
+//删除图片按钮
|
|
|
637
|
+$(document).on("click", ".removepic", function() {
|
|
|
638
|
+ Bll.module.contentData.data.splice($(this).data("index"), 1);
|
|
|
639
|
+ $("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
|
|
|
640
|
+ datas: Bll.module.contentData.data
|
|
|
641
|
+ }));
|
511
|
}); |
642
|
}); |