⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editclientinfo.jsp

📁 一个关于tlms的一个小程序 看看能否帮助到别人
💻 JSP
字号:
<%@ include file="/WEB-INF/jsp/common/Taglibs.jsp" %>

<script type="text/javascript" language="javascript">
    function addClientInfo(attributeName) {
        if (validataRecord(attributeName)) {
            var form = document.forms[0];
            if (validateAddedClientInfoBean(form)) {
                form.action = '<c:url value="/admin/clientInfo/addClientInfo.do"/>';
                form.submit();
            }
        }
    }


    function updateClientInfo(attributeName) {
        if (validataRecord(attributeName)) {
            var form = document.forms[0];
            if (validateUpdateClientInfoBean(form)) {
                form.action = '<c:url value="/admin/clientInfo/updateClientInfo.do"/>';
                form.submit();
            }
        }
    }

    function searchClientInfo() {
        var f = document.forms[0];
        f.action = "<c:url value="/admin/clientInfo/searchClientInfo.do"/>";
        f.submit();
    }

    function validataRecord(attributeName) {
        var allRowsArray = document.getElementsByName(attributeName);
        var checkedRowNumber = 0;
        var newArray = new Array();
        var j = 0;
        var businessID = '';
        for (i = 0; i < allRowsArray.length; i++) {
            if (allRowsArray[i].checked) {
                newArray[j] = allRowsArray[i];
                j++;
                checkedRowNumber++;
            }
        }
        if (checkedRowNumber == 0) {
            alert("<bean:message key="label.admin.business.error"/>");
            return false;
        }
        for (j = 0; j < newArray.length; j++) {
            businessID = businessID + newArray[j].value;
            if (newArray.length - 1 != j) {
                businessID += '~';
            }
        }
        document.forms[0].elements['clientInfoBean.businessID'].value = businessID;
        return true;
    }

</script>
<html:form action="/clientInfo/addClientInfo.do">
<html:hidden property="clientInfoBean.id" value="${clientInfoBean.id}"/>
<html:hidden property="clientInfoBean.businessID"/>
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="table1">
<tr>
    <td height="28" colspan="2">
        <img src="<c:url value='/images/dot.gif'/>" width="11" height="11" alt="">
        <bean:message key="label.admin.systemSetting"/> &gt;
        <bean:message key="label.admin.clientInfo.title"/>
    </td>
</tr>
<tr>
    <td width="2%" height="31" class="section">
        <img src="<c:url value='/images/menu_dot.jpg'/>" width="6" height="19" alt="">
    </td>
    <td width="98%" class="section">
        <bean:message key="label.admin.clientInfo.basicInfo"/>
    </td>
</tr>
<tr>
    <td></td>
    <td></td>
</tr>
<tr>
    <td></td>
    <td>
        <table width="100%" height="43" border="0" cellpadding="0" cellspacing="0"
               style="font-size:12px; width:96%" id="table2">
            <tr>
                <td nowrap><bean:message key="label.admin.clientInfo.code"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.code" value="${clientInfoBean.code}" readonly="true"/>
                </td>
                <td nowrap><bean:message key="label.admin.clientInfo.clientCatalog"/></td>
                <td nowrap>
                    <html:select property="clientInfoBean.clientCatalog" value="${clientInfoBean.clientCatalog}">
                        <html:option value=""><bean:message key="label.common.pleaseSelect"/></html:option>
                        <c:forEach items="${clientCatalogList}" var="clientCatalogList">
                            <html:option value="${clientCatalogList[0]}"><c:out value="${clientCatalogList[1]}"/>
                            </html:option>
                        </c:forEach>
                    </html:select>
                </td>
            </tr>
            <tr>
                <td nowrap><bean:message key="label.admin.clientInfo.corpType"/></td>
                <td nowrap>
                    <html:select property="clientInfoBean.corpType" value="${clientInfoBean.corpType}">
                        <html:option value=""><bean:message key="label.common.pleaseSelect"/></html:option>
                        <c:forEach items="${corpTypeList}" var="corpTypeList">
                            <html:option value="${corpTypeList[0]}"><c:out value="${corpTypeList[1]}"/></html:option>
                        </c:forEach>
                    </html:select>
                </td>
                <td nowrap><bean:message key="label.admin.clientInfo.name"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.name" value="${clientInfoBean.name}"/>
                </td>
            </tr>
            <tr>
                <td nowrap><bean:message key="label.admin.clientInfo.calling"/></td>
                <td nowrap>
                    <html:select property="clientInfoBean.calling" value="${clientInfoBean.calling}">
                        <html:option value=""><bean:message key="label.common.pleaseSelect"/></html:option>
                        <c:forEach items="${callingList}" var="callingList">
                            <html:option value="${callingList[0]}"><c:out value="${callingList[1]}"/></html:option>
                        </c:forEach>
                    </html:select>
                </td>
                <td nowrap><bean:message key="label.admin.clientInfo.parentCompany"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.parentCompany" value="${clientInfoBean.parentCompany}"/>
                </td>
            </tr>
            <tr>
                <td nowrap><bean:message key="label.admin.clientInfo.address"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.address" value="${clientInfoBean.address}"/>
                </td>
                <td nowrap><bean:message key="label.admin.clientInfo.area"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.area" value="${clientInfoBean.area}"/>
                </td>
            </tr>
            <tr>
                <td nowrap><bean:message key="label.admin.clientInfo.postalcode"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.postalcode" value="${clientInfoBean.postalcode}"/>
                </td>
                <td nowrap><bean:message key="label.admin.clientInfo.fax"/></td>
                <td nowrap>
                    <html:text property="clientInfoBean.fax" value="${clientInfoBean.fax}"/>
                    &nbsp;<bean:message key="label.admin.clientInfo.example"/>
                </td>
            </tr>

        </table>
    </td>
