提交 f54d3733 authored 作者: 吴德鹏's avatar 吴德鹏

条目管理

上级 3f9cf84b
...@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -42,7 +43,7 @@ public class TermController { ...@@ -42,7 +43,7 @@ public class TermController {
//查询列表数据 //查询列表数据
Query query = new Query(params); Query query = new Query(params);
List<TermVo> termList = termService.queryList(query); List<TermEntity> termList = termService.queryList(query);
int total = termService.queryTotal(query); int total = termService.queryTotal(query);
PageUtils pageUtil = new PageUtils(termList, total, query.getLimit(), query.getPage()); PageUtils pageUtil = new PageUtils(termList, total, query.getLimit(), query.getPage());
...@@ -72,7 +73,7 @@ public class TermController { ...@@ -72,7 +73,7 @@ public class TermController {
@RequestMapping("/info/{id}") @RequestMapping("/info/{id}")
@RequiresPermissions("term:info") @RequiresPermissions("term:info")
@ResponseBody @ResponseBody
public R info(@PathVariable("id") String id) { public R info(@PathVariable("id") String id) throws UnsupportedEncodingException{
TermEntity term = termService.queryObject(id); TermEntity term = termService.queryObject(id);
return R.ok().put("term", term); return R.ok().put("term", term);
...@@ -84,7 +85,7 @@ public class TermController { ...@@ -84,7 +85,7 @@ public class TermController {
@RequestMapping("/save") @RequestMapping("/save")
@RequiresPermissions("term:save") @RequiresPermissions("term:save")
@ResponseBody @ResponseBody
public R save(@RequestBody TermEntity term) { public R save(@RequestBody TermEntity term) throws UnsupportedEncodingException {
termService.save(term); termService.save(term);
return R.ok(); return R.ok();
...@@ -96,7 +97,7 @@ public class TermController { ...@@ -96,7 +97,7 @@ public class TermController {
@RequestMapping("/update") @RequestMapping("/update")
@RequiresPermissions("term:update") @RequiresPermissions("term:update")
@ResponseBody @ResponseBody
public R update(@RequestBody TermEntity term) { public R update(@RequestBody TermEntity term) throws UnsupportedEncodingException {
termService.update(term); termService.update(term);
return R.ok(); return R.ok();
...@@ -121,8 +122,10 @@ public class TermController { ...@@ -121,8 +122,10 @@ public class TermController {
@ResponseBody @ResponseBody
public R queryAll(@RequestParam Map<String, Object> params) { public R queryAll(@RequestParam Map<String, Object> params) {
List<TermVo> list = termService.queryList(params); List<TermEntity> list = termService.queryList(params);
return R.ok().put("list", list); return R.ok().put("list", list);
} }
} }
...@@ -31,6 +31,15 @@ public class TbCfOrderListEntity implements Serializable { ...@@ -31,6 +31,15 @@ public class TbCfOrderListEntity implements Serializable {
private String deliveryFlag; private String deliveryFlag;
private BigDecimal itemsPrice; private BigDecimal itemsPrice;
private String itemUrl; private String itemUrl;
private String email;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getItemUrl() { public String getItemUrl() {
return itemUrl; return itemUrl;
......
...@@ -53,6 +53,7 @@ public class TermEntity implements Serializable { ...@@ -53,6 +53,7 @@ public class TermEntity implements Serializable {
/** /**
* 设置:条款ID * 设置:条款ID
*/ */
......
...@@ -3,6 +3,7 @@ package com.platform.service; ...@@ -3,6 +3,7 @@ package com.platform.service;
import com.platform.entity.TermEntity; import com.platform.entity.TermEntity;
import com.platform.vo.TermVo; import com.platform.vo.TermVo;
import java.io.UnsupportedEncodingException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -20,7 +21,7 @@ public interface TermService { ...@@ -20,7 +21,7 @@ public interface TermService {
* @param id 主键 * @param id 主键
* @return 实体 * @return 实体
*/ */
TermEntity queryObject(String id); TermEntity queryObject(String id) throws UnsupportedEncodingException;
/** /**
* 分页查询 * 分页查询
...@@ -28,7 +29,7 @@ public interface TermService { ...@@ -28,7 +29,7 @@ public interface TermService {
* @param map 参数 * @param map 参数
* @return list * @return list
*/ */
List<TermVo> queryList(Map<String, Object> map); List<TermEntity> queryList(Map<String, Object> map);
/** /**
* 分页统计总数 * 分页统计总数
...@@ -44,7 +45,7 @@ public interface TermService { ...@@ -44,7 +45,7 @@ public interface TermService {
* @param term 实体 * @param term 实体
* @return 保存条数 * @return 保存条数
*/ */
int save(TermEntity term); int save(TermEntity term) throws UnsupportedEncodingException;
/** /**
* 根据主键更新实体 * 根据主键更新实体
...@@ -52,7 +53,7 @@ public interface TermService { ...@@ -52,7 +53,7 @@ public interface TermService {
* @param term 实体 * @param term 实体
* @return 更新条数 * @return 更新条数
*/ */
int update(TermEntity term); int update(TermEntity term) throws UnsupportedEncodingException;
/** /**
* 根据主键删除 * 根据主键删除
......
package com.platform.service.impl; package com.platform.service.impl;
import com.platform.dao.TermDao; import com.platform.dao.TermDao;
import com.platform.entity.TermEntity; import com.platform.entity.TermEntity;
import com.platform.service.TermService; import com.platform.service.TermService;
import com.platform.utils.IdUtil; import com.platform.utils.IdUtil;
...@@ -9,6 +10,8 @@ import org.apache.commons.lang.StringUtils; ...@@ -9,6 +10,8 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -25,20 +28,37 @@ public class TermServiceImpl implements TermService { ...@@ -25,20 +28,37 @@ public class TermServiceImpl implements TermService {
private TermDao termDao; private TermDao termDao;
@Override @Override
public TermEntity queryObject(String id) { public TermEntity queryObject(String id) throws UnsupportedEncodingException {
return termDao.queryObject(id); TermEntity term = termDao.queryObject(id);
term.setTermContent(URLDecoder.decode(term.getTermContent(), "UTF-8"));
return term;
} }
// @Override
// public List<TermVo> queryList(Map<String, Object> map) {
// //查询所有一级条款
// map.put("parentId", "0");
// List<TermVo> termList = termDao.queryTermsList(map);
// for (TermVo term : termList) {
// List<TermEntity> childrenTerms = termDao.queryChildrenTerms(term.getId());
// term.setChildrenList(childrenTerms);
// }
// return termList;
// }
@Override @Override
public List<TermVo> queryList(Map<String, Object> map) { public List<TermEntity> queryList(Map<String, Object> map) {
//查询所有一级条款 List<TermEntity> list = termDao.queryList(map);
map.put("parentId", "0"); list.forEach(t -> {
List<TermVo> termList = termDao.queryTermsList(map); try {
for (TermVo term : termList) { t.setTermContent(URLDecoder.decode(t.getTermContent(), "UTF-8"));
List<TermEntity> childrenTerms = termDao.queryChildrenTerms(term.getId()); if ("0".equals(t.getParentId())) {
term.setChildrenList(childrenTerms); t.setParentName("一级条款");
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} }
return termList; });
return list;
} }
@Override @Override
...@@ -47,20 +67,18 @@ public class TermServiceImpl implements TermService { ...@@ -47,20 +67,18 @@ public class TermServiceImpl implements TermService {
} }
@Override @Override
public int save(TermEntity term) { public int save(TermEntity term) throws UnsupportedEncodingException {
term.setId(IdUtil.createIdbyUUID()); term.setId(IdUtil.createIdbyUUID());
term.setCreateTime(new Date()); term.setCreateTime(new Date());
term.setUpdateTime(new Date()); term.setUpdateTime(new Date());
if (StringUtils.isBlank(term.getParentId())) { term.setTermContent(URLDecoder.decode(term.getTermContent(), "UTF-8"));
//一级条款父Id为0
term.setParentId("0");
}
return termDao.save(term); return termDao.save(term);
} }
@Override @Override
public int update(TermEntity term) { public int update(TermEntity term) throws UnsupportedEncodingException {
term.setUpdateTime(new Date()); term.setUpdateTime(new Date());
term.setTermContent(URLDecoder.decode(term.getTermContent(), "UTF-8"));
return termDao.update(term); return termDao.update(term);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
o.delivery_name, o.delivery_name,
o.delivery_phone, o.delivery_phone,
o.delivery_address, o.delivery_address,
a.email,
f.pay_way_code, f.pay_way_code,
o.order_status, o.order_status,
o.pay_id, o.pay_id,
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
LEFT JOIN tb_cf_finance f on f.order_id=o.order_id LEFT JOIN tb_cf_finance f on f.order_id=o.order_id
LEFT JOIN tb_cf_user_info u on u.user_id=o.user_id LEFT JOIN tb_cf_user_info u on u.user_id=o.user_id
LEFT JOIN tb_cf_coupon c on c.coupon_id=o.coupon_id LEFT JOIN tb_cf_coupon c on c.coupon_id=o.coupon_id
LEFT JOIN tb_cf_address a on a.user_id=u.user_id
WHERE 1=1 and o.enable_flag=1 WHERE 1=1 and o.enable_flag=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND o.order_no LIKE concat('%',#{name},'%') AND o.order_no LIKE concat('%',#{name},'%')
......
...@@ -28,23 +28,26 @@ ...@@ -28,23 +28,26 @@
where id = #{id} where id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.vo.TermVo"> <select id="queryList" resultType="com.platform.entity.TermEntity">
select select
`id`, t.`id`,
`parent_id`, t.`term_name`,
`term_name`, t.parent_id,
`term_content`, p.`term_name` parentName,
`create_time`, t.`term_content`,
`update_time`, t.`create_time`,
`status`, t.`update_time`,
`sort` t.`status`,
from term t.`sort`
from term t
left join term p
on t.parent_id=p.id
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND t.`term_name` LIKE concat('%',#{name},'%')
</if> </if>
<if test="parentId != null and parentId.trim() != ''"> <if test="parentId != null and parentId.trim() != ''">
AND parent_id=#{parentId} AND t.parent_id=#{parentId}
</if> </if>
<choose> <choose>
<when test="sidx != null and sidx.trim() != ''"> <when test="sidx != null and sidx.trim() != ''">
...@@ -109,7 +112,7 @@ ...@@ -109,7 +112,7 @@
select count(*) from term select count(*) from term
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND `term_name` LIKE concat('%',#{name},'%')
</if> </if>
<if test="parentId != null and parentId.trim() != ''"> <if test="parentId != null and parentId.trim() != ''">
AND parent_id=#{parentId} AND parent_id=#{parentId}
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<script type="text/javascript" src="http://vuejs.org/js/vue.min.js"></script> <script type="text/javascript" src="http://vuejs.org/js/vue.min.js"></script>
<script type="text/javascript" src="http://unpkg.com/view-design/dist/iview.min.js"></script> <script type="text/javascript" src="http://unpkg.com/view-design/dist/iview.min.js"></script>
<style> <style>
#jqGrid tr td{
text-align:center;
}
p,li,span,h1,h2,h3,h4,h5{ p,li,span,h1,h2,h3,h4,h5{
/* line-height: 2em; */ /* line-height: 2em; */
} }
......
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
<title></title> <title></title>
#parse("sys/header.html") #parse("sys/header.html")
</head> </head>
<style>
.ivu-select-dropdown {
position: relative !important;
top: 0 !important;
}
</style>
<body> <body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);"> <div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;"> <div v-show="showList" style="height: 100%;">
...@@ -33,43 +39,57 @@ ...@@ -33,43 +39,57 @@
<Card v-show="!showList"> <Card v-show="!showList">
<p slot="title">{{title}}</p> <p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="term" :rules="ruleValidate" :label-width="80"> <i-form ref="formValidate" :model="term" :rules="ruleValidate" :label-width="80">
<!-- <Form-item label="父条款ID,一级条款为0" prop="parentId">--> <!-- <Form-item label="父条款ID,一级条款为0" prop="parentId">-->
<!-- <i-input v-model="term.parentId" placeholder="父条款ID,一级条款为0"/>--> <!-- <i-input v-model="term.parentId" placeholder="父条款ID,一级条款为0"/>-->
<!-- </Form-item>--> <!-- </Form-item>-->
<Form-item label="条款名称" prop="termName"> <Form-item label="条款目录" prop="parentId" style="width: 800px" :disabled="disabled">
<i-select placeholder="请选择" v-model="term.parentId" v-show="disabled"
@on-change="changeType">
<i-option v-for="(el,i) in typeList" :key='i'
:value="el.value">{{el.label}}
</i-option>
</i-select>
<div v-show="!disabled">{{typelistname}}</div>
</Form-item>
<Form-item label="条款名称" prop="termName" style="width: 800px">
<i-input v-model="term.termName" placeholder="条款名称"/> <i-input v-model="term.termName" placeholder="条款名称"/>
</Form-item> </Form-item>
<Form-item label="序号" prop="sort" style="width: 800px">
<span>条款目录</span> <i-input v-model="term.sort" placeholder="序号"/>
<select @change="changeProduct($event)">
<!-- <option v-model="term.termName">Volvo</option>-->
<option value="0">上级目录</option>
<option v-for="(el,index) in Allfa.list" :key="index" :value="el.id">{{el.termName}}</option>
<!-- <option :value="audi">Audi</option>-->
</select>
<!-- <Form-item label="上级菜单" v-if="term.type == 2" prop="parentName">-->
<!-- <i-input v-model="menu.parentName" @on-click="termTree" icon="eye" readonly="readonly"-->
<!-- placeholder="一级菜单"/>-->
<!-- </Form-item>-->
<!-- <Form-item label="上级菜单" v-if="term.type != 2">-->
<!-- <i-input v-model="menu.parentName" @on-click="termTree" icon="eye" readonly="readonly"-->
<!-- placeholder="一级菜单"/>-->
<!-- </Form-item>-->
<Form-item label="条款内容" prop="termContent" v-if="flag">
<i-input v-model="term.termContent" placeholder="条款内容"/>
</Form-item> </Form-item>
<Form-item label="条款内容" prop="termContent" v-if="!flag"> <br/>
<i-input v-model="term.termContent" placeholder="父级不可用" readonly="readonly"/> <!-- <span>条款目录</span>-->
<!-- <select @change="changeProduct($event)">-->
<!-- &lt;!&ndash; <option v-model="term.termName">Volvo</option>&ndash;&gt;-->
<!-- <option value="0">上级目录</option>-->
<!-- <option v-for="(el,index) in Allfa.list" :key="index" :value="el.id">{{el.termName}}</option>-->
<!-- &lt;!&ndash; <option :value="audi">Audi</option>&ndash;&gt;-->
<!-- </select>-->
<!-- <Form-item label="上级菜单" v-if="term.type == 2" prop="parentName">-->
<!-- <i-input v-model="menu.parentName" @on-click="termTree" icon="eye" readonly="readonly"-->
<!-- placeholder="一级菜单"/>-->
<!-- </Form-item>-->
<!-- <Form-item label="上级菜单" v-if="term.type != 2">-->
<!-- <i-input v-model="menu.parentName" @on-click="termTree" icon="eye" readonly="readonly"-->
<!-- placeholder="一级菜单"/>-->
<!-- </Form-item>-->
<Form-item label="条款内容" prop="termContent" v-show="showContent">
<!-- <i-input v-model="term.termContent" placeholder="条款内容"/>-->
<textarea id="termContent" style="width: 800px;height: 600px;"></textarea>
</Form-item> </Form-item>
<!-- <Form-item label="创建时间" prop="createTime">-->
<!-- <i-input v-model="term.createTime" placeholder="创建时间"/>--> <!-- <Form-item label="条款内容" prop="termContent" v-if="!flag">-->
<!-- </Form-item>--> <!-- <i-input v-model="term.termContent" placeholder="父级不可用" readonly="readonly"/>-->
<!-- <Form-item label="更新时间" prop="updateTime">--> <!-- </Form-item>-->
<!-- <i-input v-model="term.updateTime" placeholder="更新时间"/>--> <!-- <Form-item label="创建时间" prop="createTime">-->
<!-- </Form-item>--> <!-- <i-input v-model="term.createTime" placeholder="创建时间"/>-->
<!-- <Form-item label="状态 0:无效 1:有效" prop="status">--> <!-- </Form-item>-->
<!-- <i-input v-model="term.status" placeholder="状态 0:无效 1:有效"/>--> <!-- <Form-item label="更新时间" prop="updateTime">-->
<!-- </Form-item>--> <!-- <i-input v-model="term.updateTime" placeholder="更新时间"/>-->
<!-- </Form-item>-->
<!-- <Form-item label="状态 0:无效 1:有效" prop="status">-->
<!-- <i-input v-model="term.status" placeholder="状态 0:无效 1:有效"/>-->
<!-- </Form-item>-->
<Form-item label="状态" prop="status"> <Form-item label="状态" prop="status">
<Radio-group v-model="term.status"> <Radio-group v-model="term.status">
<Radio label="1"> <Radio label="1">
...@@ -80,12 +100,13 @@ ...@@ -80,12 +100,13 @@
</Radio> </Radio>
</Radio-group> </Radio-group>
</Form-item> </Form-item>
<!-- <Form-item label="排序" prop="sort">--> <!-- <Form-item label="排序" prop="sort">-->
<!-- <i-input v-model="term.sort" placeholder="排序"/>--> <!-- <i-input v-model="term.sort" placeholder="排序"/>-->
<!-- </Form-item>--> <!-- </Form-item>-->
<Form-item> <Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <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> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item> </Form-item>
</i-form> </i-form>
...@@ -93,5 +114,17 @@ ...@@ -93,5 +114,17 @@
</div> </div>
<script src="${rc.contextPath}/js/sys/term.js?_${date.systemTime}"></script> <script src="${rc.contextPath}/js/sys/term.js?_${date.systemTime}"></script>
<script type="text/javascript">
var content = UE.getEditor('termContent');
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function (action) {
if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
return '${rc.contextPath}/api/osstest/uploaditemimage';
} else {
return this._bkGetActionUrl.call(this, action);
}
};
</script>
</body> </body>
</html> </html>
...@@ -603,7 +603,7 @@ statusFormat = function (cellvalue) { ...@@ -603,7 +603,7 @@ statusFormat = function (cellvalue) {
*/ */
statusFormat1 = function (cellvalue) { statusFormat1 = function (cellvalue) {
return cellvalue == 1 ? '正常' : '已删除'; return cellvalue == 1 ? '正常' : '无效';
}; };
//状态 0:已删除 1:活动进行中 2:活动已关闭 3:活动已结束 //状态 0:已删除 1:活动进行中 2:活动已关闭 3:活动已结束
......
...@@ -8,19 +8,21 @@ $(function () { ...@@ -8,19 +8,21 @@ $(function () {
{label: '订单编号', name: 'orderNo', index: 'order_no'}, {label: '订单编号', name: 'orderNo', index: 'order_no'},
{label: '用户名称', name: 'userName', index: 'user_name'}, {label: '用户名称', name: 'userName', index: 'user_name'},
{label: '下单时间', name: 'orderTime', index: 'order_time'}, {label: '下单时间', name: 'orderTime', index: 'order_time'},
{label: '支付方式', name: 'payWayCode', index: 'pay_way_code'}, {label: '支付方式', name: 'payWayCode', index: 'pay_way_code', width: 80},
{ {
label: '订单金额', label: '订单金额',
width: 100,
name: 'realityPay', name: 'realityPay',
index: 'reality_pay', index: 'reality_pay',
formatter: "currency", formatter: "currency",
formatoptions: {prefix: "$"} formatoptions: {prefix: "$"}
}, },
{label: '订单状态', name: 'orderStatus', index: 'order_status', formatter: orderStatusFormat}, {label: '订单状态', name: 'orderStatus', index: 'order_status', width: 100, formatter: orderStatusFormat},
{label: '代购状态', name: 'deliveryFlag', index: 'delivery_flag', formatter: deliveryFlagFormat}, {label: '代购状态', name: 'deliveryFlag', index: 'delivery_flag',width: 100, formatter: deliveryFlagFormat},
{label: '收货人', name: 'deliveryName', index: 'delivery_name', hidden: true}, {label: '收货人', name: 'deliveryName', index: 'delivery_name', hidden: true},
{label: '收货人手机', name: 'deliveryPhone', index: 'delivery_phone', hidden: true}, {label: '收货人手机', name: 'deliveryPhone', index: 'delivery_phone', hidden: true},
{label: '收货地址', name: 'deliveryAddress', index: 'delivery_address', hidden: true}, {label: '收货地址', name: 'deliveryAddress', index: 'delivery_address', hidden: true},
{label: '收货人邮箱', name: 'email', index: 'email'},
{label: '流水ID', name: 'payId', index: 'pay_id', hidden: true}, {label: '流水ID', name: 'payId', index: 'pay_id', hidden: true},
{label: '税费', name: 'tax', index: 'tax', hidden: true}, {label: '税费', name: 'tax', index: 'tax', hidden: true},
{label: '手续费', name: 'fee', index: 'fee', hidden: true}, {label: '手续费', name: 'fee', index: 'fee', hidden: true},
...@@ -30,7 +32,7 @@ $(function () { ...@@ -30,7 +32,7 @@ $(function () {
name: '操作', index: 'operate', width: '160px', name: '操作', index: 'operate', width: '160px',
formatter: function (value, grid, rows) { formatter: function (value, grid, rows) {
console.log(grid.colModel.formatter.arguments[2].orderStatus) console.log(grid.colModel.formatter.arguments[2].orderStatus)
if (grid.colModel.formatter.arguments[2].orderStatus == 10||grid.colModel.formatter.arguments[2].orderStatus == 60) { if (grid.colModel.formatter.arguments[2].orderStatus == 10 || grid.colModel.formatter.arguments[2].orderStatus == 60) {
return '<button onclick="closeList" style="display: inline-block;height: 30px; line-height: 25px; padding: 1px 18px; background-color: #49C8F2;font-size: 10px; ' + return '<button onclick="closeList" style="display: inline-block;height: 30px; line-height: 25px; padding: 1px 18px; background-color: #49C8F2;font-size: 10px; ' +
'-webkit-border-radius: 2px; border-radius: 6px; color: #fff; cursor: pointer; border: 0;margin: 1px 6px;" class="orderdescbutton">查看订单' + '-webkit-border-radius: 2px; border-radius: 6px; color: #fff; cursor: pointer; border: 0;margin: 1px 6px;" class="orderdescbutton">查看订单' +
'</button><button style="display: inline-block;height: 30px; line-height: 25px; padding: 1px 18px; background-color: #999c9e;font-size: 10px; ' + '</button><button style="display: inline-block;height: 30px; line-height: 25px; padding: 1px 18px; background-color: #999c9e;font-size: 10px; ' +
...@@ -842,12 +844,12 @@ let vm = new Vue({ ...@@ -842,12 +844,12 @@ let vm = new Vue({
vm.orderClose = true; vm.orderClose = true;
} }
let source; let source;
if(r.orderBasicVo.source==1){ if (r.orderBasicVo.source == 1) {
source='APP'; source = 'APP';
}else if(r.orderBasicVo.source==2){ } else if (r.orderBasicVo.source == 2) {
source='PC'; source = 'PC';
}else if(r.orderBasicVo.source==3){ } else if (r.orderBasicVo.source == 3) {
source='MOBILE'; source = 'MOBILE';
} }
vm.basicInfoData[0].data = r.orderBasicVo.orderNo; vm.basicInfoData[0].data = r.orderBasicVo.orderNo;
vm.basicInfoData[1].data = r.orderBasicVo.userName; vm.basicInfoData[1].data = r.orderBasicVo.userName;
......
...@@ -3,12 +3,12 @@ $(function () { ...@@ -3,12 +3,12 @@ $(function () {
url: '../term/list', url: '../term/list',
colModel: [ colModel: [
// {label: 'id', name: 'id', index: 'id', key: true, hidden: true}, // {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
// {label: '父条款ID,一级条款为0', name: 'parentId', index: 'parent_id', width: 80},
{label: '条款名称', name: 'termName', index: 'term_name', width: 80}, {label: '条款名称', name: 'termName', index: 'term_name', width: 80},
{label: '父条款名称', name: 'parentName', index: 'parentName', width: 80},
{label: '条款内容', name: 'termContent', index: 'term_content', width: 80}, {label: '条款内容', name: 'termContent', index: 'term_content', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}, {label: '创建时间', name: 'createTime', index: 'create_time', width: 80},
// {label: '更新时间', name: 'updateTime', index: 'update_time', width: 80}, // {label: '更新时间', name: 'updateTime', index: 'update_time', width: 80},
{label: '状态 0:无效 1:有效', name: 'status', index: 'status', width: 80}, {label: '状态', name: 'status', index: 'status', width: 80, formatter: statusFormat1},
// {label: '排序', name: 'sort', index: 'sort', width: 80} // {label: '排序', name: 'sort', index: 'sort', width: 80}
] ]
}); });
...@@ -17,9 +17,13 @@ $(function () { ...@@ -17,9 +17,13 @@ $(function () {
let vm = new Vue({ let vm = new Vue({
el: '#rrapp', el: '#rrapp',
data: { data: {
disabled: true,
showContent: false,
typeList: [],
typelistname:'',
showList: true, showList: true,
title: null, title: null,
term: {parentId:'0'}, term: {parentId: '0'},
ruleValidate: { ruleValidate: {
name: [ name: [
{required: true, message: '名称不能为空', trigger: 'blur'} {required: true, message: '名称不能为空', trigger: 'blur'}
...@@ -28,30 +32,63 @@ let vm = new Vue({ ...@@ -28,30 +32,63 @@ let vm = new Vue({
q: { q: {
name: '' name: ''
}, },
Allfa:{}, Allfa: {},
flag:false flag: false
}, },
methods: { methods: {
reloadType(){
$.get('../term/queryAll?parentId=0', res => {
console.log('term', JSON.parse(res).list)
this.typeList.push({
label: '一级条款',
value: "0"
});
JSON.parse(res).list.forEach((term) => {
console.log('termName', term.termName)
this.typeList.push({
label: term.termName,
value: term.id,
});
})
})
},
changeType() {
let parentId = vm.term.parentId;
if (parentId != 0) {
vm.showContent = true
} else {
vm.showContent = false
}
},
query: function () { query: function () {
vm.reload(); vm.reload();
}, },
add: function () { add: function () {
vm.showContent = false;
vm.showList = false; vm.showList = false;
vm.disabled = true;
vm.title = "新增"; vm.title = "新增";
vm.term = {}; vm.term = {};
vm.getFainfo(); vm.getFainfo();
}, },
update: function (event) { update: function (event) {
vm.disabled = false;
let id = getSelectedRow("#jqGrid"); let id = getSelectedRow("#jqGrid");
if (id == null) { if (id == null) {
return; return;
} }
vm.showContent = false;
vm.showList = false; vm.showList = false;
vm.title = "修改"; vm.title = "修改";
vm.getInfo(id); vm.getInfo(id);
}, },
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
vm.term.termContent = encodeURI(UE.getEditor('termContent').getContent()); // 富文本取值
vm.term.termContent = vm.term.termContent.replace(/&nbsp;/g, " ").replace(null, " ");
let url = vm.term.id == null ? "../term/save" : "../term/update"; let url = vm.term.id == null ? "../term/save" : "../term/update";
Ajax.request({ Ajax.request({
url: url, url: url,
...@@ -67,7 +104,7 @@ let vm = new Vue({ ...@@ -67,7 +104,7 @@ let vm = new Vue({
}, },
del: function (event) { del: function (event) {
let ids = getSelectedRows("#jqGrid"); let ids = getSelectedRows("#jqGrid");
if (ids == null){ if (ids == null) {
return; return;
} }
confirm('确定要删除选中的记录?', function () { confirm('确定要删除选中的记录?', function () {
...@@ -84,12 +121,20 @@ let vm = new Vue({ ...@@ -84,12 +121,20 @@ let vm = new Vue({
}); });
}); });
}, },
getInfo: function(id){
getInfo: function (id) {
// this.typeList=[];
Ajax.request({ Ajax.request({
url: "../term/info/"+id, url: "../term/info/" + id,
async: true, async: true,
successCallback: function (r) { successCallback: function (r) {
vm.term = r.term; vm.term = r.term;
vm.typelistname = r.term.termName
UE.getEditor('termContent').setContent(vm.term.termContent); // 富文本赋值
let parentId = vm.term.parentId;
if (parentId != "0") {
this.isParent = true
}
} }
}); });
}, },
...@@ -102,7 +147,7 @@ let vm = new Vue({ ...@@ -102,7 +147,7 @@ let vm = new Vue({
}).trigger("reloadGrid"); }).trigger("reloadGrid");
vm.handleReset('formValidate'); vm.handleReset('formValidate');
}, },
reloadSearch: function() { reloadSearch: function () {
vm.q = { vm.q = {
name: '' name: ''
}; };
...@@ -119,13 +164,13 @@ let vm = new Vue({ ...@@ -119,13 +164,13 @@ let vm = new Vue({
changeProduct(e) { changeProduct(e) {
vm.term.parentId = e.target.value vm.term.parentId = e.target.value
console.log(vm.term.parentId) console.log(vm.term.parentId)
if(vm.term.parentId == 0){ if (vm.term.parentId == 0) {
vm.flag = false; vm.flag = false;
}else { } else {
vm.flag = true; vm.flag = true;
} }
}, },
getFainfo(){ getFainfo() {
Ajax.request({ Ajax.request({
url: "../term/queryAll", url: "../term/queryAll",
async: true, async: true,
...@@ -136,7 +181,23 @@ let vm = new Vue({ ...@@ -136,7 +181,23 @@ let vm = new Vue({
}); });
} }
}, },
created(){ created() {
this.reloadType();
// $.get('../term/queryAll?parentId=0', res => {
// console.log('term', JSON.parse(res).list)
// this.typeList.push({
// label: '一级条款',
// value: "0"
// });
// JSON.parse(res).list.forEach((term) => {
// console.log('termName', term.termName)
// this.typeList.push({
// label: term.termName,
// value: term.id,
// });
// })
//
// })
// Ajax.request({ // Ajax.request({
// url: "../term/queryAll", // url: "../term/queryAll",
// async: true, // async: true,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论