新增单品备注

This commit is contained in:
gyq 2025-04-24 10:40:40 +08:00
parent 3a11828f3c
commit ca3b0eddbc
4 changed files with 46 additions and 4 deletions

View File

@ -182,8 +182,8 @@ const printData = reactive({
totalAmount: "10",
},
],
amount: "30.00",
originAmount: '30.00',
amount: "10.00",
originAmount: '10.00',
discountAmount: "0.00",
discount: 0,
remark: "给我多放点辣椒,谢谢老板",

View File

@ -27,7 +27,8 @@
<div class="price" v-else>
<template v-if="+props.item.discount_sale_amount">
<span class="dis">
{{ formatDecimal(goodsStore.showVipPrice ? +props.item.memberPrice || +props.item.lowPrice : +props.item.lowPrice,
{{ formatDecimal(goodsStore.showVipPrice ? +props.item.memberPrice || +props.item.lowPrice
: +props.item.lowPrice,
2, true) }}
</span>
<span>
@ -41,7 +42,9 @@
</span>
</template>
<span>
{{ formatDecimal(goodsStore.showVipPrice ? +props.item.memberPrice || +props.item.lowPrice : +props.item.lowPrice,
{{ formatDecimal(goodsStore.showVipPrice ? +props.item.memberPrice || +props.item.lowPrice
:
+props.item.lowPrice,
2,
true) }}
</span>
@ -49,6 +52,11 @@
</div>
</template>
</div>
<div class="remark_wrap" @click="showRemark(props.item)">
备注<span class="t">{{ props.item.remark }}</span><el-icon class="icon" v-if="props.type == 'cart'">
<EditPen />
</el-icon>
</div>
<div class="sku_list" v-if="props.item.sku_name">
<div class="tag" v-for="item in item.sku_name.split(',')">
{{ item }}
@ -82,10 +90,13 @@
<el-text class="t">x{{ formatDecimal(+props.item.number, 2, true) }}</el-text>
</div>
</div>
<!-- 备注 -->
<remarkModal ref="remarkRef" @success="remarkSuccess" />
</template>
<script setup>
import { ref } from 'vue'
import remarkModal from "@/components/remarkModal.vue";
import { useGoods } from '@/store/goods.js'
import { formatDecimal } from '@/utils/index.js'
@ -122,9 +133,34 @@ function selectCartItemHandle() {
goodsStore.selectOrderItem(props.index, props.i)
}
}
//
const remarkRef = ref(null)
function showRemark() {
if (props.type == 'cart') {
remarkRef.value.show()
}
}
//
function remarkSuccess(e) {
goodsStore.operateCart({ ...props.item, remark: e }, 'edit')
}
</script>
<style scoped lang="scss">
.remark_wrap {
font-size: 14px;
color: #999;
padding-top: 10px;
.icon {
position: relative;
top: 2px;
margin-left: 4px;
}
}
.cart_item {
padding: var(--el-font-size-base);

View File

@ -37,6 +37,9 @@
</template>
</div>
</div>
<div class="gift_wrap" style="padding-bottom: 10px;">
<div class="name">备注{{ item.remark || '无' }}</div>
</div>
<div class="tag_wrap" v-if="item.sku_name">
<div class="tag" v-for="item in item.sku_name.split(',')">
{{ item }}

View File

@ -35,6 +35,9 @@
<span>{{ item.productName }}</span>
<span class="amount">{{ formatDecimal(+item.payAmount) }}</span>
</div>
<div class="num">
备注: {{ item.remark || "无" }}
</div>
<div class="num">
<span>{{ formatDecimal(+item.unitPrice) }}</span>
<span>x{{ item.num }}</span>