| | |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :handleSelectionChange="handleSelectionChange" |
| | | <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-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-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-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> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | |
| | | 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: '采购合同号', |
| | |
| | | { |
| | | label: '发票金额(元)', |
| | | prop: 'invoiceAmount' |
| | | }, |
| | | { |
| | | label: '税率(%)', |
| | | prop: 'taxRate' |
| | | }, |
| | | { |
| | | 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) |
| | |
| | | tableLoading.value = true |
| | | 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(); |
| | | if (type === 'edit') { |
| | | registrationInfo(row.id).then(res => { |
| | |
| | | } |
| | | 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().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 = '' |
| | | } |