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

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

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

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

@ -14,13 +14,13 @@
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<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>
@ -29,7 +29,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>
@ -46,12 +46,10 @@
<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 class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}">
<option value="">请选择</option>
</select>
<input class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}">
</div>
</div>
<div class="form-group">
@ -69,7 +67,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">报价币种:</label>
<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 th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option>
</select>
@ -78,7 +76,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">美元汇率:</label>
<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 class="form-group">
@ -94,7 +92,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" readonly/>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
@ -116,7 +117,7 @@
<div class="container">
<h4 class="form-header h4">计算</h4>
<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/>
</div>
<div class="col-xs-12 form-row">
@ -174,6 +175,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-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>
@ -188,39 +190,6 @@
var sysCustomerQuote = [[${formData}]];
var prefix = ctx + "system/customerQuote"
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() {
var options = {
id: "bootstrap-table-Quote-child4",
@ -479,6 +448,24 @@
})
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({
format: "yyyy-mm-dd",
minView: "month",
@ -486,23 +473,24 @@
});
//计算
function getTotalAmount(){
let getData = $("#bootstrap-table-Quote-child4").bootstrapTable('getData', true);
var enterprise = "";
let getData = $("#bootstrap-table-Quote-child4").bootstrapTable('getData');
var 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);
enterprise += 1;
enterpriseSum = parseInt(enterprise + getData[i].materialNum).toFixed(0);
noRmb = parseFloat(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = parseFloat(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = parseFloat(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = parseFloat(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = parseFloat(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = parseFloat(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = parseFloat(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = parseFloat(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_edit").val(enterprise);
$("#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>
</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 class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}">
<option value="">请选择</option>
</select>
<input class="form-control" name="businessMembers" th:field="*{businessMembers}" disabled required />
</div>
</div>
<div class="form-group">
@ -174,6 +173,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-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>
@ -490,28 +490,43 @@
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);
// 计算企业数量和物料数量总和
enterprise = getData.length; // 直接获取数据长度
enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
// 先累加数值,toFixed在累加后应用以避免精度损失
for (let i = 0; i < getData.length; i++) {
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);
}
function submitHandler() {
if ($.validate.form()) {

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

@ -175,6 +175,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-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>
@ -188,35 +189,6 @@
var prefix = ctx + "system/customerQuote"
var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#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() {
var options = {
id: "bootstrap-table-Quote-child5",
@ -423,28 +395,43 @@
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);
// 计算企业数量和物料数量总和
enterprise = getData.length; // 直接获取数据长度
enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
// 先累加数值,toFixed在累加后应用以避免精度损失
for (let i = 0; i < getData.length; i++) {
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);
}
function submitHandler() {

Loading…
Cancel
Save