|
@@ -34,6 +34,15 @@
|
|
|
<span v-if="item.isTransit == 1">(有在途)</span>
|
|
|
</template>
|
|
|
|
|
|
+ <template #payStatus="{ item }">
|
|
|
+ <span
|
|
|
+ style="cursor: pointer; color: #409eff"
|
|
|
+ @click="handleClickPayStatus(item)"
|
|
|
+ >
|
|
|
+ {{ dictValueLabel(item.payStatus, paymentStatus) }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #btn="{ item }">
|
|
|
<div>
|
|
|
<!-- <el-button type="primary" link @click="handleUpdateData(item)"
|
|
@@ -103,6 +112,8 @@
|
|
|
? formData.data.deliverGoodsDetailsList
|
|
|
: formData.data.arrivalDetailList
|
|
|
"
|
|
|
+ show-summary
|
|
|
+ :summary-method="getSummaries"
|
|
|
>
|
|
|
<el-table-column
|
|
|
prop="productDefinition"
|
|
@@ -221,7 +232,11 @@
|
|
|
>
|
|
|
<template #detailSlot>
|
|
|
<div style="width: 100%">
|
|
|
- <el-table :data="formData.dataOne.purchaseDetailVoList">
|
|
|
+ <el-table
|
|
|
+ :data="formData.dataOne.purchaseDetailVoList"
|
|
|
+ show-summary
|
|
|
+ :summary-method="getSummariesOne"
|
|
|
+ >
|
|
|
<el-table-column prop="productCustomCode" label="物品编码" />
|
|
|
<el-table-column prop="productName" label="物品名称" />
|
|
|
<el-table-column prop="productSpec" label="规格" />
|
|
@@ -419,7 +434,11 @@
|
|
|
>
|
|
|
<template #detailSlot>
|
|
|
<div style="width: 100%">
|
|
|
- <el-table :data="formData.dataTwo.purchaseBackDetailsList">
|
|
|
+ <el-table
|
|
|
+ :data="formData.dataTwo.purchaseBackDetailsList"
|
|
|
+ show-summary
|
|
|
+ :summary-method="getSummariesTwo"
|
|
|
+ >
|
|
|
<el-table-column
|
|
|
prop="subscribeCode"
|
|
|
label="申购单号"
|
|
@@ -450,6 +469,7 @@
|
|
|
/>
|
|
|
<el-table-column prop="price" label="单价" width="60" />
|
|
|
<el-table-column prop="count" label="采购数量" width="100" />
|
|
|
+ <el-table-column prop="amount" label="采购金额" width="100" />
|
|
|
<el-table-column
|
|
|
prop="defectiveQuantity"
|
|
|
label="次品数量"
|
|
@@ -482,10 +502,14 @@
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
onmousewheel="return false;"
|
|
|
+ @change="
|
|
|
+ (val) => (row.backAmount = Number(row.price * val))
|
|
|
+ "
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="backAmount" label="退货金额" width="100" />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -938,6 +962,87 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="'付款明细'"
|
|
|
+ v-model="payDialog"
|
|
|
+ width="600"
|
|
|
+ destroy-on-close
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-timeline :reverse="false">
|
|
|
+ <el-timeline-item
|
|
|
+ placement="top"
|
|
|
+ v-for="(activity, index) in activities"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div style="color: #909399">
|
|
|
+ {{ activity.payUserName }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="activity.type == '1'">
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 类型: <span style="color: #8fe3a1">付款 </span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 付款账号:
|
|
|
+ {{ dictValueLabel(activity.payAccount, accountData) }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 付款金额:{{ moneyFormat(activity.amount, 2) }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 付款时间: {{ activity.payDate }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 付款备注: {{ activity.remark }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="activity.type == '2'">
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 类型: <span style="color: #fc0000">退款</span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 退款账号:
|
|
|
+ {{ dictValueLabel(activity.payAccount, accountData) }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 退款金额:{{ moneyFormat(activity.amount, 2) }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 退款时间: {{ activity.payDate }}
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ 退款备注: {{ activity.remark }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="width: 100%; margin-top: 5px"
|
|
|
+ v-if="activity.fileList && activity.fileList.length > 0"
|
|
|
+ >
|
|
|
+ <div v-for="(item, index) in activity.fileList" :key="index">
|
|
|
+ <div
|
|
|
+ style="cursor: pointer; color: #409eff"
|
|
|
+ @click="openFile(item)"
|
|
|
+ >
|
|
|
+ {{ item.fileName }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="payDialog = false" size="large">关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -1162,11 +1267,12 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "付款状态",
|
|
|
prop: "payStatus",
|
|
|
+ slot: "payStatus",
|
|
|
width: 100,
|
|
|
},
|
|
|
- render(status) {
|
|
|
- return proxy.dictValueLabel(status, paymentStatus.value);
|
|
|
- },
|
|
|
+ // render(status) {
|
|
|
+ // return proxy.dictValueLabel(status, paymentStatus.value);
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
@@ -1704,17 +1810,24 @@ const fundsPaymentMethod = ref([]);
|
|
|
const supplierData = ref([]);
|
|
|
const warehouseList = ref([]);
|
|
|
const userList = ref([]);
|
|
|
+const accountData = ref([]);
|
|
|
const getDict = () => {
|
|
|
- proxy.getDictOne(["unit", "funds_payment_method"]).then((res) => {
|
|
|
- productUnit.value = res["unit"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .getDictOne(["unit", "funds_payment_method", "purchase_payment_account"])
|
|
|
+ .then((res) => {
|
|
|
+ productUnit.value = res["unit"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ accountData.value = res["purchase_payment_account"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ });
|
|
|
proxy
|
|
|
.post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
|
|
|
.then((res) => {
|
|
@@ -2138,6 +2251,136 @@ const statistics = (att) => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+const payDialog = ref(false);
|
|
|
+const activities = ref([]);
|
|
|
+const handleClickPayStatus = (row) => {
|
|
|
+ proxy
|
|
|
+ .post("/purchasePayRecordDetail/page", { purchaseId: row.id })
|
|
|
+ .then((res) => {
|
|
|
+ if (res && res.rows && res.rows.length > 0) {
|
|
|
+ activities.value = res.rows;
|
|
|
+ const idList = activities.value.map((x) => x.purchasePayRecordId);
|
|
|
+ // 请求文件数据并回显
|
|
|
+ if (idList.length > 0) {
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: idList,
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ if (fileObj) {
|
|
|
+ for (let i = 0; i < activities.value.length; i++) {
|
|
|
+ const e = activities.value[i];
|
|
|
+ for (const key in fileObj) {
|
|
|
+ if (e.purchasePayRecordId === key) {
|
|
|
+ e.fileList = fileObj[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ payDialog.value = true;
|
|
|
+ } else {
|
|
|
+ return ElMessage({
|
|
|
+ message: `暂无付款记录`,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+const openFile = (item) => {
|
|
|
+ window.open(item.fileUrl, "_blank");
|
|
|
+};
|
|
|
+
|
|
|
+const getSummaries = (param) => {
|
|
|
+ const { columns, data } = param; //columns是每列的信息,data是每行的信息
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计"; //此处是在index=0的这一列显示为“合计”
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map((item) => Number(item[column.property]));
|
|
|
+ if (
|
|
|
+ column.property === "count" ||
|
|
|
+ column.property === "alreadyDeliverGoodsQuantity" ||
|
|
|
+ column.property === "deliverGoodsQuantity" ||
|
|
|
+ column.property === "transitQuantity"
|
|
|
+ ) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+};
|
|
|
+
|
|
|
+const getSummariesOne = (param) => {
|
|
|
+ const { columns, data } = param; //columns是每列的信息,data是每行的信息
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计"; //此处是在index=0的这一列显示为“合计”
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map((item) => Number(item[column.property]));
|
|
|
+ if (
|
|
|
+ column.property === "count" ||
|
|
|
+ column.property === "deliverGoodsQuantity" ||
|
|
|
+ column.property === "receiptQuantity" ||
|
|
|
+ column.property === "purchaseBackQuantity" ||
|
|
|
+ column.property === "qualityQuantity" ||
|
|
|
+ column.property === "noQualifiedCount"
|
|
|
+ ) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+};
|
|
|
+
|
|
|
+const getSummariesTwo = (param) => {
|
|
|
+ const { columns, data } = param; //columns是每列的信息,data是每行的信息
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计"; //此处是在index=0的这一列显示为“合计”
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map((item) => Number(item[column.property]));
|
|
|
+ if (
|
|
|
+ column.property === "count" ||
|
|
|
+ column.property === "amount" ||
|
|
|
+ column.property === "defectiveQuantity" ||
|
|
|
+ column.property === "quantity" ||
|
|
|
+ column.property === "backAmount"
|
|
|
+ ) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|