解决前面的bug
This commit is contained in:
parent
6bd1d4f49f
commit
771cd1ede2
|
@ -67,101 +67,136 @@
|
|||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!--</template>-->
|
||||
</template>
|
||||
|
||||
<!--<script lang="ts" setup>-->
|
||||
<!--import {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 dialogFormVisible = ref(false)-->
|
||||
<!--const formLabelWidth = '140px'-->
|
||||
<!--const searchParams: any = ref({ //封装分页-->
|
||||
<!-- current: 1, //当前页码-->
|
||||
<!-- pageSize: 5 //每页显示条数-->
|
||||
<!--})-->
|
||||
<!--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('', { ...searchParams.value });-->
|
||||
<!-- 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 orderList = ref({-->
|
||||
<!--id:'',-->
|
||||
<!--userId:'',-->
|
||||
<!--addressSnapshot:{-->
|
||||
<!--name:'',-->
|
||||
<!--phone:'',-->
|
||||
<!--region:'',-->
|
||||
<!--detailAddress:''-->
|
||||
<!--},-->
|
||||
<!--couponSnapshot:{-->
|
||||
<!--name:'',-->
|
||||
<!--conditionAmount:''-->
|
||||
<!--},-->
|
||||
<!--totalAmount:'',-->
|
||||
<!--orderStatus:'',-->
|
||||
<!--createTime:'',-->
|
||||
<!--updateTime:'',-->
|
||||
<!--isDelete:'',-->
|
||||
<!--orderNumber:''-->
|
||||
<!--})-->
|
||||
<!--const delBatch =()=>{-->
|
||||
<!-- //批量取消-->
|
||||
<!--}-->
|
||||
<!--//发货-->
|
||||
<!--const shipments = (index: number, row: any , flag : number) => {-->
|
||||
<script lang="ts" setup>
|
||||
import {ref,onMounted} from "vue";
|
||||
import myAxios from "@/api/myAxios";
|
||||
import {ElMessage} from "element-plus";
|
||||
const tableData : any= ref([]);
|
||||
const total = ref(0);
|
||||
const num = ref(0)
|
||||
const dialogFormVisible = ref(false)
|
||||
const formLabelWidth = '140px'
|
||||
onMounted(()=>{
|
||||
getOrderList()
|
||||
})
|
||||
|
||||
<!--};-->
|
||||
<!--//编辑-->
|
||||
<!--const ReviseOrView = (index: number, row: any , flag : number) => {-->
|
||||
const searchParams: any = ref({ //封装分页
|
||||
current: 1, //当前页码
|
||||
pageSize: 5 //每页显示条数
|
||||
})
|
||||
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)
|
||||
if (res.data.code === 1) {
|
||||
tableData.value = res.data.data.records
|
||||
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)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '获取数据失败',
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: '发生错误',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
<!--};-->
|
||||
<!--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>-->
|
||||
// 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: '发生错误',
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
<!--<style lang="scss" scoped>-->
|
||||
// const orderList = ref({
|
||||
// id:'',
|
||||
// userId:'',
|
||||
// addressSnapshot:{
|
||||
// name:'',
|
||||
// phone:'',
|
||||
// region:'',
|
||||
// detailAddress:''
|
||||
// },
|
||||
// couponSnapshot:{
|
||||
// name:'',
|
||||
// conditionAmount:''
|
||||
// },
|
||||
// totalAmount:'',
|
||||
// orderStatus:'',
|
||||
// createTime:'',
|
||||
// updateTime:'',
|
||||
// isDelete:'',
|
||||
// orderNumber:''
|
||||
// })
|
||||
const delBatch =()=>{
|
||||
//批量取消
|
||||
}
|
||||
//发货
|
||||
const shipments = (index: number, row: any , flag : number) => {
|
||||
|
||||
<!--</style> -->
|
||||
};
|
||||
//编辑
|
||||
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>
|
Loading…
Reference in New Issue
Block a user