订单退单

This commit is contained in:
魏啾 2024-03-15 10:29:33 +08:00
parent 861e62ce15
commit ba7efac5d1
4 changed files with 54 additions and 20 deletions

View File

@ -37,3 +37,15 @@ export function payreturnOrder(data) {
});
}
/**
* 打印
* @param {*} params
* @returns
*/
export function cloudPrinterprint(params) {
return request({
method: "post",
url: "cloudPrinter/print",
params
});
}

View File

@ -72,7 +72,7 @@ const loading = ref(false);
const form = reactive({
serialNumber: RandomNumBoth(1000, 9999),
clientType: 'pc',
merchantName: '',
merchantName: '',//19191703856
loginName: "",
password: "",
});

View File

@ -2,9 +2,12 @@
<div class="demo_tabs_box">
<div class="demo_tabs_boxitem" v-for="(item, index) in ordereData.list" :key="index"
@click="clickitemboxshow(item)">
<div class="demo_tabs_boxitem_oneyt" v-if="item.status == 'refund'">已退款</div>
<div class="demo_tabs_boxitem_one">
<div class="" style="width: 100px; height: 70px;border-radius: 10px; background:var( --primary-color); color: #fff; display: flex; justify-content: center; align-items: center;">
<div>{{ item.zdNo || "pos" }}</div>
<div class=""
style="width: 100px; height: 70px;border-radius: 10px; background:rgb(186 200 239); display: flex; justify-content: center; align-items: center;">
<div>{{ item.zdNo || "pos" }}</div>
</div>
<!-- <el-image style="width: 100px; height: 70px;border-radius: 10px;" :src="item.imgUrl" fit="scale-down" /> -->
<div class="demo_tabs_boxitem_oneone">
@ -18,8 +21,8 @@
<div class="demo_tabs_boxitem_onetow">
<div style="font-size: 16px; color: #757575;">{{ item.orderNo }}</div>
<div>
<span>{{item.names && item.names[0] }} </span>
<span style="margin-left: 6px;">{{ item.names && item.names.length }}</span>
<span>{{ item.names && item.names[0] }} </span>
<span style="margin-left: 6px;">{{ item.names && item.names.length }}</span>
</div>
</div>
</div>
@ -45,8 +48,8 @@ const props = defineProps({
ordereData: {
type: Object,
default: {
list:[{
names:[]
list: [{
names: []
}]
}
}
@ -70,14 +73,30 @@ const clickitemboxshow = (e) => {
border-radius: 6px;
display: flex;
justify-content: space-between;
// background: #eeeeee;
border-bottom: 1px solid #ccc;
position: relative;
.demo_tabs_boxitem_oneyt {
position: absolute;
top: 20%;
transform: translate(-50%, 0);
transform: rotate(45deg);
right: 200px;
display: inline-block;
border: 3px solid red;
color: red;
font-weight: bold;
border-radius: 6px;
text-align: center;
padding: 10px 6px;
}
.demo_tabs_boxitem_one {
display: flex;
justify-content: flex-start;
flex-shrink: 0;
.demo_tabs_boxitem_oneone {
display: flex;
margin-left: 20px;

View File

@ -15,14 +15,14 @@
@current-change="handleCurrentChange" />
</el-tab-pane>
<el-tab-pane label="销售" name="closed">
<add :ordereData="ordereData" v-if="ordereData.list.length"></add>
<add :ordereData="ordereData" @emititemboxshow="emititemboxshow" v-if="ordereData.list.length"></add>
<div v-else style="width: 100%; text-align: center; margin: 30px 0;">暂无数据</div>
<el-pagination v-if="ordereData.list.length" layout="prev, pager, next, jumper"
style="margin-top: 20px;" :total="Number(ordereData.total)"
@current-change="handleCurrentChange" />
</el-tab-pane>
<el-tab-pane label="退单" name="refund">
<add :ordereData="ordereData" v-if="ordereData.list.length"></add>
<add :ordereData="ordereData" @emititemboxshow="emititemboxshow" v-if="ordereData.list.length"></add>
<div v-else style="width: 100%; text-align: center; margin: 30px 0;">暂无数据</div>
<el-pagination v-if="ordereData.list.length" layout="prev, pager, next, jumper"
style="margin-top: 20px;" :total="Number(ordereData.total)"
@ -45,7 +45,7 @@
<span class="span">收银员</span><span class="nunber">{{ orderDetaildata.userName }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">创建时间</span><span class="nunber">{{ orderDetaildata.createdAt }}</span>
<span class="span">创建时间</span><span class="nunber">{{dayjs( orderDetaildata.createdAt).format("YYYY-MM-DD HH:mm:ss") }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">终端</span><span class="nunber">{{ orderDetaildata.zdNo }}</span>
@ -80,21 +80,22 @@
</div>
<div class="orderbox_right_list_item" style="margin-top: 20px;"
v-for="(item, index) in orderDetaildata.detailList" :key="index">
<div>{{ item.productName }}-{{ item.productSkuName }}号商品</div>
<div>{{ item.productName }}-{{ item.productSkuName }}</div>
<div style="text-align: center;">{{ item.num }}</div>
<div style="text-align: center;">{{ item.price }}</div>
<div>{{ item.priceAmount }}</div>
<div v-if="item.status == 'refund'" ><span style="border: 2px solid red; color: red; padding: 4px 2px;">已退</span></div>
<div v-else>{{ item.priceAmount }}</div>
</div>
</div>
<div class="orderbox_right_button">
<div class="orderbox_right_buttonbutton" v-if="orderDetaildata.status == 'refund'">
<router-link to="/" style="width: 45%;">
<el-button style="width: 100%;" type="primary">打票</el-button>
<el-button style="width: 100%;" v-if="orderDetaildata.status != 'refund'" type="primary" @click="recharge = true">退单</el-button>
<div class="orderbox_right_buttonbutton">
<router-link to="/" style="width: 45%;" type="danger">
<el-button style="width: 100%;" type="">重打收銀打票</el-button>
</router-link>
<el-button style="width: 45%;" type="danger" @click="recharge = true">退单</el-button>
<el-button style="width: 45%;" type="" @click="recharge = true">重打出品小票</el-button>
<!--payreturnOrderclick @click="recharge = true" -->
</div>
<el-button v-else style="width: 100%; margin-top: 10px;" type="primary" @click="onSubmit">结算</el-button>
</div>
</div>
<div class="orderbox_rightbox" v-else>
@ -161,7 +162,7 @@
单号{{ orderDetaildata.orderNo }}
</div>
<div>
下单时间{{ orderDetaildata.createdAt }}
下单时间{{ dayjs(orderDetaildata.createdAt).format("YYYY-MM-DD HH:mm:ss") }}
</div>
<div>
<span>金额{{ orderDetaildata.orderAmount }}</span>
@ -249,6 +250,7 @@ const payreturnOrderclick = async () => {
await payreturnOrder(arr)
changechecked.value = false
recharge.value = false
ElMessage.error('退款成功!')
asyncorderfindOrder()
} else {
ElMessage.error('以没有退款项目!')
@ -722,7 +724,7 @@ onMounted(() => {
.tableDataclass {
width: 100%;
overflow: auto;
height: 75%;
height: 80%;
.orderbox_right_item {
margin-top: 6px;
@ -740,6 +742,7 @@ onMounted(() => {
bottom: 16px;
.orderbox_right_buttonbutton {
margin-top: 10px;
display: flex;
justify-content: space-between;
align-items: center;