</tr>

<tr>
    <td>&nbsp;</td><td>&nbsp;</td>
</tr>


<tr>
    <td height="31" class="section">
        <img src="<c:url value="/images/menu_dot.jpg"/>" width="6" height="19" alt="">
    </td>
    <td height="31" class="section">
        <bean:message key="label.admin.business.List"/>
    </td>
</tr>
<tr>
    <td nowrap></td>
    <td nowrap>
        <table width="100%" height="43" border="0" cellpadding="0" cellspacing="0"
               style="font-size:12px; width:96%" id="table3">
            <tr>
                <logic:iterate id="business" collection="${businessList}">
                    <td nowrap>
                        <html:multibox property="businessArr">
                            <c:out value="${business[0]}"/>
                        </html:multibox>
                    </td>
                    <td nowrap>
                        <c:out value="${business[2]}"/>
                    </td>
                </logic:iterate>
            </tr>
        </table>
    </td>
</tr>


<tr>
    <td colspan="2"><hr size="1"></td>
</tr>
<tr>
    <td></td>
    <td>
        <table border="0" cellspacing="0" cellpadding="0" align="left">
            <tr>
                <td width="8" class="ButtonHOMEL-msover"></td>
                <td class="ButtonHOME-msover">
                    <c:choose>
                    <c:when test="${empty clientInfoBean.id}">
                    <a href="#" class="hrefColor" onclick="addClientInfo('businessArr')">
                            <bean:message key="button.save"/>
                        </c:when>
                        <c:otherwise>
                        <a href="#" class="hrefColor" onclick="updateClientInfo('businessArr')">
                                <bean:message key="button.update"/>
                            </c:otherwise>
                            </c:choose>
                </td>
                <td width="8" class="ButtonHOMER-msover"></td>
                <td width="10"></td>
            </tr>
        </table>
        <table border="0" cellspacing="0" cellpadding="0" align="left">
            <tr>
                <td width="8" class="ButtonHOMEL-msover"></td>
                <td class="ButtonHOME-msover">
                    <a href="#" class="hrefColor" onclick="searchClientInfo()">
                        <bean:message key="button.cancel"/>
                    </a>
                </td>
                <td width="8" class="ButtonHOMER-msover"></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <c:choose>
        <c:when test="${empty clientInfoBean.id}">
        </c:when>
        <c:otherwise>
            <logic:iterate id="business2" collection="${selectedBusiness}">
                <html:multibox property="selectedBusinessArr" style="VISIBILITY:hidden;">
                    <c:out value="${business2[3]}"/>
                </html:multibox>
            </logic:iterate>
        </c:otherwise>
    </c:choose>

</tr>
</table>
</div>
</html:form>


<c:choose>
    <c:when test="${empty clientInfoBean.id}">
        <html:javascript formName="/clientInfo/addClientInfo" method="validateAddedClientInfoBean"/>
    </c:when>
    <c:otherwise>
        <html:javascript formName="/clientInfo/updateClientInfo" method="validateUpdateClientInfoBean"/>
    </c:otherwise>
</c:choose>
<script type="text/javascript" language="javascript">
    function getSelectedBusiness() {
        var allselected = document.getElementsByName('selectedBusinessArr');
        var allCheckBox = document.getElementsByName('businessArr');
        for (i = 0; i < allselected.length; i++) {
            for (j = 0; j < allCheckBox.length; j++) {
                if (allCheckBox[j].value == Number(allselected[i].value)) {
                    allCheckBox[j].checked = true;
                }
            }
        }
    }
    getSelectedBusiness();
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -