Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 5 months ago
parent
commit
752ddeb93a
  1. 232
      ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html
  2. 172
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html
  3. 173
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html
  4. 173
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

232
ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html

@ -180,7 +180,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">报价币种:</label> <label class="col-sm-3 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>
<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>
@ -189,7 +189,7 @@
<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 is-required">美元汇率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required /> <input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" disabled />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -197,7 +197,7 @@
<div class="col-sm-8"> <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="${'confirmTax_' + dict.dictCode}" <input required type="radio" th:id="${'confirmTax_' + dict.dictCode}"
name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}"> name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}" th:disabled="${dict.default ? 'disabled' : ''}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -205,7 +205,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">税率:</label> <label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="taxRate" id="taxRate_edit" th:field="*{taxRate}" class="form-control" type="number"> <input name="taxRate" id="taxRate_edit" th:field="*{taxRate}" class="form-control" type="number" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -213,7 +213,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}"> <div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<input required type="radio" th:id="${'invoice_' + dict.dictCode}" <input required type="radio" th:id="${'invoice_' + dict.dictCode}"
name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}"> name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}" th:disabled="${dict.default ? 'disabled' : ''}">
<label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -221,19 +221,19 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label> <label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="paymentTerms" th:field="*{paymentTerms}" class="form-control" type="text"> <input name="paymentTerms" th:field="*{paymentTerms}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交货方式:</label> <label class="col-sm-3 control-label">交货方式:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deliveryMethod" th:field="*{deliveryMethod}" class="form-control" type="text"> <input name="deliveryMethod" th:field="*{deliveryMethod}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交货条件:</label> <label class="col-sm-3 control-label">交货条件:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deliveryConditions" th:field="*{deliveryConditions}" class="form-control" type="text"> <input name="deliveryConditions" th:field="*{deliveryConditions}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -249,7 +249,7 @@
<label class="col-sm-3 control-label">客户验收时间:</label> <label class="col-sm-3 control-label">客户验收时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="modificationTime" th:field="*{modificationTime}" class="form-control" placeholder="yyyy-mm-dd" type="text" /> <input name="modificationTime" th:field="*{modificationTime}" class="form-control" placeholder="yyyy-mm-dd" type="text" disabled/>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -257,57 +257,47 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label> <label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}"></textarea> <textarea name="tradeClause" class="form-control" th:field="*{tradeClause}" disabled></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label> <label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea> <textarea name="remark" class="form-control" th:field="*{remark}" disabled></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">业务员:</label> <label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="businessMembers" class="form-control m-b" th:field="*{businessMembers}" required> <input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" disabled>
</select>
</div> </div>
</div> </div>
<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="materialSum" id="enterprise_edit" type="number" th:field="*{materialSum}" readonly/> <label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="materialSum" type="number" th:field="*{materialSum}" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" th:field="*{enterpriseSum}" readonly/> <label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum"type="number" th:field="*{enterpriseSum}" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbPrice" id="noRmb_edit" type="number" th:field="*{noRmbPrice}" readonly/> <label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbPrice" type="number" th:field="*{noRmbPrice}" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" type="number" th:field="*{noRmbSum}" readonly/> <label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" type="number" th:field="*{noRmbSum}" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmbPrice" id="rmb_edit" type="number" th:field="*{rmbPrice}" readonly/> <label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmbPrice" type="number" th:field="*{rmbPrice}" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" id="rmbTax_edit" type="number" th:field="*{rmbTaxSum}" readonly/> <label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" type="number" th:field="*{rmbTaxSum}" readonly/>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-4" name="noUsdPrice" id="noUsd_edit" type="number" th:field="*{noUsdPrice}" readonly/> <label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-4" name="noUsdPrice" type="number" th:field="*{noUsdPrice}" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" type="number" th:field="*{noUsdSum}" readonly/> <label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" type="number" th:field="*{noUsdSum}" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-4" name="usdPrice" id="usd_edit" type="number" th:field="*{usdPrice}" readonly/> <label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-4" name="usdPrice" type="number" th:field="*{usdPrice}" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdTaxSum" id="usdSum_edit" type="number" th:field="*{usdTaxSum}" readonly/> <label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdTaxSum" type="number" th:field="*{usdTaxSum}" readonly/>
</div> </div>
</div> </div>
</form> </form>
<div class="other-container"> <div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder"></table> <table id="bootstrap-sub-table-editOrder"></table>
@ -334,142 +324,59 @@
var options = { var options = {
id:'bootstrap-sub-table-editOrder', id:'bootstrap-sub-table-editOrder',
url: ctx + "system/orderChild/list", url: ctx + "system/orderChild/list",
pagination: false,
queryParams: queryParams, queryParams: queryParams,
sidePagination: "client", sidePagination: "client",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
model: "物料报价信息", model: "物料报价信息",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{field: 'index',align: 'center', title: "序号", {field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) { formatter: function (value, row, index,column) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index)); return $.table.serialNumber(index) - 1;
return columnIndex + $.table.serialNumber(index);
} }
}, },
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl', {title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);} },
formatter: function(value, row, index) { {title: '物料类型',field: 'materialType',align: 'center',formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'}, { title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center', { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}},
formatter: function(value, row, index) { {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
return $.table.selectDictLabel(sysUnitClassDatas, value); { title: '对外售价',field: 'materialSole'},
} {title: '国内税率',field: 'countTax',align: 'center'},
}, { title: '美元汇率',field: 'usdTax', align: 'center'},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',editable: true},
{title: '国内税率',field: 'countTax',align: 'center',editable: true},
{ title: '美元汇率',field: 'usdTax', align: 'center',editable: true},
{field: 'materialNum',align: 'center',title: '物料的数量',editable: true},
{ title: '物料的不含税单价(RMB)', { title: '物料的不含税单价(RMB)',
field: 'materialNoRmb', field: 'materialNoRmb',
align: 'center', align: 'center'
editable: function(value, row, index) {
var commonCurrency3 = $("#commonCurrency_edit option:selected").val();
if (commonCurrency3 == 1){
return true;
}else{
return false;
}
}
}, },
{ title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{field: 'materialNum',align: 'center',title: '物料的数量',
},
{title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '物料的不含税单价(美元)', {title: '物料的不含税单价(美元)',
field: 'materialNoUsd', field: 'materialNoUsd',
align: 'center', align: 'center',
editable: function(value, row, index) {
var commonCurrency2= $("#commonCurrency_edit option:selected").val();
if (commonCurrency2 == 2){
return true;
}else{
return false;
}
}
},
{ title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'},
{ title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'},
{ title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center'},
{ title: '物料的含税总价(RMB)',field: 'materialNoRmbSum', align: 'center'},
{ title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'},
{ title: '计划交付时间',field: 'deliveryTime',align: 'center',
editable: {type: 'date',title: '计划交付时间',format: 'yyyy-mm-dd', emptytext: "计划交付时间",
formatter: function (value, row, index) {
return value;
}}
}, },
{title: '质保天数',align: 'center',field: 'expiryDay',formatter: function(value, row, index){ { title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center',},
return value + "天数"; { title: '物料的含税总价(美元)',field: 'materialUsdSum', align: 'center',},
}, { title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center',},
{ title: '计划交付时间',field: 'deliveryTime',align: 'center' },
{title: '质保天数',align: 'center',field: 'expiryDay',
}, },
{title:'已完成数'},{title: '已出货数'},{title: '已出库数'},{title: '已收货数'},{title: '已验收数'}, {field: 'remark',align: 'center',title: '备注',},
{ title: '录入人',field: 'createBy',align: 'center',visible: false}, {field: 'auditStatus',align: 'center',title: '审核状态',visible: false,
{ title: '录入时间',field: 'createTime',align: 'center',visible: false},
{ title: '更新人',field: 'updateBy',align: 'center',visible: false},
{ title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{ title: '备注',field: 'remark',align: 'center', visible: false },
{ title: '审核状态',field: 'auditStatus',align: 'center',visible: false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
}, },
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
], ],
onEditableSave:function(field, row, oldValue, $el){
var commonCurrency1 = $("#commonCurrency_edit option:selected").val();
var rmb1 = $("#taxRate_edit").val();
if (rmb1 =='' || rmb1== null){
rmb1 = 0;
}else{
rmb1 = $("#taxRate_edit").val();
}
var rmb = Number(rmb1).toFixed(2) / 100;
var usd = $("#usdTax_edit").val();
if (usd =='' || usd== null){
usd = 0;
}else{
usd = Number(usd).toFixed(2);
}
if(commonCurrency1 == 1){
row.materialNoRmb = Number(row.materialNoRmb).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * Number(1 + rmb));
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
row.materialNoUsd = Number(row.materialNoRmb / usd).toFixed(2);
row.materialNoUsdSum = Number(row.materialNum * row.materialNoUsd).toFixed(2);
row.materialUsd = Number(row.materialNoUsd).toFixed(2)
row.materialUsdSum = Number(row.materialNum * Number(row.materialUsd)).toFixed(2);
}
else if( commonCurrency1 == 2){
row.materialNoUsd = Number(row.materialNoUsd).toFixed(2);
row.materialUsd = Number(row.materialNoUsd).toFixed(2);
row.materialUsdSum = Number(row.materialNum * row.materialUsd).toFixed(2);
row.materialNoUsdSum = Number(row.materialNoUsd * row.materialNum).toFixed(2);
row.materialNoRmb = Number(row.materialNoUsd * usd).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * (1 + rmb)).toFixed(2);
row.materialNoRmbSum = Number(row.materialNoRmb * row.materialNum).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
}
getTotalAmount()
},
}; };
$.table.init(options); $.table.init(options);
$.ajax({ $.ajax({
@ -693,46 +600,7 @@
} }
} }
} }
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
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;
$("input[name='materialSum']").val(0);
$("input[name='enterpriseSum']").val(0);
$("input[name='noRmbPrice']").val(0);
$("input[name='noRmbSum']").val(0);
$("input[name='rmbPrice']").val(0);
$("input[name='rmbTaxSum']").val(0);
$("input[name='noUsdPrice']").val(0);
$("input[name='noUsdSum']").val(0);
$("input[name='usdPrice']").val(0);
$("input[name='usdTaxSum']").val(0);
for(let i=0;i<getData.length;i++){
enterprise += 1;
enterpriseSum = parseInt(enterprise + getData[i].materialNum);
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);
}
$("input[name='materialSum']").val(enterprise);
$("input[name='enterpriseSum']").val(enterpriseSum);
$("input[name='noRmbPrice']").val(noRmb);
$("input[name='noRmbSum']").val(noRmbSum);
$("input[name='rmbPrice']").val(rmb);
$("input[name='rmbTaxSum']").val(rmbSum);
$("input[name='noUsdPrice']").val(noUsd);
$("input[name='noUsdSum']").val(noUsdSum);
$("input[name='usdPrice']").val(usd);
$("input[name='usdTaxSum']").val(usdSum);
}
$("input[name='pricingDate']").datetimepicker({ $("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
minView: "month", minView: "month",

172
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html

@ -261,31 +261,31 @@
<input class="col-sm-4" name="materialSum" <input class="col-sm-4" name="materialSum"
th:field="*{materialSum}" id="enterprise_edit" type="number" readonly /> th:field="*{materialSum}" id="enterprise_edit" type="number" readonly />
<label class=" col-sm-2">数量合计:</label> <label class=" col-sm-2">数量合计:</label>
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" readonly /> <input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label> <label class="col-sm-2"> 不含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" type="number" readonly />
<label class="col-sm-2"> 不含税总价:</label> <label class="col-sm-2"> 不含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" readonly/> <input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label> <label class="col-sm-2"> 含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" type="number" readonly />
<label class="col-sm-2"> 含税总价:</label> <label class="col-sm-2"> 含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label> <label class="col-sm-2">不含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" type="number" readonly />
<label class="col-sm-2">不含税总价:</label> <label class="col-sm-2">不含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label> <label class="col-sm-2">含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" type="number" readonly />
<label class="col-sm-2">含税总价:</label> <label class="col-sm-2">含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" type="number" readonly />
</div> </div>
</div> </div>
<div class="container"> <div class="container">
@ -294,11 +294,6 @@
</form> </form>
<div class="other-container"> <div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder1"></table> <table id="bootstrap-sub-table-editOrder1"></table>
@ -334,113 +329,49 @@
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{field: 'index',align: 'center', title: "序号", {field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) { formatter: function (value, row, index,column) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index)); return $.table.serialNumber(index) - 1;
return columnIndex + $.table.serialNumber(index);
} }
}, },
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl', {title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);} },
formatter: function(value, row, index) { {title: '物料类型',field: 'materialType',align: 'center',formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'}, { title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center', { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}},
formatter: function(value, row, index) { {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
return $.table.selectDictLabel(sysUnitClassDatas, value); { title: '对外售价',field: 'materialSole'},
} {title: '国内税率',field: 'countTax',align: 'center'},
}, { title: '美元汇率',field: 'usdTax', align: 'center'},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',editable: false},
{title: '国内税率',field: 'countTax',align: 'center',editable: false},
{ title: '美元汇率',field: 'usdTax', align: 'center',editable: false},
{title: '物料的数量',field: 'materialNum',align: 'center',editable: false},
{ title: '物料的不含税单价(RMB)', { title: '物料的不含税单价(RMB)',
field: 'materialNoRmb', field: 'materialNoRmb',
align: 'center', align: 'center'
editable: {
type: 'text', mode: 'inline', // 同样设定为行内编辑模式
enabled: function() {return false; },
options: {placeholder: '请输入USD单价...', maxlength: 10}
}
}, },
{ title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{field: 'materialNum',align: 'center',title: '物料的数量',
},
{title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '物料的不含税单价(美元)', {title: '物料的不含税单价(美元)',
field: 'materialNoUsd', field: 'materialNoUsd',
align: 'center', align: 'center',
editable: {
type: 'text', mode: 'inline', // 同样设定为行内编辑模式
enabled: function() {return false; },
options: {placeholder: '请输入USD单价...', maxlength: 10}
}
}, },
{ title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'}, { title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center',},
{ title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'}, { title: '物料的含税总价(美元)',field: 'materialUsdSum', align: 'center',},
{ title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center'}, { title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialNoRmbSum', align: 'center'}, { title: '计划交付时间',field: 'deliveryTime',align: 'center' },
{ title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'}, {title: '质保天数',align: 'center',field: 'expiryDay',
{ title: '录入人',field: 'createBy',align: 'center',visible: false}, },
{ title: '录入时间',field: 'createTime',align: 'center',visible: false}, {field: 'remark',align: 'center',title: '备注',},
{ title: '更新人',field: 'updateBy',align: 'center',visible: false}, {field: 'auditStatus',align: 'center',title: '审核状态',visible: false,
{ title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{ title: '备注',field: 'remark',align: 'center', visible: false },
{ title: '审核状态',field: 'auditStatus',align: 'center',visible: false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
}, },
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
], ],
onEditableSave:function(field, row, oldValue, $el){
var commonCurrency1 = $("#commonCurrency_edit option:selected").val();
var rmbRateInput = parseFloat($("#rmbTax_edit").val()) || 0;
var rmbRate = rmbRateInput / 100;
rmbRate = parseFloat(rmbRate.toFixed(2)); // 确保rmbRate转换为两位小数的浮点数
var usdRate = parseFloat($("#usdTax_edit").val()) || 0;
var testMaterialNum = parseFloat(row.materialNum) || 0;
if (commonCurrency1 === '1') {
// RMB为基准货币
row.materialRmb = (parseFloat(row.materialNoRmb) * (1 + rmbRate)).toFixed(2);
row.materialRmbSum = (parseFloat(row.materialRmb) * testMaterialNum).toFixed(2);
row.materialNoRmbSum = (parseFloat(row.materialNoRmb) * testMaterialNum).toFixed(2);
row.materialNoUsd = (parseFloat(row.materialNoRmb) / usdRate).toFixed(2);
row.materialUsd = row.materialNoUsd; // 保持一致,除非有特别的计算逻辑
row.materialUsdSum = (parseFloat(row.materialUsd) * testMaterialNum).toFixed(2);
row.materialNoUsdSum = (parseFloat(row.materialNoUsd) * testMaterialNum).toFixed(2);
} else if (commonCurrency1 === '2') {
// USD为基准货币
row.materialUsd = row.materialNoUsd
row.materialUsdSum = (parseFloat(row.materialUsd) * testMaterialNum).toFixed(2);
row.materialNoUsdSum = (parseFloat(row.materialNoUsd) * testMaterialNum).toFixed(2);
row.materialNoRmb = (parseFloat(row.materialNoUsd) * usdRate).toFixed(2);
row.materialRmb = (parseFloat(row.materialNoRmb) * (1 + rmbRate)).toFixed(2);
row.materialNoRmbSum = (parseFloat(row.materialNoRmb) * testMaterialNum).toFixed(2);
row.materialRmbSum = (parseFloat(row.materialRmb) * testMaterialNum).toFixed(2);
}
// 确保getTotalAmount函数存在且正确引用
if (typeof getTotalAmount === 'function') {
getTotalAmount();
}
},
}; };
$.table.init(options); $.table.init(options);
$.ajax({ $.ajax({
@ -631,44 +562,7 @@
minView: "month", minView: "month",
autoclose: true autoclose: true
}); });
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-editOrder1").bootstrapTable('getData',true);
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;
enterprise = getData.length; // 直接获取数据长度
enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
for(var 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;
}
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='materialSum']").val(enterprise);
$("input[name='enterpriseSum']").val(enterpriseSum);
$("input[name='noRmbPrice']").val(noRmb);
$("input[name='noRmbSum']").val(noRmbSum);
$("input[name='rmbPrice']").val(rmb);
$("input[name='rmbTaxSum']").val(rmbSum);
$("input[name='noUsdPrice']").val(noUsd);
$("input[name='noUsdSum']").val(noUsdSum);
$("input[name='usdPrice']").val(usd);
$("input[name='usdTaxSum']").val(usdSum);
}
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("select[name='salesOrderType']").removeAttr("disabled"); $("select[name='salesOrderType']").removeAttr("disabled");

