From feb53a39cb88c7f807c287b18d8008bb149b5200 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 13 六月 2025 17:40:08 +0800 Subject: [PATCH] 小数点 --- src/views/salesManagement/invoiceLedger/index.vue | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue index db08cab..d5f5d76 100644 --- a/src/views/salesManagement/invoiceLedger/index.vue +++ b/src/views/salesManagement/invoiceLedger/index.vue @@ -52,9 +52,10 @@ <el-button v-else link type="primary" @click="handleDownload(scope.row)">涓婁紶</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="delInvoiceLedger(scope.row);">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -90,7 +91,7 @@ <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"> @@ -103,6 +104,7 @@ type="date" placeholder="璇烽�夋嫨" clearable + disabled /> </el-form-item> </el-col> @@ -143,7 +145,7 @@ </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"> @@ -156,6 +158,7 @@ :headers="upload.headers" accept=".pdf" :limit="1" + style="width: 100%" :on-exceed="handleExceed" :before-upload="handleBeforeUpload" :on-error="handleUploadError" @@ -192,8 +195,9 @@ invoiceLedgerSaveOrUpdate, invoiceLedgerProductInfo, commitFile, - registrationProductPage + registrationProductPage, delInvoiceLedgerByRegProductId } from "../../../api/salesManagement/invoiceLedger.js"; +import useUserStore from "@/store/modules/user.js"; const { proxy } = getCurrentInstance() const tableData = ref([]) const productData = ref([]) @@ -201,7 +205,7 @@ const tableLoading = ref(false) const page = reactive({ current: 1, - size: 10, + size: 100, }) const total = ref(0) const fileList = ref([]) @@ -235,6 +239,7 @@ }) const { searchForm, form, rules } = toRefs(data) const currentId = ref('') +const userStore = useUserStore() const upload = reactive({ // 涓婁紶鐨勫湴鍧� url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile", @@ -252,9 +257,9 @@ page.current = 1 getList() } -const paginationChange = ({ current, limit }) => { - page.current = current; - page.size = limit; +const paginationChange = (obj) => { + page.current = obj.page; + page.size = obj.limit; getList() } const getList = () => { @@ -282,9 +287,17 @@ productData.value = [] fileList.value = [] currentId.value = row.id; + invoiceLedgerProductInfo({id: row.id}).then(res => { form.value = {...res.data} fileList.value = res.data.fileList; + if(!form.value.invoicePerson){ + form.value.invoicePerson = userStore.nickName + form.value.entryDate = getCurrentDate(); + } + if(!form.value.invoiceDate){ + form.value.invoiceDate = getCurrentDate(); + } }) dialogFormVisible.value = true } @@ -392,7 +405,31 @@ currentId.value = '' fileList.value = [] }) +} +// 鍒犻櫎寮�绁ㄥ彴璐� +const delInvoiceLedger = (row) => { + ElMessageBox.confirm( + '璇ュ彂绁ㄥ彴璐﹀皢琚垹闄�,鏄惁纭鍒犻櫎', { + confirmButtonText: '纭', + cancelButtonText: '鍙栨秷', + type: 'warning', + } + ).then(() => { + delInvoiceLedgerByRegProductId(row.id).then(res => { + 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}`; } getList() -- Gitblit v1.9.3