|
|
@ -2,7 +2,9 @@ |
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml"> |
|
|
|
<head> |
|
|
|
<th:block th:include="include :: header('驳回调整')" /> |
|
|
|
<th:block th:include="include :: datetimepicker-css" /> |
|
|
|
<th:block th:include="include :: select2-css" /> |
|
|
|
<th:block th:include="include :: bootstrap-editable-css" /> |
|
|
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
|
|
|
</head> |
|
|
|
<body class="white-bg"> |
|
|
@ -16,13 +18,13 @@ |
|
|
|
<!--驳回调整允许更新内容--> |
|
|
|
<input type="hidden" name="saveEntity" value="true" /> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">申请人:</label> |
|
|
|
<label class="col-sm-4 control-label">申请人:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">申请时间:</label> |
|
|
|
<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> |
|
|
@ -31,7 +33,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">标题:</label> |
|
|
|
<label class="col-sm-4 control-label">标题:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> |
|
|
|
</div> |
|
|
@ -48,12 +50,11 @@ |
|
|
|
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-4 control-label">业务员:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select readonly class="form-control" name="businessMembers" required th:field="*{businessMembers}"> |
|
|
|
<option value="">请选择</option> |
|
|
|
</select> |
|
|
|
<input class="form-control" name="businessMembers" th:field="*{businessMembers}" readonly> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
@ -84,8 +85,8 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-6 control-label is-required">是否含税:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<label class="col-sm-4 control-label is-required">是否含税:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> |
|
|
|
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}" |
|
|
|
name="confirmFax" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}"> |
|
|
@ -96,7 +97,10 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-4 control-label">国内税率:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="rmbTax" id="rmbTax_edit" th:field="*{rmbTax}" class="form-control" type="number" placeholder="13%" /> |
|
|
|
<div class="input-group"> |
|
|
|
<input name="rmbTax" id="rmbTax_edit" th:field="*{rmbTax}" class="form-control" placeholder="13" type="number" /> |
|
|
|
<span class="input-group-addon">%</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
@ -170,6 +174,9 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<th:block th:include="include :: select2-js" /> |
|
|
|
<th:block th:include="include :: datetimepicker-js" /> |
|
|
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|
|
|
<script th:src="@{/js/activiti.js}"></script> |
|
|
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
|
|
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
|
|
@ -184,39 +191,16 @@ |
|
|
|
var sysCustomerQuote = [[${formData}]]; |
|
|
|
var prefix = ctx + "system/customerQuote" |
|
|
|
var commonCurrency = $("#commonCurrency_edit option:selected").val(); |
|
|
|
$("#form-customerQuote-modify").validate({ |
|
|
|
focusCleanup: true, |
|
|
|
}); |
|
|
|
$(function() { |
|
|
|
/*业务员列表*/ |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/salesOrder/getBinessMembers', |
|
|
|
type: 'get', |
|
|
|
success: function (res) { |
|
|
|
console.log(res) |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("#form-customerQuote-modify select[name='businessMembers']").append("<option value='" |
|
|
|
+ usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
$("#form-customerQuote-modify select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
var confirmFax = $("input[name='confirmFax']"); |
|
|
|
confirmFax.val([sysCustomerQuote.confirmFax]); |
|
|
|
$("input[name='rmbTax']").val([sysCustomerQuote.taxRate]); |
|
|
|
confirmFax.change(function () { |
|
|
|
if ($("input[name='confirmFax']").val() == "1") { |
|
|
|
$("input[name='rmbTax']").val(sysCustomerQuote.taxRate); |
|
|
|
} else { |
|
|
|
$("input[name='rmbTax']").val(0); |
|
|
|
} |
|
|
|
}); |
|
|
|
$("#commonCurrency_edit").val(sysCustomerQuote.commonCurrency).trigger('change'); |
|
|
|
var businessMembers = [[${formData.businessMembers}]]; |
|
|
|
var confirmFax = $("input[name='confirmFax']"); |
|
|
|
$("#form-customerQuote-modify").validate({ focusCleanup: true}); |
|
|
|
confirmFax.val([sysCustomerQuote.confirmFax]); |
|
|
|
confirmFax.change(function () { |
|
|
|
if ($("input[name='confirmFax']").val() == "1") { |
|
|
|
$("input[name='rmbTax']").val(sysCustomerQuote.taxRate); |
|
|
|
} else { |
|
|
|
$("input[name='rmbTax']").val(0); |
|
|
|
} |
|
|
|
}); |
|
|
|
$(function() { |
|
|
|
var options = { |
|
|
@ -410,6 +394,25 @@ |
|
|
|
}; |
|
|
|
$.table.init(options); |
|
|
|
}); |
|
|
|
function getBuniessMembers(){ |
|
|
|
/*业务员列表*/ |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/salesOrder/getBinessMembers', |
|
|
|
type: 'get', |
|
|
|
success: function (res) { |
|
|
|
console.log(res) |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("#form-customerQuote-modify select[name='businessMembers']").append("<option value='" |
|
|
|
+ usertData[i].loginName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
function queryParams(params) { |
|
|
|
var curParams = { |
|
|
|
// 传递参数查询参数 |
|
|
@ -422,11 +425,7 @@ |
|
|
|
} |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
var formData = $("#form-customerQuote-modify").serializeArray(); |
|
|
|
console.log("formData",formData); |
|
|
|
var tableData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData'); |
|
|
|
console.log("tableData",JSON.stringify(tableData)); |
|
|
|
var rows = tableData.length; |
|
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
|
|
$('#materialType').val(materialType); |
|
|
|
if ($('textarea[name="comment"]').val()) { |
|
|
@ -495,43 +494,66 @@ |
|
|
|
}); |
|
|
|
getTotalAmount(); |
|
|
|
} |
|
|
|
$("input[name='pricingDate']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
//计算 |
|
|
|
function getTotalAmount(){ |
|
|
|
let getData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData', true); |
|
|
|
var enterprise = ""; |
|
|
|
let enterprise = 0; |
|
|
|
let enterpriseSum = 0; |
|
|
|
let noRmb = 0;let rmb = 0;let noRmbSum = 0; |
|
|
|
let rmbSum = 0;let noUsd = 0;let usd = 0; |
|
|
|
let noUsdSum = 0;let usdSum = 0; |
|
|
|
for(var i=0;i<getData.length;i++){ |
|
|
|
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; |
|
|
|
enterpriseSum += Number(getData[i].materialNum); |
|
|
|
noRmb += Number(getData[i].materialNoRmb); |
|
|
|
rmb += Number(getData[i].materialRmb) ; |
|
|
|
noRmbSum += Number(getData[i].materialNoRmbSum); |
|
|
|
rmbSum += Number(getData[i].materialRmbSum); |
|
|
|
noUsd += Number(getData[i].materialNoUsd) ; |
|
|
|
usd += Number(getData[i].materialUsd) ; |
|
|
|
noUsdSum += Number(getData[i].materialNoUsdSum); |
|
|
|
usdSum += Number(getData[i].materialUsdSum); |
|
|
|
$("input[name='enterprise']").val(0); |
|
|
|
$("input[name='enterpriseSum']").val(0); |
|
|
|
$("input[name='noRmb']").val(0); |
|
|
|
$("input[name='noRmbSum']").val(0); |
|
|
|
$("input[name='rmb']").val(0); |
|
|
|
$("input[name='rmbSum']").val(0); |
|
|
|
$("input[name='noUsd']").val(0); |
|
|
|
$("input[name='noUsdSum']").val(0); |
|
|
|
$("input[name='usd']").val(0); |
|
|
|
$("input[name='usdSum']").val(0); |
|
|
|
// 计算企业数量和物料数量总和 |
|
|
|
enterprise = getData.length; // 直接获取数据长度 |
|
|
|
// 先累加数值,toFixed在累加后应用以避免精度损失 |
|
|
|
for (let i = 0; i < getData.length; i++) { |
|
|
|
enterpriseSum += parseInt(getData[i].materialNum) || 0; |
|
|
|
noRmb += parseFloat(getData[i].materialNoRmb) || 0; |
|
|
|
rmb += parseFloat(getData[i].materialRmb) || 0; |
|
|
|
noRmbSum += parseFloat(getData[i].materialNoRmbSum) || 0; |
|
|
|
rmbSum += parseFloat(getData[i].materialRmbSum) || 0; |
|
|
|
noUsd += parseFloat(getData[i].materialNoUsd) || 0; |
|
|
|
usd += parseFloat(getData[i].materialUsd) || 0; |
|
|
|
noUsdSum += parseFloat(getData[i].materialNoUsdSum) || 0; |
|
|
|
usdSum += parseFloat(getData[i].materialUsdSum) || 0; |
|
|
|
} |
|
|
|
$("#enterprise_edit").val(enterprise); |
|
|
|
$("#enterpriseSum_edit").val(enterpriseSum); |
|
|
|
$("#noRmb_edit").val(noRmb); |
|
|
|
$("#rmb_edit").val(rmb); |
|
|
|
$("#noRmbSum_edit").val(noRmbSum); |
|
|
|
$("#rmbSum_edit").val(rmbSum); |
|
|
|
$("#noUsd_edit").val(noUsd); |
|
|
|
$("#usd_edit").val(usd); |
|
|
|
$("#noUsdSum_edit").val(noUsdSum); |
|
|
|
$("#usdSum_edit").val(usdSum); |
|
|
|
} |
|
|
|
|
|
|
|
// 将累加的结果格式化为两位小数 |
|
|
|
noRmb = noRmb.toFixed(2); |
|
|
|
rmb = rmb.toFixed(2); |
|
|
|
noRmbSum = noRmbSum.toFixed(2); |
|
|
|
rmbSum = rmbSum.toFixed(2); |
|
|
|
noUsd = noUsd.toFixed(2); |
|
|
|
usd = usd.toFixed(2); |
|
|
|
noUsdSum = noUsdSum.toFixed(2); |
|
|
|
usdSum = usdSum.toFixed(2); |
|
|
|
|
|
|
|
// 设置表单输入值 |
|
|
|
$("input[name='enterprise']").val(enterprise); |
|
|
|
$("input[name='enterpriseSum']").val(enterpriseSum); |
|
|
|
$("input[name='noRmb']").val(noRmb); |
|
|
|
$("input[name='noRmbSum']").val(noRmbSum); |
|
|
|
$("input[name='rmb']").val(rmb); |
|
|
|
$("input[name='rmbSum']").val(rmbSum); |
|
|
|
$("input[name='noUsd']").val(noUsd); |
|
|
|
$("input[name='noUsdSum']").val(noUsdSum); |
|
|
|
$("input[name='usd']").val(usd); |
|
|
|
$("input[name='usdSum']").val(usdSum); |
|
|
|
} |
|
|
|
$("input[name='pricingDate']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |