| | |
| | | <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"> |
| | | <!-- <el-table-column label="发票" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.invoiceFileName" text bg type="primary" |
| | | @click="handleFile(scope.row.commonFiles)"> |
| | |
| | | 上传 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | <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="downLoadFile(scope.row)">附件</el-button> |
| | | <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <FileList ref="fileListRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | registrationProductPage, |
| | | delInvoiceLedgerByRegProductId, |
| | | } from "../../../api/salesManagement/invoiceLedger.js"; |
| | | import { getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import dayjs from "dayjs"; |
| | | import FileList from "./fileList.vue"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableData = ref([]); |
| | |
| | | }; |
| | | // 上传前校检 |
| | | function handleBeforeUpload(file) { |
| | | console.log("file", file); |
| | | // 校检文件大小 |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | proxy.$modal.msgError("上传文件大小不能超过10MB!"); |
| | |
| | | proxy.$modal.msgError("文件格式不匹配"); |
| | | return false; |
| | | } |
| | | console.log('handleBeforeUpload'); |
| | | proxy.$modal.loading("正在上传文件,请稍候..."); |
| | | return true; |
| | | } |
| | |
| | | // 上传成功回调 |
| | | function handleUploadSuccess(res, file, uploadFiles) { |
| | | proxy.$modal.closeLoading(); |
| | | console.log('handleUploadSuccess'); |
| | | if (res.code === 200) { |
| | | proxy.$refs["fileUpload"].handleRemove(file); |
| | | fileList.value.push(res.data); |
| | | // proxy.$refs["fileUpload"].handleRemove(file); |
| | | // fileList.value.push(res.data); |
| | | proxy.$modal.msgSuccess("上传成功"); |
| | | } else { |
| | | proxy.$modal.msgError(res.msg); |
| | |
| | | } |
| | | // 移除文件 |
| | | function handleRemove(file) { |
| | | let index = fileList.value.findIndex((item) => item.url === file.url); |
| | | if (index > -1) { |
| | | fileList.value.splice(index, 1); |
| | | } |
| | | // let index = fileList.value.findIndex((item) => item.url === file.url); |
| | | // if (index > -1) { |
| | | // fileList.value.splice(index, 1); |
| | | // } |
| | | } |
| | | // 提交表单 |
| | | const submitForm = () => { |
| | |
| | | getList(); |
| | | }; |
| | | |
| | | //附件相关 |
| | | const fileListRef = ref(null) |
| | | //查看附件 |
| | | const downLoadFile = (row) => { |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => { |
| | | fileListRef.value.open(res.salesLedgerFiles) |
| | | }); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // 设置开票日期范围默认值为当天 |
| | | const today = dayjs().format('YYYY-MM-DD'); |