模版上架页面
This commit is contained in:
parent
7bc78923aa
commit
eb2ce6e95c
|
|
@ -5,7 +5,10 @@ import com.ghy.common.core.domain.AjaxResult;
|
|||
import com.ghy.common.core.page.TableDataInfo;
|
||||
import com.ghy.goods.domain.GoodsStandard;
|
||||
import com.ghy.goods.service.GoodsStandardService;
|
||||
import com.ghy.order.domain.OrderTemplate;
|
||||
import com.ghy.order.service.OrderTemplateService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -22,11 +25,20 @@ public class GoodsStandardController extends BaseController {
|
|||
@Resource
|
||||
private GoodsStandardService goodsStandardService;
|
||||
|
||||
@Autowired
|
||||
private OrderTemplateService orderTemplateService;
|
||||
|
||||
@GetMapping("/addTemplate")
|
||||
public String addTemplate(ModelMap modelMap){
|
||||
return PREFIX + "/addTemplate";
|
||||
}
|
||||
|
||||
@GetMapping("getByTemplateId/{id}")
|
||||
public String getByTemplateId(ModelMap modelMap, @PathVariable("id") Long templateId) {
|
||||
OrderTemplate orderTemplate = orderTemplateService.selectById(templateId);
|
||||
modelMap.put("template", orderTemplate);
|
||||
return PREFIX + "/addTemplate";
|
||||
}
|
||||
@RequiresPermissions("goods:standard:view")
|
||||
@GetMapping
|
||||
public String goodsStandard(Long goodsId, ModelMap mmap) {
|
||||
|
|
|
|||
|
|
@ -2,22 +2,91 @@
|
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<th:block th:include="include :: header('模板新增')"/>
|
||||
|
||||
<style>
|
||||
.pane1 {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.pane2 {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.template-div {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.template-body {
|
||||
padding: 10px;
|
||||
border-radius: 5px 5px 0 0;
|
||||
border: 1px solid #1c84c6;
|
||||
}
|
||||
|
||||
.template-footer {
|
||||
background-color: #1c84c6;
|
||||
color: white;
|
||||
padding: 5px;
|
||||
border-radius: 0 0 5px 5px;
|
||||
border: 1px solid #1c84c6;
|
||||
}
|
||||
|
||||
.floor-text {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.floor-input {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.dropdown-btn {
|
||||
height: 31px;
|
||||
}
|
||||
|
||||
.oper-banner {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.oper-banner-start {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.oper-banner-end {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.yuan-symbol {
|
||||
color: red;
|
||||
font-size: large;
|
||||
}
|
||||
</style>
|
||||
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content animated fadeIn">
|
||||
<form id="addTemplateForm">
|
||||
<div class="pane1 wrapper wrapper-content animated fadeIn">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
商品信息
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="template-grid">
|
||||
<div class="template-grid" id="template-grid">
|
||||
<div class="template-div">
|
||||
<p>MR1234</p>
|
||||
<p>快速发布</p>
|
||||
<div class="template-body">MR1234</div>
|
||||
<div class="template-footer">快速发布</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="addTemplateForm" class="form-horizontal m">
|
||||
<div class="form-horizontal m">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">服务类目:</label>
|
||||
<div id="categoryCxSelect" class="col-sm-6 row">
|
||||
|
|
@ -41,46 +110,364 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button class="btn btn-primary" type="submit">提交</button>
|
||||
<label class="col-sm-2 control-label is-required">服务品牌:</label>
|
||||
<div class="col-sm-8 row">
|
||||
<div class="col-sm-3">
|
||||
<input type="text" name="goodsBrand" class="form-control" placeholder="品牌" required>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" name="goodsSpecification" class="form-control" placeholder="规格(非必填)">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<select class="form-control">
|
||||
<option value="后台订单">后台订单</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">服务时间:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input type="text" class="form-control" id="servDate" name="servDate" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="servTime" required>
|
||||
<option value="8:00-12:00">8:00-12:00</option>
|
||||
<option value="8:00-12:00">12:00-16:00</option>
|
||||
<option value="8:00-12:00">16:00-20:00</option>
|
||||
<option value="8:00-12:00">8:00-10:00</option>
|
||||
<option value="8:00-12:00">10:00-12:00</option>
|
||||
<option value="8:00-12:00">12:00-14:00</option>
|
||||
<option value="8:00-12:00">14:00-16:00</option>
|
||||
<option value="8:00-12:00">16:00-18:00</option>
|
||||
<option value="8:00-12:00">18:00-20:00</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">视频链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="videoUrl" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">图片上传:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input id="multipleFile" name="files" type="file" multiple>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">服务地址:</label>
|
||||
<div id="areaCxSelect" class="col-sm-6 row">
|
||||
<div class="col-sm-3">
|
||||
<select class="province form-control m-b" name="province" id="province" required onchange="selectRegion('province', 'city')"></select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<select class="city form-control m-b" name="city" id="city" required onchange="selectRegion('city', 'district')"></select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<select class="district form-control m-b" name="district" id="district" required onchange="selectRegion('district', 'street')"></select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<select class="street form-control m-b" name="street" id="street" required></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="fullAddress" class="form-control" required placeholder="请输入详细的门牌号">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">客户姓名:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="customerName" class="form-control" placeholder="请输入客户姓名" required>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="customerPhone" class="form-control" placeholder="请输入客户手机号码" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">下单模式:</label>
|
||||
<div class="col-sm-8 row">
|
||||
<div class="col-sm-2">
|
||||
<label><input type="radio" checked="" value="1" name="orderMode"> 带价发布</label>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<label><input type="radio" value="2" name="orderMode"> 一票价发布</label>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<label><input type="radio" value="3" name="orderMode"> 回收模式</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">发布价格:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" name="price" class="form-control" required placeholder="发布价格(佣金)">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" value="1" name="isOnSiteQuote" checked>上门报价</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" name="agencyFund" class="form-control" placeholder="上门代收款额(非必填)">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group">
|
||||
<input type="text" name="informationFee" class="form-control" required placeholder="信息费">
|
||||
<div class="input-group-btn">
|
||||
<button data-toggle="dropdown" class="btn btn-white dropdown-toggle dropdown-btn" type="button" id="informationFeeUnit">单位<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li onclick="changeInformationFeeUnit('%')"><a>%</a></li>
|
||||
<li onclick="changeInformationFeeUnit('元')"><a>元</a></li>
|
||||
</ul>
|
||||
<!-- <select class="form-control dropdown-menu pull-right" name="informationFeeUnit">-->
|
||||
<!-- <option value="%">%</option>-->
|
||||
<!-- <option value="元">元</option>-->
|
||||
<!-- </select>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">奖励金:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="bonus" class="form-control" placeholder="准时服务奖励金">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注说明:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" name="remark" placeholder="请输入备注说明(不超过512个字符)"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">物流单号:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="logisticsCode" class="form-control" placeholder="请输入物流单号">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-8">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" value="1" name="needWagon">需提供货拉拉或58速运类业务,本次服务需拉货</label>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" value="1" name="needCarry">需要搬货</label>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="floor-text">
|
||||
<div>需提供可搬货人员,楼层</div>
|
||||
<div class="floor-input"><input type="number" name="floor" class="form-control"></div>
|
||||
<div>层(费用另行计算);</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pane2 wrapper wrapper-content animated fadeIn">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="oper-banner">
|
||||
<div class="oper-banner-start col-sm-5">
|
||||
<span>合计金额:</span>
|
||||
<span class="yuan-symbol">¥</span>
|
||||
<span class="yuan-symbol" id="totalMoney">0</span>
|
||||
</div>
|
||||
<div class="oper-banner-end col-sm-5">
|
||||
<div class="m-r">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" value="1" name="isPayOffline">线下到付</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-r">
|
||||
<button type="button" class="btn btn-w-m btn-success" onclick="submitOrder()">提交订单</button>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" class="btn btn-w-m btn-success" onclick="addTemplate()">保存模版</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<th:block th:include="include :: footer"/>
|
||||
<th:block th:include="include :: jquery-cxselect-js" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||
$("#addTemplateForm").validate({
|
||||
rules: {
|
||||
goodsNum: "required"
|
||||
},
|
||||
messages: {
|
||||
goodsNum: icon + "请输入规格数量",
|
||||
}
|
||||
});
|
||||
// $("#addTemplateForm").validate({
|
||||
// rules: {
|
||||
// },
|
||||
// messages: {
|
||||
// }
|
||||
// });
|
||||
|
||||
// 级联下拉
|
||||
$.ajax()
|
||||
$('#categoryCxSelect').cxSelect({
|
||||
selects: ['category1', 'category2', 'category3', 'category4'],
|
||||
jsonValue: 'v',
|
||||
data: [
|
||||
{'v': '1', 'n': '类目1', s:
|
||||
[{'v': '2', 'n': '类目2', s:
|
||||
[{'v': '3', 'n': '类目3', s:
|
||||
[{'v': '4', 'n': '类目4'}]
|
||||
}]
|
||||
}]
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType:"json",
|
||||
url: ctx + "goods/deptcategory/app/list",
|
||||
data: JSON.stringify({deptId: 101, goodsCategoryId: 1}),
|
||||
contentType: 'application/json',
|
||||
success: function (result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$('#categoryCxSelect').cxSelect({
|
||||
selects: ['category1', 'category2', 'category3', 'category4'],
|
||||
jsonValue: 'goodsCategoryId',
|
||||
jsonName: 'goodsCategoryName',
|
||||
jsonSub: 'child',
|
||||
data: result.data
|
||||
});
|
||||
} else {
|
||||
$.modal.msgError("数据加载错误,请重试!")
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType:"json",
|
||||
url: ctx + "system/area/list",
|
||||
success: function (result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$('#areaCxSelect').cxSelect({
|
||||
selects: ['province', 'city', 'district', 'street'],
|
||||
jsonValue: 'areaId',
|
||||
jsonName: 'areaName',
|
||||
data: result.data
|
||||
});
|
||||
} else {
|
||||
$.modal.msgError("数据加载错误,请重试!")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$("#servDate").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$('#template-grid').html('');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType:"json",
|
||||
url: ctx + "order/template/selectByUserId",
|
||||
success: function (result) {
|
||||
if (result != null) {
|
||||
result.forEach(function(item) {
|
||||
$('#template-grid').append('<div class="template-div">' +
|
||||
' <div class="template-body">' + item.id + '</div>' +
|
||||
' <div class="template-footer">快速发布</div>' +
|
||||
' </div>');
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 多图上传
|
||||
// $("#multipleFile").fileinput({
|
||||
// uploadUrl: ctx + 'common/uploads',
|
||||
// uploadAsync: false
|
||||
// }).on('filebatchuploadsuccess', function (event, data, previewId, index) {
|
||||
// var rsp = data.response;
|
||||
// log.info("return urls:" + rsp.urls)
|
||||
// log.info("reutrn fileNames:" + rsp.fileNames)
|
||||
// }).on('fileremoved', function (event, id, index) {
|
||||
// this.$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
// })
|
||||
});
|
||||
|
||||
function changeInformationFeeUnit(unit) {
|
||||
this.$('#informationFeeUnit').html(unit + '<span class="caret"></span>');
|
||||
}
|
||||
|
||||
function selectRegion(regionLevelName, nextRegionLevelName) {
|
||||
var regionId = $("#" + regionLevelName).val();
|
||||
if ($.common.isEmpty(regionId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Ajax调用处理
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType:"json",
|
||||
url: ctx + "system/area/list",
|
||||
data: {parentCode: regionId},
|
||||
success: function (result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$('#areaCxSelect').cxSelect({
|
||||
selects: [nextRegionLevelName],
|
||||
jsonValue: 'areaId',
|
||||
jsonName: 'areaName',
|
||||
data: result.data
|
||||
});
|
||||
} else {
|
||||
$.modal.msgError("数据加载错误,请重试!")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function submitOrder() {
|
||||
|
||||
}
|
||||
|
||||
function addTemplate() {
|
||||
if ($.validate.form()) {
|
||||
var data = $("#addTemplateForm").serializeArray();
|
||||
var params= {};
|
||||
data.forEach(function (item){
|
||||
params[item.name] = item.value;
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType:"json",
|
||||
url: ctx + "order/template/insert",
|
||||
data: JSON.stringify(params),
|
||||
contentType: 'application/json',
|
||||
success: function (result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$.modal.msgSuccess("提交成功")
|
||||
} else {
|
||||
$.modal.msgError("请求失败")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue