优化小票打印

This commit is contained in:
gyq
2025-03-13 18:54:10 +08:00
parent cfe9f7bb36
commit 745b8675ea
8 changed files with 207 additions and 167 deletions

View File

@@ -1,5 +1,5 @@
<template>
<el-drawer v-model="isShow" direction="rtl" size="60%">
<el-drawer v-model="isShow" direction="rtl" size="70%">
<template #header>
<h4>订单号{{ item.orderNo }}</h4>
</template>
@@ -24,9 +24,10 @@
<el-radio-button label="自定义" :value="3" />
</el-radio-group>
<div class="amount">
<el-input v-model="customAmount" v-if="refundType == 3" style="width: 250px;"
<el-input v-model="customAmount" v-if="refundType == 3" style="width: 370px;height: 42px;"
placeholder="请输入退款金额" @input="inputChange">
<template #prepend></template>
<template #append>最多可退{{ formatDecimal(item.payAmount - item.refundAmount, 2) }}</template>
</el-input>
<template v-else>
退款金额{{ formatDecimal(refundType == 1 ? item.originAmount - item.refundAmount : amount) }}
@@ -97,10 +98,10 @@
</el-table>
</template>
<div class="ipt">
<el-input type="textarea" v-model="remark" placeholder="请输入退单原因" />
<el-input type="textarea" rows="4" v-model="remark" placeholder="请输入退单原因" />
</div>
<div class="remark_tag">
<div class="item" v-for="(item, index) in remarkTagList" :key="index" @click="remark = item">
<div class="item" v-for="(item, index) in remarkTagList" :key="index" @click="addRmarkHandle(item)">
{{ item }}
</div>
</div>
@@ -394,13 +395,22 @@ function refundTypeChange(val) {
function inputChange(n) {
setTimeout(() => {
if (n > item.value.payAmount - item.value.refundAmount) {
customAmount.value = formatDecimal(item.value.payAmount - item.value.refundAmount, 2, true)
customAmount.value = formatDecimal(item.value.payAmount - item.value.refundAmount, 2)
} else {
customAmount.value = inputFilterFloat(n)
}
}, 100)
}
// 添加备注
function addRmarkHandle(item) {
if (remark.value.length) {
remark.value += `${item}`
} else {
remark.value = item
}
}
defineExpose({
show
})