| | |
| | | show-summary |
| | | :summary-method="summarizeChildrenTable"> |
| | | <el-table-column align="center" label="序号" type="index" width="60" /> |
| | | <el-table-column label="产品大类" prop="productCategory" /> |
| | | <el-table-column label="规格型号" prop="specificationModel" /> |
| | | <el-table-column label="单位" prop="unit" width="70"/> |
| | | <el-table-column label="数量" prop="quantity" width="70"/> |
| | | <el-table-column label="税率" prop="taxRate" width="70" /> |
| | | <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="开票数" prop="invoiceNum" /> |
| | | <el-table-column label="开票金额(元)" prop="invoiceAmount" :formatter="formattedNumber" /> |
| | | <el-table-column label="未开票数" prop="noInvoiceNum" /> |
| | | <el-table-column label="未开票金额(元)" prop="noInvoiceAmount" :formatter="formattedNumber"/> |
| | | <el-table-column label="回款日期" prop="receiptPaymentDate" /> |
| | | <el-table-column label="回款金额" prop="receiptPaymentAmount"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.receiptPaymentAmount" :disabled="!scope.row.editType"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="回款方式" prop="receiptPaymentType" > |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.receiptPaymentType" placeholder="请选择" clearable :disabled="!scope.row.editType"> |
| | | <el-option v-for="item in receipt_payment_type" :key="item.value" :label="item.label" :value="item.value"/> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="登记人" prop="registrant" /> |
| | | <el-table-column label="登记日期" prop="createTime" /> |
| | | <el-table-column label="操作" width="150"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="changeEditType(scope.row)" v-if="!scope.row.editType">编辑</el-button> |
| | | <el-button link type="primary" size="small" @click="saveReceiptPayment(scope.row)" v-if="scope.row.editType">保存</el-button> |
| | | <el-button link type="primary" size="small" @click="delReceiptRecord(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import { |
| | | receiptPaymentSaveOrUpdate, |
| | | bindInvoiceNoRegPage, |
| | | invoiceInfo, receiptPaymentHistoryListNoPage |
| | | invoiceInfo, |
| | | receiptPaymentHistoryListNoPage, |
| | | receiptPaymentDel |
| | | } from "../../../api/salesManagement/receiptPayment.js"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { ElMessage,ElMessageBox } from 'element-plus' |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | expandedRowKeys.value = [] |
| | | tableLoading.value = true |
| | | bindInvoiceNoRegPage({...searchForm.value, ...page}).then(res => { |
| | | tableLoading.value = false |
| | |
| | | type: 1 }).then(res => { |
| | | const index = tableData.value.findIndex(item => item.id === row.id); |
| | | if (index > -1) { |
| | | if(res?.length > 0) { |
| | | res.forEach(item => { |
| | | item.editType = false |
| | | }) |
| | | } |
| | | tableData.value[index].children = res; |
| | | } |
| | | expandedRowKeys.value.push(row.id) |
| | |
| | | } |
| | | // 表格选择数据 |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection |
| | | console.log('selection', selection) |
| | | selectedRows.value = selection.filter(item => item.children !== undefined); |
| | | } |
| | | // 主表合计方法 |
| | | const summarizeMainTable = (param) => { |
| | |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeChildrenTable = (param) => { |
| | | return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice','invoiceNum','invoiceAmount','noInvoiceNum','noInvoiceAmount']); |
| | | return proxy.summarizeTable(param, ['receiptPaymentAmount']); |
| | | } |
| | | // 打开弹框 |
| | | const openForm = () => { |
| | |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | |
| | | // 删除回款记录 |
| | | const delReceiptRecord = (row) => { |
| | | console.log('row',row) |
| | | ElMessageBox.confirm("确认删除该记录吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | try { |
| | | let ids = [] |
| | | ids.push(row.id) |
| | | await receiptPaymentDel(ids); |
| | | ElMessage.success("删除成功"); |
| | | getList(); |
| | | } catch (error) { |
| | | console.error("删除失败:", error); |
| | | ElMessage.error("删除失败"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.info("已取消删除"); |
| | | }); |
| | | |
| | | } |
| | | |
| | | // 编辑修改状态 |
| | | const changeEditType = (row) => { |
| | | row.editType = !row.editType |
| | | } |
| | | |
| | | // 保存回款记录 |
| | | const saveReceiptPayment = (row) => { |
| | | let updateData = { |
| | | id:row.id, |
| | | receiptPaymentType: row.receiptPaymentType, |
| | | receiptPaymentAmount: row.receiptPaymentAmount |
| | | } |
| | | receiptPaymentSaveOrUpdate(updateData).then(res => { |
| | | row.editType = !row.editType |
| | | }) |
| | | } |
| | | |
| | | getList() |
| | | </script> |
| | | |