💄 优化账单核销文案和弹窗展示
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<el-button v-if="row.status === AR_BILL_STATUS.DRAFT" link type="success" v-hasPermi="['ar:bill:confirm']" @click="confirmBill(row)">确认</el-button>
|
||||
<el-button v-if="row.status === AR_BILL_STATUS.DRAFT || row.status === AR_BILL_STATUS.CONFIRMED" link type="warning" v-hasPermi="['ar:bill:void']" @click="voidBill(row)">作废</el-button>
|
||||
<el-button v-if="row.status !== AR_BILL_STATUS.DRAFT && row.status !== AR_BILL_STATUS.VOID" link type="primary" v-hasPermi="['ar:bill:export']" @click="exportBill(row)">导出明细</el-button>
|
||||
<el-button v-if="canGoWriteoff(row)" link type="primary" v-hasPermi="['customer:bill:writeoff']" @click="goWriteoff(row)">去核销</el-button>
|
||||
<el-button v-if="canGoWriteoff(row)" link type="primary" v-hasPermi="['customer:bill:writeoff']" @click="goWriteoff(row)">核销</el-button>
|
||||
<el-button v-if="canGoReverseWriteoff(row)" link type="warning" v-hasPermi="['customer:bill:writeoff:cancel']" @click="goReverseWriteoff(row)">反核销</el-button>
|
||||
</template>
|
||||
</basic-table>
|
||||
|
||||
+4
-26
@@ -949,17 +949,14 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- ====== 余额核销账单弹窗 ====== -->
|
||||
<el-dialog title="余额核销账单" v-model="woDialog.visible" width="560px" append-to-body v-loading="woDialog.accountLoading">
|
||||
<!-- ====== 账单核销弹窗 ====== -->
|
||||
<el-dialog title="账单核销" v-model="woDialog.visible" width="560px" append-to-body>
|
||||
<el-descriptions :column="1" border size="small" v-if="woDialog.bill">
|
||||
<el-descriptions-item label="账单号">{{ woDialog.bill.billNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="账单名称">{{ woDialog.bill.billName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="账单未核销金额">
|
||||
<span class="money-out">CNY {{ formatMoney(woDialog.bill.unwrittenAmount) }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="账户可用余额">
|
||||
<span class="money-in">CNY {{ formatMoney(currentAccount.balance) }}</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-form :model="woDialog.form" label-width="110px" class="wo-form">
|
||||
<el-form-item label="本次核销金额" required>
|
||||
@@ -1904,10 +1901,9 @@ function loadBillWriteoffData() {
|
||||
|
||||
/* ---- 核销弹窗 ---- */
|
||||
const woSubmitLoading = ref(false)
|
||||
const woDialog = reactive({ visible: false, bill: null, form: {}, accountLoading: false })
|
||||
let writeoffAccountRequestSerial = 0
|
||||
const woDialog = reactive({ visible: false, bill: null, form: {} })
|
||||
|
||||
async function openWriteoffDialog(row) {
|
||||
function openWriteoffDialog(row) {
|
||||
const customerId = Number(route.query.customerId)
|
||||
if (!customerId) {
|
||||
proxy.$modal.msgError('缺少客户ID,无法发起核销')
|
||||
@@ -1925,27 +1921,9 @@ async function openWriteoffDialog(row) {
|
||||
remark: ''
|
||||
}
|
||||
woDialog.visible = true
|
||||
|
||||
// 仍刷新账户余额供展示,但不再限制核销金额
|
||||
const requestSerial = ++writeoffAccountRequestSerial
|
||||
woDialog.accountLoading = true
|
||||
try {
|
||||
const res = await listAccount(customerId)
|
||||
if (requestSerial !== writeoffAccountRequestSerial) return
|
||||
accountList.value = res.data || []
|
||||
} catch (e) {
|
||||
if (requestSerial !== writeoffAccountRequestSerial) return
|
||||
proxy.$modal.msgError('账户余额刷新失败,请稍后重试')
|
||||
} finally {
|
||||
if (requestSerial === writeoffAccountRequestSerial) woDialog.accountLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
function submitWriteoff() {
|
||||
if (woDialog.accountLoading) {
|
||||
proxy.$modal.msgWarning('正在刷新账户余额,请稍候')
|
||||
return
|
||||
}
|
||||
const bill = woDialog.bill
|
||||
const rawAmount = typeof woDialog.form.writeoffAmount === 'string'
|
||||
? woDialog.form.writeoffAmount.trim()
|
||||
|
||||
Reference in New Issue
Block a user