取消
- 保存
+ 保存
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+ {{ contractDialog.expanded ? '收起' : '展开' }}
+
+
+
+
+
+
+
+ {{
+ row.organizationName || row.deptName || '-'
+ }}
+ {{
+ contractCategoryName(row.contractCategory)
+ }}
+ {{ signTypeName(row.signType) }}
+ {{ displayValue(row[column.prop]) }}
+
+
+
+
+ 选择
+
+
+
+
+
+ 取消
+ 确定
+
+
+
this.$refs.formRef?.clearValidate());
},
async loadDetail() {
@@ -969,15 +1186,85 @@ export default {
this.loading = false;
}
},
- async loadContractOptions(keyword = '') {
- this.contractLoading = true;
+ openContractDialog() {
+ if (!this.editable || this.details.length > 0) return;
+ this.contractDialog.visible = true;
+ this.contractDialog.expanded = false;
+ this.contractDialog.current = null;
+ this.contractDialog.page.current = 1;
+ this.loadContractRows();
+ },
+ async loadContractRows() {
+ this.contractDialog.loading = true;
try {
- const { data } = await getContractOptions(keyword);
- this.contractOptions = data?.data || [];
+ const { data } = await getContractList(
+ this.contractDialog.page.current,
+ this.contractDialog.page.size,
+ { ...this.contractDialog.query }
+ );
+ const page = data?.data || {};
+ this.contractDialog.rows = page.records || [];
+ this.contractDialog.page.total = Number(page.total || 0);
} finally {
- this.contractLoading = false;
+ this.contractDialog.loading = false;
}
},
+ searchContractRows() {
+ this.contractDialog.page.current = 1;
+ this.loadContractRows();
+ },
+ resetContractQuery() {
+ this.contractDialog.query = {
+ contractNo: '',
+ contractName: '',
+ projectName: '',
+ organizationName: '',
+ contractCategory: '',
+ signType: '',
+ effectiveType: '',
+ contractStage: '',
+ approvalStatus: '',
+ };
+ this.searchContractRows();
+ },
+ handleContractSizeChange() {
+ this.contractDialog.page.current = 1;
+ this.loadContractRows();
+ },
+ selectContract(row) {
+ if (!row) {
+ this.$message.warning('请选择合同');
+ return;
+ }
+ const contract = {
+ ...row,
+ deptId: row.deptId || row.organizationId,
+ deptName: row.deptName || row.organizationName,
+ partyA: row.partyA || row.payerName,
+ partyB: row.partyB || row.payeeName,
+ settlementType:
+ row.settlementType || (row.contractCategory === '客户合同' ? 'receivable' : 'payable'),
+ };
+ const index = this.contractOptions.findIndex(item => String(item.id) === String(contract.id));
+ if (index >= 0) this.contractOptions.splice(index, 1, contract);
+ else this.contractOptions.push(contract);
+ this.handleContractChange(contract.id);
+ this.contractDialog.visible = false;
+ this.contractDialog.current = null;
+ this.$refs.formRef?.clearValidate('contractId');
+ },
+ contractCategoryName(value) {
+ return (
+ this.contractCategoryOptions.find(item => String(item.value) === String(value))?.label ||
+ this.displayValue(value)
+ );
+ },
+ signTypeName(value) {
+ return (
+ this.signTypeOptions.find(item => String(item.value) === String(value))?.label ||
+ this.displayValue(value)
+ );
+ },
async loadFeeOptions() {
const { data } = await getFeeOptions();
this.feeOptions = data?.data || [];
@@ -993,6 +1280,7 @@ export default {
handleContractChange(id) {
const contract = this.contractOptions.find(item => String(item.id) === String(id));
if (!contract) {
+ this.form.contractId = '';
this.form.contractNo = '';
this.form.contractName = '';
this.form.projectId = '';
@@ -1004,6 +1292,7 @@ export default {
this.summaryFees = [];
return;
}
+ this.form.contractId = contract.id;
this.form.contractNo = contract.contractNo;
this.form.contractName = contract.contractName;
this.form.projectId = contract.projectId;
@@ -1166,9 +1455,7 @@ export default {
this.details.forEach(row => {
const feeItems = this.parseFeeItems(row.feeItemsJson || row.feeItems);
const feeItemEntries = Object.entries(feeItems);
- feeItemEntries.forEach(([feeItem, amount]) =>
- appendSummary(feeItem, amount, row.feeType)
- );
+ feeItemEntries.forEach(([feeItem, amount]) => appendSummary(feeItem, amount, row.feeType));
let knownAmount = feeItemEntries.reduce(
(total, [, amount]) => total + Number(amount || 0),
@@ -1186,11 +1473,7 @@ export default {
}
const totalAmount = Number(
- row.settlementAmountTax ??
- row.totalAmount ??
- row.afterAmount ??
- row.settlementAmount ??
- 0
+ row.settlementAmountTax ?? row.totalAmount ?? row.afterAmount ?? row.settlementAmount ?? 0
);
const residualAmount = Number((totalAmount - knownAmount).toFixed(2));
if (Math.abs(residualAmount) >= 0.005) {
@@ -1621,6 +1904,39 @@ export default {
margin-left: auto;
}
+ &__contract-filter {
+ display: grid !important;
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ gap: 8px 24px;
+ margin-bottom: 16px;
+
+ :deep(.el-form-item) {
+ display: flex;
+ min-width: 0;
+ margin-bottom: 0;
+ }
+
+ :deep(.el-form-item__content) {
+ flex: 1;
+ min-width: 0;
+ }
+
+ :deep(.el-input),
+ :deep(.el-select) {
+ width: 100%;
+ }
+ }
+
+ &__contract-filter-actions {
+ grid-column: 1 / -1;
+ width: 100%;
+ justify-content: flex-end;
+
+ :deep(.el-form-item__content) {
+ justify-content: flex-end;
+ }
+ }
+
&__attachment-actions {
display: flex;
align-items: center;
@@ -1649,6 +1965,14 @@ export default {
font-weight: 600;
}
+ &__negative-amount {
+ color: var(--el-color-danger);
+ }
+
+ :deep(.pre-settlement-editor__negative-amount .el-input__inner) {
+ color: var(--el-color-danger);
+ }
+
&__pagination {
display: flex;
justify-content: flex-end;
diff --git a/src/views/settlement/receivable-payable-detail.vue b/src/views/settlement/receivable-payable-detail.vue
index 87e78cf..48b312d 100644
--- a/src/views/settlement/receivable-payable-detail.vue
+++ b/src/views/settlement/receivable-payable-detail.vue
@@ -150,7 +150,7 @@
-
+
+
+
+ 查看详情
+
+
-