Compare commits

..

No commits in common. "10d80f09b962b6248a3f0edc1b8a5b085ba0c9a8" and "1c7c4370e842e75a55e1790ab8ab89cb8f2ec3ab" have entirely different histories.

2 changed files with 381 additions and 408 deletions

View File

@ -1,216 +1,224 @@
<template> <template>
<div> <div>
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入订单编号" <el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入订单编号"
v-model="name"></el-input> v-model="name"></el-input>
<el-button class="ml-5" type="primary" @click="load" style="height: 25px;">搜索</el-button> <el-button class="ml-5" type="primary" @click="load" style="height: 25px;">搜索</el-button>
<el-button type="warning" @click="reset" style="height:25px">重置</el-button> <el-button type="warning" @click="reset" style="height:25px">重置</el-button>
</div> </div>
<div style="margin: 15px 0"> <div style="margin: 15px 0">
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red" <el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
title="您确定批量删除这些数据吗?" @confirm="delBatch" width=180> title="您确定批量删除这些数据吗?" @confirm="delBatch" width=180>
<template #reference> <template #reference>
<el-button style="height: 25px" class="ml-5" type="danger">批量删除 <el-icon style="margin-left: 5px;"> <el-button style="height: 25px" class="ml-5" type="danger">批量删除 <el-icon style="margin-left: 5px;">
<Remove /> <Remove />
</el-icon></el-button> </el-icon></el-button>
</template>
</el-popconfirm>
</div>
<!-- 数据展示层 -->
<el-table :data="tableData" border stripe header-cell-class-name="headerBg"
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
:header-cell-style="{ 'text-align': 'center' }">
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
<el-table-column prop="id" label="订单编号" width="80"></el-table-column>
<el-table-column prop="userId" label="用户id"></el-table-column>
<el-table-column prop="orderNumber" label="订单编号" width="150"></el-table-column>
<!-- 商品信息需要发第二次请求 -->
<el-table-column label="所购买的商品" width="100">
<el-table-column label="展开所有商品" type="expand" width="100">
<el-table :data="orderDetail">
<el-table-column label="商品编号" prop="id" />
<el-table-column label="商品名称" prop="orderDetail[num].type" />
<el-table-column label="商品图片" prop="orderDetail[num].price" />
<el-table-column label="类别" prop="city" />
<el-table-column label="商品单价" prop="address" />
<el-table-column label="是否是限定商品" prop="zip" />
<el-table-column label="数量" prop="address" />
</el-table>
</el-table-column>
</el-table-column>
<el-table-column label="地址信息快照" width="180">
<el-table-column prop="addressSnapshot.name" label="收货人" />
<el-table-column prop="addressSnapshot.phone" label="手机号" />
<el-table-column prop="addressSnapshot.region" label="地区" />
<el-table-column prop="addressSnapshot.detailAddress" label="详细地址" />
</el-table-column>
<el-table-column label="优惠卷信息快照" width="50">
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
<el-table-column prop="couponSnapshot.conditionAmount" label="优惠金额" />
</el-table-column>
<el-table-column prop="totalAmount" label="订单总金额"></el-table-column>
<el-table-column prop="orderStatus" label="订单状态"></el-table-column>
<el-table-column label="操作" width="120px" fixed="right">
<template #default="scope">
<el-button size="small" @click="showDetail(scope.$index, scope.row , 0)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
<div style="padding: 10px 0">
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchParams.current"
:page-size="searchParams.pageSize"
:page-sizes="[5, 10, 15, 20]"
:small="null" :disabled="null"
:background="null"
layout="total, sizes, prev, pager, next, jumper"
:total="total" />
</div>
<!-- <el-dialog title="订单详情信息" v-model="orderList" width="60%">
<el-form label-width="100px" size="default">
<el-form-item label="订单id">
<el-input v-model="orderList.id" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户id">
<el-input v-model="orderList.userId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户名称">
<el-input v-model="orderList.addressSnapshot.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单编号">
<el-input v-model="orderList.addressSnapshot" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="收货地址">
<el-input v-model="orderList.addressSnapshot.region" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="详细地址">
<el-input v-model="orderList.addressSnapshot.detailAddress" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="电话">
<el-input v-model="orderList.addressSnapshot.phone" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="orderList.couponSnapshot.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="满减金额">
<el-input v-model="orderList.couponSnapshot.conditionAmount" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单总金额">
<el-input v-model="orderList.totalAmount" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-input v-model="orderList.orderStatus" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-input v-model="orderList.createTime" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="更新时间">
<el-input v-model="orderList.updateTime" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button style="height: 30px;" @click="dialogFormVisible = false">取消</el-button>
<el-button style="height: 30px" type="primary" @click=save>确认</el-button>
</div>
</template> </template>
</el-dialog> --> </el-popconfirm>
</template> </div>
<!-- 数据展示层 -->
<script lang="ts" setup> <el-table :data="tableData" border stripe header-cell-class-name="headerBg"
import {onMounted, ref} from "vue"; :cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
import myAxios from "@/api/myAxios"; :header-cell-style="{ 'text-align': 'center' }">
import {ElMessage} from "element-plus"; <el-table-column type="selection" width="55" fixed="left"></el-table-column>
const tableData : any= ref([]); // <el-table-column prop="id" label="订单编号" width="80"></el-table-column>
const total = ref(0); <el-table-column prop="userId" label="用户id"></el-table-column>
const title = ref('') <el-table-column prop="orderNumber" label="订单编号" width="150"></el-table-column>
const editForm : any = ref({}); <!-- 商品信息需要发第二次请求 -->
const DialogVisible = ref(true); <el-table-column label="所购买的商品" width="100">
const name =ref('') <el-table-column label="展开所有商品" type="expand" width="100">
const searchParams: any = ref({ // <el-table :data="orderDetail">
current: 1, // <el-table-column label="商品编号" prop="id" />
pageSize: 5 // <el-table-column label="商品名称" prop="orderDetail[num].type" />
}) <el-table-column label="商品图片" prop="orderDetail[num].price" />
const num = ref(0) <el-table-column label="类别" prop="city" />
const orderDetail : any = ref([]) // <el-table-column label="商品单价" prop="address" />
// <el-table-column label="是否是限定商品" prop="zip" />
const orderList = ref([{}]) <el-table-column label="数量" prop="address" />
onMounted(()=>{ </el-table>
getOrderList() // </el-table-column>
}) </el-table-column>
const handleSizeChange = (newSize: any) => { <el-table-column label="地址信息快照" width="180">
searchParams.value.pageSize = newSize // <el-table-column prop="addressSnapshot.name" label="收货人" />
getOrderList() <el-table-column prop="addressSnapshot.phone" label="手机号" />
} <el-table-column prop="addressSnapshot.region" label="地区" />
const handleCurrentChange = (Current: any) => { <el-table-column prop="addressSnapshot.detailAddress" label="详细地址" />
searchParams.value.current = Current </el-table-column>
getOrderList() <el-table-column label="优惠卷信息快照" width="50">
} <el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
const handleSelectionChange = (row: any) => { <el-table-column prop="couponSnapshot.conditionAmount" label="优惠金额" />
// id.value = JSON.parse(JSON.stringify(row)); </el-table-column>
} <el-table-column prop="totalAmount" label="订单总金额"></el-table-column>
const getOrderList = async () => { <el-table-column prop="orderStatus" label="订单状态"></el-table-column>
try { <el-table-column label="操作" width="120px" fixed="right">
const res = await myAxios.post('/order/list/page', { ...searchParams.value}); <template #default="scope">
console.log('订单信息--->',res.data); <el-button size="small" @click="showDetail(scope.$index, scope.row , 0)">
if (res.data.code === 1) { 详情
tableData.value = res.data.data.records; </el-button>
total.value = parseInt(res.data.data.total) <el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
console.log('tableData-->',tableData.value); title="是否确认删除" @confirm="deleteProduct(scope.row.id)" width=180>
// <template #reference>
console.log('数组长度--->',tableData.value.length); <el-button class="ml-5" type="danger">删除</el-button>
for(let key in tableData.value) { </template>
num.value = parseInt(key) </el-popconfirm>
const resOrderDetail = await myAxios.post('/order/list/item',{id:tableData.value[key].id}) // <el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red"
if( resOrderDetail.data.code === 1 ) { title="您确定删除吗?">
orderDetail.value[num.value] = resOrderDetail.data.data // </el-popconfirm>
} </template>
console.log('请求返回的resOrderDetail--->',resOrderDetail.data); </el-table-column>
console.log('第',key,'次返回的orderDetail-->',orderDetail.value[num.value]); </el-table>
console.log('总的orderDetail-->',orderDetail.value); <div style="padding: 10px 0">
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="searchParams.current"
:page-size="searchParams.pageSize"
:page-sizes="[5, 10, 15, 20]"
:small="null" :disabled="null"
:background="null"
layout="total, sizes, prev, pager, next, jumper"
:total="total" />
</div>
<!-- <el-dialog title="订单详情信息" v-model="orderList" width="60%">
<el-form label-width="100px" size="default">
<el-form-item label="订单id">
<el-input v-model="orderList.id" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户id">
<el-input v-model="orderList.userId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="用户名称">
<el-input v-model="orderList.addressSnapshot.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单编号">
<el-input v-model="orderList.addressSnapshot" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="收货地址">
<el-input v-model="orderList.addressSnapshot.region" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="详细地址">
<el-input v-model="orderList.addressSnapshot.detailAddress" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="电话">
<el-input v-model="orderList.addressSnapshot.phone" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="orderList.couponSnapshot.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="满减金额">
<el-input v-model="orderList.couponSnapshot.conditionAmount" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单总金额">
<el-input v-model="orderList.totalAmount" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-input v-model="orderList.orderStatus" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-input v-model="orderList.createTime" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="更新时间">
<el-input v-model="orderList.updateTime" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button style="height: 30px;" @click="dialogFormVisible = false">取消</el-button>
<el-button style="height: 30px" type="primary" @click=save>确认</el-button>
</div>
</template>
</el-dialog> -->
</template>
<script lang="ts" setup>
import {onMounted, ref} from "vue";
import myAxios from "@/api/myAxios";
import {ElMessage} from "element-plus";
const tableData : any= ref([]); //
const total = ref(0);
const title = ref('')
const editForm : any = ref({});
const DialogVisible = ref(true);
const name =ref('')
const searchParams: any = ref({ //
current: 1, //
pageSize: 5 //
})
const num = ref(0)
const orderDetail : any = ref([]) //
//
const orderList = ref([{}])
onMounted(()=>{
getOrderList() //
})
const handleSizeChange = (newSize: any) => {
searchParams.value.pageSize = newSize //
getOrderList()
}
const handleCurrentChange = (Current: any) => {
searchParams.value.current = Current
getOrderList()
}
const handleSelectionChange = (row: any) => {
// id.value = JSON.parse(JSON.stringify(row));
}
const getOrderList = async () => {
try {
const res = await myAxios.post('/order/list/page', { ...searchParams.value});
console.log('订单信息--->',res.data);
if (res.data.code === 1) {
tableData.value = res.data.data.records;
total.value = parseInt(res.data.data.total)
console.log('tableData-->',tableData.value);
//
console.log('数组长度--->',tableData.value.length);
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 ) {
orderDetail.value[num.value] = resOrderDetail.data.data //
} }
// console.log(orderDetail.value); console.log('请求返回的resOrderDetail--->',resOrderDetail.data);
} else { console.log('第',key,'次返回的orderDetail-->',orderDetail.value[num.value]);
ElMessage({ console.log('总的orderDetail-->',orderDetail.value);
message: '获取数据失败',
});
} }
} catch (error) { // console.log(orderDetail.value);
} else {
ElMessage({ ElMessage({
message: '发生错误', message: '获取数据失败',
}); });
} }
} catch (error) {
ElMessage({
message: '发生错误',
});
} }
const delBatch =()=>{ }
// const delBatch =()=>{
//
}
const showDetail = (index: number, row: any , flag : number) => {
title.value = "订单详情"
DialogVisible.value = true;
editForm.value = row;
};
const deleteProduct = async (index: number) => {
// console.log(typeof index)
const res = await myAxios.post('/goods/delete', { id: index })
console.log(res)
if (res.data.code === 1) {
ElMessage({
type: 'success',
message: '删除成功',
})
getOrderList()
} }
const showDetail = (index: number, row: any , flag : number) => { }
title.value = "订单详情" const reset = () => {
DialogVisible.value = true; name.value = '';
editForm.value = row;
}; };
const deleteProduct = async (index: number) => { const load =()=>{}
// console.log(typeof index) </script>
const res = await myAxios.post('/goods/delete', { id: index })
console.log(res) <style lang="scss" scoped>
if (res.data.code === 1) {
ElMessage({ </style>
type: 'success',
message: '删除成功',
})
getOrderList()
}
}
const reset = () => {
name.value = '';
};
const load =()=>{}
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,202 +1,167 @@
<template> <template>
<div> <!--<div>-->
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称" <!-- <el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称"-->
v-model="id"></el-input> <!-- v-model="id"></el-input>-->
<el-button class="ml-5" type="primary" @click="load" style="height: 25px;">搜索</el-button> <!-- <el-button class="ml-5" type="primary" @click="load" style="height: 25px;">搜索</el-button>-->
<el-button type="warning" @click="reset" style="height:25px">重置</el-button> <!-- <el-button type="warning" @click="reset" style="height:25px">重置</el-button>-->
</div> <!--</div>-->
<div style="margin: 15px 0"> <!-- <div style="margin: 15px 0">-->
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red" <!-- <el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"-->
title="您确定批量删除这些数据吗?" @confirm="delBatch" width=180> <!-- title="您确定批量删除这些数据吗?" @confirm="delBatch" width=180>-->
<template #reference> <!-- <template #reference>-->
<el-button style="height: 25px" class="ml-5" type="danger">批量删除 <el-icon style="margin-left: 5px;"> <!-- <el-button style="height: 25px" class="ml-5" type="danger">批量删除 <el-icon style="margin-left: 5px;">-->
<Remove /> <!-- <Remove />-->
</el-icon></el-button> <!-- </el-icon></el-button>-->
</template> <!-- </template>-->
</el-popconfirm> <!-- </el-popconfirm>-->
</div> <!-- </div>-->
<el-table :data="tableData" border stripe header-cell-class-name="headerBg" <!-- <el-table :data="tableData" border stripe header-cell-class-name="headerBg"-->
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange" <!-- :cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"-->
:header-cell-style="{ 'text-align': 'center' }"> <!-- :header-cell-style="{ 'text-align': 'center' }">-->
<el-table-column type="selection" width="55"></el-table-column> <!-- <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="id" label="订单id" width="80"></el-table-column>-->
<el-table-column prop="goodSnapshot.name" label="商品名称"></el-table-column> <!-- <el-table-column prop="" label="购买商品名称"></el-table-column>-->
<el-table-column prop="quantity" label="购买数量" width="180"></el-table-column> <!-- <el-table-column prop="" label="购买数量" width="180"></el-table-column>-->
<el-table-column prop="totalAmount" label="订单总金额"></el-table-column> <!-- <el-table-column prop="totalAmount" label="订单总金额"></el-table-column>-->
<el-table-column prop="createTime" label="下单时间"></el-table-column> <!-- <el-table-column prop="" label="下单时间"></el-table-column>-->
<el-table-column prop="orderNumber" label="快递单号"></el-table-column> <!-- <el-table-column prop="" label="快递单号"></el-table-column>-->
<el-table-column prop="orderStatus" label="订单状态"></el-table-column> <!-- <el-table-column prop="orderStatus" label="订单状态"></el-table-column>-->
<el-table-column label="操作" width="250px"> <!-- <el-table-column label="操作" width="250px">-->
<template #default="scope"> <!-- <template #default="scope">-->
<el-button size="small" @click="ReviseOrView(scope.$index, scope.row , 0)"> <!-- <el-button size="small" @click="ReviseOrView(scope.$index, scope.row , 0)">-->
编辑 <!-- 编辑-->
</el-button> <!-- </el-button>-->
<el-button plain @click="dialogFormVisible = true"> <!-- <el-button plain @click="dialogFormVisible = true">-->
发货 <!-- 发货-->
</el-button> <!-- </el-button>-->
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red" <!-- <el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"-->
title="是否确认删除" @confirm="deleteProduct(scope.row.id)" width=180> <!-- title="是否确认删除" @confirm="deleteProduct(scope.row.id)" width=180>-->
<template #reference> <!-- <template #reference>-->
<el-button class="ml-5" type="danger">取消订单</el-button> <!-- <el-button class="ml-5" type="danger">取消订单</el-button>-->
</template> <!-- </template>-->
</el-popconfirm> <!-- </el-popconfirm>-->
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red" <!-- <el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red"-->
title="您确定删除吗?"> <!-- title="您确定删除吗?">-->
</el-popconfirm> <!-- </el-popconfirm>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> <!-- </el-table>-->
<div style="padding: 10px 0"> <!-- <div style="padding: 10px 0">-->
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"-->
:current-page="searchParams.current" :page-size="searchParams.pageSize" :page-sizes="[5, 10, 15, 20]" <!-- :current-page="searchParams.current" :page-size="searchParams.pageSize" :page-sizes="[5, 10, 15, 20]"-->
:small="null" :disabled="null" :background="null" layout="total, sizes, prev, pager, next, jumper" <!-- :small="null" :disabled="null" :background="null" layout="total, sizes, prev, pager, next, jumper"-->
:total="total" /> <!-- :total="total" />-->
</div> <!-- </div>-->
<!-- <el-dialog v-model="dialogFormVisible" title="Shipping address" width="500">--> <!-- <el-dialog v-model="dialogFormVisible" title="Shipping address" width="500">-->
<!-- <el-form :model="">--> <!-- <el-form :model=" null">-->
<!-- <el-form-item label="快递单号" :label-width="formLabelWidth">--> <!-- <el-form-item label="快递单号" :label-width="formLabelWidth">-->
<!-- <el-input v-model=" " autocomplete="off" />--> <!-- <el-input v-model=" null" autocomplete="off" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-form>--> <!-- </el-form>-->
<!-- <template #footer>--> <!-- <template #footer>-->
<!-- <div class="dialog-footer">--> <!-- <div class="dialog-footer">-->
<!-- <el-button @click="dialogFormVisible = false">取消</el-button>--> <!-- <el-button @click="dialogFormVisible = false">取消</el-button>-->
<!-- <el-button type="primary" @click="dialogFormVisible = false">--> <!-- <el-button type="primary" @click="dialogFormVisible = false">-->
<!-- 确定--> <!-- 确定-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- </div>--> <!-- </div>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-dialog>--> <!-- </el-dialog>-->
</template> </template>
<script lang="ts" setup> <!--<script lang="ts" setup>-->
import {ref,onMounted} from "vue"; <!--import {ref} from "vue";-->
import myAxios from "@/api/myAxios"; <!--import myAxios from "@/api/myAxios";-->
import {ElMessage} from "element-plus"; <!--import {ElMessage} from "element-plus";-->
const tableData : any= ref([]); <!--const tableData : any= ref([]);-->
const total = ref(0); <!--const total = ref(0);-->
const num = ref(0) <!--// const title = ref('')-->
const dialogFormVisible = ref(false) <!--// const editForm : any = ref({});-->
const formLabelWidth = '140px' <!--// const DialogVisible = ref(true);-->
onMounted(()=>{ <!--const dialogFormVisible = ref(false)-->
getOrderList() <!--const formLabelWidth = '140px'-->
}) <!--const searchParams: any = ref({ //-->
<!-- current: 1, //-->
const searchParams: any = ref({ // <!-- pageSize: 5 //-->
current: 1, // <!--})-->
pageSize: 5 // <!--const handleSizeChange = (newSize: any) => {-->
}) <!-- searchParams.value.pageSize = newSize //-->
const handleSizeChange = (newSize: any) => { <!-- getOrderList()-->
searchParams.value.pageSize = newSize // <!--}-->
getOrderList() <!--const handleCurrentChange = (Current: any) => {-->
} <!-- searchParams.value.current = Current-->
const handleCurrentChange = (Current: any) => { <!-- getOrderList()-->
searchParams.value.current = Current <!--}-->
getOrderList() <!--const handleSelectionChange = (row: any) => {-->
} <!-- id.value = JSON.parse(JSON.stringify(row));-->
const handleSelectionChange = (row: any) => { <!--}-->
// id.value = JSON.parse(JSON.stringify(row)); <!--const getOrderList = async () => {-->
} <!-- try {-->
const getOrderList = async () => { <!-- const res = await myAxios.post('', { ...searchParams.value });-->
try { <!-- if (res.data.code === 1) {-->
const res = await myAxios.post('/order/list/page', { ...searchParams.value }); <!-- tableData.value = res.data.data.records;-->
// console.log(res) <!-- total.value = parseInt(res.data.data.total)-->
if (res.data.code === 1) { <!-- } else {-->
tableData.value = res.data.data.records <!-- ElMessage({-->
total.value = parseInt(res.data.data.total) <!-- message: '获取数据失败',-->
for(let key in tableData.value) { <!-- });-->
num.value = parseInt(key) <!-- }-->
const resOrderDetail = await myAxios.post('/order/list/item',{id:tableData.value[key].id}) <!-- } catch (error) {-->
if( resOrderDetail.data.code === 1 ) { <!-- ElMessage({-->
tableData.value.goodSnapshot= resOrderDetail.data.data[key].goodSnapshot <!-- message: '发生错误',-->
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) <!--const orderList = ref({-->
} <!--id:'',-->
} <!--userId:'',-->
} else { <!--addressSnapshot:{-->
ElMessage({ <!--name:'',-->
message: '获取数据失败', <!--phone:'',-->
}); <!--region:'',-->
} <!--detailAddress:''-->
} catch (error) { <!--},-->
ElMessage({ <!--couponSnapshot:{-->
message: '发生错误', <!--name:'',-->
}); <!--conditionAmount:''-->
} <!--},-->
} <!--totalAmount:'',-->
<!--orderStatus:'',-->
<!--createTime:'',-->
// const getItemList = async (id: number) => { <!--updateTime:'',-->
// try { <!--isDelete:'',-->
// const res = await myAxios.post('/order/list/item', { id:tableData.value[key].id}); <!--orderNumber:''-->
// console.log(res) <!--})-->
// if (res.data.code === 1) { <!--const delBatch =()=>{-->
// tableData.value = res.data.data.records; <!-- //-->
// total.value = parseInt(res.data.data.total) <!--}-->
// } else { <!--//-->
// ElMessage({ <!--const shipments = (index: number, row: any , flag : number) => {-->
// message: '',
// }); <!--};-->
// } <!--//-->
// } catch (error) { <!--const ReviseOrView = (index: number, row: any , flag : number) => {-->
// ElMessage({
// message: '', <!--};-->
// }); <!--const deleteProduct = async (index: number) => {-->
// } <!-- console.log(typeof index)-->
// } <!-- const res = await myAxios.post('/goods/delete', { id: index })-->
<!-- console.log(res)-->
// const orderList = ref({ <!-- if (res.data.code === 1) {-->
// id:'', <!-- ElMessage({-->
// userId:'', <!-- type: 'success',-->
// addressSnapshot:{ <!-- message: '删除成功',-->
// name:'', <!-- })-->
// phone:'', <!-- getOrderList()-->
// region:'', <!-- }-->
// detailAddress:'' <!--}-->
// }, <!--const reset = () => {-->
// couponSnapshot:{ <!-- id.value = '';-->
// name:'',
// conditionAmount:'' <!--};-->
// }, <!--const load =()=>{}-->
// totalAmount:'', <!--</script>-->
// orderStatus:'',
// createTime:'', <!--<style lang="scss" scoped>-->
// updateTime:'',
// isDelete:'', <!--</style> -->
// orderNumber:''
// })
const delBatch =()=>{
//
}
//
const shipments = (index: number, row: any , flag : number) => {
};
//
const ReviseOrView = (index: number, row: any , flag : number) => {
};
const deleteProduct = async (index: number) => {
console.log(typeof index)
const res = await myAxios.post('/goods/delete', { id: index })
console.log(res)
if (res.data.code === 1) {
ElMessage({
type: 'success',
message: '删除成功',
})
getOrderList()
}
}
const reset = () => {
id.value = '';
};
const load =()=>{}
</script>
<style lang="scss" scoped>
</style>