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

完成海报管理

上级 a0cc9b73
......@@ -41,12 +41,12 @@ public class TbCfPostersServiceImpl implements TbCfPostersService {
public int save(TbCfPostersEntity tbCfPosters) {
tbCfPosters.setId(IdUtil.createIdbyUUID());
tbCfPosters.setCreateTime(new Date());
tbCfPosters.setUpdateTime(new Date());
return tbCfPostersDao.save(tbCfPosters);
}
@Override
public int update(TbCfPostersEntity tbCfPosters) {
tbCfPosters.setCreateTime(new Date());
tbCfPosters.setUpdateTime(new Date());
return tbCfPostersDao.update(tbCfPosters);
}
......
......@@ -127,7 +127,7 @@
left JOIN tb_cf_express_template e ON i.item_descrition_id = e.template_id
WHERE 1=1 and i.enable_flag!=0
<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 test="code != null and code.trim() != ''">
AND item_code=#{code}
......@@ -138,7 +138,12 @@
<if test="itemCategory != null and itemCategory.trim() != ''">
AND item_category=#{itemCategory}
</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>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
......@@ -150,7 +155,6 @@
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryItemInfoById" resultType="com.platform.entity.ItemDescSkus">
......
......@@ -17,8 +17,8 @@
margin:0 auto;
}
.category-container{
width:800px;
min-height:600px;
padding-bottom: 80px;
}
.edit-container{
position: relative;
......@@ -29,10 +29,14 @@
bottom:0;
right:0;
}
.productList{
padding-bottom: 10px;
}
.productList,.search{
display: flex;
justify-content: space-between;
}.productList-style-start{
justify-content: start;
}
.productList-style-start{
display: flex;
justify-content: start;
}
......@@ -54,6 +58,14 @@
.vradio-wrapper>i{
vertical-align:top;
}
#searchjqGrid{
width:100%;
margin-top:10px;
}
#showItems{
margin-top:20px;
}
</style>
</head>
<body>
......@@ -133,36 +145,31 @@
<!-- </div>-->
<!-- 商品列表页 -->
<div v-else-if='typeActive==1' >
<div class="productList">
<div class="productList-style-start">
<div>
<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-Select>
</div>
<div>
<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-Select>
</div>
<div>
<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-Select>
</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>
<i-Button type="warning" style="float: right;margin-top:30px;width:100px;" @click='resetSelectedCategory'>重置</i-Button>
</div>
<!-- 商品 -->
<div v-else>
<div v-else-if="typeActive==2">
<div class="productList-style-start">
<div>
<span>一级分类</span>
......@@ -177,7 +184,7 @@
</i-Select>
</div>
<div>
<span style="margin-left:20px;">三级分类</span>
<span style="margin-left:20px;" >三级分类</span>
<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-Select>
......@@ -185,19 +192,29 @@
</div>
<div class="search" style="margin-top:20px;">
<div>
<i-Input v-model="search" placeholder="请输入搜索内容" style="width:500px;" />
</div>
<i-Button type="primary" style="width:100px;" @click='handleSearch()'>搜索</i-Button>
<i-Input v-model="search"
placeholder="请输入搜索内容(可选)"
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>
</div>
<section id="showItems">
表格内容。。。
<table id="searchjqGrid"></table>
</section>
</div>
<!-- <div class="btn-container">-->
<!-- <i-Button type="primary" @click='submit()'>确定</i-Button>-->
<!-- <i-Button >取消</i-Button>-->
<!-- </div>-->
<div v-else-if="typeActive==3">
<div>
<span style="margin-left:20px;">商品标签</span>
<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>
</Card>
</div>
......
......@@ -12,9 +12,10 @@ $(function () {
{label: '备注', name: 'remark', index: 'remark', width: 80}
]
});
});
let vm = new Vue({
el: '#rrapp',
data() {
......@@ -35,7 +36,14 @@ let vm = new Vue({
}, {
name: '商品',
isChecked: false
}, {
name: '标签',
isChecked: false
},
{
name:'不跳转',
isChecked: false
}
],
/*
--链接方式
......@@ -88,13 +96,13 @@ let vm = new Vue({
],
categoryListsActive3: null,
// 独立
categoryLists: [
tagLists: [
{
value: '独立',
label: '独立'
}
],
categoryListsActive: null,
tagListsActive: null,
/*
--商品
*/
......@@ -181,6 +189,8 @@ let vm = new Vue({
vm.title = "新增";
vm.tbCfPosters = {};
this.link = null;
this.typeActive = 0;
},
update: function (event) {
let id = getSelectedRow("#jqGrid");
......@@ -194,7 +204,9 @@ let vm = new Vue({
},
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({
url: url,
params: JSON.stringify(vm.tbCfPosters),
......@@ -243,6 +255,43 @@ let vm = new Vue({
async: true,
successCallback: function (r) {
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({
vm.reload();
},
handleSubmit: function (name) {
let redirectUrl = null;
let postersType = this.typeActive; //海报类型
let redirectUrl = null
switch (this.typeActive) {
case 0:
redirectUrl = this.link;
console.log('保存连接方式',redirectUrl);
redirectUrl?vm.saveOrUpdate(redirectUrl):this.$Message.info('请输入链接')
break;
case 1:
!this.subcategoryListsActive?this.$Message.info('请至少选择一级分类'):(()=>{
if(this.subsubCategoryListsActive){
redirectUrl = this.subcategoryListsActive+','+this.subsubCategoryListsActive
}else{
redirectUrl = this.subcategoryListsActive
}
console.log('保存分类子页面',redirectUrl)
})()
this.categoryListsActive1?(()=>{
redirectUrl = `${this.categoryListsActive1},${this.categoryListsActive2},${this.categoryListsActive3}`;
vm.saveOrUpdate(redirectUrl)
})():this.$Message.info('至少选择一种分类')
break;
case 2:
console.log('保存商品列表页')
redirectUrl = getSelectedRows("#searchjqGrid")[0];
if(redirectUrl){
vm.saveOrUpdate(redirectUrl)
}
break;
case 3:
console.log('保存商品')
redirectUrl = this.tagListsActive;
if(redirectUrl){
vm.saveOrUpdate(redirectUrl)
}
break;
default :
vm.saveOrUpdate('')
break;
}
// handleSubmitValidate(this, name, function () {
......@@ -337,109 +391,153 @@ let vm = new Vue({
}
},
/* 搜索 */
handleSearch() {
this.search ? alert('你搜索的内容是' + this.search) : alert('未输入搜索内容~');
},
/* 确定 */
submit() {
if (this.typeActive === 0) {
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name)
} else if (this.typeActive === 1) {
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name)
} else if (this.typeActive === 1) {
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name)
} else {
this.$Message.info('你提交的内容是' + this.items[this.typeActive].name)
}
handleSearch(e) {
1==1 ? (()=>{
$('#showItems').children().remove();
$('#showItems').append(`<table id="searchjqGrid"></table>`);
function beforeSelectRow(){
$("#searchjqGrid").jqGrid('resetSelection');
return(true);
}
let _this = this;
$(function () {
$("#searchjqGrid").Grid({
url: `../tbcfstationitem/list?itemCategory=${_this.commoditycategoryListsActive1||''}&typeTwo=${_this.commoditycategoryListsActive2||''}&typeThree=${_this.commoditycategoryListsActive3||''}&name=${vm.search||e||''}`,
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;
if(this.typeActive===1000){
if (this.typeActive === 1000) {
ID = this.subcategoryListsActive
}else if(this.typeActive===1){
} else if (this.typeActive === 1) {
ID = this.categoryListsActive1
}else{
} else {
ID = this.commoditycategoryListsActive1
}
this.subsubCategoryLists = [];
this.CategoryLists2 = [];
this.commodityCategoryLists2 = [];
$.get('../tbcfstationitem/queryByItemType?typeId='+ID, res => {
$.get('../tbcfstationitem/queryByItemType?typeId=' + ID, res => {
let _res = JSON.parse(res);
_res.code===0?(()=>{
if(this.typeActive===1000){
_res.list.forEach((item)=>{
_res.code === 0 ? (() => {
if (this.typeActive === 1000) {
_res.list.forEach((item) => {
this.subsubCategoryLists.push({
label:item.goodstwotypeTitle,
value:item.goodstwotypeId
label: item.goodstwotypeTitle,
value: item.goodstwotypeId
})
})
}else if(this.typeActive===1){
_res.list.forEach((item)=>{
} else if (this.typeActive === 1) {
_res.list.forEach((item) => {
this.CategoryLists2.push({
label:item.goodstwotypeTitle,
value:item.goodstwotypeId
label: item.goodstwotypeTitle,
value: item.goodstwotypeId
})
})
}else{
_res.list.forEach((item)=>{
} else {
_res.list.forEach((item) => {
this.commodityCategoryLists2.push({
label:item.goodstwotypeTitle,
value:item.goodstwotypeId
label: item.goodstwotypeTitle,
value: item.goodstwotypeId
})
})
}
})():null
callback?callback():null;
})() : null
})
},
//查询三级分类
queryMiniCatagory(status){
queryMiniCatagory(status,callback=null) {
let ID = null
status===2?ID = this.categoryListsActive2:ID = this.commoditycategoryListsActive2
$.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId='+ID, res => {
status === 2 ? ID = this.categoryListsActive2 : ID = this.commoditycategoryListsActive2
$.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId=' + ID, res => {
this.CategoryLists3 = [];
this.commodityCategoryLists3 = [];
let _res = JSON.parse(res);
_res.code===0?(()=>{
_res.descripiton.forEach((item)=>{
_res.code === 0 ? (() => {
_res.descripiton.forEach((item) => {
this.CategoryLists3.push({
label:item.descripitionName,
value:item.descripitionId
label: item.descripitionName,
value: item.descripitionId
})
this.commodityCategoryLists3.push({
label:item.descripitionName,
value:item.descripitionId
label: item.descripitionName,
value: item.descripitionId
})
})
console.log(this.CategoryLists3)
})():null
callback?callback():null;
})() : null
})
}
}
,
created() {
document.onkeydown=(e)=>{
if(this.search&&e.keyCode===13){
this.handleSearch()
}
}
//获取分类子页面一级分类数据
$.get('../tbcfgoodstype/queryAll', res => {
res.code===0?(()=>{
res.code === 0 ? (() => {
this.subCategoryLists = [];
this.commodityCategoryLists1 = [];
this.CategoryLists1= [];
res.list.forEach((item)=>{
this.CategoryLists1 = [];
res.list.forEach((item) => {
this.subCategoryLists.push({
label:item.goodstypeTitle,
value:item.goodstypeId
label: item.goodstypeTitle,
value: item.goodstypeId
});
this.commodityCategoryLists1.push({
label:item.goodstypeTitle,
value:item.goodstypeId
label: item.goodstypeTitle,
value: item.goodstypeId
});
this.CategoryLists1.push({
label:item.goodstypeTitle,
value:item.goodstypeId
label: item.goodstypeTitle,
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() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论