| | |
| | | <div class="search_form"> |
| | | <el-form :inline="true" :model="searchForm"> |
| | | <el-form-item label="客户名称/合同号"> |
| | | <el-input v-model="searchForm.searchText" style="width: 240px" placeholder="输入客户名称/合同号搜索" |
| | | <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: 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-input v-model="searchForm.invoiceAmountStart" style="width: 110px" placeholder="最小" clearable @change="handleQuery" /> |
| | | <span style="margin: 0 6px">-</span> |
| | | <el-input v-model="searchForm.invoiceAmountEnd" style="width: 110px" 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)"> |
| | | :row-key="(row) => row.id" show-summary :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)" stripe> |
| | | <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 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="200" /> |
| | | <el-table-column label="项目" prop="projectName" width="320" /> |
| | | <el-table-column label="产品大类" prop="productCategory" width="200" /> |
| | | <el-table-column label="规格型号" prop="specificationModel" width="300" show-overflow-tooltip /> |
| | | <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="120" /> |
| | | 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> |
| | | <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> |
| | | <el-button v-else link type="primary" @click="handleDownload(scope.row)"> |
| | | <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="操作" 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> |
| | | <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> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票金额(元):" prop="invoiceTotal"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" 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> |
| | |
| | | invoiceDateStart: dayjs().startOf("month").format("YYYY-MM-DD"), |
| | | invoiceDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"), |
| | | createTimeStart: "", // 录入日期 |
| | | invoiceAmountStart: undefined, |
| | | invoiceAmountEnd: undefined, |
| | | }, |
| | | form: { |
| | | salesLedgerId: "", |
| | |
| | | function handleBeforeUpload(file) { |
| | | console.log("file", file); |
| | | // 校检文件大小 |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | proxy.$modal.msgError("上传文件大小不能超过10MB!"); |
| | | if (file.size > 1024 * 1024 * 50) { |
| | | proxy.$modal.msgError("上传文件大小不能超过50MB!"); |
| | | return 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("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 打开附件上传弹窗 |
| | | const handleDownload = (val) => { |
| | | fileList.value = []; |
| | |
| | | }) |
| | | .then(() => { |
| | | delInvoiceLedgerByRegProductId(row.id).then((res) => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }); |
| | | }) |