173
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html

@ -261,31 +261,31 @@
<input class="col-sm-4" name="materialSum" <input class="col-sm-4" name="materialSum"
th:field="*{materialSum}" id="enterprise_edit" type="number" readonly /> th:field="*{materialSum}" id="enterprise_edit" type="number" readonly />
<label class=" col-sm-2">数量合计:</label> <label class=" col-sm-2">数量合计:</label>
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" readonly /> <input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label> <label class="col-sm-2"> 不含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" type="number" readonly />
<label class="col-sm-2"> 不含税总价:</label> <label class="col-sm-2"> 不含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" readonly/> <input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label> <label class="col-sm-2"> 含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" type="number" readonly />
<label class="col-sm-2"> 含税总价:</label> <label class="col-sm-2"> 含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label> <label class="col-sm-2">不含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" type="number" readonly />
<label class="col-sm-2">不含税总价:</label> <label class="col-sm-2">不含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label> <label class="col-sm-2">含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" type="number" readonly />
<label class="col-sm-2">含税总价:</label> <label class="col-sm-2">含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" type="number" readonly />
</div> </div>
</div> </div>
<div class="container"> <div class="container">
@ -293,11 +293,6 @@
</div> </div>
</form> </form>
<div class="other-container"> <div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder2"></table> <table id="bootstrap-sub-table-editOrder2"></table>
@ -331,113 +326,48 @@
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{field: 'index',align: 'center', title: "序号", {field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) { formatter: function (value, row, index,column) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index)); return $.table.serialNumber(index) - 1;
return columnIndex + $.table.serialNumber(index);
} }
}, },
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl', {title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);} },
formatter: function(value, row, index) { {title: '物料类型',field: 'materialType',align: 'center',formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'}, { title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center', { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}},
formatter: function(value, row, index) { {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
return $.table.selectDictLabel(sysUnitClassDatas, value); { title: '对外售价',field: 'materialSole'},
} {title: '国内税率',field: 'countTax',align: 'center'},
}, { title: '美元汇率',field: 'usdTax', align: 'center'},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',editable: false},
{title: '国内税率',field: 'countTax',align: 'center',editable: false},
{ title: '美元汇率',field: 'usdTax', align: 'center',editable: false},
{title: '物料的数量',field: 'materialNum',align: 'center',editable: false},
{ title: '物料的不含税单价(RMB)', { title: '物料的不含税单价(RMB)',
field: 'materialNoRmb', field: 'materialNoRmb',
align: 'center', align: 'center'
editable: {
type: 'text', mode: 'inline', // 同样设定为行内编辑模式
enabled: function() {return false; },
options: {placeholder: '请输入USD单价...', maxlength: 10}
}
}, },
{ title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{field: 'materialNum',align: 'center',title: '物料的数量',
},
{title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '物料的不含税单价(美元)', {title: '物料的不含税单价(美元)',
field: 'materialNoUsd', field: 'materialNoUsd',
align: 'center', align: 'center',
editable: {
type: 'text', mode: 'inline', // 同样设定为行内编辑模式
enabled: function() {return false; },
options: {placeholder: '请输入USD单价...', maxlength: 10}
}
}, },
{ title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'}, { title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center',},
{ title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'}, { title: '物料的含税总价(美元)',field: 'materialUsdSum', align: 'center',},
{ title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center'}, { title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialNoRmbSum', align: 'center'}, { title: '计划交付时间',field: 'deliveryTime',align: 'center' },
{ title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'}, {title: '质保天数',align: 'center',field: 'expiryDay',
{ title: '录入人',field: 'createBy',align: 'center',visible: false}, },
{ title: '录入时间',field: 'createTime',align: 'center',visible: false}, {field: 'remark',align: 'center',title: '备注',},
{ title: '更新人',field: 'updateBy',align: 'center',visible: false}, {field: 'auditStatus',align: 'center',title: '审核状态',visible: false,
{ title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{ title: '备注',field: 'remark',align: 'center', visible: false },
{ title: '审核状态',field: 'auditStatus',align: 'center',visible: false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
}, },
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
], ],
onEditableSave:function(field, row, oldValue, $el){
var commonCurrency1 = $("#commonCurrency_edit option:selected").val();
var rmbRateInput = parseFloat($("#rmbTax_edit").val()) || 0;
var rmbRate = rmbRateInput / 100;
rmbRate = parseFloat(rmbRate.toFixed(2)); // 确保rmbRate转换为两位小数的浮点数
var usdRate = parseFloat($("#usdTax_edit").val()) || 0;
var testMaterialNum = parseFloat(row.materialNum) || 0;
if (commonCurrency1 === '1') {
// RMB为基准货币
row.materialRmb = (parseFloat(row.materialNoRmb) * (1 + rmbRate)).toFixed(2);
row.materialRmbSum = (parseFloat(row.materialRmb) * testMaterialNum).toFixed(2);
row.materialNoRmbSum = (parseFloat(row.materialNoRmb) * testMaterialNum).toFixed(2);
row.materialNoUsd = (parseFloat(row.materialNoRmb) / usdRate).toFixed(2);
row.materialUsd = row.materialNoUsd; // 保持一致,除非有特别的计算逻辑
row.materialUsdSum = (parseFloat(row.materialUsd) * testMaterialNum).toFixed(2);
row.materialNoUsdSum = (parseFloat(row.materialNoUsd) * testMaterialNum).toFixed(2);
} else if (commonCurrency1 === '2') {
// USD为基准货币
row.materialUsd = row.materialNoUsd
row.materialUsdSum = (parseFloat(row.materialUsd) * testMaterialNum).toFixed(2);
row.materialNoUsdSum = (parseFloat(row.materialNoUsd) * testMaterialNum).toFixed(2);
row.materialNoRmb = (parseFloat(row.materialNoUsd) * usdRate).toFixed(2);
row.materialRmb = (parseFloat(row.materialNoRmb) * (1 + rmbRate)).toFixed(2);
row.materialNoRmbSum = (parseFloat(row.materialNoRmb) * testMaterialNum).toFixed(2);
row.materialRmbSum = (parseFloat(row.materialRmb) * testMaterialNum).toFixed(2);
}
// 确保getTotalAmount函数存在且正确引用
if (typeof getTotalAmount === 'function') {
getTotalAmount();
}
},
}; };
$.table.init(options); $.table.init(options);
$.ajax({ $.ajax({
@ -628,44 +558,7 @@
minView: "month", minView: "month",
autoclose: true autoclose: true
}); });
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-editOrder2").bootstrapTable('getData',true);
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;
enterprise = getData.length; // 直接获取数据长度
enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
for(var 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;
}
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='materialSum']").val(enterprise);
$("input[name='enterpriseSum']").val(enterpriseSum);
$("input[name='noRmbPrice']").val(noRmb);
$("input[name='noRmbSum']").val(noRmbSum);
$("input[name='rmbPrice']").val(rmb);
$("input[name='rmbTaxSum']").val(rmbSum);
$("input[name='noUsdPrice']").val(noUsd);
$("input[name='noUsdSum']").val(noUsdSum);
$("input[name='usdPrice']").val(usd);
$("input[name='usdTaxSum']").val(usdSum);
}
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

