Merge branch 'main' of http://154.8.193.216:3030/admin1/jiangchengfeiyi-Web
This commit is contained in:
commit
634e468f95
|
@ -99,6 +99,28 @@
|
||||||
<span slot="title">实体商品订单列表</span>
|
<span slot="title">实体商品订单列表</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
|
<el-sub-menu index="6">
|
||||||
|
<template #title>
|
||||||
|
<el-icon><HomeFilled/></el-icon>
|
||||||
|
<span>写真预约管理</span>
|
||||||
|
</template>
|
||||||
|
<el-menu-item index="/ClothingGrade">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">服装等级管理</span>
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item index="/CostumeDetails">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">服装详情</span>
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item index="/AddCostumes">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">添加服装</span>
|
||||||
|
</el-menu-item>
|
||||||
|
<el-menu-item index="/AppointmentOrder">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">预约订单</span>
|
||||||
|
</el-menu-item>
|
||||||
|
</el-sub-menu>
|
||||||
|
|
||||||
|
|
||||||
</el-menu>
|
</el-menu>
|
||||||
|
|
|
@ -274,10 +274,6 @@ const deleteProduct = async (index: number) => {
|
||||||
getTypeList()
|
getTypeList()
|
||||||
}
|
}
|
||||||
//选中发生的方法--->将其赋值给批量删除的数组
|
//选中发生的方法--->将其赋值给批量删除的数组
|
||||||
const handleSelectionChange = (row: any) => {
|
|
||||||
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) => {
|
||||||
//flag值不同显示不同内容 disabled开启和关闭
|
//flag值不同显示不同内容 disabled开启和关闭
|
||||||
|
|
135
src/views/CostumeAppointments/AddCostumes.vue
Normal file
135
src/views/CostumeAppointments/AddCostumes.vue
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form ref="resetFormData" :model="form" label-width="auto" style="width: 750px" size="large">
|
||||||
|
<el-form-item label="添加服装图片">
|
||||||
|
<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"
|
||||||
|
limit="1" >
|
||||||
|
<el-icon>
|
||||||
|
<Plus />
|
||||||
|
</el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="添加效果图">
|
||||||
|
<el-upload
|
||||||
|
ref="uploadProductDetail"
|
||||||
|
action="#"
|
||||||
|
list-type="picture-card"
|
||||||
|
:auto-upload="false"
|
||||||
|
multiple="true"
|
||||||
|
:on-change="(event: any) => handleChange(event, 1)"
|
||||||
|
:on-exceed="Exceed_ProductDetail"
|
||||||
|
limit="1"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<Plus />
|
||||||
|
</el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服装名称" prop="name">
|
||||||
|
<el-input v-model="form.name" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服装价格" prop="price">
|
||||||
|
<el-input v-model="form.price" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服装类别" prop="intro">
|
||||||
|
<el-input v-model="form.clothesType" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服装简介" prop="intro">
|
||||||
|
<el-input v-model="form.intro" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSubmit">提交</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import {Plus} from "@element-plus/icons-vue";
|
||||||
|
import {ElMessage, genFileId, type UploadProps, type UploadRawFile} from "element-plus";
|
||||||
|
import myAxios from "@/api/myAxios";
|
||||||
|
import {inject, ref} from "vue";
|
||||||
|
const fileSimple = ref()
|
||||||
|
const uploadProductImg : any = ref()
|
||||||
|
const uploadProductDetail : any = ref()
|
||||||
|
const form = ref({
|
||||||
|
name:'',
|
||||||
|
image:'',
|
||||||
|
effectImg:'',
|
||||||
|
intro:'',
|
||||||
|
price:'',
|
||||||
|
clothesType:''
|
||||||
|
})
|
||||||
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
|
console.log(uploadFile, uploadFiles)
|
||||||
|
}
|
||||||
|
const handleChange = async (file: any, flag: number) => {
|
||||||
|
fileSimple.value = file
|
||||||
|
let formData = new FormData()
|
||||||
|
formData.append("file", fileSimple.value.raw)
|
||||||
|
const res = await myAxios({
|
||||||
|
url: '/file/upload/server/not_login',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
biz: "test",
|
||||||
|
file: formData.get("file")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
flag ? form.value.effectImg = res.data.data : form.value.image = res.data.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const Exceed_ProductImg: UploadProps['onExceed'] = (files) => { //覆盖商品照片
|
||||||
|
uploadProductImg.value!.clearFiles()
|
||||||
|
const file = files[0] as UploadRawFile
|
||||||
|
file.uid = genFileId()
|
||||||
|
uploadProductImg.value!.handleStart(file)
|
||||||
|
}
|
||||||
|
const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //覆盖商品详情图片
|
||||||
|
uploadProductDetail.value!.clearFiles()
|
||||||
|
const file = files[0] as UploadRawFile
|
||||||
|
file.uid = genFileId()
|
||||||
|
uploadProductDetail.value!.handleStart(file)
|
||||||
|
}
|
||||||
|
const reload : any = inject("reload")
|
||||||
|
const onSubmit = async () => {
|
||||||
|
const values = Object.values(form.value);
|
||||||
|
// 使用some()方法来检查是否有任何值为空
|
||||||
|
if (values.some(value => value === null || value === undefined || value === '')) {
|
||||||
|
ElMessage({
|
||||||
|
type:'warning',
|
||||||
|
message:'请检查表单数据是否完整填写'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await myAxios.post('/clothesInfo/add', { ...form.value })
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: "提交成功"
|
||||||
|
})
|
||||||
|
reload() //上传完后重置表单
|
||||||
|
} else {
|
||||||
|
ElMessage.error("服务错误")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
185
src/views/CostumeAppointments/AppointmentOrder.vue
Normal file
185
src/views/CostumeAppointments/AppointmentOrder.vue
Normal file
|
@ -0,0 +1,185 @@
|
||||||
|
<template>
|
||||||
|
<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="Search(name)" 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="orders" border style="width: 100%;margin: 15px 0" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
@selection-change="handleSelectionChange" :cell-style="{ 'text-align': 'center', 'font-size': '16px' }">
|
||||||
|
<!-- <el-table-column type="selection" width="55"></el-table-column>-->
|
||||||
|
<el-table-column prop="id" label="序号" width="50"></el-table-column>
|
||||||
|
<el-table-column prop="type" label="类别" ></el-table-column>
|
||||||
|
<el-table-column prop="clothesType" label="类型"></el-table-column>
|
||||||
|
<el-table-column prop="specificDate" label="日期"></el-table-column>
|
||||||
|
<el-table-column prop="timeSlot" label="时间"></el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="下单时间"></el-table-column>
|
||||||
|
<el-table-column prop="orderStatus" label="订单状态"></el-table-column>
|
||||||
|
<el-table-column label="购买客户" width="50">
|
||||||
|
<el-table-column label="姓名" prop="contactsSnapshot.name" />
|
||||||
|
<el-table-column label="联系方式" prop="contactsSnapshot.phone" />
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="success" @click="editShow(scope.$index, scope.row,0)">详情</el-button>
|
||||||
|
<el-button type="success" @click="editShow(scope.$index, scope.row,1)">修改</el-button>
|
||||||
|
<!-- <el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"-->
|
||||||
|
<!-- title="是否确认删除" @confirm="Delete(scope.row.id)" width=180>-->
|
||||||
|
<!-- <template #reference>-->
|
||||||
|
<!-- <el-button style="height: 25px" class="ml-5" type="danger">删除</el-button>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-popconfirm>-->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 弹窗-->
|
||||||
|
<el-dialog v-model="dialogVisible" title="" width="500">
|
||||||
|
<el-form :model="order" label-width="auto" style="max-width: 600px" :disabled="disabled">
|
||||||
|
|
||||||
|
<el-form-item label="订单编号" >
|
||||||
|
<el-input v-model="order.id" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型">
|
||||||
|
<el-input v-model="order.clothesType" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="定金">
|
||||||
|
<el-input v-model="order.deposit" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="拍摄日期">
|
||||||
|
<el-input v-model="order.specificDate" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="拍摄时间段">
|
||||||
|
<el-input v-model="order.timeSlot" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="室内拍摄">
|
||||||
|
<el-input v-model="order.isIndoors" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="妆造">
|
||||||
|
<el-input v-model="order.isMakeup" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="摄影">
|
||||||
|
<el-input v-model="order.isPhotography" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户id">
|
||||||
|
<el-input v-model="order.userId" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单状态">
|
||||||
|
<el-input v-model="order.orderStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-input v-model="order.createTime" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer #default="{ row, $index }">
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取消</el-button>
|
||||||
|
<el-button type="primary" @click="addType">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref,onMounted } from 'vue'
|
||||||
|
import myAxios from "@/api/myAxios";
|
||||||
|
import {ElMessage, genFileId, type UploadProps, type UploadRawFile} from "element-plus";
|
||||||
|
const orders = ref([{}])
|
||||||
|
const name = ref('')
|
||||||
|
const searchParams: any = ref({ //封装分页
|
||||||
|
current: 1, //当前页码
|
||||||
|
pageSize: 5, //每页显示条数
|
||||||
|
sortField: "id", //根据ID分类
|
||||||
|
sortOrder: "descend" //降序
|
||||||
|
})
|
||||||
|
onMounted(()=>{
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
//获取订单
|
||||||
|
const total = ref(0)
|
||||||
|
const getList = async () => {
|
||||||
|
const res = await myAxios.post('/advanceOrder/list',{...searchParams.value})
|
||||||
|
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
orders.value = res.data.data.records
|
||||||
|
total.value = res.data.data.total
|
||||||
|
}else {
|
||||||
|
ElMessage({
|
||||||
|
message:res.data.message
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handleSelectionChange = (val:any)=>{
|
||||||
|
console.log(val)
|
||||||
|
}
|
||||||
|
//弹窗
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const disabled = ref(true)
|
||||||
|
const order = ref({
|
||||||
|
id:0,
|
||||||
|
type:'',
|
||||||
|
clothesType:'',
|
||||||
|
deposit:'',
|
||||||
|
specificDate:'',
|
||||||
|
timeSlot:'',
|
||||||
|
isIndoors:0,
|
||||||
|
isMakeup:0,
|
||||||
|
isPhotography:0,
|
||||||
|
userId:0,
|
||||||
|
orderStatus:'',
|
||||||
|
createTime:''
|
||||||
|
})
|
||||||
|
const title = ref('')
|
||||||
|
const editShow = (index: number, row: any,flag:number) => {
|
||||||
|
flag ? (title.value= "修改订单",disabled.value = false): (title.value= "订单详情·",disabled.value = true)
|
||||||
|
dialogVisible.value = true
|
||||||
|
order.value = row
|
||||||
|
}
|
||||||
|
const cancel = () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
const editForm : any = ref({})
|
||||||
|
const addType =async () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
const res = await myAxios.post('/advanceOrder/update',{
|
||||||
|
id:order.value.id,
|
||||||
|
orderStatus:order.value.orderStatus
|
||||||
|
})
|
||||||
|
if(res.data.code === 1 ) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message:'更新成功'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//搜索
|
||||||
|
const Search = (data:any)=>{
|
||||||
|
searchParams.value.orderStatus = data
|
||||||
|
// searchParams.value.id = data
|
||||||
|
// searchParams.value.type = data
|
||||||
|
searchParams.value.current = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
const reset = ()=>{
|
||||||
|
name.value = ''
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
223
src/views/CostumeAppointments/ClothingGrade.vue
Normal file
223
src/views/CostumeAppointments/ClothingGrade.vue
Normal file
|
@ -0,0 +1,223 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 10px;">
|
||||||
|
<el-button type="success" @click="add">添加等级</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="orders" 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 prop="id" label="序号" width="50"></el-table-column>
|
||||||
|
<el-table-column prop="image" label="图片">
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<img :src="scope.row.image" alt="" style="height: 50px;">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="clothesType" label="等级" ></el-table-column>
|
||||||
|
<el-table-column prop="minPrice" label="最低价" ></el-table-column>
|
||||||
|
<el-table-column prop="maxPrice" label="最高价" ></el-table-column>
|
||||||
|
<el-table-column prop="brief" label="简介" ></el-table-column>
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="success" @click="change(scope.$index, scope.row)">修改等级</el-button>
|
||||||
|
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
|
||||||
|
title="是否确认删除" @confirm="Delete(scope.row.id)" width=180>
|
||||||
|
<template #reference>
|
||||||
|
<el-button style="height: 25px" class="ml-5" type="danger">删除等级</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-dialog v-model="dialogVisible" title="服装等级" width="500">
|
||||||
|
<el-form :model="order" label-width="auto" style="max-width: 600px">
|
||||||
|
<el-form-item label="添加类别图片">
|
||||||
|
<el-upload
|
||||||
|
action="#"
|
||||||
|
list-type="picture-card"
|
||||||
|
:auto-upload="false"
|
||||||
|
multiple="true"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
@change="(event: any) => handleChange(event)"
|
||||||
|
limit="1" >
|
||||||
|
<el-icon>
|
||||||
|
<Plus />
|
||||||
|
</el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称">
|
||||||
|
<el-input v-model="order.clothesType"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最低价">
|
||||||
|
<el-input v-model="order.minPrice"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最高">
|
||||||
|
<el-input v-model="order.maxPrice"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="简介">
|
||||||
|
<el-input v-model="order.brief"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer #default="{ row, $index }">
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取消</el-button>
|
||||||
|
<el-button type="primary" @click="addType">
|
||||||
|
提交
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref,onMounted } from 'vue'
|
||||||
|
import myAxios from "@/api/myAxios";
|
||||||
|
import {ElMessage, type UploadProps} from "element-plus";
|
||||||
|
onMounted(()=>{
|
||||||
|
getOrder()
|
||||||
|
})
|
||||||
|
const total = ref(0)
|
||||||
|
const orders = ref([{}])
|
||||||
|
const flag = ref(0)//请求类型
|
||||||
|
const dialogVisible = ref(false)//弹窗
|
||||||
|
const selectedItems = ref([])
|
||||||
|
const getOrder = async ()=>{
|
||||||
|
const res = await myAxios.post('/clothesGrade/list')
|
||||||
|
console.log(res)
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
orders.value = res.data.data
|
||||||
|
total.value = parseInt(res.data.data.total)
|
||||||
|
}else {
|
||||||
|
ElMessage({
|
||||||
|
message:'获取数据失败',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//添加
|
||||||
|
const add = async () => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
flag.value = 0
|
||||||
|
}
|
||||||
|
//取消
|
||||||
|
const cancel = () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
restOrder()
|
||||||
|
}
|
||||||
|
//修改
|
||||||
|
const change = async (index:number, row: any) => {
|
||||||
|
order.value = row
|
||||||
|
dialogVisible.value = true
|
||||||
|
flag.value = 1
|
||||||
|
}
|
||||||
|
//提交
|
||||||
|
const addType = async () => {
|
||||||
|
if(
|
||||||
|
order.value.clothesType == ''||
|
||||||
|
order.value.image ==''||
|
||||||
|
order.value.brief == ''||
|
||||||
|
order.value.minPrice == 0||
|
||||||
|
order.value.maxPrice == 0) {
|
||||||
|
ElMessage({
|
||||||
|
type:'warning',
|
||||||
|
message:'内容不能为空'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
if(flag.value === 0){
|
||||||
|
const res =await myAxios.post('/clothesGrade/add',{
|
||||||
|
clothesType:order.value.clothesType,
|
||||||
|
image:order.value.image,
|
||||||
|
minPrice:order.value.minPrice,
|
||||||
|
maxPrice:order.value.maxPrice,
|
||||||
|
brief:order.value.brief,
|
||||||
|
})
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
restOrder()
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag.value === 1){
|
||||||
|
const res = await myAxios.post('/clothesGrade/update',{
|
||||||
|
clothesType:order.value.clothesType,
|
||||||
|
image:order.value.image,
|
||||||
|
minPrice:order.value.minPrice,
|
||||||
|
maxPrice:order.value.maxPrice,
|
||||||
|
brief:order.value.brief,
|
||||||
|
id:order.value.id
|
||||||
|
})
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type:'success',
|
||||||
|
message:'更新成功'
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getOrder()
|
||||||
|
}
|
||||||
|
//重置
|
||||||
|
const restOrder = ()=>{
|
||||||
|
order.value = {
|
||||||
|
image:'',
|
||||||
|
clothesType:'',
|
||||||
|
minPrice:0,
|
||||||
|
maxPrice:0,
|
||||||
|
brief:'',
|
||||||
|
id:0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const order=ref({
|
||||||
|
image:'',
|
||||||
|
clothesType:'',
|
||||||
|
minPrice:0,
|
||||||
|
maxPrice:0,
|
||||||
|
brief:'',
|
||||||
|
id:0
|
||||||
|
})
|
||||||
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
|
console.log(uploadFile, uploadFiles)
|
||||||
|
}
|
||||||
|
const handleSelectionChange = (row: any) => {
|
||||||
|
selectedItems.value = JSON.parse(JSON.stringify(row))
|
||||||
|
}
|
||||||
|
//删除
|
||||||
|
const Delete= async (index: number) => {
|
||||||
|
const res = await myAxios.post('/clothesGrade/delete',{ id : index })
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message:"删除成功"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getOrder()
|
||||||
|
}
|
||||||
|
const fileSimple = ref()
|
||||||
|
const handleChange = async (file: any) => {
|
||||||
|
fileSimple.value = file
|
||||||
|
let formData = new FormData()
|
||||||
|
formData.append("file", fileSimple.value.raw)
|
||||||
|
const res = await myAxios({
|
||||||
|
url: '/file/upload/server/not_login',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
biz: "test",
|
||||||
|
file: formData.get("file")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if ( res.data.code === 1) {
|
||||||
|
order.value.image = res.data.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
276
src/views/CostumeAppointments/CostumeDetails.vue
Normal file
276
src/views/CostumeAppointments/CostumeDetails.vue
Normal file
|
@ -0,0 +1,276 @@
|
||||||
|
<template>
|
||||||
|
<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="Search(name)" 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="orders" border style="width: 100%;margin: 15px 0" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
|
@selection-change="handleSelectionChange" :cell-style="{ 'text-align': 'center', 'font-size': '16px' }">
|
||||||
|
<!-- <el-table-column type="selection" width="55"></el-table-column>-->
|
||||||
|
<el-table-column prop="id" label="序号" width="50"></el-table-column>
|
||||||
|
<el-table-column prop="name" label="服装名称" ></el-table-column>
|
||||||
|
<el-table-column prop="clothesType" label="类型"></el-table-column>
|
||||||
|
<el-table-column prop="price" label="价格"></el-table-column>
|
||||||
|
<el-table-column prop="image" label="类别图片" width="200">
|
||||||
|
<template #default="scope"><img :src="scope.row.image" alt="" style="height: 50px;"></template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="image" label="效果图片" width="200">
|
||||||
|
<template #default="scope"><img :src="scope.row.effectImg" alt="" style="height: 50px;"></template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="success" @click="editShow(scope.$index, scope.row,0)">详情</el-button>
|
||||||
|
<el-button type="success" @click="editShow(scope.$index, scope.row,1)">修改</el-button>
|
||||||
|
<el-popconfirm class="ml-5" confirm-button-text='确定' cancel-button-text='取消' icon="InfoFilled" icon-color="red"
|
||||||
|
title="是否确认删除" @confirm="Delete(scope.row.id)" width=180>
|
||||||
|
<template #reference>
|
||||||
|
<el-button style="height: 25px" class="ml-5" type="danger">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</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="dialogVisible" title="" width="500">
|
||||||
|
<el-form :model="order" label-width="auto" style="max-width: 600px" :disabled="disabled">
|
||||||
|
<el-form-item label="服装图片">
|
||||||
|
<div v-if="order.image">
|
||||||
|
<img :src="order.image" 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"
|
||||||
|
:on-exceed="Exceed_ProductImg"
|
||||||
|
limit="1" >
|
||||||
|
<el-icon>
|
||||||
|
<Plus/>
|
||||||
|
</el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品图文">
|
||||||
|
<div v-if="order.effectImg">
|
||||||
|
<img :src="order.effectImg" alt="商品图标" class="thumbnail" style="width: 100px; height: 100px;" />
|
||||||
|
</div>
|
||||||
|
<el-upload
|
||||||
|
ref="uploadProductDetail"
|
||||||
|
action="#"
|
||||||
|
list-type="picture-card"
|
||||||
|
:auto-upload="false"
|
||||||
|
multiple="true"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:on-exceed="Exceed_ProductDetail"
|
||||||
|
limit="1" >
|
||||||
|
<el-icon>
|
||||||
|
<Plus/>
|
||||||
|
</el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称">
|
||||||
|
<el-input v-model="order.name"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型">
|
||||||
|
<el-input v-model="order.clothesType"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="价格">
|
||||||
|
<el-input v-model="order.price"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="简介">
|
||||||
|
<el-input v-model="order.intro"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer #default="{ row, $index }">
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="cancel">取消</el-button>
|
||||||
|
<el-button type="primary" @click="addType">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {ref, onMounted} from 'vue'
|
||||||
|
import myAxios from "@/api/myAxios";
|
||||||
|
import {ElMessage, genFileId, type UploadProps, type UploadRawFile} from "element-plus";
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
const orders = ref([{}])
|
||||||
|
const total = ref(0)
|
||||||
|
const getList = async ()=>{
|
||||||
|
const res = await myAxios.post('/clothesInfo/list/page',{...searchParams.value})
|
||||||
|
console.log(res)
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
orders.value = res.data.data.records;
|
||||||
|
total.value = parseInt(res.data.data.total)
|
||||||
|
}else {
|
||||||
|
ElMessage({
|
||||||
|
message:'获取数据失败',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const name = ref('')//跟据名搜索
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const order=ref({
|
||||||
|
id:0,
|
||||||
|
name:'',
|
||||||
|
price:'',
|
||||||
|
effectImg:'',
|
||||||
|
image:'',
|
||||||
|
intro:'',
|
||||||
|
clothesType:''
|
||||||
|
})
|
||||||
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
|
console.log(uploadFile, uploadFiles)
|
||||||
|
}
|
||||||
|
const cancel = () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const title = ref('')
|
||||||
|
const disabled = ref(true)
|
||||||
|
const editShow = (index: number, row: any,flag:number) => {
|
||||||
|
flag ? (title.value= "修改服装",disabled.value = false): (title.value= "服装详情·",disabled.value = true)
|
||||||
|
dialogVisible.value = true
|
||||||
|
order.value = row
|
||||||
|
}
|
||||||
|
//删除
|
||||||
|
const Delete=async (index : number)=>{
|
||||||
|
const res = await myAxios.post('/clothesInfo/delete',{ id : index })
|
||||||
|
console.log(res)
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message:'删除成功'
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
ElMessage({
|
||||||
|
message:'删除失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
const searchParams: any = ref({ //封装分页
|
||||||
|
current: 1, //当前页码
|
||||||
|
pageSize: 5, //每页显示条数
|
||||||
|
sortField: "id", //根据ID分类
|
||||||
|
sortOrder: "descend" //降序
|
||||||
|
})
|
||||||
|
const handleSizeChange = (newSize: any) => {
|
||||||
|
searchParams.value.pageSize = newSize
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
const handleCurrentChange = (Current: any) => {
|
||||||
|
searchParams.value.current = Current
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
//搜索
|
||||||
|
const Search = (data:String)=>{
|
||||||
|
searchParams.value.name = data
|
||||||
|
searchParams.value.current = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
// const reload : any = inject("reload")
|
||||||
|
const reset =()=>{
|
||||||
|
name.value=''
|
||||||
|
}
|
||||||
|
const handleSelectionChange = (val:any)=>{
|
||||||
|
console.log(val)
|
||||||
|
}
|
||||||
|
const fileSimple = ref()
|
||||||
|
const handleChange = async (file: any) => {
|
||||||
|
fileSimple.value = file
|
||||||
|
let formData = new FormData()
|
||||||
|
formData.append("file", fileSimple.value.raw)
|
||||||
|
const res = await myAxios({
|
||||||
|
url: '/file/upload/server/not_login',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
biz: "test",
|
||||||
|
file: formData.get("file")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if ( res.data.code === 1) {
|
||||||
|
order.value.image = res.data.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//批量删除
|
||||||
|
const idList = ref([])
|
||||||
|
const delBatch = async ()=>{
|
||||||
|
console.log(idList.value);
|
||||||
|
const res = await myAxios.post('/clothesInfo/delete',{
|
||||||
|
id: idList.value
|
||||||
|
})
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '批量删除成功'
|
||||||
|
})
|
||||||
|
getList()
|
||||||
|
} else {
|
||||||
|
ElMessage.error('删除失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const editForm : any = ref({})
|
||||||
|
//提交
|
||||||
|
const addType =async ()=>{
|
||||||
|
dialogVisible.value = false
|
||||||
|
const res = await myAxios('/clothesInfo/update',{...editForm.value})
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message:'更新成功'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const uploadProductImg : any = ref()
|
||||||
|
const uploadProductDetail : any = ref()
|
||||||
|
const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //覆盖商品详情图片
|
||||||
|
uploadProductDetail.value!.clearFiles()
|
||||||
|
const file = files[0] as UploadRawFile
|
||||||
|
file.uid = genFileId()
|
||||||
|
uploadProductDetail.value!.handleStart(file)
|
||||||
|
}
|
||||||
|
const Exceed_ProductImg: UploadProps['onExceed'] = (files , flag) => { //覆盖商品照片
|
||||||
|
uploadProductImg.value!.clearFiles()
|
||||||
|
const file = files[0] as UploadRawFile
|
||||||
|
file.uid = genFileId()
|
||||||
|
uploadProductImg.value!.handleStart(file)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -135,10 +135,8 @@ onMounted(() => {
|
||||||
getCouponsList()
|
getCouponsList()
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleSelectionChange = (row: any) => {
|
|
||||||
// id.value = JSON.parse(JSON.stringify(row));
|
|
||||||
}
|
|
||||||
const DialogVisible = ref(false)
|
const DialogVisible = ref(false)
|
||||||
|
const idList = ref([])
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const tableData : any= ref([])
|
const tableData : any= ref([])
|
||||||
const Couponsname = ref('')
|
const Couponsname = ref('')
|
||||||
|
@ -166,16 +164,33 @@ const handleCurrentChange = (Current: any) => {
|
||||||
searchParams.value.current = Current
|
searchParams.value.current = Current
|
||||||
getCouponsList()
|
getCouponsList()
|
||||||
}
|
}
|
||||||
const delBatch =()=>{
|
const handleSelectionChange = (row: any) => {
|
||||||
|
idList.value = row.map((item : any)=>item.id)
|
||||||
|
}
|
||||||
//批量删除
|
//批量删除
|
||||||
|
const delBatch = async ()=>{
|
||||||
|
const res = await myAxios.post('/coupon/delete', {
|
||||||
|
id:idList.value
|
||||||
|
})
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type:'success',
|
||||||
|
message:"批量删除成功"
|
||||||
|
})
|
||||||
|
getCouponsList()
|
||||||
|
}else {
|
||||||
|
ElMessage.error('删除失败')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//重置搜索
|
//重置搜索
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
Couponsname.value = '';
|
Couponsname.value = '';
|
||||||
}
|
}
|
||||||
//搜索
|
//搜索
|
||||||
const load =()=>{
|
const load =(data:String)=>{
|
||||||
|
searchParams.value.name = data
|
||||||
|
searchParams.value.content = 1
|
||||||
|
getCouponsList()
|
||||||
}
|
}
|
||||||
const saveEdit = async () => { //编辑商品
|
const saveEdit = async () => { //编辑商品
|
||||||
const res = await myAxios.post('/coupon/update',{...editForm.value})
|
const res = await myAxios.post('/coupon/update',{...editForm.value})
|
||||||
|
@ -215,7 +230,7 @@ const getCouponsList = async ()=> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleChange = async (file: any, flag: number) => {
|
const handleChange = async (file: any, flag: number) => {
|
||||||
fileSimple.value = file
|
fileSimple.value = filen
|
||||||
let formData = new FormData() //这一步很重要 创建一个FormData对象
|
let formData = new FormData() //这一步很重要 创建一个FormData对象
|
||||||
formData.append("file", fileSimple.value.raw) //fileSimple.value.raw 才是文件主体 将其以文件的格式插入formData
|
formData.append("file", fileSimple.value.raw) //fileSimple.value.raw 才是文件主体 将其以文件的格式插入formData
|
||||||
const res = await myAxios({ //编写请求,与以前的请求不同,这一次要指定好头部类型和文件类型
|
const res = await myAxios({ //编写请求,与以前的请求不同,这一次要指定好头部类型和文件类型
|
||||||
|
|
Loading…
Reference in New Issue
Block a user