Authored by 马力

经营模式

@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 </select> 152 </select>
153 </div> 153 </div>
154 154
155 - <label class="col-sm-1 control-label">JIT供应商</label> 155 + <label class="col-sm-1 control-label">供应商</label>
156 <div class="col-sm-2"> 156 <div class="col-sm-2">
157 <select id="supplierId" class="form-control"> 157 <select id="supplierId" class="form-control">
158 <option value="-1">选择JIT供应商</option> 158 <option value="-1">选择JIT供应商</option>
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
107 </div> 107 </div>
108 </div> 108 </div>
109 <div class="form-group"> 109 <div class="form-group">
110 - <label class="col-sm-2 control-label">JIT供应商</label> 110 + <label class="col-sm-2 control-label">供应商</label>
111 <div class="col-sm-2"> 111 <div class="col-sm-2">
112 <select id="supplierId" class="form-control"> 112 <select id="supplierId" class="form-control">
113 <option value="[[supplierId||'-1']]">[[supplierName||'供应商']]</option> 113 <option value="[[supplierId||'-1']]">[[supplierName||'供应商']]</option>
@@ -27,23 +27,24 @@ @@ -27,23 +27,24 @@
27 <div class="col-sm-3">店铺:[[shopName]]</div> 27 <div class="col-sm-3">店铺:[[shopName]]</div>
28 <div class="col-sm-3">品牌:[[brandName]]</div> 28 <div class="col-sm-3">品牌:[[brandName]]</div>
29 <div class="col-sm-3">供应商:[[supplierName]]</div> 29 <div class="col-sm-3">供应商:[[supplierName]]</div>
30 - [[if renderType=='edit']]  
31 - <div class="col-sm-3">厂家编号:[[factoryCode]]</div>  
32 - [[else]]  
33 - <div class="col-sm-3"><img src="[[productImageUrl]]" width="100" height="100" alt=""></div>  
34 - [[/if]] 30 + <div class="col-sm-3">经营模式:[[sellType]]</div>
35 </div> 31 </div>
36 <div class="form-group"> 32 <div class="form-group">
37 <div class="col-sm-3">品类:[[maxSortName]]/[[middleSortName]]/[[smallSortName]]</div> 33 <div class="col-sm-3">品类:[[maxSortName]]/[[middleSortName]]/[[smallSortName]]</div>
38 <div class="col-sm-3">货品年:[[goodsYears]]</div> 34 <div class="col-sm-3">货品年:[[goodsYears]]</div>
39 <div class="col-sm-3">货品季:[[goodsSeason]]</div> 35 <div class="col-sm-3">货品季:[[goodsSeason]]</div>
40 - [[if renderType=='info']]  
41 - <div class="col-sm-3">厂家编号:[[factoryCode]]</div> 36 + [[if renderType=='edit']]
  37 + <div class="col-sm-3">厂家编号:[[factoryCode]]</div>
  38 + [[else]]
  39 + <div class="col-sm-3"><img src="[[productImageUrl]]" width="100" height="100" alt=""></div>
42 [[/if]] 40 [[/if]]
43 </div> 41 </div>
44 <div class="form-group"> 42 <div class="form-group">
45 <div class="col-sm-3">SKN[[productSkn]]</div> 43 <div class="col-sm-3">SKN[[productSkn]]</div>
46 <div class="col-sm-3">商品类型:[[attribute]]</div> 44 <div class="col-sm-3">商品类型:[[attribute]]</div>
  45 + [[if renderType=='info']]
  46 + <div class="col-sm-3">厂家编号:[[factoryCode]]</div>
  47 + [[/if]]
