提交 219ced92 authored 作者: zgy's avatar zgy

完成海报管理

上级 a0cc9b73
...@@ -41,12 +41,12 @@ public class TbCfPostersServiceImpl implements TbCfPostersService { ...@@ -41,12 +41,12 @@ public class TbCfPostersServiceImpl implements TbCfPostersService {
public int save(TbCfPostersEntity tbCfPosters) { public int save(TbCfPostersEntity tbCfPosters) {
tbCfPosters.setId(IdUtil.createIdbyUUID()); tbCfPosters.setId(IdUtil.createIdbyUUID());
tbCfPosters.setCreateTime(new Date()); tbCfPosters.setCreateTime(new Date());
tbCfPosters.setUpdateTime(new Date());
return tbCfPostersDao.save(tbCfPosters); return tbCfPostersDao.save(tbCfPosters);
} }
@Override @Override
public int update(TbCfPostersEntity tbCfPosters) { public int update(TbCfPostersEntity tbCfPosters) {
tbCfPosters.setCreateTime(new Date());
tbCfPosters.setUpdateTime(new Date()); tbCfPosters.setUpdateTime(new Date());
return tbCfPostersDao.update(tbCfPosters); return tbCfPostersDao.update(tbCfPosters);
} }
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
left JOIN tb_cf_express_template e ON i.item_descrition_id = e.template_id left JOIN tb_cf_express_template e ON i.item_descrition_id = e.template_id
WHERE 1=1 and i.enable_flag!=0 WHERE 1=1 and i.enable_flag!=0
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND item_name LIKE concat('%',#{name},'%') AND item_name LIKE concat('%',#{name},'%') or item_id LIKE concat('%',#{name},'%')
</if> </if>
<if test="code != null and code.trim() != ''"> <if test="code != null and code.trim() != ''">
AND item_code=#{code} AND item_code=#{code}
...@@ -138,7 +138,12 @@ ...@@ -138,7 +138,12 @@
<if test="itemCategory != null and itemCategory.trim() != ''"> <if test="itemCategory != null and itemCategory.trim() != ''">
AND item_category=#{itemCategory} AND item_category=#{itemCategory}
</if> </if>
<if test="typeTwo != null and typeTwo.trim() != ''">
AND item_categorytwo=#{typeTwo}
</if>
<if test="typeThree != null and typeThree.trim() != ''">
AND item_descrition_id=#{typeThree}
</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}
...@@ -150,7 +155,6 @@ ...@@ -150,7 +155,6 @@
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
limit #{offset}, #{limit} limit #{offset}, #{limit}
</if> </if>
</select> </select>
<select id="queryItemInfoById" resultType="com.platform.entity.ItemDescSkus"> <select id="queryItemInfoById" resultType="com.platform.entity.ItemDescSkus">
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
margin:0 auto; margin:0 auto;
} }
.category-container{ .category-container{
width:800px;
min-height:600px; min-height:600px;
padding-bottom: 80px;
} }
.edit-container{ .edit-container{
position: relative; position: relative;
...@@ -29,10 +29,14 @@ ...@@ -29,10 +29,14 @@
bottom:0; bottom:0;
right:0; right:0;
} }
.productList{
padding-bottom: 10px;
}
.productList,.search{ .productList,.search{
display: flex; display: flex;
justify-content: space-between; justify-content: start;
}.productList-style-start{ }
.productList-style-start{
display: flex; display: flex;
justify-content: start; justify-content: start;
} }
...@@ -54,6 +58,14 @@ ...@@ -54,6 +58,14 @@
.vradio-wrapper>i{ .vradio-wrapper>i{
vertical-align:top; vertical-align:top;
} }
#searchjqGrid{
width:100%;
margin-top:10px;
}
#showItems{
margin-top:20px;
}
</style> </style>
</head> </head>
<body> <body>
...@@ -133,36 +145,31 @@ ...@@ -133,36 +145,31 @@
<!-- </div>--> <!-- </div>-->
<!-- 商品列表页 --> <!-- 商品列表页 -->
<div v-else-if='typeActive==1' > <div v-else-if='typeActive==1' >
<div class="productList"> <div class="productList-style-start">
<div> <div>
<span>一级分类</span> <span>一级分类</span>
<i-Select v-model="categoryListsActive1" style="width:100px" @on-change="changeSubCateType"> <i-Select v-model.sync="categoryListsActive1" style="width:100px" @on-change="changeSubCateType">
<i-Option v-for="item in CategoryLists1" :value="item.value" :key="item.value">{{ item.label }}</i-Option> <i-Option v-for="item in CategoryLists1" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select> </i-Select>
</div> </div>
<div> <div>
<span style="margin-left:20px;" >二级分类</span> <span style="margin-left:20px;" >二级分类</span>
<i-Select v-model="categoryListsActive2" @on-change="queryMiniCatagory(2)" style="width:100px"> <i-Select v-model.sync="categoryListsActive2" @on-change="queryMiniCatagory(2)" style="width:100px">
<i-Option v-for="item in CategoryLists2" :value="item.value" :key="item.value">{{ item.label }}</i-Option> <i-Option v-for="item in CategoryLists2" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select> </i-Select>
</div> </div>
<div> <div>
<span style="margin-left:20px;">三级分类</span> <span style="margin-left:20px;">三级分类</span>
<i-Select v-model="categoryListsActive3" style="width:100px"> <i-Select v-model.sync="categoryListsActive3" style="width:100px">
<i-Option v-for="item in CategoryLists3" :value="item.value" :key="item.value">{{ item.label }}</i-Option> <i-Option v-for="item in CategoryLists3" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select> </i-Select>
</div> </div>
<div>
<span style="margin-left:20px;">独立分类</span>
<i-Select v-model="categoryListsActive" style="width:100px">
<i-Option v-for="item in categoryLists" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select>
</div>
</div> </div>
<i-Button type="warning" style="float: right;margin-top:30px;width:100px;" @click='resetSelectedCategory'>重置</i-Button> <i-Button type="warning" style="float: right;margin-top:30px;width:100px;" @click='resetSelectedCategory'>重置</i-Button>
</div> </div>
<!-- 商品 --> <!-- 商品 -->
<div v-else> <div v-else-if="typeActive==2">
<div class="productList-style-start"> <div class="productList-style-start">
<div> <div>
<span>一级分类</span> <span>一级分类</span>
...@@ -177,7 +184,7 @@ ...@@ -177,7 +184,7 @@
</i-Select> </i-Select>
</div> </div>
<div> <div>
<span style="margin-left:20px;">三级分类</span> <span style="margin-left:20px;" >三级分类</span>
<i-Select v-model="commoditycategoryListsActive3" style="width:100px"> <i-Select v-model="commoditycategoryListsActive3" style="width:100px">
<i-Option v-for="item in commodityCategoryLists3" :value="item.value" :key="item.value">{{ item.label }}</i-Option> <i-Option v-for="item in commodityCategoryLists3" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select> </i-Select>
...@@ -185,19 +192,29 @@ ...@@ -185,19 +192,29 @@
</div> </div>
<div class="search" style="margin-top:20px;"> <div class="search" style="margin-top:20px;">
<div> <div>
<i-Input v-model="search" placeholder="请输入搜索内容" style="width:500px;" /> <i-Input v-model="search"
</div> placeholder="请输入搜索内容(可选)"
<i-Button type="primary" style="width:100px;" @click='handleSearch()'>搜索</i-Button> style="width:500px;" />
</div>
<i-Button
type="primary"
style="width:100px;"
@click='handleSearch()'
>搜索</i-Button>
<i-Button style="width:100px;" @click="resetSelectedCategory('commodity')">重置</i-Button> <i-Button style="width:100px;" @click="resetSelectedCategory('commodity')">重置</i-Button>
</div> </div>
<section id="showItems"> <section id="showItems">
表格内容。。。 <table id="searchjqGrid"></table>
</section> </section>
</div> </div>
<!-- <div class="btn-container">--> <div v-else-if="typeActive==3">
<!-- <i-Button type="primary" @click='submit()'>确定</i-Button>--> <div>
<!-- <i-Button >取消</i-Button>--> <span style="margin-left:20px;">商品标签</span>
<!-- </div>--> <i-Select v-model="tagListsActive" style="width:100px">
<i-Option v-for="item in tagLists" :value="item.value" :key="item.value">{{ item.label }}</i-Option>
</i-Select>
</div>
</div>
</section> </section>
</Card> </Card>
</div> </div>
......
...@@ -12,9 +12,10 @@ $(function () { ...@@ -12,9 +12,10 @@ $(function () {
{label: '备注', name: 'remark', index: 'remark', width: 80} {label: '备注', name: 'remark', index: 'remark', width: 80}
] ]
}); });
}); });
let vm = new Vue({ let vm = new Vue({
el: '#rrapp', el: '#rrapp',
data() { data() {
...@@ -35,7 +36,14 @@ let vm = new Vue({ ...@@ -35,7 +36,14 @@ let vm = new Vue({
}, { }, {
name: '商品', name: '商品',
isChecked: false isChecked: false
}, {
name: '标签',
isChecked: false
}, },
{
name:'不跳转',
isChecked: false
}
], ],
/* /*
--链接方式 --链接方式
...@@ -88,13 +96,13 @@ let vm = new Vue({ ...@@ -88,13 +96,13 @@ let vm = new Vue({
], ],
categoryListsActive3: null, categoryListsActive3: null,
// 独立 // 独立
categoryLists: [ tagLists: [
{ {
value: '独立', value: '独立',
label: '独立' label: '独立'
} }
], ],
categoryListsActive: null, tagListsActive: null,
/* /*
--商品 --商品
*/ */
...@@ -181,6 +189,8 @@ let vm = new Vue({ ...@@ -181,6 +189,8 @@ let vm = new Vue({
vm.title = "新增"; vm.title = "新增";
vm.tbCfPosters = {}; vm.tbCfPosters = {};
this.link = null;
this.typeActive = 0;
}, },
update: function (event) { update: function (event) {
let id = getSelectedRow("#jqGrid"); let id = getSelectedRow("#jqGrid");
...@@ -194,7 +204,9 @@ let vm = new Vue({ ...@@ -194,7 +204,9 @@ let vm = new Vue({
}, },
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
let url = vm.tbCfPosters.id == null ? "../tbcfposters/save" : "../tbcfposters/update"; let url = vm.tbCfPosters.id == null ? "../tbcfposters/save": "../tbcfposters/update";
vm.tbCfPosters.redirectUrl=event;
vm.tbCfPosters.postersType=this.typeActive;
Ajax.request({ Ajax.request({
url: url, url: url,
params: JSON.stringify(vm.tbCfPosters), params: JSON.stringify(vm.tbCfPosters),
...@@ -243,6 +255,43 @@ let vm = new Vue({ ...@@ -243,6 +255,43 @@ let vm = new Vue({
async: true, async: true,
successCallback: function (r) { successCallback: function (r) {
vm.tbCfPosters = r.tbCfPosters; vm.tbCfPosters = r.tbCfPosters;
//数据回显
vm.typeActive = vm.tbCfPosters.postersType;
vm.vHandleChange(null,vm.typeActive)
if(vm.typeActive===0){
vm.link=vm.tbCfPosters.redirectUrl;
}else if(vm.typeActive===1){
let ARR_ids = vm.tbCfPosters.redirectUrl.split(',');
vm.CategoryLists1.forEach(item=>{
if(item.value===ARR_ids[0]) {
vm.categoryListsActive1 = item.value
}
})
if(ARR_ids[1]!='null'){
vm.changeSubCateType(()=>{
vm.CategoryLists2.forEach(item=>{
if(item.value===ARR_ids[1]){
vm.categoryListsActive2 = item.value
}
})
});
}
if(ARR_ids[2]!='null'){
vm.queryMiniCatagory(2,()=>{
vm.CategoryLists3.forEach(item=>{
if(item.value===ARR_ids[2]){
vm.categoryListsActive3 = item.value
}
})
});
}
}else if(vm.typeActive===2){
setTimeout(()=>{
vm.handleSearch(vm.tbCfPosters.redirectUrl);
},500)
}else if(vm.typeActive===3){
vm.tagListsActive = vm.tbCfPosters.redirectUrl;
}
} }
}); });
...@@ -263,28 +312,33 @@ let vm = new Vue({ ...@@ -263,28 +312,33 @@ let vm = new Vue({
vm.reload(); vm.reload();
}, },
handleSubmit: function (name) { handleSubmit: function (name) {
let redirectUrl = null;
let postersType = this.typeActive; //海报类型 let postersType = this.typeActive; //海报类型
let redirectUrl = null
switch (this.typeActive) { switch (this.typeActive) {
case 0: case 0:
redirectUrl = this.link; redirectUrl = this.link;
console.log('保存连接方式',redirectUrl); redirectUrl?vm.saveOrUpdate(redirectUrl):this.$Message.info('请输入链接')
break; break;
case 1: case 1:
!this.subcategoryListsActive?this.$Message.info('请至少选择一级分类'):(()=>{ this.categoryListsActive1?(()=>{
if(this.subsubCategoryListsActive){ redirectUrl = `${this.categoryListsActive1},${this.categoryListsActive2},${this.categoryListsActive3}`;
redirectUrl = this.subcategoryListsActive+','+this.subsubCategoryListsActive vm.saveOrUpdate(redirectUrl)
}else{ })():this.$Message.info('至少选择一种分类')
redirectUrl = this.subcategoryListsActive
}
console.log('保存分类子页面',redirectUrl)
})()
break; break;
case 2: case 2:
console.log('保存商品列表页') redirectUrl = getSelectedRows("#searchjqGrid")[0];
if(redirectUrl){
vm.saveOrUpdate(redirectUrl)
}
break; break;
case 3: case 3:
console.log('保存商品') redirectUrl = this.tagListsActive;
if(redirectUrl){
vm.saveOrUpdate(redirectUrl)
}
break;
default :
vm.saveOrUpdate('')
break; break;
} }
// handleSubmitValidate(this, name, function () { // handleSubmitValidate(this, name, function () {
...@@ -337,109 +391,153 @@ let vm = new Vue({ ...@@ -337,109 +391,153 @@ let vm = new Vue({
} }
}, },
/* 搜索 */ /* 搜索 */
handleSearch() { handleSearch(e) {
this.search ? alert('你搜索的内容是' + this.search) : alert('未输入搜索内容~'); 1==1 ? (()=>{
}, $('#showItems').children().remove();
/* 确定 */ $('#showItems').append(`<table id="searchjqGrid"></table>`);
submit() { function beforeSelectRow(){
if (this.typeActive === 0) { $("#searchjqGrid").jqGrid('resetSelection');
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name) return(true);
} else if (this.typeActive === 1) { }
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name) let _this = this;
} else if (this.typeActive === 1) { $(function () {
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name) $("#searchjqGrid").Grid({
} else { url: `../tbcfstationitem/list?itemCategory=${_this.commoditycategoryListsActive1||''}&typeTwo=${_this.commoditycategoryListsActive2||''}&typeThree=${_this.commoditycategoryListsActive3||''}&name=${vm.search||e||''}`,
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name) colModel: [
} {label: 'itemId', name: 'itemId', index: 'item_id', key: true, hidden: true},
{label: '商品图片', name: 'itemImg', index: 'item_img', width: 50, formatter: imageFormat},
{label: '商品编号', name: 'itemCode', index: 'item_code', width: 160},
{label: '商品名称', name: 'itemName', index: 'item_name', width: 160},
/* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/
/*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
{label: '商品原价', name: 'itemPrice', index: 'item_price', width: 65},
{label: '商品现价', name: 'discountPrice', index: 'discount_price', width: 55},
{label: '库存', name: 'itemCount', index: 'item_count', width: 55},
{label: '点击量', name: 'itemNum', index: 'item_num', width: 55},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{label: '供应商', name: 'supplier', index: 'supplier', width: 80},
{label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 80},
{label: '商品二级分类', name: 'title', index: 'title', width: 80},
{label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 120},
{label: '状态', name: 'enableFlag', index: 'enable_flag', width: 120, formatter: itemStatusFormat},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 160}
],
multiselect: true,
multiboxonly:true,
beforeSelectRow: beforeSelectRow,
});
});
})() : alert('未输入搜索内容~');
}, },
//获取分类子页面二级分类数据 //获取分类子页面二级分类数据
changeSubCateType(){ changeSubCateType(callback=null) {
let ID = null; let ID = null;
if(this.typeActive===1000){ if (this.typeActive === 1000) {
ID = this.subcategoryListsActive ID = this.subcategoryListsActive
}else if(this.typeActive===1){ } else if (this.typeActive === 1) {
ID = this.categoryListsActive1 ID = this.categoryListsActive1
}else{ } else {
ID = this.commoditycategoryListsActive1 ID = this.commoditycategoryListsActive1
} }
this.subsubCategoryLists = []; this.subsubCategoryLists = [];
this.CategoryLists2 = []; this.CategoryLists2 = [];
this.commodityCategoryLists2 = []; this.commodityCategoryLists2 = [];
$.get('../tbcfstationitem/queryByItemType?typeId='+ID, res => { $.get('../tbcfstationitem/queryByItemType?typeId=' + ID, res => {
let _res = JSON.parse(res); let _res = JSON.parse(res);
_res.code===0?(()=>{ _res.code === 0 ? (() => {
if(this.typeActive===1000){ if (this.typeActive === 1000) {
_res.list.forEach((item)=>{ _res.list.forEach((item) => {
this.subsubCategoryLists.push({ this.subsubCategoryLists.push({
label:item.goodstwotypeTitle, label: item.goodstwotypeTitle,
value:item.goodstwotypeId value: item.goodstwotypeId
}) })
}) })
}else if(this.typeActive===1){ } else if (this.typeActive === 1) {
_res.list.forEach((item)=>{ _res.list.forEach((item) => {
this.CategoryLists2.push({ this.CategoryLists2.push({
label:item.goodstwotypeTitle, label: item.goodstwotypeTitle,
value:item.goodstwotypeId value: item.goodstwotypeId
}) })
}) })
}else{ } else {
_res.list.forEach((item)=>{ _res.list.forEach((item) => {
this.commodityCategoryLists2.push({ this.commodityCategoryLists2.push({
label:item.goodstwotypeTitle, label: item.goodstwotypeTitle,
value:item.goodstwotypeId value: item.goodstwotypeId
}) })
}) })
} }
})():null callback?callback():null;
})() : null
}) })
}, },
//查询三级分类 //查询三级分类
queryMiniCatagory(status){ queryMiniCatagory(status,callback=null) {
let ID = null let ID = null
status===2?ID = this.categoryListsActive2:ID = this.commoditycategoryListsActive2 status === 2 ? ID = this.categoryListsActive2 : ID = this.commoditycategoryListsActive2
$.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId='+ID, res => { $.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId=' + ID, res => {
this.CategoryLists3 = []; this.CategoryLists3 = [];
this.commodityCategoryLists3 = []; this.commodityCategoryLists3 = [];
let _res = JSON.parse(res); let _res = JSON.parse(res);
_res.code===0?(()=>{ _res.code === 0 ? (() => {
_res.descripiton.forEach((item)=>{ _res.descripiton.forEach((item) => {
this.CategoryLists3.push({ this.CategoryLists3.push({
label:item.descripitionName, label: item.descripitionName,
value:item.descripitionId value: item.descripitionId
}) })
this.commodityCategoryLists3.push({ this.commodityCategoryLists3.push({
label:item.descripitionName, label: item.descripitionName,
value:item.descripitionId value: item.descripitionId
}) })
}) })
console.log(this.CategoryLists3) callback?callback():null;
})():null })() : null
}) })
} }
} }
, ,
created() { created() {
document.onkeydown=(e)=>{
if(this.search&&e.keyCode===13){
this.handleSearch()
}
}
//获取分类子页面一级分类数据 //获取分类子页面一级分类数据
$.get('../tbcfgoodstype/queryAll', res => { $.get('../tbcfgoodstype/queryAll', res => {
res.code===0?(()=>{ res.code === 0 ? (() => {
this.subCategoryLists = []; this.subCategoryLists = [];
this.commodityCategoryLists1 = []; this.commodityCategoryLists1 = [];
this.CategoryLists1= []; this.CategoryLists1 = [];
res.list.forEach((item)=>{ res.list.forEach((item) => {
this.subCategoryLists.push({ this.subCategoryLists.push({
label:item.goodstypeTitle, label: item.goodstypeTitle,
value:item.goodstypeId value: item.goodstypeId
}); });
this.commodityCategoryLists1.push({ this.commodityCategoryLists1.push({
label:item.goodstypeTitle, label: item.goodstypeTitle,
value:item.goodstypeId value: item.goodstypeId
}); });
this.CategoryLists1.push({ this.CategoryLists1.push({
label:item.goodstypeTitle, label: item.goodstypeTitle,
value:item.goodstypeId value: item.goodstypeId
})
})
})() : null
}) })
//获取标签
$.get('../tbcflabel/queryAll?timestamp=' + new Date().getTime(), res => {
this.tagLists=[];
let OBJ_res = JSON.parse(res);
OBJ_res.list.forEach((item) => {
console.log('labelName',item.labelName)
this.tagLists.push({
label: item.labelName,
value: item.id
});
}) })
})():null
}) })
}, },
mounted() { mounted() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论