| | |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true" |
| | | :isShowSummary="isShowSummarySon" |
| | | :summaryMethod="summarizeMainTable1" |
| | | :handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination" |
| | | :total="total"></PIMTable> |
| | | </div> |
| | |
| | | <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="purchaseLedgerId"> |
| | | <el-select v-model="form.purchaseLedgerId" placeholder="请选择" clearable @change="setInfo" |
| | | :disabled="operationType === 'edit'"> |
| | | <el-option v-for="item in purchaseLedgerList" :key="item.id" :label="item.purchaseContractNumber" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | <el-form-item label="采购合同号:" prop="purchaseContractNumber"> |
| | | <el-input v-model="form.purchaseContractNumber" placeholder="自动填充" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票号:" prop="invoiceNumber"> |
| | | <el-select v-model="form.invoiceNumber" placeholder="请选择" clearable :disabled="operationType === 'edit'" |
| | | @change="setInvoiceAmount"> |
| | | <el-option v-for="item in invoiceNumberList" :key="item.id" :label="item.invoiceNumber" |
| | | :value="item.invoiceNumber" /> |
| | | </el-select> |
| | | <el-input v-model="form.invoiceNumber" placeholder="自动填充" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="税率(%):" prop="taxRate"> |
| | | <!-- <el-input type="number" :step="0.01" v-model="form.taxRate" placeholder="自动填充" clearable/> --> |
| | | <el-select v-model="form.taxRate" placeholder="请选择" clearable :disabled="operationType === 'edit'"> |
| | | <el-option v-for="item in taxRateSelection" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="本次付款金额:" prop="currentPaymentAmount"> |
| | | <el-input type="number" :step="0.01" v-model="form.currentPaymentAmount" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="付款方式:" prop="paymentMethod"> |
| | | <el-select v-model="form.paymentMethod" placeholder="请选择" clearable> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="登记人:" prop="registrant"> |
| | | <el-input v-model="form.registrant" placeholder="请输入" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="付款日期:" prop="paymentDate"> |
| | | <el-date-picker disabled style="width: 100%" v-model="form.paymentDate" value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" type="date" placeholder="请选择" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="登记日期:" prop="registrationtDate"> |
| | | <el-input v-model="form.registrationtDate" placeholder="请输入" clearable disabled /> |
| | |
| | | import { ref } from 'vue' |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { getInfo } from "@/api/login.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { |
| | | byPurchaseId, |
| | | getPurchaseNo, |
| | | paymentRegistrationAdd, paymentRegistrationDel, |
| | | paymentRegistrationEdit, |
| | | registrationInfo, |
| | | registrationList, |
| | | getTicketNo |
| | | } from "@/api/procurementManagement/paymentEntry.js"; |
| | | import {invoiceListPage} from "@/api/procurementManagement/procurementInvoiceLedger.js" |
| | | const { proxy } = getCurrentInstance() |
| | | const taxRateSelection = [ |
| | | { value: '0', label: '0%' }, |
| | | { value: '3', label: '3%' }, |
| | | { value: '6', label: '6%' }, |
| | | { value: '9', label: '9%' }, |
| | | { value: '13', label: '13%' }, |
| | | { value: '17', label: '17%' }, |
| | | ] |
| | | const tableColumn = ref([ |
| | | { |
| | | label: '采购合同号', |
| | |
| | | }, |
| | | { |
| | | label: '发票金额(元)', |
| | | prop: 'invoiceAmount' |
| | | prop: 'invoiceAmount', |
| | | formatData: (params) => { |
| | | return parseFloat(params).toFixed(2); |
| | | } |
| | | }, |
| | | { |
| | | label: '本次付款金额(元)', |
| | | prop: 'currentPaymentAmount' |
| | | label: '已付款金额(元)', |
| | | prop: 'paymentAmountTotal', |
| | | formatData: (params) => { |
| | | return parseFloat(params).toFixed(2); |
| | | } |
| | | }, |
| | | { |
| | | label: '待付款金额(元)', |
| | | prop: 'unPaymentAmount' |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | align: 'center', |
| | | operation: [ |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm('edit', row); |
| | | }, |
| | | }, |
| | | ], |
| | | prop: 'unPaymentAmountTotal', |
| | | formatData: (params) => { |
| | | return parseFloat(params).toFixed(2); |
| | | } |
| | | }, |
| | | ]) |
| | | const tableData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const tableLoading = ref(false) |
| | | const purchaseLedgerList = ref([]) |
| | | const invoiceNumberList = ref([]) |
| | | const userStore = useUserStore() |
| | | const page = reactive({ |
| | |
| | | supplierNameOrContractNo: '', |
| | | }, |
| | | form: { |
| | | purchaseContractNumber:'', |
| | | purchaseLedgerId: '', |
| | | salesContractNo: '', |
| | | supplierName: '', |
| | |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | const isShowSummarySon = ref(true); |
| | | |
| | | // 子表合计方法 |
| | | const summarizeMainTable1 = (param) => { |
| | | return proxy.summarizeTable(param, ['invoiceAmount', 'paymentAmountTotal', 'unPaymentAmountTotal'], { |
| | | ticketsNum: { noDecimal: true }, // 不保留小数 |
| | | futureTickets: { noDecimal: true }, // 不保留小数 |
| | | }); |
| | | }; |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const pagination = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | const pagination = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | registrationList({ ...searchForm.value, ...page }).then(res => { |
| | | invoiceListPage({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.rows |
| | | tableData.value = res.records |
| | | total.value = res.total |
| | | }) |
| | | } |
| | |
| | | } |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if(selectedRows.value.length !== 1 ) { |
| | | proxy.$message.error("请选择一条发票数据") |
| | | return |
| | | } |
| | | operationType.value = type |
| | | form.value = {} |
| | | invoiceNumberList.value = [] |
| | | form.value = {...selectedRows.value[0]} |
| | | form.value.ticketRegistrationId = selectedRows.value[0].id |
| | | form.value.id = null |
| | | // 查询采购合同号 |
| | | getPurchaseNo().then(res => { |
| | | purchaseLedgerList.value = res |
| | | }) |
| | | form.value.registrationtDate = getCurrentDate(); |
| | | form.value.paymentDate = getCurrentDate(); |
| | | form.value.registrant = userStore.name |
| | | if (type === 'edit') { |
| | | registrationInfo(row.id).then(res => { |
| | | form.value = { ...res.data } |
| | | if (form.value.registrantId == userStore.id) { |
| | | form.value.registrant = userStore.name |
| | | } |
| | | }) |
| | | } |
| | | dialogFormVisible.value = true |
| | | } |
| | | // 选择发票号以后给发票金额赋值 |