Authored by weiqingting

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

... ... @@ -74,6 +74,7 @@ var t = new common.tab({
if (columnname == 1 || columnname == 2) {
editPostion = '#position9';
}
g.init($("#gridurl").val());
},
columns: [{
... ...
... ... @@ -143,4 +143,10 @@ $.ajax({
}
});
//去编辑商品名称
$('#editProductName').on('click', function() {
$('#productName').focus();
})
\ No newline at end of file
... ...
... ... @@ -41,6 +41,24 @@ var basicInfohtml = '',
attribute: {
1: '普通',
2: '赠品'
},
goodsSeason: {
0: '四季',
1: '春',
2: '夏',
3: '秋',
4: '冬',
5: '春夏',
6: '秋冬'
},
seasons: {
0: '四季',
1: '春',
2: '夏',
3: '秋',
4: '冬',
5: '春夏',
6: '秋冬'
}
},
basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '',
... ...
... ... @@ -253,7 +253,7 @@ common.edit.ajaxfileupload(".fenmianfile", {
__type: "upload",
bucket: "goodsimg"
},
valid_extensions: ['gif', 'png', 'jpg', 'jpeg'],
valid_extensions: ['png', 'jpg', 'jpeg'],
onComplete: function(response) {
console.log(response);
if (response.status && response.code == 200) {
... ...
... ... @@ -2,11 +2,8 @@
*@time: 2016/2/1
*@author: chenglong
*/
var $ = require('jquery');
common = require('../common/common');
var sortmenu = require('../common/sortmenu');
// 把Y、N转换成是、否
... ... @@ -18,14 +15,10 @@ function convertNorY(val) {
}
}
var tableGird = new common.grid({
el: "#attr-table",
parms: function () {
console.log(window.sortid);
return {
categoryId: window.sortid
};
... ... @@ -57,17 +50,69 @@ var tableGird = new common.grid({
]
});
var propValueGrid = new common.grid({
el: "#prop-value-table",
columns: [
{display: "ID", name: "id",
render: function (items) {
//items.id=items.__index+1;
return('<input id="id" class="form-control width110" value="'+items.id+'" type="text">');
}
},
{display: "属性值", name: "name",
render: function (items) {
return('<input id="name" class="form-control width110 propValue" value="'+items.name+'" data-index="'+items.__index+'" type="text" placeholder="属性值">');
}
},
{
display: "操作",
name: "categoryId",
render: function (items) {
var html = [];
if (items.__index == propValueGrid.__rows.length-1) {
html.push('<button data-index="' + items.__index + '" class="btn btn-success btn-xs prop-add-btn">添加</button>');
}
html.push('<button data-index="' + items.__index + '" class="btn btn-success btn-xs prop-del-btn">删除</button>');
return html.join("");
}
}
]
});
$(document).on("change",".propValue",function(){
var item=propValueGrid.__rows[$(this).data("index")];
item.name = $(this).val();
});
//增加属性值
$(document).on('click', '.prop-add-btn', function () {
propValueGrid.__rows.push({name:"",id:propValueGrid.__rows.length});
propValueGrid.reload();
});
//删除属性值
$(document).on('click', '.prop-del-btn', function () {
var item = tableGird.rows[$(this).data('index')];
propValueGrid.__rows.splice($(this).data('index'),1);
propValueGrid.reload();
});
sortmenu.init(function () {
tableGird.init('/product/attr/queryProductAttributeList');
});
$('#add-attri').click(function () {
attributeOp("添加", '/product/attr/add', {categoryId: window.sortid});
});
// 编辑产品属性
$(document).on('click', '.edit-class-btn', function () {
var item = tableGird.rows[$(this).data('index')];
... ... @@ -75,16 +120,49 @@ $(document).on('click', '.edit-class-btn', function () {
// $("#select2-shopsId-container").val(item.)
});
$(document).on('change', '#inputType', function () {
showORHidePropValue();
});
function attributeOp(prefix, url, item) {
var a = new common.edit(".confirm");
common.dialog.confirm(prefix + "属性", common.util.__template($("#template").html(), item), function () {
if(item.attributeValues) {
propValueGrid.__rows = JSON.parse(item.attributeValues);
} else {
propValueGrid.__rows=[{ 'name':""}];
}
common.dialog.confirm(prefix + "属性", common.util.__template($("#template").html(), item), function () {
return a.submit(url, function (option) {
option.data.categoryId = item.categoryId;
option.data.attributeId = item.attributeId;
var inputType = $('#inputType').val();
console.log(inputType);
// 单行文本 或者 多行文本 时不显示表格
if (inputType == 'textarea' || inputType == 'text' || inputType =="") {
} else {
var propVlaueArr = propValueGrid.__rows.splice(0).map(function(item,inex){
return {id:item.id,
name:item.name
}
});
option.data.attributeValues = JSON.stringify(propVlaueArr);
}
//console.log(propVlaueArr);
//option.debug = true;
propValueGrid.__rows = [];
option.success = function (res) {
res = res.data;
if (res.code == "200") {
a.$tip("提交成功", function () {
... ... @@ -104,7 +182,25 @@ function attributeOp(prefix, url, item) {
a.init();
// 属性值列表的初始化
propValueGrid.init(propValueGrid.__rows);
showORHidePropValue();
}
function showORHidePropValue () {
var inputType = $('#inputType').val();
// 单行文本 或者 多行文本 时不显示表格
if (inputType == 'textarea' || inputType == 'text' || inputType =="") {
$('#attributeValues').show();
$('#prop-value-table').hide();
} else {
$('#attributeValues').hide();
$('#prop-value-table').show();
}
}
... ...
This diff could not be displayed because it is too large.
... ... @@ -271,8 +271,8 @@ exports.res = [{
// type: 'number'
// }]
}, {
//网销信息 -> 编辑页面渲染
route: '/goods/audit/info/:param',
//网销信息 -> 编辑页面渲染
route: '/goods/audit/info/:param',
method: 'GET',
view: 'pages/goods/netsale-edit',
// url: '/product/getNetSaleInfo',
... ... @@ -355,6 +355,21 @@ exports.res = [{
}, {
name: 'searchSortList',
type: 'string'
}, {
name: 'searchKeys',
type: 'string'
}, {
name: 'brandRelationList',
type: 'string'
}, {
name: 'attributeProValuesOne',
type: 'string'
}, {
name: 'attributeProValuesTwo',
type: 'string'
}, {
name: 'goodsImagesReq',
type: 'string'
}]
}, {
//网销信息 -> 保存基本信息接口
... ... @@ -505,6 +520,15 @@ exports.res = [{
type: 'string'
}]
}, {
//网销信息 -> 关联逛
route: '/goods/article/queryArticlesBySKN',
method: 'POST',
url: '/article/queryArticlesBySKN ',
params: [{
name: 'productSkn',
type: 'number'
}]
}, {
//网销信息 -> 品牌关联列表
route: '/goods/brands/queryBrandsByStatus',
method: 'POST',
... ...
... ... @@ -137,159 +137,159 @@ exports.res = [
type: 'Number'
}]
},
// {
// //商品管理>【产品属性】页面渲染
// route: '/erpproduct/attribute/index',
// method: 'GET',
// view: 'pages/product/product-attr',
// //url: '/product/queryAllProductSortList',
// url:'/product/queryProductSortListByConf',
// src: '/product/attr',
// params:[{
// name: 'status',
// type: 'String',
// def:1
// }]
// },
// {
// //商品管理>【产品属性ajax获取】
// route: '/product/attr/get',
// method: 'POST',
// url: '/product/getAttr',
// },{
// //商品管理>【添加产品属性ajax】
// route: '/product/attr/add',
// method: 'POST',
// url: '/product/addProductAttribute',
// params: [
// {
// name: 'attributeName',
// type: 'String'
// },{
// name: 'saleType',
// type: 'Number'
// },{
// name: 'inputType',
// type: 'String'
// },{
// name: 'attributeType',
// type: 'String'
// },{
// name: 'isMust',
// type: 'String'
// },{
// name: 'isSearch',
// type: 'String'
// },{
// name: 'maxValueLen',
// type: 'Number'
// },{
// name: 'isAllowAlias',
// type: 'String'
// },{
// name: 'orderBy',
// type: 'Number'
// },{
// name: 'state',
// type: 'Number'
// },{
// name: 'remark',
// type: 'String'
// },{
// name: 'attributeValues',
// type: 'String'
// },{
{
//商品管理>【产品属性】页面渲染
route: '/erpproduct/attribute/index',
method: 'GET',
view: 'pages/product/product-attr',
//url: '/product/queryAllProductSortList',
url:'/product/queryProductSortListByConf',
src: '/product/attr',
params:[{
name: 'status',
type: 'String',
def:1
}]
},
{
//商品管理>【产品属性ajax获取】
route: '/product/attr/get',
method: 'POST',
url: '/product/getAttr',
},{
//商品管理>【添加产品属性ajax】
route: '/product/attr/add',
method: 'POST',
url: '/product/addProductAttribute',
params: [
{
name: 'attributeName',
type: 'String'
},{
name: 'saleType',
type: 'Number'
},{
name: 'inputType',
type: 'String'
},{
name: 'attributeType',
type: 'String'
},{
name: 'isMust',
type: 'String'
},{
name: 'isSearch',
type: 'String'
},{
name: 'maxValueLen',
type: 'Number'
},{
name: 'isAllowAlias',
type: 'String'
},{
name: 'orderBy',
type: 'Number'
},{
name: 'state',
type: 'Number'
},{
name: 'remark',
type: 'String'
},{
name: 'attributeValues',
type: 'String'
},{
// name: 'displayPosition',
// type: 'Number'
// },{
// name: 'categoryId',
// type: 'Number'
// }
// ]
// },{
// //商品管理>【更新产品属性ajax】
// route: '/product/attr/update',
// method: 'POST',
// url: '/product/updateProductAttribute',
// params: [
// {
// name: 'attributeName',
// type: 'String'
// },{
// name: 'saleType',
// type: 'Number'
// },{
// name: 'inputType',
// type: 'String'
// },{
// name: 'attributeType',
// type: 'String'
// },{
// name: 'isMust',
// type: 'String'
// },{
// name: 'isSearch',
// type: 'String'
// },{
// name: 'maxValueLen',
// type: 'Number'
// },{
// name: 'isAllowAlias',
// type: 'String'
// },{
// name: 'orderBy',
// type: 'Number'
// },{
// name: 'state',
// type: 'Number'
// },{
// name: 'remark',
// type: 'String'
// },{
// name: 'attributeValues',
// type: 'String'
// },{
name: 'displayPosition',
type: 'Number'
},{
name: 'categoryId',
type: 'Number'
}
]
},{
//商品管理>【更新产品属性ajax】
route: '/product/attr/update',
method: 'POST',
url: '/product/updateProductAttribute',
params: [
{
name: 'attributeName',
type: 'String'
},{
name: 'saleType',
type: 'Number'
},{
name: 'inputType',
type: 'String'
},{
name: 'attributeType',
type: 'String'
},{
name: 'isMust',
type: 'String'
},{
name: 'isSearch',
type: 'String'
},{
name: 'maxValueLen',
type: 'Number'
},{
name: 'isAllowAlias',
type: 'String'
},{
name: 'orderBy',
type: 'Number'
},{
name: 'state',
type: 'Number'
},{
name: 'remark',
type: 'String'
},{
name: 'attributeValues',
type: 'String'
},{
// name: 'displayPosition',
// type: 'Number'
// },{
// name: 'attributeId',
// type: 'Number'
// },{
// name: 'categoryId',
// type: 'Number'
// }
// ]
// },{
// //商品管理【根据类目ID ajax查询属性列表】
// route: '/product/attr/queryProductAttributeList',
// method: 'POST',
// url: '/product/queryProductAttributeList',
// params: [
// {
// name: 'categoryId',
// type: 'Number'
// },
// {
// name: 'page',
// type: 'Number'
// },
// {
// name: 'size',
// type: 'Number'
// }
// ]
// },{
// //商品管理【根据类目ID ajax查询属性的详细信息】
// route: '/product/attr/getProductAttribute',
// method: 'POST',
// url: '/product/getProductAttribute',
// params: [
// {
// name: 'attributeId',
// type: 'Number'
// }
// ]
// }
name: 'displayPosition',
type: 'Number'
},{
name: 'attributeId',
type: 'Number'
},{
name: 'categoryId',
type: 'Number'
}
]
},{
//商品管理【根据类目ID ajax查询属性列表】
route: '/product/attr/queryProductAttributeList',
method: 'POST',
url: '/product/queryProductAttributeList',
params: [
{
name: 'categoryId',
type: 'Number'
},
{
name: 'page',
type: 'Number'
},
{
name: 'size',
type: 'Number'
}
]
},{
//商品管理【根据类目ID ajax查询属性的详细信息】
route: '/product/attr/getProductAttribute',
method: 'POST',
url: '/product/getProductAttribute',
params: [
{
name: 'attributeId',
type: 'Number'
}
]
}
];
\ No newline at end of file
... ...
... ... @@ -45,6 +45,7 @@
<div class="panel panel-primary">
<div class="panel-heading">
<a class="netsale-position" href="javascript:;" name="position9"></a>
<a id="editProductName" class="btn btn-default" href="javascript:;" style="position: absolute;left: 40%;top: 20%;">去编辑商品名称</a>
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
... ...
... ... @@ -167,13 +167,16 @@
</div>
</div>
<div class="form-group">
<div class="form-group" id="propValue">
<label class="col-md-3 control-label">
属性值<i class="red">*</i>
</label>
<div class="col-md-6">
<div class="col-md-6" >
<input id="attributeValues" value="{attributeValues}" class="form-control width300" type="text" placeholder="属性值" required="required">
<div id="prop-value-table" class="table-responsive" >
</div>
</div>
</div>
... ...
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
<h2 class="panel-title">补全信息</h2>
... ...
... ... @@ -137,7 +137,7 @@
<div class="col-sm-12">
<label>商品短评<i class="red">*</i>:</label>
[[if renderType=='edit']]
<input id="productName" style="display:inline-block;width: 280px;" class="form-control" placeholder="基础商品名称" type="text" value="[[productName]]" required>
<input id="phrase" style="display:inline-block;width: 280px;" class="form-control" placeholder="商品短评" type="text" value="[[phrase]]" required>
[[else]]
<span>[[phrase]]</span>
[[/if]]
... ...
... ... @@ -17,7 +17,7 @@
<script type="text/template" id="fenmianTemp">
[[each goodsList as item index]]
<div class="form-group">
<div class="col-sm-1">
<div class="col-sm-2">
<div class="goods-img">
<p>SKC: [[item.productSkc]]</p>
<p>[[item.goodsName]]</p>
... ... @@ -25,7 +25,7 @@
</div>
</div>
<div class="col-sm-11">
<div class="col-sm-10">
<ul class="cover-image-list col-sm-12" data-index=[[index]]>
[[each item.goodsImagesList as _item _index]]
<li class="cover-image-item fileinput-button" data-index=[[_index]]>
... ... @@ -44,13 +44,13 @@
</div>
</div>
<div class="form-group">
<div class="col-sm-1">
<div class="col-sm-2">
<div class="height40">颜色封面:</div>
</div>
<div class="col-sm-11">
<div id="cover-color" class="cover-color col-sm-12 height40">
<div class="col-sm-10">
<div id="cover-color" class="cover-color col-sm-12">
[[each item.goodsImagesList as _item _index]]
<div class="cover-color-box">
<div class="cover-color-box height40">
[[if _item.isDefault=="Y"]]
<a href="javascript:;" class="btn btn-default btn-metro info">默认</a>
[[else]]
... ... @@ -76,11 +76,11 @@
</div>
</div>
<div class="form-group">
<div class="col-sm-1">
<div class="col-sm-2">
<div class="goods-color height40">商品封面:</div>
</div>
<div class="col-sm-11">
<div class="goods-color height40">
<div class="col-sm-10">
<div class="goods-color">
[[if item.isDefault=="Y"]]
<a href="javascript:;" class="btn btn-default btn-metro info" data-index=[[index]]>设置默认</a>
[[else]]
... ... @@ -102,7 +102,7 @@
</script>
<script type="text/template" id="colorCoverTemp">
<div class="cover-color-box">
<div class="cover-color-box height40">
<a href="javascript:;" class="btn btn-default btn-metro">默认</a>
<a href="javascript:;" class="btn btn-default btn-metro">男封</a>
<a href="javascript:;" class="btn btn-default btn-metro">女封</a>
... ...