|
|
@ -1,13 +1,12 @@ |
|
|
|
<!DOCTYPE html> |
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml"> |
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
|
|
|
<head> |
|
|
|
<th:block th:include="include :: header('业务经理审核')" /> |
|
|
|
<th:block th:include="include :: select2-css" /> |
|
|
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
|
|
|
</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-ywjl-audit" th:object="${formData}"> |
|
|
|
<input name="id" th:field="*{id}" type="hidden"> |
|
|
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
|
|
|
<input type="hidden" name="p_COM_comment" /> |
|
|
@ -47,7 +46,7 @@ |
|
|
|
<div class="col-xs-12"> |
|
|
|
<label class="col-sm-4 control-label">业务员:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select readonly class="form-control" name="businessMembers" required th:field="*{businessMembers}"> |
|
|
|
<select class="form-control" name="businessMembers" th:field="*{businessMembers}" id="businessMembers" required> |
|
|
|
<option value="">请选择</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
@ -67,7 +66,8 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-4 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> |
|
|
|
<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> |
|
|
@ -83,8 +83,8 @@ |
|
|
|
<label class="col-sm-6 control-label is-required">是否含税:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> |
|
|
|
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}" |
|
|
|
name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}"> |
|
|
|
<input type="radio" th:id="${'confirmFax_' + dict.dictCode}" |
|
|
|
name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}" required> |
|
|
|
<label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -99,7 +99,7 @@ |
|
|
|
<label class="col-sm-4 control-label">订价日期:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<div class="input-group date"> |
|
|
|
<input name="pricingDate" th:value="*{pricingDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
|
|
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -119,33 +119,23 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2"> 不含税单价(RMB):</label><input placeholder="RMB" class="col-sm-1" name="noRmb" id="noRmb_edit" th:field="*{noRmb}" type="number" disabled /> |
|
|
|
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-1" name="noRmbSum" id="noRmbSum_edit" th:field="*{noRmbSum}" type="number" disabled/> |
|
|
|
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-1" name="rmb" id="rmb_edit" type="number" th:field="*{rmb}" disabled/> |
|
|
|
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-1" name="rmbSum" id="rmbSum_edit" th:field="*{rmbSum}" type="number" disabled/> |
|
|
|
<label class="col-sm-2"> 不含税单价(RMB):</label><input placeholder="RMB" class="col-sm-4" name="noRmb" id="noRmb_edit" th:field="*{noRmb}" type="number" disabled /> |
|
|
|
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" th:field="*{noRmbSum}" type="number" disabled/> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12"> |
|
|
|
<label class="col-sm-2">不含税单价(美元):</label><input placeholder="USD" class="col-sm-1" name="noUsd" id="noUsd_edit" th:field="*{noUsd}" type="number" disabled/> |
|
|
|
<label class="col-sm-2">不含税总价:</label><input placeholder="USD" class="col-sm-1" name="noUsdSum" id="noUsdSum_edit" th:field="*{noUsdSum}" type="number" disabled/> |
|
|
|
<label class="col-sm-2">含税单价:</label><input placeholder="USD" class="col-sm-1" name="usd" id="usd_edit" th:field="*{usd}" type="number" disabled/> |
|
|
|
<label class="col-sm-2">含税总价:</label><input placeholder="USD" class="col-sm-1" name="usdSum" id="usdSum_edit" th:field="*{usdSum}" type="number" disabled/> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmb" id="rmb_edit" type="number" th:field="*{rmb}" disabled/> |
|
|
|
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbSum" id="rmbSum_edit" th:field="*{rmbSum}" type="number" disabled/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="other container"> |
|
|
|
<div class="form-row"> |
|
|
|
<div class="btn-group-sm" id="toolbar" role="group"> |
|
|
|
<span>选择报价信息</span> |
|
|
|
<a class="btn btn-success" onclick="insertRow()"> |
|
|
|
<i class="fa fa-plus"></i> 添加物料 |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2">不含税单价(美元):</label><input placeholder="USD" class="col-sm-4" name="noUsd" id="noUsd_edit" th:field="*{noUsd}" type="number" disabled/> |
|
|
|
<label class="col-sm-2">不含税总价:</label><input placeholder="USD" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" th:field="*{noUsdSum}" type="number" disabled/> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-table-Quote-child"></table> |
|
|
|
</div> |
|
|
|
<div class="col-xs-12 form-row"> |
|
|
|
<label class="col-sm-2">含税单价:</label><input placeholder="USD" class="col-sm-4" name="usd" id="usd_edit" th:field="*{usd}" type="number" disabled/> |
|
|
|
<label class="col-sm-2">含税总价:</label><input placeholder="USD" class="col-sm-4" name="usdSum" id="usdSum_edit" th:field="*{usdSum}" type="number" disabled/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<hr/> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
|
|
@ -164,123 +154,274 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<div class="other container"> |
|
|
|
<div class="form-row"> |
|
|
|
<div class="btn-group-sm" id="toolbar" role="group"> |
|
|
|
<span>选择报价信息</span> |
|
|
|
<a class="btn btn-success" disabled> |
|
|
|
<i class="fa fa-plus"></i> 添加物料 |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-table-Quote-child"></table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<th:block th:include="include :: select2-js" /> |
|
|
|
<script th:src="@{/js/activiti.js}"></script> |
|
|
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
|
|
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
|
|
|
<script type="text/javascript"> |
|
|
|
new Vue({ |
|
|
|
el: '#app', |
|
|
|
data: function() { |
|
|
|
return { |
|
|
|
fileList: [], |
|
|
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
|
|
|
fileDeleteUrl: ctx + "common/deleteFile", |
|
|
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
|
|
|
fileIdList:[], |
|
|
|
removeFileIdList:[], |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
// 控制下拉框选中 |
|
|
|
var materialType = $("#materialType").val(); |
|
|
|
$("#selectMaterialType").val(materialType).trigger("change"); |
|
|
|
|
|
|
|
var that = this; |
|
|
|
// 页面渲染完成,可以执行需要的操作 |
|
|
|
console.log('页面已渲染完成'); |
|
|
|
console.log($("#id").val()); |
|
|
|
console.log($("#photoAttachId").val()); |
|
|
|
var attachId = $("#photoAttachId").val(); |
|
|
|
if(attachId){ |
|
|
|
$.ajax({ |
|
|
|
type: "get", |
|
|
|
url: that.getListByAttachIdUrl, |
|
|
|
data: {attachId:attachId}, |
|
|
|
cache: false, |
|
|
|
async: false, // 设置成同步 |
|
|
|
dataType: 'json', |
|
|
|
success: function(result) { |
|
|
|
if (result.code == web_status.SUCCESS) { |
|
|
|
result.data.forEach((item) => { |
|
|
|
that.fileIdList.push(item.id); |
|
|
|
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
$.modal.msgError(result.msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function(error) { |
|
|
|
$.modal.msgError("获取附件失败。"); |
|
|
|
<th:block th:include="include :: datetimepicker-js" /> |
|
|
|
<script th:inline="javascript"> |
|
|
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|
|
|
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|
|
|
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
var userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
|
var sysCustomerQuote = [[${formData}]]; |
|
|
|
var prefix = ctx + "system/customerQuote" |
|
|
|
var commonCurrency = $("#commonCurrency_edit option:selected").val(); |
|
|
|
$("#form-ywjl-audit").validate({focusCleanup: true}); |
|
|
|
$(function() { |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'system/user/list', |
|
|
|
type: 'post', |
|
|
|
success: function (res) { |
|
|
|
console.log(res) |
|
|
|
if (res.rows.length > 0) { |
|
|
|
var usertData = res.rows; |
|
|
|
for (let i in usertData) { |
|
|
|
$("#form-ywjl-audit select[name='businessMembers']").append("<option value='" + |
|
|
|
usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
} |
|
|
|
}); |
|
|
|
$("#form-ywjl-audit select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change");; |
|
|
|
} else { |
|
|
|
$.modal.msgError(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
uploadSuccess(response, file, fileList) { |
|
|
|
console.log(response); |
|
|
|
if(response.code == web_status.SUCCESS){ |
|
|
|
var attachFileId = response.data.id; |
|
|
|
file.attachFileId = attachFileId; |
|
|
|
file.isBind = false; |
|
|
|
this.fileIdList.push(attachFileId); |
|
|
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
|
|
|
$.modal.msgSuccess("上传成功"); |
|
|
|
}); |
|
|
|
var confirmFax = $("input[name='confirmFax']"); |
|
|
|
confirmFax.val([sysCustomerQuote.confirmFax]); |
|
|
|
$("input[name='rmbTax']").val([sysCustomerQuote.taxRate]); |
|
|
|
confirmFax.change(function () { |
|
|
|
if ($("input[name='confirmFax']").val() == "1") { |
|
|
|
$("input[name='rmbTax']").val(sysCustomerQuote.taxRate); |
|
|
|
} else { |
|
|
|
$("input[name='rmbTax']").val(0); |
|
|
|
} |
|
|
|
}); |
|
|
|
$("#commonCurrency_edit").val(sysCustomerQuote.commonCurrency).trigger('change'); |
|
|
|
}); |
|
|
|
$(function() { |
|
|
|
var options = { |
|
|
|
id: "bootstrap-table-Quote-child", |
|
|
|
url: ctx + "system/quoteChild/list", |
|
|
|
queryParams: queryParams, |
|
|
|
pagination: false, |
|
|
|
sidePagination: "client", |
|
|
|
clickToSelect: true, |
|
|
|
showExport: true, |
|
|
|
showSearch: false, |
|
|
|
showRefresh: false, |
|
|
|
showToggle: false, |
|
|
|
showColumns: false, |
|
|
|
showPaginationSwitch: false, |
|
|
|
model: "物料报价信息", |
|
|
|
columns: [ |
|
|
|
{checkbox: true}, |
|
|
|
{title: '序号',align: 'center', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.serialNumber(index); |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '报价子表id',field: 'id',align: 'center',visible: false}, |
|
|
|
{title: '物料报价主表id',field: 'quoteId',align: 'center',visible: false}, |
|
|
|
{title: '物料索引',field: 'materialId',align: 'center',visible: false}, |
|
|
|
{title: '料号',field: 'materialCode',align: 'center'}, |
|
|
|
{title: '物料名称',field: 'materialName',align: 'center'}, |
|
|
|
{title: '物料类型',field: 'materialType',align: 'center', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
$.table.selectCategoryLabel(materialTypeDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ title: '描述',field: 'describe',align: 'center'}, |
|
|
|
{title: '品牌',field: 'brand',align: 'center'}, |
|
|
|
{ |
|
|
|
title: '图片', field: 'photoUrl', align: 'center', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.imageView(value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ 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: 'countTax',align: 'center',editable: true}, |
|
|
|
{title: '美元汇率',field: 'usdTax', align: 'center',editable: true}, |
|
|
|
{title: '对外售价',field: 'materialSole',editable: true}, |
|
|
|
{title: '物料的数量',field: 'materialNum',align: 'center',editable: true}, |
|
|
|
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: commonCurrency==1?true:false}, |
|
|
|
{title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',editable: commonCurrency==2?true:false}, |
|
|
|
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, |
|
|
|
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, |
|
|
|
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'}, |
|
|
|
{title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'}, |
|
|
|
{title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'}, |
|
|
|
{title: '物料的不含税总价(美元)', field: 'materialNoUsdSum',align: 'center'}, |
|
|
|
{field: 'remark',align: 'center',title: '备注',visible: false}, |
|
|
|
{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.id + '\')"><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 = $("#rmbTax_edit").val(); |
|
|
|
if (rmb1 =='' || rmb1== null){ |
|
|
|
rmb1 = 0; |
|
|
|
}else{ |
|
|
|
$.modal.alertError(response.msg); |
|
|
|
rmb1 = $("#rmbTax_edit").val(); |
|
|
|
} |
|
|
|
}, |
|
|
|
uploadRemove(file, fileList) { |
|
|
|
console.log(file, fileList); |
|
|
|
var attachFileId = file.attachFileId; |
|
|
|
var isBind = file.isBind; |
|
|
|
if(isBind==false){ |
|
|
|
$.ajax({ |
|
|
|
type: "get", |
|
|
|
url: this.fileDeleteUrl, |
|
|
|
data: {id:attachFileId}, |
|
|
|
cache: false, |
|
|
|
async: false, // 设置成同步 |
|
|
|
dataType: 'json', |
|
|
|
success: function(result) { |
|
|
|
if (result.code == web_status.SUCCESS) { |
|
|
|
var index = this.fileIdList.indexOf(attachFileId); |
|
|
|
if(index!=-1){ |
|
|
|
this.fileIdList.splice(index,1); |
|
|
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
|
|
|
} |
|
|
|
$.modal.msgSuccess("删除附件成功。"); |
|
|
|
} else { |
|
|
|
$.modal.alertError(result.msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function(error) { |
|
|
|
$.modal.alertError("删除附件失败。"); |
|
|
|
} |
|
|
|
}); |
|
|
|
var rmb = Number(rmb1).toFixed(2) / 100; |
|
|
|
var usd = $("#usdTax_edit").val(); |
|
|
|
if (usd =='' || usd== null){ |
|
|
|
usd = 0; |
|
|
|
}else{ |
|
|
|
var index = this.fileIdList.indexOf(attachFileId); |
|
|
|
if(index!=-1){ |
|
|
|
this.fileIdList.splice(index,1); |
|
|
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
|
|
|
// 保存的时候才删除 |
|
|
|
this.removeFileIdList.push(attachFileId); |
|
|
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
|
|
|
} |
|
|
|
usd = Number(usd).toFixed(2); |
|
|
|
} |
|
|
|
console.log(commonCurrency1); |
|
|
|
if(commonCurrency1 == 1){ |
|
|
|
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) * Number(row.materialNoUsd); |
|
|
|
row.materialUsd = Number(row.materialNoUsd).toFixed(2) |
|
|
|
row.materialUsdSum = Number(row.materialNum * Number(row.materialUsd)).toFixed(2); |
|
|
|
} |
|
|
|
else if(commonCurrency1 == 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() |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
var prefix = ctx + "erp/bom"; |
|
|
|
$("#form-edit").validate({ |
|
|
|
focusCleanup: true |
|
|
|
}; |
|
|
|
$.table.init(options); |
|
|
|
}); |
|
|
|
|
|
|
|
function queryParams(params) { |
|
|
|
var curParams = { |
|
|
|
// 传递参数查询参数 |
|
|
|
pageSize: params.limit, |
|
|
|
pageNum: params.offset / params.limit + 1, |
|
|
|
quoteId: sysCustomerQuote.supplierCode, |
|
|
|
}; |
|
|
|
curParams.quoteId = sysCustomerQuote.supplierCode; |
|
|
|
return curParams; |
|
|
|
} |
|
|
|
function doSubmit(index, layero,uniqueId){ |
|
|
|
console.log(uniqueId); |
|
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|
|
|
console.log("rowData: "+rowData); |
|
|
|
var timestamp = new Date().getTime(); |
|
|
|
$("#bootstrap-table-Quote-child").bootstrapTable('insertRow', { |
|
|
|
index: 1, |
|
|
|
row: { |
|
|
|
id:'', |
|
|
|
quoteId:$("#supplierCode").val(), |
|
|
|
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: '', |
|
|
|
usdTax: '', |
|
|
|
materialSole: "", |
|
|
|
materialNum: "", |
|
|
|
materialNoRmb: "", |
|
|
|
materialNoUsd: "", |
|
|
|
materialRmb: "", |
|
|
|
materialNoRmbSum: "", |
|
|
|
materialRmbSum: "", |
|
|
|
materialUsd: "", |
|
|
|
materialUsdSum: "", |
|
|
|
materialNoUsdSum: "", |
|
|
|
remark: "", |
|
|
|
} |
|
|
|
}) |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
function insertRow() { |
|
|
|
var url = ctx + "erp/material/select"; |
|
|
|
var options = { |
|
|
|
title: '选择料号', |
|
|
|
url: url, |
|
|
|
callBack: doSubmit |
|
|
|
}; |
|
|
|
$.modal.openOptions(options); |
|
|
|
} |
|
|
|
/* 删除指定表格行 */ |
|
|
|
function removeRow(rowData){ |
|
|
|
$.table.bootstrapTable('remove', { |
|
|
|
field: 'index', |
|
|
|
values: rowData.index |
|
|
|
}) |
|
|
|
} |
|
|
|
$("input[name='pricingDate']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
//计算 |
|
|
|
function getTotalAmount(){ |
|
|
|
let getData = $("#bootstrap-table-Quote-child").bootstrapTable('getData', true); |
|
|
|
var enterprise = ""; |
|
|
|
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; |
|
|
|
for(var i=0;i<getData.length;i++){ |
|
|
|
enterprise += getData[i].materialName + ": 数量" + getData[i].materialNum +"; "; |
|
|
|
enterpriseSum +=getData[i].materialNum; |
|
|
|
noRmb += getData[i].materialNoRmb ; |
|
|
|
rmb +=getData[i].materialRmb; |
|
|
|
noRmbSum += getData[i].materialNoRmbSum; |
|
|
|
rmbSum += getData[i].materialRmbSum; |
|
|
|
noUsd += getData[i].materialNoUsd ; |
|
|
|
usd += getData[i].materialUsd ; |
|
|
|
noUsdSum += getData[i].materialNoUsdSum; |
|
|
|
usdSum += getData[i].materialUsdSum; |
|
|
|
} |
|
|
|
$("#enterprise_edit").val(enterprise); |
|
|
|
$("#enterpriseSum_edit").val(enterpriseSum); |
|
|
|
$("#noRmb_edit").val(noRmb); |
|
|
|
$("#rmb_edit").val(rmb); |
|
|
|
$("#noRmbSum_edit").val(noRmbSum); |
|
|
|
$("#rmbSum_edit").val(rmbSum); |
|
|
|
$("#noUsd_edit").val(noUsd); |
|
|
|
$("#usd_edit").val(usd); |
|
|
|
$("#noUsdSum_edit").val(noUsdSum); |
|
|
|
$("#usdSum_edit").val(usdSum); |
|
|
|
} |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
|
@ -289,10 +430,9 @@ |
|
|
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
|
|
|
} |
|
|
|
var taskId = [[${taskId}]]; |
|
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
|
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-ywjl-audit').serialize()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |