Authored by liuyue

批量导入

@@ -333,7 +333,8 @@ edit.ajaxfileupload=function(el,option){ @@ -333,7 +333,8 @@ edit.ajaxfileupload=function(el,option){
333 $(el).ajaxfileupload({ 333 $(el).ajaxfileupload({
334 'action': '/ajax/upload', 334 'action': '/ajax/upload',
335 'params':$.extend({},{__type:"fileupload-upload"},option.params), 335 'params':$.extend({},{__type:"fileupload-upload"},option.params),
336 - onComplete:option.onComplete 336 + onComplete:option.onComplete,
  337 + onStart: option.onStart
337 }) 338 })
338 } 339 }
339 edit.prototype.init.prototype=edit.prototype; 340 edit.prototype.init.prototype=edit.prototype;
@@ -83,4 +83,24 @@ $('#basicTable').on('click', '.cooperate-type', function() { @@ -83,4 +83,24 @@ $('#basicTable').on('click', '.cooperate-type', function() {
83 },true); 83 },true);
84 }); 84 });
85 85
  86 +//批量导入按钮点击事件
  87 +$('#import-btn').on('click', function() {
  88 + $('#basicTable, .bulk-import').toggle();
  89 +});
86 90
  91 +$('.excel-model, #sure-change, .priceTable-wrap').hide();
  92 +common.edit.ajaxfileupload("#upload-input",{
  93 + params:{type:"brandCooperation",__type:"batch-import"},
  94 + onStart: function() {
  95 + $('.load-modal').show();
  96 + },
  97 + onComplete:function(response){
  98 + console.log(response);
  99 + var li = '';
  100 + $('.load-modal').hide();
  101 + $.each(response.data.failFileReason, function(i, value) {
  102 + li += '<li>' + value + '</li>';
  103 + });
  104 + $('#error-msg').html(li);
  105 + }
  106 +});
