提交 bf8eddfa authored 作者: zgy's avatar zgy

商品独立站管理细节优化

上级 9fb648e5
package com.platform.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -8,7 +9,7 @@ import java.util.Date;
* 表名 tb_cf_descripiton
*
* @author lipengjun
* @date 2019-10-16 11:32:22
* @date 2020-01-10 11:01:40
*/
public class TbCfDescripitonEntity implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -33,6 +34,43 @@ public class TbCfDescripitonEntity implements Serializable {
* 二级分类Id
*/
private String goodstwotypeId;
/**
* 品名图片
*/
private String image;
/**
* 单件邮费
*/
private BigDecimal postage;
/**
* 续件邮费
*/
private BigDecimal morePostage;
/**
* 一级分类名称
*/
private String type;
/**
* 二级分类名称
*/
private String twoType;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTwoType() {
return twoType;
}
public void setTwoType(String twoType) {
this.twoType = twoType;
}
/**
* 设置:品名Id
......@@ -47,6 +85,7 @@ public class TbCfDescripitonEntity implements Serializable {
public String getDescripitionId() {
return descripitionId;
}
/**
* 设置:品名名字
*/
......@@ -60,6 +99,7 @@ public class TbCfDescripitonEntity implements Serializable {
public String getDescripitionName() {
return descripitionName;
}
/**
* 设置:海关编码
*/
......@@ -73,6 +113,7 @@ public class TbCfDescripitonEntity implements Serializable {
public String getDescripitionCode() {
return descripitionCode;
}
/**
* 设置:一级分类Id
*/
......@@ -86,6 +127,7 @@ public class TbCfDescripitonEntity implements Serializable {
public String getGoodstypeId() {
return goodstypeId;
}
/**
* 设置:二级分类Id
*/
......@@ -99,4 +141,46 @@ public class TbCfDescripitonEntity implements Serializable {
public String getGoodstwotypeId() {
return goodstwotypeId;
}
/**
* 设置:品名图片
*/
public void setImage(String image) {
this.image = image;
}
/**
* 获取:品名图片
*/
public String getImage() {
return image;
}
/**
* 设置:单件邮费
*/
public void setPostage(BigDecimal postage) {
this.postage = postage;
}
/**
* 获取:单件邮费
*/
public BigDecimal getPostage() {
return postage;
}
/**
* 设置:续件邮费
*/
public void setMorePostage(BigDecimal morePostage) {
this.morePostage = morePostage;
}
/**
* 获取:续件邮费
*/
public BigDecimal getMorePostage() {
return morePostage;
}
}
......@@ -3,110 +3,125 @@
<mapper namespace="com.platform.dao.TbCfDescripitonDao">
<resultMap type="com.platform.entity.TbCfDescripitonEntityExtends" id="tbCfDescripitonMap">
<resultMap type="com.platform.entity.TbCfDescripitonEntity" id="tbCfDescripitonMap">
<result property="descripitionId" column="descripition_id"/>
<result property="descripitionName" column="descripition_name"/>
<result property="descripitionCode" column="descripition_code"/>
<result property="goodstypeId" column="goodstype_id"/>
<result property="goodstwotypeId" column="goodstwotype_id"/>
<result property="goodtype" column="goodstype_title"/>
<result property="title" column="goodstwotype_title"/>
<result property="image" column="image"/>
<result property="postage" column="postage"/>
<result property="morePostage" column="more_postage"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfDescripitonEntity">
<select id="queryObject" resultType="com.platform.entity.TbCfDescripitonEntity">
select
`descripition_id`,
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
from tb_cf_descripiton
where descripition_id = #{id}
</select>
<select id="queryByItemTypeTwo" resultType="com.platform.entity.TbCfDescripitonEntity">
<select id="queryByItemTypeTwo" resultType="com.platform.entity.TbCfDescripitonEntity">
select
`descripition_id`,
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
from tb_cf_descripiton
where goodstwotype_id = #{id}
</select>
<select id="queryList" resultMap="tbCfDescripitonMap">
SELECT
d.descripition_id,
d.descripition_name,
d.descripition_code,
d.goodstype_id,
d.goodstwotype_id,
t.goodstwotype_title,
o.goodstype_title
FROM
tb_cf_descripiton d
LEFT JOIN tb_cf_goodstwotype t ON t.goodstwotype_id = d.goodstwotype_id
LEFT JOIN tb_cf_goodstype o ON o.goodstype_id = t.goodstype_id
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<select id="queryList" resultType="com.platform.entity.TbCfDescripitonEntity">
select
d.descripition_id,
d.descripition_name,
d.descripition_code,
d.goodstype_id,
d.goodstwotype_id,
d.image,
d.postage,
d.more_postage,
o.goodstype_title type,
t.goodstwotype_title twoType
from tb_cf_descripiton d left join tb_cf_goodstype o on d.goodstype_id=o.goodstype_id left join
tb_cf_goodstwotype t on d.goodstwotype_id=t.goodstwotype_id
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
<otherwise>
order by descripition_id desc
</otherwise>
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_descripiton
WHERE 1=1
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_descripiton
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfDescripitonEntity">
</select>
<insert id="save" parameterType="com.platform.entity.TbCfDescripitonEntity">
insert into tb_cf_descripiton(
`descripition_id`,
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`)
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`)
values(
#{descripitionId},
#{descripitionName},
#{descripitionCode},
#{goodstypeId},
#{goodstwotypeId})
#{goodstwotypeId},
#{image},
#{postage},
#{morePostage})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfDescripitonEntity">
update tb_cf_descripiton
<set>
<if test="descripitionName != null">`descripition_name` = #{descripitionName}, </if>
<if test="descripitionCode != null">`descripition_code` = #{descripitionCode}, </if>
<if test="goodstypeId != null">`goodstype_id` = #{goodstypeId}, </if>
<if test="goodstwotypeId != null">`goodstwotype_id` = #{goodstwotypeId}</if>
</set>
where descripition_id = #{descripitionId}
</update>
<delete id="delete">
<update id="update" parameterType="com.platform.entity.TbCfDescripitonEntity">
update tb_cf_descripiton
<set>
<if test="descripitionName != null">`descripition_name` = #{descripitionName},</if>
<if test="descripitionCode != null">`descripition_code` = #{descripitionCode},</if>
<if test="goodstypeId != null">`goodstype_id` = #{goodstypeId},</if>
<if test="goodstwotypeId != null">`goodstwotype_id` = #{goodstwotypeId},</if>
<if test="image != null">`image` = #{image},</if>
<if test="postage != null">`postage` = #{postage},</if>
<if test="morePostage != null">`more_postage` = #{morePostage}</if>
</set>
where descripition_id = #{descripitionId}
</update>
<delete id="delete">
delete from tb_cf_descripiton where descripition_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_descripiton where descripition_id in
<foreach item="descripitionId" collection="array" open="(" separator="," close=")">
#{descripitionId}
</foreach>
</delete>
<delete id="deleteBatch">
delete from tb_cf_descripiton where descripition_id in
<foreach item="descripitionId" collection="array" open="(" separator="," close=")">
#{descripitionId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<!DOCTYPE html>
<html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
<title></title>
#parse("sys/header.html")
<style>
.ui-jqgrid .ui-jqgrid-bdiv{
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 {
border-top: 2px solid #e7eaec;
line-height: 1.38857;
padding: 13px;
vertical-align: middle;
}
</style>
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
......@@ -38,7 +27,6 @@
#end
</div>
</Row>
<div id="speedp"></div>
<table id="jqGrid"></table>
</div>
......@@ -48,23 +36,28 @@
<Form-item label="品名名字" prop="descripitionName">
<i-input v-model="tbCfDescripiton.descripitionName" placeholder="品名名字"/>
</Form-item>
<Form-item label="海关编码" prop="descripitionCode">
<!-- <Form-item label="海关编码" prop="descripitionCode">
<i-input v-model="tbCfDescripiton.descripitionCode" placeholder="海关编码"/>
</Form-item>-->
<Form-item label="一级分类Id" prop="goodstypeId">
<i-input v-model="tbCfDescripiton.goodstypeId" placeholder="一级分类Id"/>
</Form-item>
<Form-item label="商品一级分类" prop="goodstypeId" >
<i-select placeholder="请选择" v-model="tbCfDescripiton.goodstypeId" @on-change="changeGoodstype">
<i-option
v-for="(el,i) in Goodstype" :key = 'i'
:value="el.goodstypeId">{{el.goodstypeTitle}}</i-option>
</i-select>
<Form-item label="二级分类Id" prop="goodstwotypeId">
<i-input v-model="tbCfDescripiton.goodstwotypeId" placeholder="二级分类Id"/>
</Form-item>
<!--<Form-item label="品名图片" prop="image">
<i-input v-model="tbCfDescripiton.image" placeholder="品名图片"/>
</Form-item>-->
<Form-item label="品名图片" prop="image">
<img v-bind:src="tbCfDescripiton.image" style="width:200px;height:200px;" v-show="!!tbCfDescripiton.image"/>
<input type="file" placeholder="品名图片" @change="tirggerFile($event)"/>
</Form-item>
<Form-item label="单件邮费" prop="postage">
<i-input v-model="tbCfDescripiton.postage" placeholder="单件邮费"/>
</Form-item>
<Form-item label="续件邮费" prop="morePostage">
<i-input v-model="tbCfDescripiton.morePostage" placeholder="续件邮费"/>
</Form-item>
<Form-item label="商品二级分类" prop="goodstwotypeId">
<i-select placeholder="请选择" v-model="tbCfDescripiton.goodstwotypeId">
<i-option
v-for="(el,i) in Goodstype2" :key = 'i'
:value="el.goodstwotypeId">{{el.goodstwotypeTitle}}</i-option>
</i-select>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
......
......@@ -48,12 +48,12 @@
<Form-item label="商品分类标题" prop="goodstypeTitle">
<i-input v-model="tbCfGoodstype.goodstypeTitle" placeholder="商品分类标题"/>
</Form-item>
<Form-item label="商品分类排序编号" prop="goodstypeSort">
<i-input v-model="tbCfGoodstype.goodstypeSort" placeholder="商品分类排序编号"/>
<Form-item label="排序编号" prop="goodstypeSort">
<i-input v-model="tbCfGoodstype.goodstypeSort" placeholder="排序编号"/>
</Form-item>
<Form-item label="商品分类跳转链接" prop="goodstypeUrl">
<!-- <Form-item label="商品分类跳转链接" prop="goodstypeUrl">
<i-input v-model="tbCfGoodstype.goodstypeUrl" placeholder="商品分类跳转链接"/>
</Form-item>
</Form-item>-->
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
......
......@@ -4,9 +4,10 @@
<title>平台管理</title>
#parse("sys/header.html")
<style>
.ui-jqgrid .ui-jqgrid-bdiv{
height:auto!important;
.ui-jqgrid .ui-jqgrid-bdiv {
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 {
border-top: 2px solid #e7eaec;
line-height: 1.38857;
......@@ -17,7 +18,7 @@
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
......@@ -38,12 +39,12 @@
#end
</div>
</Row>
<table id="jqGrid"></table>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfPlatform" :rules="ruleValidate" :label-width="80">
<i-form ref="formValidate" :model="tbCfPlatform" :rules="ruleValidate" :label-width="80">
<Form-item label="平台编号" prop="platformCode">
<i-input v-model="tbCfPlatform.platformCode" placeholder="平台编号"/>
</Form-item>
......@@ -60,7 +61,8 @@
<i-input v-model="tbCfPlatform.platformImg" placeholder="平台图片"/>
</Form-item>-->
<Form-item label="主营商品图片" prop="platformImg">
<img v-bind:src="tbCfPlatform.platformImg" style="width:200px;height:200px;" v-show="!!tbCfPlatform.platformImg"/>
<img v-bind:src="tbCfPlatform.platformImg" style="width:200px;height:200px;"
v-show="!!tbCfPlatform.platformImg"/>
<input type="file" placeholder="主营商品图片" @change="tirggerFile($event)"/>
</Form-item>
<Form-item label="启用状态" prop="enableFlag">
......@@ -74,11 +76,12 @@
</Form-item>-->
<Form-item>
<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>
</Form-item>
</i-form>
</Card>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcfplatform.js?_${date.systemTime}"></script>
......
......@@ -2,133 +2,104 @@ $(function () {
$("#jqGrid").Grid({
url: '../tbcfdescripiton/list',
colModel: [
{label: 'descripitionId', name: 'descripitionId', index: 'descripition_id', key: true, hidden: true},
{label: '商品品名', name: 'descripitionName', index: 'descripition_name', width: 80},
{label: '海关编码', name: 'descripitionCode', index: 'descripition_code', width: 80},
{label: '商品一级分类标题', name: 'goodtype', index: 'goodtype', width: 80},
{label: '商品二级分类标题', name: 'title', index: 'title', width: 80}],
shrinkToFit: true,
datatype : "json",
rowNum:15,
rowList:[15,30,45],
mtype: "POST",
rownumbers: true,
rownumWidth: 40,
gridview: true,
pager: '#speedp',
sortname: 'descripition_id',
viewrecords: true,
sortorder: "desc"
{label: 'descripitionId', name: 'descripitionId', index: 'descripition_id', key: true, hidden: true},
{label: '品名图片', name: 'image', index: 'image', width: 80, formatter: imageFormat},
{label: '品名名字', name: 'descripitionName', index: 'descripition_name', width: 80},
/*{label: '海关编码', name: 'descripitionCode', index: 'descripition_code', width: 80},*/
{label: '商品一级分类', name: 'type', index: 'type', width: 80},
{label: '商品二级分类', name: 'twoType', index: 'twoType', width: 80},
{label: '单件邮费', name: 'postage', index: 'postage', width: 80},
{label: '续件邮费', name: 'morePostage', index: 'more_postage', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfDescripiton: {},
Goodstype2:null,
Goodstype:null,
GoodstypeTwo:null,
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
changeGoodstype(){
let url = `/africa_shop/tbcfdescripiton/queryByItemType?typeId=${this.tbCfDescripiton.goodstypeId}`
console.log('url',url)
let that = this;
Ajax.request({
url: url,
type: "get",
contentType: "application/json",
successCallback: function (r) {
console.log('res',r)
if(r.code===0){
that.Goodstype2 = r.list
console.log(that.Goodstype2)
}
}
});
},
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfDescripiton = {};
},
update: function (event) {
tbCfDescripiton: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfDescripiton = {};
},
update: function (event) {
let descripitionId = getSelectedRow("#jqGrid");
if (descripitionId == null) {
return;
}
vm.showList = false;
if (descripitionId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(descripitionId);
},
saveOrUpdate: function (event) {
},
saveOrUpdate: function (event) {
let url = vm.tbCfDescripiton.descripitionId == null ? "../tbcfdescripiton/save" : "../tbcfdescripiton/update";
Ajax.request({
url: url,
url: url,
params: JSON.stringify(vm.tbCfDescripiton),
type: "POST",
contentType: "application/json",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
});
},
del: function (event) {
let descripitionIds = getSelectedRows("#jqGrid");
if (descripitionIds == null){
return;
}
if (descripitionIds == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfdescripiton/delete",
url: "../tbcfdescripiton/delete",
params: JSON.stringify(descripitionIds),
type: "POST",
contentType: "application/json",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(descripitionId){
}
});
});
},
getInfo: function (descripitionId) {
Ajax.request({
url: "../tbcfdescripiton/info/"+descripitionId,
url: "../tbcfdescripiton/info/" + descripitionId,
async: true,
successCallback: function (r) {
vm.tbCfDescripiton = r.tbCfDescripiton;
}
});
},
reload: function (event) {
vm.showList = true;
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
},
reloadSearch: function () {
vm.q = {
name: ''
};
......@@ -141,20 +112,29 @@ let vm = new Vue({
},
handleReset: function (name) {
handleResetForm(this, name);
},
tirggerFile: function (event) {
var file = event.target.files[0];
var formData = new FormData();
formData.append("file", file);
$.ajax({
url: "../api/upload/image/",
type: "POST",
data: formData,
cache: false, //不设置缓存
processData: false, // 不处理数据
contentType: false,// 不设置内容类型
success: function (result) {
result = JSON.parse(result);
//console.log(result)
if (result.errno == 0) {//成功
vm.tbCfDescripiton.image = result.data;
vm.$forceUpdate();
} else {
iview.Message.error(result.errmsg);
}
}
});
}
},
created() {
var that = this
$.get('../tbcfgoodstype/queryAll', function (res) {
// console.log(that,"this");
that.Goodstype = res.list;
// console.log(that.Goodstype);
});
$.get('../tbcfgoodstwotype/queryAll', function (res) {
// console.log(that,"this");
that.GoodstypeTwo = res.list;
// console.log(res);
});
}
}
});
\ No newline at end of file
......@@ -3,8 +3,8 @@ $(function () {
url: '../tbcfgoodstwotype/list',
colModel: [
{label: '商品二级分类Id', name: 'goodstwotypeId', index: 'goodstwotype_id', key: true, hidden: true},
{label: '商品一级分类标题', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品二级分类标题', name: 'goodstwotypeTitle', index: 'goodstwotype_title', width: 80}],
{label: '商品一级分类', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品二级分类', name: 'goodstwotypeTitle', index: 'goodstwotype_title', width: 80}],
shrinkToFit: true,
datatype : "json",
rowNum:15,
......
......@@ -3,9 +3,9 @@ $(function () {
url: '../tbcfgoodstype/list',
colModel: [
{label: 'goodstypeId', name: 'goodstypeId', index: 'goodstype_id', key: true, hidden: true},
{label: '商品分类标题', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品分类排序编号', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '商品分类跳转链接', name: 'goodstypeUrl', index: 'goodstype_url', width: 80}],
{label: '商品一级分类', name: 'goodstypeTitle', index: 'goodstype_title', width: 80},
{label: '排序编号', name: 'goodstypeSort', index: 'goodstype_sort', width: 80}
/*{label: '商品分类跳转链接', name: 'goodstypeUrl', index: 'goodstype_url', width: 80}*/],
shrinkToFit: true,
datatype : "json",
rowNum:15,
......
......@@ -14,8 +14,8 @@ $(function () {
{label: '点击量', name: 'itemNum', index: 'item_num', width: 45},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{label: '一级分类', name: 'goodtype', index: 'goodtype', width: 80},
{label: '二级分类', name: 'title', index: 'title', width: 80},
{label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 80},
{label: '商品二级分类', name: 'title', index: 'title', width: 80},
{label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 80},
{label: '状态', name: 'enableFlag', index: 'enable_flag', width: 60, formatter: itemStatusFormat},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 80}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论