| | |
| | | <!-- 表单内容 --> |
| | | <u-form @submit="onSubmit" ref="formRef" label-width="110" input-align="right" error-message-align="right"> |
| | | <!-- 基本信息 --> |
| | | <u-cell-group title="基本信息"> |
| | | <u-form-item label="采购合同号" border-bottom> |
| | | <u-input v-model="form.contractNo" placeholder="自动填充" readonly /> |
| | | <u-cell-group title="基本信息" class="form-section"> |
| | | <u-form-item label="采购合同号" class="form-item"> |
| | | <u-input v-model="form.purchaseContractNumber" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <u-form-item label="供应商名称" border-bottom> |
| | | <u-form-item label="销售合同号" class="form-item"> |
| | | <u-input v-model="form.salesContractNo" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <u-form-item label="供应商名称" class="form-item"> |
| | | <u-input v-model="form.supplierName" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <u-form-item label="发票号" border-bottom> |
| | | <u-input v-model="form.invoiceNo" placeholder="自动填充" readonly /> |
| | | <u-form-item label="发票号" class="form-item"> |
| | | <u-input v-model="form.invoiceNumber" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <u-form-item label="发票金额(元)" class="form-item"> |
| | | <u-input v-model="form.invoiceAmount" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <view class="tip-text">待付款金额:{{ currentNoReceiptAmount }} 元</view> |
| | | <u-form-item label="本次付款金额" prop="currentPaymentAmount" required class="form-item"> |
| | | <u-input v-model="form.currentPaymentAmount" type="number" placeholder="请输入" @blur="changeNum" clearable /> |
| | | </u-form-item> |
| | | <u-form-item label="付款形式" prop="paymentMethod" required class="form-item"> |
| | | <u-input v-model="form.paymentMethod" placeholder="请选择" readonly @click="showPaymentTypePicker" /> |
| | | <template #right> |
| | | <up-icon |
| | | name="arrow-right" |
| | | @click="showPaymentTypePicker" |
| | | ></up-icon> |
| | | </template> |
| | | </u-form-item> |
| | | <u-form-item label="发票金额(元)" border-bottom> |
| | | <u-input v-model="form.invoiceAmount" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <u-form-item label="本次付款金额" prop="paymentAmount" required border-bottom> |
| | | <u-input v-model="form.paymentAmount" type="number" placeholder="请输入" @blur="changeNum" clearable /> |
| | | </u-form-item> |
| | | <u-form-item label="付款形式" prop="paymentType" required border-bottom> |
| | | <u-input v-model="form.paymentType" placeholder="请选择" readonly @click="showPaymentTypePicker" /> |
| | | </u-form-item> |
| | | <u-form-item label="付款日期" prop="paymentDate" required border-bottom> |
| | | <u-form-item label="付款日期" prop="paymentDate" required class="form-item"> |
| | | <u-input v-model="form.paymentDate" placeholder="请选择" readonly @click="showDatePicker" /> |
| | | <template #right> |
| | | <up-icon |
| | | name="arrow-right" |
| | | @click="showDatePicker" |
| | | ></up-icon> |
| | | </template> |
| | | </u-form-item> |
| | | </u-cell-group> |
| | | <u-form-item label="登记人" class="form-item"> |
| | | <u-input v-model="form.registrant" placeholder="自动填充" readonly /> |
| | | </u-form-item> |
| | | <u-form-item label="登记日期" prop="registrationtDate" required class="form-item"> |
| | | <u-input v-model="form.registrationtDate" placeholder="请选择" readonly /> |
| | | </u-form-item> |
| | | </u-cell-group> |
| | | |
| | | <!-- 提交按钮 --> |
| | | <view class="footer-btns"> |
| | | <u-button class="cancel-btn" @click="onClickLeft">取消</u-button> |
| | | <u-button class="save-btn" type="primary" @click="onSubmit" :loading="loading">保存</u-button> |
| | | </view> |
| | | <FooterButtons |
| | | :loading="loading" |
| | | @cancel="onClickLeft" |
| | | @confirm="onSubmit" |
| | | /> |
| | | </u-form> |
| | | |
| | | <!-- 付款方式选择器 --> |
| | | <u-popup v-model="showPaymentType" mode="bottom"> |
| | | <u-picker |
| | | v-model="pickerValue" |
| | | :columns="paymentTypeOptions" |
| | | @confirm="onPaymentTypeConfirm" |
| | | @cancel="showPaymentType = false" |
| | | /> |
| | | </u-popup> |
| | | <up-action-sheet |
| | | :show="showPaymentType" |
| | | title="选择付款方式" |
| | | :actions="receipt_payment_type" |
| | | @select="onPaymentTypeConfirm" |
| | | @close="showPaymentType = false" |
| | | /> |
| | | |
| | | <!-- 日期选择器 --> |
| | | <u-popup v-model="showDate" mode="bottom"> |
| | | <u-datetime-picker |
| | | v-model="currentDate" |
| | | title="选择日期" |
| | | @confirm="onDateConfirm" |
| | | @cancel="showDate = false" |
| | | /> |
| | | </u-popup> |
| | | <up-datetime-picker |
| | | :show="showDate" |
| | | v-model="form.paymentDate" |
| | | @confirm="onDateConfirm" |
| | | @cancel="showDate = false" |
| | | mode="date" |
| | | /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | } |
| | | |
| | | import { ref, onMounted, computed } from 'vue' |
| | | import FooterButtons from '@/components/FooterButtons.vue' |
| | | import useUserStore from '@/store/modules/user' |
| | | import { useDict } from '@/utils/dict' |
| | | import {paymentRegistrationAdd, paymentRegistrationEdit} from "@/api/procurementManagement/paymentEntry"; |
| | | import { formatDateToYMD } from '@/utils/ruoyi' |
| | | |
| | | const userStore = useUserStore() |
| | | |
| | |
| | | // 响应式数据 |
| | | const loading = ref(false) |
| | | const showPaymentType = ref(false) |
| | | const pickerValue = ref([]) |
| | | const showDate = ref(false) |
| | | const currentDate = ref([new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()]) |
| | | |
| | | // 表单数据 |
| | | const form = ref({ |
| | |
| | | ticketRegistrationId: '' |
| | | }) |
| | | const currentNoReceiptAmount = ref(0) |
| | | const operationType = ref('') |
| | | |
| | | // 获取字典数据 |
| | | const { receipt_payment_type: dictReceiptPaymentType } = useDict('receipt_payment_type') |
| | |
| | | // 转换字典数据格式为选择器需要的格式 |
| | | const receipt_payment_type = computed(() => { |
| | | return dictReceiptPaymentType.value.map(item => ({ |
| | | text: item.label, |
| | | name: item.label, |
| | | value: item.value |
| | | })) |
| | | }) |
| | |
| | | } |
| | | |
| | | // 确认付款方式选择 |
| | | const onPaymentTypeConfirm = ({ selectedValues, selectedOptions }) => { |
| | | form.value.receiptPaymentType = selectedOptions[0].value |
| | | form.value.paymentMethod = selectedOptions[0].text |
| | | pickerValue.value = selectedValues; |
| | | const onPaymentTypeConfirm = (item) => { |
| | | form.value.receiptPaymentType = item.value |
| | | form.value.paymentMethod = item.name |
| | | showPaymentType.value = false |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 确认日期选择 |
| | | const onDateConfirm = ({ selectedValues }) => { |
| | | form.value.paymentDate = selectedValues.join('-') |
| | | currentDate.value = selectedValues |
| | | const onDateConfirm = (e) => { |
| | | form.value.paymentDate = formatDateToYMD(e.value) |
| | | showDate.value = false |
| | | } |
| | | |
| | |
| | | } |
| | | if (!form.value.receiptPaymentType) { |
| | | showNotify({ type: 'warning', message: '请选择付款形式' }) |
| | | return |
| | | } |
| | | if (!form.value.paymentDate) { |
| | | showNotify({ type: 'warning', message: '请选择付款日期' }) |
| | | return |
| | | } |
| | | loading.value = true |
| | |
| | | const rowStr = uni.getStorageSync('invoiceLedgerEditRow') |
| | | const row = JSON.parse(rowStr) |
| | | form.value = { ...row }; |
| | | form.value.ticketRegistrationId = row.id; |
| | | form.value.id = ""; |
| | | if (operationType.value === 'add') { |
| | | currentNoReceiptAmount.value = row.unPaymentAmountTotal |
| | | form.value.registrant = userStore.nickName |
| | | form.value.registrationtDate = getCurrentDate(); |
| | | form.value.paymentDate = getCurrentDate(); |
| | | } |
| | | currentNoReceiptAmount.value = row.unPaymentAmountTotal || 0; |
| | | } |
| | | // 获取当前日期并格式化为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | onMounted(() => { |
| | | operationType.value = uni.getStorageSync('operationType') || ''; |
| | | initData() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .account-detail { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | padding-bottom: 5rem; |
| | | } |
| | | |
| | | .footer-btns { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: #fff; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | padding: 0.75rem 0; |
| | | box-shadow: 0 -0.125rem 0.5rem rgba(0,0,0,0.05); |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .cancel-btn { |
| | | font-weight: 400; |
| | | font-size: 1rem; |
| | | color: #FFFFFF; |
| | | width: 6.375rem; |
| | | background: #C7C9CC; |
| | | box-shadow: 0 0.25rem 0.625rem 0 rgba(3,88,185,0.2); |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | |
| | | .save-btn { |
| | | font-weight: 400; |
| | | font-size: 1rem; |
| | | color: #FFFFFF; |
| | | width: 14rem; |
| | | background: linear-gradient( 140deg, #00BAFF 0%, #006CFB 100%); |
| | | box-shadow: 0 0.25rem 0.625rem 0 rgba(3,88,185,0.2); |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | |
| | | // 响应式调整 |
| | | @media (max-width: 768px) { |
| | | .submit-section { |
| | | padding: 12px; |
| | | } |
| | | } |
| | | .tip-text { padding: 4px 16px 0 16px; font-size: 12px; color: #888; } |
| | | @import '@/static/scss/form-common.scss'; |
| | | </style> |