Compare commits
No commits in common. "06aa3853f335fabeedd8a967065c7f060f7c0e55" and "c6beef1783a11057072c7a19523cf5b2bb9c41ff" have entirely different histories.
06aa3853f3
...
c6beef1783
|
@ -22,7 +22,7 @@
|
||||||
<el-select v-model="timeList[index][row].minNumValue"
|
<el-select v-model="timeList[index][row].minNumValue"
|
||||||
placeholder="最小人数"
|
placeholder="最小人数"
|
||||||
style="width: 100px"
|
style="width: 100px"
|
||||||
@change="minNumFun(timeList[index][row].minNumValue,index,row)">
|
@change="minNumFun">
|
||||||
<el-option v-for="item in minOptions[index][row]"
|
<el-option v-for="item in minOptions[index][row]"
|
||||||
:key="item"
|
:key="item"
|
||||||
:value="item" />
|
:value="item" />
|
||||||
|
@ -34,31 +34,23 @@
|
||||||
:key="item"
|
:key="item"
|
||||||
:value="item" />
|
:value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-button circle @click="addList(index, row)"><el-icon>
|
<el-button circle @click="addList(index, row)"><el-icon>
|
||||||
<Plus />
|
<Plus />
|
||||||
</el-icon></el-button>
|
</el-icon></el-button>
|
||||||
<el-button circle @click="subList(index, row)" v-if="row + 1 > 1"><el-icon>
|
<el-button circle @click="subList(index, row)" v-if="row + 1 > 1"><el-icon>
|
||||||
<Minus />
|
<Minus />
|
||||||
</el-icon></el-button>
|
</el-icon></el-button>
|
||||||
<el-checkbox v-model="timeList[index][row].isAvailable" label="此时间段可预约" style="margin-left: 10px;"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="totalButton">
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="resetForm">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref , defineEmits } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
import { Plus } from '@element-plus/icons-vue';
|
||||||
const dayList = ref([0, 1, 2, 3]) //今天和未来三天
|
const dayList = ref([0, 1, 2, 3]) //今天和未来三天
|
||||||
const timeList = ref([ //时间段数组,可以直接通过timeList[index][row]访问对应的时间段
|
const timeList = ref([ //时间段数组,可以直接通过timeList[index][row]访问对应的时间段
|
||||||
|
@ -67,8 +59,7 @@ const timeList = ref([ //时间段数组,可以直接通过timeList[index][
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
minNumValue: '',
|
minNumValue: '',
|
||||||
maxNunValue: '',
|
maxNunValue: ''
|
||||||
isAvailable: false
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -76,8 +67,7 @@ const timeList = ref([ //时间段数组,可以直接通过timeList[index][
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
minNumValue: '',
|
minNumValue: '',
|
||||||
maxNunValue: '',
|
maxNunValue: ''
|
||||||
isAvailable: false
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -85,8 +75,7 @@ const timeList = ref([ //时间段数组,可以直接通过timeList[index][
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
minNumValue: '',
|
minNumValue: '',
|
||||||
maxNunValue: '',
|
maxNunValue: ''
|
||||||
isAvailable: false
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -94,8 +83,7 @@ const timeList = ref([ //时间段数组,可以直接通过timeList[index][
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
minNumValue: '',
|
minNumValue: '',
|
||||||
maxNunValue: '',
|
maxNunValue: ''
|
||||||
isAvailable: false
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
@ -115,22 +103,12 @@ const maxOptions = ref(
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
const flag = ref(0) //第一个人数下标
|
const flag = ref(0) //第一个人数下标
|
||||||
const appointmentDateAddRequestList = ref(
|
|
||||||
Array.from({length: 4},()=>(
|
|
||||||
{
|
|
||||||
timeSlot: '',
|
|
||||||
isAvailable: 0,
|
|
||||||
numberRange: ''
|
|
||||||
}
|
|
||||||
)),
|
|
||||||
)
|
|
||||||
const emit = defineEmits(['time-Info']) //组件绑定
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
for(let i=0; i<4; i++) { //开始时初始化人数的数组
|
for(let i=0; i<4; i++) { //开始时初始化人数的数组
|
||||||
for(let j=0; j<6; j++) {
|
for(let j=0; j<6; j++) {
|
||||||
for(let k=0;k<50;k++) {
|
for(let k=0;k<50;k++) {
|
||||||
minOptions.value[i][j][k] = k+5;
|
minOptions.value[i][j][k] = k+1;
|
||||||
maxOptions.value[i][j][k] = k+6;
|
maxOptions.value[i][j][k] = k+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,40 +119,27 @@ const addList = (index: any, row: any) => {
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
minNumValue: '',
|
minNumValue: '',
|
||||||
maxNunValue: '',
|
maxNunValue: ''
|
||||||
isAvailable: false
|
|
||||||
})
|
})
|
||||||
flag.value += 1
|
flag.value += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const subList = (index: number, row: number) => {
|
const subList = (index: number, row: number) => {
|
||||||
|
console.log(index, row);
|
||||||
timeList.value[index].splice(row, 1)
|
timeList.value[index].splice(row, 1)
|
||||||
}
|
}
|
||||||
const minNumFun = (number : any,index : number,row : number)=> {
|
const minNumFun = (number : any)=> {
|
||||||
maxOptions.value[index][row].splice(0,number-5)
|
for(let i = 0;i<number;i++) {
|
||||||
}
|
if(maxOptions.value[i] < number) {
|
||||||
//组件传值
|
maxOptions.value.splice(i,1)
|
||||||
const onSubmit =()=>{
|
console.log(maxOptions.value);
|
||||||
//将数组处理成后端格式
|
}
|
||||||
emit('time-Info',timeList)
|
|
||||||
}
|
|
||||||
const resetForm=()=>{
|
|
||||||
for(let i=0;i<4;i++) {
|
|
||||||
timeList.value[i] = [{
|
|
||||||
startTime: '',
|
|
||||||
endTime: '',
|
|
||||||
minNumValue: '',
|
|
||||||
maxNunValue: '',
|
|
||||||
isAvailable: false
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.date-picker {
|
|
||||||
height: 750px;
|
|
||||||
}
|
|
||||||
div {
|
div {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: rgb(96, 98, 102);
|
color: rgb(96, 98, 102);
|
||||||
|
@ -186,12 +151,9 @@ div {
|
||||||
.box {
|
.box {
|
||||||
width: 380px;
|
width: 380px;
|
||||||
height: 50pxpx;
|
height: 50pxpx;
|
||||||
|
border: 1px solid red;
|
||||||
}
|
}
|
||||||
.numRange {
|
.numRange {
|
||||||
margin-left: 26px;
|
margin-left: 26px;
|
||||||
}
|
}
|
||||||
.totalButton {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-evenly;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -65,7 +65,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="timeTable">
|
<div class="timeTable">
|
||||||
<appointTime @time-Info="getInfo"></appointTime>
|
<appointTime></appointTime>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -82,6 +82,8 @@ const uploadedFiles = ref<UploadFile[]>([]);//商品图片数组
|
||||||
const uploadedDescription = ref<UploadFile[]>([]);//商品图文描述数组
|
const uploadedDescription = ref<UploadFile[]>([]);//商品图文描述数组
|
||||||
const resetFormData = ref()
|
const resetFormData = ref()
|
||||||
const selectValue = '服务类'
|
const selectValue = '服务类'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const count = ref(1)
|
||||||
const form = ref({
|
const form = ref({
|
||||||
name: '',
|
name: '',
|
||||||
price: '', //商品价格
|
price: '', //商品价格
|
||||||
|
@ -99,9 +101,36 @@ const form = ref({
|
||||||
const reload: any = inject("reload")
|
const reload: any = inject("reload")
|
||||||
const uploadProductImg: any = ref() //图片上传的ref绑定
|
const uploadProductImg: any = ref() //图片上传的ref绑定
|
||||||
const uploadProductDetail: any = ref() //图片上传的ref绑定
|
const uploadProductDetail: any = ref() //图片上传的ref绑定
|
||||||
const timeInfo = ref([]) //组件传过来的信息
|
// const startTime = ref('')
|
||||||
|
// const endTime = ref('')
|
||||||
|
// const timeList = ref(
|
||||||
|
// {
|
||||||
|
// days: [0,1,2,3], //表示第几天,0是当日
|
||||||
|
// slot: Array.from({ length:8 },()=>({
|
||||||
|
// startTime: '',
|
||||||
|
// endTime: ''
|
||||||
|
// }))
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
const timeList = ref([
|
||||||
|
{
|
||||||
|
slot: Array.from({ length: 8 }, () => ({
|
||||||
|
startTime: '',
|
||||||
|
endTime: ''
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
])
|
||||||
|
//时间段数组对象
|
||||||
|
const arr = ref([
|
||||||
|
{
|
||||||
|
timeSlot: '',
|
||||||
|
isAvailable: 1,
|
||||||
|
numberRange: ''
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const myDate = new Date();
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// console.log(myDate.getHours()); //打印当前小时数
|
console.log(myDate.getHours()); //打印当前小时数
|
||||||
})
|
})
|
||||||
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
console.log(uploadFile, uploadFiles)
|
console.log(uploadFile, uploadFiles)
|
||||||
|
@ -167,9 +196,23 @@ const Exceed_ProductDetail: UploadProps['onExceed'] = (files) => { //覆盖商
|
||||||
file.uid = genFileId()
|
file.uid = genFileId()
|
||||||
uploadProductDetail.value!.handleStart(file)
|
uploadProductDetail.value!.handleStart(file)
|
||||||
}
|
}
|
||||||
const getInfo =(info:any)=>{
|
const showDatePop = () => {
|
||||||
timeInfo.value = info
|
dialogVisible.value = true
|
||||||
console.log('--->',info.value);
|
}
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
}
|
||||||
|
const addList = (index: number, row: number) => {
|
||||||
|
console.log(index, row);
|
||||||
|
// if (count.value <= 6) {
|
||||||
|
// timeList.value[row+1] = {
|
||||||
|
// startTime: '',
|
||||||
|
// endTime: ''
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
const subList = (index: number, row: number) => {
|
||||||
|
// arr.value[index].splice(index, 1)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -179,6 +222,7 @@ const getInfo =(info:any)=>{
|
||||||
}
|
}
|
||||||
|
|
||||||
.fromBox {
|
.fromBox {
|
||||||
|
border: 1px solid red;
|
||||||
width: 750px;
|
width: 750px;
|
||||||
height: 750px;
|
height: 750px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user