Commit c1b3d7e5 authored by 黄辉勇's avatar 黄辉勇

''

parent 5b6da055
This diff is collapsed.
...@@ -1217,15 +1217,19 @@ var table = { ...@@ -1217,15 +1217,19 @@ var table = {
if (result.code == web_status.SUCCESS) { if (result.code == web_status.SUCCESS) {
var topWindow = $(window.parent.document); var topWindow = $(window.parent.document);
var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel'); var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel');
var $contentWindow = $('.JeeThink_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow; try{
var $contentWindow = $('.JeeThink_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
$contentWindow.$.modal.msgSuccess(result.msg);
$contentWindow.$(".layui-layer-padding").removeAttr("style");
if ($contentWindow.table.options.type == table_type.bootstrapTable) {
$contentWindow.$.table.refresh();
} else if ($contentWindow.table.options.type == table_type.bootstrapTreeTable) {
$contentWindow.$.treeTable.refresh();
}
}catch (e) {
console.log(e);
}
$.modal.close(); $.modal.close();
$contentWindow.$.modal.msgSuccess(result.msg);
$contentWindow.$(".layui-layer-padding").removeAttr("style");
if ($contentWindow.table.options.type == table_type.bootstrapTable) {
$contentWindow.$.table.refresh();
} else if ($contentWindow.table.options.type == table_type.bootstrapTreeTable) {
$contentWindow.$.treeTable.refresh();
}
$.modal.closeTab(); $.modal.closeTab();
} else if (result.code == web_status.WARNING) { } else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg) $.modal.alertWarning(result.msg)
......
...@@ -220,6 +220,82 @@ ...@@ -220,6 +220,82 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">出口港:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="portOfLoading" th:value="${crmOrderPrice.portOfLoading}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">目的港:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="portOfDestination" th:value="${crmOrderPrice.portOfDestination}" class="form-control" type="text" required>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">运输方式:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="shippedVia" th:value="${crmOrderPrice.shippedVia}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价人:</label>
<div class="col-sm-8">
<input name="prcieBy" th:field="*{prcieBy}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">报价有效截止时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-xs-2 control-label">备注:</label>
<div class="col-xs-10">
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -526,50 +602,6 @@ ...@@ -526,50 +602,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价人:</label>
<div class="col-sm-8">
<input name="prcieBy" th:field="*{prcieBy}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">报价有效截止时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-xs-2 control-label">备注:</label>
<div class="col-xs-10">
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
</div> </div>
</div> </div>
<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 ">进价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="incomePrice" class="form-control" type="text" required> <input name="incomePrice" class="form-control" type="text" >
</div> </div>
</div> </div>
<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 ">售价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="salePrice" class="form-control" type="text" required> <input name="salePrice" class="form-control" type="text" >
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -99,26 +99,16 @@ ...@@ -99,26 +99,16 @@
</tr> </tr>
</thead> </thead>
<tbody id="tbody"> <tbody id="tbody">
<tr>
<td align="center">
<input type="text" name="NO[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7" />
</td>
<td align="center">
<input type="text" name="serial_number[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7" />
</td>
<td>
<input type="button" id="Button2" onClick="deltr(this)" value="删行">
</td>
</tr>
</tbody> </tbody>
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
//添加表格 //添加表格
function tableChange() { function tableChange() {
var length = $("#tbody tr").length;
var tableHtml =""; var tableHtml ="";
tableHtml += '<tr>' tableHtml += '<tr>'
+'<td align="center"><input type="text" name="NO[]" style="line-height: 24px;border:none;border-radius: 4px;border:1px solid #e5e6e7"/> </td>' +'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].name" style="line-height: 24px;border:none;border-radius: 4px;border:1px solid #e5e6e7"/> </td>'
+'<td align="center"><input type="text" name="serial_number[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>' +'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].attrVal" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>'
+'<td><input type="button" onClick="deltr(this)" value="删行"></td>' +'<td><input type="button" onClick="deltr(this)" value="删行"></td>'
+'</tr>'; +'</tr>';
$("#tbody").append(tableHtml) ; //在表格后面添加一行 $("#tbody").append(tableHtml) ; //在表格后面添加一行
......
...@@ -41,15 +41,15 @@ ...@@ -41,15 +41,15 @@
</div> </div>
</div> </div>
<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 ">进价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="incomePrice" th:field="*{incomePrice}" class="form-control" type="text" required> <input name="incomePrice" th:field="*{incomePrice}" class="form-control" type="text" >
</div> </div>
</div> </div>
<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 ">售价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="salePrice" th:field="*{salePrice}" class="form-control" type="text" required> <input name="salePrice" th:field="*{salePrice}" class="form-control" type="text" >
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -107,26 +107,21 @@ ...@@ -107,26 +107,21 @@
</tr> </tr>
</thead> </thead>
<tbody id="tbody"> <tbody id="tbody">
<tr> <tr th:each="wmsProductAttribute,wmsProductAttributeStat : ${wmsProduct.wmsProductAttributes}" th:with="arrayIndex=${wmsProductAttributeStat.index}">
<td align="center"> <td align="center"><input type="text" th:name="'wmsProductAttributes['+${arrayIndex}+'].name'" th:value="${wmsProductAttribute.name}" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/> </td>
<input type="text" name="NO[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7" /> <td align="center"><input type="text" th:name="'wmsProductAttributes['+${arrayIndex}+'].attrVal'" th:value="${wmsProductAttribute.attrVal}" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>
</td> <td><input type="button" onClick="deltr(this)" value="删行"></td>
<td align="center">
<input type="text" name="serial_number[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7" />
</td>
<td>
<input type="button" id="Button2" onClick="deltr(this)" value="删行">
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
//添加表格 //添加表格
function tableChange() { function tableChange() {
var length = $("#tbody tr").length;
var tableHtml =""; var tableHtml ="";
tableHtml += '<tr>' tableHtml += '<tr>'
+'<td align="center"><input type="text" name="NO[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/> </td>' +'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].name" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/> </td>'
+'<td align="center"><input type="text" name="serial_number[]" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>' +'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].attrVal" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>'
+'<td><input type="button" onClick="deltr(this)" value="删行"></td>' +'<td><input type="button" onClick="deltr(this)" value="删行"></td>'
+'</tr>'; +'</tr>';
$("#tbody").append(tableHtml) ; //在表格后面添加一行 $("#tbody").append(tableHtml) ; //在表格后面添加一行
......
...@@ -1217,15 +1217,19 @@ var table = { ...@@ -1217,15 +1217,19 @@ var table = {
if (result.code == web_status.SUCCESS) { if (result.code == web_status.SUCCESS) {
var topWindow = $(window.parent.document); var topWindow = $(window.parent.document);
var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel'); var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-panel');
var $contentWindow = $('.JeeThink_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow; try{
var $contentWindow = $('.JeeThink_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
$contentWindow.$.modal.msgSuccess(result.msg);
$contentWindow.$(".layui-layer-padding").removeAttr("style");
if ($contentWindow.table.options.type == table_type.bootstrapTable) {
$contentWindow.$.table.refresh();
} else if ($contentWindow.table.options.type == table_type.bootstrapTreeTable) {
$contentWindow.$.treeTable.refresh();
}
}catch (e) {
console.log(e);
}
$.modal.close(); $.modal.close();
$contentWindow.$.modal.msgSuccess(result.msg);
$contentWindow.$(".layui-layer-padding").removeAttr("style");
if ($contentWindow.table.options.type == table_type.bootstrapTable) {
$contentWindow.$.table.refresh();
} else if ($contentWindow.table.options.type == table_type.bootstrapTreeTable) {
$contentWindow.$.treeTable.refresh();
}
$.modal.closeTab(); $.modal.closeTab();
} else if (result.code == web_status.WARNING) { } else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg) $.modal.alertWarning(result.msg)
......
...@@ -220,6 +220,82 @@ ...@@ -220,6 +220,82 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">出口港:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="portOfLoading" th:value="${crmOrderPrice.portOfLoading}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">目的港:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="portOfDestination" th:value="${crmOrderPrice.portOfDestination}" class="form-control" type="text" required>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">运输方式:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="shippedVia" th:value="${crmOrderPrice.shippedVia}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价人:</label>
<div class="col-sm-8">
<input name="prcieBy" th:field="*{prcieBy}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">报价有效截止时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-xs-2 control-label">备注:</label>
<div class="col-xs-10">
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -526,50 +602,6 @@ ...@@ -526,50 +602,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价人:</label>
<div class="col-sm-8">
<input name="prcieBy" th:field="*{prcieBy}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">报价时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">报价有效截止时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="prcieEndDate" th:value="${#dates.format(crmOrderPrice.prcieEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-xs-2 control-label">备注:</label>
<div class="col-xs-10">
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
</div> </div>
</div> </div>
<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 ">进价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="incomePrice" class="form-control" type="text" required> <input name="incomePrice" class="form-control" type="text" >
</div> </div>
</div> </div>
<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 ">售价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="salePrice" class="form-control" type="text" required> <input name="salePrice" class="form-control" type="text" >
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -82,12 +82,48 @@ ...@@ -82,12 +82,48 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-xs-3 control-label">备注:</label> <label class="col-xs-3 control-label">备注:</label>
<div class="col-xs-8"> <div class="col-xs-8">
<textarea name="remark" maxlength="500" class="form-control" <textarea name="remark" maxlength="500" class="form-control"
rows="3"></textarea> rows="3"></textarea>
</div> </div>
</div> </div>
<div>
<p onclick="tableChange()"><a href="javascript:;">添加</a></p>
<table class="table table-bordered" id="tables">
<thead>
<tr>
<th>名称</th>
<th></th>
<th>操作</th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
<script type="text/javascript">
//添加表格
function tableChange() {
var length = $("#tbody tr").length;
var tableHtml ="";
tableHtml += '<tr>'
+'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].name" style="line-height: 24px;border:none;border-radius: 4px;border:1px solid #e5e6e7"/> </td>'
+'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].attrVal" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>'
+'<td><input type="button" onClick="deltr(this)" value="删行"></td>'
+'</tr>';
$("#tbody").append(tableHtml) ; //在表格后面添加一行
}
function deltr(opp) {
var length = $("#tbody tr").length;
if (length <= 1) {
alert("至少保留一行");
} else {
$(opp).parent().parent().remove();//移除当前行
}
}
</script>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('修改产品')" /> <th:block th:include="include :: header('修改产品')" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
...@@ -43,15 +41,15 @@ ...@@ -43,15 +41,15 @@
</div> </div>
</div> </div>
<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 ">进价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="incomePrice" th:field="*{incomePrice}" class="form-control" type="text" required> <input name="incomePrice" th:field="*{incomePrice}" class="form-control" type="text" >
</div> </div>
</div> </div>
<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 ">售价(元):</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="salePrice" th:field="*{salePrice}" class="form-control" type="text" required> <input name="salePrice" th:field="*{salePrice}" class="form-control" type="text" >
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -100,7 +98,6 @@ ...@@ -100,7 +98,6 @@
</div> </div>
<div> <div>
<p onclick="tableChange()"><a href="javascript:;">添加</a></p> <p onclick="tableChange()"><a href="javascript:;">添加</a></p>
<!-- <button onclick="tableChange()">Copy Text</button>-->
<table class="table table-bordered" id="tables"> <table class="table table-bordered" id="tables">
<thead> <thead>
<tr> <tr>
...@@ -110,26 +107,21 @@ ...@@ -110,26 +107,21 @@
</tr> </tr>
</thead> </thead>
<tbody id="tbody"> <tbody id="tbody">
<tr> <tr th:each="wmsProductAttribute,wmsProductAttributeStat : ${wmsProduct.wmsProductAttributes}" th:with="arrayIndex=${wmsProductAttributeStat.index}">
<td align="center"> <td align="center"><input type="text" th:name="'wmsProductAttributes['+${arrayIndex}+'].name'" th:value="${wmsProductAttribute.name}" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/> </td>
<input type="text" name="NO[]" size="2" /> <td align="center"><input type="text" th:name="'wmsProductAttributes['+${arrayIndex}+'].attrVal'" th:value="${wmsProductAttribute.attrVal}" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>
</td> <td><input type="button" onClick="deltr(this)" value="删行"></td>
<td align="center">
<input type="text" name="serial_number[]" />
</td>
<td>
<input type="button" id="Button2" onClick="deltr(this)" value="删行">
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
//添加表格 //添加表格
function tableChange() { function tableChange() {
var length = $("#tbody tr").length;
var tableHtml =""; var tableHtml ="";
tableHtml += '<tr>' tableHtml += '<tr>'
+'<td align="center"><input type="text" name="NO[]" size="2" /> </td>' +'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].name" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/> </td>'
+'<td align="center"><input type="text" name="serial_number[]"/></td>' +'<td align="center"><input type="text" name="wmsProductAttributes['+length+'].attrVal" style="line-height: 24px;border-radius: 4px;border:none;border:1px solid #e5e6e7"/></td>'
+'<td><input type="button" onClick="deltr(this)" value="删行"></td>' +'<td><input type="button" onClick="deltr(this)" value="删行"></td>'
+'</tr>'; +'</tr>';
$("#tbody").append(tableHtml) ; //在表格后面添加一行 $("#tbody").append(tableHtml) ; //在表格后面添加一行
......
...@@ -455,6 +455,15 @@ public class CrmOrderPrice extends BaseEntity ...@@ -455,6 +455,15 @@ public class CrmOrderPrice extends BaseEntity
@Excel(name = "净利(35%)") @Excel(name = "净利(35%)")
private BigDecimal netProfitThirtyFive; private BigDecimal netProfitThirtyFive;
// 粗口港
private String portOfLoading;
//目的港
private String portOfDestination;
// 运输方式
private String shippedVia;
...@@ -1264,7 +1273,29 @@ public class CrmOrderPrice extends BaseEntity ...@@ -1264,7 +1273,29 @@ public class CrmOrderPrice extends BaseEntity
this.profitThirtyFive = profitThirtyFive; this.profitThirtyFive = profitThirtyFive;
} }
public String getPortOfLoading() {
return portOfLoading;
}
public void setPortOfLoading(String portOfLoading) {
this.portOfLoading = portOfLoading;
}
public String getPortOfDestination() {
return portOfDestination;
}
public void setPortOfDestination(String portOfDestination) {
this.portOfDestination = portOfDestination;
}
public String getShippedVia() {
return shippedVia;
}
public void setShippedVia(String shippedVia) {
this.shippedVia = shippedVia;
}
public BigDecimal getNetProfitThirtyFive() { public BigDecimal getNetProfitThirtyFive() {
return netProfitThirtyFive; return netProfitThirtyFive;
......
...@@ -43,4 +43,11 @@ public interface WmsProductAttributeMapper { ...@@ -43,4 +43,11 @@ public interface WmsProductAttributeMapper {
* @return * @return
*/ */
public int deleteWmsProductAttributeByProdId(Long prodId); public int deleteWmsProductAttributeByProdId(Long prodId);
/***
* 查询产品属性
* @param prodId
* @return
*/
public List<WmsProductAttribute> selectWmsProductAttributeByProdId(Long prodId);
} }
...@@ -2,6 +2,8 @@ package com.jeethink.crm.service.impl; ...@@ -2,6 +2,8 @@ package com.jeethink.crm.service.impl;
import java.util.List; import java.util.List;
import com.jeethink.common.utils.DateUtils; import com.jeethink.common.utils.DateUtils;
import com.jeethink.crm.domain.WmsProductAttribute;
import com.jeethink.crm.mapper.WmsProductAttributeMapper;
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 com.jeethink.crm.mapper.WmsProductMapper; import com.jeethink.crm.mapper.WmsProductMapper;
...@@ -20,6 +22,8 @@ public class WmsProductServiceImpl implements IWmsProductService ...@@ -20,6 +22,8 @@ public class WmsProductServiceImpl implements IWmsProductService
{ {
@Autowired @Autowired
private WmsProductMapper wmsProductMapper; private WmsProductMapper wmsProductMapper;
@Autowired
private WmsProductAttributeMapper wmsProductAttributeMapper;
/** /**
* 查询产品 * 查询产品
...@@ -30,7 +34,10 @@ public class WmsProductServiceImpl implements IWmsProductService ...@@ -30,7 +34,10 @@ public class WmsProductServiceImpl implements IWmsProductService
@Override @Override
public WmsProduct selectWmsProductById(Long productId) public WmsProduct selectWmsProductById(Long productId)
{ {
return wmsProductMapper.selectWmsProductById(productId); WmsProduct wmsProduct = wmsProductMapper.selectWmsProductById(productId);
List<WmsProductAttribute> wmsProductAttributes = wmsProductAttributeMapper.selectWmsProductAttributeByProdId(productId);
wmsProduct.setWmsProductAttributes(wmsProductAttributes);
return wmsProduct;
} }
/** /**
...@@ -56,7 +63,19 @@ public class WmsProductServiceImpl implements IWmsProductService ...@@ -56,7 +63,19 @@ public class WmsProductServiceImpl implements IWmsProductService
{ {
wmsProduct.setDelFlag("0"); wmsProduct.setDelFlag("0");
wmsProduct.setCreateTime(DateUtils.getNowDate()); wmsProduct.setCreateTime(DateUtils.getNowDate());
return wmsProductMapper.insertWmsProduct(wmsProduct); int saveCount = wmsProductMapper.insertWmsProduct(wmsProduct);
Long productId = wmsProduct.getProductId();
wmsProductAttributeMapper.deleteWmsProductAttributeByProdId(productId);
List<WmsProductAttribute> wmsProductAttributes = wmsProduct.getWmsProductAttributes();
if(null != wmsProductAttributes
&& wmsProductAttributes.size()>0){
wmsProductAttributes.forEach(wmsProductAttribute -> {
wmsProductAttribute.setProductId(productId);
wmsProductAttribute.setDelFlag("0");
wmsProductAttributeMapper.insertWmsProductAttribute(wmsProductAttribute);
});
}
return saveCount;
} }
/** /**
...@@ -69,6 +88,17 @@ public class WmsProductServiceImpl implements IWmsProductService ...@@ -69,6 +88,17 @@ public class WmsProductServiceImpl implements IWmsProductService
public int updateWmsProduct(WmsProduct wmsProduct) public int updateWmsProduct(WmsProduct wmsProduct)
{ {
wmsProduct.setUpdateTime(DateUtils.getNowDate()); wmsProduct.setUpdateTime(DateUtils.getNowDate());
Long productId = wmsProduct.getProductId();
wmsProductAttributeMapper.deleteWmsProductAttributeByProdId(productId);
List<WmsProductAttribute> wmsProductAttributes = wmsProduct.getWmsProductAttributes();
if(null != wmsProductAttributes
&& wmsProductAttributes.size()>0){
wmsProductAttributes.forEach(wmsProductAttribute -> {
wmsProductAttribute.setProductId(productId);
wmsProductAttribute.setDelFlag("0");
wmsProductAttributeMapper.insertWmsProductAttribute(wmsProductAttribute);
});
}
return wmsProductMapper.updateWmsProduct(wmsProduct); return wmsProductMapper.updateWmsProduct(wmsProduct);
} }
......
...@@ -116,6 +116,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -116,6 +116,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="managFeeThirtyFive" column="manag_fee_thirty_five" /> <result property="managFeeThirtyFive" column="manag_fee_thirty_five" />
<result property="netProfitThirtyFive" column="net_profit_thirty_five" /> <result property="netProfitThirtyFive" column="net_profit_thirty_five" />
<!--end--> <!--end-->
<result property="portOfLoading" column="port_of_loading" />
<result property="portOfDestination" column="port_of_destination" />
<result property="shippedVia" column="shipped_via" />
<association property="customer" column="customer_id" javaType="CrmCustomer" resultMap="customerResult" /> <association property="customer" column="customer_id" javaType="CrmCustomer" resultMap="customerResult" />
</resultMap> </resultMap>
...@@ -127,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -127,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectCrmOrderPriceVo"> <sql id="selectCrmOrderPriceVo">
select p.order_id, p.order_code, p.customer_id, select p.order_id, p.order_code, p.customer_id,
p.order_name, p.total_price, p.cost_price, p.order_name, p.total_price, p.cost_price,port_of_loading,port_of_destination,shipped_via,
p.freight,p.currency,p.net_profit,p.manag_fee,p.profit,p.dollar_val,p.fob,p.exch_rate,p.total_end_tax,p.invoice_amount,p.tax_rebates,p.profit_added_tax, p.freight,p.currency,p.net_profit,p.manag_fee,p.profit,p.dollar_val,p.fob,p.exch_rate,p.total_end_tax,p.invoice_amount,p.tax_rebates,p.profit_added_tax,
p.transport_added_tax,p.added_tax,p.total_payment_goods,p.cont_weight,p.cont_stand,p.total_weight,p.total_quantity,p.price, p.transport_added_tax,p.added_tax,p.total_payment_goods,p.cont_weight,p.cont_stand,p.total_weight,p.total_quantity,p.price,
p.prcie_date, p.prcie_by, p.prcie_end_date, p.order_date, p.order_status,p.weight, p.prcie_date, p.prcie_by, p.prcie_end_date, p.order_date, p.order_status,p.weight,
...@@ -291,6 +294,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -291,6 +294,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managFeeThirtyFive != null">manag_fee_thirty_five,</if> <if test="managFeeThirtyFive != null">manag_fee_thirty_five,</if>
<if test="netProfitThirtyFive != null">net_profit_thirty_five,</if> <if test="netProfitThirtyFive != null">net_profit_thirty_five,</if>
<!--end--> <!--end-->
<if test="portOfLoading != null">port_of_loading,</if>
<if test="portOfDestination != null">port_of_destination,</if>
<if test="shippedVia != null">shipped_via,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">#{orderCode},</if> <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
...@@ -394,6 +400,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -394,6 +400,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managFeeThirtyFive != null">#{managFeeThirtyFive},</if> <if test="managFeeThirtyFive != null">#{managFeeThirtyFive},</if>
<if test="netProfitThirtyFive != null">#{netProfitThirtyFive},</if> <if test="netProfitThirtyFive != null">#{netProfitThirtyFive},</if>
<!--end--> <!--end-->
<if test="portOfLoading != null">#{portOfLoading},</if>
<if test="portOfDestination != null">#{portOfDestination},</if>
<if test="shippedVia != null">#{shippedVia},</if>
</trim> </trim>
</insert> </insert>
...@@ -501,6 +510,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -501,6 +510,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managFeeThirtyFive != null">manag_fee_thirty_five=#{managFeeThirtyFive},</if> <if test="managFeeThirtyFive != null">manag_fee_thirty_five=#{managFeeThirtyFive},</if>
<if test="netProfitThirtyFive != null">net_profit_thirty_five=#{netProfitThirtyFive},</if> <if test="netProfitThirtyFive != null">net_profit_thirty_five=#{netProfitThirtyFive},</if>
<!--end--> <!--end-->
<if test="portOfLoading != null">port_of_loading=#{portOfLoading},</if>
<if test="portOfDestination != null">port_of_destination=#{portOfDestination},</if>
<if test="shippedVia != null">shipped_via=#{shippedVia},</if>
</trim> </trim>
where order_id = #{orderId} where order_id = #{orderId}
</update> </update>
......
...@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productId != null ">product_id,</if> <if test="productId != null ">product_id,</if>
<if test="name != null ">name,</if> <if test="name != null ">name,</if>
<if test="attrVal != null and productName != ''">attr_val,</if> <if test="attrVal != null and attrVal != ''">attr_val,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if> <if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null ">create_time,</if> <if test="createTime != null ">create_time,</if>
...@@ -49,5 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -49,5 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteWmsProductAttributeByProdId" parameterType="Long"> <delete id="deleteWmsProductAttributeByProdId" parameterType="Long">
delete from wms_product_attribute where product_id = #{prodId} delete from wms_product_attribute where product_id = #{prodId}
</delete> </delete>
<!--订单选择产品 -->
<select id="selectWmsProductAttributeByProdId" resultMap="WmsProductAttributeResult">
select pa.* from wms_product_attribute pa
<where>
pa.del_flag="0"
and pa.product_id = #{prodId}
</where>
order by pa.create_time desc
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -116,6 +116,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -116,6 +116,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="managFeeThirtyFive" column="manag_fee_thirty_five" /> <result property="managFeeThirtyFive" column="manag_fee_thirty_five" />
<result property="netProfitThirtyFive" column="net_profit_thirty_five" /> <result property="netProfitThirtyFive" column="net_profit_thirty_five" />
<!--end--> <!--end-->
<result property="portOfLoading" column="port_of_loading" />
<result property="portOfDestination" column="port_of_destination" />
<result property="shippedVia" column="shipped_via" />
<association property="customer" column="customer_id" javaType="CrmCustomer" resultMap="customerResult" /> <association property="customer" column="customer_id" javaType="CrmCustomer" resultMap="customerResult" />
</resultMap> </resultMap>
...@@ -127,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -127,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectCrmOrderPriceVo"> <sql id="selectCrmOrderPriceVo">
select p.order_id, p.order_code, p.customer_id, select p.order_id, p.order_code, p.customer_id,
p.order_name, p.total_price, p.cost_price, p.order_name, p.total_price, p.cost_price,port_of_loading,port_of_destination,shipped_via,
p.freight,p.currency,p.net_profit,p.manag_fee,p.profit,p.dollar_val,p.fob,p.exch_rate,p.total_end_tax,p.invoice_amount,p.tax_rebates,p.profit_added_tax, p.freight,p.currency,p.net_profit,p.manag_fee,p.profit,p.dollar_val,p.fob,p.exch_rate,p.total_end_tax,p.invoice_amount,p.tax_rebates,p.profit_added_tax,
p.transport_added_tax,p.added_tax,p.total_payment_goods,p.cont_weight,p.cont_stand,p.total_weight,p.total_quantity,p.price, p.transport_added_tax,p.added_tax,p.total_payment_goods,p.cont_weight,p.cont_stand,p.total_weight,p.total_quantity,p.price,
p.prcie_date, p.prcie_by, p.prcie_end_date, p.order_date, p.order_status,p.weight, p.prcie_date, p.prcie_by, p.prcie_end_date, p.order_date, p.order_status,p.weight,
...@@ -291,6 +294,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -291,6 +294,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managFeeThirtyFive != null">manag_fee_thirty_five,</if> <if test="managFeeThirtyFive != null">manag_fee_thirty_five,</if>
<if test="netProfitThirtyFive != null">net_profit_thirty_five,</if> <if test="netProfitThirtyFive != null">net_profit_thirty_five,</if>
<!--end--> <!--end-->
<if test="portOfLoading != null">port_of_loading,</if>
<if test="portOfDestination != null">port_of_destination,</if>
<if test="shippedVia != null">shipped_via,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">#{orderCode},</if> <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
...@@ -394,6 +400,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -394,6 +400,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managFeeThirtyFive != null">#{managFeeThirtyFive},</if> <if test="managFeeThirtyFive != null">#{managFeeThirtyFive},</if>
<if test="netProfitThirtyFive != null">#{netProfitThirtyFive},</if> <if test="netProfitThirtyFive != null">#{netProfitThirtyFive},</if>
<!--end--> <!--end-->
<if test="portOfLoading != null">#{portOfLoading},</if>
<if test="portOfDestination != null">#{portOfDestination},</if>
<if test="shippedVia != null">#{shippedVia},</if>
</trim> </trim>
</insert> </insert>
...@@ -501,6 +510,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -501,6 +510,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="managFeeThirtyFive != null">manag_fee_thirty_five=#{managFeeThirtyFive},</if> <if test="managFeeThirtyFive != null">manag_fee_thirty_five=#{managFeeThirtyFive},</if>
<if test="netProfitThirtyFive != null">net_profit_thirty_five=#{netProfitThirtyFive},</if> <if test="netProfitThirtyFive != null">net_profit_thirty_five=#{netProfitThirtyFive},</if>
<!--end--> <!--end-->
<if test="portOfLoading != null">port_of_loading=#{portOfLoading},</if>
<if test="portOfDestination != null">port_of_destination=#{portOfDestination},</if>
<if test="shippedVia != null">shipped_via=#{shippedVia},</if>
</trim> </trim>
where order_id = #{orderId} where order_id = #{orderId}
</update> </update>
......
<?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.jeethink.crm.mapper.WmsProductAttributeMapper">
<resultMap type="WmsProductAttribute" id="WmsProductAttributeResult">
<id property="attributeId" column="attribute_id" />
<result property="productId" column="product_id" />
<result property="name" column="name" />
<result property="attrVal" column="attr_val" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<insert id="insertWmsProductAttribute" parameterType="WmsProductAttribute" useGeneratedKeys="true" keyProperty="attributeId">
insert into wms_product_attribute
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productId != null ">product_id,</if>
<if test="name != null ">name,</if>
<if test="attrVal != null and attrVal != ''">attr_val,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null ">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null ">#{productId},</if>
<if test="name != null ">#{name},</if>
<if test="attrVal != null and attrVal != ''">#{attrVal},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null ">#{updateTime},</if>
</trim>
</insert>
<delete id="deleteWmsProductAttributeById" parameterType="Long">
delete from wms_product_attribute where attribute_id = #{attributeId}
</delete>
<delete id="deleteWmsProductAttributeByIds" parameterType="String">
delete from wms_product_attribute where attribute_id in
<foreach item="attributeId" collection="array" open="(" separator="," close=")">
#{attributeId}
</foreach>
</delete>
<delete id="deleteWmsProductAttributeByProdId" parameterType="Long">
delete from wms_product_attribute where product_id = #{prodId}
</delete>
<!--订单选择产品 -->
<select id="selectWmsProductAttributeByProdId" resultMap="WmsProductAttributeResult">
select pa.* from wms_product_attribute pa
<where>
pa.del_flag="0"
and pa.product_id = #{prodId}
</where>
order by pa.create_time desc
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment