|
@@ -13,35 +13,28 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="会议开始时间" prop="startTime"
|
|
|
+ <el-form-item label="会议开始时间" prop="startDate"
|
|
|
:rules="[
|
|
|
- {required: true, message:'会议开始时间不能为空', trigger:'blur'}]">
|
|
|
+ {required: true, message:'会议开始日期不能为空', trigger:'blur'}]">
|
|
|
<el-date-picker
|
|
|
- style="width: 100%"
|
|
|
- placement="bottom-start"
|
|
|
- v-model="inputForm.startTime"
|
|
|
- type="datetime"
|
|
|
- placeholder="选择日期时间"
|
|
|
- format="YYYY-MM-DD HH:mm"
|
|
|
- value-format="YYYY-MM-DD HH:mm"
|
|
|
- date-format="YYYY-MM-DD"
|
|
|
- time-format="HH:mm"
|
|
|
+ style="width:50%;"
|
|
|
+ v-model="inputForm.startDate"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择日期"
|
|
|
:disabled-date="disableDate"
|
|
|
- :disabled-hours="disabledHour"
|
|
|
- :disabled-minutes="disabledMinute"
|
|
|
- :popper-options="{
|
|
|
- modifiers: [
|
|
|
- {
|
|
|
- name: 'flip',
|
|
|
- options: {
|
|
|
- fallbackPlacements: ['bottom'],
|
|
|
- allowedAutoPlacements: ['bottom'],
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- }"
|
|
|
- @blur="checkTime"
|
|
|
- ></el-date-picker>
|
|
|
+ :size="default"
|
|
|
+ @change="checkTime"
|
|
|
+ />
|
|
|
+ <el-select v-model="inputForm.startTime" placeholder="请选择时间" style="width:50%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in dateList"
|
|
|
+ :disabled="item.disabled"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -104,6 +97,7 @@
|
|
|
id: '',
|
|
|
title: '',
|
|
|
startTime: '',
|
|
|
+ startDate: '',
|
|
|
duration: '',
|
|
|
createById: this.$store.state.user.id,
|
|
|
createByName: this.$store.state.user.name,
|
|
@@ -112,6 +106,7 @@
|
|
|
},
|
|
|
baseKey: '',
|
|
|
keyWatch: '',
|
|
|
+ dateList:[]
|
|
|
}
|
|
|
},
|
|
|
MeetingRoom:null,
|
|
@@ -167,6 +162,7 @@
|
|
|
id:'',
|
|
|
title:'',
|
|
|
startTime:'',
|
|
|
+ startDate:'',
|
|
|
duration:'',
|
|
|
createById:'',
|
|
|
createByName:'',
|
|
@@ -252,6 +248,14 @@
|
|
|
console.log('5',this.inputForm)
|
|
|
if (status === 'save') {
|
|
|
// 暂存
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.startDate)|| this.commonJS.isEmpty(this.inputForm.startTime)) {
|
|
|
+ this.$message.error('请选择会议开始时间')
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.duration)) {
|
|
|
+ this.$message.error('请选择会议时长')
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
this.loading = true
|
|
|
this.inputForm.status = '1'
|
|
|
this.meetingRoomServie.saveForm(this.inputForm).then((data) => {
|
|
@@ -262,7 +266,7 @@
|
|
|
})
|
|
|
return
|
|
|
} else if (status === 'start') {
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.startTime)) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.startDate)|| this.commonJS.isEmpty(this.inputForm.startTime)) {
|
|
|
this.$message.error('请选择会议开始时间')
|
|
|
this.loading = false
|
|
|
}
|
|
@@ -280,6 +284,7 @@
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
|
+ console.log('form',this.inputForm)
|
|
|
this.meetingRoomServie.saveForm(this.inputForm).then((data) => {
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.$refs.inputForm.resetFields()
|
|
@@ -387,15 +392,39 @@
|
|
|
return arrs;
|
|
|
},
|
|
|
checkTime(){
|
|
|
- if (this.inputForm.startTime !== ''){
|
|
|
- this.meetingRoomServie.checkTime(this.inputForm.startTime).then((data)=>{
|
|
|
- if (data === false){
|
|
|
- this.$message.error('所有人都在忙,请选择其他时间')
|
|
|
- this.loading = false
|
|
|
+ this.dateList=this.$dictUtils.getDictList('jy_meeting_date')
|
|
|
+ console.log('this.dateList',this.dateList)
|
|
|
+ this.inputForm.startTime=''
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.startDate)){
|
|
|
+ this.meetingRoomServie.checkTime(this.inputForm.startDate).then((data)=>{
|
|
|
+ console.log('data',data)
|
|
|
+ if (this.commonJS.isNotEmpty(data)){
|
|
|
+ var num = [];
|
|
|
+ for (var key in data) {
|
|
|
+ console.log(data[key])
|
|
|
+ let date1=data[key].replace(/:/g, '')
|
|
|
+
|
|
|
+ for (let i=0;i<this.dateList.length;i++){
|
|
|
+ let date2=this.dateList[i].value.replace(/:/g, "")
|
|
|
+ console.log('date2',date2)
|
|
|
+ if (date1===date2){
|
|
|
+ num.push(i)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ console.log('num', num)
|
|
|
+ for (let i=0;i<num.length;i++){
|
|
|
+ console.log('num[i]', num[i])
|
|
|
+ this.dateList[num[i]].disabled = true
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|