|
|
@@ -93,18 +93,57 @@
|
|
|
selectStorageOrder();
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- if (isFieldEditable('paymentApply.bankName')) {
|
|
|
- $('#selectAccountBtn').click(function() {
|
|
|
- selectSettlementAccount();
|
|
|
+
|
|
|
+ // 绑定收款单位(供应商)选择按钮事件
|
|
|
+ if (isFieldEditable('paymentApply.payeeName')) {
|
|
|
+ $('#selectPayeeBtn').click(function() {
|
|
|
+ selectSupplier();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 绑定收款单位字段变化事件,清空合同、采购订单、入库单和供应商编码
|
|
|
+ $('#payeeName').on('input change', function() {
|
|
|
+ clearRelatedOrders();
|
|
|
+ // 清空供应商编码,这样手动输入后就不能选择采购订单/入库单
|
|
|
+ $('#vendorCode').val('');
|
|
|
});
|
|
|
+
|
|
|
+ // 初始化:如果已有合同,则设置收款单位为只读
|
|
|
+ if ($('#contractId').val()) {
|
|
|
+ $("#payeeName").attr("readonly", "readonly");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
});
|
|
|
|
|
|
//校验表单
|
|
|
function checkForm() {
|
|
|
+ // 验证隐藏域:开户行和账号
|
|
|
+ /* if($.trim($("#bankName").val()) == ''){
|
|
|
+ addError("开户行不能为空!请检查是否已设置默认账户。");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if($.trim($("#bankAccount").val()) == ''){
|
|
|
+ addError("账号不能为空!请检查是否已设置默认账户。");
|
|
|
+ return false;
|
|
|
+ }*/
|
|
|
+
|
|
|
var rs = true;
|
|
|
|
|
|
+ // 验证合同、采购订单、入库单互斥逻辑
|
|
|
+ var contractId = $('#contractId').val();
|
|
|
+ var purchaseOrderNo = $('#purchaseOrderNo').val();
|
|
|
+ var storageOrderNo = $('#storageOrderNo').val();
|
|
|
+
|
|
|
+ var selectedCount = 0;
|
|
|
+ if (contractId) selectedCount++;
|
|
|
+ if (purchaseOrderNo) selectedCount++;
|
|
|
+ if (storageOrderNo) selectedCount++;
|
|
|
+
|
|
|
+ if (selectedCount > 1) {
|
|
|
+ addError("合同、采购订单、入库单只能选择其中一个!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
// 基础必填字段验证(根据权限判断)
|
|
|
rs = validateFieldIfEditable("paymentApply.payerName", "单位", [{type: "require", msg: "单位不能为空!"}]) && rs;
|
|
|
rs = validateFieldIfEditable("paymentApply.payeeName", "收款单位", [{type: "require", msg: "收款单位不能为空!"}]) && rs;
|
|
|
@@ -114,23 +153,22 @@
|
|
|
rs = validateFieldIfEditable("paymentApply.paymentType", "付款类型", [{type: "require", msg: "付款类型必须选择!"}]) && rs;
|
|
|
|
|
|
// 根据付款类型验证相应字段
|
|
|
- if (isFieldEditable("paymentApply.paymentType")) {
|
|
|
+ /*if (isFieldEditable("paymentApply.paymentType")) {
|
|
|
var paymentType = $('#paymentType').val();
|
|
|
if (paymentType == '1') { // 预付款
|
|
|
rs = validateFieldIfEditable("paymentApply.purchaseOrderNo", "采购订单编号", [{type: "require", msg: "采购订单编号不能为空!"}]) && rs;
|
|
|
} else if (paymentType == '2') { // 到付款
|
|
|
rs = validateFieldIfEditable("paymentApply.storageOrderNo", "入库单编号", [{type: "require", msg: "入库单编号不能为空!"}]) && rs;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 其他必填字段验证(根据权限判断)
|
|
|
- rs = validateFieldIfEditable("paymentApply.bankName", "开户行", [{type: "require", msg: "开户行不能为空!"}]) && rs;
|
|
|
- rs = validateFieldIfEditable("paymentApply.bankAccount", "账号", [{type: "require", msg: "账号不能为空!"}]) && rs;
|
|
|
rs = validateFieldIfEditable("paymentApply.paymentMethod", "付款方式", [{type: "require", msg: "付款方式不能为空!"}]) && rs;
|
|
|
rs = validateFieldIfEditable("paymentApply.paymentDate", "付款日期", [{type: "require", msg: "付款日期不能为空!"}]) && rs;
|
|
|
rs = validateFieldIfEditable("paymentApply.amountUpper", "付款金额(大写)", [{type: "require", msg: "付款金额(大写)不能为空!"}]) && rs;
|
|
|
rs = validateFieldIfEditable("paymentApply.purpose", "用途或理由", [{type: "require", msg: "用途或理由不能为空!"}]) && rs;
|
|
|
rs = validateFieldIfEditable("paymentApply.operator", "经办人", [{type: "require", msg: "经办人不能为空!"}]) && rs;
|
|
|
+ rs = validateFieldIfEditable("paymentApply.payeeBankAccount", "开户行及账号", [{type: "require", msg: "开户行及账号不能为空!"}]) && rs;
|
|
|
|
|
|
if(dept_approver){
|
|
|
rs = $.validate({name: "dept_approver_imgval", model: [{type: "require", msg: "部门负责人审批不能为空!"}]}) && rs;
|
|
|
@@ -251,53 +289,22 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <td class="l-table-edit-text">付款类型<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',payment_type,')}"><font color="red">*</font></c:if>:</td>
|
|
|
- <td class="l-table-edit-td">
|
|
|
- <c:choose>
|
|
|
- <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',payment_type,')}">
|
|
|
- <c:choose>
|
|
|
- <c:when test="${paymentApply.paymentType eq '1'}">预付款</c:when>
|
|
|
- <c:when test="${paymentApply.paymentType eq '2'}">到付款</c:when>
|
|
|
- <c:otherwise></c:otherwise>
|
|
|
- </c:choose>
|
|
|
- <input type="hidden" id="paymentType" name="paymentApply.paymentType" value="${paymentApply.paymentType}"/>
|
|
|
- </c:when>
|
|
|
- <c:otherwise>
|
|
|
- <select name="paymentApply.paymentType" id="paymentType">
|
|
|
- <option value="1" <c:if test="${empty paymentApply.paymentType or paymentApply.paymentType eq '1'}">selected</c:if>>预付款</option>
|
|
|
- <option value="2" <c:if test="${paymentApply.paymentType eq '2'}">selected</c:if>>到付款</option>
|
|
|
- </select>
|
|
|
- </c:otherwise>
|
|
|
- </c:choose>
|
|
|
- </td>
|
|
|
- <td class="l-table-edit-text" id="orderLabel1">采购订单编号<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',purchase_order_no,')}"><font color="red">*</font></c:if>:</td>
|
|
|
- <td class="l-table-edit-td" id="orderField1">
|
|
|
- <c:choose>
|
|
|
- <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',purchase_order_no,')}">
|
|
|
- ${paymentApply.purchaseOrderNo}
|
|
|
- </c:when>
|
|
|
- <c:otherwise>
|
|
|
- <input type="text" name="paymentApply.purchaseOrderNo" id="purchaseOrderNo" value="${paymentApply.purchaseOrderNo}" readonly="readonly">
|
|
|
- <input type="button" id="selectPurchaseOrderBtn" name="selectPurchaseOrderBtn" class="l-button" value="选择采购单" />
|
|
|
- <input type="hidden" id="vendorCode" name="paymentApply.vendorCode" value="${paymentApply.vendorCode}">
|
|
|
- </c:otherwise>
|
|
|
- </c:choose>
|
|
|
- </td>
|
|
|
- <td class="l-table-edit-text" id="orderLabel2">入库单编号<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',storage_order_no,')}"><font color="red">*</font></c:if>:</td>
|
|
|
- <td class="l-table-edit-td" id="orderField2">
|
|
|
+ <td class="l-table-edit-text" style="width: 100px;">合同:</td>
|
|
|
+ <td class="l-table-edit-td" style="width: 250px;">
|
|
|
<c:choose>
|
|
|
- <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',storage_order_no,')}">
|
|
|
- ${paymentApply.storageOrderNo}
|
|
|
+ <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',contract_number,')}">
|
|
|
+ <input type="hidden" name="paymentApply.contractNumber" value="${paymentApply.contractNumber}">
|
|
|
+ ${paymentApply.contractNumber}
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
- <input type="text" name="paymentApply.storageOrderNo" id="storageOrderNo" value="${paymentApply.storageOrderNo}" readonly="readonly">
|
|
|
- <input type="button" id="selectStorageOrderBtn" name="selectStorageOrderBtn" class="l-button" value="选择入库单" />
|
|
|
- <input type="hidden" id="vendorCode" name="paymentApply.vendorCode" value="${paymentApply.vendorCode}">
|
|
|
+ <input type="hidden" id="contractId" name="paymentApply.contractId" value="${paymentApply.contractId}" />
|
|
|
+ <input type="text" readonly="readonly" id="contractNumber" name="paymentApply.contractNumber" value="${paymentApply.contractNumber}">
|
|
|
+ <input type="hidden" id="contractName" name="paymentApply.contractName" value="${paymentApply.contractName}">
|
|
|
+ <img id="searchContract" class="fee" onClick="selectContract()" src="${pageContext.request.contextPath}/images/sousuo.png" style="height: 20px; width: 20px; cursor: pointer;">
|
|
|
+ <input id="clearContractBtn" name="clearContractBtn" type="button" class="l-button" value="清除" onclick="clearContract()"/>
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
<td class="l-table-edit-text" style="width: 100px;">单位<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',payer_name,')}"><font color="red">*</font></c:if>:</td>
|
|
|
<td class="l-table-edit-td" style="width: 250px;">
|
|
|
<c:choose>
|
|
|
@@ -310,6 +317,8 @@
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
<td class="l-table-edit-text" style="width: 100px;">收款单位<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',payee_name,')}"><font color="red">*</font></c:if>:</td>
|
|
|
<td class="l-table-edit-td" style="width: 250px;">
|
|
|
<c:choose>
|
|
|
@@ -319,40 +328,75 @@
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
<input type="text" name="paymentApply.payeeName" id="payeeName" value="${paymentApply.payeeName}">
|
|
|
+ <input type="button" id="selectPayeeBtn" name="selectPayeeBtn" class="l-button" value="选择供应商" />
|
|
|
+ <input type="hidden" id="vendorCode" name="paymentApply.vendorCode" value="${paymentApply.vendorCode}">
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ </td>
|
|
|
+ <td class="l-table-edit-text" style="width: 100px;">开户行及账号<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',payee_bank_account,')}"><font color="red">*</font></c:if>:</td>
|
|
|
+ <td class="l-table-edit-td" style="width: 250px;">
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',payee_bank_account,')}">
|
|
|
+ <input type="hidden" name="paymentApply.payeeBankAccount" value="${paymentApply.payeeBankAccount}">
|
|
|
+ ${paymentApply.payeeBankAccount}
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>
|
|
|
+ <input type="text" name="paymentApply.payeeBankAccount" id="payeeBankAccount" value="${paymentApply.payeeBankAccount}" style="width: 100%;">
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <!-- </table>
|
|
|
-
|
|
|
- <table class="l-table-edit line l-table-edit-custom" width="99%"> -->
|
|
|
<tr>
|
|
|
- <td class="l-table-edit-text">开户行<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',bank_name,')}"><font color="red">*</font></c:if>:</td>
|
|
|
+ <td class="l-table-edit-text">付款类型<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',payment_type,')}"><font color="red">*</font></c:if>:</td>
|
|
|
<td class="l-table-edit-td">
|
|
|
<c:choose>
|
|
|
- <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',bank_name,')}">
|
|
|
- ${paymentApply.bankName}
|
|
|
+ <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',payment_type,')}">
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${paymentApply.paymentType eq '1'}">预付款</c:when>
|
|
|
+ <c:when test="${paymentApply.paymentType eq '2'}">到付款</c:when>
|
|
|
+ <c:otherwise></c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ <input type="hidden" id="paymentType" name="paymentApply.paymentType" value="${paymentApply.paymentType}"/>
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
- <input type="text" name="paymentApply.bankName" id="bankName" value="${paymentApply.bankName}" readonly="readonly">
|
|
|
- <input type="button" id="selectAccountBtn" name="selectAccountBtn" class="l-button" value="选择账户" />
|
|
|
+ <select name="paymentApply.paymentType" id="paymentType">
|
|
|
+ <option value="1" <c:if test="${empty paymentApply.paymentType or paymentApply.paymentType eq '1'}">selected</c:if>>预付款</option>
|
|
|
+ <option value="2" <c:if test="${paymentApply.paymentType eq '2'}">selected</c:if>>到付款</option>
|
|
|
+ </select>
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
- <td class="l-table-edit-text">账号<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',bank_account,')}"><font color="red">*</font></c:if>:</td>
|
|
|
- <td class="l-table-edit-td">
|
|
|
+ <td class="l-table-edit-text" id="orderLabel1">采购订单编号:</td>
|
|
|
+ <td class="l-table-edit-td" id="orderField1">
|
|
|
<c:choose>
|
|
|
- <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',bank_account,')}">
|
|
|
- ${paymentApply.bankAccount}
|
|
|
+ <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',purchase_order_no,')}">
|
|
|
+ ${paymentApply.purchaseOrderNo}
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
- <input type="text" name="paymentApply.bankAccount" id="bankAccount" value="${paymentApply.bankAccount}" readonly="readonly">
|
|
|
- <input type="hidden" id="accountId" name="paymentApply.accountId" value="${paymentApply.accountId}"/>
|
|
|
- <input type="hidden" id="accountName" name="paymentApply.accountName" value="${paymentApply.accountName}"/>
|
|
|
+ <input type="text" name="paymentApply.purchaseOrderNo" id="purchaseOrderNo" value="${paymentApply.purchaseOrderNo}" readonly="readonly" style="width: 70%;">
|
|
|
+ <input type="button" id="selectPurchaseOrderBtn" name="selectPurchaseOrderBtn" class="l-button" value="选择采购单" />
|
|
|
+ <input id="clearPurchaseOrderBtn" name="clearPurchaseOrderBtn" type="button" class="l-button" value="清除" onclick="clearPurchaseOrder()"/>
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ </td>
|
|
|
+ <td class="l-table-edit-text" id="orderLabel2">入库单编号:</td>
|
|
|
+ <td class="l-table-edit-td" id="orderField2">
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${curTacheModel.n_se ne 1 and !fn:contains(curTacheModel.table_fields, ',storage_order_no,')}">
|
|
|
+ ${paymentApply.storageOrderNo}
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>
|
|
|
+ <input type="text" name="paymentApply.storageOrderNo" id="storageOrderNo" value="${paymentApply.storageOrderNo}" readonly="readonly" style="width: 70%;">
|
|
|
+ <input type="button" id="selectStorageOrderBtn" name="selectStorageOrderBtn" class="l-button" value="选择入库单" />
|
|
|
+ <input id="clearStorageOrderBtn" name="clearStorageOrderBtn" type="button" class="l-button" value="清除" onclick="clearStorageOrder()"/>
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
</tr>
|
|
|
+
|
|
|
+ <!-- </table>
|
|
|
+
|
|
|
+ <table class="l-table-edit line l-table-edit-custom" width="99%"> -->
|
|
|
<tr>
|
|
|
<td class="l-table-edit-text">付款方式<c:if test="${curTacheModel.n_se eq 1 or fn:contains(curTacheModel.table_fields, ',payment_method,')}"><font color="red">*</font></c:if>:</td>
|
|
|
<td class="l-table-edit-td">
|
|
|
@@ -736,6 +780,11 @@
|
|
|
<input type="hidden" id="table_fields" name="table_fields" value="${curTacheModel.table_fields}">
|
|
|
<input type="hidden" id="universalid" name="paymentApply.universalid" value="${paymentApply.universalid}">
|
|
|
<input type="hidden" id="lFormInsId" name="paymentApply.lFormInsId" value="${paymentApply.lFormInsId}">
|
|
|
+
|
|
|
+ <input type="hidden" name="paymentApply.bankName" id="bankName" value="${paymentApply.bankName}"/>
|
|
|
+ <input type="hidden" name="paymentApply.bankAccount" id="bankAccount" value="${paymentApply.bankAccount}"/>
|
|
|
+ <input type="hidden" id="accountId" name="paymentApply.accountId" value="${paymentApply.accountId}"/>
|
|
|
+ <input type="hidden" id="accountName" name="paymentApply.accountName" value="${paymentApply.accountName}"/>
|
|
|
</form>
|
|
|
</body>
|
|
|
</html>
|