fix:付款审批详情:采购应付单列表调整
parent
7a7b549de3
commit
1f86f382df
|
|
@ -28,6 +28,22 @@
|
||||||
<div class="el-descriptions__title">应付单信息</div>
|
<div class="el-descriptions__title">应付单信息</div>
|
||||||
<el-table :data="data.payableDetails" border style="width: 100%; margin-top: 10px;">
|
<el-table :data="data.payableDetails" border style="width: 100%; margin-top: 10px;">
|
||||||
<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
||||||
|
<el-table-column label="采购单号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="purchase-no-cell">
|
||||||
|
<el-link
|
||||||
|
v-for="(purchaseItem, index) in getPurchaseNoList(scope.row.purchaseNo)"
|
||||||
|
:key="`${scope.$index}-${purchaseItem.purchaseNo}-${purchaseItem.purchaseId || ''}-${index}`"
|
||||||
|
type="primary"
|
||||||
|
:underline="false"
|
||||||
|
class="purchase-no-link"
|
||||||
|
@click="handleViewPruchaseDetail(scope.row, purchaseItem)"
|
||||||
|
>
|
||||||
|
{{ purchaseItem.purchaseNo }}
|
||||||
|
</el-link>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="采购-应付单编号" align="center">
|
<el-table-column label="采购-应付单编号" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="handleViewPayable(scope.row)">{{ scope.row.payableBillCode }}</el-button>
|
<el-button type="text" @click="handleViewPayable(scope.row)">{{ scope.row.payableBillCode }}</el-button>
|
||||||
|
|
@ -38,13 +54,9 @@
|
||||||
<a @click="handleViewProject(scope.row)" class="link-type">{{ scope.row.projectName }}</a>
|
<a @click="handleViewProject(scope.row)" class="link-type">{{ scope.row.projectName }}</a>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="productType" label="产品类型" align="center">
|
<el-table-column prop="productCode" label="产品编码" align="center"></el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="model" label="产品型号" align="center"></el-table-column>
|
||||||
<dict-tag :options="dict.type.product_type" :value="scope.row.productType"/>
|
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="totalPriceWithTax" label="含税总价" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="paymentAmount" label="本次付款金额" align="center"></el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -72,19 +84,44 @@
|
||||||
|
|
||||||
<edit-form :visible.sync="payableVisible" :data="selectedPayableRow" :z-index="2000" @close="payableVisible = false" />
|
<edit-form :visible.sync="payableVisible" :data="selectedPayableRow" :z-index="2000" @close="payableVisible = false" />
|
||||||
<project-detail-drawer :visible.sync="projectDrawerVisible" :project-id="currentProjectId" />
|
<project-detail-drawer :visible.sync="projectDrawerVisible" :project-id="currentProjectId" />
|
||||||
|
|
||||||
|
<el-drawer
|
||||||
|
title="采购单详情"
|
||||||
|
:visible.sync="showPruchaseDetailDrawer"
|
||||||
|
direction="rtl"
|
||||||
|
size="80%"
|
||||||
|
append-to-body
|
||||||
|
:z-index="2100"
|
||||||
|
>
|
||||||
|
<ApproveLayout title="采购单详情" v-if="showPruchaseDetailDrawer">
|
||||||
|
<purchase-order-detail-view
|
||||||
|
ref="pruchaseDetailView"
|
||||||
|
:order-data="pruchaseDetailOrderData"
|
||||||
|
@close="showPruchaseDetailDrawer = false"
|
||||||
|
>
|
||||||
|
</purchase-order-detail-view>
|
||||||
|
<template #footer>
|
||||||
|
<span>采购单编号: {{ pruchaseDetailOrderData ? pruchaseDetailOrderData.purchaseNo : '' }}</span>
|
||||||
|
<span v-if="pruchaseDetailOrderData"> | 版本号: {{ pruchaseDetailOrderData.version }}</span>
|
||||||
|
</template>
|
||||||
|
</ApproveLayout>
|
||||||
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
import { getPurchaseorder } from "@/api/sip/purchaseorder";
|
||||||
import {formatCurrency} from "@/utils";
|
import {formatCurrency} from "@/utils";
|
||||||
import EditForm from "@/views/finance/payable/components/EditForm.vue";
|
import EditForm from "@/views/finance/payable/components/EditForm.vue";
|
||||||
import ProjectDetailDrawer from "@/views/project/info/ProjectDetailDrawer.vue";
|
import ProjectDetailDrawer from "@/views/project/info/ProjectDetailDrawer.vue";
|
||||||
|
import ApproveLayout from "@/views/approve/ApproveLayout.vue";
|
||||||
|
import PurchaseOrderDetailView from "@/views/purchaseorder/components/PurchaseOrderDetailView.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PaymentDetail",
|
name: "PaymentDetail",
|
||||||
components: { EditForm, ProjectDetailDrawer },
|
components: { EditForm, ProjectDetailDrawer, ApproveLayout, PurchaseOrderDetailView },
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
@ -103,7 +140,9 @@ export default {
|
||||||
payableVisible: false,
|
payableVisible: false,
|
||||||
selectedPayableRow: {},
|
selectedPayableRow: {},
|
||||||
projectDrawerVisible: false,
|
projectDrawerVisible: false,
|
||||||
currentProjectId: null
|
currentProjectId: null,
|
||||||
|
showPruchaseDetailDrawer: false,
|
||||||
|
pruchaseDetailOrderData: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -154,7 +193,38 @@ export default {
|
||||||
handleViewProject(row) {
|
handleViewProject(row) {
|
||||||
this.currentProjectId = row.projectId;
|
this.currentProjectId = row.projectId;
|
||||||
this.projectDrawerVisible = true;
|
this.projectDrawerVisible = true;
|
||||||
}
|
},
|
||||||
|
getPurchaseNoList(purchaseNo) {
|
||||||
|
return (purchaseNo || '')
|
||||||
|
.split(',')
|
||||||
|
.map(item => item.trim())
|
||||||
|
.filter(Boolean)
|
||||||
|
.map(item => {
|
||||||
|
const splitIndex = item.lastIndexOf('__');
|
||||||
|
if (splitIndex === -1) {
|
||||||
|
return { purchaseNo: item, purchaseId: null };
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
purchaseNo: item.substring(0, splitIndex),
|
||||||
|
purchaseId: item.substring(splitIndex + 2)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleViewPruchaseDetail(row, purchaseItem) {
|
||||||
|
const purchaseId = purchaseItem && purchaseItem.purchaseId ? purchaseItem.purchaseId : (row.purchaseId || row.purchaseOrderId);
|
||||||
|
if (purchaseId) {
|
||||||
|
getPurchaseorder(purchaseId).then(response => {
|
||||||
|
this.pruchaseDetailOrderData = response.data;
|
||||||
|
this.showPruchaseDetailDrawer = true;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.pruchaseDetailOrderData = {
|
||||||
|
purchaseNo: (purchaseItem && purchaseItem.purchaseNo) || row.purchaseNo || '',
|
||||||
|
version: row.version || ''
|
||||||
|
};
|
||||||
|
this.showPruchaseDetailDrawer = true;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -163,4 +233,12 @@ export default {
|
||||||
.payment-detail {
|
.payment-detail {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.purchase-no-cell {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purchase-no-link {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@
|
||||||
|
|
||||||
<!-- 订单详情抽屉 -->
|
<!-- 订单详情抽屉 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
title="订单详情"
|
title="采购单详情"
|
||||||
:visible.sync="showDetailDrawer"
|
:visible.sync="showDetailDrawer"
|
||||||
direction="rtl"
|
direction="rtl"
|
||||||
size="80%"
|
size="80%"
|
||||||
|
|
@ -295,7 +295,7 @@
|
||||||
@view-history-detail="handleViewHistoryDetailEvent">
|
@view-history-detail="handleViewHistoryDetailEvent">
|
||||||
</purchase-order-detail-view>
|
</purchase-order-detail-view>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span>订单编号: {{ currentDetailPurchaseNo }}</span>
|
<span>采购单编号: {{ currentDetailPurchaseNo }}</span>
|
||||||
</template>
|
</template>
|
||||||
</ApproveLayout>
|
</ApproveLayout>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
|
||||||
|
|
@ -194,4 +194,4 @@ public @interface Excel
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ public class OmsPurchaseOrder extends BaseEntity
|
||||||
@Excel(name = "流程类型", readConverterExp = "online=线上,offline=线下")
|
@Excel(name = "流程类型", readConverterExp = "online=线上,offline=线下")
|
||||||
private String flowType;
|
private String flowType;
|
||||||
|
|
||||||
@Excel(name = "备注")
|
@Excel(name = "备注", wrapText = true)
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 删除标志(0正常 1删除) */
|
/** 删除标志(0正常 1删除) */
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,19 @@ public class PaymentBillPayableDetailDTO {
|
||||||
|
|
||||||
/** 项目名称 */
|
/** 项目名称 */
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/** 产品类型 */
|
||||||
private String productType;
|
private String productType;
|
||||||
|
|
||||||
|
/** 产品编码 */
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
/** 产品型号 */
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
/** 产品名称 */
|
||||||
|
private String productName;
|
||||||
|
|
||||||
/** 采购应付单ID */
|
/** 采购应付单ID */
|
||||||
private Long payableBillId;
|
private Long payableBillId;
|
||||||
|
|
||||||
|
|
@ -40,4 +51,8 @@ public class PaymentBillPayableDetailDTO {
|
||||||
private BigDecimal paymentRate;
|
private BigDecimal paymentRate;
|
||||||
private String vendorName;
|
private String vendorName;
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
/** 采购单号 */
|
||||||
|
private String purchaseNo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,4 +79,6 @@ public interface OmsPayableBillMapper
|
||||||
|
|
||||||
List<OmsPayableBill> listPayable(OmsPayableBill payableBill);
|
List<OmsPayableBill> listPayable(OmsPayableBill payableBill);
|
||||||
|
|
||||||
|
String selectPurcahseNoByPayableBillCode(@Param("payableBillCode") String payableBillCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,4 +89,7 @@ public interface IOmsPayableBillService
|
||||||
void deleteByInventoryCode(List<String> collect);
|
void deleteByInventoryCode(List<String> collect);
|
||||||
|
|
||||||
List<OmsPayableBill> listPayable(OmsPayableBill payableBill);
|
List<OmsPayableBill> listPayable(OmsPayableBill payableBill);
|
||||||
|
|
||||||
|
String selectPurcahseNoByPayableBillCode(String payableBillCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -582,5 +582,11 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
public List<OmsPayableBill> listPayable(OmsPayableBill payableBill) {
|
public List<OmsPayableBill> listPayable(OmsPayableBill payableBill) {
|
||||||
return omsPayableBillMapper.listPayable( payableBill);
|
return omsPayableBillMapper.listPayable( payableBill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String selectPurcahseNoByPayableBillCode(String payableBillCode) {
|
||||||
|
return omsPayableBillMapper.selectPurcahseNoByPayableBillCode(payableBillCode);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,10 @@ public class OmsPaymentBillServiceImpl implements IOmsPaymentBillService , TodoC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<PaymentBillPayableDetailDTO> paymentBillPayableDetailDTOS = detailService.listPayableByPaymentCode(paymentBillDetailDTO.getPaymentBillCode());
|
List<PaymentBillPayableDetailDTO> paymentBillPayableDetailDTOS = detailService.listPayableByPaymentCode(paymentBillDetailDTO.getPaymentBillCode());
|
||||||
|
paymentBillPayableDetailDTOS.forEach(item -> {
|
||||||
|
String purchaseNo = payableBillService.selectPurcahseNoByPayableBillCode(item.getPayableBillCode());
|
||||||
|
item.setPurchaseNo(purchaseNo);
|
||||||
|
});
|
||||||
paymentBillDetailDTO.setPayableDetails(paymentBillPayableDetailDTOS);
|
paymentBillDetailDTO.setPayableDetails(paymentBillPayableDetailDTOS);
|
||||||
return paymentBillDetailDTO;
|
return paymentBillDetailDTO;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -341,4 +341,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectPurcahseNoByPayableBillCode" resultType="java.lang.String">
|
||||||
|
select group_concat(distinct concat(t4.purchase_no,'__',t4.id)) as purchase_no
|
||||||
|
from oms_payable_bill as t1
|
||||||
|
inner join oms_inventory_info as t2 on t1.inventory_code = t2.outer_code
|
||||||
|
inner join oms_purchase_order_item as t3 on t2.product_code = t3.product_code
|
||||||
|
inner join oms_purchase_order as t4 on t3.purchase_id = t4.id
|
||||||
|
where t1.payable_bill_code = #{payableBillCode}
|
||||||
|
group by t1.payable_bill_code
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -122,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ORDER BY t1.create_time DESC
|
ORDER BY t1.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="listPayableByPaymentCode" resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
|
<select id="listPayableByPaymentCode" resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
|
||||||
select t1.payment_amount, t1.payable_bill_id, t2.payable_bill_code, t3.project_id, t4.project_name, t4.project_code, t2.total_price_with_tax,t2.product_type
|
select t1.payment_amount, t1.payable_bill_id, t2.payable_bill_code, t3.project_id, t4.project_name, t4.project_code,
|
||||||
|
t2.total_price_with_tax,t2.product_type, t5.product_code, t5.model, t5.product_name
|
||||||
from (SELECT sum(payment_amount) payment_amount,
|
from (SELECT sum(payment_amount) payment_amount,
|
||||||
payable_bill_id
|
payable_bill_id
|
||||||
FROM oms_payable_payment_detail t1
|
FROM oms_payable_payment_detail t1
|
||||||
|
|
@ -135,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join oms_payable_bill t2 on t1.payable_bill_id = t2.id
|
left join oms_payable_bill t2 on t1.payable_bill_id = t2.id
|
||||||
left join project_order_info t3 on t2.order_code = t3.order_code
|
left join project_order_info t3 on t2.order_code = t3.order_code
|
||||||
left join project_info t4 on t3.project_id = t4.id
|
left join project_info t4 on t3.project_id = t4.id
|
||||||
|
left join product_info t5 on t2.product_code = t5.product_code
|
||||||
</select>
|
</select>
|
||||||
<select id="listPayableByWriteOffId" resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
|
<select id="listPayableByWriteOffId" resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
|
||||||
select t1.payment_amount, t2.payable_bill_code, t4.project_name, t4.project_code, t2.total_price_with_tax,t5.vendor_name,t2.create_time
|
select t1.payment_amount, t2.payable_bill_code, t4.project_name, t4.project_code, t2.total_price_with_tax,t5.vendor_name,t2.create_time
|
||||||
|
|
@ -185,4 +187,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
delete from oms_payable_payment_detail where write_off_id is null and payable_detail_type='2';
|
delete from oms_payable_payment_detail where write_off_id is null and payable_detail_type='2';
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue