| | |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">新增回款</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</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" show-overflow-tooltip/> |
| | | <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="receiptPaymentAmount" show-overflow-tooltip/> |
| | | <el-table-column label="回款形式" prop="receiptPaymentType" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{transferValue(scope.row.receiptPaymentType)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="待回款金额(元)" prop="entryDate" show-overflow-tooltip/> |
| | | <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> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="回款金额(元)" prop="receiptPaymentAmountTotal" show-overflow-tooltip/> |
| | | <el-table-column label="待回款金额(元)" prop="noReceiptAmount" show-overflow-tooltip/> |
| | | </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="invoiceLedgerId"> |
| | | <el-select v-model="form.invoiceLedgerId" placeholder="请选择" clearable @change="ledgerChange"> |
| | | <el-option v-for="item in invoiceLedgerList" :key="item.id" :label="item.salesContractNo + '(' + item.invoiceDate + ')' " :value="item.id"/> |
| | | </el-select> |
| | | <el-form-item label="销售合同号:" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="自动填充" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票金额(元):" prop="invoiceAmount"> |
| | | <el-input type="number" v-model="form.invoiceAmount" placeholder="自动填充" :step="0.01" disabled/> |
| | | <el-form-item label="发票金额(元):" prop="invoiceTotal"> |
| | | <el-input type="number" v-model="form.invoiceTotal" placeholder="自动填充" :step="0.01" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import {ElMessageBox } from "element-plus"; |
| | | import { |
| | | invoiceLedgerListNoPage, |
| | | invoiceLedgerDetail |
| | | } from "../../../api/salesManagement/invoiceLedger.js"; |
| | | import { |
| | | receiptPaymentSaveOrUpdate, |
| | | receiptPaymentListPage, |
| | | receiptPaymentInfo, |
| | | receiptPaymentDel |
| | | bindInvoiceNoRegPage, |
| | | invoiceInfo |
| | | } from "../../../api/salesManagement/receiptPayment.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | |
| | | const total = ref(0) |
| | | |
| | | // 用户信息表单弹框数据 |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | searchText: '', |
| | | }, |
| | | form: { |
| | | invoiceLedgerId: '', |
| | | salesContractNo: '', |
| | | customerName: '', |
| | | invoiceNo: '', |
| | | invoiceAmount: '', |
| | | invoiceTotal: '', |
| | | taxRate: '', |
| | | receiptPaymentAmount: '', |
| | | receiptPaymentType: '', |
| | |
| | | receiptPaymentDate: '' |
| | | }, |
| | | rules: { |
| | | invoiceLedgerId: [{ required: true, message: "请选择", trigger: "change" }], |
| | | salesContractNo: [{ required: true, message: "请选择", trigger: "change" }], |
| | | customerName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | invoiceNo: [{ required: true, message: "请选择", trigger: "change" }], |
| | | invoiceAmount: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | invoiceTotal: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | taxRate: [{ required: true, message: "请选择", trigger: "change" }], |
| | | receiptPaymentAmount: [{ required: true, message: "请选择", trigger: "change" }], |
| | | receiptPaymentType: [{ required: true, message: "请选择", trigger: "change" }], |
| | |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | const currentId = ref('') |
| | | // 开票台账数组 |
| | | const invoiceLedgerList = ref([]) |
| | | const { receipt_payment_type } = proxy.useDict("receipt_payment_type") |
| | | |
| | | // 查询列表 |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | receiptPaymentListPage({...searchForm.value, ...page}).then(res => { |
| | | bindInvoiceNoRegPage({...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 = () => { |
| | | form.value = {} |
| | | productData.value = [] |
| | | invoiceLedgerListNoPage({}).then(res => { |
| | | invoiceLedgerList.value = res.data |
| | | }) |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | receiptPaymentInfo({id: row.id}).then(res => { |
| | | form.value = {...res.data} |
| | | }) |
| | | if(selectedRows.value.length !== 1) { |
| | | proxy.$modal.msgError("请选择一条数据") |
| | | return |
| | | } |
| | | invoiceInfo({id: selectedRows.value[0].id}).then(res => { |
| | | form.value = {...res.data} |
| | | form.value.invoiceLedgerId = form.value.id |
| | | form.value.id = '' |
| | | }) |
| | | dialogFormVisible.value = true |
| | | } |
| | | // 提交表单 |
| | |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | // 删除 |
| | | 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(() => { |
| | | receiptPaymentDel(ids).then(res => { |
| | | proxy.$modal.msgSuccess("删除成功") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |
| | | } |
| | | // 销售台账筛选 |
| | | const ledgerChange = (val) => { |
| | | console.log('val', val) |
| | | if(val){ |
| | | invoiceLedgerDetail({id: val}).then(res => { |
| | | form.value.customerName = res.data.customerName, |
| | | form.value.invoiceNo= res.data.invoiceNo, |
| | | form.value.invoiceAmount= res.data.invoiceAmount, |
| | | form.value.taxRate= res.data.taxRate, |
| | | form.value.salesLedgerId= res.data.salesLedgerId, |
| | | form.value.customerId= res.data.customerId, |
| | | form.value.salesContractNo = res.data.salesContractNo |
| | | }) |
| | | }else { |
| | | form.value.customerName = '', |
| | | form.value.invoiceNo= '', |
| | | form.value.invoiceAmount= '', |
| | | form.value.taxRate= '', |
| | | form.value.salesLedgerId= '', |
| | | form.value.customerId= '', |
| | | form.value.salesContractNo= '' |
| | | } |
| | | } |
| | | // 收款类别转换 |
| | | const transferValue = (val) => { |
| | | const findIndex = receipt_payment_type.value.findIndex(item => item.value === val); |
| | | if (findIndex > -1) { |
| | | return receipt_payment_type.value[findIndex].label |
| | | } |
| | | } |
| | | getList() |
| | | </script> |