完成订单
This commit is contained in:
@@ -4,9 +4,8 @@
|
||||
<el-tabs v-model="ordereData.status" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="全部" name="closed">
|
||||
<div class="demo_tabs_div">
|
||||
<el-input v-model="ordereData.ordernumbr" placeholder="请输入订单号查询" @input="inputChange"
|
||||
clearable />
|
||||
<el-button style="margin-left: 10px;" type="primary" @click="onSubmit">搜索</el-button>
|
||||
<el-input v-model="ordereData.orderNo" placeholder="请输入订单号查询" @input="inputChange" clearable />
|
||||
<!-- <el-button style="margin-left: 10px;" type="primary" @click="onSubmit">搜索</el-button> -->
|
||||
</div>
|
||||
<add :ordereData="ordereData" @emititemboxshow="emititemboxshow" v-if="ordereData.list.length">
|
||||
</add>
|
||||
@@ -31,7 +30,7 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="orderbox_right" v-if="itemboxshow">
|
||||
<div class="orderbox_right" v-if="itemboxshow" v-loading="orderDetaildata.loading">
|
||||
<div class="orderbox_right_top">
|
||||
<span>堂食订单</span>
|
||||
<el-icon :size="32" style="color: var(--primary-color) ;" @click="itemboxshow = false">
|
||||
@@ -90,11 +89,12 @@
|
||||
<div class="orderbox_right_button">
|
||||
<div class="orderbox_right_buttonbutton">
|
||||
<router-link to="/" style="width: 45%;">
|
||||
<el-button style="width: 100%;" type="primary">点单</el-button>
|
||||
<el-button style="width: 100%;" type="primary">打票</el-button>
|
||||
</router-link>
|
||||
<el-button style="width: 45%;" type="danger" @click="onSubmit">取消</el-button>
|
||||
<el-button style="width: 45%;" type="danger" @click="payreturnOrderclick">退单</el-button>
|
||||
<!-- @click="recharge = true" -->
|
||||
</div>
|
||||
<el-button style="width: 100%; margin-top: 10px;" type="primary" @click="onSubmit">结算</el-button>
|
||||
<!-- <el-button style="width: 100%; margin-top: 10px;" type="primary" @click="onSubmit">结算</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="orderbox_rightbox" v-else>
|
||||
@@ -135,7 +135,19 @@
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <el-dialog v-model="recharge" title="退单" width="800" :before-close="handlerecharge">
|
||||
<div class="recharge_footer">
|
||||
<div class="recharge_footer_item">
|
||||
<el-input v-model="textarea" style="width: 100%" :rows="2" type="textarea"
|
||||
placeholder="Please input" />
|
||||
<div class="recharge_footer_items">
|
||||
<div>顾客取消</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="recharge_footer_itemright">
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -144,25 +156,38 @@ import { ref, onMounted, reactive } from 'vue'
|
||||
import { ElMessage, dayjs } from 'element-plus'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import lodash from 'lodash'
|
||||
import { orderfindOrder, orderorderDetail } from '@/api/order/index.js'
|
||||
import { orderfindOrder, orderorderDetail, payreturnOrder } from '@/api/order/index.js'
|
||||
import add from '@/views/order/components/add.vue'
|
||||
const store = useUser()
|
||||
const itemboxshow = ref(false)
|
||||
const drawershow = ref(true)
|
||||
const handleClick = (Name) => {//切换teb
|
||||
ordereData.status = Name.props.name
|
||||
asyncorderfindOrder()
|
||||
}
|
||||
const firstinput = ref('')//搜索输入框
|
||||
const onSubmit = () => {
|
||||
if (firstinput.value) {
|
||||
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '请输入订单号查询',
|
||||
type: 'warning',
|
||||
const recharge = ref(true)//退单切换
|
||||
|
||||
const handlerecharge = () => {
|
||||
recharge.value = !recharge.value
|
||||
}
|
||||
|
||||
const payreturnOrderclick = async () => {
|
||||
try {
|
||||
let result = orderDetaildata.value.detailList.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
orderId: orderDetaildata.value.id
|
||||
}
|
||||
})
|
||||
await payreturnOrder(result)
|
||||
asyncorderfindOrder()
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const emititemboxshow = async (e) => { //接收子组件值 并赋值给父组件
|
||||
try {
|
||||
let res = await orderorderDetail({
|
||||
@@ -177,7 +202,7 @@ const emititemboxshow = async (e) => { //接收子组件值 并赋值给父组
|
||||
}
|
||||
}
|
||||
const orderDetaildata = ref({//详情数据
|
||||
|
||||
// loading
|
||||
})
|
||||
const ordereData = reactive({//表格数据
|
||||
list: [{
|
||||
@@ -193,7 +218,6 @@ const ordereData = reactive({//表格数据
|
||||
status: 'closed',
|
||||
total: '',
|
||||
orderNo: '',
|
||||
ordernumbr: ''
|
||||
})
|
||||
const asyncorderfindOrder = async () => {//获取流水
|
||||
try {
|
||||
@@ -202,7 +226,7 @@ const asyncorderfindOrder = async () => {//获取流水
|
||||
status: ordereData.status,
|
||||
size: ordereData.size,
|
||||
page: ordereData.page,
|
||||
ordernumbr: ordereData.ordernumbr
|
||||
orderNo: ordereData.orderNo
|
||||
})
|
||||
ordereData.total = res.total
|
||||
ordereData.list = res.list
|
||||
@@ -378,6 +402,161 @@ onMounted(() => {
|
||||
|
||||
}
|
||||
|
||||
.recharge_footer {
|
||||
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
.recharge_footer_item {
|
||||
background: #f2f2f2;
|
||||
width: 60%;
|
||||
background: #f2f2f2;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-flow: wrap;
|
||||
|
||||
.recharge_footer_items {
|
||||
// background: #187ead;
|
||||
border: 1px solid #187ead;
|
||||
padding: 16px 22px;
|
||||
width: 30%;
|
||||
color: #187ead;
|
||||
height: fit-content;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.recharge_footer_itemright {
|
||||
padding-left: 20px;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
.recharge_footer_itemright_input {
|
||||
width: 100%;
|
||||
background: #333333;
|
||||
border-radius: 10px;
|
||||
padding: 0 6px;
|
||||
display: flex;
|
||||
height: 60px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
div:nth-child(1) {
|
||||
color: #56792e;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
div:nth-child(2) {
|
||||
color: #88937c;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
width: 100%;
|
||||
height: 40vh;
|
||||
background: #FFFFFF;
|
||||
|
||||
.key-row {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
height: 10vh;
|
||||
line-height: 10vh;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.keyboard .key-cell {
|
||||
flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
height: 30vh;
|
||||
width: 25%;
|
||||
line-height: 30vh;
|
||||
color: #FFFFFF;
|
||||
z-index: 5;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm2 {
|
||||
position: absolute;
|
||||
height: 10vh;
|
||||
width: 25%;
|
||||
line-height: 10vh;
|
||||
z-index: 9999;
|
||||
right: 0;
|
||||
top: 60px;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.key-zero-and-point {
|
||||
display: flex;
|
||||
height: 10vh;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 75%;
|
||||
font-size: 30px;
|
||||
|
||||
.zero {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 66.66%;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 33.33%;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.key-cell:active {
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
|
||||
.a:active,
|
||||
.key-confirm2:active {
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.orderbox_right {
|
||||
position: relative;
|
||||
width: 40%;
|
||||
|
||||
Reference in New Issue
Block a user