提交 9481b5d9 authored 作者: 梁业锦's avatar 梁业锦 💬

Merge remote-tracking branch 'origin/master'

package com.platform.controller;
import com.platform.entity.TbCfLabelEntity;
import com.platform.service.TbCfLabelService;
import com.platform.utils.PageUtils;
import com.platform.utils.Query;
import com.platform.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
/**
* 商品标签Controller
*
* @author lipengjun
* @date 2020-03-12 16:20:26
*/
@Controller
@RequestMapping("tbcflabel")
public class TbCfLabelController {
@Autowired
private TbCfLabelService tbCfLabelService;
/**
* 查看列表
*/
@RequestMapping("/list")
@RequiresPermissions("tbcflabel:list")
@ResponseBody
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<TbCfLabelEntity> tbCfLabelList = tbCfLabelService.queryList(query);
int total = tbCfLabelService.queryTotal(query);
PageUtils pageUtil = new PageUtils(tbCfLabelList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 查看信息
*/
@RequestMapping("/info/{id}")
@RequiresPermissions("tbcflabel:info")
@ResponseBody
public R info(@PathVariable("id") String id) {
TbCfLabelEntity tbCfLabel = tbCfLabelService.queryObject(id);
return R.ok().put("tbCfLabel", tbCfLabel);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("tbcflabel:save")
@ResponseBody
public R save(@RequestBody TbCfLabelEntity tbCfLabel) {
tbCfLabelService.save(tbCfLabel);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("tbcflabel:update")
@ResponseBody
public R update(@RequestBody TbCfLabelEntity tbCfLabel) {
tbCfLabelService.update(tbCfLabel);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("tbcflabel:delete")
@ResponseBody
public R delete(@RequestBody String[] ids) {
tbCfLabelService.deleteBatch(ids);
return R.ok();
}
/**
* 查看所有列表
*/
@RequestMapping("/queryAll")
@ResponseBody
public R queryAll(@RequestParam Map<String, Object> params) {
List<TbCfLabelEntity> list = tbCfLabelService.queryList(params);
return R.ok().put("list", list);
}
/**
* 查询父标签的子类
*
* @return list
*/
@RequestMapping("/queryParentLabels")
@ResponseBody
public R queryParentLabels(@RequestParam(value = "parentId",defaultValue = "0") String parentId) {
List<TbCfLabelEntity> labelList = tbCfLabelService.queryParentLabels(parentId);
return R.ok().put("list", labelList);
}
}
package com.platform.dao;
import com.platform.entity.TbCfLabelEntity;
import java.util.List;
/**
* 商品标签Dao
*
* @author lipengjun
* @date 2020-03-12 16:20:26
*/
public interface TbCfLabelDao extends BaseDao<TbCfLabelEntity> {
/**
* 查询所有父标签
*
* @return list
*/
List<TbCfLabelEntity> queryParentLabels(String parentId);
}
package com.platform.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 商品标签实体
* 表名 tb_cf_label
*
* @author lipengjun
* @date 2020-03-17 10:38:00
*/
public class TbCfLabelEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 标签ID
*/
private String id;
/**
* 父标签ID,如果没有父标签,则为:0
*/
private String parentId;
/**
* 标签名
*/
private String labelName;
/**
* 是否启用 0:不启用 1:启用
*/
private Integer enableFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 设置:标签ID
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取:标签ID
*/
public String getId() {
return id;
}
/**
* 设置:父标签ID,如果没有父标签,则为:0
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* 获取:父标签ID,如果没有父标签,则为:0
*/
public String getParentId() {
return parentId;
}
/**
* 设置:标签名
*/
public void setLabelName(String labelName) {
this.labelName = labelName;
}
/**
* 获取:标签名
*/
public String getLabelName() {
return labelName;
}
/**
* 设置:是否启用 0:不启用 1:启用
*/
public void setEnableFlag(Integer enableFlag) {
this.enableFlag = enableFlag;
}
/**
* 获取:是否启用 0:不启用 1:启用
*/
public Integer getEnableFlag() {
return enableFlag;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:更新时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取:更新时间
*/
public Date getUpdateTime() {
return updateTime;
}
}
...@@ -51,9 +51,13 @@ public class TbCfStationItemEntity implements Serializable { ...@@ -51,9 +51,13 @@ public class TbCfStationItemEntity implements Serializable {
*/ */
private String itemImg; private String itemImg;
/** /**
* 商品标签 * 搜索关键字
*/ */
private String itemTags; private String itemTags;
/**
* 商品标签
*/
private String itemLabel;
/** /**
* 浏览人数 * 浏览人数
*/ */
...@@ -389,4 +393,12 @@ public class TbCfStationItemEntity implements Serializable { ...@@ -389,4 +393,12 @@ public class TbCfStationItemEntity implements Serializable {
public String getItemDescritionId() { public String getItemDescritionId() {
return itemDescritionId; return itemDescritionId;
} }
public String getItemLabel() {
return itemLabel;
}
public void setItemLabel(String itemLabel) {
this.itemLabel = itemLabel;
}
} }
package com.platform.service;
import com.platform.entity.TbCfLabelEntity;
import java.util.List;
import java.util.Map;
/**
* 商品标签Service接口
*
* @author lipengjun
* @date 2020-03-12 16:20:26
*/
public interface TbCfLabelService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfLabelEntity queryObject(String id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfLabelEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfLabel 实体
* @return 保存条数
*/
int save(TbCfLabelEntity tbCfLabel);
/**
* 根据主键更新实体
*
* @param tbCfLabel 实体
* @return 更新条数
*/
int update(TbCfLabelEntity tbCfLabel);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(String id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(String[] ids);
/**
* 查询父标签的子类
*
* @return list
*/
List<TbCfLabelEntity> queryParentLabels(String parentId);
}
package com.platform.service.impl;
import com.platform.dao.TbCfLabelDao;
import com.platform.entity.TbCfLabelEntity;
import com.platform.service.TbCfLabelService;
import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 商品标签Service实现类
*
* @author lipengjun
* @date 2020-03-12 16:20:26
*/
@Service("tbCfLabelService")
public class TbCfLabelServiceImpl implements TbCfLabelService {
@Autowired
private TbCfLabelDao tbCfLabelDao;
@Override
public TbCfLabelEntity queryObject(String id) {
return tbCfLabelDao.queryObject(id);
}
@Override
public List<TbCfLabelEntity> queryList(Map<String, Object> map) {
return tbCfLabelDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfLabelDao.queryTotal(map);
}
@Override
public int save(TbCfLabelEntity tbCfLabel) {
tbCfLabel.setId(IdUtil.createIdbyUUID());
tbCfLabel.setCreateTime(new Date());
tbCfLabel.setUpdateTime(new Date());
return tbCfLabelDao.save(tbCfLabel);
}
@Override
public int update(TbCfLabelEntity tbCfLabel) {
tbCfLabel.setUpdateTime(new Date());
return tbCfLabelDao.update(tbCfLabel);
}
@Override
public int delete(String id) {
return tbCfLabelDao.delete(id);
}
@Override
public int deleteBatch(String[] ids) {
return tbCfLabelDao.deleteBatch(ids);
}
/**
* 查询父标签的子类
*
* @return list
*/
@Override
public List<TbCfLabelEntity> queryParentLabels(String parentId) {
return tbCfLabelDao.queryParentLabels(parentId);
}
}
...@@ -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);
} }
......
...@@ -118,6 +118,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -118,6 +118,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
tbCfStationItem.setItemCategorytwo(itemSkus.getItemCategorytwo()); tbCfStationItem.setItemCategorytwo(itemSkus.getItemCategorytwo());
tbCfStationItem.setItemCount(count); tbCfStationItem.setItemCount(count);
tbCfStationItem.setItemTags(itemSkus.getItemTags()); tbCfStationItem.setItemTags(itemSkus.getItemTags());
tbCfStationItem.setItemLabel(itemSkus.getItemLabel());
tbCfStationItem.setItemDescritionId(itemSkus.getItemDescritionId()); tbCfStationItem.setItemDescritionId(itemSkus.getItemDescritionId());
tbCfStationItem.setItemTop("N"); tbCfStationItem.setItemTop("N");
tbCfStationItem.setItemImg(itemSkus.getItemImg()); tbCfStationItem.setItemImg(itemSkus.getItemImg());
...@@ -240,6 +241,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -240,6 +241,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
tbCfStationItem.setItemCategorytwo(itemSkus.getItemCategorytwo()); tbCfStationItem.setItemCategorytwo(itemSkus.getItemCategorytwo());
tbCfStationItem.setItemCount(count); tbCfStationItem.setItemCount(count);
tbCfStationItem.setItemTags(itemSkus.getItemTags()); tbCfStationItem.setItemTags(itemSkus.getItemTags());
tbCfStationItem.setItemLabel(itemSkus.getItemLabel());
tbCfStationItem.setItemDescritionId(itemSkus.getItemDescritionId()); tbCfStationItem.setItemDescritionId(itemSkus.getItemDescritionId());
tbCfStationItem.setItemImg(itemSkus.getItemImg()); tbCfStationItem.setItemImg(itemSkus.getItemImg());
if (itemSkus.isPutaway()) { if (itemSkus.isPutaway()) {
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.TbCfLabelDao">
<resultMap type="com.platform.entity.TbCfLabelEntity" id="tbCfLabelMap">
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="labelName" column="label_name"/>
<result property="enableFlag" column="enable_flag"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfLabelEntity">
select
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`
from tb_cf_label
where id = #{id}
</select>
<select id="queryList" resultType="com.platform.entity.TbCfLabelEntity">
select
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`
from tb_cf_label
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>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryParentLabels" resultType="com.platform.entity.TbCfLabelEntity">
select
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`
from tb_cf_label
WHERE parent_id=#{parentId}
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_label
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfLabelEntity">
insert into tb_cf_label(
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{parentId},
#{labelName},
#{enableFlag},
#{createTime},
#{updateTime})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfLabelEntity">
update tb_cf_label
<set>
<if test="parentId != null">`parent_id` = #{parentId},</if>
<if test="labelName != null">`label_name` = #{labelName},</if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_label where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_label where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result property="itemUrl" column="item_url"/> <result property="itemUrl" column="item_url"/>
<result property="itemImg" column="item_img"/> <result property="itemImg" column="item_img"/>
<result property="itemTags" column="item_tags"/> <result property="itemTags" column="item_tags"/>
<result property="itemLabel" column="item_label"/>
<result property="itemNum" column="item_num"/> <result property="itemNum" column="item_num"/>
<result property="itemCount" column="item_count"/> <result property="itemCount" column="item_count"/>
<result property="itemSku" column="item_sku"/> <result property="itemSku" column="item_sku"/>
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
`item_url`, `item_url`,
`item_img`, `item_img`,
`item_tags`, `item_tags`,
`item_label`,
`item_num`, `item_num`,
`item_count`, `item_count`,
`item_sku`, `item_sku`,
...@@ -66,6 +68,7 @@ ...@@ -66,6 +68,7 @@
`item_url`, `item_url`,
`item_img`, `item_img`,
`item_tags`, `item_tags`,
`item_label`,
`item_num`, `item_num`,
`item_count`, `item_count`,
`item_sku`, `item_sku`,
...@@ -127,7 +130,7 @@ ...@@ -127,7 +130,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 +141,12 @@ ...@@ -138,7 +141,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 +158,6 @@ ...@@ -150,7 +158,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">
...@@ -170,7 +177,7 @@ ...@@ -170,7 +177,7 @@
select count(*) from tb_cf_station_item select count(*) from tb_cf_station_item
WHERE 1=1 and enable_flag!=0 WHERE 1=1 and 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}
...@@ -181,6 +188,12 @@ ...@@ -181,6 +188,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>
</select> </select>
<insert id="save" parameterType="com.platform.entity.TbCfStationItemEntity"> <insert id="save" parameterType="com.platform.entity.TbCfStationItemEntity">
...@@ -195,6 +208,7 @@ ...@@ -195,6 +208,7 @@
`item_url`, `item_url`,
`item_img`, `item_img`,
`item_tags`, `item_tags`,
`item_label`,
`item_num`, `item_num`,
`item_count`, `item_count`,
`item_sku`, `item_sku`,
...@@ -215,6 +229,7 @@ ...@@ -215,6 +229,7 @@
#{itemUrl}, #{itemUrl},
#{itemImg}, #{itemImg},
#{itemTags}, #{itemTags},
#{itemLabel},
#{itemNum}, #{itemNum},
#{itemCount}, #{itemCount},
#{itemSku}, #{itemSku},
...@@ -238,6 +253,7 @@ ...@@ -238,6 +253,7 @@
<if test="itemUrl != null">`item_url` = #{itemUrl},</if> <if test="itemUrl != null">`item_url` = #{itemUrl},</if>
<if test="itemImg != null">`item_img` = #{itemImg},</if> <if test="itemImg != null">`item_img` = #{itemImg},</if>
<if test="itemTags != null">`item_tags` = #{itemTags},</if> <if test="itemTags != null">`item_tags` = #{itemTags},</if>
`item_label` = #{itemLabel},
<if test="itemNum != null">`item_num` = #{itemNum},</if> <if test="itemNum != null">`item_num` = #{itemNum},</if>
<if test="itemCollectionNum != null">`item_collection_num` = #{itemCollectionNum},</if> <if test="itemCollectionNum != null">`item_collection_num` = #{itemCollectionNum},</if>
<if test="itemCount != null">`item_count` = #{itemCount},</if> <if test="itemCount != null">`item_count` = #{itemCount},</if>
......
<!DOCTYPE html>
<html>
<head>
<title>商品标签</title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
<i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
</i-col>
<i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
<div class="buttons-group">
#if($shiro.hasPermission("tbcflabel:save"))
<i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
#end
#if($shiro.hasPermission("tbcflabel:update"))
<i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
#end
#if($shiro.hasPermission("tbcflabel:delete"))
<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
#end
</div>
</Row>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfLabel" :rules="ruleValidate" :label-width="80">
<!-- <Form-item label="标签组名" prop="parentId">
<i-input v-model="tbCfLabel.parentId" placeholder="父标签ID,如果没有父标签,则为:0"/>
</Form-item>-->
<Form-item label="标签组名" prop="parentId">
<i-select placeholder="请选择" v-model="tbCfLabel.parentId">
<i-option v-for="(el,i) in labelList" :key='el.id'
:value="el.id">{{el.labelName}}
</i-option>
</i-select>
</Form-item>
<Form-item label="标签名" prop="labelName">
<i-input v-model="tbCfLabel.labelName" placeholder="标签名"/>
</Form-item>
<Form-item label="是否启用" prop="enableFlag">
<i-input v-model="tbCfLabel.enableFlag" placeholder="是否启用 0:不启用 1:启用"/>
</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="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcflabel.js?_${date.systemTime}"></script>
</body>
</html>
\ No newline at end of file
...@@ -255,8 +255,11 @@ ...@@ -255,8 +255,11 @@
<!-- <Form-item label="商品链接" prop="itemUrl"> <!-- <Form-item label="商品链接" prop="itemUrl">
<i-input v-model="tbCfStationItem.itemUrl" placeholder="商品链接"/> <i-input v-model="tbCfStationItem.itemUrl" placeholder="商品链接"/>
</Form-item>--> </Form-item>-->
<Form-item label="商品标签" prop="itemTags" style="width: 800px"> <Form-item label="搜索关键字" prop="itemTags" style="width: 800px">
<i-input v-model="tbCfStationItem.itemTags" placeholder="商品标签"/> <i-input v-model="tbCfStationItem.itemTags" placeholder="搜索关键字"/>
</Form-item>
<Form-item label="商品标签" prop="itemLabel" style="width: 800px">
<i-input v-model="tbCfStationItem.itemLabel" placeholder="商品标签"/>
</Form-item> </Form-item>
<Form-item label="原价" prop="itemPrice" style="width: 800px"> <Form-item label="原价" prop="itemPrice" style="width: 800px">
<i-input v-model="tbCfStationItem.itemPrice" placeholder="原价(可不填)"/> <i-input v-model="tbCfStationItem.itemPrice" placeholder="原价(可不填)"/>
......
...@@ -153,7 +153,6 @@ let vm = new Vue({ ...@@ -153,7 +153,6 @@ let vm = new Vue({
created() { created() {
var that = this var that = this
$.get('../tbcfgoodstype/queryAll', function (res) { $.get('../tbcfgoodstype/queryAll', function (res) {
debugger
// console.log(that,"this"); // console.log(that,"this");
that.Goodstype = res.list; that.Goodstype = res.list;
// console.log(that.Goodstype); // console.log(that.Goodstype);
......
...@@ -5,7 +5,7 @@ $(function () { ...@@ -5,7 +5,7 @@ $(function () {
{label: 'ID', name: 'goodstypeId', index: 'goodstype_id', key: true,hidden: true}, {label: 'ID', 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: 'goodstypeSort', index: 'goodstype_sort', width: 80}, {label: '排序编号', name: 'goodstypeSort', index: 'goodstype_sort', width: 80},
{label: '一级分类图片', name: 'goodstwotypeUrl', index: 'goodstype_url', width: 80, formatter: imageFormat}], {label: '一级分类图片', name: 'goodstypeUrl', index: 'goodstype_url', width: 80, formatter: imageFormat}],
shrinkToFit: true, shrinkToFit: true,
datatype : "json", datatype : "json",
rowNum:15, rowNum:15,
......
$(function () {
$("#jqGrid").Grid({
url: '../tbcflabel/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
/*{label: '标签组名', name: 'parentId', index: 'parent_id', width: 80},*/
{label: '标签名', name: 'labelName', index: 'label_name', width: 80},
{label: '是否启用', name: 'enableFlag', index: 'enable_flag', width: 80,formatter: validFormat},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
labelList:null,
showList: true,
title: null,
tbCfLabel: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfLabel = {};
},
update: function (event) {
let id = getSelectedRow("#jqGrid");
if (id == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(id);
},
saveOrUpdate: function (event) {
let url = vm.tbCfLabel.id == null ? "../tbcflabel/save" : "../tbcflabel/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfLabel),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let ids = getSelectedRows("#jqGrid");
if (ids == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcflabel/delete",
params: JSON.stringify(ids),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(id){
Ajax.request({
url: "../tbcflabel/info/"+id,
async: true,
successCallback: function (r) {
vm.tbCfLabel = r.tbCfLabel;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
},
created(){
$.get('../tbcflabel/queryParentLabels', res => {
this.labelList = JSON.parse(res).list;
this.labelList.unshift({
id: "0",
labelName: "标签组",
})
})
}
});
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论