Browse Source

修复:客户报价业务经理审核页面,报价计算有误。

dev
zhangsiqi 4 months ago
parent
commit
31cb50140e
  1. 89
      ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html
  2. 27
      ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html
  3. 22
      ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html
  4. 172
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html
  5. 100
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html
  6. 65
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html
  7. 87
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

89
ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html

@ -145,6 +145,7 @@
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]]; var userName = [[${@permission.getPrincipalProperty('userName')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "system/customerQuote"; var prefix = ctx + "system/customerQuote";
var commonCurrency = $("#commonCurrency_add option:selected").val(); var commonCurrency = $("#commonCurrency_add option:selected").val();
$("#form-customerQuote-add").validate({focusCleanup: true}); $("#form-customerQuote-add").validate({focusCleanup: true});
@ -166,11 +167,9 @@
} }
} }
} }
//获取客户信息
// 监听客户编号下拉框的变化
// 监听客户编号下拉框的变化 $('#customerCode').on('change', function() {
$('#customerCode').on('change', function() {
var selectedCustomerCode = $(this).val(); // 获取选中的客户ID var selectedCustomerCode = $(this).val(); // 获取选中的客户ID
if (selectedCustomerCode) { if (selectedCustomerCode) {
// 发起Ajax请求获取客户名称 // 发起Ajax请求获取客户名称
@ -208,14 +207,12 @@
$('input[name="customerName"]').val(''); $('input[name="customerName"]').val('');
} }
}); });
$(document).ready(function() { $(document).ready(function() {
// 初始化时默认加载客户编号列表 // 初始化时默认加载客户编号列表
loadCustomerIds(); loadCustomerIds();
}); });
// 假设的加载客户编号列表函数 // 假设的加载客户编号列表函数
function loadCustomerIds() { function loadCustomerIds() {
var url = ctx + 'system/customer/getCustomers'; var url = ctx + 'system/customer/getCustomers';
$.ajax({ $.ajax({
type: 'GET', // 请求类型 type: 'GET', // 请求类型
@ -245,9 +242,6 @@
} }
}); });
} }
//添加收款明细 //添加收款明细
function insertNoMaterialNoRow() { function insertNoMaterialNoRow() {
// 生成一个简单的唯一标识,这里使用时间戳作为示例 // 生成一个简单的唯一标识,这里使用时间戳作为示例
@ -270,8 +264,6 @@
} }
$(function() { $(function() {
var options = { var options = {
id:'bootstrap-sub-table-quoteChild', id:'bootstrap-sub-table-quoteChild',
@ -544,46 +536,51 @@
// 可以选择取消这次编辑操作,但Bootstrap Table默认不会提供直接的API来取消编辑后的保存,您可能需要手动恢复数据或采取其他策略。 // 可以选择取消这次编辑操作,但Bootstrap Table默认不会提供直接的API来取消编辑后的保存,您可能需要手动恢复数据或采取其他策略。
} }
}); });
// 初始化时也需要根据当前的货币类型设置一次 // 初始化时也需要根据当前的货币类型设置一次
$("#commonCurrency_add").trigger('change'); $("#commonCurrency_add").trigger('change');
getBusinessMembers();
getCustomerCode();
}); });
//获取单号 function getCustomerCode(){
$.ajax({ //获取单号
url: prefix + "/getId", $.ajax({
type: "post", url: prefix + "/getId",
dateType: "json", type: "post",
success: function (resp) { dateType: "json",
if (resp.code === 0) { success: function (resp) {
$("input[name='supplierCode']").val(resp.data); if (resp.code === 0) {
} else { $("input[name='supplierCode']").val(resp.data);
$.modal.msgError("失败啦"); } else {
$.modal.msgError("失败啦");
}
},
error: function () {
$.modal.msgError("后台出错啦!");
} }
}, });
error: function () { }
$.modal.msgError("后台出错啦!"); function getBusinessMembers(){
} /*业务员列表*/
}); $.ajax({
/*业务员列表*/ url: ctx + 'system/salesOrder/getBinessMembers',
$.ajax({ type: 'get',
url: ctx + 'system/salesOrder/getBinessMembers', success: function (res) {
type: 'get', console.log(res)
success: function (res) { if (res.rows.length > 0) {
console.log(res) var usertData = res.rows;
if (res.rows.length > 0) { //alert(JSON.stringify(data));
var usertData = res.rows; for (let i in usertData) {
//alert(JSON.stringify(data)); // console.log(finishProductData[i].finishProductCode)
for (let i in usertData) { $("#form-customerQuote-add select[name='businessMembers']").append(
// console.log(finishProductData[i].finishProductCode) "<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
$("#form-customerQuote-add select[name='businessMembers']").append( }
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); $("#form-customerQuote-add select[name='businessMembers']").val(loginName).trigger("change");
} else {
$.modal.msgError(res.msg);
} }
$("#form-customerQuote-add select[name='businessMembers']").val(userName).trigger("change");
} else {
$.modal.msgError(res.msg);
} }
} });
}); }
function doSubmit(index, layero,uniqueId){ function doSubmit(index, layero,uniqueId){
console.log(uniqueId); console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];

27
ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html

@ -70,7 +70,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">国内税率:</label> <label class="col-sm-4 control-label">国内税率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="rmbTax" th:field="*{rmbTax}" id="rmbTax_edit" class="form-control" type="number" placeholder="13%" disabled/> <div class="input-group">
<input name="rmbTax" id="rmbTax_edit" th:field="*{rmbTax}" class="form-control" placeholder="13" disabled/>
<span class="input-group-addon">%</span>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -142,28 +145,6 @@
var commonCurrency = $("#commonCurrency_edit option:selected").val(); var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#form-customerQuote-edit").validate({focusCleanup: true}); $("#form-customerQuote-edit").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;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-customerQuote-detail select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" +
usertData[i].userName + "</option>");
}
$("#form-customerQuote-detail select[name='businessMembers']").val(sysCustomerQuote.businessMembers);
} else {
$.modal.msgError(res.msg);
}
}
});
});
$(function() { $(function() {
var options = { var options = {
id: "bootstrap-table-Quote-child-detail", id: "bootstrap-table-Quote-child-detail",

22
ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html

@ -466,22 +466,22 @@
//计算 //计算
function getTotalAmount(){ function getTotalAmount(){
let getData = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData', true); let getData = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData', true);
var enterprise = ""; var enterprise = 0;
let enterpriseSum = 0; let enterpriseSum = 0;
let noRmb = 0;let rmb = 0;let noRmbSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0;
let rmbSum = 0;let noUsd = 0;let usd = 0; let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0; let noUsdSum = 0;let usdSum = 0;
for(var i=0;i<getData.length;i++){ for(var i=0;i<getData.length;i++){
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; enterprise += 1;
enterpriseSum += Number(getData[i].materialNum); enterpriseSum = parseInt(enterprise + getData[i].materialNum).toFixed(0);
noRmb += Number(getData[i].materialNoRmb); noRmb = parseFloat(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb += Number(getData[i].materialRmb) ; rmb = parseFloat(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum += Number(getData[i].materialNoRmbSum); noRmbSum = parseFloat(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum += Number(getData[i].materialRmbSum); rmbSum = parseFloat(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd += Number(getData[i].materialNoUsd) ; noUsd = parseFloat(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd += Number(getData[i].materialUsd) ; usd = parseFloat(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum += Number(getData[i].materialNoUsdSum); noUsdSum = parseFloat(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum += Number(getData[i].materialUsdSum); usdSum = parseFloat(usdSum + getData[i].materialUsdSum).toFixed(2);
} }
$("#enterprise_edit").val(enterprise); $("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum); $("#enterpriseSum_edit").val(enterpriseSum);

172
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html

@ -2,7 +2,9 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head> <head>
<th:block th:include="include :: header('驳回调整')" /> <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 :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> <link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/>
</head> </head>
<body class="white-bg"> <body class="white-bg">
@ -16,13 +18,13 @@
<!--驳回调整允许更新内容--> <!--驳回调整允许更新内容-->
<input type="hidden" name="saveEntity" value="true" /> <input type="hidden" name="saveEntity" value="true" />
<div class="form-group"> <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="col-sm-8">
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> <input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <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="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
@ -31,7 +33,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <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="col-sm-8">
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> <input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div> </div>
@ -48,12 +50,11 @@
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly> <input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="form-group">
<label class="col-sm-4 control-label">业务员:</label> <label class="col-sm-4 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select readonly class="form-control" name="businessMembers" required th:field="*{businessMembers}"> <input class="form-control" name="businessMembers" th:field="*{businessMembers}" readonly>
<option value="">请选择</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -84,8 +85,8 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-6 control-label is-required">是否含税:</label> <label class="col-sm-4 control-label is-required">是否含税:</label>
<div class="col-sm-6"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> <div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}" <input required type="radio" th:id="${'confirmFax_' + dict.dictCode}"
name="confirmFax" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}"> name="confirmFax" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
@ -96,7 +97,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">国内税率:</label> <label class="col-sm-4 control-label">国内税率:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
@ -170,6 +174,9 @@
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <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="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script> <script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> <script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
@ -184,39 +191,16 @@
var sysCustomerQuote = [[${formData}]]; var sysCustomerQuote = [[${formData}]];
var prefix = ctx + "system/customerQuote" var prefix = ctx + "system/customerQuote"
var commonCurrency = $("#commonCurrency_edit option:selected").val(); var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#form-customerQuote-modify").validate({ var businessMembers = [[${formData.businessMembers}]];
focusCleanup: true, var confirmFax = $("input[name='confirmFax']");
}); $("#form-customerQuote-modify").validate({ focusCleanup: true});
$(function() { confirmFax.val([sysCustomerQuote.confirmFax]);
/*业务员列表*/ confirmFax.change(function () {
$.ajax({ if ($("input[name='confirmFax']").val() == "1") {
url: ctx + 'system/salesOrder/getBinessMembers', $("input[name='rmbTax']").val(sysCustomerQuote.taxRate);
type: 'get', } else {
success: function (res) { $("input[name='rmbTax']").val(0);
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');
}); });
$(function() { $(function() {
var options = { var options = {
@ -410,6 +394,25 @@
}; };
$.table.init(options); $.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) { function queryParams(params) {
var curParams = { var curParams = {
// 传递参数查询参数 // 传递参数查询参数
@ -422,11 +425,7 @@
} }
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
var formData = $("#form-customerQuote-modify").serializeArray();
console.log("formData",formData);
var tableData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData'); var tableData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData');
console.log("tableData",JSON.stringify(tableData));
var rows = tableData.length;
var materialType = $('#selectMaterialType').select2('val'); var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType); $('#materialType').val(materialType);
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {
@ -495,43 +494,66 @@
}); });
getTotalAmount(); getTotalAmount();
} }
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//计算 //计算
function getTotalAmount(){ function getTotalAmount(){
let getData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData', true); let getData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData', true);
var enterprise = ""; let enterprise = 0;
let enterpriseSum = 0; let enterpriseSum = 0;
let noRmb = 0;let rmb = 0;let noRmbSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0;
let rmbSum = 0;let noUsd = 0;let usd = 0; let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0; let noUsdSum = 0;let usdSum = 0;
for(var i=0;i<getData.length;i++){ $("input[name='enterprise']").val(0);
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; $("input[name='enterpriseSum']").val(0);
enterpriseSum += Number(getData[i].materialNum); $("input[name='noRmb']").val(0);
noRmb += Number(getData[i].materialNoRmb); $("input[name='noRmbSum']").val(0);
rmb += Number(getData[i].materialRmb) ; $("input[name='rmb']").val(0);
noRmbSum += Number(getData[i].materialNoRmbSum); $("input[name='rmbSum']").val(0);
rmbSum += Number(getData[i].materialRmbSum); $("input[name='noUsd']").val(0);
noUsd += Number(getData[i].materialNoUsd) ; $("input[name='noUsdSum']").val(0);
usd += Number(getData[i].materialUsd) ; $("input[name='usd']").val(0);
noUsdSum += Number(getData[i].materialNoUsdSum); $("input[name='usdSum']").val(0);
usdSum += Number(getData[i].materialUsdSum); // 计算企业数量和物料数量总和
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> </script>
</body> </body>
</html> </html>

100
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html

@ -14,13 +14,13 @@
<input name="instanceType" th:field="*{instanceType}" type="hidden"> <input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" /> <input type="hidden" name="p_COM_comment" />
<div class="form-group"> <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="col-sm-8">
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> <input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <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="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
@ -29,7 +29,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <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="col-sm-8">
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> <input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly>
</div> </div>
@ -46,12 +46,10 @@
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly> <input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="form-group">
<label class="col-sm-4 control-label">业务员:</label> <label class="col-sm-4 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}"> <input class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}">
<option value="">请选择</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -69,7 +67,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">报价币种:</label> <label class="col-sm-4 control-label">报价币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" id="commonCurrency_edit" name="commonCurrency" th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required> <select class="form-control" id="commonCurrency_edit" name="commonCurrency" th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" disabled required>
<option value="">请选择</option> <option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> <option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option>
</select> </select>
@ -78,7 +76,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">美元汇率:</label> <label class="col-sm-4 control-label">美元汇率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="usdTax" th:field="*{usdTax}" id="usdTax_edit" class="form-control" type="number" placeholder="美元对人民币汇率"> <input name="usdTax" th:field="*{usdTax}" id="usdTax_edit" class="form-control" type="number" placeholder="美元对人民币汇率" readonly/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -94,7 +92,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">国内税率:</label> <label class="col-sm-4 control-label">国内税率:</label>
<div class="col-sm-8"> <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" readonly/>
<span class="input-group-addon">%</span>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -116,7 +117,7 @@
<div class="container"> <div class="container">
<h4 class="form-header h4">计算</h4> <h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="enterprise" id="enterprise_edit" type="text" readonly/> <label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="enterprise" id="enterprise_edit" type="number" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/> <label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
@ -174,6 +175,7 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/activiti.js}"></script> <script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script> <script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> <script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
@ -188,39 +190,6 @@
var sysCustomerQuote = [[${formData}]]; var sysCustomerQuote = [[${formData}]];
var prefix = ctx + "system/customerQuote" var prefix = ctx + "system/customerQuote"
var commonCurrency = $("#commonCurrency_edit option:selected").val(); var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#form-customerQuote-ywjl").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-ywjl select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-customerQuote-ywjl 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');
});
$(function() { $(function() {
var options = { var options = {
id: "bootstrap-table-Quote-child4", id: "bootstrap-table-Quote-child4",
@ -479,6 +448,24 @@
}) })
getTotalAmount(); getTotalAmount();
} }
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-ywjl select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-customerQuote-ywjl select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
});
}
$("input[name='pricingDate']").datetimepicker({ $("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
minView: "month", minView: "month",
@ -486,23 +473,24 @@
}); });
//计算 //计算
function getTotalAmount(){ function getTotalAmount(){
let getData = $("#bootstrap-table-Quote-child4").bootstrapTable('getData', true); let getData = $("#bootstrap-table-Quote-child4").bootstrapTable('getData');
var enterprise = ""; var enterprise = 0;
let enterpriseSum = 0; let enterpriseSum = 0;
let noRmb = 0;let rmb = 0;let noRmbSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0;
let rmbSum = 0;let noUsd = 0;let usd = 0; let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0; let noUsdSum = 0;let usdSum = 0;
for(var i=0;i<getData.length;i++){ for(var i=0;i<getData.length;i++){
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; enterprise += 1;
enterpriseSum += Number(getData[i].materialNum); enterpriseSum = parseInt(enterprise + getData[i].materialNum).toFixed(0);
noRmb += Number(getData[i].materialNoRmb); noRmb = parseFloat(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb += Number(getData[i].materialRmb) ; rmb = parseFloat(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum += Number(getData[i].materialNoRmbSum); noRmbSum = parseFloat(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum += Number(getData[i].materialRmbSum); rmbSum = parseFloat(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd += Number(getData[i].materialNoUsd) ; noUsd = parseFloat(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd += Number(getData[i].materialUsd) ; usd = parseFloat(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum += Number(getData[i].materialNoUsdSum); noUsdSum = parseFloat(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum += Number(getData[i].materialUsdSum); usdSum = parseFloat(usdSum + getData[i].materialUsdSum).toFixed(2);
} }
$("#enterprise_edit").val(enterprise); $("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum); $("#enterpriseSum_edit").val(enterpriseSum);

65
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html

@ -46,12 +46,11 @@
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly> <input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="col-xs-12"> <div class="form-group">
<label class="col-sm-4 control-label">业务员:</label> <label class="col-sm-4 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}"> <input class="form-control" name="businessMembers" th:field="*{businessMembers}" disabled required />
<option value="">请选择</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -174,6 +173,7 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/activiti.js}"></script> <script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script> <script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> <script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
@ -490,28 +490,43 @@
let noRmb = 0;let rmb = 0;let noRmbSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0;
let rmbSum = 0;let noUsd = 0;let usd = 0; let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0; let noUsdSum = 0;let usdSum = 0;
for(var i=0;i<getData.length;i++){ // 计算企业数量和物料数量总和
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; enterprise = getData.length; // 直接获取数据长度
enterpriseSum += Number(getData[i].materialNum); enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ; // 先累加数值,toFixed在累加后应用以避免精度损失
noRmbSum += Number(getData[i].materialNoRmbSum); for (let i = 0; i < getData.length; i++) {
rmbSum += Number(getData[i].materialRmbSum); noRmb += parseFloat(getData[i].materialNoRmb) || 0;
noUsd += Number(getData[i].materialNoUsd) ; rmb += parseFloat(getData[i].materialRmb) || 0;
usd += Number(getData[i].materialUsd) ; noRmbSum += parseFloat(getData[i].materialNoRmbSum) || 0;
noUsdSum += Number(getData[i].materialNoUsdSum); rmbSum += parseFloat(getData[i].materialRmbSum) || 0;
usdSum += Number(getData[i].materialUsdSum); 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); noRmb = noRmb.toFixed(2);
$("#rmb_edit").val(rmb); rmb = rmb.toFixed(2);
$("#noRmbSum_edit").val(noRmbSum); noRmbSum = noRmbSum.toFixed(2);
$("#rmbSum_edit").val(rmbSum); rmbSum = rmbSum.toFixed(2);
$("#noUsd_edit").val(noUsd); noUsd = noUsd.toFixed(2);
$("#usd_edit").val(usd); usd = usd.toFixed(2);
$("#noUsdSum_edit").val(noUsdSum); noUsdSum = noUsdSum.toFixed(2);
$("#usdSum_edit").val(usdSum); 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);
} }
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {

87
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

@ -175,6 +175,7 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/activiti.js}"></script> <script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script> <script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> <script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
@ -188,35 +189,6 @@
var prefix = ctx + "system/customerQuote" var prefix = ctx + "system/customerQuote"
var commonCurrency = $("#commonCurrency_edit option:selected").val(); var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#form-customerQuote-zozj").validate({focusCleanup: true}); $("#form-customerQuote-zozj").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-zozj select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-customerQuote-zozj select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
});
var confirmFax = $("input[name='confirmFax']");
confirmFax.val([sysCustomerQuote.confirmFax]).attr("checked", "check");
$("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);
}
});
});
$(function() { $(function() {
var options = { var options = {
id: "bootstrap-table-Quote-child5", id: "bootstrap-table-Quote-child5",
@ -423,28 +395,43 @@
let noRmb = 0;let rmb = 0;let noRmbSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0;
let rmbSum = 0;let noUsd = 0;let usd = 0; let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0; let noUsdSum = 0;let usdSum = 0;
for(var i=0;i<getData.length;i++){ // 计算企业数量和物料数量总和
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; enterprise = getData.length; // 直接获取数据长度
enterpriseSum += Number(getData[i].materialNum); enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ; // 先累加数值,toFixed在累加后应用以避免精度损失
noRmbSum += Number(getData[i].materialNoRmbSum); for (let i = 0; i < getData.length; i++) {
rmbSum += Number(getData[i].materialRmbSum); noRmb += parseFloat(getData[i].materialNoRmb) || 0;
noUsd += Number(getData[i].materialNoUsd) ; rmb += parseFloat(getData[i].materialRmb) || 0;
usd += Number(getData[i].materialUsd) ; noRmbSum += parseFloat(getData[i].materialNoRmbSum) || 0;
noUsdSum += Number(getData[i].materialNoUsdSum); rmbSum += parseFloat(getData[i].materialRmbSum) || 0;
usdSum += Number(getData[i].materialUsdSum); 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); noRmb = noRmb.toFixed(2);
$("#rmb_edit").val(rmb); rmb = rmb.toFixed(2);
$("#noRmbSum_edit").val(noRmbSum); noRmbSum = noRmbSum.toFixed(2);
$("#rmbSum_edit").val(rmbSum); rmbSum = rmbSum.toFixed(2);
$("#noUsd_edit").val(noUsd); noUsd = noUsd.toFixed(2);
$("#usd_edit").val(usd); usd = usd.toFixed(2);
$("#noUsdSum_edit").val(noUsdSum); noUsdSum = noUsdSum.toFixed(2);
$("#usdSum_edit").val(usdSum); 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);
} }
function submitHandler() { function submitHandler() {

Loading…
Cancel
Save