47 </div> 48 </div>
48 <div class="form-group"> 49 <div class="form-group">
49 <label class="col-sm-1">商品名称<i class="red">*</i>:</label> 50 <label class="col-sm-1">商品名称<i class="red">*</i>:</label>
@@ -88,10 +88,10 @@ common.edit.ajaxfileupload('#skuUpmCode', batchExport('#brand-file', 'skuUpmCode @@ -88,10 +88,10 @@ common.edit.ajaxfileupload('#skuUpmCode', batchExport('#brand-file', 'skuUpmCode
88 88
89 common.edit.ajaxfileupload('#expectSaleTime', batchExport('#sort-file', 'expectSaleTime')); 89 common.edit.ajaxfileupload('#expectSaleTime', batchExport('#sort-file', 'expectSaleTime'));
90 90
91 -var isbrandId=false,isshops=false; 91 +var isbrandId=false,isshops=false,issellType=false;
92 92
93 function jiekai(){ 93 function jiekai(){
94 - if(isbrandId&&isshops){ 94 + if(isbrandId&&isshops&&issellType){
95 $("#baseProduct").prop("disabled",false); 95 $("#baseProduct").prop("disabled",false);
96 }else{ 96 }else{
97 $("#baseProduct").prop("disabled",true); 97 $("#baseProduct").prop("disabled",true);
@@ -118,12 +118,24 @@ $(document).on("change","#shopId",function(){ @@ -118,12 +118,24 @@ $(document).on("change","#shopId",function(){
118 }) 118 })
119 $(document).on("change","#supplierId",function(){ // 不维护供应商,则不带出经销选项 119 $(document).on("change","#supplierId",function(){ // 不维护供应商,则不带出经销选项
120 if($(this).val() > 0){ 120 if($(this).val() > 0){
121 - $("#sellType").append("<option value='1'>经销</option>"); 121 + $("#sellType option[value=1], #sellType option[value=2], #sellType option[value=3]").remove();
  122 + $("#sellType").append("<option value='2'>代销</option>");
  123 + $("#sellType").append("<option value='3'>JIT</option>");
122 }else{ 124 }else{
123 - $("#sellType option[value=1]").remove(); 125 + $("#sellType option[value=1], #sellType option[value=2], #sellType option[value=3]").remove();
  126 + $("#sellType").append("<option value='1'>经销</option>");
124 } 127 }
125 $("#sellType").val(-1).trigger("change"); 128 $("#sellType").val(-1).trigger("change");
126 }) 129 })
  130 +$(document).on("change","#sellType",function(){ // 不维护供应商,则不带出经销选项
  131 + if($(this).val() > 0){
  132 + issellType = true;
  133 + }else{
  134 + issellType = false;
  135 + }
  136 + jiekai();
  137 +})
  138 +
127 139
128 function __ajaxExeclById(unquid){ 140 function __ajaxExeclById(unquid){
129 var params={param:unquid}; 141 var params={param:unquid};
@@ -149,10 +149,12 @@ if(RESPONSEDATA.isAuditing==200){ @@ -149,10 +149,12 @@ if(RESPONSEDATA.isAuditing==200){
149 $('#expectArrivalTimeStr').removeAttr("required"); 149 $('#expectArrivalTimeStr').removeAttr("required");
150 $('#advanceSettings').hide(); 150 $('#advanceSettings').hide();
151 } 151 }
  152 +
  153 + $('#sellType').removeAttr('required'); // 修改页面不允许修改经营模式,已置灰,但要保证老数据没有经营模式的时候,可以正常提交
152 } else { 154 } else {
153 // 新增页面隐藏话题字段 155 // 新增页面隐藏话题字段
154 $("#productTagDiv").hide(); 156 $("#productTagDiv").hide();
155 - $("#sellType option[value=1]").remove(); // 新增页面初始化的时候,需要去掉经营模式中的经销选项 157 + $("#sellType option[value=2], #sellType option[value=3]").remove(); // 新增页面初始化的时候,需要去掉经营模式中的经销选项
156 } 158 }
157 159
158 /*下拉选择*/ 160 /*下拉选择*/
@@ -356,9 +358,12 @@ $(document).on("change","#shopId",function(){ @@ -356,9 +358,12 @@ $(document).on("change","#shopId",function(){
356 358
357 $(document).on("change","#supplierId",function(){ // 不维护供应商,则不带出经销选项 359 $(document).on("change","#supplierId",function(){ // 不维护供应商,则不带出经销选项
358 if($(this).val() > 0){ 360 if($(this).val() > 0){
359 - $("#sellType").append("<option value='1'>经销</option>"); 361 + $("#sellType option[value=1], #sellType option[value=2], #sellType option[value=3]").remove();
  362 + $("#sellType").append("<option value='2'>代销</option>");
  363 + $("#sellType").append("<option value='3'>JIT</option>");
360 }else{ 364 }else{
361 - $("#sellType option[value=1]").remove(); 365 + $("#sellType option[value=1], #sellType option[value=2], #sellType option[value=3]").remove();
  366 + $("#sellType").append("<option value='1'>经销</option>");
362 } 367 }
363 $("#sellType").val(-1).trigger("change"); 368 $("#sellType").val(-1).trigger("change");
364 }); 369 });
@@ -74,6 +74,11 @@ var basicInfohtml = '', @@ -74,6 +74,11 @@ var basicInfohtml = '',
74 classic: { 74 classic: {
75 '1': '是', 75 '1': '是',
76 '0': '否' 76 '0': '否'
  77 + },
  78 + sellType: {
  79 + '1': '经销',
  80 + '2': '代销',
  81 + '3': 'JIT'
77 } 82 }
78 }, 83 },
79 basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '', 84 basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '',