From b0fa15ec9c9dde96e423bc29cb4b605bb41502a2 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期一, 15 九月 2025 17:20:49 +0800
Subject: [PATCH] 企业通讯录管理页面,用印管理查询调整
---
src/views/procurementManagement/invoiceEntry/components/Modal.vue | 164 +++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 135 insertions(+), 29 deletions(-)
diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index 3296bb3..f29b78a 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -1,6 +1,12 @@
<template>
<el-dialog :title="modalOptions.title" v-model="visible" width="70%">
- <el-form ref="formRef" :model="form" :rules="rules" label-width="120px" label-position="top">
+ <el-form
+ ref="formRef"
+ :model="form"
+ :rules="rules"
+ label-width="120px"
+ label-position="top"
+ >
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="閲囪喘鍚堝悓鍙凤細" prop="purchaseLedgerNo">
@@ -9,75 +15,151 @@
</el-col>
<el-col :span="12">
<el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
- <el-input v-model="form.salesContractNo" placeholder="鑷姩濉厖" clearable disabled />
+ <el-input
+ v-model="form.salesContractNo"
+ placeholder="鑷姩濉厖"
+ clearable
+ disabled
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="渚涘簲鍟嗗悕绉帮細" prop="supplierName">
- <el-input v-model="form.supplierName" placeholder="鑷姩濉厖" clearable disabled />
+ <el-input
+ v-model="form.supplierName"
+ placeholder="鑷姩濉厖"
+ clearable
+ disabled
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
- <el-input v-model="form.projectName" placeholder="鑷姩濉厖" clearable disabled />
+ <el-input
+ v-model="form.projectName"
+ placeholder="鑷姩濉厖"
+ clearable
+ disabled
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鍙戠エ鍙凤細" prop="invoiceNumber">
- <el-input v-model="form.invoiceNumber" placeholder="璇疯緭鍏�" clearable />
+ <el-input
+ v-model="form.invoiceNumber"
+ placeholder="璇疯緭鍏�"
+ clearable
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceAmount">
- <el-input type="number" :step="0.01" :min="0" v-model="form.invoiceAmount" placeholder="鑷姩濉厖" clearable />
+ <el-input-number :step="0.01" :min="0" style="width: 100%"
+ v-model="form.invoiceAmount"
+ placeholder="鑷姩濉厖"
+ clearable
+ :disabled="true"
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="褰曞叆浜猴細" prop="issUer">
- <el-input v-model="form.issUer" placeholder="璇疯緭鍏�" clearable disabled />
+ <el-input
+ v-model="form.issUer"
+ placeholder="璇疯緭鍏�"
+ clearable
+ disabled
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="寮�绁ㄦ棩鏈燂細" prop="entryDate">
- <el-date-picker style="width: 100%" v-model="form.entryDate" type="date" clearable />
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.entryDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="涓婁紶闄勪欢">
- <FileUpload :showTip="false" accept="*" :autoUpload="true" :action="action" :headers="{
- Authorization: 'Bearer ' + getToken(),
- }" :limit="10" @success="uploadSuccess" @remove="removeFile" />
+ <FileUpload
+ :showTip="false"
+ accept="*"
+ :autoUpload="true"
+ :action="action"
+ :headers="{
+ Authorization: 'Bearer ' + getToken(),
+ }"
+ :limit="10"
+ @success="uploadSuccess"
+ @remove="removeFile"
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="褰曞叆鏃ユ湡锛�" prop="enterDate">
- <el-date-picker style="width: 100%" v-model="form.enterDate" type="date" clearable />
+ <el-date-picker
+ style="width: 100%"
+ v-model="form.enterDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ clearable
+ />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="浜у搧淇℃伅锛�"> </el-form-item>
- <PIMTable rowKey="id" :column="columns" :tableData="form.productData" height="auto">
+ <PIMTable
+ rowKey="id"
+ :column="columns"
+ :tableData="form.productData"
+ :summaryMethod="summarizeChildrenTable"
+ :isShowSummary="true"
+ height="auto"
+ >
<template #ticketsNumRef="{ row }">
- <el-input-number v-model="row.ticketsNum" placeholder="璇烽�夋嫨" :min="0" :step="0.1" clearable style="width: 100%"
- @change="invoiceNumBlur(row)" />
+ <el-input-number
+ v-model="row.ticketsNum"
+ placeholder="璇疯緭鍏�"
+ :min="0"
+ :step="0.1"
+ :precision="2"
+ clearable
+ style="width: 100%"
+ @change="invoiceNumBlur(row)"
+ />
</template>
<template #ticketsAmountRef="{ row }">
- <el-input-number v-model="row.ticketsAmount" placeholder="璇烽�夋嫨" :min="0" :step="0.1" clearable
- style="width: 100%" @change="invoiceAmountBlur(row)" />
+ <el-input-number
+ v-model="row.ticketsAmount"
+ placeholder="璇疯緭鍏�"
+ :min="0"
+ :precision="2"
+ :step="0.1"
+ clearable
+ style="width: 100%"
+ @change="invoiceAmountBlur(row)"
+ />
</template>
</PIMTable>
</el-form>
<template #footer>
+ <el-button type="primary" :loading="modalLoading" @click="submitForm">
+ {{ modalOptions.confirmText }}
+ </el-button>
<el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
- <el-button type="primary" :loading="modalLoading" @click="submitForm">
- {{ modalOptions.confirmText }}
- </el-button>
</template>
</el-dialog>
</template>
<script setup>
import { ref, getCurrentInstance } from "vue";
+import { defineEmits } from 'vue';
import { useModal } from "@/hooks/useModal";
import useFormData from "@/hooks/useFormData";
import FileUpload from "@/components/Upload/FileUpload.vue";
@@ -139,14 +221,18 @@
title: "鏉ョエ鐧昏",
});
+const emit = defineEmits(['refreshList']);
+
const columns = [
{
label: "浜у搧澶х被",
prop: "productCategory",
+ width: 120,
},
{
label: "瑙勬牸鍨嬪彿",
prop: "specificationModel",
+ width: 120,
},
{
label: "鍗曚綅",
@@ -211,10 +297,12 @@
{
label: "鏈潵绁ㄦ暟",
prop: "futureTickets",
+ width: 100,
},
{
label: "鏈潵绁ㄩ噾棰�(鍏�)",
prop: "futureTicketsAmount",
+ width: 200,
},
];
@@ -244,7 +332,19 @@
form.productData = data.productData;
}
};
-
+// 瀛愯〃鍚堣鏂规硶
+const summarizeChildrenTable = (param) => {
+ return proxy.summarizeTable(param, [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ "ticketsNum",
+ "ticketsAmount",
+ "ticketsAmountRef",
+ "futureTickets",
+ "futureTicketsAmount",
+ ]);
+};
//鏈鏉ョエ鏁板け鐒︽搷浣�
const invoiceNumBlur = (row) => {
if (!row.ticketsNum || row.ticketsNum === "") {
@@ -256,11 +356,11 @@
return;
}
// 璁$畻鏈鏉ョエ閲戦
- row.ticketsAmount = row.ticketsNum * row.taxInclusiveUnitPrice;
+ row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2)
// 璁$畻鏈潵绁ㄦ暟
- row.futureTickets = row.tempFutureTickets - row.ticketsNum;
+ row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
// 璁$畻鏈潵绁ㄩ噾棰�
- row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount;
+ row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
calculateinvoiceAmount();
};
@@ -279,9 +379,9 @@
(row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2)
);
// 璁$畻鏈潵绁ㄦ暟
- row.futureTickets = row.tempFutureTickets - row.ticketsNum;
+ row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2)
// 璁$畻鏈潵绁ㄩ噾棰�
- row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount;
+ row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2)
calculateinvoiceAmount();
};
@@ -289,7 +389,7 @@
let invoiceAmountTotal = 0;
form.productData.forEach((item) => {
if (item.ticketsAmount) {
- invoiceAmountTotal += item.ticketsAmount;
+ invoiceAmountTotal += Number(item.ticketsAmount);
}
});
form.invoiceAmount = invoiceAmountTotal.toFixed(2);
@@ -311,10 +411,15 @@
form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId);
};
+const closeAndRefresh = () => {
+ closeModal();
+ emit('refreshList');
+};
+
const submitForm = () => {
formRef.value.validate(async (valid, fields) => {
if (valid) {
- modalLoading.value = true;
+ // modalLoading.value = true;
const { code } = await addOrUpdateRegistration({
purchaseLedgerId: id.value,
purchaseContractNumber: form.purchaseLedgerNo,
@@ -334,7 +439,7 @@
});
modalLoading.value = false;
if (code == 200) {
- closeModal();
+ closeAndRefresh();
}
} else {
modalLoading.value = false;
@@ -344,6 +449,7 @@
defineExpose({
open,
+ closeAndRefresh,
});
</script>
--
Gitblit v1.9.3