|
@@ -0,0 +1,234 @@
|
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
|
+<html>
|
|
|
|
+<head>
|
|
|
|
+ <title>材料库</title>
|
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
|
+ <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
|
|
|
|
+ <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
|
|
|
|
+ <script src="${ctxStatic}/common/html/js/script.js"></script>
|
|
|
|
+ <style>
|
|
|
|
+ #contractTypeDoc-error{
|
|
|
|
+ top:80px;
|
|
|
|
+ left:0;
|
|
|
|
+ }
|
|
|
|
+ /*超过5个汉字,调整label的长度,以下是配套的*/
|
|
|
|
+ .layui-item .layui-form-label{
|
|
|
|
+ width:90px;
|
|
|
|
+ }
|
|
|
|
+ .form-group .layui-item .layui-input-block,
|
|
|
|
+ .query .layui-input-block {
|
|
|
|
+ margin-left: 116px;
|
|
|
|
+ }
|
|
|
|
+ #workInvoiceProjectRelationList td{
|
|
|
|
+ padding-left: 0px;
|
|
|
|
+ padding-right: 0px;
|
|
|
|
+ }
|
|
|
|
+ </style>
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
+ var validateForm;
|
|
|
|
+ function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
|
|
|
|
+ //debugger
|
|
|
|
+ if(validateForm.form()){
|
|
|
|
+ $("#inputForm").submit();
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ parent.layer.msg("信息未填写完整!", {icon: 5});
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
+
|
|
|
|
+ layui.use(['form', 'layer'], function () {
|
|
|
|
+ var form = layui.form;
|
|
|
|
+ });
|
|
|
|
+ validateForm = $("#inputForm").validate({
|
|
|
|
+ submitHandler: function(form){
|
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
|
+ form.submit();
|
|
|
|
+ },
|
|
|
|
+ errorContainer: "#messageBox",
|
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
|
+
|
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
|
+ } else {
|
|
|
|
+ error.insertAfter(element);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /*--------------*/
|
|
|
|
+ $("#attachment_btn").click(function () {
|
|
|
|
+ $("#attachment_file").click();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ function newSetPNumber(obj,label,ids,isProject,details){
|
|
|
|
+ $("#projectNumber").val(obj)
|
|
|
|
+ $("#projectName").val(label)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function num(obj){
|
|
|
|
+
|
|
|
|
+ obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
|
|
|
|
+ obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
|
|
|
|
+ obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
|
|
|
|
+ obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
|
|
|
+ obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
|
|
|
|
+ var id = obj.id
|
|
|
|
+ var taxRate = $("#taxRate").val();
|
|
|
|
+ if(taxRate){
|
|
|
|
+ var projectPriceExcludingTax = parseFloat($("#projectPriceExcludingTax").val()) || 0;
|
|
|
|
+ if(projectPriceExcludingTax !== 0){
|
|
|
|
+ var rate = parseFloat(taxRate) / 100; // 将百分比税率转为小数
|
|
|
|
+ var projectPriceIncludingTax = projectPriceExcludingTax * (1 + rate);
|
|
|
|
+
|
|
|
|
+ // 四舍五入保留两位小数
|
|
|
|
+ projectPriceIncludingTax = Math.round(projectPriceIncludingTax * 100) / 100;
|
|
|
|
+
|
|
|
|
+ // 确保结果显示两位小数(如100 → 100.00)
|
|
|
|
+ $("#projectPriceIncludingTax").val(projectPriceIncludingTax.toFixed(2));
|
|
|
|
+ }else{
|
|
|
|
+ $("#projectPriceIncludingTax").val("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var marketPriceExcludingTax = parseFloat($("#marketPriceExcludingTax").val()) || 0;
|
|
|
|
+ if(marketPriceExcludingTax !== 0){
|
|
|
|
+
|
|
|
|
+ var rate = parseFloat(taxRate) / 100; // 将百分比税率转为小数
|
|
|
|
+ var marketPriceIncludingTax = marketPriceExcludingTax * (1 + rate);
|
|
|
|
+
|
|
|
|
+ // 四舍五入保留两位小数
|
|
|
|
+ marketPriceIncludingTax = Math.round(marketPriceIncludingTax * 100) / 100;
|
|
|
|
+
|
|
|
|
+ // 确保结果显示两位小数(如100 → 100.00)
|
|
|
|
+ $("#marketPriceIncludingTax").val(marketPriceIncludingTax.toFixed(2));
|
|
|
|
+ }else{
|
|
|
|
+ $("#marketPriceIncludingTax").val("");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ $("#projectPriceIncludingTax").val("");
|
|
|
|
+ $("#marketPriceIncludingTax").val("");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ </script>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+<div class="single-form">
|
|
|
|
+ <div class="container">
|
|
|
|
+ <form:form id="inputForm" modelAttribute="projectMaterialStorage" method="post" class="layui-form">
|
|
|
|
+ <form:hidden path="id"/>
|
|
|
|
+ <form:hidden path="projectNumber"/>
|
|
|
|
+ <div class="form-group layui-row first">
|
|
|
|
+ <div class="form-group-label"><h2>材料详情</h2></div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label"><span class="require-item invoicetype">*</span>项目名称</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input class="form-control layui-input" readonly id="projectName" name="projectName" value="${projectMaterialStorage.projectName}">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label"><span class="require-item invoicetype">*</span>材料名称</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="materialName" path="materialName" htmlEscape="false" readonly="true" placeholder="请输入材料名称" class="form-control layui-input" required="true" maxlength="240"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">规格型号</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="specifications" path="specifications" htmlEscape="false" readonly="true" placeholder="请输入规格型号" class="form-control layui-input" maxlength="240"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label"><span class="require-item invoicetype" >*</span>单位</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="unit" path="unit" htmlEscape="false" placeholder="请输入单位" readonly="true" class="form-control required layui-input" maxlength="30" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label double-line">工程价(元,不含税)</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="projectPriceExcludingTax" path="projectPriceExcludingTax" htmlEscape="false" readonly="true" placeholder="请输入工程价(元,不含税)" class="form-control layui-input" onkeyup="num(this)" maxlength="10"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label double-line">市场价(元,不含税)</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="marketPriceExcludingTax" path="marketPriceExcludingTax" htmlEscape="false" readonly="true" placeholder="请输入市场价(元,不含税)" class="form-control layui-input" onkeyup="num(this)" maxlength="10"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label double-line">含税工程价(元)</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input class="form-control layui-input" readonly id="projectPriceIncludingTax" name="projectPriceIncludingTax" value="${projectMaterialStorage.projectPriceIncludingTax}">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label double-line">含税市场价(元)</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input class="form-control layui-input" readonly id="marketPriceIncludingTax" name="marketPriceIncludingTax" value="${projectMaterialStorage.marketPriceIncludingTax}">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">税率(%)</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="taxRate" path="taxRate" htmlEscape="taxRate" placeholder="请输入税率(%)" readonly="true" class="form-control layui-input" onkeyup="num(this)" maxlength="10"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">价格来源</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input class="form-control layui-input" readonly id="priceSource" name="priceSource" value="${projectMaterialStorage.priceSource}">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">品牌</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="brand" path="brand" htmlEscape="false" placeholder="请输入品牌" readonly="true" class="form-control layui-input" maxlength="240"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">产品说明</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="explain" path="explain" htmlEscape="false" placeholder="请输入产品说明" readonly="true" class="form-control layui-input" maxlength="800"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">供应商</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:input id="supplier" path="supplier" htmlEscape="false" placeholder="请输入供应商" readonly="true" class="form-control layui-input" maxlength="240" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
|
+ <label class="layui-form-label">报价时间</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <input class="form-control layui-input" readonly id="quotedPriceDate" name="quotedPriceDate" value="<fmt:formatDate value="${projectMaterialStorage.quotedPriceDate}" pattern="yyyy-MM"/>">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-item layui-col-sm12 with-textarea">
|
|
|
|
+ <label class="layui-form-label double-line">单体项目描述:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:textarea path="monomerProjectDescription" style="background-color: #f1f1f1" htmlEscape="false" rows="4" readonly="true" placeholder="请输入单体项目描述" class="form-control" maxlength="800"/>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="layui-item layui-col-sm12 with-textarea">
|
|
|
|
+ <label class="layui-form-label">备注:</label>
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
+ <form:textarea id="remarks" path="remarks" style="background-color: #f1f1f1" htmlEscape="false" rows="4" readonly="true" placeholder="请输入备注" class="form-control" maxlength="800"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-group layui-row page-end"></div>
|
|
|
|
+ </form:form>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
|
|
+
|
|
|
|
+</body>
|
|
|
|
+</html>
|