Merge branch 'main' of http://154.8.193.216:3030/admin1/jiangchengfeiyi-Web
# Conflicts: # src/views/Orders/orderOperations.vue
This commit is contained in:
commit
63ad408e0c
|
@ -41,7 +41,7 @@
|
||||||
<el-sub-menu index="2">
|
<el-sub-menu index="2">
|
||||||
<template #title>
|
<template #title>
|
||||||
<el-icon><HomeFilled /></el-icon>
|
<el-icon><HomeFilled /></el-icon>
|
||||||
<span>商品管理</span>
|
<span>实体类商品管理</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-menu-item index="/AddProduct">
|
<el-menu-item index="/AddProduct">
|
||||||
|
@ -59,6 +59,22 @@
|
||||||
<span slot="title">类别管理</span>
|
<span slot="title">类别管理</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
|
|
||||||
|
<el-sub-menu index="3">
|
||||||
|
<template #title>
|
||||||
|
<el-icon><HomeFilled /></el-icon>
|
||||||
|
<span>服务类商品管理</span>
|
||||||
|
</template>
|
||||||
|
<el-menu-item index="/AddServiceProduct">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">添加服务类商品</span>
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item index="/ProductCenter">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">服务类商品中心</span>
|
||||||
|
</el-menu-item>
|
||||||
|
</el-sub-menu>
|
||||||
|
|
||||||
<el-sub-menu index="4">
|
<el-sub-menu index="4">
|
||||||
<template #title>
|
<template #title>
|
||||||
<el-icon><HomeFilled /></el-icon>
|
<el-icon><HomeFilled /></el-icon>
|
||||||
|
@ -74,21 +90,18 @@
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
|
|
||||||
<el-sub-menu index="3">
|
<el-sub-menu index="5">
|
||||||
<template #title>
|
<template #title>
|
||||||
<el-icon><HomeFilled /></el-icon>
|
<el-icon><HomeFilled/></el-icon>
|
||||||
<span>商品订单管理</span>
|
<span>商品订单管理</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-menu-item index="/OrderList">
|
<el-menu-item index="/OrderList">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
<span slot="title">商品订单列表</span>
|
<span slot="title">实体商品订单列表</span>
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item index="/orderOperations">
|
|
||||||
<el-icon><Menu /></el-icon>
|
|
||||||
<span slot="title">商品订单操作</span>
|
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
|
|
||||||
|
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
export const routes = [
|
export const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
|
@ -59,9 +61,14 @@ export const routes = [
|
||||||
component: ()=> import("../views/Coupons/CouponCenter.vue")
|
component: ()=> import("../views/Coupons/CouponCenter.vue")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/orderOperations',
|
path: '/AddServiceProduct',
|
||||||
name:'商品订单操作',
|
name: '添加服务类商品',
|
||||||
component: ()=> import("../views/Orders/orderOperations.vue")
|
componet: ()=> import("../views/ServiceType/AddServiceProduct.vue")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/ProductCenter',
|
||||||
|
name: '服务类商品管理中心',
|
||||||
|
componet: ()=> import("../views/ServiceType/ProductCenter.vue")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -33,7 +33,11 @@
|
||||||
: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="商品编号" width="80"></el-table-column>
|
<el-table-column prop="id" label="商品编号" width="80">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
{{ $index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="goodImg" label="商品图片">
|
<el-table-column prop="goodImg" label="商品图片">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div>
|
||||||
|
@ -177,7 +181,7 @@ import { ElMessage , type UploadProps , genFileId ,type UploadRawFile } from 'e
|
||||||
import { ref, onMounted, inject } from 'vue';
|
import { ref, onMounted, inject } from 'vue';
|
||||||
import myAxios from "@/api/myAxios";
|
import myAxios from "@/api/myAxios";
|
||||||
const total = ref(0); //总页数
|
const total = ref(0); //总页数
|
||||||
const id = ref([]);
|
const idList = ref([]);
|
||||||
const searchParams: any = ref({ //封装分页
|
const searchParams: any = ref({ //封装分页
|
||||||
current: 1, //当前页码
|
current: 1, //当前页码
|
||||||
pageSize: 5, //每页显示条数
|
pageSize: 5, //每页显示条数
|
||||||
|
@ -269,8 +273,10 @@ const deleteProduct = async (index: number) => {
|
||||||
}
|
}
|
||||||
getTypeList()
|
getTypeList()
|
||||||
}
|
}
|
||||||
|
//选中发生的方法--->将其赋值给批量删除的数组
|
||||||
const handleSelectionChange = (row: any) => {
|
const handleSelectionChange = (row: any) => {
|
||||||
id.value = JSON.parse(JSON.stringify(row));
|
idList.value = row.map((item : any)=>item.id)
|
||||||
|
// console.log('id->',productId.value);
|
||||||
};
|
};
|
||||||
//详情或编辑
|
//详情或编辑
|
||||||
const ReviseOrView = (index: number, row: any , flag : number) => {
|
const ReviseOrView = (index: number, row: any , flag : number) => {
|
||||||
|
@ -346,14 +352,27 @@ const handleChange = async (file: any, flag: number) => {
|
||||||
flag ? editForm.value.detailImg = res.data.data : editForm.value.goodImg = res.data.data
|
flag ? editForm.value.detailImg = res.data.data : editForm.value.goodImg = res.data.data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSearch = (data : String)=>{ //搜索按钮方法
|
const onSearch = (data : String)=>{ //搜索按钮方法
|
||||||
searchParams.value.name = data
|
searchParams.value.name = data
|
||||||
searchParams.value.current = 1
|
searchParams.value.current = 1
|
||||||
getProductList()
|
getProductList()
|
||||||
}
|
}
|
||||||
const delBatch =()=>{
|
|
||||||
//批量删除
|
//批量删除
|
||||||
|
const delBatch = async ()=>{
|
||||||
|
console.log(idList.value);
|
||||||
|
const res = await myAxios.post('/goods/delBatch',{
|
||||||
|
idList: idList.value
|
||||||
|
})
|
||||||
|
console.log(res.data);
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '批量删除成功'
|
||||||
|
})
|
||||||
|
getProductList()
|
||||||
|
} else {
|
||||||
|
ElMessage.error('删除失败')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const load =()=>{}
|
const load =()=>{}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -82,7 +82,7 @@ const typeForm = ref({
|
||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
//旗帜 表示点击添加类别(0) 和 点击修改类别两个状态(1),因为我们共用一个表格
|
//旗帜 表示点击添加类别(0) 和 点击修改类别两个状态(1),因为我们共用一个表格
|
||||||
const flag = ref(0)
|
const flag = ref(0)
|
||||||
|
const typeList = ref([])
|
||||||
//老套路 页面加载必须获取类别列表
|
//老套路 页面加载必须获取类别列表
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTypeList()
|
getTypeList()
|
||||||
|
@ -209,6 +209,13 @@ const Delete_type = async (index: number) => {
|
||||||
}
|
}
|
||||||
getTypeList()
|
getTypeList()
|
||||||
}
|
}
|
||||||
|
//批量删除类别
|
||||||
|
const delBatch = async ()=>{
|
||||||
|
console.log(typeList.value);
|
||||||
|
const res = await myAxios.post('/goods/delBatch',{
|
||||||
|
idList: typeList.value
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
|
@ -148,7 +148,9 @@ const fileSimple = ref()
|
||||||
const disabled = ref(true)
|
const disabled = ref(true)
|
||||||
const searchParams: any = ref({ //分页
|
const searchParams: any = ref({ //分页
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 5
|
pageSize: 5,
|
||||||
|
sortField: "id", //根据ID分类
|
||||||
|
sortOrder: "descend" //降序
|
||||||
})
|
})
|
||||||
//删除图片
|
//删除图片
|
||||||
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
|
|
|
@ -5,25 +5,19 @@
|
||||||
<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">
|
|
||||||
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
|
|
||||||
title="您确定批量删除这些数据吗?" @confirm="delBatch" width=180>
|
|
||||||
<template #reference>
|
|
||||||
<el-button style="height: 25px" class="ml-5" type="danger">批量删除 <el-icon style="margin-left: 5px;">
|
|
||||||
<Remove />
|
|
||||||
</el-icon></el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
</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" fixed="left"></el-table-column>
|
<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="id" label="订单序号" width="80">
|
||||||
<el-table-column prop="userId" label="用户id"></el-table-column>
|
<template #default="{ $index }">
|
||||||
<el-table-column prop="userName" label="用户名" width="100"></el-table-column>
|
{{ $index + 1 }}
|
||||||
<el-table-column prop="orderNumber" label="订单编号" width="150"></el-table-column>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="orderNumber" label="订单编号" width="180"></el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="下单时间" width="180"></el-table-column>
|
||||||
|
<el-table-column prop="userName" label="用户名" width="80"></el-table-column>
|
||||||
<el-table-column label="所购买的商品" width="100">
|
<el-table-column label="所购买的商品" width="100">
|
||||||
<el-table-column label="展开所有商品" type="expand" width="100">
|
<el-table-column label="展开所有商品" type="expand" width="100">
|
||||||
<template #default="props">
|
<template #default="props">
|
||||||
|
@ -47,9 +41,9 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="地址信息快照" width="180">
|
<el-table-column label="地址信息快照" width="180">
|
||||||
<el-table-column prop="addressSnapshot.name" label="收货人" />
|
<el-table-column prop="addressSnapshot.name" label="收货人" />
|
||||||
<el-table-column prop="addressSnapshot.phone" label="手机号" />
|
<el-table-column prop="addressSnapshot.phone" label="手机号" width="180"/>
|
||||||
<el-table-column prop="addressSnapshot.region" label="地区" />
|
<el-table-column prop="addressSnapshot.region" label="地区" width="180"/>
|
||||||
<el-table-column prop="addressSnapshot.detailAddress" label="详细地址" />
|
<el-table-column prop="addressSnapshot.detailAddress" label="详细地址" width="180"/>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="优惠卷信息快照" width="50">
|
<el-table-column label="优惠卷信息快照" width="50">
|
||||||
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
|
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
|
||||||
|
@ -60,13 +54,13 @@
|
||||||
<el-table-column prop="orderStatus" label="快递单号"></el-table-column>
|
<el-table-column prop="orderStatus" label="快递单号"></el-table-column>
|
||||||
<el-table-column label="操作" width="220px" fixed="right">
|
<el-table-column label="操作" width="220px" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" @click="showDetail(scope.$index, scope.row, 0)">
|
<el-button size="small" @click="showDetail(scope.$index, scope.row)">
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="small" @click="">
|
<el-button size="small" @click="deliverGoods(scope.row)">
|
||||||
发货
|
发货
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="small" @click="" type="warning" plain>
|
<el-button size="small" @click="deleteOrder(scope.row)" type="warning" plain>
|
||||||
取消订单
|
取消订单
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -78,55 +72,47 @@
|
||||||
: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 title="订单详情信息" v-model="orderList" width="60%">
|
<el-dialog title="订单详情信息" v-model="DialogVisible" width="60%">
|
||||||
<el-form label-width="100px" size="default">
|
<el-form label-width="100px" size="default" :model="editForm">
|
||||||
<el-form-item label="订单id">
|
<el-form-item label="订单编号">
|
||||||
<el-input v-model="orderList.id" autocomplete="off"></el-input>
|
<el-input v-model="editForm.addressSnapshot" 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>
|
||||||
<el-form-item label="用户名称">
|
<el-form-item label="用户名称">
|
||||||
<el-input v-model="orderList.addressSnapshot.name" autocomplete="off"></el-input>
|
<el-input v-model="editForm.addressSnapshot.name" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="订单编号">
|
<el-form-item label="收货手机">
|
||||||
<el-input v-model="orderList.addressSnapshot" autocomplete="off"></el-input>
|
<el-input v-model="editForm.addressSnapshot.phone" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="收货地址">
|
<el-form-item label="收货地址">
|
||||||
<el-input v-model="orderList.addressSnapshot.region" autocomplete="off"></el-input>
|
<el-input v-model="editForm.addressSnapshot.region" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="详细地址">
|
<!-- 这里的商品明细就不放图片了 -->
|
||||||
<el-input v-model="orderList.addressSnapshot.detailAddress" autocomplete="off"></el-input>
|
<el-form-item label="商品明细">
|
||||||
</el-form-item>
|
<el-input v-model="editForm.addressSnapshot.detailAddress" autocomplete="off"></el-input>
|
||||||
<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>
|
||||||
<el-form-item label="订单总金额">
|
<el-form-item label="订单总金额">
|
||||||
<el-input v-model="orderList.totalAmount" autocomplete="off"></el-input>
|
<el-input v-model="editForm.totalAmount" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="订单状态">
|
<el-form-item label="订单状态">
|
||||||
<el-input v-model="orderList.orderStatus" autocomplete="off"></el-input>
|
<el-input v-model="editForm.orderStatus" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="快递单号">
|
||||||
|
<!-- <el-input v-model="editForm.totalAmount" autocomplete="off"></el-input> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="创建时间">
|
<el-form-item label="创建时间">
|
||||||
<el-input v-model="orderList.createTime" autocomplete="off"></el-input>
|
<el-input v-model="editForm.createTime" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="更新时间">
|
<el-form-item label="更新时间">
|
||||||
<el-input v-model="orderList.updateTime" autocomplete="off"></el-input>
|
<el-input v-model="editForm.updateTime" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button style="height: 30px;" @click="dialogFormVisible = false">取消</el-button>
|
<el-button style="height: 30px;" @click="DialogVisible = false">取消</el-button>
|
||||||
<el-button style="height: 30px" type="primary" @click=save>确认</el-button>
|
<el-button style="height: 30px" type="primary" @click="DialogVisible = false">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog> -->
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -136,13 +122,16 @@ import { ElMessage } from "element-plus";
|
||||||
const tableData: any = ref([]); //表单展示数据
|
const tableData: any = ref([]); //表单展示数据
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const editForm: any = ref({});
|
const editForm: any = ref({}); //编辑表单
|
||||||
const DialogVisible = ref(true);
|
const DialogVisible = ref(false); //详情展示
|
||||||
const name = ref('')
|
const name = ref('')
|
||||||
const searchParams: any = ref({ //封装分页
|
const searchParams: any = ref({ //封装分页
|
||||||
current: 1, //当前页码
|
current: 1, //当前页码
|
||||||
pageSize: 5 //每页显示条数
|
pageSize: 5, //每页显示条数
|
||||||
|
sortField: "id", //根据ID分类
|
||||||
|
sortOrder: "descend" //降序
|
||||||
})
|
})
|
||||||
|
const id = ref({})
|
||||||
const num = ref(0)
|
const num = ref(0)
|
||||||
const orderDetail: any = ref([]) //订单中的商品明细,多个商品
|
const orderDetail: any = ref([]) //订单中的商品明细,多个商品
|
||||||
//订单列表
|
//订单列表
|
||||||
|
@ -165,11 +154,11 @@ const handleSelectionChange = (row: any) => {
|
||||||
const getOrderList = async () => {
|
const getOrderList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
|
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
|
||||||
console.log('订单信息--->', res.data.data);
|
// console.log('订单信息--->', res.data.data);
|
||||||
if (res.data.code === 1) {
|
if (res.data.code === 1) {
|
||||||
tableData.value = res.data.data.records;
|
tableData.value = res.data.data.records;
|
||||||
total.value = parseInt(res.data.data.total)
|
total.value = parseInt(res.data.data.total)
|
||||||
console.log('表单信息--->', tableData.value[0].orderItemList);
|
// console.log('表单信息--->', tableData.value);
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '获取数据失败',
|
message: '获取数据失败',
|
||||||
|
@ -181,17 +170,33 @@ const getOrderList = async () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const delBatch = () => {
|
//查看订单详情
|
||||||
//批量删除
|
const showDetail = (index: number, row: any) => {
|
||||||
}
|
|
||||||
const showDetail = (index: number, row: any, flag: number) => {
|
|
||||||
title.value = "订单详情"
|
title.value = "订单详情"
|
||||||
DialogVisible.value = true;
|
DialogVisible.value = true;
|
||||||
editForm.value = row;
|
editForm.value = row;
|
||||||
|
console.log('editForm--->',editForm.value);
|
||||||
};
|
};
|
||||||
const deleteProduct = async (index: number) => {
|
//发货方法
|
||||||
|
const deliverGoods = async (row : any)=>{
|
||||||
|
// console.log('status--->',row.id);
|
||||||
|
const res = await myAxios.post('/order/update',{
|
||||||
|
id: row.id,
|
||||||
|
orderStatus: "已发货"
|
||||||
|
})
|
||||||
|
//发货要改的,要有弹窗填写快递单号
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '发货成功'
|
||||||
|
})
|
||||||
|
getOrderList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//取消订单
|
||||||
|
const deleteOrder = async (row : any) => {
|
||||||
// console.log(typeof index)
|
// console.log(typeof index)
|
||||||
const res = await myAxios.post('/goods/delete', { id: index })
|
const res = await myAxios.post('/goods/delete', { id: row.id })
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.data.code === 1) {
|
if (res.data.code === 1) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
@ -206,6 +211,10 @@ const reset = () => {
|
||||||
|
|
||||||
};
|
};
|
||||||
const load = () => { }
|
const load = () => { }
|
||||||
|
//保存订单状态
|
||||||
|
const save =()=>{
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
|
@ -1,206 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称"
|
|
||||||
v-model="id"></el-input>
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div style="margin: 15px 0">
|
|
||||||
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
|
|
||||||
title="您确定批量删除这些数据吗?" @confirm="delBatch" width=180>
|
|
||||||
<template #reference>
|
|
||||||
<el-button style="height: 25px" class="ml-5" type="danger">批量删除 <el-icon style="margin-left: 5px;">
|
|
||||||
<Remove />
|
|
||||||
</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"></el-table-column>
|
|
||||||
<el-table-column prop="id" label="订单id" width="80"></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>
|
|
||||||
<el-table-column prop="orderNumber" label="快递单号"></el-table-column>
|
|
||||||
<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 plain @click="dialogFormVisible = true">
|
|
||||||
发货
|
|
||||||
</el-button>
|
|
||||||
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
|
|
||||||
title="是否确认删除" @confirm="deleteProduct(scope.row.id)" width=180>
|
|
||||||
<template #reference>
|
|
||||||
<el-button class="ml-5" type="danger">取消订单</el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red"
|
|
||||||
title="您确定删除吗?">
|
|
||||||
</el-popconfirm>
|
|
||||||
</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 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>
|
|
||||||
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 order = ref(
|
|
||||||
{
|
|
||||||
orderNumber:0,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
const dialogFormVisible = ref(false)
|
|
||||||
const formLabelWidth = '140px'
|
|
||||||
onMounted(()=>{
|
|
||||||
getOrderList()
|
|
||||||
})
|
|
||||||
|
|
||||||
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.data.data)
|
|
||||||
if (res.data.code === 1) {
|
|
||||||
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)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
} 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:'',
|
|
||||||
// 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) => {
|
|
||||||
|
|
||||||
};
|
|
||||||
//编辑
|
|
||||||
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>
|
|
13
src/views/ServiceType/AddServiceProduct.vue
Normal file
13
src/views/ServiceType/AddServiceProduct.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
13
src/views/ServiceType/ProductCenter.vue
Normal file
13
src/views/ServiceType/ProductCenter.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,252 +1,41 @@
|
||||||
<template>
|
<template>
|
||||||
switch parent border: <el-switch v-model="parentBorder" /> switch child
|
<div>
|
||||||
border: <el-switch v-model="childBorder" />
|
<span
|
||||||
<el-table :data="tableData" :border="parentBorder" style="width: 100%">
|
:style="getStyle(1)"
|
||||||
<el-table-column type="expand">
|
@click="selectText(1)"
|
||||||
<template #default="props">
|
>
|
||||||
<div m="4">
|
文字1
|
||||||
<p m="t-0 b-2">State: {{ props.row.state }}</p>
|
</span>
|
||||||
<p m="t-0 b-2">City: {{ props.row.city }}</p>
|
<span
|
||||||
<p m="t-0 b-2">Address: {{ props.row.address }}</p>
|
:style="getStyle(2)"
|
||||||
<p m="t-0 b-2">Zip: {{ props.row.zip }}</p>
|
@click="selectText(2)"
|
||||||
<h3>Family</h3>
|
>
|
||||||
<el-table :data="props.row.family" :border="childBorder">
|
文字2
|
||||||
<el-table-column label="Name" prop="name" />
|
</span>
|
||||||
<el-table-column label="State" prop="state" />
|
|
||||||
<el-table-column label="City" prop="city" />
|
|
||||||
<el-table-column label="Address" prop="address" />
|
|
||||||
<el-table-column label="Zip" prop="zip" />
|
|
||||||
</el-table>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="Date" prop="date" />
|
|
||||||
<el-table-column label="Name" prop="name" />
|
|
||||||
</el-table>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const parentBorder = ref(false)
|
const selectedText = ref(1); // 用来存储选中的文字
|
||||||
const childBorder = ref(false)
|
|
||||||
const tableData = [
|
// 根据选中状态动态返回样式
|
||||||
{
|
const getStyle = (textNum) => {
|
||||||
date: '2016-05-03',
|
return {
|
||||||
name: 'Tom',
|
'border-bottom': selectedText.value === textNum ? '2px solid black' : 'none',
|
||||||
state: 'California',
|
'cursor': 'pointer'
|
||||||
city: 'San Francisco',
|
};
|
||||||
address: '3650 21st St, San Francisco',
|
};
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
const selectText = (textNum) => {
|
||||||
{
|
selectedText.value = textNum; // 更新选中的文字
|
||||||
name: 'Jerry',
|
};
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-02',
|
|
||||||
name: 'Tom',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
|
||||||
{
|
|
||||||
name: 'Jerry',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-04',
|
|
||||||
name: 'Tom',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
|
||||||
{
|
|
||||||
name: 'Jerry',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-01',
|
|
||||||
name: 'Tom',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
|
||||||
{
|
|
||||||
name: 'Jerry',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-08',
|
|
||||||
name: 'Tom',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
|
||||||
{
|
|
||||||
name: 'Jerry',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-06',
|
|
||||||
name: 'Tom',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
|
||||||
{
|
|
||||||
name: 'Jerry',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-07',
|
|
||||||
name: 'Tom',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
family: [
|
|
||||||
{
|
|
||||||
name: 'Jerry',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Spike',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tyke',
|
|
||||||
state: 'California',
|
|
||||||
city: 'San Francisco',
|
|
||||||
address: '3650 21st St, San Francisco',
|
|
||||||
zip: 'CA 94114',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
span {
|
||||||
|
margin-right: 10px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user