From 9d496497c8f4b9fea9609efd20b96b44016c305d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 17:43:00 +0800
Subject: [PATCH] 付款流水-添加采购合同号筛选
---
src/views/salesManagement/invoiceLedger/index.vue | 470 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 256 insertions(+), 214 deletions(-)
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index db08cab..14f6908 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -1,65 +1,68 @@
<template>
<div class="app-container">
<div class="search_form">
- <div>
- <span class="search_title">瀹㈡埛鍚嶇О/鍚堝悓鍙凤細</span>
- <el-input
- v-model="searchForm.searchText"
- style="width: 240px"
- placeholder="杈撳叆瀹㈡埛鍚嶇О/鍚堝悓鍙锋悳绱�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- <span class="search_title" style="margin-left: 10px">寮�绁ㄦ棩鏈燂細</span>
- <el-date-picker
- style="width: 240px"
- v-model="searchForm.invoiceDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
- </div>
- <div>
- <el-button @click="handleOut" type="primary" style="width: 100px">瀵煎嚭</el-button>
- </div>
+ <el-form :inline="true" :model="searchForm">
+ <el-form-item label="瀹㈡埛鍚嶇О/鍚堝悓鍙�">
+ <el-input v-model="searchForm.searchText" style="width: 240px" placeholder="杈撳叆瀹㈡埛鍚嶇О/閿�鍞悎鍚屽彿鎼滅储"
+ @change="handleQuery" clearable :prefix-icon="Search" />
+ </el-form-item>
+ <el-form-item label="寮�绁ㄦ棩鏈�">
+ <el-date-picker style="width: 240px" v-model="searchForm.invoiceDate" value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD" type="daterange" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿" clearable
+ @change="changeDateRange" @clear="clearRange" />
+ </el-form-item>
+ <el-form-item label="褰曞叆鏃ユ湡">
+ <el-date-picker style="width: 100%" v-model="searchForm.createTimeStart" value-format="YYYY-MM-DD HH:mm:ss"
+ format="YYYY-MM-DD" type="date" placeholder="璇烽�夋嫨" clearable @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="涓嶆樉绀烘湁鍙戠エ琛�">
+ <el-checkbox v-model="searchForm.status" @change="handleQuery" />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
+ <el-button @click="resetForm"> 閲嶇疆 </el-button>
+ <el-button @click="handleOut" type="primary">瀵煎嚭</el-button>
+ </el-form-item>
+ </el-form>
</div>
<div class="table_list">
- <el-table :data="tableData" border v-loading="tableLoading"
- @selection-change="handleSelectionChange"
- :row-key="row => row.id"
- show-summary
- :summary-method="summarizeMainTable"
- height="calc(100vh - 18.5em)">
+ <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
+ :row-key="(row) => row.id" show-summary :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
<el-table-column align="center" type="selection" width="55" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" show-overflow-tooltip/>
- <el-table-column label="瀹㈡埛鍚堝悓鍙�" prop="customerContractNo" show-overflow-tooltip/>
- <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip/>
- <el-table-column label="浜у搧澶х被" prop="productCategory" />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
- <el-table-column label="鍙戠エ鍙�" prop="invoiceNo" show-overflow-tooltip/>
- <el-table-column label="鍙戠エ閲戦(鍏�)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
- <el-table-column label="绋庣巼" prop="taxRate" show-overflow-tooltip/>
- <el-table-column label="寮�绁ㄤ汉" prop="invoicePerson" show-overflow-tooltip/>
- <el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip/>
- <el-table-column label="鍙戠エ" prop="invoiceFileName" show-overflow-tooltip>
+ <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" show-overflow-tooltip width="180" />
+ <el-table-column label="瀹㈡埛鍚堝悓鍙�" prop="customerContractNo" show-overflow-tooltip width="180" />
+ <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip width="240" />
+ <el-table-column label="椤圭洰" prop="projectName" width="320" />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" width="200" />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="160" show-overflow-tooltip />
+ <el-table-column label="鍙戠エ鍙�" prop="invoiceNo" width="200" show-overflow-tooltip />
+ <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="invoicePerson" show-overflow-tooltip />
+ <el-table-column label="褰曞叆鏃ユ湡" prop="createTime" show-overflow-tooltip :formatter="formatDate" width="180" />
+ <el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip width="120" />
+ <el-table-column label="鍙戠エ" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right">
<template #default="scope">
- <span v-if="scope.row.invoiceFileName">{{ scope.row.invoiceFileName }}</span>
- <el-button v-else link type="primary" @click="handleDownload(scope.row)">涓婁紶</el-button>
+ <el-button v-if="scope.row.invoiceFileName" text bg type="primary"
+ @click="handleFile(scope.row.commonFiles)">
+ 鏌ョ湅闄勪欢
+ </el-button>
+ <el-button v-else link type="primary" @click="handleDownload(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">
+ 涓婁紶
+ </el-button>
</template>
</el-table-column>
- <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
+ <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openForm(scope.row);">缂栬緫</el-button>
+ <el-button link type="primary" size="small" @click="openForm(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">缂栬緫</el-button>
+ <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">鍒犻櫎</el-button>
</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">
@@ -71,65 +74,45 @@
</el-col>
<el-col :span="12">
<el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerName">
- <el-input v-model="form.customerName" placeholder="鑷姩濉厖" clearable disabled/>
+ <el-input v-model="form.customerName" placeholder="鑷姩濉厖" clearable 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="璇疯緭鍏�" clearable/>
+ <el-input v-model="form.invoiceNo" placeholder="璇疯緭鍏�" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceTotal">
- <el-input type="number" :step="0.01" v-model="form.invoiceTotal" placeholder="璇疯緭鍏�" clearable/>
+ <el-form-item :label="`鍙戠エ閲戦(鍏�)锛� 鍚堝悓鎬婚(${form.taxInclusiveTotalPrice}鍏�)`" prop="invoiceTotal">
+ <el-input-number :step="0.01" :min="0" :max="form.taxInclusiveTotalPrice" style="width: 100%" v-model="form.invoiceTotal" placeholder="璇疯緭鍏�" clearable :precision="2"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="寮�绁ㄤ汉锛�" prop="invoicePerson">
- <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable/>
+ <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="寮�绁ㄦ棩鏈燂細" prop="invoiceDate">
- <el-date-picker
- style="width: 100%"
- v-model="form.invoiceDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable
- />
+ <el-date-picker style="width: 100%" v-model="form.invoiceDate" 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="24">
<el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
- <el-upload
- v-model:file-list="fileList"
- :action="upload.url"
- multiple
- ref="fileUpload"
- auto-upload
- :headers="upload.headers"
- accept=".pdf"
- :limit="1"
- :before-upload="handleBeforeUpload"
- :on-error="handleUploadError"
- :on-success="handleUploadSuccess"
- :on-remove="handleRemove"
- >
+ <el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload
+ :headers="upload.headers" accept=".pdf" :limit="10" :before-upload="handleBeforeUpload"
+ :on-error="handleUploadError" :on-success="handleUploadSuccess" :on-remove="handleRemove">
<el-button type="primary">涓婁紶</el-button>
<template #tip>
-<!-- 鏂囦欢鏍煎紡鏀寔 doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z-->
- <div class="el-upload__tip">
- 鏂囦欢鏍煎紡鏀寔 pdf
- </div>
+ <!-- 鏂囦欢鏍煎紡鏀寔 doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z-->
+ <div class="el-upload__tip">鏂囦欢鏍煎紡鏀寔 pdf</div>
</template>
</el-upload>
</el-form-item>
@@ -143,30 +126,17 @@
</div>
</template>
</el-dialog>
- <el-dialog title="涓婁紶寮圭獥" width="20%" v-model="uploadModal">
+ <el-dialog title="涓婁紶寮圭獥" width="50%" v-model="uploadModal">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
- <el-upload
- v-model:file-list="fileList"
- :action="upload.url"
- multiple
- ref="fileUpload"
- auto-upload
- :headers="upload.headers"
- accept=".pdf"
- :limit="1"
- :on-exceed="handleExceed"
- :before-upload="handleBeforeUpload"
- :on-error="handleUploadError"
- :on-success="handleUploadSuccess"
- :on-remove="handleRemove"
- >
+ <el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload
+ :headers="upload.headers" accept=".pdf" :limit="10" style="width: 100%" :on-exceed="handleExceed"
+ :before-upload="handleBeforeUpload" :on-error="handleUploadError" :on-success="handleUploadSuccess"
+ :on-remove="handleRemove">
<el-button type="primary">涓婁紶</el-button>
<template #tip>
- <div class="el-upload__tip">
- 鏂囦欢鏍煎紡浠呮敮鎸� pdf
- </div>
+ <div class="el-upload__tip">鏂囦欢鏍煎紡浠呮敮鎸� pdf</div>
</template>
</el-upload>
</el-form-item>
@@ -175,7 +145,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="commiInvoicetFile" type="primary">纭</el-button>
- <el-button @click="uploadModal = false">鍙栨秷</el-button>
+ <el-button @click="uploadModal = false">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
@@ -183,44 +153,54 @@
</template>
<script setup>
-import pagination from '@/components/PIMTable/Pagination.vue'
-import { ref } from 'vue'
-import {Search} from "@element-plus/icons-vue";
-import {ElMessageBox } from "element-plus";
-import { getToken } from "@/utils/auth"
+import pagination from "@/components/PIMTable/Pagination.vue";
+import { ref } from "vue";
+import { Search } from "@element-plus/icons-vue";
+import { ElMessageBox } from "element-plus";
+import { getToken } from "@/utils/auth";
import {
invoiceLedgerSaveOrUpdate,
invoiceLedgerProductInfo,
commitFile,
- registrationProductPage
+ registrationProductPage,
+ delInvoiceLedgerByRegProductId,
} from "../../../api/salesManagement/invoiceLedger.js";
-const { proxy } = getCurrentInstance()
-const tableData = ref([])
-const productData = ref([])
-const selectedRows = ref([])
-const tableLoading = ref(false)
+import useUserStore from "@/store/modules/user.js";
+import useFormData from "@/hooks/useFormData";
+import dayjs from "dayjs";
+
+const { proxy } = getCurrentInstance();
+const tableData = ref([]);
+const productData = ref([]);
+const selectedRows = ref([]);
+const tableLoading = ref(false);
const page = reactive({
current: 1,
- size: 10,
-})
-const total = ref(0)
-const fileList = ref([])
-const dialogFormVisible = ref(false)
+ size: 100,
+});
+const total = ref(0);
+const fileList = ref([]);
+const dialogFormVisible = ref(false);
const data = reactive({
searchForm: {
- searchText: '',
- invoiceDate:''
+ searchText: "",
+ status: false,
+ invoiceDate: null,
+ invoiceDateStart: undefined,
+ invoiceDateEnd: undefined,
+ createTimeStart: "", // 褰曞叆鏃ユ湡
},
form: {
- salesLedgerId: '',
- customerId: '',
- invoiceNo: '',
- invoiceTotal: '',
- taxRate: '',
- invoicePerson: '',
- invoiceDate: '',
- customerName:'',
- fileList:[]
+ salesLedgerId: "",
+ customerId: "",
+ invoiceNo: "",
+ invoiceTotal: "",
+ taxRate: "",
+ invoicePerson: "",
+ invoiceDate: "",
+ customerName: "",
+ fileList: [],
+ createTime: "", // 褰曞叆鏃ユ湡
},
rules: {
salesLedgerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -231,63 +211,77 @@
invoicePerson: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
invoiceDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
customerName: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- }
-})
-const { searchForm, form, rules } = toRefs(data)
-const currentId = ref('')
+ },
+});
+const { form, rules } = toRefs(data);
+const { form: searchForm, resetForm } = useFormData(data.searchForm);
+const currentId = ref("");
+const userStore = useUserStore();
const upload = reactive({
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile",
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
-})
-const matchFileType = ref(['pdf'])
-const uploadModal = ref(false)
+});
+const matchFileType = ref(["pdf"]);
+const uploadModal = ref(false);
const formattedNumber = (row, column, cellValue) => {
return parseFloat(cellValue).toFixed(2);
+};
+const formatDate = (row, column, cellValue) => {
+ return dayjs(cellValue).format("YYYY-MM-DD HH:mm:ss");
};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
- page.current = 1
- getList()
-}
-const paginationChange = ({ current, limit }) => {
- page.current = current;
- page.size = limit;
- getList()
-}
+ page.current = 1;
+ getList();
+};
+const paginationChange = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
const getList = () => {
- tableLoading.value = true
- registrationProductPage({...searchForm.value, ...page}).then(res => {
- tableLoading.value = false
+ tableLoading.value = true;
+ const { invoiceDate, ...rest } = searchForm;
+ registrationProductPage({ ...rest, ...page }).then((res) => {
+ tableLoading.value = false;
tableData.value = res.data.records;
total.value = res.data.total;
- })
-}
+ });
+};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
- selectedRows.value = selection
-}
+ selectedRows.value = selection;
+};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, ['invoiceTotal'], {
+ return proxy.summarizeTable(param, ["invoiceTotal"], {
ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
});
};
// 鎵撳紑寮规
const openForm = (row) => {
- form.value = {}
- productData.value = []
- fileList.value = []
+ form.value = {};
+ productData.value = [];
+ fileList.value = [];
currentId.value = row.id;
- invoiceLedgerProductInfo({id: row.id}).then(res => {
- form.value = {...res.data}
+
+ invoiceLedgerProductInfo({ id: row.id }).then((res) => {
+ form.value = { ...res.data };
fileList.value = res.data.fileList;
- })
- dialogFormVisible.value = true
-}
+ if (!form.value.invoicePerson) {
+ form.value.invoicePerson = userStore.nickName;
+ form.value.entryDate = getCurrentDate();
+ }
+ if (!form.value.invoiceDate) {
+ form.value.invoiceDate = getCurrentDate();
+ }
+ });
+ dialogFormVisible.value = true;
+};
// 涓婁紶澶氫釜鏂囦欢灏辫鐩栧師鏉ョ殑
const handleExceed = (files) => {
proxy.$refs["fileUpload"].clearFiles();
@@ -297,107 +291,155 @@
};
// 涓婁紶鍓嶆牎妫�
function handleBeforeUpload(file) {
- console.log('file',file)
+ console.log("file", file);
// 鏍℃鏂囦欢澶у皬
if (file.size > 1024 * 1024 * 10) {
- proxy.$modal.msgError('涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!')
- return false
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
+ return false;
}
// 鍒ゆ柇鏂囦欢鏍煎紡鏄惁绗﹀悎
- const fileType = file.name.split('.').pop().toLowerCase();
- if(!matchFileType.value.includes(fileType)) {
- proxy.$modal.msgError('鏂囦欢鏍煎紡涓嶅尮閰�')
- return false
+ const fileType = file.name.split(".").pop().toLowerCase();
+ if (!matchFileType.value.includes(fileType)) {
+ proxy.$modal.msgError("鏂囦欢鏍煎紡涓嶅尮閰�");
+ return false;
}
- proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...")
- return true
+ proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
+ return true;
}
// 涓婁紶澶辫触
function handleUploadError(err) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触")
- proxy.$modal.closeLoading()
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
+ proxy.$modal.closeLoading();
}
// 涓婁紶鎴愬姛鍥炶皟
function handleUploadSuccess(res, file, uploadFiles) {
- proxy.$modal.closeLoading()
+ proxy.$modal.closeLoading();
if (res.code === 200) {
- proxy.$refs["fileUpload"].handleRemove(file)
- fileList.value.push(res.data)
- proxy.$modal.msgSuccess("涓婁紶鎴愬姛")
+ proxy.$refs["fileUpload"].handleRemove(file);
+ fileList.value.push(res.data);
+ proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
} else {
- proxy.$modal.msgError(res.msg)
- proxy.$refs.fileUpload.handleRemove(file)
+ proxy.$modal.msgError(res.msg);
+ proxy.$refs.fileUpload.handleRemove(file);
}
}
// 绉婚櫎鏂囦欢
-function handleRemove (file) {
- let index = fileList.value.findIndex(item => item.url === file.url)
- if(index > -1) {
- fileList.value.splice(index, 1)
+function handleRemove(file) {
+ let index = fileList.value.findIndex((item) => item.url === file.url);
+ if (index > -1) {
+ fileList.value.splice(index, 1);
}
}
// 鎻愪氦琛ㄥ崟
const submitForm = () => {
- proxy.$refs["formRef"].validate(valid => {
+ proxy.$refs["formRef"].validate((valid) => {
if (valid) {
form.value.fileList = fileList.value;
- invoiceLedgerSaveOrUpdate(form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
- closeDia()
- getList()
- })
+ invoiceLedgerSaveOrUpdate(form.value).then((res) => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
}
- })
-}
+ });
+};
// 鍏抽棴寮规
const closeDia = () => {
- proxy.resetForm("formRef")
- dialogFormVisible.value = false
-}
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
+};
// 瀵煎嚭
const handleOut = () => {
- ElMessageBox.confirm(
- '閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�',
- '瀵煎嚭', {
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- proxy.download("/invoiceLedger/export", {}, '寮�绁ㄥ彴璐�.xlsx')
- }).catch(() => {
- proxy.$modal.msg("宸插彇娑�")
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
-}
+ .then(() => {
+ proxy.download("/invoiceLedger/export", {}, "寮�绁ㄥ彴璐�.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
// 鎵撳紑闄勪欢涓婁紶寮圭獥
const handleDownload = (val) => {
- fileList.value = []
- uploadModal.value = true
- currentId.value = val.id
-}
+ fileList.value = [];
+ uploadModal.value = true;
+ currentId.value = val.id;
+};
// 纭鏂囦欢涓婁紶
const commiInvoicetFile = () => {
const object = {
fileList: fileList.value,
id: currentId.value,
- }
- commitFile(object).then(res => {
+ };
+ commitFile(object).then((res) => {
if (res.code === 200) {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
- uploadModal.value = false
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ uploadModal.value = false;
}
getList();
- currentId.value = ''
- fileList.value = []
+ currentId.value = "";
+ fileList.value = [];
+ });
+};
+// 鍒犻櫎寮�绁ㄥ彴璐�
+const delInvoiceLedger = (row) => {
+ ElMessageBox.confirm("璇ュ彂绁ㄥ彴璐﹀皢琚垹闄�,鏄惁纭鍒犻櫎", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
+ .then(() => {
+ delInvoiceLedgerByRegProductId(row.id).then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+function getCurrentDate() {
+ const today = new Date();
+ const year = today.getFullYear();
+ const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+ const day = String(today.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day}`;
}
+const changeDateRange = (date) => {
+ if (date) {
+ searchForm.invoiceDateStart = date[0];
+ searchForm.invoiceDateEnd = date[1];
+ getList();
+ }
+};
-getList()
+const handleFile = (commonFiles) => {
+ commonFiles.forEach((e) => {
+ proxy.$download.name(e.url);
+ });
+};
+
+const clearRange = () => {
+ searchForm.invoiceDate = [];
+ searchForm.invoiceDateStart = undefined;
+ searchForm.invoiceDateEnd = undefined;
+ getList();
+};
+
+onMounted(() => {
+ getList();
+});
</script>
<style scoped lang="scss">
-
+.table_list {
+ margin-top: unset;
+}
</style>
--
Gitblit v1.9.3