123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713 |
- <%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
- <html>
- <head>
- <title>采购的名单管理</title>
- <meta name="decorator" content="default"/>
- <script type="text/javascript">
- $(document).ready(function() {
- //$("#name").focus();
- $("#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);
- }
- }
- });
- $(":radio[name='invoice']").click(function () {
- var index = $(":radio[name='invoice']").index($(this));
- if (index == 1) //选中第2个时,div显示
- $("#invoiceTable").show();
- else //当被选中的不是第2个时,div隐藏
- $("#invoiceTable").hide();
- });
- var lenght =${fn:length(contractOrder.clubsubbranchList)};
- for (var i = 0; i < lenght; i++) {
- loadCity(i);
- }
- var $totalFees=$("#productTable").find("[name*='totalFee']");
- $totalFees.each(function(index,element){
- var totalFee = $(this).val();
- var totalFeeNumber = Number(totalFee);//当个商品总结
- $("#orderProduct" + index + "\\.shouldPayFee").val(totalFeeNumber);
- })
- //再次修改时候界面不能是数据库四舍五入值,(重新计算机最新值展示以防修改)
- var changeValue = $("#changeValue").val();//经理折扣金额
- if(null !=changeValue && ''!=changeValue){
- setProductTotalFee();
- }
- });
- function showProductSelect(contractId) {
- top.$.jBox("iframe:${ctx}/bulkpurchase/orderProduct/getContractpRroduct?contractId=" + contractId, {
- iframeScrolling: 'yes',
- width: $(top.document).width() - 330,
- height: $(top.document).height() - 160,
- persistent: true,
- showScrolling: false,
- title: "选择商品",
- bottomText: '请从可供选择的项目中选择一个',
- buttons: {"确定": '1', "关闭": '-1'},
- submit: function (v, h, f) {
- //确定
- var $jboxFrame = top.$('#jbox-iframe');
- var $mainFrame = top.$('#mainFrame');
- if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
- var items = $jboxFrame[0].contentWindow.getCheckedItems();
- if (items.length > 0) {
- setProductSelect(items);
- return true;
- } else {
- top.$.jBox.tip("请选择...");
- return false;
- }
- }
- return true;
- }
- });
- }
- function setProductSelect(items) {
- var item=items[0];
- var flag="false";
- $.ajax({
- url: "${ctx}/bulkpurchase/contractOrder/PutSession",
- data: {"items": item},
- type: "POST",
- async: false,
- success: function(data){
- flag=data.success;
- }
- });
- if(flag=='true'){
- closeP();
- }
- }
- function closeP(){
- var path = "${ctx}/bulkpurchase/contractOrder/putProductToOrder";
- $(".error").remove();
- $("#inputForm").attr("action", path).submit();
- }
- function managerDiscount(){
- var booleanFlag = setProductTotalFee();
- if(false !=booleanFlag){//有错误则不显示经理折扣
- var addValue = $("#addValue").text("已经理折扣");
- }
- }
- //经理折扣后计算
- function setProductTotalFee() {
- var changeValue = $("#changeValue").val();//经理折扣金额
- if(null ==changeValue || ''==changeValue){
- alertx("请先输入");
- var addValue = $("#addValue").text("");
- return false;
- }
- if(isNaN(changeValue)){
- alertx("您输入的折扣有误");
- $("#changeValue").focus();
- var addValue = $("#addValue").text("");
- return false;
- }
- var productTotalFeeNumber = parseFloat($("#productTotalFee").val());//商品总金额
- var dis = parseFloat(changeValue);//经理折扣金额
- //检查输入的折扣如果存在小数点最多只能两位
- var checknumFlag = checknum(dis);
- if(checknumFlag == false){
- return false;
- }
- var shouldPayFeeNumber = (productTotalFeeNumber*100000 - dis*100000)/10000;//应付金额数量
- shouldPayFeeNumber=((shouldPayFeeNumber).toFixed(1)/10).toFixed(2);
- if (shouldPayFeeNumber < 0.01) {
- $("#changeValue").val(0);
- alertx("您输入的折扣大于实付金额");
- var addValue = $("#addValue").text("");
- return false;
- } else if (shouldPayFeeNumber - dis == 0) {
- alertx("您输入的折扣等于实付金额");
- var addValue = $("#addValue").text("");
- return false;
- } else {
- var payTotalFee = $("#payTotalFee").val(shouldPayFeeNumber);
- var $totalFees=$("#productTable").find("[name*='totalFee']");
- $totalFees.each(function(index,element){
- var totalFee = $(this).val();
- var totalFeeNumber = Number(totalFee);//单个商品总金额
- var shouldPayFees = ((shouldPayFeeNumber * totalFeeNumber * 100000) / productTotalFeeNumber) / 10000; // 单个商品应付金额
- shouldPayFees=((shouldPayFees).toFixed(1)/10).toFixed(2);
- $("#shouldPayFee"+index).text(shouldPayFees);
- $("#orderProduct"+index+"\\.shouldPayFee").val(shouldPayFees);
- //单个商品应付隐藏域
- $("#shouldPayFeeHidden"+index).val(((shouldPayFeeNumber * totalFeeNumber * 100000) / productTotalFeeNumber) / 100000);
- var difference = totalFeeNumber - shouldPayFees;
- // 获取隐藏域的应付费用
- var cmFeeHidden = Number($("#cmFeeHidden"+index).val());
- var otherFeeHidden = Number($("#otherFeeHidden"+index).val());
- var totalProfit = (otherFeeHidden + cmFeeHidden) - difference;// 总盈利
- var totalCount = otherFeeHidden + cmFeeHidden;
- //除数和被除数都不能为0
- if(totalProfit != 0 && totalCount != 0 ){
- var profitRatio = totalProfit / (totalCount)// 盈利比
- }else{
- profitRatio =0;
- }
- /* //计算单个商品总增值税(久算法:(应付总额/商品总额)x 总价x 税率)
- var shouldPay = (((shouldPayFeeNumber * totalFeeNumber * 100000) / productTotalFeeNumber) / 10000).toFixed(1)/10;//单个商品应付总额
- var taxRateHidden = Number($("#taxRateHidden"+index).val());//税率
- var totalAddedValueTax = (shouldPay * (taxRateHidden / 100)).toFixed(2);*/
- if(profitRatio != 0){
- var otherFee = (((profitRatio * otherFeeHidden * 100000) / 10000).toFixed(1) / 10).toFixed(2);// 应付第三方
- }else{
- otherFee = 0;
- }
- var shouldPay = (((shouldPayFeeNumber * totalFeeNumber * 100000) / productTotalFeeNumber) / 10000).toFixed(1)/10;//单个商品应付总额
- //计算单个商品总增值税(新算法:(应付金额-[应付金额/(1+税率)](最后保留2位小数+四舍五入 ))
- var taxRateHidden = Number($("#taxRateHidden"+index).val());//税率
- var tax = ((shouldPay * 100000)/(1 * 100000 + (taxRateHidden / 100) * 100000)).toFixed(2);
- var totalTax =(shouldPay - tax);
- var totalAddedValueTax = (totalTax).toFixed(2);
- //计算单个商品应付采美(算法: 应付采美=应付金额-应付供应商-应付第三方-税费)
- var shopFee = Number($("#shopFeeHidden"+index).val());
- // var cmFee = (((profitRatio * cmFeeHidden * 100000) / 10000).toFixed(1) / 10).toFixed(2);// 应付采美
- var cmFee = (((shouldPay * 100000)-(shopFee * 100000)-(otherFee * 100000)-(totalAddedValueTax * 100000))/100000).toFixed(2) ;// 应付采美
- $("#otherFee"+index).text(otherFee);
- $("#cmFee"+index).text(cmFee);
- $("#totalAddedValueTax"+index).text(totalAddedValueTax);
- //更新提交隐藏域值
- $("#orderProduct"+index+"\\.totalAddedValueTax").val(totalAddedValueTax);
- $("#orderProduct"+index+"\\.otherFee").val(otherFee);
- $("#orderProduct"+index+"\\.cmFee").val(cmFee);
- });
- $("#discount").val(dis);
- $("#payPrice").text(keepTwoDecimalFull(((productTotalFeeNumber*1000 - dis*1000)/1000)));
- }
- }
- //检查输入的折扣如果存在小数点最多只能两位
- function checknum(obj){
- var reg=/^\d+[.]?\d{0,2}$/;
- if(!reg.test(obj)){
- alertx("经理折扣必须为整数或者两位小数以内的值");
- var addValue = $("#addValue").text("");
- return false;
- }
- }
- function retultAlert() {
- alertx("请先添加商品");
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li><a href="${ctx}/bulkpurchase/contractOrder?contractId=${contractOrder.contractId}">采购的订单列表</a></li>
- <li class="active"><a
- href="${ctx}/bulkpurchase/contractOrder/form?id=${contractOrder.id}&contractId=${contractOrder.contractId}">采购的订单<shiro:hasPermission
- name="contractorder:contractOrder:edit">${not empty contractOrder.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission
- name="contractorder:contractOrder:edit">查看</shiro:lacksPermission></a></li>
- </ul>
- <br/>
- <form:form id="inputForm" modelAttribute="contractOrder" action="${ctx}/bulkpurchase/contractOrder/save" method="post" class="form-horizontal">
- <form:hidden path="id"/>
- <form:hidden path="contractId"/>
- <sys:message content="${message}"/>
- <input type="hidden" id="curProvince" name="curProvince" value="${contractOrder.bpOrderUserinfo.province }" disabled="disabled">
- <input type="hidden" id="curCity" name="curCity" value="${contractOrder.bpOrderUserinfo.city }" disabled="disabled">
- <input type="hidden" id="curTown" name="curTown" value="${contractOrder.bpOrderUserinfo.town }" disabled="disabled">
- <table id="contentTable" class="table table-striped table-bordered table-condensed">
- <form:hidden path="bpOrderUserinfo.id"/>
- <form:hidden path="bpOrderUserinfo.clubId"/>
- <form:hidden path="bpOrderUserinfo.userId"/>
- <form:hidden path="orderInvoice.id"/>
- <thead>
- <tr>
- <td colspan="4">用户信息</td>
- </tr>
- </thead>
- <tr>
- <td>买家</td>
- <td><form:input path="bpOrderUserinfo.name" readonly="true"/></td>
- <td>订单号</td>
- <td><form:input path="no" readonly="true" class="input-xlarg required"/></td>
- </tr>
- <tr>
- <td>收货人<span class="help-inline"><font color="red">*</font> </span></td>
- <td><form:input path="bpOrderUserinfo.shouHuoRen" class="input-medium required"/></td>
- <td>手机<span class="help-inline"><font color="red">*</font> </span></td>
- <td><form:input path="bpOrderUserinfo.mobile" minlength="11" maxlength="11" class="input-medium required " /></td>
- </tr>
- <tr>
- <td>电话</td>
- <td><form:input path="bpOrderUserinfo.phone" class="input-medium " /></td>
- <td> 收货地址</td>
- <td><%--form:input path="bpOrderUserinfo.address" class="input-medium required"/>--%>
- <form:select path="bpOrderUserinfo.province" class="input-xlarge required" id="province" onchange="loadCity()" style="width:100px;">
- <form:option value="" label="省" provinceId=""/>
- </form:select>
- <form:select path="bpOrderUserinfo.city" class="input-xlarge required" id="city" onchange="loadTown()" style="width:100px;">
- <form:option value="" label="市" cityId=""/>
- </form:select>
- <form:select path="bpOrderUserinfo.town" class="input-xlarge required" id="town" style="width:100px;">
- <form:option value="" label="区"/>
- </form:select>
- <from:input path="bpOrderUserinfo.address" class="input-group required"></from:input>
- </td>
- </tr>
- <c:if test="${not empty contractOrder.contract}">
- <tr>
- <td>采购编号</td>
- <td>${contractOrder.contract.no}</td>
- </tr>
- </c:if>
- </table>
- <br>
- <table id="orderTable" class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <td colspan="4">订单详情</td>
- </tr>
- </thead>
- <tr>
- <td>收货人邮编</td>
- <td><form:input path="bpOrderUserinfo.postalCode"/></td>
- <td>下单时间</td>
- <td><fmt:formatDate value="${contractOrder.createDate}" pattern="yyyy-MM-dd HH:mm"/></td>
- </tr>
- <tr>
- <td>支付方式</td>
- <td>
- <form:select path="payWay" class="input-medium required">
- <form:options items="${fns:getDictList('bp_order_pay')}" itemLabel="label" itemValue="value"
- htmlEscape="false"/>
- </form:select>
- </td>
- <td>订单状态</td>
- <td>
- <%--<form:select path="status" class="input-medium required">--%>
- <%--<form:options items="${fns:getDictList('order_status')}" itemLabel="label" itemValue="value"--%>
- <%--htmlEscape="false"/>--%>
- <%--</form:select>--%>
- ${fns:getDictLabel(contractOrder.status,'order_status' ,'未付款' )}
- </td>
- </tr>
- <tr>
- <td>订单备注</td>
- <td><form:input path="remarks"/></td>
- <td>来源</td><td>${fns:getDictLabel(contractOrder.orderSource,'bp_orderSource' ,'' )}
- <from:hidden path="orderSource"></from:hidden>
- <%--<from:select path="orderSource" class="input-medium required" disabled="true">
- <form:options items="${fns:getDictList('bp_orderSource')}" itemLabel="label" itemValue="value"
- htmlEscape="false"/>
- </from:select>--%>
- </td>
- </tr>
- </table>
- <c:if test="${empty contractOrder.confirmFlag || contractOrder.confirmFlag eq 0 }">
- <input type="button" value="添加商品" class="btn btn-primary" onclick="showProductSelect(${contractOrder.contractId})"/>
- </c:if>
- <table id="productTable" class="table table-striped table-bordered table-condensed">
- <tr>
- <th>商品ID</th>
- <th>商品名称</th>
- <th>供应商名称</th>
- <th>数量(赠品数)</th>
- <th>单价</th>
- <th>折扣</th>
- <th>折后单价</th>
- <th>税率</th>
- <th>单个税费</th>
- <th>税费</th>
- <th>总价</th>
- <th>应付金额</th>
- <th>应付供应商</th>
- <th>应付第三方</th>
- <th>应付采美</th>
- </tr>
- <c:if test="${not empty contractOrder.orderProduct}">
- <c:forEach items="${contractOrder.orderProduct}" var="orderProduct" varStatus="step">
- <from:hidden path="orderProduct[${step.index}].orderId"/>
- <from:hidden path="orderProduct[${step.index}].contractId"/>
- <from:hidden path="orderProduct[${step.index}].shopId"/>
- <from:hidden path="orderProduct[${step.index}].productId"/>
- <tr class="indexp">
- <td>
- ${orderProduct.productId}
- <form:hidden path="orderProduct[${step.index}].id"/>
- <form:hidden path="orderProduct[${step.index}].contractProductId"/>
- </td>
- <td>
- <div style='width:120px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;' title='${orderProduct.name}'>${orderProduct.name}</div>
- <form:hidden path="orderProduct[${step.index}].name"/>
- </td>
- <td>
- <div style='width:120px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;' title='${orderProduct.shopName}'>${orderProduct.shopName}</div>
- <form:hidden path="orderProduct[${step.index}].shopName"/>
- </td>
- <td>
- ${orderProduct.num}(${orderProduct.presentNum})
- <form:hidden path="orderProduct[${step.index}].num"/>
- <form:hidden path="orderProduct[${step.index}].presentNum"/>
- </td>
- <td>
- <fmt:formatNumber value="${orderProduct.price}" type="currency" pattern="0.00"/>
- <form:hidden path="orderProduct[${step.index}].price"/>
- </td>
- <td>
- <fmt:formatNumber value="${orderProduct.discount/100}" type="currency" pattern="0.00%"/>
- <form:hidden path="orderProduct[${step.index}].discount"/>
- </td>
- <td>
- <fmt:formatNumber value="${orderProduct.discountPrice}" type="currency" pattern="0.00"/>
- <form:hidden path="orderProduct[${step.index}].discountPrice"/>
- </td>
- <td>
- <fmt:formatNumber value="${orderProduct.taxRate/100}" type="currency" pattern="0%"/>
- <form:hidden path="orderProduct[${step.index}].taxRate"/>
- <input type="hidden" id="taxRateHidden${step.index}" value="${orderProduct.taxRate}">
- </td>
- <td>
- <fmt:formatNumber value="${orderProduct.addedValueTax}" type="currency" pattern="0.00"/>
- <form:hidden path="orderProduct[${step.index}].addedValueTax"/>
- </td>
- <td>
- <span id="totalAddedValueTax${step.index}"><fmt:formatNumber value="${orderProduct.totalAddedValueTax}" type="currency" pattern="0.00"/></span>
- <form:hidden path="orderProduct[${step.index}].totalAddedValueTax"/>
- <input type="hidden" id="totalAddedValueTaxHidden${step.index}" value="${orderProduct.totalAddedValueTax}">
- </td>
- <td>
- <fmt:formatNumber value="${orderProduct.totalFee}" type="currency" pattern="0.00"/>
- <form:hidden path="orderProduct[${step.index}].totalFee"/>
- </td>
- <td>
- <span id="shouldPayFee${step.index}"><fmt:formatNumber value= "${empty orderProduct.shouldPayFee ? (orderProduct.totalFee) : (orderProduct.shouldPayFee)}" type="currency" pattern="0.00"/>
- </span>
- <form:hidden path="orderProduct[${step.index}].shouldPayFee"/>
- <input type="hidden" id="shouldPayFeeHidden${step.index}" value="">
- </td>
- <td>
- <span id="shopFee${step.index}"><fmt:formatNumber value= "${orderProduct.shopFee}" type="currency" pattern="0.00"/></span>
- <form:hidden path="orderProduct[${step.index}].shopFee"/>
- <input type="hidden" id="shopFeeHidden${step.index}" value="${orderProduct.shopFee}">
- </td>
- <td>
- <span id="otherFee${step.index}"><fmt:formatNumber value= "${orderProduct.otherFee}" type="currency" pattern="0.00"/></span>
- <form:hidden path="orderProduct[${step.index}].otherFee"/>
- <input type="hidden" id="otherFeeHidden${step.index}" value="${empty orderProduct.otherBppFee ? (orderProduct.otherFee) : (orderProduct.otherBppFee)}">
- </td>
- <td>
- <span id="cmFee${step.index}"><fmt:formatNumber value= "${orderProduct.cmFee}" type="currency" pattern="0.00"/></span>
- <form:hidden path="orderProduct[${step.index}].cmFee"/>
- <input type="hidden" id="cmFeeHidden${step.index}" value="${empty orderProduct.cmBppFee ? (orderProduct.cmFee) : (orderProduct.cmBppFee)}">
- </td>
- </tr>
- </c:forEach>
- </c:if>
- </table>
- <br><br>
- <table id="orderPrice" class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <td colspan="4">订单金额</td>
- </tr>
- </thead>
- <tr>
- <td>商品总金额</td>
- <td>
- <c:if test="${ empty contractOrder.productTotalFee}">0.00元</c:if>
- <c:if test="${ !empty contractOrder.productTotalFee}">
- <fmt:formatNumber value="${contractOrder.productTotalFee}" type="currency" pattern="0.00"/>元</c:if>
- </td>
- <form:hidden path="productTotalFee"/>
- <td>商品总数</td>
- <td><c:if test="${ empty contractOrder.productCount}">0</c:if>
- <c:if test="${ !empty contractOrder.productCount}">
- <fmt:formatNumber value="${contractOrder.productCount}" type="currency" pattern="0"/>
- </c:if>
- </td>
- <form:hidden path="productCount"/>
- </tr>
- <tr>
- <td>账户余额支付金额</td>
- <td><c:if test="${ empty contractOrder.balancePayFee||contractOrder.balancePayFee==null}">0.00元</c:if>
- <c:if test="${ !empty contractOrder.balancePayFee}">
- <fmt:formatNumber value="${contractOrder.balancePayFee}" type="currency" pattern="0.00"/>
- 元</c:if>
- </td>
- <td>赠送商品数</td>
- <td>
- <c:if test="${ empty contractOrder.presentCount}">0</c:if>
- <c:if test="${ !empty contractOrder.presentCount}">
- <fmt:formatNumber value="${contractOrder.presentCount}" type="currency" pattern="0"/>
- </c:if>
- <form:hidden path="presentCount"/>
- </td>
- </tr>
- <tr>
- <td>订单总额</td>
- <td>
- <c:if test="${ empty contractOrder.orderTotalFee}">0.00 元</c:if>
- <c:if test="${ !empty contractOrder.orderTotalFee}">
- <fmt:formatNumber value="${contractOrder.orderTotalFee}" type="currency" pattern="0.00"/> 元</c:if>
- </td>
- <form:hidden path="orderTotalFee"/>
- <td>运费</td>
- <td> ${contractOrder.freePostFlag ==0?"包邮":"到付"}
- <form:hidden path="freePostFlag"/>
- </td>
- </tr>
- <tr>
- <td>经理折扣</td>
- <td>
- <input type="text" id="changeValue" name="changeValue" value="<fmt:formatNumber value="${contractOrder.discount}" type="currency" pattern="0.00"/>"/>
- <c:if test="${empty contractOrder.orderProduct}">
- <c:if test="${empty contractOrder.confirmFlag || contractOrder.confirmFlag eq 0 }"><input type="button" onchange="retultAlert()" value="确认折扣" </c:if>
- </c:if>
- <c:if test="${!empty contractOrder.orderProduct}">
- <c:if test="${empty contractOrder.confirmFlag || contractOrder.confirmFlag eq 0 }"><input type="button" onclick="managerDiscount()"value="确认折扣"></c:if>
- <span id="addValue" style="color: red"></span>
- </c:if>
- <from:hidden path="discount"/></td>
- </td>
- <td>应付总额</td>
- <td>
- <span id="payPrice"><c:if test="${ empty contractOrder.payTotalFee}">0.00 元</c:if>
- <c:if test="${ !empty contractOrder.payTotalFee}">
- <fmt:formatNumber value="${contractOrder.payTotalFee}" type="currency" pattern="0.00"/> 元</c:if>
- </span>
- <form:hidden path="payTotalFee"/>
- </td>
- </tr>
- </table>
- <br>
- <c:if test="${empty contractOrder.confirmFlag || contractOrder.confirmFlag eq 0 }">
- <c:if test="${empty contractOrder.orderInvoice.invoiceTitle}">
- <div>
- <input type="radio" name="invoice" checked="checked"> 不需要发票
- <input type="radio" name="invoice"> 需要发票
- </div>
- <div class="panel panel-default" id="invoiceTable" style="display:none">
- <table class="table">
- <td>发票类型</td>
- <td><input type="radio" checked="checked">普通发票</td>
- <tr>
- <td>发票内容</td>
- <td><input type="radio" checked="checked">明细</td>
- </tr>
- <tr>
- <td>发票抬头</td>
- <td><form:input path="orderInvoice.invoiceTitle"/></td>
- </tr>
- </table>
- </div>
- </c:if>
- <c:if test="${!empty contractOrder.orderInvoice.invoiceTitle}">
- <div>
- <input type="radio" name="invoice"> 不需要发票
- <input type="radio" name="invoice" checked="checked"> 需要发票
- </div>
- <div class="panel panel-default" id="invoiceTable">
- <table class="table">
- <td>发票类型</td>
- <td><input type="radio" checked="checked">普通发票</td>
- <tr>
- <td>发票内容</td>
- <td><input type="radio" checked="checked">明细</td>
- </tr>
- <tr>
- <td>发票抬头</td>
- <td><form:input path="orderInvoice.invoiceTitle"/></td>
- </tr>
- </table>
- </div>
- </c:if>
- </c:if>
- <c:if test="${contractOrder.confirmFlag eq 1 }">
- <c:if test="${!empty contractOrder.id}">
- <c:if test="${empty contractOrder.orderInvoice.invoiceTitle}">
- <div>
- <input type="radio" name="invoice" checked="checked"> 不需要发票
- </c:if>
- <c:if test="${!empty contractOrder.orderInvoice.invoiceTitle}">
- <div>
- <input type="radio" name="invoice" checked="checked"> 需要发票
- </div>
- <div class="panel panel-default" id="invoiceTable">
- <table class="table">
- <td>发票类型</td>
- <td><input type="radio" checked="checked">普通发票</td>
- <tr>
- <td>发票内容</td>
- <td><input type="radio" checked="checked">明细</td>
- </tr>
- <tr>
- <td>发票抬头</td>
- <td><form:input path="orderInvoice.invoiceTitle"/></td>
- </tr>
- </table>
- </div>
- </div>
- </c:if>
- </c:if>
- </c:if>
- <div class="form-actions">
- <c:if test="${empty contractOrder.confirmFlag || contractOrder.confirmFlag eq 0 }">
- <shiro:hasPermission name="contractorder:contractOrder:orderEdit"><input id="btnSubmit" class="btn btn-primary"
- type="submit"
- value="保 存"/> </shiro:hasPermission>
- </c:if>
- <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
- </div>
- </form:form>
- <script type="text/javascript">
- var curProvince = $("#curProvince").val();
- var curCity = $("#curCity").val();
- var curTown = $("#curTown").val();
- $(function() {
- $.ajax({
- type: 'POST',
- dataType: 'json',
- url: '/area/loadProvince',
- success: function(data) {
- $("#province").html("");
- $("#province").append("<option value=''>省</option>");
- for(var i=0; i<data.length; i++) {
- if(curProvince != '' && curProvince != null && typeof(curProvince) != "undefined" && curProvince == data[i].name) {
- $("#province").append("<option value='" + data[i].name + "' provinceId=" + data[i].id +" selected>" + data[i].name +"</option>");
- $(".select2-chosen").eq(0).html(curProvince);
- loadCity();
- } else {
- $("#province").append("<option value='" + data[i].name + "' provinceId=" + data[i].id +">" + data[i].name +"</option>");
- }
- }
- }
- });
- });
- function loadCity() {
- var provinceId = $("#province option:selected").attr("provinceId");
- $("#town").html("");
- $(".select2-chosen").eq(2).html("区");
- $("#town").append("<option value=''>区</option>");
- if(typeof(provinceId) != "undefined") {
- $.ajax({
- type: 'POST',
- dataType: 'json',
- data: {'provinceId':provinceId},
- url: '/area/loadCity',
- success: function(data) {
- $(".select2-chosen").eq(1).html("市");
- $("#city").html("");
- $("#city").append("<option value=''>市</option>");
- for(var i=0; i<data.length; i++) {
- if(curCity != null && typeof(curCity) != "undefined" && curCity == data[i].name) {
- $("#city").append("<option value='" + data[i].name + "' selected cityId=" + data[i].id +">" + data[i].name +"</option>");
- $(".select2-chosen").eq(1).html(curCity);
- loadTown();
- } else {
- $("#city").append("<option value='" + data[i].name + "' cityId=" + data[i].id +">" + data[i].name +"</option>");
- }
- }
- }
- });
- } else {
- $("#city").html("");
- $(".select2-chosen").eq(1).html("市");
- $("#city").append("<option value=''>市</option>");
- $("#town").html("");
- $(".select2-chosen").eq(2).html("区");
- $("#town").append("<option value=''>区</option>");
- }
- }
- function loadTown() {
- var cityId = $("#city option:selected").attr("cityId");
- if(typeof(cityId) != "undefined") {
- $.ajax({
- type: 'POST',
- dataType: 'json',
- data: {'cityId':cityId},
- url: '/area/loadTown',
- success: function(data) {
- $(".select2-chosen").eq(2).html("区");
- $("#town").html("");
- $("#town").append("<option value=''>区</option>");
- for(var i=0; i<data.length; i++) {
- if(curTown != null && typeof(curTown) != "undefined" && curTown == data[i].name) {
- $("#town").append("<option value='" + data[i].name + "' selected>" + data[i].name +"</option>");
- $(".select2-chosen").eq(2).html(curTown);
- } else {
- $("#town").append("<option value='" + data[i].name + "'>" + data[i].name +"</option>");
- }
- }
- }
- });
- } else {
- $("#town").html("");
- $(".select2-chosen").eq(2).html("区");
- $("#town").append("<option value=''>区</option>");
- }
- }
- </script>
- </body>
- </html>
|