Merge branch 'dev_天津军泰伟业' of http://114.132.189.42:9002/r/product-inventory-management into dev_天津军泰伟业
| | |
| | | }); |
| | | } |
| | | |
| | | export function getProductRecordById(params) { |
| | | export function getProductRecordById(data) { |
| | | return request({ |
| | | url: "/purchase/registration/getProductRecordById", |
| | | method: "get", |
| | | params: params, |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form :model="filters" |
| | | :inline="true"> |
| | | <el-form-item label="供应商名称"> |
| | | <el-input |
| | | v-model="filters.supplierName" |
| | | placeholder="请输入名称搜索" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | <el-input v-model="filters.supplierName" |
| | | placeholder="请输入名称搜索" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="getTableData" /> |
| | | </el-form-item> |
| | | <el-form-item label="采购订单号:"> |
| | | <el-input |
| | | v-model="filters.purchaseContractNumber" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | <el-input v-model="filters.purchaseContractNumber" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="getTableData" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="销售合同号"> |
| | | <el-input |
| | | v-model="filters.salesContractNo" |
| | | placeholder="请输入销售合同号" |
| | | clearable |
| | | /> |
| | | <el-input v-model="filters.salesContractNo" |
| | | placeholder="请输入销售合同号" |
| | | clearable /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData"> 搜索 </el-button> |
| | | <el-button type="primary" |
| | | @click="getTableData"> 搜索 </el-button> |
| | | <el-button @click="resetFilters"> 重置 </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <div class="actions"> |
| | | <div></div> |
| | | <div> |
| | | <el-button @click="handleExport" style="margin-right: 10px">导出</el-button> |
| | | <el-button type="primary" @click="handleAdd('add')"> |
| | | <el-button @click="handleExport" |
| | | style="margin-right: 10px">导出</el-button> |
| | | <el-button type="primary" |
| | | @click="handleAdd('add')"> |
| | | 新增登记 |
| | | </el-button> |
| | | <!-- <el-button type="danger" plain @click="handleDelete">删除</el-button>--> |
| | | <!-- <el-button type="danger" plain @click="handleDelete">删除</el-button>--> |
| | | </div> |
| | | </div> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="filteredDataList" |
| | | :tableLoading="loading" |
| | | :isSelection="true" |
| | | :page="{ |
| | | <PIMTable rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :tableLoading="loading" |
| | | :isSelection="true" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | :expand-row-keys="expandRowKeys" |
| | | :summaryMethod="summarizeMainTable" |
| | | :isShowSummary="true" |
| | | @expand-change="expandChange" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | :expand-row-keys="expandRowKeys" |
| | | :summaryMethod="summarizeMainTable" |
| | | :isShowSummary="true" |
| | | @expand-change="expandChange" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage"> |
| | | <template #expand="{ row }"> |
| | | <ExpandTable ref="expandTableRef" /> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button |
| | | text |
| | | type="primary" |
| | | size="small" |
| | | @click="handleEdit('edit', row.id)" |
| | | > |
| | | <el-button text |
| | | type="primary" |
| | | size="small" |
| | | @click="handleEdit('edit', row.id)"> |
| | | 编辑 |
| | | </el-button> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <Modal ref="modalRef" @refreshList="getTableData"></Modal> |
| | | <Modal ref="modalRef" |
| | | @refreshList="getTableData"></Modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { usePaginationApi } from "@/hooks/usePaginationApi"; |
| | | import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js"; |
| | | import { nextTick, onMounted, getCurrentInstance, ref } from "vue"; |
| | | import ExpandTable from "./components/ExpandTable.vue"; |
| | | import Modal from "./components/Modal.vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import { usePaginationApi } from "@/hooks/usePaginationApi"; |
| | | import { |
| | | delRegistration, |
| | | gePurchaseListPage, |
| | | } from "@/api/procurementManagement/invoiceEntry.js"; |
| | | import { nextTick, onMounted, getCurrentInstance, ref } from "vue"; |
| | | import ExpandTable from "./components/ExpandTable.vue"; |
| | | import Modal from "./components/Modal.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | |
| | | defineOptions({ |
| | | name: "来票登记", |
| | | }); |
| | | defineOptions({ |
| | | name: "来票登记", |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const expandRowKeys = ref([]); |
| | | const expandTableRef = ref(); |
| | | const modalRef = ref(); |
| | | const selectedRows = ref([]); |
| | | const { proxy } = getCurrentInstance(); |
| | | const expandRowKeys = ref([]); |
| | | const expandTableRef = ref(); |
| | | const modalRef = ref(); |
| | | const selectedRows = ref([]); |
| | | |
| | | const { |
| | | loading, |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi( |
| | | gePurchaseListPage, |
| | | { |
| | | purchaseContractNumber: undefined, |
| | | }, |
| | | [ |
| | | const { |
| | | loading, |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi( |
| | | gePurchaseListPage, |
| | | { |
| | | type: "expand", |
| | | dataType: "slot", |
| | | slot: "expand", |
| | | purchaseContractNumber: undefined, |
| | | }, |
| | | { |
| | | label: "采购订单号", |
| | | prop: "purchaseContractNumber", |
| | | width:150 |
| | | }, |
| | | { |
| | | label: "销售合同号", |
| | | prop: "salesContractNo", |
| | | width:150 |
| | | }, |
| | | { |
| | | label: "供应商名称", |
| | | prop: "supplierName", |
| | | width:300 |
| | | }, |
| | | { |
| | | label: "录入人", |
| | | prop: "recorderName", |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | prop: "entryDate", |
| | | width:110 |
| | | }, |
| | | { |
| | | label: "合同金额(元)", |
| | | prop: "contractAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | [ |
| | | { |
| | | type: "expand", |
| | | dataType: "slot", |
| | | slot: "expand", |
| | | }, |
| | | }, |
| | | { |
| | | label: "已来票金额(元)", |
| | | prop: "receiptPaymentAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | { |
| | | label: "采购订单号", |
| | | prop: "purchaseContractNumber", |
| | | width: 150, |
| | | }, |
| | | }, |
| | | { |
| | | label: "待来票金额(元)", |
| | | prop: "unReceiptPaymentAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | { |
| | | label: "销售合同号", |
| | | prop: "salesContractNo", |
| | | width: 150, |
| | | }, |
| | | }, |
| | | // { |
| | | // fixed: "right", |
| | | // label: "操作", |
| | | // dataType: "slot", |
| | | // slot: "operation", |
| | | // align: "center", |
| | | // width: "200px", |
| | | // }, |
| | | ] |
| | | ); |
| | | // 计算属性过滤 审批通过approvalStatus=1 的数据 |
| | | const filteredDataList = computed(() => { |
| | | return dataList.value.filter(item => item.approvalStatus == 1); |
| | | }); |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection.filter( |
| | | (item) => item.purchaseContractNumber !== undefined |
| | | { |
| | | label: "供应商名称", |
| | | prop: "supplierName", |
| | | width: 300, |
| | | }, |
| | | { |
| | | label: "录入人", |
| | | prop: "recorderName", |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | prop: "entryDate", |
| | | width: 110, |
| | | }, |
| | | { |
| | | label: "合同金额(元)", |
| | | prop: "contractAmount", |
| | | width: 200, |
| | | formatData: val => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "已来票金额(元)", |
| | | prop: "receiptPaymentAmount", |
| | | width: 200, |
| | | formatData: val => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "待来票金额(元)", |
| | | prop: "unReceiptPaymentAmount", |
| | | width: 200, |
| | | formatData: val => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | // { |
| | | // fixed: "right", |
| | | // label: "操作", |
| | | // dataType: "slot", |
| | | // slot: "operation", |
| | | // align: "center", |
| | | // width: "200px", |
| | | // }, |
| | | ] |
| | | ); |
| | | }; |
| | | // 计算属性过滤 审批通过approvalStatus=1 的数据 |
| | | // const filteredDataList = computed(() => { |
| | | // // return dataList.value.filter(item => item.approvalStatus == 1); |
| | | // return dataList; |
| | | // }); |
| | | const handleSelectionChange = selection => { |
| | | selectedRows.value = selection.filter( |
| | | item => item.purchaseContractNumber !== undefined |
| | | ); |
| | | }; |
| | | |
| | | const handleAdd = (type) => { |
| | | if (selectedRows.value.length < 1) { |
| | | proxy.$modal.msgWarning("请至少选中一条数据"); |
| | | return; |
| | | } |
| | | modalRef.value.open(type, selectedRows.value); |
| | | }; |
| | | |
| | | const handleEdit = (type, id) => { |
| | | modalRef.value.open(type, id); |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/purchase/registration/export", {}, "来票登记.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 导出采购台账 |
| | | const handleExport = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/purchase/ledger/exportOne", {}, "来票登记.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 删除 |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // 新增判断:如果有选中的数据没有ticketRegistrationId,提示并终止 |
| | | const noTicket = selectedRows.value.some(item => !item.ticketRegistrationId); |
| | | if (noTicket) { |
| | | proxy.$modal.msgWarning("采购台账还未进行来票登记,无法进行删除操作"); |
| | | const handleAdd = type => { |
| | | if (selectedRows.value.length < 1) { |
| | | proxy.$modal.msgWarning("请至少选中一条数据"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map((item) => item.ticketRegistrationId); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delRegistration(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | modalRef.value.open(type, selectedRows.value); |
| | | }; |
| | | |
| | | const expandChange = async (row, expandedRows) => { |
| | | if (expandedRows.length > 0) { |
| | | await nextTick(); |
| | | expandTableRef.value.getList(row.id); |
| | | } |
| | | }; |
| | | const handleEdit = (type, id) => { |
| | | modalRef.value.open(type, id); |
| | | }; |
| | | |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | onCurrentChange(page); |
| | | }; |
| | | // 主表合计方法 |
| | | const summarizeMainTable = (param) => { |
| | | return proxy.summarizeTable( |
| | | param, |
| | | ["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | | } |
| | | ); |
| | | }; |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/purchase/registration/export", {}, "来票登记.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 导出采购台账 |
| | | const handleExport = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/purchase/ledger/exportOne", {}, "来票登记.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 删除 |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // 新增判断:如果有选中的数据没有ticketRegistrationId,提示并终止 |
| | | const noTicket = selectedRows.value.some( |
| | | item => !item.ticketRegistrationId |
| | | ); |
| | | if (noTicket) { |
| | | proxy.$modal.msgWarning("采购台账还未进行来票登记,无法进行删除操作"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map(item => item.ticketRegistrationId); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delRegistration(ids).then(res => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | const expandChange = async (row, expandedRows) => { |
| | | if (expandedRows.length > 0) { |
| | | await nextTick(); |
| | | expandTableRef.value.getList(row.id); |
| | | } |
| | | }; |
| | | |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | onCurrentChange(page); |
| | | }; |
| | | // 主表合计方法 |
| | | const summarizeMainTable = param => { |
| | | return proxy.summarizeTable( |
| | | param, |
| | | ["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"], |
| | | { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | | } |
| | | ); |
| | | }; |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
| | |
| | | v-model="scope.row.currentPaymentAmount" |
| | | :disabled="!scope.row.editType" |
| | | :precision="2" |
| | | :max="scope.row.maxAmountTTotal + maxAmount" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </template> |
| | |
| | | } |
| | | }); |
| | | }; |
| | | const maxAmount = ref(0); |
| | | const maxAmountTTotal = ref(0); |
| | | // 展开行 |
| | | const expandChange = (row, expandedRows) => { |
| | | if (expandedRows.length > 0) { |
| | |
| | | expandedRowKeys.value = []; |
| | | try { |
| | | childrenLoading.value = true; |
| | | maxAmount.value = row.unPaymentAmountTotal; |
| | | registrationListPageGetById({ id: row.id }).then(res => { |
| | | childrenLoading.value = false; |
| | | const index = tableData.value.findIndex(item => item.id === row.id); |
| | | if (index > -1) { |
| | | expandData.value = res; |
| | | } |
| | | expandData.value = res.map(item => ({ |
| | | ...item, |
| | | maxAmountTTotal: item.currentPaymentAmount, |
| | | })); |
| | | expandedRowKeys.value.push(row.id); |
| | | }); |
| | | } catch (error) { |
| | |
| | | taxInclusiveUnitPrice: undefined, // 含税单价 |
| | | ticketRegistrationId: undefined, // 含税单价 |
| | | }); |
| | | |
| | | const load = async id => { |
| | | const { code, data } = await getProductRecordById({ id }); |
| | | const cuticketsAmount = ref(0); |
| | | const cufutureTickets = ref(0); |
| | | const load = async (id, purchaseLedgerId, productModelId) => { |
| | | const { code, data } = await getProductRecordById({ |
| | | id: id, |
| | | purchaseLedgerId: purchaseLedgerId, |
| | | productModelId: productModelId, |
| | | }); |
| | | if (code === 200) { |
| | | console.log(data, "来票台账详情"); |
| | | form.id = data.id; |
| | | form.purchaseContractNumber = data.purchaseContractNumber; |
| | | form.salesContractNo = data.salesContractNo; |
| | |
| | | form.ticketsAmount = data.ticketsAmount.toFixed(2); |
| | | form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice; |
| | | form.futureTickets = data.futureTickets; |
| | | form.futureTicketsAmount = data.futureTicketsAmount.toFixed(2); |
| | | // temFutureTickets.value = data.futureTickets; |
| | | temFutureTickets.value = data.quantity; |
| | | cuticketsAmount.value = data.futureTicketsAmount + data.ticketsAmount; |
| | | cufutureTickets.value = data.futureTickets + data.ticketsNum; |
| | | |
| | | form.ticketRegistrationId = data.ticketRegistrationId; |
| | | } |
| | |
| | | proxy.$modal.msgWarning("含税单价不能为零或未定义"); |
| | | return; |
| | | } |
| | | if (Number(form.ticketsNum) > Number(temFutureTickets.value)) { |
| | | if (Number(form.ticketsNum) > Number(cufutureTickets.value)) { |
| | | proxy.$modal.msgWarning("开票数不得大于未开票数"); |
| | | form.ticketsNum = temFutureTickets.value; |
| | | form.ticketsNum = cufutureTickets.value; |
| | | } |
| | | |
| | | // 确保所有数值都转换为数字类型进行计算 |
| | | const ticketsAmount = |
| | | Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice); |
| | | const futureTickets = |
| | | Number(temFutureTickets.value) - Number(form.ticketsNum); |
| | | const futureTickets = Number(cufutureTickets.value) - Number(form.ticketsNum); |
| | | form.futureTickets = Number(futureTickets.toFixed(2)); |
| | | form.ticketsAmount = Number(ticketsAmount.toFixed(2)); |
| | | }; |
| | |
| | | return; |
| | | } |
| | | |
| | | if (Number(val) > Number(form.futureTickets * form.taxInclusiveUnitPrice)) { |
| | | if ( |
| | | Number(val) > |
| | | Number((form.futureTickets + form.ticketsNum) * form.taxInclusiveUnitPrice) |
| | | ) { |
| | | proxy.$modal.msgWarning("本次来票金额不得大于总金额"); |
| | | form.ticketsAmount = ( |
| | | form.futureTickets * form.taxInclusiveUnitPrice |
| | | ).toFixed(2); |
| | | form.ticketsAmount = cuticketsAmount.value.toFixed(2); |
| | | const ticketsNum = |
| | | Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice); |
| | | form.ticketsNum = Number(ticketsNum.toFixed(2)); |
| | | form.futureTickets = Number( |
| | | (cufutureTickets.value - form.ticketsNum).toFixed(2) |
| | | ); |
| | | return; |
| | | } |
| | | |
| | |
| | | <template> |
| | | <el-dialog :title="modalOptions.title" v-model="visible" @close="close"> |
| | | <el-dialog :title="modalOptions.title" |
| | | v-model="visible" |
| | | @close="close"> |
| | | <EditForm ref="editFormRef" /> |
| | | <template #footer> |
| | | <el-button type="primary" :loading="loading" @click="sendForm"> |
| | | {{ modalOptions.confirmText }} |
| | | </el-button> |
| | | <el-button type="primary" |
| | | :loading="loading" |
| | | @click="sendForm"> |
| | | {{ modalOptions.confirmText }} |
| | | </el-button> |
| | | <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { useModal } from "@/hooks/useModal"; |
| | | import EditForm from "../Form/EditForm.vue"; |
| | | import { updateRegistration } from "@/api/procurementManagement/procurementInvoiceLedger"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { useModal } from "@/hooks/useModal"; |
| | | import EditForm from "../Form/EditForm.vue"; |
| | | import { updateRegistration } from "@/api/procurementManagement/procurementInvoiceLedger"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | defineOptions({ |
| | | name: "来票台账编辑", |
| | | }); |
| | | const emits = defineEmits(["success"]); |
| | | defineOptions({ |
| | | name: "来票台账编辑", |
| | | }); |
| | | const emits = defineEmits(["success"]); |
| | | |
| | | const saleLedgerProjectId = ref('') |
| | | const editFormRef = ref(); |
| | | const { |
| | | id, |
| | | visible, |
| | | loading, |
| | | openModal, |
| | | modalOptions, |
| | | handleConfirm, |
| | | closeModal, |
| | | } = useModal({ title: "来票台账" }); |
| | | const saleLedgerProjectId = ref(""); |
| | | const editFormRef = ref(); |
| | | const { |
| | | id, |
| | | visible, |
| | | loading, |
| | | openModal, |
| | | modalOptions, |
| | | handleConfirm, |
| | | closeModal, |
| | | } = useModal({ title: "来票台账" }); |
| | | |
| | | const open = async (row) => { |
| | | openModal(row.id); |
| | | saleLedgerProjectId.value = row.saleLedgerProjectId; |
| | | await nextTick(); |
| | | editFormRef.value.load(row.id); |
| | | }; |
| | | const open = async row => { |
| | | openModal(row.id); |
| | | saleLedgerProjectId.value = row.saleLedgerProjectId; |
| | | await nextTick(); |
| | | editFormRef.value.load(row.id, row.purchaseLedgerId, row.productModelId); |
| | | }; |
| | | |
| | | const close = () => { |
| | | editFormRef.value.resetForm(); |
| | | closeModal(); |
| | | }; |
| | | const close = () => { |
| | | editFormRef.value.resetForm(); |
| | | closeModal(); |
| | | }; |
| | | |
| | | const sendForm = async () => { |
| | | const form = editFormRef.value.form; |
| | | form.saleLedgerProjectId = saleLedgerProjectId.value; |
| | | const { code } = await updateRegistration(form); |
| | | if (code === 200) { |
| | | emits("success"); |
| | | ElMessage({ message: "操作成功", type: "success" }); |
| | | close(); |
| | | } |
| | | }; |
| | | const sendForm = async () => { |
| | | const form = editFormRef.value.form; |
| | | form.saleLedgerProjectId = saleLedgerProjectId.value; |
| | | const { code } = await updateRegistration(form); |
| | | if (code === 200) { |
| | | emits("success"); |
| | | ElMessage({ message: "操作成功", type: "success" }); |
| | | close(); |
| | | } |
| | | }; |
| | | |
| | | defineExpose({ |
| | | open, |
| | | }); |
| | | defineExpose({ |
| | | open, |
| | | }); |
| | | </script> |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: "开票日期", |
| | | label: "来票日期", |
| | | prop: "createdAt", |
| | | width: 110, |
| | | }, |
| | |
| | | prop="invoiceTotal"> |
| | | <el-input-number :step="0.01" |
| | | :min="0" |
| | | :max="form.noInvoiceAmount" |
| | | :max="form.noInvoiceAmount + form.invoiceAmount" |
| | | style="width: 100%" |
| | | v-model="form.invoiceTotal" |
| | | placeholder="请输入" |