diff --git a/config/dev.env.js b/config/dev.env.js index b33ce77..1f0b5fa 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -7,6 +7,6 @@ module.exports = merge(prodEnv, { NODE_ENV: '"development"', // BASE_API: '"http://111.198.10.15:11802"' - BASE_API: '"http://192.168.8.109:8095"' + BASE_API: '"http://localhost:8095"' // BASE_API: '"http://192.168.0.166:8095"' }) diff --git a/config/dev.env.js b/config/dev.env.js index b33ce77..1f0b5fa 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -7,6 +7,6 @@ module.exports = merge(prodEnv, { NODE_ENV: '"development"', // BASE_API: '"http://111.198.10.15:11802"' - BASE_API: '"http://192.168.8.109:8095"' + BASE_API: '"http://localhost:8095"' // BASE_API: '"http://192.168.0.166:8095"' }) diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index f85acdc..2413c6f 100755 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -27,7 +27,7 @@ if (typeof (WebSocket) === 'undefined') { Notification({ title: '提示', - message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器或360浏览器极速模式!', + message: '当前浏览器无法接收实时信息,请使用谷歌浏览器或360浏览器极速模式!', type: 'warning', duration: 0 }) @@ -63,7 +63,7 @@ duration: 0 }) } - + // // 转换为json对象 // const data = JSON.parse(msg.data) // console.log(data) @@ -90,7 +90,7 @@ socket.onerror = function() { Notification({ title: '服务器错误', - message: '无法接收实时报警信息,请检查服务器后重新刷新页面', + message: '无法接收实时信息,请检查服务器后重新刷新页面', type: 'error', duration: 0 }) diff --git a/config/dev.env.js b/config/dev.env.js index b33ce77..1f0b5fa 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -7,6 +7,6 @@ module.exports = merge(prodEnv, { NODE_ENV: '"development"', // BASE_API: '"http://111.198.10.15:11802"' - BASE_API: '"http://192.168.8.109:8095"' + BASE_API: '"http://localhost:8095"' // BASE_API: '"http://192.168.0.166:8095"' }) diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index f85acdc..2413c6f 100755 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -27,7 +27,7 @@ if (typeof (WebSocket) === 'undefined') { Notification({ title: '提示', - message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器或360浏览器极速模式!', + message: '当前浏览器无法接收实时信息,请使用谷歌浏览器或360浏览器极速模式!', type: 'warning', duration: 0 }) @@ -63,7 +63,7 @@ duration: 0 }) } - + // // 转换为json对象 // const data = JSON.parse(msg.data) // console.log(data) @@ -90,7 +90,7 @@ socket.onerror = function() { Notification({ title: '服务器错误', - message: '无法接收实时报警信息,请检查服务器后重新刷新页面', + message: '无法接收实时信息,请检查服务器后重新刷新页面', type: 'error', duration: 0 }) diff --git a/src/views/attendance/makeReport.vue b/src/views/attendance/makeReport.vue index dd8e410..5f5d837 100644 --- a/src/views/attendance/makeReport.vue +++ b/src/views/attendance/makeReport.vue @@ -46,7 +46,7 @@ name: 'MakeReport', data() { const validateMonth = (rule, value, callback) => { - if (this.form.beginDateS === '' && this.form.endDateS === '' && value === '') { + if ((this.form.beginDateS === '' || this.form.beginDateS === null || this.form.endDateS === ''|| this.form.endDateS === null) && value === '') { callback(new Error('请选择考勤月或起止日期')) } else { this.$nextTick(() => { @@ -56,22 +56,17 @@ } } const validateBeginDate = (rule, value, callback) => { - if (this.form.month === '' && this.form.endDateS === '' && value === '') { + if (this.form.month === '' && (value === '' || value === null)) { callback(new Error('请选择考勤月或起止日期')) } else { - this.$nextTick(() => { - this.$refs['dataForm'].clearValidate() - }) callback() } } const validateEndDate = (rule, value, callback) => { - if (this.form.beginDateS === '' && this.form.month === '' && value === '') { + debugger + if (this.form.month === '' && (value === '' || value === null)) { callback(new Error('请选择考勤月或起止日期')) } else { - this.$nextTick(() => { - this.$refs['dataForm'].clearValidate() - }) callback() } } @@ -130,23 +125,23 @@ }) }, makeReportTrainee() { - if(this.form.month === ''){ - this.$message.error('请选择考勤月') - return - } - // 全屏加载动画 - const loading = this.$loading({ - lock: true, - text: '数据处理中,请稍后...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - makeReportTrainee(this.form).then(response => { - loading.close() - downloadFile(response.data, '考勤报表') - this.$message.success('生成报表成功') - }).catch((res) => { - loading.close() + this.$refs['dataForm'].validate((valid) => { + if (valid) { + // 全屏加载动画 + const loading = this.$loading({ + lock: true, + text: '数据处理中,请稍后...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + makeReportTrainee(this.form).then(response => { + loading.close() + downloadFile(response.data, '实习生考勤报表') + this.$message.success('生成报表成功') + }).catch((res) => { + loading.close() + }) + } }) } } diff --git a/config/dev.env.js b/config/dev.env.js index b33ce77..1f0b5fa 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -7,6 +7,6 @@ module.exports = merge(prodEnv, { NODE_ENV: '"development"', // BASE_API: '"http://111.198.10.15:11802"' - BASE_API: '"http://192.168.8.109:8095"' + BASE_API: '"http://localhost:8095"' // BASE_API: '"http://192.168.0.166:8095"' }) diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index f85acdc..2413c6f 100755 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -27,7 +27,7 @@ if (typeof (WebSocket) === 'undefined') { Notification({ title: '提示', - message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器或360浏览器极速模式!', + message: '当前浏览器无法接收实时信息,请使用谷歌浏览器或360浏览器极速模式!', type: 'warning', duration: 0 }) @@ -63,7 +63,7 @@ duration: 0 }) } - + // // 转换为json对象 // const data = JSON.parse(msg.data) // console.log(data) @@ -90,7 +90,7 @@ socket.onerror = function() { Notification({ title: '服务器错误', - message: '无法接收实时报警信息,请检查服务器后重新刷新页面', + message: '无法接收实时信息,请检查服务器后重新刷新页面', type: 'error', duration: 0 }) diff --git a/src/views/attendance/makeReport.vue b/src/views/attendance/makeReport.vue index dd8e410..5f5d837 100644 --- a/src/views/attendance/makeReport.vue +++ b/src/views/attendance/makeReport.vue @@ -46,7 +46,7 @@ name: 'MakeReport', data() { const validateMonth = (rule, value, callback) => { - if (this.form.beginDateS === '' && this.form.endDateS === '' && value === '') { + if ((this.form.beginDateS === '' || this.form.beginDateS === null || this.form.endDateS === ''|| this.form.endDateS === null) && value === '') { callback(new Error('请选择考勤月或起止日期')) } else { this.$nextTick(() => { @@ -56,22 +56,17 @@ } } const validateBeginDate = (rule, value, callback) => { - if (this.form.month === '' && this.form.endDateS === '' && value === '') { + if (this.form.month === '' && (value === '' || value === null)) { callback(new Error('请选择考勤月或起止日期')) } else { - this.$nextTick(() => { - this.$refs['dataForm'].clearValidate() - }) callback() } } const validateEndDate = (rule, value, callback) => { - if (this.form.beginDateS === '' && this.form.month === '' && value === '') { + debugger + if (this.form.month === '' && (value === '' || value === null)) { callback(new Error('请选择考勤月或起止日期')) } else { - this.$nextTick(() => { - this.$refs['dataForm'].clearValidate() - }) callback() } } @@ -130,23 +125,23 @@ }) }, makeReportTrainee() { - if(this.form.month === ''){ - this.$message.error('请选择考勤月') - return - } - // 全屏加载动画 - const loading = this.$loading({ - lock: true, - text: '数据处理中,请稍后...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - makeReportTrainee(this.form).then(response => { - loading.close() - downloadFile(response.data, '考勤报表') - this.$message.success('生成报表成功') - }).catch((res) => { - loading.close() + this.$refs['dataForm'].validate((valid) => { + if (valid) { + // 全屏加载动画 + const loading = this.$loading({ + lock: true, + text: '数据处理中,请稍后...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + makeReportTrainee(this.form).then(response => { + loading.close() + downloadFile(response.data, '实习生考勤报表') + this.$message.success('生成报表成功') + }).catch((res) => { + loading.close() + }) + } }) } } diff --git a/src/views/memberManage/listStaff.vue b/src/views/memberManage/listStaff.vue index 1ff7ff1..e74b911 100644 --- a/src/views/memberManage/listStaff.vue +++ b/src/views/memberManage/listStaff.vue @@ -210,7 +210,7 @@ this.columns.push( { text: '是否实习生', - value: 'personType', + value: 'personTypeName', align: 'center' }) } @@ -342,13 +342,22 @@ search() { this.fetchData(false) }, - // 获取集中器数据 + // 获取数据 fetchData(isNowPage = true) { this.listLoading = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 this.listQuery.offset = 1 } getPersonList(this.listQuery).then(response => { + if(response.data.rows){ + for(var i = 0;i