提交 879beaac authored 作者: 吴德鹏's avatar 吴德鹏

完成商品二级分类排序

上级 d350d360
...@@ -58,6 +58,16 @@ public class TbCfDescripitonEntity implements Serializable { ...@@ -58,6 +58,16 @@ public class TbCfDescripitonEntity implements Serializable {
private Integer count; private Integer count;
private Integer sort;
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getCount() { public Integer getCount() {
return count; return count;
} }
......
...@@ -30,6 +30,8 @@ public class TbCfGoodstwotypeEntity implements Serializable { ...@@ -30,6 +30,8 @@ public class TbCfGoodstwotypeEntity implements Serializable {
*/ */
private String goodstwotypeUrl; private String goodstwotypeUrl;
private Integer sort;
/** /**
* 设置:商品二级分类Id * 设置:商品二级分类Id
*/ */
...@@ -82,4 +84,12 @@ public class TbCfGoodstwotypeEntity implements Serializable { ...@@ -82,4 +84,12 @@ public class TbCfGoodstwotypeEntity implements Serializable {
public String getGoodstwotypeUrl() { public String getGoodstwotypeUrl() {
return goodstwotypeUrl; return goodstwotypeUrl;
} }
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
} }
...@@ -27,6 +27,16 @@ public class GoodsTypeToGoodsTwo implements Serializable { ...@@ -27,6 +27,16 @@ public class GoodsTypeToGoodsTwo implements Serializable {
private Integer count; private Integer count;
private Integer sort;
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getCount() { public Integer getCount() {
return count; return count;
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result property="image" column="image"/> <result property="image" column="image"/>
<result property="postage" column="postage"/> <result property="postage" column="postage"/>
<result property="morePostage" column="more_postage"/> <result property="morePostage" column="more_postage"/>
<result property="sort" column="sort"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfDescripitonEntity"> <select id="queryObject" resultType="com.platform.entity.TbCfDescripitonEntity">
...@@ -23,7 +24,8 @@ ...@@ -23,7 +24,8 @@
`goodstwotype_id`, `goodstwotype_id`,
`image`, `image`,
`postage`, `postage`,
`more_postage` `more_postage`,
sort
from tb_cf_descripiton from tb_cf_descripiton
where descripition_id = #{id} where descripition_id = #{id}
</select> </select>
...@@ -43,7 +45,8 @@ ...@@ -43,7 +45,8 @@
`goodstwotype_id`, `goodstwotype_id`,
`image`, `image`,
`postage`, `postage`,
`more_postage` `more_postage`,
sort
from tb_cf_descripiton from tb_cf_descripiton
where goodstwotype_id = #{id} where goodstwotype_id = #{id}
</select> </select>
...@@ -57,6 +60,7 @@ ...@@ -57,6 +60,7 @@
d.image, d.image,
d.postage, d.postage,
d.more_postage, d.more_postage,
d.sort,
o.goodstype_title type, o.goodstype_title type,
t.goodstwotype_title twoType, t.goodstwotype_title twoType,
t.count count t.count count
...@@ -97,7 +101,8 @@ ...@@ -97,7 +101,8 @@
`goodstwotype_id`, `goodstwotype_id`,
`image`, `image`,
`postage`, `postage`,
`more_postage`) `more_postage`,
sort)
values( values(
#{descripitionId}, #{descripitionId},
#{descripitionName}, #{descripitionName},
...@@ -106,7 +111,8 @@ ...@@ -106,7 +111,8 @@
#{goodstwotypeId}, #{goodstwotypeId},
#{image}, #{image},
#{postage}, #{postage},
#{morePostage}) #{morePostage},
#{sort})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfDescripitonEntity"> <update id="update" parameterType="com.platform.entity.TbCfDescripitonEntity">
...@@ -119,6 +125,7 @@ ...@@ -119,6 +125,7 @@
<if test="image != null">`image` = #{image},</if> <if test="image != null">`image` = #{image},</if>
<if test="postage != null">`postage` = #{postage},</if> <if test="postage != null">`postage` = #{postage},</if>
<if test="morePostage != null">`more_postage` = #{morePostage}</if> <if test="morePostage != null">`more_postage` = #{morePostage}</if>
<if test="sort != null">`sort` = #{sort}</if>
</set> </set>
where descripition_id = #{descripitionId} where descripition_id = #{descripitionId}
</update> </update>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result property="goodstwotypeTitle" column="goodstwotype_title"/> <result property="goodstwotypeTitle" column="goodstwotype_title"/>
<result property="goodstypeId" column="goodstype_id"/> <result property="goodstypeId" column="goodstype_id"/>
<result property="goodstwotypeUrl" column="goodstwotype_url"/> <result property="goodstwotypeUrl" column="goodstwotype_url"/>
<result property="sort" column="sort"/>
</resultMap> </resultMap>
<resultMap type="com.platform.entity.merge.GoodsTypeToGoodsTwo" id="GoodsToTwo"> <resultMap type="com.platform.entity.merge.GoodsTypeToGoodsTwo" id="GoodsToTwo">
...@@ -16,6 +17,7 @@ ...@@ -16,6 +17,7 @@
<result property="goodstypeId" column="goodstype_id"/> <result property="goodstypeId" column="goodstype_id"/>
<result property="goodstypeTitle" column="goodstype_title"/> <result property="goodstypeTitle" column="goodstype_title"/>
<result property="goodstwotypeUrl" column="goodstwotype_url"/> <result property="goodstwotypeUrl" column="goodstwotype_url"/>
<result property="sort" column="sort"/>
</resultMap> </resultMap>
<select id="queryGoodsTypeId" resultMap="GoodsToTwo"> <select id="queryGoodsTypeId" resultMap="GoodsToTwo">
...@@ -23,6 +25,7 @@ ...@@ -23,6 +25,7 @@
tw.`goodstwotype_id`, tw.`goodstwotype_id`,
tw.`goodstwotype_title`, tw.`goodstwotype_title`,
tw.`goodstwotype_url`, tw.`goodstwotype_url`,
tw.sort,
ds.`goodstype_id`, ds.`goodstype_id`,
ds.`goodstype_title` ds.`goodstype_title`
FROM tb_cf_goodstwotype tw FROM tb_cf_goodstwotype tw
...@@ -42,7 +45,8 @@ ...@@ -42,7 +45,8 @@
`goodstwotype_id`, `goodstwotype_id`,
`goodstwotype_title`, `goodstwotype_title`,
`goodstwotype_url`, `goodstwotype_url`,
`goodstype_id` `goodstype_id`,
sort
from tb_cf_goodstwotype from tb_cf_goodstwotype
WHERE goodstype_id= #{id} WHERE goodstype_id= #{id}
</select> </select>
...@@ -52,7 +56,8 @@ ...@@ -52,7 +56,8 @@
`goodstwotype_id`, `goodstwotype_id`,
`goodstwotype_title`, `goodstwotype_title`,
`goodstype_id`, `goodstype_id`,
`goodstwotype_url` `goodstwotype_url`,
sort
from tb_cf_goodstwotype from tb_cf_goodstwotype
where goodstwotype_id = #{id} where goodstwotype_id = #{id}
</select> </select>
...@@ -62,17 +67,22 @@ ...@@ -62,17 +67,22 @@
tw.`goodstwotype_id`, tw.`goodstwotype_id`,
tw.`goodstwotype_title`, tw.`goodstwotype_title`,
tw.`goodstwotype_url`, tw.`goodstwotype_url`,
tw.sort,
ds.`goodstype_id`, ds.`goodstype_id`,
ds.`goodstype_title`, ds.`goodstype_title`,
IFNULL(t.count,0) count IFNULL(t.count,0) count
FROM FROM
tb_cf_goodstwotype tw tb_cf_goodstwotype tw
left JOIN tb_cf_goodstype ds ON ds.goodstype_id = tw.goodstype_id left JOIN tb_cf_goodstype ds ON ds.goodstype_id = tw.goodstype_id
left JOIN ( SELECT count( * ) count, c.item_categorytwo FROM tb_cf_station_item c where c.enable_flag!=0 GROUP BY item_categorytwo ) t ON tw.goodstwotype_id = t.item_categorytwo left JOIN ( SELECT count( * ) count, c.item_categorytwo FROM tb_cf_station_item c where c.enable_flag!=0 GROUP
BY item_categorytwo ) t ON tw.goodstwotype_id = t.item_categorytwo
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND goodstwotype_title LIKE concat('%',#{name},'%') AND goodstwotype_title LIKE concat('%',#{name},'%')
</if> </if>
<if test="category != null and category.trim() != ''">
AND tw.goodstype_id=#{category}
</if>
<choose> <choose>
<when test="sidx != null and sidx.trim() != ''"> <when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order} order by ${sidx} ${order}
...@@ -99,20 +109,24 @@ ...@@ -99,20 +109,24 @@
`goodstwotype_id`, `goodstwotype_id`,
`goodstwotype_title`, `goodstwotype_title`,
`goodstype_id`, `goodstype_id`,
`goodstwotype_url`) `goodstwotype_url`,
sort)
values( values(
#{goodstwotypeId}, #{goodstwotypeId},
#{goodstwotypeTitle}, #{goodstwotypeTitle},
#{goodstypeId}, #{goodstypeId},
#{goodstwotypeUrl}) #{goodstwotypeUrl},
#{sort}
)
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfGoodstwotypeEntity"> <update id="update" parameterType="com.platform.entity.TbCfGoodstwotypeEntity">
update tb_cf_goodstwotype update tb_cf_goodstwotype
<set> <set>
<if test="goodstwotypeTitle != null">`goodstwotype_title` = #{goodstwotypeTitle}, </if> <if test="goodstwotypeTitle != null">`goodstwotype_title` = #{goodstwotypeTitle},</if>
<if test="goodstypeId != null">`goodstype_id` = #{goodstypeId}, </if> <if test="goodstypeId != null">`goodstype_id` = #{goodstypeId},</if>
<if test="goodstwotypeUrl != null">`goodstwotype_url` = #{goodstwotypeUrl}</if> <if test="goodstwotypeUrl != null">`goodstwotype_url` = #{goodstwotypeUrl},</if>
<if test="sort != null">`sort` = #{sort}</if>
</set> </set>
where goodstwotype_id = #{goodstwotypeId} where goodstwotype_id = #{goodstwotypeId}
</update> </update>
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
<title></title> <title></title>
#parse("sys/header.html") #parse("sys/header.html")
<style> <style>
.ui-jqgrid .ui-jqgrid-bdiv{ .ui-jqgrid .ui-jqgrid-bdiv {
height:auto!important; height: auto !important;
} }
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
border-top: 2px solid #e7eaec; border-top: 2px solid #e7eaec;
line-height: 1.38857; line-height: 1.38857;
...@@ -20,9 +21,22 @@ ...@@ -20,9 +21,22 @@
<div v-show="showList" style="height: 100%;"> <div v-show="showList" style="height: 100%;">
<Row :gutter="16"> <Row :gutter="16">
<div class="search-group"> <div class="search-group">
<i-col span="4"> <span style="margin-left: 30px">
<i-input v-model="q.name" @on-enter="query" placeholder="名称"/> 二级分类名称:
</i-col>
<i-input v-model="q.name" @on-enter="query" placeholder="名称" style="width:160px"/>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span>
一级分类:
<i-select v-model="q.category" @on-enter="query"
placeholder="一级分类" style="width:160px">
<i-option v-for="(el,i) in Goodstype" :key='i'
:value="el.goodstypeId">{{el.goodstypeTitle}}
</i-option>
</i-select>
</span>
<i-button @click="query">查询</i-button> <i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button> <i-button @click="reloadSearch">重置</i-button>
</div> </div>
...@@ -48,8 +62,9 @@ ...@@ -48,8 +62,9 @@
<Form-item label="商品一级分类" prop="goodstypeId"> <Form-item label="商品一级分类" prop="goodstypeId">
<i-select placeholder="请选择" v-model="tbCfGoodstwotype.goodstypeId"> <i-select placeholder="请选择" v-model="tbCfGoodstwotype.goodstypeId">
<i-option <i-option
v-for="(el,i) in Goodstype" :key = 'i' v-for="(el,i) in Goodstype" :key='i'
:value="el.goodstypeId">{{el.goodstypeTitle}}</i-option> :value="el.goodstypeId">{{el.goodstypeTitle}}
</i-option>
</i-select> </i-select>
</Form-item> </Form-item>
...@@ -60,9 +75,13 @@ ...@@ -60,9 +75,13 @@
<Form-item label="商品二级分类标题" prop="goodstwotypeTitle"> <Form-item label="商品二级分类标题" prop="goodstwotypeTitle">
<i-input v-model="tbCfGoodstwotype.goodstwotypeTitle" placeholder="商品二级分类标题"/> <i-input v-model="tbCfGoodstwotype.goodstwotypeTitle" placeholder="商品二级分类标题"/>
</Form-item> </Form-item>
<Form-item label="排序" prop="sort">
<i-input v-model="tbCfGoodstwotype.sort" placeholder="排序"/>
</Form-item>
<Form-item> <Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button> <i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item> </Form-item>
</i-form> </i-form>
......
...@@ -6,7 +6,9 @@ $(function () { ...@@ -6,7 +6,9 @@ $(function () {
{label: '商品一级分类', name: 'goodstypeTitle', index: 'goodstype_title', width: 80}, {label: '商品一级分类', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品二级分类', name: 'goodstwotypeTitle', index: 'goodstwotype_title', width: 80}, {label: '商品二级分类', name: 'goodstwotypeTitle', index: 'goodstwotype_title', width: 80},
{label: '二级分类图片', name: 'goodstwotypeUrl', index: 'goodstwotype_url', width: 80, formatter: imageFormat}, {label: '二级分类图片', name: 'goodstwotypeUrl', index: 'goodstwotype_url', width: 80, formatter: imageFormat},
{label: '商品数量', name: 'count', index: 'count', width: 80}], {label: '商品数量', name: 'count', index: 'count', width: 80},
{label: '排序', name: 'sort', index: 'sort', width: 80}
],
shrinkToFit: true, shrinkToFit: true,
datatype: "json", datatype: "json",
rowNum: 15, rowNum: 15,
...@@ -18,7 +20,9 @@ $(function () { ...@@ -18,7 +20,9 @@ $(function () {
pager: '#speedp', pager: '#speedp',
sortname: 'goodstwotype_id', sortname: 'goodstwotype_id',
viewrecords: true, viewrecords: true,
sortorder: "asc" sortorder: "asc",
}); });
}); });
...@@ -28,14 +32,15 @@ let vm = new Vue({ ...@@ -28,14 +32,15 @@ let vm = new Vue({
showList: true, showList: true,
title: null, title: null,
tbCfGoodstwotype: {}, tbCfGoodstwotype: {},
Goodstype: null, Goodstype: [],
ruleValidate: { ruleValidate: {
name: [ name: [
{required: true, message: '名称不能为空', trigger: 'blur'} {required: true, message: '名称不能为空', trigger: 'blur'}
] ]
}, },
q: { q: {
name: '' name: '',
category: ''
} }
}, },
methods: { methods: {
...@@ -104,7 +109,7 @@ let vm = new Vue({ ...@@ -104,7 +109,7 @@ let vm = new Vue({
vm.showList = true; vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page'); let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', { $("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name}, postData: {'name': vm.q.name, 'category': vm.q.category},
page: page page: page
}).trigger("reloadGrid"); }).trigger("reloadGrid");
vm.handleReset('formValidate'); vm.handleReset('formValidate');
...@@ -138,7 +143,8 @@ let vm = new Vue({ ...@@ -138,7 +143,8 @@ let vm = new Vue({
}, },
reloadSearch: function () { reloadSearch: function () {
vm.q = { vm.q = {
name: '' name: '',
category: ''
}; };
vm.reload(); vm.reload();
}, },
...@@ -158,5 +164,6 @@ let vm = new Vue({ ...@@ -158,5 +164,6 @@ let vm = new Vue({
that.Goodstype = res.list; that.Goodstype = res.list;
// console.log(that.Goodstype); // console.log(that.Goodstype);
}) })
} }
}); });
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论