This commit is contained in:
sa_10_0 2024-11-08 15:23:38 +08:00
parent f172751e31
commit b667d74070
2 changed files with 57 additions and 53 deletions

View File

@ -133,7 +133,7 @@
current: 1, //
pageSize: 5 //
})
const num = ref(0)
const orderDetail : any = ref([]) //
//
const orderList = ref([{}])

View File

@ -20,7 +20,7 @@
:header-cell-style="{ 'text-align': 'center' }">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="id" label="订单id" width="80"></el-table-column>
<el-table-column prop="goodSnapshot.name" label="商品名称"></el-table-column>
<el-table-column prop="name" label="商品名称"></el-table-column>
<el-table-column prop="quantity" label="购买数量" width="180"></el-table-column>
<el-table-column prop="totalAmount" label="订单总金额"></el-table-column>
<el-table-column prop="createTime" label="下单时间"></el-table-column>
@ -28,9 +28,9 @@
<el-table-column prop="orderStatus" label="订单状态"></el-table-column>
<el-table-column label="操作" width="250px">
<template #default="scope">
<el-button size="small" @click="ReviseOrView(scope.$index, scope.row , 0)">
编辑
</el-button>
<!-- <el-button size="small" @click="ReviseOrView(scope.$index, scope.row , 0)">-->
<!-- 编辑-->
<!-- </el-button>-->
<el-button plain @click="dialogFormVisible = true">
发货
</el-button>
@ -52,21 +52,21 @@
:small="null" :disabled="null" :background="null" layout="total, sizes, prev, pager, next, jumper"
:total="total" />
</div>
<!-- <el-dialog v-model="dialogFormVisible" title="Shipping address" width="500">-->
<!-- <el-form :model="">-->
<!-- <el-form-item label="快递单号" :label-width="formLabelWidth">-->
<!-- <el-input v-model=" " autocomplete="off" />-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <template #footer>-->
<!-- <div class="dialog-footer">-->
<!-- <el-button @click="dialogFormVisible = false">取消</el-button>-->
<!-- <el-button type="primary" @click="dialogFormVisible = false">-->
<!-- 确定-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-dialog>-->
<el-dialog v-model="dialogFormVisible" title="订单号" width="500">
<el-form label-position="100px" size="default">
<el-form-item label="快递单号" >
<el-input v-model="tableData.orderNumber" autocomplete="off" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="dialogFormVisible = false">
确定
</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
@ -76,6 +76,11 @@
const tableData : any= ref([]);
const total = ref(0);
const num = ref(0)
const order = ref(
{
orderNumber:0,
}
)
const dialogFormVisible = ref(false)
const formLabelWidth = '140px'
onMounted(()=>{
@ -100,21 +105,21 @@
const getOrderList = async () => {
try {
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
// console.log(res)
console.log(res.data.data)
if (res.data.code === 1) {
tableData.value = res.data.data.records
tableData.value = res.data.data
total.value = parseInt(res.data.data.total)
for(let key in tableData.value) {
num.value = parseInt(key)
const resOrderDetail = await myAxios.post('/order/list/item',{id:tableData.value[key].id})
if( resOrderDetail.data.code === 1 ) {
tableData.value.goodSnapshot= resOrderDetail.data.data[key].goodSnapshot
tableData.value.quantity = resOrderDetail.data.data[key].quality
// console.log(resOrderDetail.data.data[0].goodSnapshot.name)
console.log( tableData.value.goodSnapshot.name)
console.log( resOrderDetail.data.data[key].quantity)
}
}
// for(let key in tableData.value) {
// num.value = parseInt(key)
// const resOrderDetail = await myAxios.post('/order/list/item',{id:tableData.value[key].id})
// if( resOrderDetail.data.code === 1 ) {
// tableData.value.goodSnapshot= resOrderDetail.data.data[key].goodSnapshot
// tableData.value.quantity = resOrderDetail.data.data[key].quality
// // console.log(resOrderDetail.data.data[0].goodSnapshot.name)
// console.log( tableData.value.goodSnapshot.name)
// console.log( resOrderDetail.data.data[key].quantity)
// }
// }
} else {
ElMessage({
message: '获取数据失败',
@ -126,26 +131,25 @@
});
}
}
// const getItemList = async (id: number) => {
// try {
// const res = await myAxios.post('/order/list/item', { id:tableData.value[key].id});
// console.log(res)
// if (res.data.code === 1) {
// tableData.value = res.data.data.records;
// total.value = parseInt(res.data.data.total)
// } else {
// ElMessage({
// message: '',
// });
// }
// } catch (error) {
// ElMessage({
// message: '',
// });
// }
// }
const setNumber =async ()=>{
const values = Object.values(order.value);
if (values.some(value => value === null || value === undefined )) {
ElMessage({
type: 'warning',
message: '请检查表单数据是否完整填写'
});
return;
}
const res = await myAxios.post('/order/list/page', { ...tableData.value.orderNumber});
if (res.data.code === 1) {
ElMessage({
type: 'success',
message: "提交成功"
});
} else {
ElMessage.error("服务错误");
}
}
// const orderList = ref({
// id:'',