|
|
@ -494,6 +494,41 @@ |
|
|
|
}, |
|
|
|
}; |
|
|
|
$.table.init(options); |
|
|
|
//获取单号 |
|
|
|
$.ajax({ |
|
|
|
url: prefix + "/getId", |
|
|
|
type: "post", |
|
|
|
dateType: "json", |
|
|
|
success: function (resp) { |
|
|
|
if (resp.code === 0) { |
|
|
|
$("input[name='salesOrderCode']").val(resp.data); |
|
|
|
} else { |
|
|
|
$.modal.msgError("失败啦"); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function () { |
|
|
|
$.modal.msgError("后台出错啦!"); |
|
|
|
} |
|
|
|
}); |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/user/list', |
|
|
|
type: 'post', |
|
|
|
data:{ |
|
|
|
userName: '业务' |
|
|
|
}, |
|
|
|
success: function (res) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("#businessMembers_add").append( |
|
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
$("#businessMembers_add").val(userName).trigger("change"); |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
//获取客户信息 |
|
|
|
$(function(){ |
|
|
@ -621,43 +656,7 @@ |
|
|
|
$("input[name='deliveryPhone']").val(data1.customerPhone); |
|
|
|
$("input[name='deliveryAddress']").val(data1.deliveryAddress); |
|
|
|
}); |
|
|
|
|
|
|
|
//获取单号 |
|
|
|
$.ajax({ |
|
|
|
url: prefix + "/getId", |
|
|
|
type: "post", |
|
|
|
dateType: "json", |
|
|
|
success: function (resp) { |
|
|
|
if (resp.code === 0) { |
|
|
|
$("input[name='salesOrderCode']").val(resp.data); |
|
|
|
} else { |
|
|
|
$.modal.msgError("失败啦"); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function () { |
|
|
|
$.modal.msgError("后台出错啦!"); |
|
|
|
} |
|
|
|
}); |
|
|
|
/*业务员列表*/ |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/user/list', |
|
|
|
type: 'post', |
|
|
|
data:{ |
|
|
|
userName: '业务' |
|
|
|
}, |
|
|
|
success: function (res) { |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("#businessMembers_add").append( |
|
|
|
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
$("#businessMembers_add").val(userName).trigger("change"); |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
//获取单号 |
|
|
|
$("#form-salesOrder-add").validate({ |
|
|
|
focusCleanup: true |
|
|
@ -727,40 +726,41 @@ |
|
|
|
function getTotalAmount(){ |
|
|
|
// $("#addFinishbomTable").bootstrapTable('refresh'); |
|
|
|
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData'); |
|
|
|
let enterprise = Number(0);let enterpriseSum = Number(0).toFixed(0); let noRmb = Number(0).toFixed(0); |
|
|
|
let rmb = Number(0).toFixed(2);let noRmbSum =Number(0).toFixed(2);let rmbSum = Number(0).toFixed(2);let noUsd = Number(0).toFixed(2); |
|
|
|
let usd = Number(0).toFixed(2);let noUsdSum = Number(0).toFixed(2); let usdSum = Number(0).toFixed(2); |
|
|
|
$("#enterprise_add").val(0); |
|
|
|
$("#enterpriseSum_add").val(0); |
|
|
|
$("#noRmb_add").val(0); |
|
|
|
$("#rmb_add").val(0); |
|
|
|
$("#noRmbSum_add").val(0); |
|
|
|
$("#rmbTax_add").val(0); |
|
|
|
$("#noUsd_add").val(0); |
|
|
|
$("#usd_add").val(0); |
|
|
|
$("#noUsdSum_add").val(0); |
|
|
|
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 = 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_add").val(enterprise); |
|
|
|
$("#enterpriseSum_add").val(enterpriseSum); |
|
|
|
$("#noRmb_add").val(noRmb); |
|
|
|
$("#rmb_add").val(rmb); |
|
|
|
$("#noRmbSum_add").val(noRmbSum); |
|
|
|
$("#rmbTax_add").val(rmbSum); |
|
|
|
$("#noUsd_add").val(noUsd); |
|
|
|
$("#usd_add").val(usd); |
|
|
|
$("#noUsdSum_add").val(noUsdSum); |
|
|
|
$("#usdSum_add").val(usdSum); |
|
|
|
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", |
|
|
|