|
|
@ -12,9 +12,12 @@ |
|
|
|
</head> |
|
|
|
<body class="white-bg"> |
|
|
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
|
<form class="form-horizontal m" id="form-edit" th:object="${formData}"> |
|
|
|
<form class="form-horizontal m" id="form-modfify-audit" th:object="${formData}"> |
|
|
|
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden"> |
|
|
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
|
|
|
<input name="taskName" th:field="*{taskName}" type="hidden"> |
|
|
|
<input name="instanceId" th:field="*{instanceId}" type="hidden"> |
|
|
|
<input name="instanceType" th:field="*{instanceType}" type="hidden"> |
|
|
|
<!--驳回调整允许更新内容--> |
|
|
|
<input type="hidden" name="saveEntity" value="true" /> |
|
|
|
<div class="form-group"> |
|
|
@ -241,46 +244,58 @@ |
|
|
|
<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-2" name="materialSum" th:field="*{materialSum}" id="enterprise_edit" type="text" readonly/> |
|
|
|
<label class=" col-sm-2">数量合计:</label><input class="col-sm-2" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" readonly/> |
|
|
|
<label class=" col-sm-2">物料合计:</label> |
|
|
|
<input class="col-sm-4" name="materialSum" |
|
|
|
th:field="*{materialSum}" id="enterprise_edit" type="number" disabled /> |
|
|
|
<label class=" col-sm-2">数量合计:</label> |
|
|
|
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" disabled /> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" readonly/> |
|
|
|
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" th:field="*{noRmbTaxSum}" id="noRmbSum_edit" type="number" readonly/> |
|
|
|
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" readonly/> |
|
|
|
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="_edit" type="number" readonly/> |
|
|
|
<label class="col-sm-2"> 不含税单价:</label> |
|
|
|
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" disabled /> |
|
|
|
<label class="col-sm-2"> 不含税总价:</label> |
|
|
|
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" disabled /> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2"> 含税单价:</label> |
|
|
|
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" disabled /> |
|
|
|
<label class="col-sm-2"> 含税总价:</label> |
|
|
|
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" disabled /> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12"> |
|
|
|
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-3" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" readonly/> |
|
|
|
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-3" name="noUsdSum" th:field="*{noUsdTaxSum}" id="noUsdSum_edit" type="number"readonly/> |
|
|
|
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-3" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" readonly/> |
|
|
|
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-3" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number"readonly/> |
|
|
|
<label class="col-sm-2">不含税单价:</label> |
|
|
|
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" disabled /> |
|
|
|
<label class="col-sm-2">不含税总价:</label> |
|
|
|
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" disabled /> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2">含税单价:</label> |
|
|
|
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" disabled /> |
|
|
|
<label class="col-sm-2">含税总价:</label> |
|
|
|
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" disabled /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<div class="container"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select id="reApply" name="p_B_reApply" class="form-control m-b"> |
|
|
|
<option value="true">重新申请</option> |
|
|
|
<option value="false">结束流程</option> |
|
|
|
</select> |
|
|
|
<div class="container"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select id="reApply" name="p_B_reApply" class="form-control m-b"> |
|
|
|
<option value="true">重新申请</option> |
|
|
|
<option value="false">结束流程</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<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="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-sub-table-quoteChild"></table> |
|
|
|
<table id="bootstrap-sub-table-editOrder4"></table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -299,7 +314,7 @@ |
|
|
|
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
var sysSalesOrder = [[${formData}]]; |
|
|
|
$("#form-edit").validate({ |
|
|
|
$("#form-modfify-audit").validate({ |
|
|
|
onkeyup: false, |
|
|
|
rules:{ |
|
|
|
}, |
|
|
@ -311,10 +326,411 @@ |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
var taskId = [[${taskId}]]; |
|
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
|
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-modfify-audit').serialize()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$("#form-modfify-audit").validate({focusCleanup: true}); |
|
|
|
var prefix = ctx + "system/salesOrder"; |
|
|
|
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]]; |
|
|
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|
|
|
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|
|
|
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
var sysSalesOrder = [[${formData}]]; |
|
|
|
$("#form-modfify-audit").validate({focusCleanup: true}); |
|
|
|
$(function() { |
|
|
|
var options = { |
|
|
|
id:'bootstrap-sub-table-editOrder4', |
|
|
|
url: ctx + "system/orderChild/list", |
|
|
|
pagination: false, |
|
|
|
queryParams: queryParams, |
|
|
|
sidePagination: "client", |
|
|
|
model: "物料报价信息", |
|
|
|
columns: [ |
|
|
|
{checkbox: true}, |
|
|
|
{field: 'index',align: 'center', title: "序号", |
|
|
|
formatter: function (value, row, index) { |
|
|
|
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index)); |
|
|
|
return columnIndex + $.table.serialNumber(index); |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, |
|
|
|
{title: '料号',field: 'materialCode',align: 'center'}, |
|
|
|
{title: '物料名称',field: 'materialName',align: 'center'}, |
|
|
|
{title: '图片',field: 'photoUrl', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
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: 'brand',align: 'center'}, |
|
|
|
{ title: '单位',field: 'unit',align: 'center', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(sysUnitClassDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{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)', |
|
|
|
field: 'materialNoRmb', |
|
|
|
align: 'center', |
|
|
|
editable: function(value, row, index) { |
|
|
|
var commonCurrency3 = $("#commonCurrency_edit option:selected").val(); |
|
|
|
if (commonCurrency3 == 1){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料的不含税单价(美元)', |
|
|
|
field: 'materialNoUsd', |
|
|
|
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: 'createBy',align: 'center',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) { |
|
|
|
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); |
|
|
|
$.ajax({ |
|
|
|
type: "post", |
|
|
|
url:ctx + "system/customer/customerList", |
|
|
|
dataType:"json", |
|
|
|
delay:250, |
|
|
|
cache:true, |
|
|
|
success: function (res, params) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var result = res.rows; |
|
|
|
for (let i in result) { |
|
|
|
$("#form-modfify-audit select[name='enterpriseCode']").append( |
|
|
|
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>"); |
|
|
|
} |
|
|
|
$("#form-modfify-audit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change"); |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
$.ajax({ |
|
|
|
type: "post", |
|
|
|
url:ctx + "system/shippingaddress/list", |
|
|
|
dataType:"json", |
|
|
|
delay:250, |
|
|
|
cache:true, |
|
|
|
data:{ |
|
|
|
enterpriseCode:sysSalesOrder.enterpriseCode, |
|
|
|
}, |
|
|
|
success: function (res, params) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var result = res.rows; |
|
|
|
for (let i in result) { |
|
|
|
$("#form-modfify-audit select[name='customerDelivery']").append( |
|
|
|
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>"); |
|
|
|
} |
|
|
|
$("#form-modfify-audit select[name='customerDelivery']").val(sysSalesOrder.customerDelivery).trigger() |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
$.ajax({ |
|
|
|
type: "post", |
|
|
|
url:ctx + "system/contacts/list", |
|
|
|
dataType:"json", |
|
|
|
delay:250, |
|
|
|
cache:true, |
|
|
|
data:{ |
|
|
|
enterpriseCode:sysSalesOrder.enterpriseCode, |
|
|
|
}, |
|
|
|
success: function (res, params) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var result = res.rows; |
|
|
|
for (let i in result) { |
|
|
|
$("#form-modfify-audit select[name='customerContact']").append( |
|
|
|
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>"); |
|
|
|
} |
|
|
|
$("#form-modfify-audit select[name='customerContact']").val(sysSalesOrder.customerContact).trigger("change"); |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
$("#enterprise_edit").val(sysSalesOrder.enterprise); |
|
|
|
$("#enterpriseSum_edit").val(sysSalesOrder.enterpriseSum); |
|
|
|
$("#noRmb_edit").val(sysSalesOrder.noRmb); |
|
|
|
$("#rmb_edit").val(sysSalesOrder.rmb); |
|
|
|
$("#noRmbSum_edit").val(sysSalesOrder.noRmbSum); |
|
|
|
$("#rmbTax_edit").val(sysSalesOrder.rmbSum); |
|
|
|
$("#noUsd_edit").val(sysSalesOrder.noUsd); |
|
|
|
$("#usd_edit").val(sysSalesOrder.usd); |
|
|
|
$("#noUsdSum_edit").val(sysSalesOrder.noUsdSum); |
|
|
|
$("#usdSum_edit").val(sysSalesOrder.usdSum); |
|
|
|
}); |
|
|
|
$('#enterpriseCode_edit').on('select2:select', function (e) { |
|
|
|
var data = e.params.data; |
|
|
|
$("input[name='enterpriseName']").val(data.enterpriseName); |
|
|
|
$("input[name='customerPurser']").val(data.customerPurser); |
|
|
|
$("input[name='taxRate']").val(data.taxRate); |
|
|
|
$("input[name='confirmFax']").val(data.confirmTax); |
|
|
|
$("#commonCurrency_add").val(data.commonCurrency).trigger('change'); |
|
|
|
commonCurrency = $("#commonCurrency_edit option:selected").val(); |
|
|
|
console.log("commonCurrency",commonCurrency); |
|
|
|
}); |
|
|
|
$('#customerContact_edit').on('select2:select', function (e) { |
|
|
|
var data = e.params.data; |
|
|
|
$("input[name='contactPost']").val(data.customerPosition); |
|
|
|
$("input[name='contactNumber']").val(data.cellPhone); |
|
|
|
$("input[name='contactEmail']").val(data.commonEmail); |
|
|
|
}); |
|
|
|
$('#customerDelivery_edit').on('select2:select', function (e) { |
|
|
|
var data1 = e.params.data; |
|
|
|
$("input[name='deliveryPhone']").val(data1.customerPhone); |
|
|
|
$("input[name='deliveryAddress']").val(data1.deliveryAddress); |
|
|
|
}); |
|
|
|
function queryParams(params) { |
|
|
|
var curParams = { |
|
|
|
// 传递参数查询参数 |
|
|
|
pageSize: params.limit, |
|
|
|
pageNum: params.offset / params.limit + 1, |
|
|
|
quoteId: sysSalesOrder.salesOrderCode, |
|
|
|
}; |
|
|
|
curParams.quoteId = sysSalesOrder.salesOrderCode; |
|
|
|
return curParams; |
|
|
|
} |
|
|
|
/*业务员列表*/ |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/salesOrder/getBinessMembers', |
|
|
|
type: 'get', |
|
|
|
success: function (res) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("#select[name='businessMembers']").append( |
|
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
function doSubmit(index, layero,uniqueId){ |
|
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|
|
|
console.log("rowData:"+rowData); |
|
|
|
var totalNum = $("#bootstrap-select-table").bootstrapTable('getData').length; |
|
|
|
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); |
|
|
|
} |
|
|
|
$("#bootstrap-sub-table-editOrder4").bootstrapTable('insertRow', { |
|
|
|
index: 1, |
|
|
|
row: { |
|
|
|
id:'', |
|
|
|
materialId:rowData.id, |
|
|
|
materialCode: rowData.materialNo, |
|
|
|
materialName: rowData.materialName, |
|
|
|
materialType: rowData.materialType, |
|
|
|
describe: rowData.describe, |
|
|
|
brand: rowData.brand, |
|
|
|
photoUrl: rowData.photoUrl, |
|
|
|
unit: rowData.unit, |
|
|
|
processMethod: rowData.processMethod, |
|
|
|
countTax:rmb, |
|
|
|
usdTax: usd, |
|
|
|
materialSole: rowData.materialSole, |
|
|
|
materialNum: 0, |
|
|
|
materialNoRmb: 0.0, |
|
|
|
materialNoUsd: 0.0, |
|
|
|
materialRmb: 0.0, |
|
|
|
materialNoRmbSum: 0.0, |
|
|
|
materialRmbSum: 0, |
|
|
|
materialUsd: 0.0, |
|
|
|
materialUsdSum: 0.0, |
|
|
|
materialNoUsdSum: 0.0, |
|
|
|
remark: "", |
|
|
|
} |
|
|
|
}) |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
function insertRow() { |
|
|
|
var url = ctx + "erp/material/select"; |
|
|
|
var options = { |
|
|
|
title: '选择料号', |
|
|
|
url: url, |
|
|
|
callBack: doSubmit |
|
|
|
}; |
|
|
|
$.modal.openOptions(options); |
|
|
|
} |
|
|
|
/* 删除指定表格行 */ |
|
|
|
function removeRow(index){ |
|
|
|
$("#bootstrap-sub-table-editOrder4").bootstrapTable('remove', { |
|
|
|
field: 'index', |
|
|
|
value: index |
|
|
|
}) |
|
|
|
} |
|
|
|
$("input[name='pricingDate']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("input[name='deliveryTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("input[name='orderReceivingTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("input[name='modificationTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
//计算 |
|
|
|
function getTotalAmount(){ |
|
|
|
let getData = $("#bootstrap-sub-table-editOrder4").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({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("input[name='deliveryTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("input[name='orderReceivingTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
$("input[name='modificationTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |