From 9af1256e9e86154aa319c1b0fe79afa87730f515 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 14 一月 2026 11:56:07 +0800
Subject: [PATCH] Merge branch 'dev_天津军泰伟业' of http://114.132.189.42:9002/r/product-inventory-management into dev_天津军泰伟业
---
src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue | 171 +++--
src/views/salesManagement/receiptPayment/index.vue | 980 ++++++++++++++++-----------------
src/views/salesManagement/salesLedger/index.vue | 532 +++++++++---------
src/views/procurementManagement/invoiceEntry/components/Modal.vue | 1
4 files changed, 845 insertions(+), 839 deletions(-)
diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index 2282f01..171850e 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -57,6 +57,7 @@
prop="invoiceAmount">
<el-input-number :step="0.01"
:min="0"
+ :disabled="true"
style="width: 100%"
v-model="form.invoiceAmount"
placeholder="璇疯緭鍏ュ彂绁ㄩ噾棰�"
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
index e26d73c..85f83ff 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
@@ -28,12 +28,22 @@
</el-col>
<el-col :span="12">
<el-form-item label="鏉ョエ鏁帮細">
- <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/>
+ <el-input-number :step="0.1"
+ :min="0"
+ style="width: 100%"
+ v-model="form.ticketsNum"
+ @change="inputTicketsNum"
+ :precision="2" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鏈鏉ョエ閲戦(鍏�)锛�">
- <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsAmount" @change="inputTicketsAmount" :precision="2"/>
+ <el-input-number :step="0.1"
+ :min="0"
+ style="width: 100%"
+ v-model="form.ticketsAmount"
+ @change="inputTicketsAmount"
+ :precision="2" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -46,85 +56,92 @@
</template>
<script setup>
-import useFormData from "@/hooks/useFormData";
-import { getProductRecordById } from "@/api/procurementManagement/procurementInvoiceLedger";
-const { proxy } = getCurrentInstance()
+ import useFormData from "@/hooks/useFormData";
+ import { getProductRecordById } from "@/api/procurementManagement/procurementInvoiceLedger";
+ const { proxy } = getCurrentInstance();
-defineOptions({
- name: "鏉ョエ鍙拌处琛ㄥ崟",
-});
-const temFutureTickets = ref(0)
-const { form, resetForm } = useFormData({
- id: undefined,
- purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
- salesContractNo: undefined, // 閿�鍞悎鍚屽彿
- createdAt: undefined, // 鍒涘缓鏃堕棿
- invoiceNumber: undefined, // 鍙戠エ鍙�
- ticketsNum: undefined, // 鏉ョエ鏁�
- ticketsAmount: undefined, // 鏉ョエ閲戦
- taxInclusiveUnitPrice: undefined, // 鍚◣鍗曚环
- ticketRegistrationId: undefined, // 鍚◣鍗曚环
-});
+ defineOptions({
+ name: "鏉ョエ鍙拌处琛ㄥ崟",
+ });
+ const temFutureTickets = ref(0);
+ const { form, resetForm } = useFormData({
+ id: undefined,
+ purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
+ salesContractNo: undefined, // 閿�鍞悎鍚屽彿
+ createdAt: undefined, // 鍒涘缓鏃堕棿
+ invoiceNumber: undefined, // 鍙戠エ鍙�
+ ticketsNum: undefined, // 鏉ョエ鏁�
+ ticketsAmount: undefined, // 鏉ョエ閲戦
+ taxInclusiveUnitPrice: undefined, // 鍚◣鍗曚环
+ ticketRegistrationId: undefined, // 鍚◣鍗曚环
+ });
-const load = async (id) => {
- const { code, data } = await getProductRecordById({ id });
- if (code === 200) {
- form.id = data.id;
- form.purchaseContractNumber = data.purchaseContractNumber;
- form.salesContractNo = data.salesContractNo;
- form.createdAt = data.createdAt;
- form.invoiceNumber = data.invoiceNumber;
- form.ticketsNum = data.ticketsNum;
- form.ticketsAmount = data.ticketsAmount.toFixed(2);
- form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
- form.futureTickets = data.futureTickets;
- temFutureTickets.value = data.futureTickets;
- form.ticketRegistrationId = data.ticketRegistrationId;
- }
-};
+ const load = async id => {
+ const { code, data } = await getProductRecordById({ id });
+ if (code === 200) {
+ form.id = data.id;
+ form.purchaseContractNumber = data.purchaseContractNumber;
+ form.salesContractNo = data.salesContractNo;
+ form.createdAt = data.createdAt;
+ form.invoiceNumber = data.invoiceNumber;
+ form.ticketsNum = data.ticketsNum;
+ form.ticketsAmount = data.ticketsAmount.toFixed(2);
+ form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
+ form.futureTickets = data.futureTickets;
+ // temFutureTickets.value = data.futureTickets;
+ temFutureTickets.value = data.quantity;
-const inputTicketsNum = (val) => {
- // 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
- if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
- proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
- return;
- }
- if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
- proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
- form.ticketsNum = temFutureTickets.value
- }
-
- // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
- const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
- const futureTickets = Number(temFutureTickets.value) - Number(form.ticketsNum);
- form.futureTickets = Number(futureTickets.toFixed(2));
- form.ticketsAmount = Number(ticketsAmount.toFixed(2));
-};
-const inputTicketsAmount = (val) => {
- // 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
- if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
- proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
- return;
- }
-
- if (Number(val) > Number(form.futureTickets*form.taxInclusiveUnitPrice)) {
- proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鎬婚噾棰�");
- form.ticketsAmount = (form.futureTickets*form.taxInclusiveUnitPrice).toFixed(2)
- const ticketsNum = Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice);
- form.ticketsNum = Number(ticketsNum.toFixed(2))
- return;
- }
-
- // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
- const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice);
- form.ticketsNum = Number(ticketsNum.toFixed(2));
-};
+ form.ticketRegistrationId = data.ticketRegistrationId;
+ }
+ };
-defineExpose({
- load,
- form,
- resetForm,
-});
+ const inputTicketsNum = val => {
+ // 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
+ if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
+ proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
+ return;
+ }
+ if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
+ proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
+ form.ticketsNum = temFutureTickets.value;
+ }
+
+ // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
+ const ticketsAmount =
+ Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
+ const futureTickets =
+ Number(temFutureTickets.value) - Number(form.ticketsNum);
+ form.futureTickets = Number(futureTickets.toFixed(2));
+ form.ticketsAmount = Number(ticketsAmount.toFixed(2));
+ };
+ const inputTicketsAmount = val => {
+ // 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
+ if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
+ proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
+ return;
+ }
+
+ if (Number(val) > Number(form.futureTickets * form.taxInclusiveUnitPrice)) {
+ proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鎬婚噾棰�");
+ form.ticketsAmount = (
+ form.futureTickets * form.taxInclusiveUnitPrice
+ ).toFixed(2);
+ const ticketsNum =
+ Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice);
+ form.ticketsNum = Number(ticketsNum.toFixed(2));
+ return;
+ }
+
+ // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
+ const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice);
+ form.ticketsNum = Number(ticketsNum.toFixed(2));
+ };
+
+ defineExpose({
+ load,
+ form,
+ resetForm,
+ });
</script>
<style lang="scss" scoped></style>
diff --git a/src/views/salesManagement/receiptPayment/index.vue b/src/views/salesManagement/receiptPayment/index.vue
index 336f3fa..1d4b0f4 100644
--- a/src/views/salesManagement/receiptPayment/index.vue
+++ b/src/views/salesManagement/receiptPayment/index.vue
@@ -1,27 +1,26 @@
<template>
<div class="app-container">
<div class="search_form">
- <el-form :inline="true" :model="searchForm" style="width: 100%">
+ <el-form :inline="true"
+ :model="searchForm"
+ style="width: 100%">
<el-row justify="space-between">
<el-col :span="24">
<el-form-item label="瀹㈡埛鍚嶇О">
- <el-input
- v-model="searchForm.customerName"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- prefix-icon="Search"
- />
+ <el-input v-model="searchForm.customerName"
+ placeholder="璇疯緭鍏�"
+ @change="handleQuery"
+ clearable
+ prefix-icon="Search" />
</el-form-item>
<el-form-item>
- <el-checkbox
- v-model="searchForm.status"
- label="涓嶆樉绀哄緟鍥炴涓�0"
- @change="handleQuery"
- />
+ <el-checkbox v-model="searchForm.status"
+ label="涓嶆樉绀哄緟鍥炴涓�0"
+ @change="handleQuery" />
</el-form-item>
<el-form-item>
- <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
+ <el-button type="primary"
+ @click="handleQuery"> 鎼滅储 </el-button>
</el-form-item>
</el-col>
</el-row>
@@ -31,158 +30,145 @@
<div class="actions">
<div></div>
<div>
- <el-button type="primary" @click="openForm('add')">
+ <el-button type="primary"
+ @click="openForm('add')">
鏂板鍥炴
</el-button>
- <el-button icon="Download" @click="handleOut"> 瀵煎嚭 </el-button>
+ <el-button icon="Download"
+ @click="handleOut"> 瀵煎嚭 </el-button>
</div>
</div>
- <el-table
- :data="tableData"
- border
- v-loading="tableLoading"
- @selection-change="handleSelectionChange"
- :row-key="(row) => row.id"
- show-summary
- :summary-method="summarizeMainTable"
- :expand-row-keys="expandedRowKeys"
- @expand-change="expandChange"
-
- height="calc(100vh - 21.5em)"
- >
- <el-table-column align="center" type="selection" width="55" />
+ <el-table :data="tableData"
+ border
+ v-loading="tableLoading"
+ @selection-change="handleSelectionChange"
+ :row-key="(row) => row.id"
+ show-summary
+ :summary-method="summarizeMainTable"
+ :expand-row-keys="expandedRowKeys"
+ @expand-change="expandChange"
+ height="calc(100vh - 21.5em)">
+ <el-table-column align="center"
+ type="selection"
+ width="55" />
<el-table-column type="expand">
<template #default="props">
- <el-table
- :data="props.row.children"
- border
- show-summary
- :summary-method="summarizeChildrenTable"
- >
- <el-table-column
- align="center"
- label="搴忓彿"
- type="index"
- width="60"
- />
- <el-table-column label="鍥炴鏃ユ湡" prop="receiptPaymentDate" width="130"/>
- <el-table-column label="鍥炴閲戦" prop="receiptPaymentAmount">
+ <el-table :data="props.row.children"
+ border
+ show-summary
+ :summary-method="summarizeChildrenTable">
+ <el-table-column align="center"
+ label="搴忓彿"
+ type="index"
+ width="60" />
+ <el-table-column label="鍥炴鏃ユ湡"
+ prop="receiptPaymentDate"
+ width="130" />
+ <el-table-column label="鍥炴閲戦"
+ prop="receiptPaymentAmount">
<template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%"
- v-model="scope.row.receiptPaymentAmount"
- :disabled="!scope.row.editType"
- :precision="2"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-input-number :step="0.01"
+ :min="0"
+ style="width: 100%"
+ v-model="scope.row.receiptPaymentAmount"
+ :disabled="!scope.row.editType"
+ :precision="2"
+ placeholder="璇疯緭鍏�"
+ clearable />
</template>
</el-table-column>
- <el-table-column label="鍥炴鏂瑰紡" prop="receiptPaymentType">
+ <el-table-column label="鍥炴鏂瑰紡"
+ prop="receiptPaymentType">
<template #default="scope">
- <el-select
- v-model="scope.row.receiptPaymentType"
- placeholder="璇烽�夋嫨"
- clearable
- :disabled="!scope.row.editType"
- >
- <el-option
- v-for="item in receipt_payment_type"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
+ <el-select v-model="scope.row.receiptPaymentType"
+ placeholder="璇烽�夋嫨"
+ clearable
+ :disabled="!scope.row.editType">
+ <el-option v-for="item in receipt_payment_type"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value" />
</el-select>
</template>
</el-table-column>
- <el-table-column label="鐧昏浜�" prop="registrant" width="90"/>
- <el-table-column label="鐧昏鏃ユ湡" prop="createTime" width="130"/>
- <el-table-column label="鎿嶄綔" width="150" align="center">
+ <el-table-column label="鐧昏浜�"
+ prop="registrant"
+ width="90" />
+ <el-table-column label="鐧昏鏃ユ湡"
+ prop="createTime"
+ width="130" />
+ <el-table-column label="鎿嶄綔"
+ width="150"
+ align="center">
<template #default="scope">
- <el-button
- link
- type="primary"
- size="small"
- @click="changeEditType(scope.row)"
- v-if="!scope.row.editType"
- >缂栬緫</el-button
- >
- <el-button
- link
- type="primary"
- size="small"
- @click="saveReceiptPayment(scope.row)"
- v-if="scope.row.editType"
- >淇濆瓨</el-button
- >
- <el-button
- link
- type="primary"
- size="small"
- @click="delReceiptRecord(scope.row)"
- >鍒犻櫎</el-button
- >
+ <el-button link
+ type="primary"
+ size="small"
+ @click="changeEditType(scope.row)"
+ v-if="!scope.row.editType">缂栬緫</el-button>
+ <el-button link
+ type="primary"
+ size="small"
+ @click="saveReceiptPayment(scope.row)"
+ v-if="scope.row.editType">淇濆瓨</el-button>
+ <el-button link
+ type="primary"
+ size="small"
+ @click="delReceiptRecord(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column
- label="閿�鍞悎鍚屽彿"
- prop="salesContractNo"
- show-overflow-tooltip
- width="240"
- />
- <el-table-column
- label="瀹㈡埛鍚嶇О"
- prop="customerName"
- show-overflow-tooltip
- width="240"
- />
- <el-table-column
- label="鍥炴鐘舵��"
- prop="statusName"
- width="120"
- >
+ <el-table-column align="center"
+ label="搴忓彿"
+ type="index"
+ width="60" />
+ <el-table-column label="閿�鍞悎鍚屽彿"
+ prop="salesContractNo"
+ show-overflow-tooltip
+ width="240" />
+ <el-table-column label="瀹㈡埛鍚嶇О"
+ prop="customerName"
+ show-overflow-tooltip
+ width="240" />
+ <el-table-column label="鍥炴鐘舵��"
+ prop="statusName"
+ width="120">
<template #default="{ row }">
- <el-tag :type="getStatusTagType(row.statusName)" disable-transitions>
+ <el-tag :type="getStatusTagType(row.statusName)"
+ disable-transitions>
{{ row.statusName || "--" }}
</el-tag>
</template>
</el-table-column>
-<!-- <el-table-column-->
-<!-- label="浜у搧澶х被"-->
-<!-- prop="productCategory"-->
-<!-- show-overflow-tooltip-->
-<!-- width="100"-->
-<!-- />-->
- <el-table-column
- label="鍙戠エ鍙�"
- prop="invoiceNo"
- show-overflow-tooltip
- width="200"
- />
- <el-table-column
- label="鍙戠エ閲戦(鍏�)"
- prop="invoiceTotal"
- show-overflow-tooltip
- :formatter="formattedNumber"
- width="200"
- />
- <el-table-column label="绋庣巼(%)" prop="taxRate" show-overflow-tooltip />
- <el-table-column
- label="鍥炴閲戦(鍏�)"
- prop="receiptPaymentAmountTotal"
- show-overflow-tooltip
- :formatter="formattedNumber"
- width="200"
- />
- <el-table-column
- label="寰呭洖娆鹃噾棰�(鍏�)"
- prop="noReceiptAmount"
- show-overflow-tooltip
- width="200"
- >
+ <!-- <el-table-column-->
+ <!-- label="浜у搧澶х被"-->
+ <!-- prop="productCategory"-->
+ <!-- show-overflow-tooltip-->
+ <!-- width="100"-->
+ <!-- />-->
+ <el-table-column label="鍙戠エ鍙�"
+ prop="invoiceNo"
+ show-overflow-tooltip
+ width="200" />
+ <el-table-column label="鍙戠エ閲戦(鍏�)"
+ prop="invoiceTotal"
+ show-overflow-tooltip
+ :formatter="formattedNumber"
+ width="200" />
+ <el-table-column label="绋庣巼(%)"
+ prop="taxRate"
+ show-overflow-tooltip />
+ <el-table-column label="鍥炴閲戦(鍏�)"
+ prop="receiptPaymentAmountTotal"
+ show-overflow-tooltip
+ :formatter="formattedNumber"
+ width="200" />
+ <el-table-column label="寰呭洖娆鹃噾棰�(鍏�)"
+ prop="noReceiptAmount"
+ show-overflow-tooltip
+ width="200">
<template #default="{ row, column }">
<el-text type="danger">
{{ formattedNumber(row, column, row.noReceiptAmount) }}
@@ -190,139 +176,126 @@
</template>
</el-table-column>
</el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- layout="total, sizes, prev, pager, next, jumper"
- :page="page.current"
- :limit="page.size"
- @pagination="paginationChange"
- />
+ <pagination v-show="total > 0"
+ :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current"
+ :limit="page.size"
+ @pagination="paginationChange" />
</div>
- <el-dialog
- v-model="dialogFormVisible"
- title="鏂板鍥炴椤甸潰"
- width="70%"
- @close="closeDia"
- >
- <el-form
- :model="form"
- label-width="140px"
- label-position="top"
- :rules="rules"
- ref="formRef"
- >
+ <el-dialog v-model="dialogFormVisible"
+ title="鏂板鍥炴椤甸潰"
+ width="70%"
+ @close="closeDia">
+ <el-form :model="form"
+ label-width="140px"
+ label-position="top"
+ :rules="rules"
+ ref="formRef">
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
- <el-input
- v-model="form.salesContractNo"
- placeholder="鑷姩濉厖"
- disabled
- />
+ <el-form-item label="閿�鍞悎鍚屽彿锛�"
+ prop="salesContractNo">
+ <el-input v-model="form.salesContractNo"
+ placeholder="鑷姩濉厖"
+ disabled />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerName">
- <el-input
- v-model="form.customerName"
- placeholder="鑷姩濉厖"
- disabled
- />
+ <el-form-item label="瀹㈡埛鍚嶇О锛�"
+ prop="customerName">
+ <el-input v-model="form.customerName"
+ placeholder="鑷姩濉厖"
+ disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="鍙戠エ鍙凤細" prop="invoiceNo">
- <el-input
- v-model="form.invoiceNo"
- placeholder="鑷姩濉厖"
- disabled
- />
+ <el-form-item label="鍙戠エ鍙凤細"
+ prop="invoiceNo">
+ <el-input v-model="form.invoiceNo"
+ placeholder="鑷姩濉厖"
+ disabled />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceTotal">
- <el-input
- type="number"
- v-model="form.invoiceTotal"
- placeholder="鑷姩濉厖"
- :step="0.01"
- disabled
- />
+ <el-form-item label="鍙戠エ閲戦(鍏�)锛�"
+ prop="invoiceTotal">
+ <el-input type="number"
+ v-model="form.invoiceTotal"
+ placeholder="鑷姩濉厖"
+ :step="0.01"
+ disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="绋庣巼锛�" prop="taxRate">
- <el-input
- type="number"
- v-model="form.taxRate"
- placeholder="鑷姩濉厖"
- :step="0.01"
- disabled
- />
+ <el-form-item label="绋庣巼锛�"
+ prop="taxRate">
+ <el-input type="number"
+ v-model="form.taxRate"
+ placeholder="鑷姩濉厖"
+ :step="0.01"
+ disabled />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鏈鍥炴閲戦锛�" prop="receiptPaymentAmount">
- <el-input-number :step="0.01" :min="0" style="width: 100%"
- :precision="2"
- v-model="form.receiptPaymentAmount"
- placeholder="璇疯緭鍏�"
- clearable
- />
+ <el-form-item label="鏈鍥炴閲戦锛�"
+ prop="receiptPaymentAmount">
+ <el-input-number :step="0.01"
+ :min="0"
+ style="width: 100%"
+ :precision="2"
+ v-model="form.receiptPaymentAmount"
+ placeholder="璇疯緭鍏�"
+ clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="鍥炴褰㈠紡锛�" prop="receiptPaymentType">
- <el-select
- v-model="form.receiptPaymentType"
- placeholder="璇烽�夋嫨"
- clearable
- >
- <el-option
- v-for="item in receipt_payment_type"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
+ <el-form-item label="鍥炴褰㈠紡锛�"
+ prop="receiptPaymentType">
+ <el-select v-model="form.receiptPaymentType"
+ placeholder="璇烽�夋嫨"
+ clearable>
+ <el-option v-for="item in receipt_payment_type"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value" />
</el-select>
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鍥炴鏃ユ湡锛�" prop="receiptPaymentDate">
- <el-date-picker
- style="width: 100%"
- v-model="form.receiptPaymentDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- />
- </el-form-item>
- </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍥炴鏃ユ湡锛�"
+ prop="receiptPaymentDate">
+ <el-date-picker style="width: 100%"
+ v-model="form.receiptPaymentDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ clearable />
+ </el-form-item>
+ </el-col>
</el-row>
<el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鐧昏浜猴細" prop="registrant">
- <el-input
- v-model="form.registrant"
- placeholder="璇疯緭鍏�"
- clearable
- />
- </el-form-item>
- </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐧昏浜猴細"
+ prop="registrant">
+ <el-input v-model="form.registrant"
+ placeholder="璇疯緭鍏�"
+ clearable />
+ </el-form-item>
+ </el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button type="primary"
+ @click="submitForm">纭</el-button>
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
@@ -331,277 +304,282 @@
</template>
<script setup>
-import pagination from "@/components/PIMTable/Pagination.vue";
-import { onMounted, ref } from "vue";
-import {
- receiptPaymentSaveOrUpdate,
- bindInvoiceNoRegPage,
- invoiceInfo,
- receiptPaymentHistoryListNoPage,
- receiptPaymentDel,
-} from "../../../api/salesManagement/receiptPayment.js";
-import useUserStore from "@/store/modules/user";
-import { ElMessage, ElMessageBox } from "element-plus";
-import useFormData from "@/hooks/useFormData";
+ import pagination from "@/components/PIMTable/Pagination.vue";
+ import { onMounted, ref } from "vue";
+ import {
+ receiptPaymentSaveOrUpdate,
+ bindInvoiceNoRegPage,
+ invoiceInfo,
+ receiptPaymentHistoryListNoPage,
+ receiptPaymentDel,
+ } from "../../../api/salesManagement/receiptPayment.js";
+ import useUserStore from "@/store/modules/user";
+ import { ElMessage, ElMessageBox } from "element-plus";
+ import useFormData from "@/hooks/useFormData";
-const userStore = useUserStore();
-const { proxy } = getCurrentInstance();
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
-});
-const total = ref(0);
-const expandedRowKeys = ref([]);
-
-// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
-const dialogFormVisible = ref(false);
-const data = reactive({
- searchForm: {
- searchText: "",
- status: true,
- customerName: "",
- customerContractNo: "",
- projectName: "",
- },
- form: {
- salesContractNo: "",
- customerName: "",
- invoiceNo: "",
- invoiceTotal: "",
- taxRate: "",
- receiptPaymentAmount: "",
- receiptPaymentType: "",
- registrant: "",
- receiptPaymentDate: "",
- },
- rules: {
- salesContractNo: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- invoiceNo: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- invoiceTotal: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- receiptPaymentAmount: [
- { required: true, message: "璇烽�夋嫨", trigger: "change" },
- ],
- receiptPaymentType: [
- { required: true, message: "璇烽�夋嫨", trigger: "change" },
- ],
- registrant: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- receiptPaymentDate: [
- { required: true, message: "璇烽�夋嫨", trigger: "change" },
- ],
- },
-});
-const { form, rules } = toRefs(data);
-const { form: searchForm, resetForm } = useFormData(data.searchForm);
-const { receipt_payment_type } = proxy.useDict("receipt_payment_type");
-
-const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
-};
-
-const getStatusTagType = (statusName = '') => {
- const normalized = statusName.trim();
- if (!normalized) return 'info';
- return normalized === '鏈畬鎴愬洖娆�' ? 'danger' : 'success';
-};
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const paginationChange = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- bindInvoiceNoRegPage({ ...searchForm, ...page })
- .then((res) => {
- tableLoading.value = false;
- tableData.value = res.data.records;
- total.value = res.data.total;
- if (expandedRowKeys.value.length > 0) {
- const arr = []
- const index = tableData.value.findIndex(item => item.id === expandedRowKeys.value[0]);
- if (index > -1) {
- arr.push(tableData.value[index]);
- expandChange(tableData.value[index], arr)
- }
- }
- })
- .catch(() => {
- tableLoading.value = false;
- });
-};
-// 灞曞紑琛�
-const expandChange = (row, expandedRows) => {
- if (expandedRows.length > 0) {
- expandedRowKeys.value = [];
- try {
- receiptPaymentHistoryListNoPage({
- invoiceLedgerId: row.id,
- type: 1,
- }).then((res) => {
- const index = tableData.value.findIndex((item) => item.id === row.id);
- if (index > -1) {
- if (res?.length > 0) {
- res.forEach((item) => {
- item.editType = false;
- });
- }
- tableData.value[index].children = res;
- }
- expandedRowKeys.value.push(row.id);
- });
- } catch (error) {
- console.log(error);
- }
- } else {
- expandedRowKeys.value = [];
- }
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- console.log("selection", selection);
- selectedRows.value = selection
-};
-// 涓昏〃鍚堣鏂规硶
-const summarizeMainTable = (param) => {
- return proxy.summarizeTable(
- param,
- ["invoiceTotal", "receiptPaymentAmountTotal", "noReceiptAmount"],
- {
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- }
- );
-};
-// 瀛愯〃鍚堣鏂规硶
-const summarizeChildrenTable = (param) => {
- return proxy.summarizeTable(param, ["receiptPaymentAmount"]);
-};
-// 鎵撳紑寮规
-const openForm = () => {
- form.value = {};
- if (selectedRows.value.length !== 1) {
- proxy.$modal.msgError("璇烽�夋嫨涓�鏉℃暟鎹�");
- return;
- }
- if (selectedRows.value[0].noReceiptAmount == 0) {
- proxy.$modal.msgWarning("鏃犻渶鍐嶅洖娆�");
- return;
- }
- invoiceInfo({ id: selectedRows.value[0].id }).then((res) => {
- form.value = { ...res.data };
- form.value.invoiceLedgerId = form.value.id;
- form.value.id = "";
- form.value.registrant = userStore.nickName;
+ const userStore = useUserStore();
+ const { proxy } = getCurrentInstance();
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
});
- dialogFormVisible.value = true;
-};
-// 鎻愪氦琛ㄥ崟
-const submitForm = () => {
- proxy.$refs["formRef"].validate((valid) => {
- if (valid) {
- receiptPaymentSaveOrUpdate(form.value).then((res) => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- });
- }
+ const total = ref(0);
+ const expandedRowKeys = ref([]);
+
+ // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
+ const dialogFormVisible = ref(false);
+ const data = reactive({
+ searchForm: {
+ searchText: "",
+ status: true,
+ customerName: "",
+ customerContractNo: "",
+ projectName: "",
+ },
+ form: {
+ salesContractNo: "",
+ customerName: "",
+ invoiceNo: "",
+ invoiceTotal: "",
+ taxRate: "",
+ receiptPaymentAmount: "",
+ receiptPaymentType: "",
+ registrant: "",
+ receiptPaymentDate: "",
+ },
+ rules: {
+ salesContractNo: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ invoiceNo: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ invoiceTotal: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ receiptPaymentAmount: [
+ { required: true, message: "璇烽�夋嫨", trigger: "change" },
+ ],
+ receiptPaymentType: [
+ { required: true, message: "璇烽�夋嫨", trigger: "change" },
+ ],
+ registrant: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ receiptPaymentDate: [
+ { required: true, message: "璇烽�夋嫨", trigger: "change" },
+ ],
+ },
});
-};
-// 鍏抽棴寮规
-const closeDia = () => {
- proxy.resetForm("formRef");
- dialogFormVisible.value = false;
-};
+ const { form, rules } = toRefs(data);
+ const { form: searchForm, resetForm } = useFormData(data.searchForm);
+ const { receipt_payment_type } = proxy.useDict("receipt_payment_type");
-// 鍒犻櫎鍥炴璁板綍
-const delReceiptRecord = (row) => {
- console.log("row", row);
- ElMessageBox.confirm("纭鍒犻櫎璇ヨ褰曞悧锛�", "鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(async () => {
- try {
- let ids = [];
- ids.push(row.id);
- await receiptPaymentDel(ids);
- ElMessage.success("鍒犻櫎鎴愬姛");
- getList();
- } catch (error) {
- console.error("鍒犻櫎澶辫触:", error);
- ElMessage.error("鍒犻櫎澶辫触");
- }
- })
- .catch(() => {
- ElMessage.info("宸插彇娑堝垹闄�");
- });
-};
-
-// 缂栬緫淇敼鐘舵��
-const changeEditType = (row) => {
- row.editType = !row.editType;
-};
-
-// 淇濆瓨鍥炴璁板綍
-const saveReceiptPayment = (row) => {
- let updateData = {
- id: row.id,
- receiptPaymentType: row.receiptPaymentType,
- receiptPaymentAmount: row.receiptPaymentAmount,
+ const formattedNumber = (row, column, cellValue) => {
+ return parseFloat(cellValue).toFixed(2);
};
- receiptPaymentSaveOrUpdate(updateData).then((res) => {
- row.editType = !row.editType;
- getList();
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- });
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- const ids = selectedRows.value.map((item) => item.id);
- proxy.download(
- `/receiptPayment/export`,
- { ids: `${ids}` },
- "鍥炴鐧昏妗f.xlsx"
- );
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
+ const getStatusTagType = (statusName = "") => {
+ const normalized = statusName.trim();
+ if (!normalized) return "info";
+ return normalized === "鏈畬鎴愬洖娆�" ? "danger" : "success";
+ };
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const paginationChange = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ bindInvoiceNoRegPage({ ...searchForm, ...page })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ if (expandedRowKeys.value.length > 0) {
+ const arr = [];
+ const index = tableData.value.findIndex(
+ item => item.id === expandedRowKeys.value[0]
+ );
+ if (index > -1) {
+ arr.push(tableData.value[index]);
+ expandChange(tableData.value[index], arr);
+ }
+ }
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+ };
+ // 灞曞紑琛�
+ const expandChange = (row, expandedRows) => {
+ if (expandedRows.length > 0) {
+ expandedRowKeys.value = [];
+ try {
+ receiptPaymentHistoryListNoPage({
+ invoiceLedgerId: row.id,
+ type: 1,
+ }).then(res => {
+ const index = tableData.value.findIndex(item => item.id === row.id);
+ if (index > -1) {
+ if (res?.length > 0) {
+ res.forEach(item => {
+ item.editType = false;
+ });
+ }
+ tableData.value[index].children = res;
+ }
+ expandedRowKeys.value.push(row.id);
+ });
+ } catch (error) {
+ console.log(error);
+ }
+ } else {
+ expandedRowKeys.value = [];
+ }
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ // 绛涢�夋帀 editType 涓� false 鐨勯」
+ selectedRows.value = selection.filter(item => item.editType !== false);
+ console.log("selectedRows.value", selectedRows.value);
+ };
+ // 涓昏〃鍚堣鏂规硶
+ const summarizeMainTable = param => {
+ return proxy.summarizeTable(
+ param,
+ ["invoiceTotal", "receiptPaymentAmountTotal", "noReceiptAmount"],
+ {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ }
+ );
+ };
+ // 瀛愯〃鍚堣鏂规硶
+ const summarizeChildrenTable = param => {
+ return proxy.summarizeTable(param, ["receiptPaymentAmount"]);
+ };
+ // 鎵撳紑寮规
+ const openForm = () => {
+ form.value = {};
+ console.log(selectedRows.value, "selectedRows.value");
+
+ if (selectedRows.value.length !== 1) {
+ proxy.$modal.msgError("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ if (selectedRows.value[0].noReceiptAmount == 0) {
+ proxy.$modal.msgWarning("鏃犻渶鍐嶅洖娆�");
+ return;
+ }
+ invoiceInfo({ id: selectedRows.value[0].id }).then(res => {
+ form.value = { ...res.data };
+ form.value.invoiceLedgerId = form.value.id;
+ form.value.id = "";
+ form.value.registrant = userStore.nickName;
});
-};
+ dialogFormVisible.value = true;
+ };
+ // 鎻愪氦琛ㄥ崟
+ const submitForm = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ receiptPaymentSaveOrUpdate(form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
+ }
+ });
+ };
+ // 鍏抽棴寮规
+ const closeDia = () => {
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
+ };
-onMounted(() => {
- getList();
-});
+ // 鍒犻櫎鍥炴璁板綍
+ const delReceiptRecord = row => {
+ console.log("row", row);
+ ElMessageBox.confirm("纭鍒犻櫎璇ヨ褰曞悧锛�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(async () => {
+ try {
+ let ids = [];
+ ids.push(row.id);
+ await receiptPaymentDel(ids);
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ getList();
+ } catch (error) {
+ console.error("鍒犻櫎澶辫触:", error);
+ ElMessage.error("鍒犻櫎澶辫触");
+ }
+ })
+ .catch(() => {
+ ElMessage.info("宸插彇娑堝垹闄�");
+ });
+ };
+
+ // 缂栬緫淇敼鐘舵��
+ const changeEditType = row => {
+ row.editType = !row.editType;
+ };
+
+ // 淇濆瓨鍥炴璁板綍
+ const saveReceiptPayment = row => {
+ let updateData = {
+ id: row.id,
+ receiptPaymentType: row.receiptPaymentType,
+ receiptPaymentAmount: row.receiptPaymentAmount,
+ };
+ receiptPaymentSaveOrUpdate(updateData).then(res => {
+ row.editType = !row.editType;
+ getList();
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ });
+ };
+
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ const ids = selectedRows.value.map(item => item.id);
+ proxy.download(
+ `/receiptPayment/export`,
+ { ids: `${ids}` },
+ "鍥炴鐧昏妗f.xlsx"
+ );
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped lang="scss">
-.table_list {
- margin-top: unset;
-}
-::v-deep(.el-checkbox__label) {
- font-weight: bold;
-}
-.actions {
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
-}
+ .table_list {
+ margin-top: unset;
+ }
+ ::v-deep(.el-checkbox__label) {
+ font-weight: bold;
+ }
+ .actions {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 10px;
+ }
</style>
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index c040769..3d259c8 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -1388,276 +1388,286 @@
// 鏋勫缓鎵撳嵃鍐呭
let printContent = `
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>鎵撳嵃棰勮</title>
- <style>
- body {
- margin: 0;
- padding: 0;
- font-family: "SimSun", serif;
- background: white;
- }
- .print-page {
- width: 200mm;
- height: 75mm;
- padding: 10mm;
- padding-left: 20mm;
- background: white;
- box-sizing: border-box;
- page-break-after: always;
- page-break-inside: avoid;
- }
- .print-page:last-child {
- page-break-after: avoid;
- }
- .delivery-note {
- width: 100%;
- height: 100%;
- font-size: 12px;
- line-height: 1.2;
- display: flex;
- flex-direction: column;
- color: #000;
- }
- .header {
- text-align: center;
- margin-bottom: 8px;
- }
- .company-name {
- font-size: 18px;
- font-weight: bold;
- margin-bottom: 4px;
- }
- .document-title {
- font-size: 16px;
- font-weight: bold;
- }
- .info-section {
- margin-bottom: 8px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .info-row {
- line-height: 20px;
- }
- .label {
- font-weight: bold;
- width: 60px;
- font-size: 12px;
- }
- .value {
- margin-right: 20px;
- min-width: 80px;
- font-size: 12px;
- }
- .table-section {
- margin-bottom: 40px;
- // flex: 0.6;
- }
- .product-table {
- width: 100%;
- border-collapse: collapse;
- border: 1px solid #000;
- }
- .product-table th, .product-table td {
- border: 1px solid #000;
- padding: 6px;
- text-align: center;
- font-size: 12px;
- line-height: 1.4;
- }
- .product-table th {
- font-weight: bold;
- }
- .total-value {
- font-weight: bold;
- }
- .footer-section {
- margin-top: auto;
- }
- .footer-row {
- display: flex;
- margin-bottom: 3px;
- line-height: 22px;
- justify-content: space-between;
- }
- .footer-item {
- display: flex;
- margin-right: 20px;
- }
- .footer-item .label {
- font-weight: bold;
- width: 80px;
- font-size: 12px;
- }
- .footer-item .value {
- min-width: 80px;
- font-size: 12px;
- }
- .address-item .address-value {
- min-width: 200px;
- }
- @media print {
- body {
- margin: 0;
- padding: 0;
- }
- .print-page {
- margin: 0;
- padding: 10mm;
- /* padding-left: 20mm; */
- page-break-inside: avoid;
- page-break-after: always;
- }
- .print-page:last-child {
- page-break-after: avoid;
- }
- }
- </style>
- </head>
- <body>
- `;
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="UTF-8">
+ <title>鎵撳嵃棰勮</title>
+ <style>
+ body {
+ margin: 0;
+ padding: 0;
+ font-family: "SimSun", serif;
+ background: white;
+ }
+ .print-page {
+ width: 200mm;
+ height: 75mm;
+ padding: 10mm;
+ padding-left: 20mm;
+ background: white;
+ box-sizing: border-box;
+ page-break-after: always;
+ page-break-inside: avoid;
+ }
+ .print-page:last-child {
+ page-break-after: avoid;
+ }
+ .delivery-note {
+ width: 100%;
+ height: 100%;
+ font-size: 12px;
+ line-height: 1.2;
+ display: flex;
+ flex-direction: column;
+ color: #000;
+ }
+ .header {
+ text-align: center;
+ margin-bottom: 8px;
+ }
+ .company-name {
+ font-size: 18px;
+ font-weight: bold;
+ margin-bottom: 4px;
+ }
+ .document-title {
+ font-size: 16px;
+ font-weight: bold;
+ }
+ .info-section {
+ margin-bottom: 8px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+ .info-row {
+ line-height: 20px;
+ }
+ .label {
+ font-weight: bold;
+ width: 60px;
+ font-size: 12px;
+ }
+ .value {
+ margin-right: 20px;
+ min-width: 80px;
+ font-size: 12px;
+ }
+ .table-section {
+ margin-bottom: 40px;
+ // flex: 0.6;
+ }
+ .product-table {
+ width: 100%;
+ border-collapse: collapse;
+ border: 1px solid #000;
+ }
+ .product-table th, .product-table td {
+ border: 1px solid #000;
+ padding: 6px;
+ text-align: center;
+ font-size: 12px;
+ line-height: 1.4;
+ }
+ .product-table th {
+ font-weight: bold;
+ }
+ .total-value {
+ font-weight: bold;
+ }
+ .footer-section {
+ margin-top: auto;
+ }
+ .footer-row {
+ display: flex;
+ margin-bottom: 3px;
+ line-height: 22px;
+ justify-content: space-between;
+ }
+ .footer-item {
+ display: flex;
+ margin-right: 20px;
+ }
+ .footer-item .label {
+ font-weight: bold;
+ width: 80px;
+ font-size: 12px;
+ }
+ .footer-item .value {
+ min-width: 80px;
+ font-size: 12px;
+ }
+ .address-item .address-value {
+ min-width: 200px;
+ }
+ @media print {
+ body {
+ margin: 0;
+ padding: 0;
+ }
+ .print-page {
+ margin: 0;
+ padding: 10mm;
+ /* padding-left: 20mm; */
+ page-break-inside: avoid;
+ page-break-after: always;
+ }
+ .print-page:last-child {
+ page-break-after: avoid;
+ }
+ }
+ </style>
+ </head>
+ <body>
+ `;
// 涓烘瘡鏉℃暟鎹敓鎴愭墦鍗伴〉闈�
printData.value.forEach((item, index) => {
printContent += `
- <div class="print-page">
- <div class="delivery-note">
- <div class="header">
- <div class="company-name">${
- currentFactoryName.value
- }</div>
- <div class="document-title">闆跺敭鍙戣揣鍗�</div>
- </div>
-
- <div class="info-section">
- <div class="info-row">
- <div>
- <span class="label">鍙戣揣鏃ユ湡锛�</span>
- <span class="value">${formatDate(
- item.createTime
- )}</span>
- </div>
- <div>
- <span class="label">瀹㈡埛鍚嶇О锛�</span>
- <span class="value">${
- item.customerName || "寮犵埍鏈�"
- }</span>
- </div>
- </div>
- <div class="info-row">
- <span class="label">鍗曞彿锛�</span>
- <span class="value">${
- item.salesContractNo || ""
- }</span>
- </div>
- </div>
+ <div class="print-page">
+ <div class="delivery-note">
+ <div class="header">
+ <div class="company-name">${
+ currentFactoryName.value
+ }</div>
+ <div class="document-title">闆跺敭鍙戣揣鍗�</div>
+ </div>
+
+ <div class="info-section">
+ <div class="info-row">
+ <div>
+ <span class="label">鍙戣揣鏃ユ湡锛�</span>
+ <span class="value">${formatDate(
+ item.createTime
+ )}</span>
+ </div>
+ <div>
+ <span class="label">瀹㈡埛鍚嶇О锛�</span>
+ <span class="value">${
+ item.customerName ||
+ "寮犵埍鏈�"
+ }</span>
+ </div>
+ </div>
+ <div class="info-row">
+ <span class="label">鍗曞彿锛�</span>
+ <span class="value">${
+ item.salesContractNo ||
+ ""
+ }</span>
+ </div>
+ </div>
- <div class="table-section">
- <table class="product-table">
- <thead>
- <tr>
- <th>浜у搧鍚嶇О</th>
- <th>瑙勬牸鍨嬪彿</th>
- <th>鍗曚綅</th>
- <th>鍗曚环</th>
- <th>闆跺敭鏁伴噺</th>
- <th>闆跺敭閲戦</th>
- </tr>
- </thead>
- <tbody>
- ${
- item.products &&
- item.products.length > 0
- ? item.products
- .map(
- product => `
- <tr>
- <td>${
- product.productCategory || ""
- }</td>
- <td>${
- product.specificationModel || ""
- }</td>
- <td>${product.unit || ""}</td>
- <td>${
- product.taxInclusiveUnitPrice ||
- "0"
- }</td>
- <td>${
- product.quantity || "0"
- }</td>
- <td>${
- product.taxInclusiveTotalPrice ||
- "0"
- }</td>
- </tr>
- `
- )
- .join("")
- : '<tr><td colspan="6" style="text-align: center; color: #999;">鏆傛棤浜у搧鏁版嵁</td></tr>'
- }
- </tbody>
- <tfoot>
- <tr>
- <td class="label">鍚堣</td>
- <td class="total-value"></td>
- <td class="total-value"></td>
- <td class="total-value"></td>
- <td class="total-value">${getTotalQuantityForPrint(
- item.products
- )}</td>
- <td class="total-value">${getTotalAmountForPrint(
- item.products
- )}</td>
- </tr>
- </tfoot>
- </table>
- </div>
+ <div class="table-section">
+ <table class="product-table">
+ <thead>
+ <tr>
+ <th>浜у搧鍚嶇О</th>
+ <th>瑙勬牸鍨嬪彿</th>
+ <th>鍗曚綅</th>
+ <th>鍗曚环</th>
+ <th>闆跺敭鏁伴噺</th>
+ <th>闆跺敭閲戦</th>
+ </tr>
+ </thead>
+ <tbody>
+ ${
+ item.products &&
+ item.products.length >
+ 0
+ ? item.products
+ .map(
+ product => `
+ <tr>
+ <td>${
+ product.productCategory ||
+ ""
+ }</td>
+ <td>${
+ product.specificationModel ||
+ ""
+ }</td>
+ <td>${
+ product.unit ||
+ ""
+ }</td>
+ <td>${
+ product.taxInclusiveUnitPrice ||
+ "0"
+ }</td>
+ <td>${
+ product.quantity ||
+ "0"
+ }</td>
+ <td>${
+ product.taxInclusiveTotalPrice ||
+ "0"
+ }</td>
+ </tr>
+ `
+ )
+ .join("")
+ : '<tr><td colspan="6" style="text-align: center; color: #999;">鏆傛棤浜у搧鏁版嵁</td></tr>'
+ }
+ </tbody>
+ <tfoot>
+ <tr>
+ <td class="label">鍚堣</td>
+ <td class="total-value"></td>
+ <td class="total-value"></td>
+ <td class="total-value"></td>
+ <td class="total-value">${getTotalQuantityForPrint(
+ item.products
+ )}</td>
+ <td class="total-value">${getTotalAmountForPrint(
+ item.products
+ )}</td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
- <div class="footer-section">
- <div class="footer-row">
- <div class="footer-item">
- <span class="label">鏀惰揣鐢佃瘽锛�</span>
- <span class="value"></span>
- </div>
- <div class="footer-item">
- <span class="label">鏀惰揣浜猴細</span>
- <span class="value"></span>
- </div>
- <div class="footer-item address-item">
- <span class="label">鏀惰揣鍦板潃锛�</span>
- <span class="value address-value"></span>
- </div>
- </div>
- <div class="footer-row">
- <div class="footer-item">
- <span class="label">鎿嶄綔鍛橈細</span>
- <span class="value">${
- userStore.nickName || "鎾曞紑鍓�"
- }</span>
- </div>
- <div class="footer-item">
- <span class="label">鎵撳嵃鏃ユ湡锛�</span>
- <span class="value">${formatDateTime(
- new Date()
- )}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- `;
+ <div class="footer-section">
+ <div class="footer-row">
+ <div class="footer-item">
+ <span class="label">鏀惰揣鐢佃瘽锛�</span>
+ <span class="value"></span>
+ </div>
+ <div class="footer-item">
+ <span class="label">鏀惰揣浜猴細</span>
+ <span class="value"></span>
+ </div>
+ <div class="footer-item address-item">
+ <span class="label">鏀惰揣鍦板潃锛�</span>
+ <span class="value address-value"></span>
+ </div>
+ </div>
+ <div class="footer-row">
+ <div class="footer-item">
+ <span class="label">鎿嶄綔鍛橈細</span>
+ <span class="value">${
+ userStore.nickName ||
+ "鎾曞紑鍓�"
+ }</span>
+ </div>
+ <div class="footer-item">
+ <span class="label">鎵撳嵃鏃ユ湡锛�</span>
+ <span class="value">${formatDateTime(
+ new Date()
+ )}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ `;
});
printContent += `
- </body>
- </html>
- `;
+ </body>
+ </html>
+ `;
// 鍐欏叆鍐呭鍒版柊绐楀彛
printWindow.document.write(printContent);
--
Gitblit v1.9.3