diff --git a/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue b/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue index e12c6dc5d..2019493a8 100644 --- a/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue +++ b/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue @@ -60,9 +60,11 @@ export default { this.bacground = 'rgba(0,0,0,0)'; this.scaleRate = window.innerWidth / 2200; if (this.stationId == 'mainHouseOne') { - this.title = '黄山主变电所接线图'; + // 黄山 + this.title = '主所1主变电所接线图'; } else { - this.title = '茶亭主变电所接线图'; + // 茶亭 + this.title = '主所2主变电所接线图'; } params.userInterface = 'substation'; // parkingLotName diff --git a/src/views/planMonitor/editTool/menus/addPlanningTrain.vue b/src/views/planMonitor/editTool/menus/addPlanningTrain.vue index 090a58e71..201064a87 100644 --- a/src/views/planMonitor/editTool/menus/addPlanningTrain.vue +++ b/src/views/planMonitor/editTool/menus/addPlanningTrain.vue @@ -10,12 +10,11 @@ :modal="false" :close-on-click-modal="false" > - - {{ $t('planMonitor.serviceNumber2')+$t('global.colon') }} - - - - + + + + + {{ $t('global.cancel') }} {{ $t('global.confirm') }} @@ -40,7 +39,15 @@ export default { return { dialogShow: false, loading: false, - serviceNumber: '' + formModel:{ + serviceNumber: '' + }, + rules:{ + serviceNumber:[ + {required: true, validator: this.validateServiceNumber, trigger: 'blur'}, + {required: true, validator: this.validateServiceNumber, trigger: 'change'} + ] + } }; }, computed: { @@ -58,9 +65,30 @@ export default { this.loading = false; this.dialogShow = false; }, + validateServiceNumber(rule, value, callback) { + if (typeof value == 'string' && value.trim().length == 0) { + return callback(new Error('请填写服务号')); + } else { + const newValue = parseInt(value); + if (newValue) { + if (newValue.toString() != value) { + this.formModel.serviceNumber = newValue; + } + const serviceNumberList = Object.keys(this.$store.state.runPlan.editData); + if (serviceNumberList.includes(value)) { + return callback(new Error('该服务号已存在,请重新填写')); + } else { + return callback(); + } + } else { + this.formModel.serviceNumber = ''; + } + + } + }, handleCommit() { - if (this.$route.query.planId || this.loadRunPlanId) { - if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) { + this.$refs.dataform.validateForm(() => { + if (this.$route.query.planId || this.loadRunPlanId) { checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.serviceNumber }).then(resp => { if (resp.data) { this.$emit('dispatchDialog', { @@ -79,11 +107,13 @@ export default { } }); } else { - this.$messageBox('长度在二到三位'); + this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph')); } - } else { - this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph')); - } + }); + // if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) { + // } else { + // this.$messageBox('长度在二到三位'); + // } }, handleConfirm(isNew = false) { this.doClose(); diff --git a/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue b/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue index b24a05fc5..4e287186f 100644 --- a/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue +++ b/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue @@ -58,7 +58,8 @@ export default { rules: { serviceNumber:[ - {required: true, validator: this.validateServiceNumber, trigger: 'blur'} + {required: true, validator: this.validateServiceNumber, trigger: 'blur'}, + {required: true, validator: this.validateServiceNumber, trigger: 'change'} ], beginTime: [ { required: true, message: '请填写开始时间', trigger: 'blur' } @@ -134,15 +135,24 @@ export default { this.dialogShow = true; }, validateServiceNumber(rule, value, callback) { - if (value.trim().length == 0) { + if (typeof value == 'string' && value.trim().length == 0) { return callback(new Error('请填写服务号')); } else { - const serviceNumberList = Object.keys(this.$store.state.runPlan.editData); - if (serviceNumberList.includes(value.trim())) { - return callback(new Error('该服务号已存在,请重新填写')); + const newValue = parseInt(value); + if (newValue) { + if (newValue.toString() != value) { + this.formModel.serviceNumber = newValue; + } + const serviceNumberList = Object.keys(this.$store.state.runPlan.editData); + if (serviceNumberList.includes(value)) { + return callback(new Error('该服务号已存在,请重新填写')); + } else { + return callback(); + } } else { - return callback(); + this.formModel.serviceNumber = ''; } + } }, validateRunningRouting(rule, value, callback) { diff --git a/src/views/planMonitor/newEditTool/menus/addTask.vue b/src/views/planMonitor/newEditTool/menus/addTask.vue index 0fd25eea5..25ce168e2 100644 --- a/src/views/planMonitor/newEditTool/menus/addTask.vue +++ b/src/views/planMonitor/newEditTool/menus/addTask.vue @@ -32,7 +32,7 @@ {{ $t('global.startTime')+$t('global.colon') }} - + diff --git a/src/views/planMonitor/newEditTool/menus/modifyingTask.vue b/src/views/planMonitor/newEditTool/menus/modifyingTask.vue index 4a9f5eac5..0585702a6 100644 --- a/src/views/planMonitor/newEditTool/menus/modifyingTask.vue +++ b/src/views/planMonitor/newEditTool/menus/modifyingTask.vue @@ -146,6 +146,7 @@ value-format="HH:mm:ss" size="mini" :clearable="false" + :picker-options="{selectableRange:'02:00:00-23:59:59'}" /> diff --git a/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue b/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue index 8c832b617..b00955840 100644 --- a/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue +++ b/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue @@ -80,8 +80,8 @@ export default { return { labelWidth: '100px', items: [ - { prop: 'beginTime', label: '开始时间', type: 'timePicker'}, - { prop: 'overTime', label: '结束时间', type: 'timePicker'}, + { prop: 'beginTime', label: '开始时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'}, + { prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'}, { prop: 'departureTimeInterval', label: '发车间隔', type: 'number'}, { prop: 'parkedTime', label: '停站时间', type: 'number'}, { prop: 'reentryTime', label: '折返时间', type: 'number'}, diff --git a/src/views/publish/examRule/draft/examFrom.vue b/src/views/publish/examRule/draft/examFrom.vue index f95524a4c..f71d1a4a5 100644 --- a/src/views/publish/examRule/draft/examFrom.vue +++ b/src/views/publish/examRule/draft/examFrom.vue @@ -24,6 +24,7 @@ value-format="timestamp" :disabled="isEdit" :picker-options="pickerOptions" + @change="handle" /> @@ -37,8 +38,8 @@ style="width: 100%;" value-format="timestamp" :disabled="true" - :picker-options="pickerOptions" /> + @@ -123,6 +124,7 @@ export default { pickerOptions: { disabledDate(time) { return time.getTime() < new Date(new Date().toLocaleDateString()).getTime(); + // return time.getTime() < Date.now() - 1 * 24 * 3600 * 1000; } }, formDetail: { @@ -217,6 +219,12 @@ export default { passMark: data.passMark }; }, + handle() { + var startAt = new Date(this.form.startDate) * 1000 / 1000; + if (startAt < Date.now()) { + this.form.startDate = new Date().getTime(); + } + }, getClassList() { if (this.isClassShow) { this.classList = []; @@ -255,34 +263,26 @@ export default { }); }, submitForm() { + this.submit('definition'); + }, + submit(type) { this.$refs['form'].validate((valid) => { if (valid) { - if (this.form.startDate) { - this.form.startDate = this.getDate(this.form.startDate); + const form = Object.assign({}, this.form); + if (form.startDate) { + form.startDate = this.getDate(form.startDate); } - if (this.form.endDate) { - this.form.endDate = this.getDate(this.form.endDate); + if (form.endDate) { + form.endDate = this.getDate(form.endDate); } - this.form['trial'] = this.trial; - this.$store.dispatch('exam/setCourseDetail', this.form); - this.$emit('definition', this.form); + form['trial'] = this.trial; + this.$store.dispatch('exam/setCourseDetail', form); + this.$emit(type, form); } }); }, createQuickly() { - this.$refs['form'].validate((valid) => { - if (valid) { - if (this.form.startDate) { - this.form.startDate = this.getDate(this.form.startDate); - } - if (this.form.endDate) { - this.form.endDate = this.getDate(this.form.endDate); - } - this.form['trial'] = this.trial; - this.$store.dispatch('exam/setCourseDetail', this.form); - this.$emit('createQuickly', this.form); - } - }); + this.submit('createQuickly'); }, getDate(date) { const now = new Date(date); diff --git a/src/views/publish/examRule/draft/index.vue b/src/views/publish/examRule/draft/index.vue index a48bc94d3..bd3cc9196 100644 --- a/src/views/publish/examRule/draft/index.vue +++ b/src/views/publish/examRule/draft/index.vue @@ -149,6 +149,7 @@ export default { this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据 const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`; const lessonId = this.$route.params.lessonId; + this.$store.dispatch('exam/setCourseDetail', {}); if (parseInt(lessonId)) { this.$router.replace({ path: `${path}`, query: { mapId: this.$route.query.mapId, lessonId: lessonId, noPreLogout: this.$route.query.noPreLogout } }); } else { diff --git a/src/views/publish/examRule/draft/rule.vue b/src/views/publish/examRule/draft/rule.vue index f776b8cea..c9a067b81 100644 --- a/src/views/publish/examRule/draft/rule.vue +++ b/src/views/publish/examRule/draft/rule.vue @@ -141,8 +141,8 @@ export default { name: this.course.name, // 名称 passingPoint: Number(this.course.passMark), // 及格分 remarks: this.course.desc, // 考试说明 - endTime: this.course.endTime, - startTime: this.course.startTime, + endTime: this.course.endDate, + startTime: this.course.startDate, type: this.course.type, // 类型 trial: this.course.trial == 2 // 权限判断 }; diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index 9bafd2d08..666e0a1da 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -76,7 +76,8 @@ export default { title: this.$t('publish.examTime'), prop: 'startTime', type: 'formatter', - format: 'yyyy-MM-dd hh:ss' + format: 'yyyy-MM-dd hh:ss', + width:'200px' }, { title: this.$t('publish.fullMark'), diff --git a/src/views/publish/publishISCS/index.vue b/src/views/publish/publishISCS/index.vue index 767b593ac..7eb19b43b 100644 --- a/src/views/publish/publishISCS/index.vue +++ b/src/views/publish/publishISCS/index.vue @@ -4,7 +4,7 @@ - {{ $t('global.confirm') }} + {{ $t('global.confirm') }} {{ $t('global.cancel') }} @@ -158,11 +158,14 @@ export default { }, doSave() { this.$refs.dataform.validateForm(() => { + this.loading = true; copyIscsData(this.formModel).then(res=>{ + this.loading = false; this.$message.success('复制ISCS数据成功'); this.close(); this.reloadTable(); }).catch(() => { + this.loading = false; this.reloadTable(); this.$messageBox('复制ISCS数据失败'); });