Authored by 马力

Merge branch 'test5.8.1' into gray

@@ -17,7 +17,9 @@ module.exports = { @@ -17,7 +17,9 @@ module.exports = {
17 department: {type: Number}, 17 department: {type: Number},
18 couponName: {type: String}, 18 couponName: {type: String},
19 status: {type: Number}, 19 status: {type: Number},
20 - couponType:{type:Number} 20 + couponType:{type:Number},
  21 + feeSharingType:{type:Number}
  22 +
21 } 23 }
22 }, 24 },
23 getCouponDetailById:{ 25 getCouponDetailById:{
@@ -51,7 +53,9 @@ module.exports = { @@ -51,7 +53,9 @@ module.exports = {
51 multipleNum: {type: Number}, 53 multipleNum: {type: Number},
52 shopPriceLimits: {type: String}, 54 shopPriceLimits: {type: String},
53 sknExclude: {type: String}, 55 sknExclude: {type: String},
54 - shopLimit:{type:String} 56 + shopLimit:{type:String},
  57 + feeSharingType:{type:Number},
  58 + feeSharingRatio:{type:Number}
55 } 59 }
56 }, 60 },
57 reject: { 61 reject: {
@@ -249,7 +249,43 @@ @@ -249,7 +249,43 @@
249 <div> 249 <div>
250 250
251 </div> 251 </div>
252 - 252 + <div class="panel-heading">
  253 + <h4 class="panel-title">费用承担</h4>
  254 + </div>
  255 + <div class="panel-body">
  256 + <div class="row">
  257 + <div class="form-group">
  258 + <label class="col-sm-2 control-label"></label>
  259 + <div class="col-sm-10">
  260 + <label class="radio-inline">
  261 + [[if status==1&&feeSharingType==0]]
  262 + <input type="radio" name="feeSharingType" value="1" disabled>我司承担</label>
  263 + [[else]]
  264 + <input type="radio" name="feeSharingType" value="1" [[if couponType==1||couponType==3||couponType==4||couponType==5||couponType==7]]checked [[else if couponType==6]]disabled[[/if]] [[if status==1]]disabled[[/if]]>我司承担</label>
  265 + [[/if]]
  266 + <label class="radio-inline">
  267 + <input type="radio" name="feeSharingType" value="2" [[if couponType==4||couponType==5||couponType==7||status==1]]disabled[[else if couponType==6]]checked[[/if]]>供应商承担</label>
  268 + <label class="radio-inline">
  269 + <input type="radio" name="feeSharingType" value="3" [[if couponType==4||couponType==5||couponType==6||couponType==7||status==1]] disabled [[/if]]>分摊(合同结算)</label>
  270 + <label class="radio-inline">
  271 + <input type="radio" name="feeSharingType" value="4" [[if couponType==4||couponType==5||couponType==6||couponType==7||status==1]] disabled [[/if]]>分摊-我司承担比例&nbsp;&nbsp;</label>
  272 + <input type="hidden" value="[[feeSharingType]]" id="feeSharingType" for="radio"
  273 + placeholder="费用分摊">
  274 + <select id="feeSharingRatio" name="feeSharingRatio" value="[[feeSharingRatio]]" data-field="feeSharingRatio" class="select-inline" [[if couponType==4||couponType==5||couponType==6||couponType==7||status==1]] disabled [[/if]]>
  275 + <option value="0.1" selected="selected">0.1</option>
  276 + <option value="0.2">0.2</option>
  277 + <option value="0.3">0.3</option>
  278 + <option value="0.4">0.4</option>
  279 + <option value="0.5">0.5</option>
  280 + <option value="0.6">0.6</option>
  281 + <option value="0.7">0.7</option>
  282 + <option value="0.8">0.8</option>
  283 + <option value="0.9">0.9</option>
  284 + </select>
  285 + </div>
  286 + </div>
  287 + </div>
  288 + </div>
253 <div class="panel-heading"> 289 <div class="panel-heading">
254 <h4 class="panel-title">领券条件</h4> 290 <h4 class="panel-title">领券条件</h4>
255 </div> 291 </div>
@@ -25,6 +25,15 @@ @@ -25,6 +25,15 @@
25 </select> 25 </select>
26 </div> 26 </div>
27 <div class="panel-col"> 27 <div class="panel-col">
  28 + <select id="filter-feeSharingType" tabindex="-1" class="select2-offscreen brandBtn-group observe">
  29 + <option value="-1">费用承担</option>
  30 + <option value="1">我司承担</option>
  31 + <option value="2">供应商承担</option>
  32 + <option value="3">分摊(合同结算)</option>
  33 + <option value="4">分摊-我司承担比例</option>
  34 + </select>
  35 + </div>
  36 + <div class="panel-col">
28 <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> 37 <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
29 <a id="all-btn" href="/market/couponList/index" class="btn btn-info">全部</a> 38 <a id="all-btn" href="/market/couponList/index" class="btn btn-info">全部</a>
30 </div> 39 </div>
@@ -225,8 +234,31 @@ @@ -225,8 +234,31 @@
225 </div> 234 </div>
226 235
227 </div> 236 </div>
  237 + <div class="panel-heading">
  238 + <h4 class="panel-title">费用承担</h4>
  239 + </div>
  240 + <div class="panel-body">
  241 + <div class="row">
  242 + <div class="form-group">
  243 +
  244 + <label class="col-sm-2 control-label">费用承担</label>
  245 +
  246 + <div class="col-sm-8">
  247 + [[if feeSharingType == 1]]
  248 + <p>我司承担</p>
  249 + [[else if feeSharingType == 2]]
  250 + <p>供应商承担</p>
  251 + [[else if feeSharingType == 3]]
  252 + <p>分摊(合同结算)</p>
  253 + [[else if feeSharingType == 4]]
  254 + <p>分摊-我司承担比例:[[feeSharingRatio]]</p>
  255 + [[/if]]
  256 + </div>
  257 + </div>
  258 + </div>
228 259
229 </div> 260 </div>
  261 + </div>
230 </script> 262 </script>
231 <script type="text/template" id="operation-record-template"> 263 <script type="text/template" id="operation-record-template">
232 <div class="historyList"> 264 <div class="historyList">
@@ -191,7 +191,7 @@ var Bll = { @@ -191,7 +191,7 @@ var Bll = {
191 /** 191 /**
192 * 根据type判断界面 192 * 根据type判断界面
193 */ 193 */
194 -console.log(type); 194 +console.log("type====="+type);
195 if (type == 'add') { 195 if (type == 'add') {
196 Bll.__render(couponBean, type); 196 Bll.__render(couponBean, type);
197 } else { 197 } else {
@@ -254,7 +254,14 @@ $(document).on("change", "#useRange", function () { @@ -254,7 +254,14 @@ $(document).on("change", "#useRange", function () {
254 }); 254 });
255 255
256 $(document).on("change","#filter-couponType",function(){ 256 $(document).on("change","#filter-couponType",function(){
  257 + var couponTypeVal = $(this).val();
257 couponBean.couponType = $(this).val(); 258 couponBean.couponType = $(this).val();
  259 + if(couponTypeVal==4||couponTypeVal==5||couponTypeVal==7){
  260 + couponBean.feeSharingType = 1;
  261 + }else if(couponTypeVal==6){
  262 + couponBean.feeSharingType = 2;
  263 + }
  264 +
258 Bll.__render(couponBean, type); 265 Bll.__render(couponBean, type);
259 }); 266 });
260 /** 267 /**
@@ -299,6 +306,13 @@ $(document).on("keyup", ".number", function () { @@ -299,6 +306,13 @@ $(document).on("keyup", ".number", function () {
299 * 保存 306 * 保存
300 */ 307 */
301 $(document).on("click", "#save_brand", function () { 308 $(document).on("click", "#save_brand", function () {
  309 + //新增时如果,如果没有选定,赋予1(我司承担)
  310 + if(type=='add'&&$("#feeSharingType").val()=='0'){
  311 + couponBean.feeSharingType = 1;
  312 + }else{
  313 + couponBean.feeSharingType = $("#feeSharingType").val();
  314 + }
  315 + couponBean.feeSharingRatio = $("#feeSharingRatio").val();
302 if(couponBean.couponType=='6'){ 316 if(couponBean.couponType=='6'){
303 if(couponBean.shopList==''){ 317 if(couponBean.shopList==''){
304 common.util.__tip('店铺券需要设置店铺限制!', 'warning'); 318 common.util.__tip('店铺券需要设置店铺限制!', 'warning');
@@ -15,6 +15,9 @@ var artTemplate = common.artTemplate; @@ -15,6 +15,9 @@ var artTemplate = common.artTemplate;
15 //下拉框 15 //下拉框
16 new common.dropDown({el: '#filter-couponType'}); 16 new common.dropDown({el: '#filter-couponType'});
17 17
  18 +//下拉框
  19 +new common.dropDown({el: '#filter-feeSharingType'});
  20 +
18 var couponTypes = ["平台券", "B券", "券码", "生日券", "免邮券","店铺券","分享券"]; 21 var couponTypes = ["平台券", "B券", "券码", "生日券", "免邮券","店铺券","分享券"];
19 var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"]; 22 var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"];
20 // var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"]; 23 // var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"];
@@ -64,29 +67,29 @@ var t = new common.tab({ @@ -64,29 +67,29 @@ var t = new common.tab({
64 el: "#basicTab", 67 el: "#basicTab",
65 click: function () { 68 click: function () {
66 columnname = $(this).find('a').attr('columnname'); 69 columnname = $(this).find('a').attr('columnname');
67 - g.options.columns[5].hidden = true;  
68 g.options.columns[6].hidden = true; 70 g.options.columns[6].hidden = true;
  71 + g.options.columns[7].hidden = true;
69 switch (columnname) { 72 switch (columnname) {
70 case "1": 73 case "1":
71 { 74 {
72 - g.options.columns[7].hidden = true; 75 + g.options.columns[8].hidden = true;
73 } 76 }
74 break; 77 break;
75 case "2": 78 case "2":
76 { 79 {
77 - g.options.columns[5].hidden = false;  
78 - g.options.columns[7].hidden = true; 80 + g.options.columns[6].hidden = false;
  81 + g.options.columns[8].hidden = true;
79 } 82 }
80 break; 83 break;
81 case "3": 84 case "3":
82 { 85 {
83 - g.options.columns[6].hidden = false;  
84 - g.options.columns[7].hidden = true; 86 + g.options.columns[7].hidden = false;
  87 + g.options.columns[8].hidden = true;
85 } 88 }
86 break; 89 break;
87 case "all": 90 case "all":
88 { 91 {
89 - g.options.columns[7].hidden = false; 92 + g.options.columns[8].hidden = false;
90 } 93 }
91 break; 94 break;
92 } 95 }
@@ -113,6 +116,7 @@ var g = new common.grid({ @@ -113,6 +116,7 @@ var g = new common.grid({
113 couponName: common.util.__input("filter-couponName"), 116 couponName: common.util.__input("filter-couponName"),
114 department: common.util.__input("choose-department"), 117 department: common.util.__input("choose-department"),
115 couponType:common.util.__input("filter-couponType"), 118 couponType:common.util.__input("filter-couponType"),
  119 + feeSharingType:common.util.__input("filter-feeSharingType"),
116 status: t.active 120 status: t.active
117 }; 121 };
118 }, 122 },
@@ -151,6 +155,19 @@ var g = new common.grid({ @@ -151,6 +155,19 @@ var g = new common.grid({
151 } 155 }
152 }, 156 },
153 {display: "优惠券说明", name: "explains"}, 157 {display: "优惠券说明", name: "explains"},
  158 + {display: "费用承担", render:function(item){
  159 + var feeType;
  160 + if(item.feeSharingType == 1){
  161 + feeType = "我司承担";
  162 + }else if(item.feeSharingType ==2){
  163 + feeType = "供应商承担"
  164 + }else if(item.feeSharingType ==3){
  165 + feeType = "分摊(合同结算)";
  166 + }else if(item.feeSharingType ==4){
  167 + feeType = "分摊-我司承担比例:"+item.feeSharingRatio;
  168 + }
  169 + return feeType;
  170 + }},
154 { 171 {
155 display: "驳回理由", hidden: true, name: "rejectReason", render: function (item) { 172 display: "驳回理由", hidden: true, name: "rejectReason", render: function (item) {
156 return "<p style='color: red'>" + item.rejectReason + "</p>" 173 return "<p style='color: red'>" + item.rejectReason + "</p>"
@@ -24,7 +24,9 @@ var couponBean = { @@ -24,7 +24,9 @@ var couponBean = {
24 sknExclude:"", 24 sknExclude:"",
25 useRange:0, 25 useRange:0,
26 shopList:"", 26 shopList:"",
27 - shopIds:"" 27 + shopIds:"",
  28 + feeSharingType:"0",
  29 + feeSharingRatio:""
28 }; 30 };
29 31
30 module.exports = couponBean; 32 module.exports = couponBean;