zhangsiqi
8 months ago
8 changed files with 2281 additions and 303 deletions
@ -0,0 +1,724 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改销售订单')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<th:block th:include="include :: bootstrap-fileinput-css"/> |
|||
|
|||
</head> |
|||
|
|||
<style> |
|||
.division { |
|||
width: 90%; |
|||
border-bottom: 1px solid #f1ecec; |
|||
padding: 10px 0 0; |
|||
margin: 0 auto 30px; |
|||
|
|||
|
|||
} |
|||
|
|||
/*.changeWidth {*/ |
|||
/* width: 33.3% !important;*/ |
|||
|
|||
/*}*/ |
|||
|
|||
.col-sm-3 { |
|||
width: 30%; |
|||
} |
|||
|
|||
.select2-container--open { |
|||
z-index: 9999999 |
|||
} |
|||
|
|||
.other-container { |
|||
width: 85%; |
|||
height: 400px; |
|||
margin: auto; |
|||
} |
|||
|
|||
.hiddenDetailInfo { |
|||
display: none; |
|||
} |
|||
|
|||
.search-collapse, .select-table { |
|||
box-shadow: none; |
|||
} |
|||
|
|||
.btn-group-sm { |
|||
padding: 0 40px; |
|||
} |
|||
|
|||
.get-finish-product h4 { |
|||
padding: 0 40px; |
|||
} |
|||
|
|||
.table-responsive { |
|||
overflow-x: inherit; |
|||
} |
|||
|
|||
.title { |
|||
padding: 10px 30px 0; |
|||
margin: 0 0 -10px 0; |
|||
font-size: 20px; |
|||
} |
|||
</style> |
|||
|
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m " id="form-salesOrder-edit" th:object="${sysSalesOrder}"> |
|||
<div class="form-group" hidden="hidden"> |
|||
<label class="col-sm-3 control-label is-required">订单索引号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderId" class="form-control" th:field="*{salesOrderId}" type="number" required disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" hidden="hidden"> |
|||
<label class="col-sm-3 control-label is-required">销售订单编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderCode" class="form-control" th:field="*{salesOrderCode}" type="text" required disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<select id="enterpriseCode_edit" name="enterpriseCode" class="form-control m-b" required disabled> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseName" class="form-control" type="text" th:field="*{enterpriseName}" readonly disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">事业部:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerPurser" class="form-control" th:field="*{customerPurser}" type="text" readonly disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">客户联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<select id="customerContact_edit" name="customerContact" th:field="*{customerContact}" class="form-control m-b" required disabled> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系人职务:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactPost" th:field="*{contactPost}" class="form-control" type="text" readonly disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label ">联系人电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系人邮箱:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactEmail" th:field="*{contactEmail}" class="form-control" type="text" required disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">客户收货人:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="customerDelivery" id="customerDelivery_edit" |
|||
th:field="*{customerDelivery}" class="form-control m-b" disabled> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">收货人电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" required disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">订单类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="salesOrderType" class="form-control" |
|||
th:with="dictList=${@dict.getType('sys_order_type')}" th:field="*{salesOrderType}" required disabled> |
|||
<option value="">请选择</option> |
|||
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">接单日期:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="orderReceivingTime" class="form-control" type="text" |
|||
th:field="*{orderReceivingTime}" placeholder="yyyy-mm-dd" disabled> |
|||
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">接单方式:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="orderReceivingMode" class="form-control" |
|||
th:field="*{orderReceivingMode}" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 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> |
|||
<option value="">请选择</option> |
|||
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">美元汇率:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required /> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 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="${'confirmTax_' + dict.dictCode}" |
|||
name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|||
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">税率:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="taxRate" id="taxRate_edit" th:field="*{taxRate}" class="form-control" type="number"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">是否开票:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}"> |
|||
<input required type="radio" th:id="${'invoice_' + dict.dictCode}" |
|||
name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|||
<label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">付款条件:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="paymentTerms" th:field="*{paymentTerms}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">交货方式:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryMethod" th:field="*{deliveryMethod}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">交货条件:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryConditions" th:field="*{deliveryConditions}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">计划交付时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="deliveryTime" class="form-control" placeholder="yyyy-mm-dd" type="text" th:field="*{deliveryTime}" /> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户验收时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="modificationTime" th:field="*{modificationTime}" class="form-control" placeholder="yyyy-mm-dd" type="text" /> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">贸易条款:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}"></textarea> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">业务员:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="businessMembers" class="form-control m-b" th:field="*{businessMembers}" required> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<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="materialSum" id="enterprise_edit" 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/> |
|||
</div> |
|||
<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="noRmbSum" id="noRmbSum_edit" type="number" th:field="*{noRmbSum}" readonly/> |
|||
</div> |
|||
<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="rmbTaxSum" id="rmbTax_edit" type="number" th:field="*{rmbTaxSum}" readonly/> |
|||
</div> |
|||
<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="noUsdSum" id="noUsdSum_edit" type="number" th:field="*{noUsdSum}" readonly/> |
|||
</div> |
|||
<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="usdTaxSum" id="usdSum_edit" type="number" th:field="*{usdTaxSum}" readonly/> |
|||
</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-editOrder"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-js"/> |
|||
<script th:inline="javascript"> |
|||
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 = [[${sysSalesOrder}]]; |
|||
$("#form-salesOrder-edit").validate({focusCleanup: true}); |
|||
$(function() { |
|||
var options = { |
|||
id:'bootstrap-sub-table-editOrder', |
|||
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-salesOrder-edit select[name='enterpriseCode']").append( |
|||
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>"); |
|||
} |
|||
$("#form-salesOrder-edit 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-salesOrder-edit select[name='customerDelivery']").append( |
|||
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>"); |
|||
} |
|||
$("#form-salesOrder-edit 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-salesOrder-edit select[name='customerContact']").append( |
|||
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>"); |
|||
} |
|||
$("#form-salesOrder-edit select[name='customerContact']").val(sysSalesOrder.customerContact).trigger("change"); |
|||
} else { |
|||
$.modal.msgError(res.msg); |
|||
} |
|||
}, |
|||
}); |
|||
$("#enterprise_edit").val(sysSalesOrder.enterprise); |
|||
$("#enterpriseSum_edit").val(Number(sysSalesOrder.enterpriseSum)); |
|||
$("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2)); |
|||
$("#rmb_edit").val(Number(sysSalesOrder.rmb).toFixed(2)); |
|||
$("#noRmbSum_edit").val(Number(sysSalesOrder.noRmbSum).toFixed(2)); |
|||
$("#rmbTax_edit").val(Number(sysSalesOrder.rmbSum).toFixed(2)); |
|||
$("#noUsd_edit").val(Number(sysSalesOrder.noUsd).toFixed(2)); |
|||
$("#usd_edit").val(Number(sysSalesOrder.usd).toFixed(2)); |
|||
$("#noUsdSum_edit").val(Number(sysSalesOrder.noUsdSum).toFixed(2)); |
|||
$("#usdSum_edit").val(Number(sysSalesOrder.usdSum).toFixed(2)); |
|||
}); |
|||
$('#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 data = e.params.data; |
|||
$("input[name='deliveryPhone']").val(data.customerPhone); |
|||
$("input[name='deliveryAddress']").val(data.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/user/list', |
|||
type: 'post', |
|||
success: function (res) { |
|||
if (res.rows.length > 0) { |
|||
var usertData = res.rows; |
|||
for (let i in usertData) { |
|||
$("#form-salesOrder-edit select[name='businessMembers']").append( |
|||
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|||
} |
|||
$("#form-salesOrder-edit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change"); |
|||
} 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-editOrder").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:rmb1 , |
|||
usdTax: usd, |
|||
materialSole: rowData.materialSole, |
|||
materialNum: 0.00, |
|||
materialNoRmb: 0.00, |
|||
materialNoUsd: 0.00, |
|||
materialRmb: 0.00, |
|||
materialNoRmbSum: 0.00, |
|||
materialRmbSum: 0.00, |
|||
materialUsd: 0.00, |
|||
materialUsdSum: 0.00, |
|||
materialNoUsdSum: 0.00, |
|||
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-editOrder").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 submitHandler() { |
|||
if ($.validate.form()) { |
|||
var formData = $("#form-salesOrder-edit").serializeArray(); |
|||
var tableData = $("#bootstrap-sub-table-editOrder").bootstrapTable('getData'); |
|||
var rows = tableData.length; |
|||
if(rows==0){ |
|||
$.modal.alertWarning("子表数据不能为空!"); |
|||
}else{ |
|||
formData.push({"name": "sysSalesOrderChildList", "value": tableData}); |
|||
var jsonData = $.common.formDataToJson(formData); |
|||
console.log("jsonData"); |
|||
console.log(jsonData); |
|||
$.operate.saveJson(prefix + "/edit", jsonData); |
|||
} |
|||
} |
|||
} |
|||
//计算 |
|||
function getTotalAmount(){ |
|||
let getData = $("#bootstrap-sub-table-editOrder").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; |
|||
$("#enterprise_edit").val(0); |
|||
$("#enterpriseSum_edit").val(0); |
|||
$("#noRmb_edit").val(0); |
|||
$("#rmb_edit").val(0); |
|||
$("#noRmbSum_edit").val(0); |
|||
$("#rmbTax_edit").val(0); |
|||
$("#noUsd_edit").val(0); |
|||
$("#usd_edit").val(0); |
|||
$("#noUsdSum_edit").val(0); |
|||
for(let i=0;i<getData.length;i++){ |
|||
enterprise += 1; |
|||
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0); |
|||
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2); |
|||
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ; |
|||
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2); |
|||
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2); |
|||
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ; |
|||
usd = Number(usd + getData[i].materialUsd).toFixed(2) ; |
|||
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2); |
|||
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2); |
|||
} |
|||
$("#enterprise_edit").val(enterprise); |
|||
$("#enterpriseSum_edit").val(Number(enterpriseSum).toFixed(2)); |
|||
$("#noRmb_edit").val(Number(noRmb).toFixed(2)); |
|||
$("#rmb_edit").val(Number(rmb).toFixed(2)); |
|||
$("#noRmbSum_edit").val(Number(noRmbSum).toFixed(2)); |
|||
$("#rmbTax_edit").val(Number(rmbSum).toFixed(2)); |
|||
$("#noUsd_edit").val(Number(noUsd).toFixed(2)); |
|||
$("#usd_edit").val(Number(usd).toFixed(2)); |
|||
$("#noUsdSum_edit").val(Number(noUsdSum).toFixed(2)); |
|||
$("#usdSum_edit").val(Number(usdSum).toFixed(2)); |
|||
} |
|||
// 结算金额 |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue