| | |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">新增台账</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</el-button> |
| | | <el-button @click="handleOut" type="primary" style="width: 100px">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | <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="invoiceAmount" show-overflow-tooltip/> |
| | | <el-table-column label="发票金额(元)" prop="invoiceTotal" show-overflow-tooltip/> |
| | | <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> |
| | | <el-table-column fixed="right" label="操作" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">编辑</el-button> |
| | | <el-button link type="primary" size="small" @click="openForm(scope.row);">编辑</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" /> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增开票台账页面' : '编辑开票台账页面'" width="70%" @close="closeDia"> |
| | | <el-dialog v-model="dialogFormVisible" title="开票台账页面" width="70%" @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售合同号:" prop="salesLedgerId"> |
| | | <el-select v-model="form.salesLedgerId" placeholder="请选择" clearable @change="ledgerChange" :disabled="operationType === 'edit'"> |
| | | <el-option v-for="item in ledgerList" :key="item.id" :label="item.salesContractNo" :value="item.id"/> |
| | | </el-select> |
| | | <el-form-item label="销售合同号:" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称:" prop="customerName"> |
| | | <el-input v-model="form.customerName" placeholder="自动填充" clearable :disabled="operationType === 'edit'"/> |
| | | <el-input v-model="form.customerName" placeholder="自动填充" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票金额(元):" prop="invoiceAmount"> |
| | | <el-input type="number" :step="0.01" v-model="form.invoiceAmount" placeholder="请输入" clearable/> |
| | | <el-form-item label="发票金额(元):" prop="invoiceTotal"> |
| | | <el-input type="number" :step="0.01" v-model="form.invoiceTotal" placeholder="请输入" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="税率:" prop="taxRate"> |
| | | <el-input type="number" :step="0.01" v-model="form.taxRate" placeholder="请输入" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开票人:" prop="invoicePerson"> |
| | | <el-input v-model="form.invoicePerson" placeholder="请输入" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开票日期:" prop="invoiceDate"> |
| | | <el-date-picker |
| | |
| | | import { ref } from 'vue' |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {ElMessageBox } from "element-plus"; |
| | | import { |
| | | getSalesLedgerWithProducts, |
| | | ledgerListNoPage |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { getToken } from "@/utils/auth" |
| | | import { |
| | | invoiceLedgerList, |
| | | invoiceLedgerDel, |
| | | invoiceLedgerSaveOrUpdate, |
| | | invoiceLedgerDetail, |
| | | invoiceLedgerProductInfo, |
| | | commitFile, |
| | | registrationProductPage |
| | | } from "../../../api/salesManagement/invoiceLedger.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | |
| | | }) |
| | | const total = ref(0) |
| | | const fileList = ref([]) |
| | | const ledgerList = ref([]) |
| | | // 用户信息表单弹框数据 |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | |
| | | salesLedgerId: '', |
| | | customerId: '', |
| | | invoiceNo: '', |
| | | invoiceAmount: '', |
| | | invoiceTotal: '', |
| | | taxRate: '', |
| | | invoicePerson: '', |
| | | invoiceDate: '', |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | invoiceLedgerList({...searchForm.value, ...page}).then(res => { |
| | | registrationProductPage({...searchForm.value, ...page}).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.data.records; |
| | | total.value = res.data.total; |
| | |
| | | return sums; |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | operationType.value = type |
| | | const openForm = (row) => { |
| | | form.value = {} |
| | | productData.value = [] |
| | | fileList.value = [] |
| | | // 查询销售合同 |
| | | ledgerListNoPage({}).then(res => { |
| | | ledgerList.value = res.data; |
| | | currentId.value = row.id; |
| | | invoiceLedgerProductInfo({id: row.id}).then(res => { |
| | | form.value = {...res.data} |
| | | fileList.value = res.data.fileList; |
| | | }) |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | invoiceLedgerDetail({id: row.id}).then(res => { |
| | | form.value = {...res.data} |
| | | fileList.value = res.data.fileList; |
| | | }) |
| | | } |
| | | dialogFormVisible.value = true |
| | | } |
| | | // 上传多个文件就覆盖原来的 |
| | |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |
| | | } |
| | | // 删除 |
| | | const handleDelete = () => { |
| | | let ids = [] |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning('请选择数据') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | '选中的内容将被删除,是否确认删除?', |
| | | '导出', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | invoiceLedgerDel(ids).then(res => { |
| | | proxy.$modal.msgSuccess("删除成功") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |
| | | } |
| | | |
| | | // 销售台账筛选 |
| | | const ledgerChange = (val) => { |
| | | if(val){ |
| | | getSalesLedgerWithProducts({id: val}).then(res => { |
| | | form.value = { |
| | | salesLedgerId: res.id, |
| | | customerName: res.customerName, |
| | | customerId: res.customerId, |
| | | salesContractNo: res.salesContractNo |
| | | } |
| | | }) |
| | | }else { |
| | | form.value.salesLedgerId = '' |
| | | form.value.customerName = '' |
| | | form.value.customerId = '' |
| | | } |
| | | } |
| | | |
| | | // 打开附件上传弹窗 |