Authored by 陶雨

Merge branch 'release/1.6' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into release/1.6

... ... @@ -44,6 +44,7 @@ function batchExport(el, type) {
},
onComplete: function(response) {
console.log(response);
$("#message").html('');
if (loadModal) {
loadModal.close();
}
... ... @@ -53,11 +54,10 @@ function batchExport(el, type) {
return;
}
if(response.data&&response.data.failFileReason.length){
$("#message").html(response.data.failFileReason.join('/n'));
$("#message").html(response.data.failFileReason.join('<br/>'));
return false;
}
common.util.__tip(response.message, 'warning');
}
}
}
... ...
... ... @@ -41,7 +41,6 @@ var Bll={
validateSort:function(){
var id=false;
var select=tabTree.getAddress();
console.log("select",select);
if(select.length>2){
if(select[2]&&select[2].id){
id=select[2].id;
... ... @@ -87,6 +86,7 @@ var ag=new common.grid({
for(var i in attrs){
if(attrs[i].standardId==item.attributeId){
item.val=attrs[i].standardVal
item.__val=attrs[i].parameterMakeId
}
}
}
... ... @@ -128,7 +128,6 @@ var SORTDATA={
displayPosition:1
}
},function(res){
console.log("分类",res);
ag.init(res.data);
},true);
}
... ... @@ -214,10 +213,10 @@ var g=new common.grid({
}
g.__e.init();
for(var i in g.__gsm){
var warp=$("#rows__"+i).children(".form-group").slice(0, 1);
var warp=$("#rows__"+i).children(".form-group").slice(0, g.__gsm[i]);
warp.find("input").prop("readonly",true);
warp.find("select").prop("disabled",true);
warp.find("btn-sort-remove").remove();
warp.find(".btn-sort-remove").remove();
warp.find(".btn-sort-kucun").prop("readonly",false);
}
for(var i=0;i<g.__length;i++){
... ... @@ -310,8 +309,9 @@ $(document).on("change",".salesPriceStr",function(){
ENUM.goodsSizeList.salePrice=$.trim($(this).val());
});
$(document).on("click",".sortdelete",function(){
var that=this;
common.dialog.confirm("温馨提示","你确定删除吗?",function(){
var index=$(this).data("index");
var index=$(that).data("index");
[].splice.call(g.__rows,index,1);
g.reload();
});
... ... @@ -323,7 +323,9 @@ $(document).on("change",".factoryCode",function(){
});
$(document).on("click",".btn-sort-add",function(){
var item=g.__rows[$(this).data("index")];
item.goodsSizeList.push($.extend({},ENUM.goodsSizeList));
var goodsSizeList=$.extend({},ENUM.goodsSizeList);
goodsSizeList.salePrice=$("#salesPriceStr").val();
item.goodsSizeList.push(goodsSizeList);
g.reload();
// g.__e.init();
});
... ... @@ -415,7 +417,6 @@ e.on("validate",function(){
return "请选择完整的分类目录";
});
e.on("validate",function(){
console.log(g.__gsm);
if(g.__rows.length==0){
return "请添加销售属性";
}
... ... @@ -505,17 +506,36 @@ $(document).on("click","#btnReview",function(){
if(ag.rows.length>0){
for(var i in ag.rows){
if(ag.rows[i].val){
if(ag.rows[i].inputType!="text"&&ag.rows[i].inputType!="textarea"){
var arr=ag.rows[i].val.split('|');
var idNameList=ag.rows[i].idNameList;
for(var x in idNameList){
for(var y in arr){
if(arr[y]==idNameList[x].id){
option.data.productStandardRelationStr.push({
standardId:ag.rows[i].attributeId,
standardVal:idNameList[x].text,
parameterMakeId:idNameList[x].id
});
}
}
}
}else{
option.data.productStandardRelationStr.push({
standardId:ag.rows[i].attributeId,
standardVal:ag.rows[i].val
standardVal:ag.rows[i].val,
parameterMakeId:ag.rows[i].id
});
}
}
}
}
option.data.productStandardRelationStr=JSON.stringify(option.data.productStandardRelationStr);
// option.debug=true;
console.log(option.data);
// console.log(option.data);
option.success=function(res){
res = res.data;
if(res.code == "200") {
... ...
... ... @@ -29,7 +29,7 @@ var urlObj = {
'queryAll4Select': '/goods/brandSeries/queryAll4Select' //品牌款型系列
};
var minimumResultsForSearch=["sortbybrand","getjitSup"];
var minimumResultsForSearch=["sortbybrand","getjitSup","sortsize2"];
var dropDown = function(option) {
new dropDown.prototype.init(option);
... ...
... ... @@ -42,9 +42,13 @@ var util = {
res = res.data;
if (res.code != 200) {
util.__tip(res.message, "warning");
return false;
} else {
return callback.bind(this, res)();
}
},
error:function(){
return false;
}
});
}
... ... @@ -240,6 +244,17 @@ var util = {
} else {
return "";
}
},
// 判断是否是有效的json字串
__isJsonString: function (str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
}
module.exports = util;
\ No newline at end of file
... ...
... ... @@ -158,7 +158,7 @@ var g = new common.grid({
name: 'picImgUrl',
render: function(item) {
if (item.picImgUrl) {
return '<a href="' + item.productUrl + '"><img src="' + item.picImgUrl + '" width="100" height="60"></a>';
return '<a target="_blank" href="' + item.productUrl + '"><img src="' + item.picImgUrl + '" width="100" height="60"></a>';
} else {
return '';
}
... ... @@ -174,7 +174,7 @@ var g = new common.grid({
middleSortName = item.middleSortName ? item.middleSortName : '',
html = '';
html += '<p><strong>名称:</strong><a href="' + item.productUrl + '">' + productName + '</a></p>';
html += '<p><strong>名称:</strong><a target="_blank" href="' + item.productUrl + '">' + productName + '</a></p>';
html += '<p><strong>品牌:</strong>' + brandName + '</p>';
html += '<p><strong>类目:</strong>' + maxSortName;
if (middleSortName) {
... ...
... ... @@ -73,7 +73,7 @@ GOLABDATA.on("LYaddInfo", function() {
$.ajax({
type: 'POST',
url: '/goods/product/queryAfterSaleInfo',
url: '/goods/product/queryAttributesByConf',
data: {
saleType: 2,
displayPosition: 3,
... ... @@ -105,7 +105,7 @@ $.ajax({
if (NETSALEDATA.attributeProValuesBosTwo) {
$.each(NETSALEDATA.attributeProValuesBosTwo, function(i, value) {
$.each(data.attributes.data, function(i2, value2) {
$.each(data.data, function(i2, value2) {
if (value.attributeId == value2.attributeId) {
value2.selectedValues = value.attributeValueId.replace(/,/g, "|");
}
... ... @@ -113,17 +113,6 @@ $.ajax({
});
}
$.each(data.productComfort.data, function(index, item) {
if (comfort && comfort[index]) {
item.value = comfort[index].value;
} else {
item.value = '';
}
});
$('#addinfo-wrap').html(common.util.__template2($('#addInfoTemp').html(), data));
e.on("bind", function() {
... ...
... ... @@ -25,7 +25,25 @@ var tableGird = new common.grid({
},
columns: [
{display: "属性名称", name: "attributeName"},
{display: "属性类型", name: "attributeValues"},
{display: "属性类型",
//name: "attributeValues"
render: function (item) {
var propType = item.attributeValues;
var propsStr="";
if (common.util.__isJsonString(propType)) {
var props = JSON.parse(propType);
props.forEach(function(prop){
propsStr += prop.name + ",";
});
} else {
propsStr = propType;
}
return '<p> '+propsStr+'</p>';
}
},
{display: "输入类型", name: "inputType"},
{
display: "是否必选",
... ... @@ -44,6 +62,7 @@ var tableGird = new common.grid({
name: "categoryId",
render: function (items) {
if (items.categoryId == window.sortid)
return ('<button data-index="' + items.__index + '" class="btn btn-success btn-xs edit-class-btn">编辑</button>');
}
}
... ... @@ -77,8 +96,15 @@ var propValueGrid = new common.grid({
if (items.__index == propValueGrid.__rows.length-1) {
html.push('<button data-index="' + items.__index + '" class="btn btn-success btn-xs prop-add-btn">添加</button>');
}
if (items.__index == 0 ) {
if (propValueGrid.__rows.length != 1) {
html.push('<button data-index="' + items.__index + '" class="btn btn-success btn-xs prop-del-btn">删除</button>');
}
} else {
html.push('<button data-index="' + items.__index + '" class="btn btn-success btn-xs prop-del-btn">删除</button>');
}
return html.join("");
}
}
... ... @@ -145,10 +171,16 @@ function attributeOp(prefix, url, item) {
var a = new common.edit(".confirm");
if(item.attributeValues) {
if (common.util.__isJsonString(item.attributeValues)) {
propValueGrid.__rows = JSON.parse(item.attributeValues);
} else {
propValueGrid.__rows=[{ 'name':"", 'id':"1"}];
}
} else {
propValueGrid.__rows=[{ 'name':"", 'id':"1"}];
}
common.dialog.confirm(prefix + "属性", common.util.__template($("#template").html(), item), function () {
return a.submit(url, function (option) {
... ... @@ -220,9 +252,13 @@ function showORHidePropValue () {
if (inputType == 'textarea' || inputType == 'text' || inputType =="") {
$('#attributeValues').show();
$('#prop-value-table').hide();
$('.propValue').removeAttr("required");
} else {
$('#attributeValues').hide();
$('#prop-value-table').show();
$('.propValue').attr("required");
}
}
... ...
... ... @@ -14,7 +14,7 @@ var config = {
apiKey: 'sd4H1ecAqlp',
//http: //192.168.102.214:8088/platform
// domain: 'http://172.16.6.240:8088/platform',
// domain:'http://172.16.6.240:8088/platform',//王书生
// domain:'http://172.16.6.240:8088/platform',// 王书生
// domain: 'http://172.16.6.124:8088/platform',//陈超
//http://172.16.6.124:8088/platform/product/queryAllProductAttr
//domain: 'http://172.16.6.227:8088/platform', //玛丽
... ...
... ... @@ -4,8 +4,7 @@ exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.162:8088/platform'; //李建
//商品管理路由配置
exports.res = [
{
exports.res = [{
//网销信息 -> 网销信息页面渲染
route: '/goods/netsale/index',
method: 'GET',
... ... @@ -207,8 +206,8 @@ exports.res = [
src: '/goods/netsale-edit',
data: {
type: 'info',
subtitle:"查看",
maintitle:"查看商品信息"
subtitle: "查看",
maintitle: "查看商品信息"
} //,
// params: [{
... ... @@ -225,8 +224,8 @@ exports.res = [
src: '/goods/netsale-edit',
data: {
type: 'edit',
subtitle:"编辑",
maintitle:"编辑商品信息"
subtitle: "编辑",
maintitle: "编辑商品信息"
} //,
// params: [{
... ... @@ -393,30 +392,8 @@ exports.res = [
}]
}, {
//网销信息 -> 查询补全信息
route: '/goods/product/queryAfterSaleInfo',
route: '/goods/product/queryAttributesByConf',
method: 'POST',
apis: {
productStyle: {
url: '/productStyle/queryProductStyles4Select'
},
productComfort: {
url: '/productComfort/queryProductComfortList'
},
productElements: {
url: '/productElements/queryProductElements4Select'
},
makingProcess: {
url: '/product/queryMakingProcess',
params: [{
name: 'categoryId',
type: 'number'
}, {
name: 'displayPosition',
type: 'number'
}],
isJsonRaw: true
},
attributes: {
url: '/product/queryAttributesByConf',
params: [{
name: 'categoryId',
... ... @@ -427,10 +404,7 @@ exports.res = [
}, {
name: 'saleType',
type: 'number'
}],
isJsonRaw: true
}
}
}]
}, {
route: '/goods/ShopsRest/queryShopsByBrandId',
method: 'POST',
... ...
... ... @@ -48,7 +48,7 @@
<p>
{{#data}}
{{#each list}}
<button type="button" class="btn btn-default sortadd btn-xs" data-id="{{id}}">{{colorName}}(+)</button>
<button type="button" class="btn btn-default sortadd btn-xs" data-id="{{id}}">{{colorName}}</button>
{{/each}}
{{/data}}
</p>
... ... @@ -64,7 +64,7 @@
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a class="btn btn-default" href="/supplier/baseproduct/index">取消</a>
<button type="submit" class="btn btn-success mr5" data-loading-text="提交审核中..." id="btnReview">提交审核</button>
<button type="submit" class="btn btn-success mr5" data-loading-text="保存中..." id="btnReview">保存</button>
</div>
</div>
</div>
... ... @@ -172,7 +172,6 @@
<label class="col-sm-1 control-label">货品季<span class="red">*</span></label>
<div class="col-sm-1">
<select id="goodsSeason" class="form-control" value="[[goodsSeason]]">
<option value="0">四季</option>
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
... ... @@ -360,30 +359,30 @@
[[if inputType=='checkbox']]
[[each idNameList as item index ]]
<label class="radio-inline">
<input type="checkbox" name="attr_[[__index]]" data-index=[[__index]] class="attr_checkobx_class" value="[[item.text]]">[[item.text]]</label>
<input type="checkbox" name="attr_[[__index]]" data-index=[[__index]] class="attr_checkobx_class" value="[[item.id]]">[[item.text]]</label>
[[/each]]
<input type="hidden" id="attr_[[__index]]" value="[[val||'']]" [[required]] for="checkbox" placeholder="[[attributeName]]"/>
<input type="hidden" id="attr_[[__index]]" value="[[__val||'']]" [[required]] for="checkbox" placeholder="[[attributeName]]"/>
[[/if]]
[[if inputType=='radio']]
[[each idNameList as item index ]]
<label class="radio-inline">
<input type="radio" name="attr_[[__index]]" data-index=[[__index]] class="attr_input" value="[[item.text]]">[[item.text]]</label>
<input type="radio" name="attr_[[__index]]" data-index=[[__index]] class="attr_input" value="[[item.id]]">[[item.text]]</label>
[[/each]]
<input type="hidden" id="attr_[[__index]]" data-index='[[__index]]' value="[[val||'']]" [[required]] for="radio" placeholder="[[attributeName]]" />
<input type="hidden" id="attr_[[__index]]" data-index='[[__index]]' value="[[__val||'']]" [[required]] for="radio" placeholder="[[attributeName]]" />
[[/if]]
[[if inputType=='select']]
<select class="form-control attr_input" data-index='[[__index]]' value="[[val||'']]" [[required]]>
<option value="">请选择</option>
<select class="form-control attr_input" style="width: 280px" data-index='[[__index]]' value="[[__val||'']]" [[required]]>
<option value="">请选择[[attributeName]]</option>
[[each idNameList as item index ]]
<option value="[[item.text]]">[[item.text]]</option>
<option value="[[item.id]]">[[item.text]]</option>
[[/each]]
</select>
[[/if]]
[[if inputType=='text']]
<input type="text" class="form-control attr_input" data-index='[[__index]]' value="[[val||'']]" [[required]] maxlength='[[maxValueLen]]' placeholder="[[attributeName]]"/>
<input type="text" class="form-control attr_input" style="width: 280px" data-index='[[__index]]' value="[[val||'']]" [[required]] maxlength='[[maxValueLen]]' placeholder="[[attributeName]]"/>
[[/if]]
[[if inputType=='textarea']]
<textarea class="form-control attr_input" data-index='[[__index]]' [[required]] maxlength='[[maxValueLen]]' placeholder="[[attributeName]]">[[val||'']]</textarea>
... ...
... ... @@ -29,8 +29,8 @@
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input type="number" id="productSkn" value="" class="form-control" placeholder="SKN"
style="height: 39px;"/>
<input type="text" id="productSkn" value="" class="form-control" placeholder="SKN"
style="height: 39px;" maxlength="9" />
</div>
<div class="panel-col">
<input type="text" id="productName" class="form-control" placeholder="商品名称" style="height: 39px;"/>
... ...
... ... @@ -97,6 +97,7 @@
<button class="btn btn-primary apply-success">通过</button>
<button class="btn btn-primary apply-back">驳回</button>
[[/if]]
<button onclick="history.go(-1);" type="button" class="btn btn-primary btn-info">返回</button>
</div>
</form>
</div>
... ... @@ -111,7 +112,7 @@
<thead>
<tr>
<th>SKC</th>
<th>SKN</th>
<th>SKU</th>
<th>销售价</th>
<th>款型编码</th>
<th>条码</th>
... ... @@ -125,16 +126,16 @@
<tr>
<th>
<span>[[item.productSkc]]</span>
<span>[[item.factoryGoodsName||""]]</span>
<span>[[item.goodsName]]</span>
</th>
<th>
<span>[[item.productSkn]]</span>
<span>[[_item.productSku]]</span>
<span>[[_item.sizeName]]</span>
</th>
<th>[[_item.salePrice]]</th>
<th>[[item.factoryCode]]</th>
<th>[[_item.barCode]]</th>
<th>[[item.goodsName]]</th>
<th>[[item.factoryGoodsName]]</th>
[[if _item.isSuppled=="Y"]]
<th></th>
[[else]]
... ...
... ... @@ -83,9 +83,7 @@
[[/each]]
</div>-->
<script type="text/template" id="addInfoTemp">
[[each attributes as a index]]
[[if index=="data"]]
[[each a as b index]]
[[each data as b index]]
<div class="attribute-group form-group">
<label>[[b.attributeName]]</label>
[[if b.inputType=='select']]
... ... @@ -107,8 +105,6 @@
</div>
[[/each]]
[[/if]]
[[/each]]
<div id="brandModelWrap" class="form-group">
<label>品牌款型:</label>
<div style="display: inline-block;width: 280px;">
... ...
... ... @@ -39,12 +39,22 @@
[[if b.idNameList && b.idNameList.length>0]]
<div class="goods-param-group form-group">
<label>[[b.attributeName]]</label>
[[if b.inputType=='select']]
<div style="display: inline-block;width: 280px;">
<select class="form-control" id="[[b.attributeId]]" value="[[b.selectedValues||'']]">
[[each b.idNameList as c index]]
<option value="[[c.id]]">[[c.text]]</option>
[[/each]]
</select>
</div>
[[else]]
<span>
[[each b.idNameList as c index]]
<label style="cursor: pointer;"><input name="[[b.attributeId]]" type="[[b.inputType]]" value="[[c.id]]">[[c.text]]</label>
[[/each]]
</span>
<input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues]]" [[b.isMust=="N"?"":"required"]] placeholder="[[b.attributeName]]">
<input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues||'']]">
[[/if]]
</div>
[[/if]]
[[/each]]
... ...