蔡德晨 5 lat temu
rodzic
commit
be805e5e92

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/mapper/xml/JkxlMapper.xml

@@ -113,7 +113,7 @@
 	</insert>
 
 	<select id="getTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData" resultType="com.jeeplus.modules.sg.entity.TzData">
-		select * from sg_wbs_fee_tz
+		select id,type,fee from sg_wbs_fee_tz
 		<where>
 			<if test="type != null and type != ''">
 				type = #{type} and

+ 18 - 15
src/main/webapp/webpage/modules/sg/free/wbslist.jsp

@@ -67,14 +67,15 @@
             </thead>
             <tbody>
             <c:if test="${ not empty map.list2}">
-                <c:forEach items="${map.list2}" var="data" varStatus="index">
+                <c:forEach items="${map.list2}" var="data2" varStatus="index">
             <tr>
-                <td id=""><c:if test="${data.type eq '1'}">补增值税税率调整差额</c:if><c:if test="${data.type eq '2'}">扣减甲供材超供材料费</c:if></td>
-                <td>${data.fee}</td>
+
+                <td id=""><c:if test="${data2.type eq '1'}">补增值税税率调整差额</c:if><c:if test="${data2.type eq '2'}">扣减甲供材超供材料费</c:if></td>
+                <td>${data2.fee}</td>
                 <td>
-                 <c:forEach items="${map.list1}" var="data2" varStatus="index">
-                    <input type="button" class="layui-btn layui-btn-primary layui-btn-xs" value="调整" onclick="wbsup(${data2.id});"/>
-                 </c:forEach>
+                    <%--<input id="type1" hidden value="${data2.type}">--%>
+                    <input id ="id1" hidden value="${data2.id}">
+                    <input type="button" class="layui-btn layui-btn-primary layui-btn-xs" value="调整" onclick="wbsup(${data2.type});"/>
                 </td>
             </tr>
                 </c:forEach>
@@ -297,22 +298,24 @@
     });
 </script>
 <script>
-    function wbsup(id){
+    function wbsup(type){
+        var id = $("#id1").val();
+        // var type = $("#type1").val();
         $.post(
             // type : "post",
             "${ctx}/jkxl/gettz",
             {"id":id},
             function(result) {
                 var trlue="";
-                // if(type === '1') {
-                    for (var i = 0; i <= result.length; i++) {
-                        trlue = trlue + "<tr><td>" + result.describe + "</td><td>" + result.wbsCode + "</td><td>" + result.originalRate + "</td><td>" + result.bzFee + "</td></tr>";
+                if(type == '1') {
+                    for (var i = 0; i < result.length; i++) {
+                        trlue = trlue + "<tr><td>" + result[i].describe + "</td><td>" + result[i].wbsCode + "</td><td>" + result[i].originalRate + "</td><td>" + result[i].bzFee + "</td></tr>";
+                    }
+                } else {
+                    for (var i = 0; i < result.length; i++) {
+                        trlue = trlue + "<tr><td>" + result[i].describe + "</td><td>" + result[i].wbsCode + "</td><td>" + result[i].originalRate + "</td><td>" + result[i].jkFee + "</td></tr>";
                     }
-                // } else {
-                //     for (var i = 0; i <= result.length; i++) {
-                //         trlue = trlue + "<tr><td>" + result.describe + "</td><td>" + result.wbsCode + "</td><td>" + result.originalRate + "</td><td>" + result.jkFee + "</td></tr>";
-                //     }
-                // }
+                }
 
                 trlue=trlue+"<tr><td>合计</td><td></td><td>100%</td><td></td></tr>";
                 $("#mytbody").html(trlue);