@@ -211,24 +211,121 @@ $("#filter-btn").click(function(){ @@ -211,24 +211,121 @@ $("#filter-btn").click(function(){
211 211
212 //批量导入按钮点击事件 212 //批量导入按钮点击事件
213 $('#import-btn').on('click', function() { 213 $('#import-btn').on('click', function() {
214 - $('#basicTable, .bulk-import').toggle() 214 + $('#basicTable, .bulk-import').toggle();
215 }); 215 });
216 216
217 -//导入excel事件  
218 -/*$('#sure-upload').on('click', function() {  
219 - console.log($('#upload-input').val());  
220 - $.ajax({  
221 - type: 'POST',  
222 - url: '/goods/batchUpdatePrice'  
223 - }).then(function(res) {  
224 - console.log(res);  
225 - })  
226 -})*/  
227 -  
228 //upload-input 217 //upload-input
  218 +var successList = null;
229 common.edit.ajaxfileupload("#upload-input",{ 219 common.edit.ajaxfileupload("#upload-input",{
230 params:{type:"price",__type:"batch-import"}, 220 params:{type:"price",__type:"batch-import"},
  221 + onStart: function() {
  222 + $('.load-modal').show();
  223 + },
231 onComplete:function(response){ 224 onComplete:function(response){
232 console.log(response); 225 console.log(response);
  226 + $('.load-modal').hide();
  227 + if (response.code == 200) {
  228 + var data = response.data,
  229 + li = '';
  230 +
  231 + $('#priceTable').show();
  232 + $('.success-wrap').hide();
  233 + successList = data.successList;
  234 + $.each(data.failFileReason, function(i, value) {
  235 + li += '<li>' + value + '</li>';
  236 + });
  237 + $('#error-msg').empty().html(li);
  238 + p.init(successList);
  239 + } else {
  240 + alert(response.message);
  241 + }
233 } 242 }
234 }); 243 });
  244 +
  245 +
  246 +
  247 +var isFirst = false,
  248 + tableHtml = '';
  249 +var p = new common.grid({
  250 + el:"#priceTable",
  251 + columns:[
  252 + {display: 'SKN', render: function(item) {
  253 + return item.newProductPriceBo.product_skn;
  254 + }},
  255 + {display: '吊牌价', render: function(item) {
  256 + return item.newProductPriceBo.retail_price + '<p style="color: #ccc;">' + item.oldProductPriceBo.retail_price + '</p>';
  257 + }},
  258 + {display: 'VIP折扣类型', render: function(item) {
  259 + return ENUM.vipType[item.newProductPriceBo.vip_discount_type] +
  260 + '<p style="color: #ccc;">' + ENUM.vipType[item.oldProductPriceBo.vip_discount_type] + '</p>';
  261 + }},
  262 + {display: 'VIP价', render: function(item) {
  263 + return item.newProductPriceBo.vip_price + '<p style="color: #ccc;">' + item.oldProductPriceBo.vip_price + '</p>';
  264 + }},
  265 + {display: '白金价', render: function(item) {
  266 + return item.newProductPriceBo.vip3_price + '<p style="color: #ccc;">' + item.oldProductPriceBo.vip3_price + '</p>';
  267 + }},
  268 + {display: '金卡价', render: function(item) {
  269 + return item.newProductPriceBo.vip2_price + '<p style="color: #ccc;">' + item.oldProductPriceBo.vip2_price + '</p>';
  270 + }},
  271 + {display: '银卡价', render: function(item) {
  272 + return item.newProductPriceBo.vip1_price + '<p style="color: #ccc;">' + item.oldProductPriceBo.vip1_price + '</p>';
  273 + }},
  274 + {display: '返币金额', render: function(item) {
  275 + return item.newProductPriceBo.return_coin + '<p style="color: #ccc;">' + item.oldProductPriceBo.return_coin + '</p>';
  276 + }},
  277 + {display: '操作', render: function(item) {
  278 + return '<a class="btn btn-info delete-btn" data-index="' + item.__index + '" href="javascript:;">删除</a>';
  279 + }}
  280 + ]
  281 +});
  282 +
  283 +$('#priceTable').on('click', '.delete-btn', function() {
  284 + //var index = p.rows[$(this).data('index')];
  285 +
  286 +
  287 + successList.splice($(this).data('index'),1);
  288 + p.reload();
  289 + // console.log(p.rows);
  290 +
  291 +});
  292 +
  293 +
  294 +var path = '';
  295 +$('#sure-change').on('click', function() {
  296 + var arr = [],
  297 + data = '';
  298 +
  299 + $.each(successList, function(i, value) {
  300 + arr.push(value.newProductPriceBo);
  301 + });
  302 + /*var data = arr.join('');*/
  303 + data = JSON.stringify(arr);
  304 + console.log(data);
  305 + common.util.__ajax({
  306 + url:'/goods/batchUpdatePrice',
  307 + data:{
  308 + batchList: data
  309 + }
  310 + },function(res){
  311 + console.log(res);
  312 + $('#priceTable').hide();
  313 + $('.success-wrap').show();
  314 + path = res.data;
  315 + //$('#download-btn').attr('href', )
  316 + });
  317 +});
  318 +
  319 +$('#download-btn').on('click', function() {
  320 + console.log(path);
  321 + /*common.util.__ajax({
  322 + url:'/goods/batch/download',
  323 + data:{
  324 + path: path
  325 + }
  326 + },function(res){
  327 + console.log(res);
  328 + //$('#download-btn').attr('href', )
  329 + });*/
  330 + location.href = $(this).data('domain') + '/batch/download?path=' + path;
  331 +});
@@ -148,7 +148,7 @@ @@ -148,7 +148,7 @@
148 right: 0; 148 right: 0;
149 bottom: 0; 149 bottom: 0;
150 left: 0; 150 left: 0;
151 - background-image: url(../images/select2-spinner.gif); 151 + background-image: url(../images/loading.gif);
152 background-color: rgba(0,0,0,0.4); 152 background-color: rgba(0,0,0,0.4);
153 background-repeat: no-repeat; 153 background-repeat: no-repeat;
154 background-position: center center; 154 background-position: center center;
1 -ul{margin-top:0}.admin-icon-yellow{color:#ffbe40}.admin-header{font-size:1.4rem;margin-bottom:0}.admin-header-list a:hover :after{content:none}.admin-main{background:#f3f3f3}.admin-menu{position:fixed;z-index:10;bottom:30px;right:20px}.admin-sidebar{width:260px;min-height:100%;float:left;border-right:1px solid #cecece}.admin-sidebar-list{margin-bottom:0}.admin-sidebar-list li a{color:#5c5c5c;padding-left:24px}.admin-sidebar-list li:first-child{border-top:none}.admin-sidebar-sub{margin-top:0;margin-bottom:0;box-shadow:0 16px 8px -15px #e2e2e2 inset;background:#ececec;padding-left:24px}.admin-sidebar-sub li:first-child{border-top:1px solid #dedede}.admin-sidebar-panel{margin:10px}.admin-content{width:auto;overflow:hidden;height:100%;background:#fff}.admin-content-list{border:1px solid #e9ecf1;margin-top:0}.admin-content-list li{border:1px solid #e9ecf1;border-width:0 1px;margin-left:-1px}.admin-content-list li:first-child{border-left:none}.admin-content-list li:last-child{border-right:none}.admin-content-table a{color:#535353}.admin-content-file{margin-bottom:0;color:#666}.admin-content-file p{margin:0 0 5px 0;font-size:1.4rem}.admin-content-file li{padding:10px 0}.admin-content-file li:first-child{border-top:none}.admin-content-file li:last-child{border-bottom:none}.admin-content-file li .am-progress{margin-bottom:4px}.admin-content-file li .am-progress-bar{line-height:14px}.admin-content-task{margin-bottom:0}.admin-content-task li{padding:5px 0;border-color:#eee}.admin-content-task li:first-child{border-top:none}.admin-content-task li:last-child{border-bottom:none}.admin-task-meta{font-size:1.2rem;color:#999}.admin-task-bd{font-size:1.4rem;margin-bottom:5px}.admin-content-comment{margin-bottom:0}.admin-content-comment .am-comment-bd{font-size:1.4rem}.admin-content-pagination{margin-bottom:0}.admin-content-pagination li a{padding:4px 8px}@media only screen and (min-width: 641px){.admin-sidebar{display:block;position:static;background:none}.admin-offcanvas-bar{position:static;width:auto;background:none;-webkit-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.admin-offcanvas-bar:after{content:none}}@media only screen and (max-width: 640px){.admin-sidebar{width:inherit}.admin-offcanvas-bar{background:#f3f3f3}.admin-offcanvas-bar:after{background:#BABABA}.admin-sidebar-list a:hover,.admin-sidebar-list a:active{-webkit-transition:background-color .3s ease;transition:background-color .3s ease;background:#E4E4E4}.admin-content-list li{padding:10px;border-width:1px 0;margin-top:-1px}.admin-content-list li:first-child{border-top:none}.admin-content-list li:last-child{border-bottom:none}.admin-form-text{text-align:left !important}}.user-info{margin-bottom:15px}.user-info .am-progress{margin-bottom:4px}.user-info p{margin:5px}.user-info-order{font-size:1.4rem}.error-log .am-pre-scrollable{max-height:40rem}.table-main{font-size:1.4rem;padding:.5rem}.table-main button{background:#fff}.table-check{width:30px}.table-id{width:50px}@media only screen and (max-width: 640px){.table-select{margin-top:10px;margin-left:5px}}.gallery-list li{padding:10px}.gallery-list a{color:#666}.gallery-list a:hover{color:#3bb4f2}.gallery-title{margin-top:6px;font-size:1.4rem}.gallery-desc{font-size:1.2rem;margin-top:4px}.page-404{background:#fff;border:none;width:200px;margin:0 auto}.fixed-layout,.fixed-layout body{height:100%;overflow:hidden}.fixed-layout .admin-header{position:fixed;top:0;left:0;right:0;z-index:1500}.fixed-layout .admin-main{position:relative;height:100%;padding-top:51px}.fixed-layout .admin-content,.fixed-layout .admin-sidebar{height:100%;overflow-x:hidden;overflow-y:scroll}.fixed-layout .admin-sidebar.am-active{z-index:1600}input[type=file]{display:block;opacity:0;height:60px;width:100px;position:absolute;z-index:99}.form-horizontal .form-group{margin-left:0px;margin-right:0px}.datepicker{display:none;position:absolute;padding:4px;margin-top:1px;direction:ltr}.datepicker.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;list-style:none;background-color:#fff;border:1px solid rgba(0,0,0,0.2);border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;color:#333;font-size:13px;line-height:18px}.datepicker.dropdown-menu th{padding:4px 5px}.datepicker.dropdown-menu td{padding:4px 5px}.datepicker table{border:0;margin:0;width:auto}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer}.datepicker td{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker td.active.day,.datepicker td.active.year{background:#2ba6cb}.datepicker td.old,.datepicker td.new{color:#999}.datepicker td span.active{background:#2ba6cb}.datepicker td.day.disabled{color:#ccc}.datepicker th{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker th.active.day,.datepicker th.active.year{background:#2ba6cb}.datepicker th.date-switch{width:145px}.datepicker th span.active{background:#2ba6cb}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.datepicker.days div.datepicker-days{display:block}.datepicker.months div.datepicker-months{display:block}.datepicker.years div.datepicker-years{display:block}.datepicker thead tr:first-child th{cursor:pointer}.datepicker thead tr:first-child th.cw{cursor:default;background-color:transparent}.datepicker tfoot tr:first-child th{cursor:pointer}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:1px solid rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.datepicker>div,.datepicker-dropdown::before,.datepicker-dropdown::after{display:none}.datepicker-close{position:absolute;top:-30px;right:0;width:15px;height:30px;padding:0;display:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.panel-default .panel-heading{border-top:1px solid #e7e7e7}.red{color:red;font-family:bold}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:0 !important}.show-grid{padding:10px}.brandBtn-group{width:150px;float:left;margin-right:8px}.brandBtn-group-lg{width:280px}.contentpanel td a{margin:0 3px}.mainwrapper .toggle-table tr{cursor:pointer}.mainwrapper .toggle-table tr.level1 td:nth-of-type(1){text-indent:2px}.mainwrapper .toggle-table tr.level2 td:nth-of-type(1){text-indent:15px}.mainwrapper .toggle-table tr.level3 td:nth-of-type(1){text-indent:30px}.pattrscroll{background:#F7F7F7}.pattrscroll ul{padding-left:0}.pattrscroll li{cursor:pointer}.mainwrapper .list-group-item.level1{text-indent:2px}.mainwrapper .list-group-item.level2{text-indent:15px}.mainwrapper .list-group-item.level3{text-indent:30px}.attr-item-active{background:#428bca;color:#fff}.pannel-scroll{height:500px;overflow-y:scroll;overflow-x:hidden}.attr-select{display:block;height:40px;line-height:40px;border:1px solid #ccc;border-radius:3px}#limit-table-box table{vertical-align:middle}#limit-table-box table th,#limit-table-box table td{text-align:center;vertical-align:middle}#limit-table-box table div.checkbox label{height:13px}#limit-table-box table .cover-img{width:100px}#limit-table-box table .width50{width:50px;text-align:center}.height40{height:40px;line-height:40px}.edit-cover-img{width:100px;margin:0 15px;float:left}.quota-text,.quota-img,.quota-video{width:300px;margin-bottom:15px}.quota-text img,.quota-img img,.quota-video img{width:100%}#text-editor{width:100%;max-width:100%;min-width:100%;height:300px;max-height:300px;min-height:300px}.product-detail input[type="text"]{width:100px}.main-table{-display:none}.bulk-import{display:none}#upload-input{display:inline-block;position:static;opacity:1;width:auto;height:auto}.excel-model{display:inline-block;width:110px;height:48px;line-height:48px;padding:0 0 0 50px;margin:0 200px;background:url(../images/excel.png) no-repeat left center}.load-modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-image:url(../images/select2-spinner.gif);background-color:rgba(0,0,0,0.4);background-repeat:no-repeat;background-position:center center;z-index:999}.panel-input{display:inline-block;width:100%}.panel-col,.panel-col2{float:left;width:150px;margin:0 10px 10px}.panel-col2{width:280px} 1 +ul{margin-top:0}.admin-icon-yellow{color:#ffbe40}.admin-header{font-size:1.4rem;margin-bottom:0}.admin-header-list a:hover :after{content:none}.admin-main{background:#f3f3f3}.admin-menu{position:fixed;z-index:10;bottom:30px;right:20px}.admin-sidebar{width:260px;min-height:100%;float:left;border-right:1px solid #cecece}.admin-sidebar-list{margin-bottom:0}.admin-sidebar-list li a{color:#5c5c5c;padding-left:24px}.admin-sidebar-list li:first-child{border-top:none}.admin-sidebar-sub{margin-top:0;margin-bottom:0;box-shadow:0 16px 8px -15px #e2e2e2 inset;background:#ececec;padding-left:24px}.admin-sidebar-sub li:first-child{border-top:1px solid #dedede}.admin-sidebar-panel{margin:10px}.admin-content{width:auto;overflow:hidden;height:100%;background:#fff}.admin-content-list{border:1px solid #e9ecf1;margin-top:0}.admin-content-list li{border:1px solid #e9ecf1;border-width:0 1px;margin-left:-1px}.admin-content-list li:first-child{border-left:none}.admin-content-list li:last-child{border-right:none}.admin-content-table a{color:#535353}.admin-content-file{margin-bottom:0;color:#666}.admin-content-file p{margin:0 0 5px 0;font-size:1.4rem}.admin-content-file li{padding:10px 0}.admin-content-file li:first-child{border-top:none}.admin-content-file li:last-child{border-bottom:none}.admin-content-file li .am-progress{margin-bottom:4px}.admin-content-file li .am-progress-bar{line-height:14px}.admin-content-task{margin-bottom:0}.admin-content-task li{padding:5px 0;border-color:#eee}.admin-content-task li:first-child{border-top:none}.admin-content-task li:last-child{border-bottom:none}.admin-task-meta{font-size:1.2rem;color:#999}.admin-task-bd{font-size:1.4rem;margin-bottom:5px}.admin-content-comment{margin-bottom:0}.admin-content-comment .am-comment-bd{font-size:1.4rem}.admin-content-pagination{margin-bottom:0}.admin-content-pagination li a{padding:4px 8px}@media only screen and (min-width: 641px){.admin-sidebar{display:block;position:static;background:none}.admin-offcanvas-bar{position:static;width:auto;background:none;-webkit-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.admin-offcanvas-bar:after{content:none}}@media only screen and (max-width: 640px){.admin-sidebar{width:inherit}.admin-offcanvas-bar{background:#f3f3f3}.admin-offcanvas-bar:after{background:#BABABA}.admin-sidebar-list a:hover,.admin-sidebar-list a:active{-webkit-transition:background-color .3s ease;transition:background-color .3s ease;background:#E4E4E4}.admin-content-list li{padding:10px;border-width:1px 0;margin-top:-1px}.admin-content-list li:first-child{border-top:none}.admin-content-list li:last-child{border-bottom:none}.admin-form-text{text-align:left !important}}.user-info{margin-bottom:15px}.user-info .am-progress{margin-bottom:4px}.user-info p{margin:5px}.user-info-order{font-size:1.4rem}.error-log .am-pre-scrollable{max-height:40rem}.table-main{font-size:1.4rem;padding:.5rem}.table-main button{background:#fff}.table-check{width:30px}.table-id{width:50px}@media only screen and (max-width: 640px){.table-select{margin-top:10px;margin-left:5px}}.gallery-list li{padding:10px}.gallery-list a{color:#666}.gallery-list a:hover{color:#3bb4f2}.gallery-title{margin-top:6px;font-size:1.4rem}.gallery-desc{font-size:1.2rem;margin-top:4px}.page-404{background:#fff;border:none;width:200px;margin:0 auto}.fixed-layout,.fixed-layout body{height:100%;overflow:hidden}.fixed-layout .admin-header{position:fixed;top:0;left:0;right:0;z-index:1500}.fixed-layout .admin-main{position:relative;height:100%;padding-top:51px}.fixed-layout .admin-content,.fixed-layout .admin-sidebar{height:100%;overflow-x:hidden;overflow-y:scroll}.fixed-layout .admin-sidebar.am-active{z-index:1600}input[type=file]{display:block;opacity:0;height:60px;width:100px;position:absolute;z-index:99}.form-horizontal .form-group{margin-left:0px;margin-right:0px}.datepicker{display:none;position:absolute;padding:4px;margin-top:1px;direction:ltr}.datepicker.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;list-style:none;background-color:#fff;border:1px solid rgba(0,0,0,0.2);border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;color:#333;font-size:13px;line-height:18px}.datepicker.dropdown-menu th{padding:4px 5px}.datepicker.dropdown-menu td{padding:4px 5px}.datepicker table{border:0;margin:0;width:auto}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer}.datepicker td{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker td.active.day,.datepicker td.active.year{background:#2ba6cb}.datepicker td.old,.datepicker td.new{color:#999}.datepicker td span.active{background:#2ba6cb}.datepicker td.day.disabled{color:#ccc}.datepicker th{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;background:#fff;cursor:pointer}.datepicker th.active.day,.datepicker th.active.year{background:#2ba6cb}.datepicker th.date-switch{width:145px}.datepicker th span.active{background:#2ba6cb}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.datepicker.days div.datepicker-days{display:block}.datepicker.months div.datepicker-months{display:block}.datepicker.years div.datepicker-years{display:block}.datepicker thead tr:first-child th{cursor:pointer}.datepicker thead tr:first-child th.cw{cursor:default;background-color:transparent}.datepicker tfoot tr:first-child th{cursor:pointer}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:1px solid rgba(0,0,0,0.2);position:absolute;top:-7px;left:6px}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.datepicker>div,.datepicker-dropdown::before,.datepicker-dropdown::after{display:none}.datepicker-close{position:absolute;top:-30px;right:0;width:15px;height:30px;padding:0;display:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.panel-default .panel-heading{border-top:1px solid #e7e7e7}.red{color:red;font-family:bold}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:0 !important}.show-grid{padding:10px}.brandBtn-group{width:150px;float:left;margin-right:8px}.brandBtn-group-lg{width:280px}.contentpanel td a{margin:0 3px}.mainwrapper .toggle-table tr{cursor:pointer}.mainwrapper .toggle-table tr.level1 td:nth-of-type(1){text-indent:2px}.mainwrapper .toggle-table tr.level2 td:nth-of-type(1){text-indent:15px}.mainwrapper .toggle-table tr.level3 td:nth-of-type(1){text-indent:30px}.pattrscroll{background:#F7F7F7}.pattrscroll ul{padding-left:0}.pattrscroll li{cursor:pointer}.mainwrapper .list-group-item.level1{text-indent:2px}.mainwrapper .list-group-item.level2{text-indent:15px}.mainwrapper .list-group-item.level3{text-indent:30px}.attr-item-active{background:#428bca;color:#fff}.pannel-scroll{height:500px;overflow-y:scroll;overflow-x:hidden}.attr-select{display:block;height:40px;line-height:40px;border:1px solid #ccc;border-radius:3px}#limit-table-box table{vertical-align:middle}#limit-table-box table th,#limit-table-box table td{text-align:center;vertical-align:middle}#limit-table-box table div.checkbox label{height:13px}#limit-table-box table .cover-img{width:100px}#limit-table-box table .width50{width:50px;text-align:center}.height40{height:40px;line-height:40px}.edit-cover-img{width:100px;margin:0 15px;float:left}.quota-text,.quota-img,.quota-video{width:300px;margin-bottom:15px}.quota-text img,.quota-img img,.quota-video img{width:100%}#text-editor{width:100%;max-width:100%;min-width:100%;height:300px;max-height:300px;min-height:300px}.product-detail input[type="text"]{width:100px}.main-table{-display:none}.bulk-import{display:none}#upload-input{display:inline-block;position:static;opacity:1;width:auto;height:auto}.excel-model{display:inline-block;width:110px;height:48px;line-height:48px;padding:0 0 0 50px;margin:0 200px;background:url(../images/excel.png) no-repeat left center}.load-modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-image:url(../images/loading.gif);background-color:rgba(0,0,0,0.4);background-repeat:no-repeat;background-position:center center;z-index:999}.panel-input{display:inline-block;width:100%}.panel-col,.panel-col2{float:left;width:150px;margin:0 10px 10px}.panel-col2{width:280px}
1 //exports.domain = require('../config/common.js').domain; 1 //exports.domain = require('../config/common.js').domain;
2 exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; 2 exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web';
3 3
4 -//路由配置 4 +//商品管理路由配置
5 exports.res = [ 5 exports.res = [
6 { 6 {
7 //商品审核 7 //商品审核
@@ -35,7 +35,7 @@ exports.res = [ @@ -35,7 +35,7 @@ exports.res = [
35 {name: 'jit', type: 'String'} 35 {name: 'jit', type: 'String'}
36 ] 36 ]
37 }, { 37 }, {
38 - //商品管理 -> 价格管理 -> 代销变价页面渲染 38 + //价格管理 -> 代销变价页面渲染
39 route: '/goods/pricechange/index', 39 route: '/goods/pricechange/index',
40 method: 'GET', 40 method: 'GET',
41 view: 'pages/goods/index', 41 view: 'pages/goods/index',
@@ -64,7 +64,7 @@ exports.res = [ @@ -64,7 +64,7 @@ exports.res = [
64 domain: exports.domain 64 domain: exports.domain
65 } 65 }
66 }, { 66 }, {
67 - //商品管理 -> 代销变价 -> 列表数据 67 + //代销变价 -> 列表数据
68 route: '/goods/price/list', 68 route: '/goods/price/list',
69 method: 'POST', 69 method: 'POST',
70 url: '/product/queryProductPriceList', 70 url: '/product/queryProductPriceList',
@@ -85,7 +85,7 @@ exports.res = [ @@ -85,7 +85,7 @@ exports.res = [
85 {name: 'size', type: 'Number'} 85 {name: 'size', type: 'Number'}
86 ] 86 ]
87 }, { 87 }, {
88 - //商品管理 -> 代销变价 -> 获得单个变价详情 88 + //代销变价 -> 获得单个变价详情
89 route: '/goods/getPrice', 89 route: '/goods/getPrice',
90 method: 'POST', 90 method: 'POST',
91 url: '/product/getProductPrice', 91 url: '/product/getProductPrice',
@@ -144,17 +144,10 @@ exports.res = [ @@ -144,17 +144,10 @@ exports.res = [
144 url: '/product/batchUpdateProductPrice', 144 url: '/product/batchUpdateProductPrice',
145 isJsonRaw: true, 145 isJsonRaw: true,
146 params: [ 146 params: [
147 - {name: 'product_skn', type: 'number'},  
148 - {name: 'sales_price', type: 'number'},  
149 - {name: 'vip_discount_type', type: 'number'},  
150 - {name: 'return_coin', type: 'number'},  
151 - {name: 'vip_price', type: 'number'},  
152 - {name: 'vip1_price', type: 'number'},  
153 - {name: 'vip2_price', type: 'number'},  
154 - {name: 'vip3_price', type: 'number'} 147 + {name: 'batchList', type: 'String'}
155 ] 148 ]
156 }, { 149 }, {
157 - //商品管理 -> 价格管理 -> 品牌合作模式页面渲染 150 + //价格管理 -> 品牌合作模式页面渲染
158 route: '/goods/brandCooperation/index', 151 route: '/goods/brandCooperation/index',
159 method: 'GET', 152 method: 'GET',
160 view: 'pages/goods/index', 153 view: 'pages/goods/index',
@@ -171,11 +164,12 @@ exports.res = [ @@ -171,11 +164,12 @@ exports.res = [
171 brandCooperation: true, 164 brandCooperation: true,
172 brandCooperationSet: true 165 brandCooperationSet: true
173 }, 166 },
  167 + bulkImport: true,
174 bottons:'{"edit":true,"columnsHidisFr":true}', 168 bottons:'{"edit":true,"columnsHidisFr":true}',
175 gridurl:'/goods/brandCooperation/list' 169 gridurl:'/goods/brandCooperation/list'
176 } 170 }
177 }, { 171 }, {
178 - //商品管理 -> 品牌合作模式 -> 列表数据 172 + //品牌合作模式 -> 列表数据
179 route: '/goods/brandCooperation/list', 173 route: '/goods/brandCooperation/list',
180 method: 'POST', 174 method: 'POST',
181 url: '/brandCooperation/queryBrandCooperationList', 175 url: '/brandCooperation/queryBrandCooperationList',
@@ -188,7 +182,7 @@ exports.res = [ @@ -188,7 +182,7 @@ exports.res = [
188 {name: 'size', type: 'Number'} 182 {name: 'size', type: 'Number'}
189 ] 183 ]
190 }, { 184 }, {
191 - //商品管理 -> 品牌合作模式 -> 修改合作模式 185 + //品牌合作模式 -> 修改合作模式
192 route: '/goods/brandCooperation/update', 186 route: '/goods/brandCooperation/update',
193 method: 'POST', 187 method: 'POST',
194 url: '/brandCooperation/saveBrandCooperation', 188 url: '/brandCooperation/saveBrandCooperation',
@@ -149,12 +149,12 @@ @@ -149,12 +149,12 @@
149 149
150 {{# bulkImport}} 150 {{# bulkImport}}
151 <div class="row" style="margin: 0 0 0 -5px;"> 151 <div class="row" style="margin: 0 0 0 -5px;">
152 - <a id="import-btn" href="javascript:;" class="btn btn-info">批量变价</a> 152 + <a id="import-btn" href="javascript:;" class="btn btn-info">批量导入</a>
153 </div> 153 </div>
154 {{/ bulkImport}} 154 {{/ bulkImport}}
155 </div> 155 </div>
156 </div> 156 </div>
157 - <div class="panel panel-primary-head"> 157 + <div class="panel">
158 <div class="dataTables_wrapper no-footer" id="basicTable"></div> 158 <div class="dataTables_wrapper no-footer" id="basicTable"></div>
159 159
160 {{# bulkImport}} 160 {{# bulkImport}}
@@ -163,12 +163,23 @@ @@ -163,12 +163,23 @@
163 <label>选择文件</label> 163 <label>选择文件</label>
164 <input id="upload-input" name="file" class="btn btn-default" type="file"> 164 <input id="upload-input" name="file" class="btn btn-default" type="file">
165 <a class="excel-model" href="{{domain}}/common/batchUpdatePrice.xlsx">表头下载</a> 165 <a class="excel-model" href="{{domain}}/common/batchUpdatePrice.xlsx">表头下载</a>
166 - <input class="btn btn-primary" type="button" value="确定变价"> 166 + <input id="sure-change" class="btn btn-primary" type="button" value="确定变价">
  167 +
  168 + </div>
  169 + <ol id="error-msg" class="error-msg" style="color: red"></ol>
  170 + <div class="priceTable-wrap">
  171 +
  172 + <div class="panel panel-warning" style="margin: 0;">
  173 + <div class="panel-heading">SKN变价</div>
  174 + </div>
  175 + <div class="dataTables_wrapper no-footer" id="priceTable"></div>
  176 + </div>
  177 + <div class="success-wrap" style="display: none;">
  178 + <a class="btn btn-info" href="">返回变价列表</a>
  179 + <a id="download-btn" class="btn btn-success" data-domain="{{domain}}" href="javascript:;">下载导入结果</a>
167 </div> 180 </div>
168 </div> 181 </div>
169 - <div class="dataTables_wrapper no-footer" id="priceTable">  
170 -  
171 - </div> 182 +
172 183
173 {{/ bulkImport}} 184 {{/ bulkImport}}
174 </div> 185 </div>