Authored by mali

展示sku状态

... ... @@ -21,6 +21,8 @@ public class Storage {
private BigDecimal suggestHighPrice;
private Integer status;
public Integer getId() {
return id;
}
... ... @@ -92,5 +94,28 @@ public class Storage {
public void setSuggestHighPrice(BigDecimal suggestHighPrice) {
this.suggestHighPrice = suggestHighPrice;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
@Override
public String toString() {
return "Storage{" +
"id=" + id +
", productId=" + productId +
", goodsId=" + goodsId +
", sizeId=" + sizeId +
", storageNum=" + storageNum +
", updateTime=" + updateTime +
", createTime=" + createTime +
", suggestLowPrice=" + suggestLowPrice +
", suggestHighPrice=" + suggestHighPrice +
", status=" + status +
'}';
}
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@
<result column="create_time" jdbcType="INTEGER" property="createTime" />
<result column="suggest_low_price" jdbcType="DECIMAL" property="suggestLowPrice" />
<result column="suggest_high_price" jdbcType="DECIMAL" property="suggestHighPrice" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from storage
... ... @@ -44,7 +45,7 @@
from storage
</select>
<select id="selectByGoodsId" resultMap="BaseResultMap">
select id, product_id, goods_id, size_id, storage_num, update_time, create_time, suggest_low_price, suggest_high_price
select id, product_id, goods_id, size_id, storage_num, update_time, create_time, suggest_low_price, suggest_high_price, status
from storage where goods_id = #{goodsId,jdbcType=INTEGER}
</select>
<select id="selectByGoodsIdList" resultMap="BaseResultMap">
... ...
... ... @@ -470,6 +470,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
suggestPriceList.add(suggestPrice);
}
bo.setSuggestPriceList(suggestPriceList);
bo.setStatusList(CollectionUtil.map(storages, Storage::getStatus));
}
bo.setProductIntro(productIntroService.selectProductIntroById(product.getId()));
... ...
... ... @@ -417,12 +417,12 @@
columns: [[{
title: "色系名称",
field: "colorName",
width: 40,
width: 20,
align: "center"
}, {
title: "颜色展示名称",
field: "goodsName",
width: 80,
width: 50,
height: 50,
align: "center",
formatter: function(value) {
... ... @@ -431,19 +431,24 @@
}, {
title: "尺码",
field: "size",
width: 100,
width: 40,
align: "center"
}, {
title: "SKU",
field: "sku",
width: 80,
width: 40,
align: "center"
},{
title: "平台建议售价",
field: "suggestPrice",
width: 80,
width: 60,
align: "center"
}]],
},{
title: "状态",
field: "status",
width: 30,
align: "center"
}]],
cache: false,
pagination: false,
idField: "id",
... ... @@ -453,6 +458,22 @@
$('.goods-name').textbox({
width: 100
});
// 下架商品
/*$(this).myDatagrid("getPanel").find("a[role='downSkuStatus']").linkbutton({
iconCls: "icon-more",
onClick: function () {
updateSkuStatus($(this).attr("dataId"), 0);
}
});*/
// 上架
/*$(this).myDatagrid("getPanel").find("a[role='upSkuStatus']").linkbutton({
iconCls: "icon-more",
onClick: function () {
updateSkuStatus($(this).attr("dataId"), 1);
}
});*/
}
});
... ... @@ -608,7 +629,8 @@
goodsName: goodsName,
size: $(item).parent().text(),
sku: ($(item).parent().text() in oldColorSizeTableData) ? oldColorSizeTableData[$(item).parent().text()].sku : '-',
suggestPrice: ($(item).parent().text() in oldColorSizeTableData) ? oldColorSizeTableData[$(item).parent().text()].suggestPrice : '-'
suggestPrice: ($(item).parent().text() in oldColorSizeTableData) ? oldColorSizeTableData[$(item).parent().text()].suggestPrice : '-',
status:($(item).parent().text() in oldColorSizeTableData) ? oldColorSizeTableData[$(item).parent().text()].status : '-'
});
});
... ... @@ -618,7 +640,8 @@
goodsName: goodsName,
size: '',
sku: '-',
suggestPrice:'-'
suggestPrice:'-',
status:'-'
});
}
that.mergeCells();
... ... @@ -885,7 +908,8 @@
goodsName: that.detailData.goodsName,
size: $('.group-size label[data-id=' + item + ']').text(),
sku: that.detailData.storageIdList[i],
suggestPrice: that.detailData.suggestPriceList[i]
suggestPrice: that.detailData.suggestPriceList[i],
status:that.detailData.statusList[i] == 1 ? '上架' : '<font color="red" >下架</font>'
});
}
}
... ... @@ -959,6 +983,14 @@
return x.replace(/^\s+|\s+$/gm,'');
}
function updateSkuStatus(sku, status) {
$.get(contextPath + '/storage/updateSkuStatus?storageId=' + sku + '&status=' + status, function(ret) {
if (ret && ret.code == 200) {
this.mergeCells();
}
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...