| | |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">供应商名称/合同号:</span> |
| | | <el-input |
| | | v-model="searchForm.supplierNameOrContractNo" |
| | | style="width: 240px" |
| | | placeholder="输入供应商名称/合同号搜索" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | <el-input v-model="searchForm.supplierNameOrContractNo" style="width: 240px" placeholder="输入供应商名称/合同号搜索" |
| | | @change="handleQuery" clearable :prefix-icon="Search" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :handleSelectionChange="handleSelectionChange" |
| | | :tableLoading="tableLoading" @pagination="pagination" :total="total"></PIMTable> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true" |
| | | :handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination" |
| | | :total="total"></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增供应商信息' : '编辑供应商信息'" width="60%" @close="closeDia"> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增付款登记' : '编辑付款登记'" width="60%" |
| | | @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="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 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> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售合同号:" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="自动填充" clearable disabled/> |
| | | <el-input v-model="form.salesContractNo" placeholder="自动填充" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供应商名称:" prop="supplierName"> |
| | | <el-input v-model="form.supplierName" placeholder="自动填充" clearable disabled/> |
| | | <el-input v-model="form.supplierName" placeholder="自动填充" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票号:" prop="invoiceNumber"> |
| | | <el-input v-model="form.invoiceNumber" placeholder="自动填充" clearable disabled/> |
| | | <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-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票金额(元):" prop="invoiceAmount"> |
| | | <el-input type="number" :step="0.01" v-model="form.invoiceAmount" placeholder="自动填充" clearable disabled/> |
| | | <el-input type="number" :step="0.01" v-model="form.invoiceAmount" placeholder="自动填充" clearable disabled /> |
| | | </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 disabled/> |
| | | <!-- <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-input type="number" :step="0.01" v-model="form.currentPaymentAmount" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="付款形式:" prop="paymentMethod"> |
| | | <el-select v-model="form.paymentMethod" placeholder="请选择" clearable> |
| | | <el-option label="电汇" value="电汇"/> |
| | | <el-option label="承兑" value="承兑"/> |
| | | <el-option label="电汇" value="电汇" /> |
| | | <el-option label="承兑" value="承兑" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="登记人:" prop="registrant"> |
| | | <el-input v-model="form.registrant" placeholder="请输入" clearable disabled/> |
| | | <el-input v-model="form.registrant" placeholder="请输入" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <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-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 /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | |
| | | <script setup> |
| | | import { ref } from 'vue' |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {ElMessageBox } from "element-plus"; |
| | | import {getInfo} from "@/api/login.js"; |
| | | 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, |
| | |
| | | paymentRegistrationAdd, paymentRegistrationDel, |
| | | paymentRegistrationEdit, |
| | | registrationInfo, |
| | | registrationList |
| | | registrationList, |
| | | getTicketNo |
| | | } from "@/api/procurementManagement/paymentEntry.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: '采购合同号', |
| | |
| | | prop: 'invoiceAmount' |
| | | }, |
| | | { |
| | | label: '税率(%)', |
| | | prop: 'taxRate' |
| | | label: '本次付款金额(元)', |
| | | prop: 'currentPaymentAmount' |
| | | }, |
| | | { |
| | | label: '待付款金额(元)', |
| | |
| | | const selectedRows = ref([]) |
| | | const tableLoading = ref(false) |
| | | const purchaseLedgerList = ref([]) |
| | | const invoiceNumberList = ref([]) |
| | | const userStore = useUserStore() |
| | | const page = reactive({ |
| | | current: 1, |
| | |
| | | registrant: '', |
| | | registrantId: '', |
| | | paymentDate: '', |
| | | registrationtDate: "", |
| | | }, |
| | | rules: { |
| | | purchaseLedgerId: [{ required: true, message: "请选择", trigger: "change" }], |
| | | currentPaymentAmount: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | paymentMethod: [{ required: true, message: "请选择", trigger: "change" }], |
| | | invoiceNumber: [{ required: true, message: "请选择采购合同号", trigger: "change" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | registrationList({...searchForm.value, ...page}).then(res => { |
| | | registrationList({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.data.records |
| | | tableData.value = res.rows |
| | | total.value = res.total |
| | | }) |
| | | } |
| | |
| | | const openForm = (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | invoiceNumberList.value = [] |
| | | // 查询采购合同号 |
| | | getPurchaseNo().then(res => { |
| | | purchaseLedgerList.value = res |
| | | }) |
| | | form.value.registrantId = userStore.id |
| | | form.value.registrant = userStore.name |
| | | 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} |
| | | form.value = { ...res.data } |
| | | if (form.value.registrantId == userStore.id) { |
| | | form.value.registrant = userStore.name |
| | | } |
| | | }) |
| | | } |
| | | dialogFormVisible.value = true |
| | | } |
| | | // 选择发票号以后给发票金额赋值 |
| | | const setInvoiceAmount = (value) => { |
| | | if (value) { |
| | | invoiceNumberList.value.forEach(item => { |
| | | if (item.invoiceNumber === value) { |
| | | form.value.invoiceAmount = item.invoiceAmount |
| | | form.value.ticketRegistrationId = item.id |
| | | } |
| | | }) |
| | | } else { |
| | | form.value.invoiceAmount = '' |
| | | } |
| | | } |
| | | // 选择采购合同号赋值 |
| | | const setInfo = (value) => { |
| | | getTicketNo({ id: value }).then((res) => { |
| | | invoiceNumberList.value = res.data |
| | | }) |
| | | if (value) { |
| | | byPurchaseId(value).then(res => { |
| | | form.value.salesContractNo = res.data.salesContractNo |
| | | form.value.supplierName = res.data.supplierName |
| | | form.value.invoiceNumber = res.data.invoiceNumber |
| | | form.value.invoiceAmount = res.data.invoiceAmount |
| | | form.value.taxRate = res.data.taxRate |
| | | form.value.supplierId = res.data.supplierId |
| | | }) |
| | | } else { |
| | | form.value.salesContractNo = '' |
| | | form.value.supplierName = '' |
| | | form.value.invoiceNumber = '' |
| | | form.value.invoiceAmount = '' |
| | | form.value.taxRate = '' |
| | | form.value.supplierId = '' |
| | | } |
| | |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | '选中的内容将被删除,是否确认删除?', |
| | | '删除提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | '选中的内容将被删除,是否确认删除?', |
| | | '删除提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | tableLoading.value = true |
| | | paymentRegistrationDel(ids).then(res => { |
| | |
| | | getList() |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | | <style scoped lang="scss"></style> |