cloud-web/src/views/market/orders/index.vue

212 lines
5.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
prop="date"
label="日期"
width="150">
</el-table-column>
<el-table-column label="购买信息">
<el-table-column
prop="name"
label="账号"
width="120">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="120">
</el-table-column>
<el-table-column label="购买详情">
<el-table-column
prop="province"
label="购买接口"
width="120">
</el-table-column>
<el-table-column
prop="city"
label="购买类型"
width="120">
</el-table-column>
<el-table-column
prop="address"
label="购买方式"
width="300">
</el-table-column>
<el-table-column
prop="zip"
label="总金额"
width="120">
</el-table-column>
<el-table-column
prop="zip"
label="是否已经完成付款"
width="120">
</el-table-column>
</el-table-column>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { selectList, update } from '@/api/market/orders'
import {handleDelete} from "@/api/market/product";
import { diGui } from "@/api/market/orders";
//这里可以导入其他文件比如组件工具js第三方插件jsjson文件图片文件等等,
//例如import 《组件名称》 from '《组件路径》,
import axios from 'axios'; // 假设你正在使用axios进行HTTP请求
export default {
dicts:[''],
//import引入的组件需要注入到对象中才能使用"
components: {},
props: {},
data() {
return {
orders:{
pageNum:1,
pageSize:5,
total:1,
typeId:0
},
tableData: [], // 初始化为空数组,等待异步数据填充
arr:[],
type:[],
Cascader:{ expandTrigger:'hover',value:'id',label:'typeName',children:'parentPOS' },
typeId:[]
};
},
//计算属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {},
//方法集合",
methods: {
// 商品分类下拉框
shopTypeId(){
for (let i = 0; i < this.typeId.length; i++) {
this.orders.typeId=this.typeId[i]
}
},
/**递归*/
diGui(){
diGui(this.orders.typeId).then(
res => {
this.type=res.data
}
)
},
// 删除
handleDelete(orders){
handleDelete(orders.id).then(
res => {
this.$message.success(res.msg)
this.page()
}
)
},
// 重置
chong(){
this.orders={}
this.page()
},
// 分页
handleSizeChange(val) {
this.orders.pageSize=val
this.page()
},
handleCurrentChange(val) {
this.orders.pageNum=val
this.page()
},
// 上架,新品,推荐修改
updateShop(orders){
update(orders).then(
res => {
this.$message.success(res.msg)
this.page()
}
)
},
// 修改跳转路径
handleEdit(orders){
if (this.orders.serviceIds && typeof this.orders.serviceIds === 'string') {
orders.serviceid = this.orders.serviceIds.split(',');
// ... 后续操作
}
console.log(JSON.stringify(orders))
orders.serviceid=orders.serviceIds.split(',').map(id => parseInt(id, 10));
console.log(JSON.stringify(orders))
this.$router.push({path:'/product/info/update',query:{orders:orders}})
},
// 查询
findShop(){
this.page()
},
// 添加跳转路径
add(){
this.$router.push('index')
},
// 多选框
handleSelectionChange(val) {
this.multipleSelection = val;
},
//商品列表
// selectList(){
// selectList(this.orders).then(
// res => {
// console.log(res)
// this.arr=res.data.list
// this.orders.total=res.data.total
// }
// )
// }.
selectList(){
selectList().then(
res=>{
this.typeList = res.data
}
)
}
},
//生命周期 - 创建完成可以访问当前this实例",
created() {
this.selectList()
this.diGui()
this.fetchData(); // 组件创建后立即获取数据
},
//生命周期 - 挂载完成可以访问DOM元素",
mounted() {
},
beforeCreate() {
}, //生命周期 - 创建之前",
beforeMount() {
}, //生命周期 - 挂载之前",
beforeUpdate() {
}, //生命周期 - 更新之前",
updated() {
}, //生命周期 - 更新之后",
beforeDestroy() {
}, //生命周期 - 销毁之前",
destroyed() {
}, //生命周期 - 销毁完成",
activated() {
} //如果页面有keep-alive缓存功能这个函数会触发",
};
</script>
<style scoped>
</style>