Showing
4 changed files
with
233 additions
and
1 deletions
@@ -99,4 +99,15 @@ module.exports=function(app) { | @@ -99,4 +99,15 @@ module.exports=function(app) { | ||
99 | 99 | ||
100 | /*通过任务ID查看任务是否被执行完*/ | 100 | /*通过任务ID查看任务是否被执行完*/ |
101 | app.post("/product/queryBatchImportResult","basegoods_queryBatchImportResult"); | 101 | app.post("/product/queryBatchImportResult","basegoods_queryBatchImportResult"); |
102 | + | ||
103 | + | ||
104 | + /*批量*/ | ||
105 | + app.get("/supplier/baseproduct/batchSetPortal","goods.batchSetPortal.Batch",function(){ | ||
106 | + this.$extend={ | ||
107 | + moduleName:"基础商品", | ||
108 | + pageName:"批量功能", | ||
109 | + isPL:true | ||
110 | + } | ||
111 | + }); | ||
112 | + | ||
102 | } | 113 | } |
1 | +<%include '../../../common/views/__ui/header'%> | ||
2 | +<%include '../../../common/views/__partail/ListHeader'%> | ||
3 | +<%if isPL%> | ||
4 | +<div class="contentpanel"> | ||
5 | + <div class="panel panel-default" style="margin-bottom:10px;"> | ||
6 | + <div class="panel-body"> | ||
7 | + <table class="table table-bordered"> | ||
8 | + <tr> | ||
9 | + <td rowspan="2">展示平台</td> | ||
10 | + <td>上传EXCEL:</td> | ||
11 | + <td style="position: relative;"><input id="appTypeModify" name="file" data-type="" type="file" style="cursor: pointer; height: 37px; top: 8px;"></td> | ||
12 | + </tr> | ||
13 | + <tr> | ||
14 | + <td>说明:</td> | ||
15 | + <td colspan="2"> | ||
16 | + 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br> | ||
17 | + 2、第一行标题栏:<span style="color: #67D267;">SKN,展示平台</span><br> | ||
18 | + 3、<a href="/ajax/link/batchModifyAppType">下载样例</a> | ||
19 | + </td> | ||
20 | + </tr> | ||
21 | + </table> | ||
22 | + </div> | ||
23 | + <div class="panel-body red" id="message"> | ||
24 | + </div> | ||
25 | + </div> | ||
26 | +</div> | ||
27 | +<%else%> | ||
28 | + | ||
29 | +<div class="contentpanel"> | ||
30 | + | ||
31 | + <div class="panel panel-default" style="margin-bottom:10px;"> | ||
32 | + <div class="panel-body"> | ||
33 | + | ||
34 | + <div class="rows"> | ||
35 | + <div class="form-group"> | ||
36 | + <label class="col-sm-1 control-label">品牌 <span class="red">*</span></label> | ||
37 | + <div class="col-sm-2"> | ||
38 | + <select id="brandId" class="form-control" required> | ||
39 | + <option value="-1">选择品牌</option> | ||
40 | + </select> | ||
41 | + </div> | ||
42 | + | ||
43 | + <label class="col-sm-1 control-label">管理店铺 <span class="red">*</span></label> | ||
44 | + <div class="col-sm-2"> | ||
45 | + <select id="shopId" class="form-control"> | ||
46 | + <option value="-1">选择店铺</option> | ||
47 | + </select> | ||
48 | + </div> | ||
49 | + | ||
50 | + <label class="col-sm-1 control-label">JIT供应商</label> | ||
51 | + <div class="col-sm-2"> | ||
52 | + <select id="supplierId" class="form-control"> | ||
53 | + <option value="-1">选择JIT供应商</option> | ||
54 | + </select> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + | ||
59 | + <table class="table table-bordered"> | ||
60 | + <tr> | ||
61 | + <td rowspan="2">基础商品</td> | ||
62 | + <td>上传EXCEL:</td> | ||
63 | + <td > | ||
64 | + <div class="panel-col" style="position: relative;"> | ||
65 | + <input id="baseProduct" name="file" data-type="baseProduct" type="file" style="cursor: pointer; height: 37px; top: 8px;"> | ||
66 | + </div> | ||
67 | + <div class="panel-col" style="line-height: 40px;position: relative;left: -60px;"> | ||
68 | + <span class="red">必须输入品牌、店铺</span> | ||
69 | + </div> | ||
70 | + </td> | ||
71 | + </tr> | ||
72 | + <tr> | ||
73 | + <td>说明:</td> | ||
74 | + <td colspan="2"> | ||
75 | + 1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br> | ||
76 | + 2、第一行标题栏:<span style="color: #67D267;">货品名称、厂家编号、一级分类、二级分类、三级分类、四级分类、性别、货品年、货品季、商品属性、吊牌价、销售价、色系、厂家颜色、款型、尺码、条码、能否补货、SKN计数,年龄层(成人,大童,中童,小童,幼童),重点款,预计上架时间、upm条码</span><br> | ||
77 | + 3、<a href="/ajax/link/baseproduct" style="margin: 0; text-decoration: underline">下载样例.xlsx</a> | ||
78 | + </td> | ||
79 | + </tr> | ||
80 | + </table> | ||
81 | + </div> | ||
82 | + </div> | ||
83 | +</div> | ||
84 | + | ||
85 | +<div class="panel panel-primary-head"> | ||
86 | + <div class="panel-body red" id="message"> | ||
87 | + </div> | ||
88 | +</div> | ||
89 | +<%/if%> | ||
90 | +<%include '../../../common/views/__ui/footer'%> |
@@ -102,7 +102,7 @@ var tabTree=new common.tabTree("#tree",SORTDATA); | @@ -102,7 +102,7 @@ var tabTree=new common.tabTree("#tree",SORTDATA); | ||
102 | tabTree.isfeeze=true; | 102 | tabTree.isfeeze=true; |
103 | 103 | ||
104 | if(ACTION == 1){ //编辑页面显示展示平台 | 104 | if(ACTION == 1){ //编辑页面显示展示平台 |
105 | - $('.showPlatform').show(); | 105 | + /*$('.showPlatform').show();*/ |
106 | } | 106 | } |
107 | 107 | ||
108 | if(ACTION == 1 && canEditSort){ | 108 | if(ACTION == 1 && canEditSort){ |
1 | +'use strict'; | ||
2 | +var $ = require('jquery'), | ||
3 | + common = require('../../../common/common'); | ||
4 | + | ||
5 | +new common.dropDown({el:"#brandId",ajax:"brand",params:function(){ | ||
6 | + return {status:1,userLimitFlag:true} | ||
7 | + }}); | ||
8 | + | ||
9 | +new common.dropDown({el:"#shopId",ajax:"sortbybrand",params:function(){ | ||
10 | + return {brandId:$("#brandId").val()} | ||
11 | +}}); | ||
12 | + | ||
13 | +new common.dropDown({el:"#supplierId",ajax:"getjitSup",params:function(){ | ||
14 | + return {brandId:$("#brandId").val(),shopId:$("#shopId").val()} | ||
15 | +}}); | ||
16 | + | ||
17 | + | ||
18 | +$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>'); | ||
19 | + | ||
20 | +var loadModal = null; | ||
21 | + | ||
22 | +function batchExport(el, type) { | ||
23 | + | ||
24 | + return { | ||
25 | + params: { | ||
26 | + type: type, | ||
27 | + brandId:common.util.__input("brandId"), | ||
28 | + shopId:common.util.__input("shopId"), | ||
29 | + supplierId:common.util.__input("supplierId"), | ||
30 | + __type: "batch-import" | ||
31 | + }, | ||
32 | + onStart: function(params) { | ||
33 | + params.brandId=common.util.__input("brandId"); | ||
34 | + params.shopsId=common.util.__input("shopId"); | ||
35 | + params.supplierId=common.util.__input("supplierId"); | ||
36 | + | ||
37 | + params.brandName=params.brandId?$("#brandId").find("option[value="+$("#brandId").val()+"]").text():""; | ||
38 | + params.shopsName=params.shopsId?$("#shopId").find("option[value="+$("#shopId").val()+"]").text():""; | ||
39 | + params.supplierName=params.supplierId?$("#supplierId").find("option[value="+$("#supplierId").val()+"]").text():""; | ||
40 | + | ||
41 | + console.log("params",params); | ||
42 | + loadModal = common.dialog.load(); | ||
43 | + $("#message").html(''); | ||
44 | + | ||
45 | + //$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", "")); | ||
46 | + }, | ||
47 | + onComplete: function(response) { | ||
48 | + console.log("批量接口返回数据",response); | ||
49 | + $("#message").html(''); | ||
50 | + if (response.code == 200&&response.data.taskId) { | ||
51 | + __ajaxExeclById(response.data.taskId); | ||
52 | + // common.util.__tip(response.message, 'success'); | ||
53 | + return; | ||
54 | + } | ||
55 | + if (loadModal) { | ||
56 | + loadModal.close(); | ||
57 | + } | ||
58 | + if(response.data&&response.data.failFileReason.length){ | ||
59 | + $("#message").html(response.data.failFileReason.join('<br/>')); | ||
60 | + return false; | ||
61 | + } | ||
62 | + common.util.__tip(response.message, 'warning'); | ||
63 | + } | ||
64 | + } | ||
65 | +} | ||
66 | +/*展示平台*/ | ||
67 | +common.edit.ajaxfileupload('#appTypeModify', batchExport('#sort-file', 'appTypeModify')); | ||
68 | +/*奥莱*/ | ||
69 | +common.edit.ajaxfileupload('#outletModify', batchExport('#sort-file', 'outletModify')); | ||
70 | +/*补货*/ | ||
71 | +common.edit.ajaxfileupload('#supplyModify', batchExport('#brand-file', 'supplyModify')); | ||
72 | +/*修改条码*/ | ||
73 | +common.edit.ajaxfileupload('#factoryCodeModify', batchExport('#brand-file', 'skuFactoryCodeModify')); | ||
74 | +/*基础商品导入*/ | ||
75 | +$("#baseProduct").prop("disabled",true); | ||
76 | +common.edit.ajaxfileupload('#baseProduct', batchExport('#sort-file', 'baseProduct')); | ||
77 | + | ||
78 | +var isbrandId=false,isshops=false; | ||
79 | + | ||
80 | +function jiekai(){ | ||
81 | + if(isbrandId&&isshops){ | ||
82 | + $("#baseProduct").prop("disabled",false); | ||
83 | + }else{ | ||
84 | + $("#baseProduct").prop("disabled",true); | ||
85 | + } | ||
86 | +} | ||
87 | +$(document).on("change","#brandId",function(){ | ||
88 | + if($(this).val()>0){ | ||
89 | + isbrandId=true; | ||
90 | + }else{ | ||
91 | + isbrandId=false; | ||
92 | + } | ||
93 | + jiekai(); | ||
94 | + $("#shopId").val(-1).trigger("change"); | ||
95 | + $("#supplierId").val(-1).trigger("change"); | ||
96 | +}); | ||
97 | +$(document).on("change","#shopId",function(){ | ||
98 | + if($(this).val()>0){ | ||
99 | + isshops=true; | ||
100 | + }else{ | ||
101 | + isshops=false; | ||
102 | + } | ||
103 | + jiekai(); | ||
104 | + $("#supplierId").val(-1).trigger("change"); | ||
105 | +}) | ||
106 | + | ||
107 | + | ||
108 | +function __ajaxExeclById(unquid){ | ||
109 | + var params={param:unquid}; | ||
110 | + | ||
111 | + common.util.__ajax({ | ||
112 | + url:'/product/queryBatchImportResult', | ||
113 | + data:params | ||
114 | + },function(res){ | ||
115 | + if(res.data.length){ | ||
116 | + | ||
117 | + //成功操作 | ||
118 | + if (loadModal) { | ||
119 | + loadModal.close(); | ||
120 | + } | ||
121 | + common.util.__tip(res.message, 'success'); | ||
122 | + | ||
123 | + }else{ | ||
124 | + setTimeout(function(){ | ||
125 | + __ajaxExeclById.call(null,unquid); | ||
126 | + },5000); | ||
127 | + } | ||
128 | + $("#message").html(res.message); | ||
129 | + },true); | ||
130 | +} | ||
131 | +// __ajaxExeclById("batchBasePrd1459835824928"); |
-
Please register or login to post a comment