增加订单选择树,订单按状态筛选
This commit is contained in:
parent
362343fcae
commit
6deaf5ebfb
|
|
@ -1,15 +1,15 @@
|
||||||
package com.ruoyi.busi.controller;
|
package com.ruoyi.busi.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.Ztree;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.busi.domain.BusiOrder;
|
import com.ruoyi.busi.domain.BusiOrder;
|
||||||
|
|
@ -123,4 +123,51 @@ public class BusiOrderController extends BaseController
|
||||||
{
|
{
|
||||||
return toAjax(busiOrderService.deleteBusiOrderByIds(ids));
|
return toAjax(busiOrderService.deleteBusiOrderByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择订单树
|
||||||
|
* @param mmap
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = {"/selectOrder","/selectOrder/{status}"})
|
||||||
|
public String selectCompany(ModelMap mmap, @PathVariable(value = "status", required = false) String status) {
|
||||||
|
BusiOrder temp = new BusiOrder();
|
||||||
|
temp.setId("0");
|
||||||
|
temp.setOrderName("根节点");
|
||||||
|
mmap.put("order", temp);
|
||||||
|
mmap.put("orderStatus", StringUtils.isNotEmpty(status) ? status : "");
|
||||||
|
return prefix + "/tree";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载客户订单选择树
|
||||||
|
*/
|
||||||
|
@GetMapping("/treeData")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Ztree> treeData(@RequestParam(name = "status",required = false) String status) {
|
||||||
|
BusiOrder busiOrder = new BusiOrder();
|
||||||
|
busiOrder.setStatus(status); //查询状态
|
||||||
|
List<BusiOrder> list = busiOrderService.selectBusiOrderList(busiOrder);
|
||||||
|
return initZtree(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化树列表
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Ztree> initZtree(List<BusiOrder> list) {
|
||||||
|
List<Ztree> ztrees = new ArrayList<Ztree>();
|
||||||
|
for (BusiOrder temp : list) {
|
||||||
|
Ztree ztree = new Ztree();
|
||||||
|
ztree.setId(Long.valueOf(temp.getId()));
|
||||||
|
ztree.setpId(0l);
|
||||||
|
String name = String.format("%s(%s:%s)", temp.getOrderName(), temp.getCompanyName(), temp.getIdentificationCode());
|
||||||
|
ztree.setName(name);
|
||||||
|
ztree.setTitle(name);
|
||||||
|
ztrees.add(ztree);
|
||||||
|
}
|
||||||
|
return ztrees;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="orderName != null and orderName != ''"> and A.order_name like concat('%', #{orderName}, '%')</if>
|
<if test="orderName != null and orderName != ''"> and A.order_name like concat('%', #{orderName}, '%')</if>
|
||||||
<if test="identificationCode != null and identificationCode != ''"> and A.identification_code like concat('%', #{identificationCode}, '%')</if>
|
<if test="identificationCode != null and identificationCode != ''"> and A.identification_code like concat('%', #{identificationCode}, '%')</if>
|
||||||
<if test="classify != null and classify != ''"> and A.classify = #{classify}</if>
|
<if test="classify != null and classify != ''"> and A.classify = #{classify}</if>
|
||||||
|
<if test="status != null and status != ''"> and A.status = #{status}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,13 @@
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>订单状态:</label>
|
||||||
|
<select name="status" th:with="type=${@dict.getType('busi_order_status')}">
|
||||||
|
<option value="">所有</option>
|
||||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('订单选择')"/>
|
||||||
|
<th:block th:include="include :: ztree-css"/>
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
height: auto;
|
||||||
|
font-family: "Microsoft YaHei";
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-family: "SimSun", "Helvetica Neue", Helvetica, Arial;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body class="hold-transition box box-main">
|
||||||
|
<input id="treeId" name="treeId" type="hidden" th:value="${order.id}"/>
|
||||||
|
<input id="treeName" name="treeName" type="hidden" th:value="${order.orderName}"/>
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||||
|
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||||
|
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||||
|
</div>
|
||||||
|
<div class="treeSearchInput" id="search">
|
||||||
|
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||||
|
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索</button>
|
||||||
|
</div>
|
||||||
|
<div class="treeExpandCollapse">
|
||||||
|
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||||
|
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||||
|
</div>
|
||||||
|
<div id="tree" class="ztree treeselect"></div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer"/>
|
||||||
|
<th:block th:include="include :: ztree-js"/>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "busi/order"
|
||||||
|
$(function () {
|
||||||
|
var url = prefix + "/treeData?status="+[[${orderStatus}]];
|
||||||
|
var options = {
|
||||||
|
url: url,
|
||||||
|
expandLevel: 2,
|
||||||
|
onClick: function (event, treeId, treeNode) {
|
||||||
|
var treeId = treeNode.id;
|
||||||
|
var treeName = treeNode.name;
|
||||||
|
$("#treeId").val(treeId);
|
||||||
|
$("#treeName").val(treeName);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.tree.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -9,15 +9,16 @@
|
||||||
<form class="form-horizontal m" id="form-productRequire-add">
|
<form class="form-horizontal m" id="form-productRequire-add">
|
||||||
<h4 class="form-header h4">产品需求信息</h4>
|
<h4 class="form-header h4">产品需求信息</h4>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">订单名称:</label>
|
<label class="col-sm-3 control-label is-required">所属订单:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="orderId" class="form-control" type="text" required>
|
<!-- <input name="orderId" class="form-control" type="text" required>-->
|
||||||
|
<input id="treeName" name="orderName" readonly="true" onclick="selectOrder(1)" class="form-control" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">数量:</label>
|
<label class="col-sm-3 control-label is-required">数量:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="amount" class="form-control" type="text">
|
<input name="amount" class="form-control digits" type="text" required >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
@ -40,7 +41,7 @@
|
||||||
<label class="col-sm-3 control-label is-required">截止日期:</label>
|
<label class="col-sm-3 control-label is-required">截止日期:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="input-group date">
|
<div class="input-group date">
|
||||||
<input name="endDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
|
<input name="endDate" class="form-control" readonly placeholder="yyyy-MM-dd" type="text" required>
|
||||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -77,6 +78,7 @@
|
||||||
$("input[name='endDate']").datetimepicker({
|
$("input[name='endDate']").datetimepicker({
|
||||||
format: "yyyy-mm-dd",
|
format: "yyyy-mm-dd",
|
||||||
minView: "month",
|
minView: "month",
|
||||||
|
startDate: new Date(),
|
||||||
autoclose: true
|
autoclose: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -155,6 +157,23 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*订单选择*/
|
||||||
|
function selectOrder(status) {
|
||||||
|
var options = {
|
||||||
|
title: '选择订单',
|
||||||
|
width: "380",
|
||||||
|
height: "400",
|
||||||
|
url: ctx + "busi/order/selectOrder/" + status,
|
||||||
|
callBack: function(index, layero){
|
||||||
|
var body = $.modal.getChildFrame(index);
|
||||||
|
$("#treeId").val(body.find('#treeId').val());
|
||||||
|
$("#treeName").val(body.find('#treeName').val());
|
||||||
|
$.modal.close(index);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.modal.openOptions(options);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<h4 class="form-header h4">产品需求信息</h4>
|
<h4 class="form-header h4">产品需求信息</h4>
|
||||||
<input name="id" th:field="*{id}" type="hidden">
|
<input name="id" th:field="*{id}" type="hidden">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">订单名称:</label>
|
<label class="col-sm-3 control-label is-required">所属订单:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="orderId" th:field="*{orderId}" class="form-control" type="text" required>
|
<input name="orderId" th:field="*{orderId}" class="form-control" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label>订单名称:</label>
|
<label>订单名称:</label>
|
||||||
<input type="text" name="orderId"/>
|
<input id="treeId" name="orderId" type="text" style="display: none;">
|
||||||
|
<input id="treeName" name="orderName" type="text" readonly="true" onclick="selectOrder()" >
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>尺码:</label>
|
<label>尺码:</label>
|
||||||
|
|
@ -119,6 +120,22 @@
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
/*客户公司选择*/
|
||||||
|
function selectOrder() {
|
||||||
|
var options = {
|
||||||
|
title: '选择订单',
|
||||||
|
width: "380",
|
||||||
|
height: "400",
|
||||||
|
url: ctx + "busi/order/selectOrder/" ,
|
||||||
|
callBack: function(index, layero){
|
||||||
|
var body = $.modal.getChildFrame(index);
|
||||||
|
$("#treeId").val(body.find('#treeId').val());
|
||||||
|
$("#treeName").val(body.find('#treeName').val());
|
||||||
|
$.modal.close(index);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.modal.openOptions(options);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue