Showing
5 changed files
with
45 additions
and
30 deletions
1 | var $ = require('jquery'), | 1 | var $ = require('jquery'), |
2 | - common = require('../common/common'); | 2 | + common = require('../common/common'), |
3 | + util = require('../common/util'); | ||
3 | 4 | ||
4 | var g = new common.grid({ | 5 | var g = new common.grid({ |
5 | el: "#product-pool", | 6 | el: "#product-pool", |
@@ -53,8 +54,9 @@ var $ = require('jquery'), | @@ -53,8 +54,9 @@ var $ = require('jquery'), | ||
53 | __type: "batch-import" | 54 | __type: "batch-import" |
54 | }, | 55 | }, |
55 | onComplete:function(res){ | 56 | onComplete:function(res){ |
57 | + util.__tip("上传成功",'success'); | ||
56 | $("#sknVal").val(JSON.stringify(res.data.productSkn)); | 58 | $("#sknVal").val(JSON.stringify(res.data.productSkn)); |
57 | - //console.log($("#sknVal").val().replace("[", "").replace("]", "")); | 59 | + $("#path").val($("#productSkn").val()); |
58 | } | 60 | } |
59 | }); | 61 | }); |
60 | 62 |
@@ -81,6 +81,21 @@ var $ = require('jquery'), | @@ -81,6 +81,21 @@ var $ = require('jquery'), | ||
81 | return "开始时间和结束时间必须同时存在"; | 81 | return "开始时间和结束时间必须同时存在"; |
82 | } | 82 | } |
83 | }); | 83 | }); |
84 | + e.on("validate", function() { | ||
85 | + var temp = $("#productPoolId").val(); | ||
86 | + if(!temp || temp == -1) { | ||
87 | + return "请填写商品池"; | ||
88 | + } | ||
89 | + }); | ||
90 | + | ||
91 | + e.on("validate", function() { | ||
92 | + if(($("#promotion1").is(":checked") && !$("#promotionName1").val()) | ||
93 | + || ($("#promotion2").is(":checked") && (!$("#promotionName2").val() || !$("#promotionName3").val())) | ||
94 | + || ($("#promotion4").is(":checked") && !$("#promotionName4").val()) | ||
95 | + || ($("#promotion5").is(":checked") && !$("#promotionName5").val())) { | ||
96 | + return "请将折扣形式填写完整"; | ||
97 | + } | ||
98 | + }); | ||
84 | 99 | ||
85 | common.dialog.confirm(hint, | 100 | common.dialog.confirm(hint, |
86 | common.util.__template($("#template").html(), item), | 101 | common.util.__template($("#template").html(), item), |
@@ -90,22 +105,18 @@ var $ = require('jquery'), | @@ -90,22 +105,18 @@ var $ = require('jquery'), | ||
90 | if(typeof option.data.startTime == "string") { | 105 | if(typeof option.data.startTime == "string") { |
91 | option.data.startTime=new Date(option.data.startTime).getTime() / 1000; | 106 | option.data.startTime=new Date(option.data.startTime).getTime() / 1000; |
92 | option.data.endTime=new Date(option.data.endTime).getTime() / 1000; | 107 | option.data.endTime=new Date(option.data.endTime).getTime() / 1000; |
93 | - // console.log(option.data.startTime); | ||
94 | - } | ||
95 | - var arr; | ||
96 | - try { | ||
97 | - arr=option.data.promotionName.split(":")//"promotionName1:折起"; | ||
98 | - option.data.promotionName = ""; | ||
99 | - for(var i = 0; i < arr.length; i++) { | ||
100 | - var value = ""; | ||
101 | - try { | ||
102 | - value = $("#" + arr[i]).val(); | ||
103 | - } catch(e) { | ||
104 | - value = arr[i]; | ||
105 | } | 108 | } |
106 | - option.data.promotionName += value ? value : arr[i]; | 109 | + |
110 | + var val=$('input:radio[name="promotionName"]:checked').val(); | ||
111 | + if(val == 1) { | ||
112 | + option.data.promotionName = $("#promotionName1").val() + "折起"; | ||
113 | + }else if(val == 2) { | ||
114 | + option.data.promotionName = $("#promotionName2").val() + "~" + $("#promotionName3").val() + "折"; | ||
115 | + }else if(val == 4) { | ||
116 | + option.data.promotionName = $("#promotionName4").val() + "元起"; | ||
117 | + }else if(val == 5) { | ||
118 | + option.data.promotionName = $("#promotionName5").val() + "%Off"; | ||
107 | } | 119 | } |
108 | - }catch(e){} | ||
109 | 120 | ||
110 | option.success=function(){ | 121 | option.success=function(){ |
111 | g.reload(); | 122 | g.reload(); |
@@ -134,6 +145,7 @@ var $ = require('jquery'), | @@ -134,6 +145,7 @@ var $ = require('jquery'), | ||
134 | $("#promotion5").attr("checked","checked"); | 145 | $("#promotion5").attr("checked","checked"); |
135 | } | 146 | } |
136 | } | 147 | } |
148 | + console.log($("#promotion1").val()); | ||
137 | 149 | ||
138 | e.init(); | 150 | e.init(); |
139 | new common.dropDown({el: "#productPoolId","ajax":"productPool"}); | 151 | new common.dropDown({el: "#productPoolId","ajax":"productPool"}); |
@@ -143,11 +155,8 @@ var $ = require('jquery'), | @@ -143,11 +155,8 @@ var $ = require('jquery'), | ||
143 | url:'/runManage/subjectManage/queryBaseProductPoolListById', | 155 | url:'/runManage/subjectManage/queryBaseProductPoolListById', |
144 | data:{id:item.productPoolId} | 156 | data:{id:item.productPoolId} |
145 | },function(res) { | 157 | },function(res) { |
146 | - // console.log(res); | ||
147 | $("#select2-productPoolId-container").html(res.data[0].text); | 158 | $("#select2-productPoolId-container").html(res.data[0].text); |
148 | },true); | 159 | },true); |
149 | - } else { | ||
150 | - $("#select2-productPoolId-container").html("选择商品池"); | ||
151 | } | 160 | } |
152 | } | 161 | } |
153 | }; | 162 | }; |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | <script type="text/template" id="template"> | 27 | <script type="text/template" id="template"> |
28 | <div class="rows" id="baseform"> | 28 | <div class="rows" id="baseform"> |
29 | <div class="form-group"> | 29 | <div class="form-group"> |
30 | - <label for="category_name_value" class="col-sm-2 control-label">分类名称</label> | 30 | + <label for="categoryName" class="col-sm-2 control-label">分类名称</label> |
31 | <div class="col-sm-10"> | 31 | <div class="col-sm-10"> |
32 | <input type="hidden" value="{id}" id="id" /> | 32 | <input type="hidden" value="{id}" id="id" /> |
33 | 33 | ||
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | </div> | 36 | </div> |
37 | </div> | 37 | </div> |
38 | <div class="form-group"> | 38 | <div class="form-group"> |
39 | - <label for="fir_category_value" class="col-sm-2 control-label">一级分类</label> | 39 | + <label class="col-sm-2 control-label">一级分类</label> |
40 | <div class="col-sm-10"> | 40 | <div class="col-sm-10"> |
41 | <select id="parentId" style="width: 280px;" value="{parentId}" name="{parentId}"> | 41 | <select id="parentId" style="width: 280px;" value="{parentId}" name="{parentId}"> |
42 | <option value="{parentId}">请选择</option> | 42 | <option value="{parentId}">请选择</option> |
@@ -71,7 +71,10 @@ | @@ -71,7 +71,10 @@ | ||
71 | </div> | 71 | </div> |
72 | <div class="form-group"> | 72 | <div class="form-group"> |
73 | <label class="col-sm-2 control-label">上传</label> | 73 | <label class="col-sm-2 control-label">上传</label> |
74 | - <div class="col-sm-10"> | 74 | + <div class="col-sm-6"> |
75 | + <input id="path" class="form-control" type="text" disabled="disabled" style="cursor:default"> | ||
76 | + </div> | ||
77 | + <div class="col-sm-4"> | ||
75 | <input id="productSkn" name="productSkn" class="btn btn-default excel-upload" type="file"> | 78 | <input id="productSkn" name="productSkn" class="btn btn-default excel-upload" type="file"> |
76 | <div class="file-name btn btn-default">请选择文件</div> | 79 | <div class="file-name btn btn-default">请选择文件</div> |
77 | <input type="hidden" id="sknVal" /> | 80 | <input type="hidden" id="sknVal" /> |
@@ -99,18 +99,17 @@ | @@ -99,18 +99,17 @@ | ||
99 | <div class="form-group"> | 99 | <div class="form-group"> |
100 | <label class="col-sm-2 control-label">促销形式</label> | 100 | <label class="col-sm-2 control-label">促销形式</label> |
101 | <div class="col-sm-10"> | 101 | <div class="col-sm-10"> |
102 | - <input id="promotion1" name="promotionName" type="radio" value="promotionName1:折起" /> | 102 | + <input id="promotion1" name="promotionName" type="radio" value="1" /> |
103 | 103 | ||
104 | - <input class="smalltxt" type="text" id="promotionName1" />折起 | 104 | + <input class="smalltxt" type="text" id="promotionName1" />折起 |
105 | 105 | ||
106 | 106 | ||
107 | - <input id="promotion2" name="promotionName" type="radio" value="promotionName2:~:promotionName3:折" /><input class="smalltxt" type="text" id="promotionName2" />~<input class="smalltxt" type="text" id="promotionName3" />折 | 107 | + <input id="promotion2" name="promotionName" type="radio" value="2" /><input class="smalltxt" type="text" id="promotionName2" />~<input class="smalltxt" type="text" id="promotionName3" />折 |
108 | 108 | ||
109 | - <input id="promotion4" name="promotionName" type="radio" value="promotionName4:元起" /><input class="smalltxt" type="text" id="promotionName4" />元起 | 109 | + <input id="promotion4" name="promotionName" type="radio" value="4" /><input class="smalltxt" type="text" id="promotionName4" />元起 |
110 | 110 | ||
111 | - <input id="promotion5" name="promotionName" type="radio" value="promotionName5:%Off" /><input class="smalltxt" type="text" id="promotionName5" />%Off(大图折扣) | 111 | + <input id="promotion5" name="promotionName" type="radio" value="5" /><input class="smalltxt" type="text" id="promotionName5" />%Off(大图折扣) |
112 | </div> | 112 | </div> |
113 | - <input type="hidden" id="promotionName" value="{promotionName}" for="radio"/> | ||
114 | </div> | 113 | </div> |
115 | <div class="form-group col-sm-100"> | 114 | <div class="form-group col-sm-100"> |
116 | <label class="col-sm-2 control-label">活动时间</label> | 115 | <label class="col-sm-2 control-label">活动时间</label> |
@@ -146,9 +145,11 @@ | @@ -146,9 +145,11 @@ | ||
146 | </div> | 145 | </div> |
147 | </div> | 146 | </div> |
148 | <div class="form-group"> | 147 | <div class="form-group"> |
149 | - <label class="col-sm-2 control-label" for="">添加商品</label> | 148 | + <label class="col-sm-2 control-label" for="">添加商品<font color="#f00">*</font></label> |
150 | <div class="col-sm-10"> | 149 | <div class="col-sm-10"> |
151 | - <select id="productPoolId" style="width: 280px;" value="{productPoolId}"></select> | 150 | + <select id="productPoolId" style="width: 280px;" value="{productPoolId}"> |
151 | + <option value="{productPoolId}">请选择商品池</option> | ||
152 | + </select> | ||
152 | </div> | 153 | </div> |
153 | </div> | 154 | </div> |
154 | </div> | 155 | </div> |
-
Please register or login to post a comment