|
|
@ -84,7 +84,9 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label is-required">客户ID:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input id="enterpriseCode_edit" th:field="*{enterpriseCode}" name="enterpriseCode" class="form-control m-b" required readonly/> |
|
|
|
<input id="enterpriseCode_edit" th:field="*{enterpriseCode}" name="enterpriseCode" |
|
|
|
class="form-control m-b" required readonly> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
@ -100,9 +102,12 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label is-required">客户联系人:</label> |
|
|
|
<label class="col-sm-3 control-label">客户联系人:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input id="customerContact_edit" name="customerContact" th:field="*{customerContact}" class="form-control" required readonly /> |
|
|
|
<select id="customerContact_edit" name="customerContact" th:field="*{customerContact}" |
|
|
|
class="form-control"> |
|
|
|
|
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
@ -124,9 +129,11 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label is-required">客户收货人:</label> |
|
|
|
<label class="col-sm-3 control-label">客户收货人:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="customerDelivery" id="customerDelivery_edit" th:field="*{customerDelivery}" class="form-control m-b" disabled/> |
|
|
|
<select name="customerDelivery" id="customerDelivery_edit" th:field="*{customerDelivery}" class="form-control m-b"> |
|
|
|
<option value=""></option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
@ -471,20 +478,41 @@ |
|
|
|
$.table.init(options); |
|
|
|
}); |
|
|
|
$(function(){ |
|
|
|
/*业务员列表*/ |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/salesOrder/getBinessMembers', |
|
|
|
type: 'get', |
|
|
|
success: function (res) { |
|
|
|
console.log(res) |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("select[name='businessMembers']").append( |
|
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
//客户信息填写 |
|
|
|
$.ajax({ |
|
|
|
type: "post", |
|
|
|
url:ctx + "system/customer/customerList", |
|
|
|
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; |
|
|
|
$("#form-salesOrder-edit select[name='customerContact']").empty(); |
|
|
|
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='customerContact']").append( |
|
|
|
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>"); |
|
|
|
} |
|
|
|
$("#form-salesOrder-edit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change"); |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
@ -502,17 +530,21 @@ |
|
|
|
success: function (res, params) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var result = res.rows; |
|
|
|
$("#form-salesOrder-edit select[name='customerDelivery']").empty(); |
|
|
|
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() |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
$('#customerContact_edit').on('select2:select', function (e) { |
|
|
|
var data = e.params.data; |
|
|
|
$.ajax({ |
|
|
|
type: "post", |
|
|
|
url:ctx + "system/contacts/list", |
|
|
|
url:ctx + "system/shippingaddress/list", |
|
|
|
dataType:"json", |
|
|
|
delay:250, |
|
|
|
cache:true, |
|
|
@ -522,56 +554,14 @@ |
|
|
|
success: function (res, params) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var result = res.rows; |
|
|
|
$("#form-salesOrder-edit select[name='customerDelivery']").empty(); |
|
|
|
for (let i in result) { |
|
|
|
$("#form-salesOrder-edit select[name='customerContact']").append( |
|
|
|
$("#form-salesOrder-edit select[name='customerDelivery']").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); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
/*业务员列表*/ |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/salesOrder/getBinessMembers', |
|
|
|
type: 'get', |
|
|
|
success: function (res) { |
|
|
|
console.log(res) |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("select[name='businessMembers']").append( |
|
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
} 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); |
|
|
|