feat(finance): 更新付款单表单逻辑与数据源

- 修改付款单类型选项,将 NORMAL 替换为 FROM_PAYABLE
- 调整应付单列表显示条件,适配新的付款单类型
- 更新订单列表标题及字段展示内容
- 修改默认付款单类型为 FROM_PAYABLE
- 优化订单列表接口调用方式,使用 POST 请求并设置 Content-Type
- 增加供应商编码查询条件,支持通过项目产品信息过滤订单
- 调整提交校验逻辑,确保选择应付单时进行有效性检查
dev_1.0.0
chenhao 2025-12-15 11:03:16 +08:00
parent c940880a9d
commit a4a93ee484
4 changed files with 34 additions and 23 deletions

View File

@ -87,11 +87,14 @@ export function listPayableBills(query) {
}
// 查询采购订单列表 (用于新增付款单-预付)
export function listPurchaseOrders(query) {
export function listOrders(query) {
return request({
url: '/finance/payment/purchaseOrders',
method: 'get',
params: query
url: '/project/order/list',
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: query
})
}

View File

@ -35,7 +35,7 @@
<el-form-item label="是否预付" prop="paymentBillType">
<el-radio-group v-model="form.paymentBillType" @change="handleTypeChange">
<el-radio label="PRE_PAYMENT"></el-radio>
<el-radio label="NORMAL"></el-radio>
<el-radio label="FROM_PAYABLE"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -51,7 +51,7 @@
<!-- Tables -->
<div v-if="form.vendorCode">
<div v-if="form.paymentBillType === 'NORMAL'" class="table-container">
<div v-if="form.paymentBillType === 'FROM_PAYABLE'" class="table-container">
<h4>应付单列表</h4>
<el-table
:data="payableList"
@ -103,7 +103,7 @@
</div>
<div v-if="form.paymentBillType === 'PRE_PAYMENT'" class="table-container">
<h4>采购订单列表</h4>
<h4>订单列表</h4>
<el-table
:data="orderList"
border
@ -113,10 +113,14 @@
row-key="orderNo"
>
<el-table-column type="selection" width="55" reserve-selection></el-table-column>
<el-table-column prop="orderNo" label="订单编号"></el-table-column>
<el-table-column prop="orderTime" label="订单日期" width="180"></el-table-column>
<el-table-column prop="orderAmount" label="订单金额"></el-table-column>
<el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column prop="projectCode" label="项目编号"></el-table-column>
<el-table-column prop="projectName" label="项目名称"></el-table-column>
<el-table-column prop="createTime" label="下单时间"></el-table-column>
<el-table-column label="订单状态" prop="orderStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
</el-table>
</div>
@ -134,7 +138,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<div v-if="form.paymentBillType === 'NORMAL'" style="float: left; line-height: 36px;">
<div v-if="form.paymentBillType === 'FROM_PAYABLE'" style="float: left; line-height: 36px;">
<span style="margin-right: 20px;">计划付款总金额: <el-tag type="success">{{
totalPlannedAmount.toFixed(2)
}}</el-tag></span>
@ -163,7 +167,7 @@
<script>
import {listAllVendor} from "@/api/base/vendor";
import {listPayableBills, listPurchaseOrders} from "@/api/finance/payment";
import {listPayableBills, listOrders} from "@/api/finance/payment";
import PaymentPlanSelector from "../../payable/components/PaymentPlan";
export default {
@ -173,12 +177,9 @@ export default {
visible: {
type: Boolean,
default: false
},
dicts: {
type: Object,
default: () => ({})
}
},
dicts:['order_status','payment_status'],
data() {
return {
internalVisible: this.visible,
@ -192,7 +193,7 @@ export default {
pageSize: 10
},
form: {
paymentBillType: 'NORMAL', // Default to Normal (Not Prepayment)
paymentBillType: 'FROM_PAYABLE', // Default to Normal (Not Prepayment)
vendorCode: null,
vendorName: null,
remark: null,
@ -213,7 +214,7 @@ export default {
},
computed: {
totalPlannedAmount() {
if (this.form.paymentBillType === 'NORMAL') {
if (this.form.paymentBillType === 'FROM_PAYABLE') {
// Calculate based on selected rows and their plans/defaults
return this.selectedRows.reduce((sum, row) => {
return sum + this.calculateOrderCurrentPaymentAmount(row);
@ -276,11 +277,12 @@ export default {
const query = {
vendorCode: this.form.vendorCode,
orderStatus:'2',
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize
};
if (this.form.paymentBillType === 'NORMAL') {
if (this.form.paymentBillType === 'FROM_PAYABLE') {
listPayableBills(query).then(res => {
this.payableList = (res.rows || []).map(item => {
const paymentPlans = item.paymentPlans ? [...item.paymentPlans] : [];
@ -303,7 +305,7 @@ export default {
this.total = res.total;
});
} else if (this.form.paymentBillType === 'PRE_PAYMENT') {
listPurchaseOrders(query).then(res => {
listOrders(query).then(res => {
this.orderList = res.rows || [];
this.total = res.total;
});
@ -357,7 +359,7 @@ export default {
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.form.paymentBillType === 'NORMAL') {
if (this.form.paymentBillType === 'FROM_PAYABLE') {
if (this.selectedRows.length === 0) {
this.$message.warning("请选择至少一条应付单");
return;
@ -408,7 +410,7 @@ export default {
this.$refs.form.resetFields();
}
this.form = {
paymentBillType: 'NORMAL',
paymentBillType: 'FROM_PAYABLE',
vendorCode: null,
vendorName: null,
remark: null,

View File

@ -88,6 +88,7 @@ public class ProjectOrderInfo extends BaseEntity {
@Excel(name = "代表处")
private String agentName;
private String agentCode;
private String vendorCode;
/**
*
*/

View File

@ -102,6 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="notifierAddress != null and notifierAddress != ''">and t1.notifier_address = #{notifierAddress}
</if>
<if test="duty != null and duty != ''">and t1.duty = #{duty}</if>
<if test="vendorCode != null and vendorCode != ''">and t1.project_id in (
select ppi.project_id from product_info pi
left join project_product_info ppi on ppi.product_bom_code=pi.product_code
where pi.vendor_code=#{vendorCode}
) </if>
<if test="dutyName != null and dutyName != ''">and t5.user_name like concat('%', #{dutyName}, '%')</if>
<if test="dutyEmail != null and dutyEmail != ''">and t1.duty_email = #{dutyEmail}</if>
<if test="dutyPhone != null and dutyPhone != ''">and t1.duty_phone = #{dutyPhone}</if>