From 0371859d14ec609d34a9089182ecc67008b8a983 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Mon, 18 Sep 2023 14:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E5=8F=8Abug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trendAnalysis/components/searchArea.vue | 3 +- .../energy/analysis/trendAnalysis/index.vue | 10 - .../energy/base/energyPlcConnect/index.vue | 6 +- .../energyLimit/components/energyLimitAdd.vue | 2 +- .../monitoring/energyReportSearch/index.vue | 10 +- .../components/energyStatisticsDetAdd.vue | 2 +- .../groupClasses/components/groupClassAdd.vue | 15 +- src/views/group/base/groupClasses/index.vue | 17 +- .../groupTeam/components/groupTeamAdd.vue | 2 +- .../group/base/groupTeamScheduling/index.vue | 198 ++++-------------- 10 files changed, 79 insertions(+), 186 deletions(-) diff --git a/src/views/energy/analysis/trendAnalysis/components/searchArea.vue b/src/views/energy/analysis/trendAnalysis/components/searchArea.vue index e38f6c62..284f3a98 100644 --- a/src/views/energy/analysis/trendAnalysis/components/searchArea.vue +++ b/src/views/energy/analysis/trendAnalysis/components/searchArea.vue @@ -172,6 +172,7 @@ export default { this.getTypeList() this.getObjTree() this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时 + this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000] }, methods: { getTypeList() { @@ -276,7 +277,7 @@ export default { this.$modal.msgError('请选择能源类型') return false } - if (!this.objArr.length === 0) { + if (this.objArr.length === 0) { this.$modal.msgError('请选择对象') return false } else { diff --git a/src/views/energy/analysis/trendAnalysis/index.vue b/src/views/energy/analysis/trendAnalysis/index.vue index 059ecfed..7c847984 100644 --- a/src/views/energy/analysis/trendAnalysis/index.vue +++ b/src/views/energy/analysis/trendAnalysis/index.vue @@ -37,16 +37,6 @@ export default { this.chartData = [] } }) - // getEnergyTrend({ - // energyTypeId: "1681183397517406210", - // objId: "1679031282510532610", - // timeDim: "2", - // startTime: "1690732800000", - // endTime: "1690992000000" - // }).then((res) => { - // console.log(res) - // this.chartData = res.data - // }) }, switchChart() { if (this.activeName === 'bar') { diff --git a/src/views/energy/base/energyPlcConnect/index.vue b/src/views/energy/base/energyPlcConnect/index.vue index 539e7436..f7177ff0 100644 --- a/src/views/energy/base/energyPlcConnect/index.vue +++ b/src/views/energy/base/energyPlcConnect/index.vue @@ -92,7 +92,7 @@ export default { type: 'input', label: '标识名', placeholder: '标识名', - param: 'name' + param: 'cnName' }, { type: 'button', @@ -149,7 +149,7 @@ export default { queryParams: { pageNo: 1, pageSize: 20, - name: null + cnName: null }, paramVisible: false, energyTypeList: [], @@ -173,7 +173,7 @@ export default { switch (val.btnName) { case 'search': this.queryParams.pageNo = 1; - this.queryParams.name = val.name + this.queryParams.cnName = val.cnName this.getList() break default: diff --git a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue index 0ee81797..ff99ce57 100644 --- a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue +++ b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue @@ -47,7 +47,7 @@ - + diff --git a/src/views/energy/monitoring/energyReportSearch/index.vue b/src/views/energy/monitoring/energyReportSearch/index.vue index b14bef5c..db0166b2 100644 --- a/src/views/energy/monitoring/energyReportSearch/index.vue +++ b/src/views/energy/monitoring/energyReportSearch/index.vue @@ -118,16 +118,16 @@ export default { window.addEventListener('resize', () => { this.tableH = this.tableHeight(260) }) - this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()] + if (this.$route.params.startTime && this.$route.params.endTime) { + this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime] + } else { + this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()] + } this.queryParams.startTime = this.formConfig[2].defaultSelect[0] this.queryParams.endTime = this.formConfig[2].defaultSelect[1] this.getList() this.getTypeList() }, - mounted() { - console.log(this.$route.params.name) - console.log('22222') - }, methods: { getTypeList() { getEnergyTypeListAll().then((res) => { diff --git a/src/views/energy/monitoring/energyStatistics/components/energyStatisticsDetAdd.vue b/src/views/energy/monitoring/energyStatistics/components/energyStatisticsDetAdd.vue index fd021693..e31166b6 100644 --- a/src/views/energy/monitoring/energyStatistics/components/energyStatisticsDetAdd.vue +++ b/src/views/energy/monitoring/energyStatistics/components/energyStatisticsDetAdd.vue @@ -75,7 +75,7 @@ export default { { type: 'input', label: '参数名称', - placeholder: '方案名称', + placeholder: '参数名称', param: 'paramName' }, { diff --git a/src/views/group/base/groupClasses/components/groupClassAdd.vue b/src/views/group/base/groupClasses/components/groupClassAdd.vue index 4154787d..52272a1e 100644 --- a/src/views/group/base/groupClasses/components/groupClassAdd.vue +++ b/src/views/group/base/groupClasses/components/groupClassAdd.vue @@ -46,7 +46,7 @@ format='HH:mm' value-format='HH:mm' style="width: 100%;" - @change="timeFun" + @change="timeFun('start')" > @@ -58,7 +58,7 @@ format='HH:mm' value-format='HH:mm' style="width: 100%;" - @change="timeFun" + @change="timeFun('end')" > @@ -126,12 +126,19 @@ export default { }) } }, - timeFun() { + timeFun(val) { if (this.form.startTime && this.form.endTime) { if (this.form.startTime > this.form.endTime) { this.form.daySpan = 1 - } else { + } else if (this.form.startTime < this.form.endTime) { this.form.daySpan = 0 + } else { + if (val === 'start') { + this.form.startTime = '' + } else { + this.form.endTime = '' + } + this.$modal.msgWarning('班次开始时间和结束时间不能相同') } } }, diff --git a/src/views/group/base/groupClasses/index.vue b/src/views/group/base/groupClasses/index.vue index cf629042..0e065e83 100644 --- a/src/views/group/base/groupClasses/index.vue +++ b/src/views/group/base/groupClasses/index.vue @@ -116,7 +116,17 @@ export default { : undefined, { type: 'cancel', - btnName: '作废' + btnName: '作废', + showParam: { + type: '&', + data: [ + { + type: 'unequal', + name: 'status', + value: '不可用' + } + ] + } }, this.$auth.hasPermi('base:group-classes:delete') ? { @@ -225,8 +235,9 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - if (row.status) { - let _this = this + console.log(row) + let _this = this + if (row.status === '可用') {// 可用 _this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() { return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() { return deleteGroupClasses(row.id); diff --git a/src/views/group/base/groupTeam/components/groupTeamAdd.vue b/src/views/group/base/groupTeam/components/groupTeamAdd.vue index 628a601c..d1f7967b 100644 --- a/src/views/group/base/groupTeam/components/groupTeamAdd.vue +++ b/src/views/group/base/groupTeam/components/groupTeamAdd.vue @@ -7,7 +7,7 @@ - + diff --git a/src/views/group/base/groupTeamScheduling/index.vue b/src/views/group/base/groupTeamScheduling/index.vue index 11bb250a..c1cb2e50 100644 --- a/src/views/group/base/groupTeamScheduling/index.vue +++ b/src/views/group/base/groupTeamScheduling/index.vue @@ -37,7 +37,6 @@ 班组上下片查询 班组能源查询 班组检测查询 - 查询 @@ -66,7 +65,7 @@
- + { - this.list = res.data || [] + let obj = res.data || {} + if (obj) { + for (let item in obj) { + for (let i = 0; i < obj[item].length; i++) { + if (!obj[item][i].teamId) { + obj[item][i].teamId = '' + } + } + } + } + this.list = obj }).catch(() => { - this.list = [] + this.list = {} this.settingBtnDis = true // 禁用设置按钮 }) }, @@ -287,10 +174,18 @@ export default { }, // 确认 confirmSetting() { + let num = 0 + // 当月数据的话,今天及今天之前的不传 + if (moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')) { + num = Number(moment().format('DD')) + } else { + num = 0 + } + // 下月数据全部都传 // 打平数据 let tempArr = Object.values(this.list) let arr = [] - for (let i = 0; i < tempArr.length; i++) { + for (let i = num; i < tempArr.length; i++) { for (let j = 0; j < tempArr[i].length; j++) { arr.push(tempArr[i][j]) } @@ -298,6 +193,7 @@ export default { createOrUpdateList(arr).then(res => { if (res.code === 0) { this.showSetting = !this.showSetting + this.$modal.msgSuccess("操作成功") this.getList() // 数据更新 } }) @@ -314,9 +210,9 @@ export default { }, // 自动排班 schedulingBtn() { + let tempData = this.list // 次月1号有值前端排班 if (this.list[1][0].teamId) { - console.log('次月1号有值前端排班') let tempArr = Object.values(this.list) let arr = [] let n = 0 @@ -332,27 +228,24 @@ export default { } } } - console.log(arr) + let tempNum = 0 for (let k = 0; k < tempArr.length; k++) { for (let v = 0; v < tempArr[k].length; v++) { - let t = (k*(k+1)+v) % arr.length - // console.log(t) + let t = tempNum % arr.length if (arr.length === 1) { - this.list[k+1][v].teamId = arr[0] + tempData[k+1][v].teamId = arr[0] } else { - if (k === 0 && v === 0) { - this.list[k+1][v].teamId = arr[0] - } else { - this.list[k+1][v].teamId = arr[t] - } + tempData[k+1][v].teamId = arr[t] } + tempNum++ } } + this.list = [] + this.list = tempData } else { // 次月1号没有值,接口排班 - console.log('次月1号没有值接口排班') autoSet().then(res => { - this.list = res.data || [] + this.list = res.data || {} }) } }, @@ -389,33 +282,24 @@ export default { switch (val) { case '1': this.$router.push({ - path: '/core/monitoring/production-line-data', - // name: 'reportDesign', - params: { startTime: '1111', endTime: '2222' } + // path: '/core/monitoring/production-line-data', + name: 'ProductionLineData', + params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } }) break; - case '2': + case '2': // 能源 this.$router.push({ - // path: '/energy/monitoring/energy-report-search', name: 'EnergyReportSearch', - params: { startTime: '1111', endTime: '2222' } + params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } }) - console.log('aaa') break; default: this.$router.push({ - path: '/quality/monitoring/quality-statistics', - // name: 'reportDesign', - params: { startTime: '1111', endTime: '2222' } + // path: '/quality/monitoring/quality-statistics', + name: 'QualityStatistics', + params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } }) } - }, - aaa() { - console.log(this.list) - }, - a() { - console.log('11111') - this.$forceUpdate() } } }