修改了禅道上的bug和一些在模拟演示过程中发生的bug,新增仪表盘和用户管理

This commit is contained in:
yuanteng 2025-03-13 07:10:56 +08:00
parent 1a336b2dac
commit 94180edc34
17 changed files with 202 additions and 228 deletions

View File

@ -4,8 +4,8 @@ import router from '../router'
const myAxios = axios.create({
withCredentials:true,
baseURL: 'http://localhost:9092/api'
// baseURL: 'http://123.249.108.160:8888/api' //测试服务器
// baseURL: 'http://localhost:9092/api'
baseURL: 'http://123.249.108.160:8888/api' //测试服务器
// baseURL: 'http://154.8.193.216:9092/api', //隋雨霏服务器
// baseURL: 'http://154.8.193.216:9093/api' //隋雨霏服务器测试环境
});

View File

@ -7,8 +7,8 @@
:collapse-transition="false"
text-color="#fff"
router
:default-active="currentRoute"
active-text-color="#ffd04b"
:default-openeds="['0']"
unique-opened
>
<div style="height: 80px; color: white; font-weight: bold;
@ -66,7 +66,7 @@
</template>
<script setup>
import {ref ,computed } from 'vue'
import {ref ,computed, onMounted } from 'vue'
import { defineProps } from 'vue';
import emitter from '@/utils/emitter'
import { useRouter } from 'vue-router';
@ -93,7 +93,7 @@ import {
Tickets,
Money,
Odometer
} from "@element-plus/icons-vue";
} from "@element-plus/icons-vue";
defineProps(['send-data'])
const showLog = ref(true)
@ -104,6 +104,7 @@ const AsideObj = ref({
width: '250px'
})
emitter.on('Aside', (value) => {
showLog.value = value
if(showLog.value){
@ -121,8 +122,13 @@ emitter.on('Aside', (value) => {
//
const router = useRouter()
const currentRoute = router.currentRoute.value.fullPath //
// console.log('router--->',router.options.routes);
onMounted(()=>{
// console.log('uid--->',router.currentRoute.value.fullPath)
})
//
const iconComponents = {
House,

View File

@ -11,6 +11,7 @@
import '@wangeditor/editor/dist/css/style.css' // css
import { onBeforeUnmount, ref, shallowRef, onMounted, defineEmits, toRefs } from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import axios from "axios";
// shallowRef
const editorRef = shallowRef()
// HTML
@ -30,12 +31,13 @@ onMounted(() => {
const toolbarConfig = {}
const editorConfig = {
MENU_CONF: {}
}
editorConfig.MENU_CONF['uploadImage'] = {
placeholder: '请输入内容...',
MENU_CONF: {
uploadImage: {
server: 'http://localhost:9092/api/file/upload/single', //
fieldName: 'file', //
}
async customUploadImage(file, insertFn) {
const { data: res } = await axios.post('',{},{})
console.log('res--->',res)
}
}
//

View File

@ -2,21 +2,21 @@
<!-- 修改前请注释以前的 -->
<!-- 搜索 -->
<div>
<el-input style="width: 240px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称"
<el-input style="width: 240px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商品名称" size="default"
v-model="productName"></el-input>
<el-button class="ml-5" type="primary" @click="onSearch(productName)" style="height: 25px; margin-right: 10px;">
<el-button type="primary" @click="onSearch(productName)" style="margin-right: 10px;" size="default">
搜索
</el-button>
<el-select v-model="editForm.type" @change="(event: any) => searchByType(event)" placeholder="商品类别"
style="width: 240px; margin-right: 10px;">
<el-select v-model="productType" @change="(event: any) => searchByType(event)" placeholder="商品类别"
style="width: 240px; margin-right: 10px;" size="default" :clearable="true">
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value1"/>
</el-select>
<el-select v-model="state" placeholder="商品状态" @change="(event: any) => searchByState(event)"
<el-select v-model="state" placeholder="商品状态" @change="(event: any) => searchByState(event)" size="default"
style="width: 240px; margin-right: 10px;">
<el-option label="已上架" value="1"/>
<el-option label="已下架" value="0"/>
</el-select>
<el-button type="warning" @click="reset" style="height:25px">重置</el-button>
<el-button type="warning" @click="reset" size="default">重置</el-button>
</div>
<div style="margin: 15px 0">
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
@ -218,7 +218,7 @@ const typeList: any = ref([
label: ''
}
])
// const ImgArr: any = ref<UploadUserFile[]>([]) //
const productType = ref('') //
onMounted(() => { //
getProductList()
getTypeList()

View File

@ -104,7 +104,7 @@ const form = ref({
detailImg: '', //url
minNumber: 0, //
maxNumber: 0, //
effectImg: [""], //
effectImg: ["21312312312"], //
bookingDateAddRequestList: [] //
})
//
@ -138,7 +138,7 @@ const onSubmit = async () => {
const values : any = Object.values(form.value);
// 使some()
console.log(form.value.bookingDateAddRequestList)
if (values.some((value:any) => value === null || value === undefined || value === '' || value === 0) || form.value.bookingDateAddRequestList.length == 0) {
if (values.some((value:any) => value === null || value === undefined || value === '') || form.value.bookingDateAddRequestList.length == 0) {
ElMessage({
type: 'warning',
message: '请检查表单数据是否完整填写'

View File

@ -6,7 +6,7 @@
<el-form :model="typeForm" label-width="auto" style="max-width: 600px" v-loading="loading">
<el-form-item label="类别名">
<el-input v-model="typeForm.typeName" />
<el-input v-model="typeForm.name" />
</el-form-item>
<!-- <el-form-item label="备注">
<el-input v-model="typeForm.typeIntro" />
@ -57,7 +57,7 @@ const typeImg: any = ref<UploadUserFile[]>([]) //商品类别图片
//
const typeForm = ref({
id: 0,
typeName: '',
name: '',
// typeIntro: ''
})
//
@ -94,8 +94,8 @@ const cancel = () => {
//
const addOrUpdateType = async () => {
//(*)
if (typeForm.value.typeName?.indexOf(' ') !== -1 ||
typeForm.value.typeName == '' ) {
if (typeForm.value.name?.indexOf(' ') !== -1 ||
typeForm.value.name == '' ) {
ElMessage({
type: 'warning',
message: '不能为空格/空字符串'
@ -107,7 +107,7 @@ const addOrUpdateType = async () => {
if (flag.value === 0) {
const res = await myAxios.post('/photoCategory/add', {
//
name: typeForm.value.typeName,
name: typeForm.value.name,
// typeUrl: typeForm.value.typeUrl,
// typeIntro: typeForm.value.typeIntro
})
@ -122,7 +122,7 @@ const addOrUpdateType = async () => {
if( flag.value === 1 ) {
const res = await myAxios.post('/photoCategory/update',{
id : typeForm.value.id,
name: typeForm.value.typeName,
name: typeForm.value.name,
// typeUrl: typeForm.value.typeUrl,
// typeIntro: typeForm.value.typeIntro
})
@ -142,7 +142,7 @@ const addOrUpdateType = async () => {
const resetForm = () => {
typeForm.value = {
id: 0,
typeName: '',
name: '',
// typeUrl: '',
// typeIntro: ''
}
@ -157,7 +157,7 @@ const editShowForm = (index: number, row: any) => {
// url: row.typeUrl
// })
dialogVisible.value = true
typeForm.value = row
typeForm.value = JSON.parse(JSON.stringify(row))
flag.value = 1
console.log('本行--->',row)
}

View File

@ -2,11 +2,11 @@
<!-- 修改前请注释以前的 -->
<!-- 搜索 -->
<div style="display: flex; align-items: center">
<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="productName"></el-input>
<div>
<el-form-item label="" style="width: 200px; margin: 3px 10px 0 0;display: inline-block;">
<el-select size="default" v-model="state" placeholder="商品状态" @change="(event: any) => searchByState(event)">
<el-select size="default" v-model="state" placeholder="上架状态" @change="(event: any) => searchByState(event)">
<el-option label="已上架" value="1" />
<el-option label="已下架" value="0" />
</el-select>
@ -20,7 +20,7 @@
<template #label>
<span style="font-size: 16px; line-height: 36px">摄影服务</span>
</template>
<el-select v-model="value1" placeholder="请选择商品编号" @change="(event: any) => loadForm1(event)" :disabled="typeSelect" size="large">
<el-select v-model="value1" placeholder="选择摄影编号" @change="(event: any) => loadForm1(event)" :disabled="typeSelect" size="large">
<el-option v-for="item in keysArray" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
@ -29,7 +29,7 @@
<template #label>
<span style="font-size: 16px; line-height: 36px">妆造服务</span>
</template>
<el-select v-model="value2" placeholder="请选择商品编号" @change="(event: any) => loadForm2(event)" :disabled="typeSelect" size="large">
<el-select v-model="value2" placeholder="选择妆造编号" @change="(event: any) => loadForm2(event)" :disabled="typeSelect" size="large">
<el-option v-for="item in keysArray" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
@ -41,10 +41,10 @@
</div>
<div style="margin: 15px 0">
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
<el-popconfirm 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;">
<el-button style="height: 25px" type="danger">批量删除 <el-icon style="margin-left: 5px;">
<Remove />
</el-icon></el-button>
</template>
@ -58,19 +58,19 @@
:header-cell-style="{ 'text-align': 'center' }"
default-expand-all>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="id" label="课程编号" width="80">
<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">
<div>
<img :src="scope.row.introImg" alt="" style="height: 50px;">
</div>
</template>
</el-table-column>
<el-table-column prop="name" label="课程名称"></el-table-column>
<el-table-column prop="name" label="服装名称"></el-table-column>
<el-table-column prop="price" label="单次价格" width="100"></el-table-column>
<el-table-column label="展开时间段" type="expand" width="80">
<template #default="{ $index }">
@ -107,7 +107,7 @@
</el-table>
</template>
</el-table-column>
<el-table-column label="商品状态" width="80">
<el-table-column label="上架状态" width="80">
<template #default="scope">
<div>
<span style="margin-left: 10px" v-if="scope.row.isShelves == 1">上架</span>
@ -146,12 +146,12 @@
<!-- 编辑/详情表单 -->
<el-dialog v-model="DialogVisible" :title="title">
<el-form label-width="100px" :disabled="disabled">
<el-form-item label="商品编号">
<el-form-item label="服装编号">
<el-input v-model="editForm.id" disabled></el-input>
</el-form-item>
<el-form-item label="商品图片">
<el-form-item label="服装图片">
<div v-if="editForm.introImg">
<img :src="editForm.introImg" alt="商品图标" class="thumbnail" style="width: 100px; height: 100px;" />
<img :src="editForm.introImg" alt="服装图标" class="thumbnail" style="width: 100px; height: 100px;" />
</div>
<el-upload ref="uploadProductImg" action="#" list-type="picture-card" :auto-upload="false" multiple="true"
:on-remove="handleRemove" @change="(event: any) => handleChange(event, 0)" :on-exceed="Exceed_ProductImg"
@ -161,11 +161,12 @@
</el-icon>
</el-upload>
</el-form-item>
<el-form-item label="商品名称">
<el-form-item label="服装名称">
<el-input v-model="editForm.name"></el-input>
</el-form-item>
<el-form-item label="商品价格">
<el-input v-model="editForm.price"></el-input>
<el-form-item label="单次价格" prop="price">
<el-input-number v-model="editForm.price" min="0" :precision="2" :step="0.5" />
<p></p>
</el-form-item>
<el-form-item label="服装类别" prop="type" style="width: 240px;">
<el-select v-model="editForm.categoryName" placeholder="请选择" @change="(event: any) => loadCategory(event)">
@ -187,7 +188,7 @@
<el-option v-for="item in maxArr" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item label="商品图文">
<el-form-item label="详情图">
<div v-if="editForm.detailImg">
<img :src="editForm.detailImg" alt="商品图标" class="thumbnail" style="width: 100px; height: 100px;" />
</div>
@ -210,7 +211,7 @@
<!-- 时间段抽屉 -->
<el-drawer v-model="drawer" :title="'当前日期:'+drawerDate.specificDate + '&emsp;服装名称:' + outfitName" direction="ltr"
@closed="closedDrawer">
<div style="margin-bottom: 20px">选择当天时间段和人数</div>
<div style="margin-bottom: 20px">选择当天时间</div>
<div v-for="(item,index) in drawerDate.bookingTimeVOList" style="margin-bottom: 40px">
<div style="margin-bottom: 15px"><span>时间点</span></div>
<div style="display: flex;">
@ -225,7 +226,7 @@
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
title="是否确认删除" @confirm="subList(item, index)" width=180>
<template #reference>
<el-button type="danger">删除</el-button>
<el-button type="danger" v-if="index > 0">删除</el-button>
</template>
</el-popconfirm>
</div>
@ -254,6 +255,7 @@ import myAxios from "@/api/myAxios";
import outfitCalendarUtil from '@/layout/components/outfitCalendarUtil.vue';
import emitter from "@/utils/emitter";
import {form} from "@/utils/entityProduct/picUpload";
import {WarnInfo} from "@/utils/messageInfo";
const total = ref(0); //
const idList = ref<Number[]>([]); //
const searchParams: any = ref({ //
@ -335,6 +337,7 @@ const getOutfitList = async () => {
}
}
const saveEdit = async () => { //
console.log('写真信息--->',editForm.value)
const values : any = Object.values(editForm.value);
// 使some()
console.log(editForm.value.bookingDateAddRequestList)
@ -352,6 +355,7 @@ const saveEdit = async () => { //编辑商品
type: 'success',
message: '更新成功'
})
await getOutfitList()
} else {
ElMessage({
type: 'error',
@ -383,9 +387,9 @@ const deleteProduct = async (index: number) => {
//
const ReviseOrView = (index: number, row: any , flag : number) => {
//flag disabled
flag ? (title.value = "编辑商品" , disabled.value = false) : (title.value = "商品详情" , disabled.value = true)
flag ? (title.value = "编辑服装" , disabled.value = false) : (title.value = "服装详情" , disabled.value = true)
DialogVisible.value = true;
editForm.value = row;
editForm.value = JSON.parse(JSON.stringify(row));
// console.log('--->',editForm.value);
};
const getOutfitKind = async ()=> { //
@ -434,13 +438,13 @@ const reset = () => {
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles)
}
const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //
const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //
uploadProductImg.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadProductImg.value!.handleStart(file)
}
const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //
const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //
uploadProductDetail.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
@ -505,8 +509,8 @@ const openDrawer =(index : number,dateInfo : any)=>{ //抽屉打开方法
timePickArr.value.splice(0,timePickArr.value.length) //
drawerDate.value = dateInfo
InfoArr.value = dateInfo.bookingTimeVOList
console.log('抽屉中的时间信息---->',drawerDate.value);
dateInfo.bookingTimeVOList.forEach((item:any,index:number)=>{ //
// console.log('---->',drawerDate.value);
dateInfo.bookingTimeVOList.forEach((item:any,index:number)=>{ //
timeAbleArr.value[index] = true
timePickArr.value.push(item.timePoint)
})
@ -524,23 +528,20 @@ const addList = async ()=>{
let newIndex = drawerDate.value.bookingTimeVOList.length
console.log('drawerDate--->',drawerDate.value);
if(addbtnText.value === '添加时间') {
drawerDate.value.bookingTimeVOList.push({ //
id: 0,
drawerDate.value.bookingTimeVOList.push({ //
timePoint: ''
})
timePickArr.value.push([])
addbtnText.value = '保存时间'
} else { //''
addTimePoint(newIndex)
if(!judgeNull(drawerDate.value.bookingTimeVOList)) {
WarnInfo('填写时间')
return;
} else {
addTimePoint(newIndex) //
addbtnText.value = '添加时间'
}
}
if(!judgeNull(drawerDate.value.bookingTimeVOList)) {
ElMessage({
type: 'warning',
message: '填写时间段和人数'
})
return;
}
addbtnText.value = '添加时间'
}
const addTimePoint = async (newIndex: number) => { //
const res = await myAxios.post('/book/add/time',{
@ -610,14 +611,14 @@ const closedDrawer =()=>{ //完全关闭抽屉触发
timeAbleArr.value[index] = false
})
if(!judgeNull(drawerDate.value.bookingTimeVOList)) {
console.log('关闭抽屉的删除数组被激活');
// console.log('');
drawerDate.value.bookingTimeVOList.splice(newIndex-1,1)
}
addbtnText.value = '添加时间'
}
const deleteDate = async (id: number)=>{ //
console.log(id)
const res = await myAxios.post('/appointmentDate/del/id',{id:id})
const res = await myAxios.post('/book/del/id',{id:id})
// console.log('res--->',res);
if(res.data.code === 1) {
getOutfitList()

View File

@ -3,8 +3,8 @@
<div>
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入优惠券名称"
v-model="name"></el-input>
<el-button class="ml-5" type="primary" @click="load(name)" style="height: 25px;">搜索</el-button>
<el-button type="warning" @click="reset" style="height:25px">重置</el-button>
<el-button class="ml-5" type="primary" @click="load(name)" size="default">搜索</el-button>
<el-button type="warning" @click="reset" size="default">重置</el-button>
</div>
<!-- 批量删除-->
<div style="margin: 15px 0">
@ -187,7 +187,7 @@ const saveEdit = async () => { //编辑商品
const ReviseOrView = (index: number, row: any , flag : number) => {
flag ? (title.value = "编辑商品" , disabled.value = false) : (title.value = "商品详情" , disabled.value = true)
DialogVisible.value = true;
editForm.value = row;
editForm.value = JSON.parse(JSON.stringify(row));
};
const getCouponsList = async ()=> {
try {

View File

@ -129,6 +129,7 @@ const getDashBoard = async () => {
waitPayOrder.value = dashBord.get('所有待支付订单数量')
waitConsumption.value = dashBord.get('服务类待消费订单')
}
console.log(res.data.data)
}
</script>

View File

@ -13,17 +13,17 @@
<el-form :model="user" ref="userForm">
<el-form-item prop="username">
<h2>账号</h2>
<el-input size="medium" style="margin: 10px 0" prefix-icon="el-icon-user" v-model="username"></el-input>
<el-input size="large" style="margin: 10px 0" :prefix-icon="User" v-model="username"></el-input>
</el-form-item>
<el-form-item prop="password">
<h2>密码</h2>
<el-input size="medium" style="margin: 10px 0;" prefix-icon="el-icon-lock" show-password v-model="password"></el-input>
<el-input size="large" style="margin: 10px 0;" :prefix-icon="Lock" show-password v-model="password"></el-input>
</el-form-item>
<div style="margin: 10px 0; text-align: right">
<div style="display: block;
font-size: 15px;
width: 80%;
margin: 50px auto 0 auto;
margin: 35px auto 0 auto;
text-align: center;
border-radius: 20px;
background-color: rgb(172, 115, 82);
@ -43,13 +43,13 @@
import {useRouter} from 'vue-router'
import myAxios from '@/api/myAxios';
import { userStore } from '../store/userStore';
import { User , Lock} from '@element-plus/icons-vue'
const user = ref({})
const username = ref('')
const password = ref('')
const router = useRouter()
const store = userStore()
const Login = async ()=>{

View File

@ -55,20 +55,27 @@
<el-table-column prop="trackingNumber" label="快递单号"></el-table-column>
<el-table-column label="操作" width="220px" fixed="right">
<template #default="scope">
<el-button v-if="['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>
取消订单
</el-button>
<el-button size="small" @click="showDetail(scope.$index, scope.row)">
详情
</el-button>
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small"
@click="openShipmentDialog(scope.row.id)"> <!-- @click="deliverGoods(scope.row)"-->
<el-button v-if="['待发货'].includes(scope.row.orderStatus)" size="small"
@click="openShipmentDialog(scope.row.id)">
发货
</el-button>
<!-- <el-button :disabled="!['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>-->
<!-- 取消订单-->
<!-- </el-button>-->
<el-popconfirm confirm-button-text='' cancel-button-text='' icon="InfoFilled" icon-color="red"
title="订单是否完成?" @confirm="successfulTransaction(scope.row.id)" width=180>
<template #reference>
<el-button v-if="['待收货'].includes(scope.row.orderStatus)" size="small" type="success"
plain>交易完成</el-button>
</template>
</el-popconfirm>
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
title="确定要退款吗?" @confirm="deleteOrder(scope.row)" width=180>
<template #reference>
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" type="danger"
<el-button v-if="['待发货','待收货'].includes(scope.row.orderStatus)" size="small" type="danger"
plain>退款</el-button>
</template>
</el-popconfirm>
@ -170,7 +177,7 @@
import { onMounted, ref } from "vue";
import myAxios from "@/api/myAxios";
import { ElMessage } from "element-plus";
import { SuccessInfo, ErrorInfo } from "@/utils/messageInfo";
import {SuccessInfo, ErrorInfo, WarnInfo} from "@/utils/messageInfo";
const tableData: any = ref([]); //
const total = ref(0);
const title = ref('')
@ -293,11 +300,25 @@ const cancelOrder = async (row: any) => { //取消订单的方法(未支付能
ErrorInfo('请求错误')
}
}
const successfulTransaction = async (oid: any) => {
// console.log('---->',oid)
// loading.value = true
const res = await myAxios.post('',{})
if (res.data.code === 1) {
SuccessInfo('订单完成')
getOrderList()
loading.value = false
} else {
WarnInfo('更新失败')
loading.value = false
}
loading.value = false
}
</script>
<style lang="scss" scoped>
/* 使用 ::v-deep 来修改表头的对齐方式 */
::v-deep .el-table__header th {
.el-table__header th {
text-align: center;
/* 表头居中 */
font-size: 14px;

View File

@ -51,20 +51,29 @@
<!-- </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="220px" fixed="right">
<el-table-column label="操作" width="160px" fixed="right">
<template #default="scope">
<!-- <el-button size="small" @click="showDetail(scope.$index, scope.row)">
详情
</el-button> -->
<!-- <el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="openShipmentDialog(scope.row.id)" > &lt;!&ndash; @click="deliverGoods(scope.row)"&ndash;&gt;-->
<!-- 发货-->
<!-- </el-button>-->
<!-- <el-button :disabled="!['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>-->
<!-- 取消订单-->
<!-- </el-button>-->
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="deleteOrder(scope.row)" type="danger" plain>
退款
</el-button>
<el-popconfirm confirm-button-text='' cancel-button-text='' icon="InfoFilled" icon-color="red"
title="是否取消订单?" @confirm="cancelOrder(scope.row)" width=180>
<template #reference>
<el-button v-if="['待支付'].includes(scope.row.orderStatus)" size="small" type="primary"
plain>取消订单</el-button>
</template>
</el-popconfirm>
<el-popconfirm confirm-button-text='' cancel-button-text='' icon="InfoFilled" icon-color="red"
title="订单已完成?" @confirm="successfulTransaction(scope.row.id)" width=180>
<template #reference>
<el-button v-if="['待收货'].includes(scope.row.orderStatus)" size="small" type="primary"
plain>完成订单</el-button>
</template>
</el-popconfirm>
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
title="确定要退款吗?" @confirm="deleteOrder(scope.row)" width=180>
<template #reference>
<el-button v-if="['待发货','待收货'].includes(scope.row.orderStatus)" size="small" type="danger"
plain>退款</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
@ -75,90 +84,16 @@
:small="null" :disabled="null" :background="null" layout="total, sizes, prev, pager, next, jumper"
:total="total" />
</div>
<!-- 弹窗-->
<el-dialog title="订单详情信息" v-model="DialogVisible" width="60%">
<el-form label-width="100px" size="default" :model="editForm" :disabled="disabled">
<div style="display: flex">
<el-form-item label="订单编号" style="width: 400px">
<el-input v-model="editForm.orderNumber" autocomplete="off"></el-input>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item label="联系人姓名" style="width: 300px">
<el-input v-model="editForm.contactsSnapshot.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="手机号" style="width: 300px">
<el-input v-model="editForm.contactsSnapshot.phone" autocomplete="off"></el-input>
</el-form-item>
</div>
<!-- 这里的商品明细就不放图片了 -->
<div style="display: flex">
<el-form-item label="订单总金额" style="width: 250px">
<el-input v-model="totalAmount" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="优惠价格" style="width: 250px">
<el-input v-model="editForm.couponSnapshot.conditionAmount" autocomplete="off"></el-input>
</el-form-item>
</div>
<el-form-item label="订单实付金额" style="width: 250px">
<el-input v-model="editForm.totalAmount" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="订单状态" style="width: 250px">
<el-input v-model="editForm.orderStatus" autocomplete="off"></el-input>
</el-form-item>
<div style="display: flex">
<el-form-item label="下单时间" style="width: 300px;">
<el-input v-model="editForm.createTime" autocomplete="off"></el-input>
</el-form-item>
<!-- <el-form-item label="更新时间" style="width: 300px;">-->
<!-- <el-input v-model="editForm.updateTime" autocomplete="off"></el-input>-->
<!-- </el-form-item>-->
</div>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button style="height: 30px;" @click="DialogVisible = false">取消</el-button>
<el-button style="height: 30px" type="primary" @click="DialogVisible = false" >确认</el-button>
</div>
</template>
</el-dialog>
<!-- 发货弹窗-->
<el-dialog title="发货" v-model="shipments" width="60%">
<el-form label-width="100px" size="default" >
<el-form-item label="快递单号" style="width: 300px;">
<el-input v-model="shipment.trackingNumber"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button style="height: 30px;" @click=" shipments = false">取消</el-button>
<el-button style="height: 30px" type="primary" @click="deliverGoods ">确认</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";
import { SuccessInfo , ErrorInfo } from "@/utils/messageInfo";
import {SuccessInfo, ErrorInfo, WarnInfo} from "@/utils/messageInfo";
import emitter from "@/utils/emitter";
const tableData: any = ref([]); //
const total = ref(0);
const title = ref('')
const disabled = ref(true)
const editForm: any = ref({});//
const shipment:any = ref({
trackingNumber: null
})//
const DialogVisible = ref(false); //
const shipments = ref(false)
const orderNumber = ref('')
const searchParams: any = ref({ //
current: 1, //
@ -204,43 +139,6 @@ const getOrderList = async () => {
}
}
const totalAmount = ref(0)
const couponAmount = ref(0)
//
const showDetail = (index: number, row: any) => {
title.value = "订单详情"
DialogVisible.value = true;
if (row.couponSnapshot !== null) {
couponAmount.value = row.couponSnapshot.conditionAmount;
}
totalAmount.value = row.totalAmount + couponAmount.value;
editForm.value = row;
console.log('editForm--->',editForm.value);
};
//
const currentId = ref<number | null>(null);
const openShipmentDialog = (id: number) => {
shipments.value = true;
currentId.value = id;
}
const deliverGoods = async () => { //
if (currentId.value) {
const res = await myAxios.post('/order/update', {
id: currentId.value,
trackingNumber: shipment.value.trackingNumber
})
if (res.data.code === 1) {
ElMessage({
type: 'success',
message: '发货成功'
})
getOrderList();
}
} else {
ElMessage.error('更新失败,请检查字段')
}
shipments.value = false;
}
const deleteOrder = async (row : any) => { //退
loading.value = true
console.log('row-->',row)
@ -270,11 +168,24 @@ const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取
ErrorInfo('请求错误')
}
}
const successfulTransaction = async (oid: any) => { //
// console.log('---->',oid)
// loading.value = true
const res = await myAxios.post('',{})
if (res.data.code === 1) {
SuccessInfo('订单完成')
getOrderList()
loading.value = false
} else {
WarnInfo('更新失败')
loading.value = false
}
loading.value = false
}
</script>
<style lang="scss" scoped>
/* 使用 ::v-deep 来修改表头的对齐方式 */
::v-deep .el-table__header th {
.el-table__header th {
text-align: center; /* 表头居中 */
font-size: 14px; /* 设置字体大小 */
font-weight: bold; /* 设置字体加粗 */

View File

@ -3,10 +3,10 @@
<!-- 搜索 -->
<div>
<el-input style="width: 240px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入商户单号"
v-model="outTradeNo"></el-input>
<el-button class="ml-5" type="primary" @click="onSearch(outTradeNo)" style="height: 25px; margin-right: 10px;">搜索</el-button>
v-model="outTradeNo" size="default"></el-input>
<el-button class="ml-5" type="primary" @click="onSearch(outTradeNo)" size="default">搜索</el-button>
<el-button type="warning" @click="reset" style="height:25px">重置</el-button>
<el-button type="warning" @click="reset" size="default">重置</el-button>
</div>
<div style="margin: 15px 0">

View File

@ -104,7 +104,7 @@ const onSubmit = async () => {
const values = Object.values(form.value);
// 使some()
console.log(form.value.appointmentDateAddRequestList)
if (values.some(value => value === null || value === undefined || value === ''|| value === 0) || form.value.appointmentDateAddRequestList.length == 0 ) {
if (values.some(value => value === null || value === undefined || value === '') || form.value.appointmentDateAddRequestList.length == 0 ) {
ElMessage({
type: 'warning',
message: '请检查表单数据是否完整填写'

View File

@ -135,8 +135,9 @@
<el-form-item label="商品名称">
<el-input v-model="editForm.name"></el-input>
</el-form-item>
<el-form-item label="商品价格">
<el-input v-model="editForm.price"></el-input>
<el-form-item label="产品价格" prop="price">
<el-input-number v-model="editForm.price" min="0" :precision="2" :step="0.5" />
<p></p>
</el-form-item>
<el-form-item label="商品标签">
<el-input v-model="editForm.label"></el-input>
@ -231,6 +232,7 @@ import {ref, onMounted, inject, toRaw} from 'vue';
import myAxios from "@/api/myAxios";
import calendarUtil from '@/layout/components/calendarUtil.vue';
import emitter from "@/utils/emitter";
import {form} from "@/utils/entityProduct/picUpload";
const total = ref(0); //
const idList = ref<Number[]>([]); //
const searchParams: any = ref({ //

View File

@ -16,7 +16,7 @@
<el-input v-model="userForm.userAccount"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="userForm.userPassword" />
<el-input v-model="userForm.userPassword" type="password" />
</el-form-item>
</div>
<div style="display: flex;">
@ -54,7 +54,19 @@ const fileSimple = ref() //单个文件
const uploadProductImg: any = ref() //ref
const tempAvatar = ref('') //
const btnText = ref('编辑') //
const tempUserObj = ref({}) //
onMounted(()=>{
getUserInfo()
})
//
const getUserInfo = async () => {
const res = await myAxios.get('/user/get/web/login')
// console.log(res.data.data)
userForm.value = res.data.data
ImgArr.value.push({
url: res.data.data.userAvatar
})
}
//
const Exceed_ProductImg: UploadProps['onExceed'] = (files) => { // 'onExceed'
uploadProductImg.value!.clearFiles()
@ -90,11 +102,26 @@ const removePic: UploadProps['onRemove'] = (uploadFile, uploadFiles) => { //u
}
const saveEdit = async ()=>{ //
const res = await myAxios.post('/user/update',{
id: userForm.value.id,
userPassword: userForm.value.userPassword,
userName: userForm.value.userName,
userAvatar: tempAvatar.value,
phone: userForm.value.phone,
userRole: userForm.value.userRole
})
console.log('更新信息--->',res.data)
if (res.data.code === 1) {
disabled.value = true
SuccessInfo('更新成功')
} else {
WarnInfo('更新失败')
}
}
const changeStatus = async ()=> {
if(btnText.value === '编辑') {
tempAvatar.value = userForm.value.userAvatar
btnText.value = '取消'
disabled.value = false
} else {

View File

@ -2,8 +2,8 @@
<div style="margin: 10px 0">
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入用户名"
v-model="username"></el-input>
<el-button class="ml-5" type="primary" @click="onSearch(username)" style="height: 25px;">搜索</el-button>
<el-button type="warning" @click="reset" style="height:25px">重置</el-button>
<el-button class="ml-5" type="primary" @click="onSearch(username)" size="default">搜索</el-button>
<el-button type="warning" @click="reset" size="default">重置</el-button>
</div>
<el-table :data="tableData" border stripe header-cell-class-name="headerBg" :cell-style="{ textAlign: 'center' }"
@selection-change="handleSelectionChange" :header-cell-style="{ 'text-align': 'center' }">
@ -23,7 +23,7 @@
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号"></el-table-column>
<el-table-column prop="isDelete" label="是否删除"></el-table-column>
<!-- <el-table-column prop="isDelete" label="是否封禁"></el-table-column>-->
<el-table-column label="操作">
<template #default="scope">
<el-button size="small" @click="checkDetail(scope.row)">详情</el-button>
@ -49,12 +49,14 @@
</el-icon>
</el-upload>
</el-form-item>
<el-form-item label="账号">
<el-input v-model="userForm.userAccount" style="width: 200px;"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="userForm.userPassword" />
</el-form-item>
<div style="display: flex;">
<el-form-item label="账号">
<el-input v-model="userForm.userAccount" style="width: 200px;"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="userForm.userPassword" type="password"/>
</el-form-item>
</div>
<div style="display: flex;">
<el-form-item label="用户名">
<el-input v-model="userForm.userName" />
@ -100,7 +102,7 @@ const disabled = ref(false) //表单是否禁用
const userForm: any = ref({}) //
const fileSimple = ref() //
const uploadProductImg: any = ref() //ref
const tempAvatar = ref('') //
const tempAvatar = ref('') //
onMounted(() => {
getUserList()
})
@ -189,6 +191,7 @@ const checkDetail = (obj: any) => { //查看详情方法
userForm.value = obj
}
const editUser = (obj: any) => { //
userForm.value = JSON.parse(JSON.stringify(obj)) //
tempAvatar.value = userForm.value.userAvatar //
disabled.value = false
title.value = '编辑用户'
@ -197,18 +200,18 @@ const editUser = (obj: any) => { //编辑方法
url: obj.userAvatar
})
DialogVisible.value = true
userForm.value = obj
}
const saveEdit = async () => { //
console.log('编辑后的信息--->', userForm.value);
const res = await myAxios.post('/user/update', {
id: 2,
id: userForm.value.id,
userPassword: userForm.value.userPassword,
userName: userForm.value.userName,
userAvatar: tempAvatar.value,
phone: userForm.value.phone,
userRole: userForm.value.userRole
})
console.log('后端返回--->',res.data)
if(res.data.code === 1) {
SuccessInfo('更新成功')
DialogVisible.value = false