| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | type="date" |
| | | placeholder="请选择" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </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"> |
| | |
| | | :headers="upload.headers" |
| | | accept=".pdf" |
| | | :limit="1" |
| | | style="width: 100%" |
| | | :on-exceed="handleExceed" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-error="handleUploadError" |
| | |
| | | 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([]) |
| | |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | size: 100, |
| | | }) |
| | | const total = ref(0) |
| | | const fileList = ref([]) |
| | |
| | | }) |
| | | 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", |
| | |
| | | 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 = () => { |
| | |
| | | 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 |
| | | } |
| | |
| | | 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() |