|
@ -1,13 +1,12 @@ |
|
|
<!DOCTYPE html> |
|
|
<!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> |
|
|
<head> |
|
|
<th:block th:include="include :: header('业务经理审核')" /> |
|
|
<th:block th:include="include :: header('业务经理审核')" /> |
|
|
<th:block th:include="include :: select2-css" /> |
|
|
<th:block th:include="include :: select2-css" /> |
|
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
|
|
|
|
|
</head> |
|
|
</head> |
|
|
<body class="white-bg"> |
|
|
<body class="white-bg"> |
|
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
<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="id" th:field="*{id}" type="hidden"> |
|
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
|
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
|
|
<input type="hidden" name="p_COM_comment" /> |
|
|
<input type="hidden" name="p_COM_comment" /> |
|
@ -47,7 +46,7 @@ |
|
|
<div class="col-xs-12"> |
|
|
<div class="col-xs-12"> |
|
|
<label class="col-sm-4 control-label">业务员:</label> |
|
|
<label class="col-sm-4 control-label">业务员:</label> |
|
|
<div class="col-sm-8"> |
|
|
<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> |
|
|
<option value="">请选择</option> |
|
|
</select> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
@ -67,7 +66,8 @@ |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-4 control-label">报价币种:</label> |
|
|
<label class="col-sm-4 control-label">报价币种:</label> |
|
|
<div class="col-sm-8"> |
|
|
<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 value="">请选择</option> |
|
|
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> |
|
|
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> |
|
|
</select> |
|
|
</select> |
|
@ -83,8 +83,8 @@ |
|
|
<label class="col-sm-6 control-label is-required">是否含税:</label> |
|
|
<label class="col-sm-6 control-label is-required">是否含税:</label> |
|
|
<div class="col-sm-6"> |
|
|
<div class="col-sm-6"> |
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> |
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> |
|
|
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}" |
|
|
<input type="radio" th:id="${'confirmFax_' + dict.dictCode}" |
|
|
name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}"> |
|
|
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> |
|
|
<label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -99,7 +99,7 @@ |
|
|
<label class="col-sm-4 control-label">订价日期:</label> |
|
|
<label class="col-sm-4 control-label">订价日期:</label> |
|
|
<div class="col-sm-8"> |
|
|
<div class="col-sm-8"> |
|
|
<div class="input-group date"> |
|
|
<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> |
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -119,33 +119,23 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="col-xs-12 form-row"> |
|
|
<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"> 不含税单价(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-1" name="noRmbSum" id="noRmbSum_edit" th:field="*{noRmbSum}" 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/> |
|
|
<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/> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="col-xs-12"> |
|
|
<div class="col-xs-12 form-row"> |
|
|
<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="RMB" class="col-sm-4" name="rmb" id="rmb_edit" type="number" th:field="*{rmb}" 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="RMB" class="col-sm-4" name="rmbSum" id="rmbSum_edit" th:field="*{rmbSum}" 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> |
|
|
</div> |
|
|
</div> |
|
|
<div class="col-xs-12 form-row"> |
|
|
<div class="other container"> |
|
|
<label class="col-sm-2">不含税单价(美元):</label><input placeholder="USD" class="col-sm-4" name="noUsd" id="noUsd_edit" th:field="*{noUsd}" type="number" disabled/> |
|
|
<div class="form-row"> |
|
|
<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 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> |
|
|
</div> |
|
|
<div class="row"> |
|
|
<div class="col-xs-12 form-row"> |
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
<label class="col-sm-2">含税单价:</label><input placeholder="USD" class="col-sm-4" name="usd" id="usd_edit" th:field="*{usd}" type="number" disabled/> |
|
|
<table id="bootstrap-table-Quote-child"></table> |
|
|
<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> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<hr/> |
|
|
<hr/> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="col-sm-3 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
|
|
<label class="col-sm-3 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
|
@ -164,123 +154,274 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</form> |
|
|
</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> |
|
|
</div> |
|
|
<th:block th:include="include :: footer" /> |
|
|
<th:block th:include="include :: footer" /> |
|
|
<th:block th:include="include :: select2-js" /> |
|
|
<th:block th:include="include :: select2-js" /> |
|
|
<script th:src="@{/js/activiti.js}"></script> |
|
|
<th:block th:include="include :: datetimepicker-js" /> |
|
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
|
|
<script th:inline="javascript"> |
|
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
|
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|
|
<script type="text/javascript"> |
|
|
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|
|
new Vue({ |
|
|
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
|
el: '#app', |
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
data: function() { |
|
|
var userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
return { |
|
|
var sysCustomerQuote = [[${formData}]]; |
|
|
fileList: [], |
|
|
var prefix = ctx + "system/customerQuote" |
|
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
|
|
var commonCurrency = $("#commonCurrency_edit option:selected").val(); |
|
|
fileDeleteUrl: ctx + "common/deleteFile", |
|
|
$("#form-ywjl-audit").validate({focusCleanup: true}); |
|
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
|
|
$(function() { |
|
|
fileIdList:[], |
|
|
$.ajax({ |
|
|
removeFileIdList:[], |
|
|
url: ctx + 'system/user/list', |
|
|
|
|
|
type: 'post', |
|
|
} |
|
|
success: function (res) { |
|
|
}, |
|
|
console.log(res) |
|
|
mounted() { |
|
|
if (res.rows.length > 0) { |
|
|
|
|
|
var usertData = res.rows; |
|
|
// 控制下拉框选中 |
|
|
for (let i in usertData) { |
|
|
var materialType = $("#materialType").val(); |
|
|
$("#form-ywjl-audit select[name='businessMembers']").append("<option value='" + |
|
|
$("#selectMaterialType").val(materialType).trigger("change"); |
|
|
usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
|
|
|
|
|
|
|
|
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("获取附件失败。"); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
$("#form-ywjl-audit select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change");; |
|
|
|
|
|
} else { |
|
|
|
|
|
$.modal.msgError(res.msg); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}); |
|
|
methods: { |
|
|
var confirmFax = $("input[name='confirmFax']"); |
|
|
uploadSuccess(response, file, fileList) { |
|
|
confirmFax.val([sysCustomerQuote.confirmFax]); |
|
|
console.log(response); |
|
|
$("input[name='rmbTax']").val([sysCustomerQuote.taxRate]); |
|
|
if(response.code == web_status.SUCCESS){ |
|
|
confirmFax.change(function () { |
|
|
var attachFileId = response.data.id; |
|
|
if ($("input[name='confirmFax']").val() == "1") { |
|
|
file.attachFileId = attachFileId; |
|
|
$("input[name='rmbTax']").val(sysCustomerQuote.taxRate); |
|
|
file.isBind = false; |
|
|
} else { |
|
|
this.fileIdList.push(attachFileId); |
|
|
$("input[name='rmbTax']").val(0); |
|
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
|
|
} |
|
|
$.modal.msgSuccess("上传成功"); |
|
|
}); |
|
|
|
|
|
$("#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{ |
|
|
}else{ |
|
|
$.modal.alertError(response.msg); |
|
|
rmb1 = $("#rmbTax_edit").val(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
var rmb = Number(rmb1).toFixed(2) / 100; |
|
|
uploadRemove(file, fileList) { |
|
|
var usd = $("#usdTax_edit").val(); |
|
|
console.log(file, fileList); |
|
|
if (usd =='' || usd== null){ |
|
|
var attachFileId = file.attachFileId; |
|
|
usd = 0; |
|
|
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("删除附件失败。"); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}else{ |
|
|
}else{ |
|
|
var index = this.fileIdList.indexOf(attachFileId); |
|
|
usd = Number(usd).toFixed(2); |
|
|
if(index!=-1){ |
|
|
} |
|
|
this.fileIdList.splice(index,1); |
|
|
console.log(commonCurrency1); |
|
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
|
|
if(commonCurrency1 == 1){ |
|
|
// 保存的时候才删除 |
|
|
row.materialRmb = Number(row.materialNoRmb * Number(1 + rmb)); |
|
|
this.removeFileIdList.push(attachFileId); |
|
|
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2); |
|
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
|
|
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() |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}; |
|
|
}) |
|
|
$.table.init(options); |
|
|
|
|
|
|
|
|
var prefix = ctx + "erp/bom"; |
|
|
|
|
|
$("#form-edit").validate({ |
|
|
|
|
|
focusCleanup: true |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
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() { |
|
|
function submitHandler() { |
|
|
if ($.validate.form()) { |
|
|
if ($.validate.form()) { |
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
|
var materialType = $('#selectMaterialType').select2('val'); |
|
@ -289,10 +430,9 @@ |
|
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
|
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
|
|
} |
|
|
} |
|
|
var taskId = [[${taskId}]]; |
|
|
var taskId = [[${taskId}]]; |
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-ywjl-audit').serialize()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
</html> |
|
|
</html> |