提交 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,14 +3,15 @@
<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">
......@@ -19,7 +20,10 @@
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
from tb_cf_descripiton
where descripition_id = #{id}
</select>
......@@ -29,23 +33,27 @@
`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
<select id="queryList" resultType="com.platform.entity.TbCfDescripitonEntity">
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
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},'%')
......@@ -61,7 +69,6 @@
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
......@@ -78,22 +85,31 @@
`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>
<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>
......@@ -108,5 +124,4 @@
#{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,22 +36,27 @@
<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="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 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>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</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;
......@@ -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,7 +76,8 @@
</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>
......
......@@ -3,22 +3,13 @@ $(function () {
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: '品名图片', 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}]
});
});
......@@ -28,9 +19,6 @@ let vm = new Vue({
showList: true,
title: null,
tbCfDescripiton: {},
Goodstype2:null,
Goodstype:null,
GoodstypeTwo:null,
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
......@@ -41,23 +29,6 @@ let vm = new Vue({
}
},
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();
},
......@@ -92,7 +63,7 @@ let vm = new Vue({
},
del: function (event) {
let descripitionIds = getSelectedRows("#jqGrid");
if (descripitionIds == null){
if (descripitionIds == null) {
return;
}
......@@ -110,9 +81,9 @@ let vm = new Vue({
});
});
},
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;
......@@ -128,7 +99,7 @@ let vm = new Vue({
}).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);
}
},
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);
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);
}
}
});
}
}
});
\ 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论