更新订单列表详情,更新商品管理,更新代客下单

This commit is contained in:
2024-09-23 17:39:38 +08:00
parent 90e3866524
commit edcf844adb
36 changed files with 5301 additions and 949 deletions

View File

@@ -6,14 +6,18 @@
</view>
<filter-vue v-model:time="pageData.order.query.createdAt"></filter-vue>
</view>
<order-list :hasAjax="pageData.order.hasAjax" :list="pageData.order.list"></order-list>
<order-list @printOrder="onPrintOrder" :hasAjax="pageData.order.hasAjax" :list="pageData.order.list"></order-list>
<my-pagination :totalElements="pageData.order.totalElements"></my-pagination>
<view style="height: 100rpx;"></view>
</view>
</template>
<script setup>
import * as Api from '@/http/yskApi/order.js'
import {$printOrder} from '@/http/yskApi/Instead.js'
import filterVue from './compoents/filter.vue';
import orderList from './compoents/order-list.vue';
import infoBox from '@/commons/utils/infoBox.js'
import {
reactive, watch
} from 'vue';
@@ -28,10 +32,11 @@
textAlign: 'right'
}
})
const pageData = reactive({
order: {
list: [],
totalElements:0,
hasAjax:false,
query: {
createdAt: [],
@@ -50,12 +55,40 @@
init()
})
async function init() {
const {content}=await Api.tbOrderInfoData(pageData.order.query)
const {content,totalElements}=await Api.tbOrderInfoData(pageData.order.query)
pageData.order.hasAjax=true
pageData.order.totalElements=totalElements
pageData.order.list=content
console.log(content);
}
init()
async function printOrder(item){
try{
console.log(item);
const res= await $printOrder({
tableId:item.tableId
})
infoBox.showToast('已发送打印请求')
}catch(e){
console.log(e);
infoBox.showToast('发送打印请求失败')
//TODO handle the exception
}
}
function onPrintOrder(e){
console.log(e);
uni.showModal({
title: '提示',
content: '是否打印该订单',
success(res) {
if (res.confirm) {
printOrder(e)
}
}
})
}
</script>
<style>