173
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

@ -261,31 +261,31 @@
<input class="col-sm-4" name="materialSum" <input class="col-sm-4" name="materialSum"
th:field="*{materialSum}" id="enterprise_edit" type="number" readonly /> th:field="*{materialSum}" id="enterprise_edit" type="number" readonly />
<label class=" col-sm-2">数量合计:</label> <label class=" col-sm-2">数量合计:</label>
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" readonly /> <input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label> <label class="col-sm-2"> 不含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" type="number" readonly />
<label class="col-sm-2"> 不含税总价:</label> <label class="col-sm-2"> 不含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" readonly/> <input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label> <label class="col-sm-2"> 含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" type="number" readonly />
<label class="col-sm-2"> 含税总价:</label> <label class="col-sm-2"> 含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" readonly /> <input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label> <label class="col-sm-2">不含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" type="number" readonly />
<label class="col-sm-2">不含税总价:</label> <label class="col-sm-2">不含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" type="number" readonly />
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label> <label class="col-sm-2">含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" type="number" readonly />
<label class="col-sm-2">含税总价:</label> <label class="col-sm-2">含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" readonly /> <input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" type="number" readonly />
</div> </div>
</div> </div>
<div class="container"> <div class="container">
@ -293,11 +293,6 @@
</div> </div>
</form> </form>
<div class="other-container"> <div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder3"></table> <table id="bootstrap-sub-table-editOrder3"></table>
@ -332,113 +327,48 @@
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{field: 'index',align: 'center', title: "序号", {field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) { formatter: function (value, row, index,column) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index)); return $.table.serialNumber(index) - 1;
return columnIndex + $.table.serialNumber(index);
} }
}, },
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'}, {title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl', {title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);} },
formatter: function(value, row, index) { {title: '物料类型',field: 'materialType',align: 'center',formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'}, { title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center', { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}},
formatter: function(value, row, index) { {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
return $.table.selectDictLabel(sysUnitClassDatas, value); { title: '对外售价',field: 'materialSole'},
} {title: '国内税率',field: 'countTax',align: 'center'},
}, { title: '美元汇率',field: 'usdTax', align: 'center'},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',editable: false},
{title: '国内税率',field: 'countTax',align: 'center',editable: false},
{ title: '美元汇率',field: 'usdTax', align: 'center',editable: false},
{title: '物料的数量',field: 'materialNum',align: 'center',editable: false},
{ title: '物料的不含税单价(RMB)', { title: '物料的不含税单价(RMB)',
field: 'materialNoRmb', field: 'materialNoRmb',
align: 'center', align: 'center'
editable: {
type: 'text', mode: 'inline', // 同样设定为行内编辑模式
enabled: function() {return false; },
options: {placeholder: '请输入USD单价...', maxlength: 10}
}
}, },
{ title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{field: 'materialNum',align: 'center',title: '物料的数量',
},
{title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '物料的不含税单价(美元)', {title: '物料的不含税单价(美元)',
field: 'materialNoUsd', field: 'materialNoUsd',
align: 'center', align: 'center',
editable: {
type: 'text', mode: 'inline', // 同样设定为行内编辑模式
enabled: function() {return false; },
options: {placeholder: '请输入USD单价...', maxlength: 10}
}
}, },
{ title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'}, { title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center',},
{ title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'}, { title: '物料的含税总价(美元)',field: 'materialUsdSum', align: 'center',},
{ title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center'}, { title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center',},
{ title: '物料的含税总价(RMB)',field: 'materialNoRmbSum', align: 'center'}, { title: '计划交付时间',field: 'deliveryTime',align: 'center' },
{ title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'}, {title: '质保天数',align: 'center',field: 'expiryDay',
{ title: '录入人',field: 'createBy',align: 'center',visible: false}, },
{ title: '录入时间',field: 'createTime',align: 'center',visible: false}, {field: 'remark',align: 'center',title: '备注',},
{ title: '更新人',field: 'updateBy',align: 'center',visible: false}, {field: 'auditStatus',align: 'center',title: '审核状态',visible: false,
{ title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{ title: '备注',field: 'remark',align: 'center', visible: false },
{ title: '审核状态',field: 'auditStatus',align: 'center',visible: false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
}, },
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
], ],
onEditableSave:function(field, row, oldValue, $el){
var commonCurrency1 = $("#commonCurrency_edit option:selected").val();
var rmbRateInput = parseFloat($("#rmbTax_edit").val()) || 0;
var rmbRate = rmbRateInput / 100;
rmbRate = parseFloat(rmbRate.toFixed(2)); // 确保rmbRate转换为两位小数的浮点数
var usdRate = parseFloat($("#usdTax_edit").val()) || 0;
var testMaterialNum = parseFloat(row.materialNum) || 0;
if (commonCurrency1 === '1') {
// RMB为基准货币
row.materialRmb = (parseFloat(row.materialNoRmb) * (1 + rmbRate)).toFixed(2);
row.materialRmbSum = (parseFloat(row.materialRmb) * testMaterialNum).toFixed(2);
row.materialNoRmbSum = (parseFloat(row.materialNoRmb) * testMaterialNum).toFixed(2);
row.materialNoUsd = (parseFloat(row.materialNoRmb) / usdRate).toFixed(2);
row.materialUsd = row.materialNoUsd; // 保持一致,除非有特别的计算逻辑
row.materialUsdSum = (parseFloat(row.materialUsd) * testMaterialNum).toFixed(2);
row.materialNoUsdSum = (parseFloat(row.materialNoUsd) * testMaterialNum).toFixed(2);
} else if (commonCurrency1 === '2') {
// USD为基准货币
row.materialUsd = row.materialNoUsd
row.materialUsdSum = (parseFloat(row.materialUsd) * testMaterialNum).toFixed(2);
row.materialNoUsdSum = (parseFloat(row.materialNoUsd) * testMaterialNum).toFixed(2);
row.materialNoRmb = (parseFloat(row.materialNoUsd) * usdRate).toFixed(2);
row.materialRmb = (parseFloat(row.materialNoRmb) * (1 + rmbRate)).toFixed(2);
row.materialNoRmbSum = (parseFloat(row.materialNoRmb) * testMaterialNum).toFixed(2);
row.materialRmbSum = (parseFloat(row.materialRmb) * testMaterialNum).toFixed(2);
}
// 确保getTotalAmount函数存在且正确引用
if (typeof getTotalAmount === 'function') {
getTotalAmount();
}
},
}; };
$.table.init(options); $.table.init(options);
$.ajax({ $.ajax({
@ -629,44 +559,7 @@
minView: "month", minView: "month",
autoclose: true autoclose: true
}); });
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-editOrder3").bootstrapTable('getData',true);
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;
enterprise = getData.length; // 直接获取数据长度
enterpriseSum = getData.reduce((sum, item) => sum + (parseInt(item.materialNum) || 0), 0);
for(var 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;
}
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='materialSum']").val(enterprise);
$("input[name='enterpriseSum']").val(enterpriseSum);
$("input[name='noRmbPrice']").val(noRmb);
$("input[name='noRmbSum']").val(noRmbSum);
$("input[name='rmbPrice']").val(rmb);
$("input[name='rmbTaxSum']").val(rmbSum);
$("input[name='noUsdPrice']").val(noUsd);
$("input[name='noUsdSum']").val(noUsdSum);
$("input[name='usdPrice']").val(usd);
$("input[name='usdTaxSum']").val(usdSum);
}
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

Loading…
Cancel
Save