|
|
@@ -101,7 +101,7 @@
|
|
|
:total="total"
|
|
|
v-model:page="queryParams.pageNum"
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="fetchScoreSummaryData(selectedMonth,monthScore.deptId)"
|
|
|
+ @pagination="handlePagination"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -119,7 +119,7 @@
|
|
|
<el-input-number
|
|
|
v-model="maintenanceOrderStats.plannedCount"
|
|
|
:min="0"
|
|
|
- :readonly="!isFirst"
|
|
|
+ :readonly="!hasFirst()"
|
|
|
controls-position="right"
|
|
|
class="full-width-input"
|
|
|
></el-input-number>
|
|
|
@@ -131,7 +131,7 @@
|
|
|
<el-input-number
|
|
|
v-model="maintenanceOrderStats.actualCount"
|
|
|
:min="0"
|
|
|
- :readonly="!isFirst"
|
|
|
+ :readonly="!hasFirst()"
|
|
|
controls-position="right"
|
|
|
class="full-width-input"
|
|
|
></el-input-number>
|
|
|
@@ -160,7 +160,7 @@
|
|
|
</div>
|
|
|
<el-input
|
|
|
v-model="maintenanceOrderStats.explainCode"
|
|
|
- :readonly="!isFirst"
|
|
|
+ :readonly="!hasFirst()"
|
|
|
maxlength="50"
|
|
|
:class="{ 'required-field': isRemarksRequired }"
|
|
|
placeholder="输入说明(限制50字以内)"
|
|
|
@@ -176,7 +176,7 @@
|
|
|
:max="1.2"
|
|
|
:step="0.1"
|
|
|
:controls="true"
|
|
|
- :readonly="!isThird"
|
|
|
+ :readonly="!hasThird()"
|
|
|
controls-position="right"
|
|
|
class="full-width-input"
|
|
|
></el-input-number>
|
|
|
@@ -191,7 +191,7 @@
|
|
|
:max="1.5"
|
|
|
:step="0.1"
|
|
|
:controls="true"
|
|
|
- :readonly="!isThird"
|
|
|
+ :readonly="!hasThird()"
|
|
|
controls-position="right"
|
|
|
class="full-width-input"
|
|
|
></el-input-number>
|
|
|
@@ -324,7 +324,7 @@
|
|
|
</div>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-card v-if="!isList && !isFirst" class="card-form" shadow="hover">
|
|
|
+ <el-card v-if="!isList && !hasFirst()" class="card-form" shadow="hover">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<el-tooltip placement="top" effect="light">
|
|
|
<template #content>
|
|
|
@@ -356,11 +356,11 @@
|
|
|
<!-- 底部按钮 -->
|
|
|
<div v-if="!isList" class="button-group">
|
|
|
<el-button v-hasPermi="['gxt:scoresummary:second','gxt:scoresummary:third']" @click="handleCancel">返回</el-button>
|
|
|
- <el-button v-hasPermi="['gxt:scoresummary:first']" v-if="monthScore.status==0" @click="handleFeedback">反馈</el-button>
|
|
|
- <el-button v-hasPermi="['gxt:scoresummary:first']" v-if="monthScore.status==0" @click="handleSubmit">提交评分</el-button>
|
|
|
- <el-button v-hasPermi="['gxt:scoresummary:second']" v-if="monthScore.status==1" @click="agreeFeedBack">取消全组扣分</el-button>
|
|
|
- <el-button v-hasPermi="['gxt:scoresummary:second']" v-if="monthScore.status==1" @click="againstFeedBack">拒绝取消扣分</el-button>
|
|
|
- <el-button v-hasPermi="['gxt:scoresummary:third']" v-if="monthScore.status==2" @click="submitCoefficient">提交本月系数</el-button>
|
|
|
+ <el-button v-if="hasFirst()" @click="handleFeedback">反馈</el-button>
|
|
|
+ <el-button v-if="hasFirst()" @click="handleSubmit">提交评分</el-button>
|
|
|
+ <el-button v-if="hasSecond()" @click="agreeFeedBack">取消全组扣分</el-button>
|
|
|
+ <el-button v-if="hasSecond()" @click="againstFeedBack">拒绝取消扣分</el-button>
|
|
|
+ <el-button v-if="hasThird()" @click="submitCoefficient">提交本月系数</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -390,7 +390,7 @@
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button class="button-ex" @click="handleFeedbackCancel">取消</el-button>
|
|
|
- <el-button class="button-ex" type="primary" @click="handleFeedbackSubmit">提交</el-button>
|
|
|
+ <el-button v-if="hasFirst" class="button-ex" type="primary" @click="handleFeedbackSubmit">提交</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
@@ -408,9 +408,6 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
isList: true,
|
|
|
- isFirst: false,
|
|
|
- isSecond: false,
|
|
|
- isThird:false,
|
|
|
isInfo:false,
|
|
|
monthScore: {
|
|
|
status: 0,
|
|
|
@@ -458,7 +455,6 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.initMonthOptions(0,null);
|
|
|
- this.checkPermissions();
|
|
|
this.initDict();
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -483,6 +479,25 @@ export default {
|
|
|
'maintenanceOrderStats.actualCount': 'calculateDeduction'
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 判断选择的月份是否小于当前月份
|
|
|
+ isMonthLessThanCurrent(month) {
|
|
|
+ if (!month) return false;
|
|
|
+ const selectedDate = new Date(month + '-01');
|
|
|
+ const currentDate = new Date();
|
|
|
+ // 设置为当月的第一天,便于比较
|
|
|
+ currentDate.setDate(1);
|
|
|
+ currentDate.setHours(0, 0, 0, 0);
|
|
|
+ return selectedDate < currentDate;
|
|
|
+ },
|
|
|
+ hasFirst() {
|
|
|
+ return this.monthScore.status === 0 && checkPermi(['gxt:scoresummary:first']) && this.isMonthLessThanCurrent(this.selectedMonth);
|
|
|
+ },
|
|
|
+ hasSecond() {
|
|
|
+ return this.monthScore.status === 1 && checkPermi(['gxt:scoresummary:second']) && this.isMonthLessThanCurrent(this.selectedMonth);
|
|
|
+ },
|
|
|
+ hasThird() {
|
|
|
+ return this.monthScore.status === 2 && checkPermi(['gxt:scoresummary:third']) && this.isMonthLessThanCurrent(this.selectedMonth);
|
|
|
+ },
|
|
|
calculateDeduction() {
|
|
|
const { plannedCount, actualCount } = this.maintenanceOrderStats;
|
|
|
// 当计划值大于实际值时,计算差值;否则清空
|
|
|
@@ -492,6 +507,9 @@ export default {
|
|
|
this.maintenanceOrderStats.groupDeduction = 0; // 或设为 0
|
|
|
}
|
|
|
},
|
|
|
+ handlePagination() {
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth, this.monthScore.deptId);
|
|
|
+ },
|
|
|
handleReview(row) {
|
|
|
const rtType = this.isInfo ? 1 : 0;
|
|
|
getScoreSummary(row.monthPeriod, rtType, row.deptId).then(response => {
|
|
|
@@ -517,7 +535,7 @@ export default {
|
|
|
|
|
|
// 初始化字典数据
|
|
|
initDict() {
|
|
|
- const { gxt_inspection_type, gxt_maintenance_type } = this.useDict("gxt_inspection_type", "gxt_maintenance_type")
|
|
|
+ const { gxt_inspection_type, gxt_maintenance_type } = useDict("gxt_inspection_type", "gxt_maintenance_type")
|
|
|
this.gxtInspectionType = gxt_inspection_type || []
|
|
|
this.gxtMaintenanceType = gxt_maintenance_type || []
|
|
|
if(!checkPermi(['gxt:scoresummary:second']) && !checkPermi(['gxt:scoresummary:third'])) {
|
|
|
@@ -563,27 +581,9 @@ export default {
|
|
|
|
|
|
// 获取月度工分汇总数据
|
|
|
fetchScoreSummaryData(monthPeriod,deptParam) {
|
|
|
+ this.feedbackDialogVisible = false;
|
|
|
if(this.isList) {
|
|
|
- // if(this.statusFilter && this.statusFilter==1) {
|
|
|
- // if(checkPermi(['gxt:scoresummary:second']) && checkPermi(['gxt:scoresummary:third'])) {
|
|
|
- // this.queryParams.status = null;
|
|
|
- // this.queryParams.statusList = '1,2';
|
|
|
- // }else if (checkPermi(['gxt:scoresummary:second'])) {
|
|
|
- // this.queryParams.status = 1;
|
|
|
- // this.queryParams.statusList = null;
|
|
|
- // }else if (checkPermi(['gxt:scoresummary:third'])) {
|
|
|
- // this.queryParams.status = 2;
|
|
|
- // this.queryParams.statusList = null;
|
|
|
- // }else{
|
|
|
- // this.queryParams.status = null;
|
|
|
- // this.queryParams.statusList = null;
|
|
|
- // }
|
|
|
- // }else{
|
|
|
- // this.queryParams.status = null;
|
|
|
- // this.queryParams.statusList = null;
|
|
|
- // }
|
|
|
this.selectedMonth = this.getLastMonth();
|
|
|
- // console.log(this.queryParams);
|
|
|
getMonthScoreList(this.queryParams).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.departmentStats = response.rows;
|
|
|
@@ -616,7 +616,7 @@ export default {
|
|
|
|
|
|
// 设置非停设备统计数据
|
|
|
if (monthScoreGet.monthRuntimes) {
|
|
|
- this.runtimeList = monthScoreGet.monthRuntimes;;
|
|
|
+ this.runtimeList = monthScoreGet.monthRuntimes;
|
|
|
}
|
|
|
|
|
|
// 设置维保机型类型统计数据
|
|
|
@@ -644,6 +644,7 @@ export default {
|
|
|
if (monthScoreGet.userScores) {
|
|
|
this.userScoreList = monthScoreGet.userScores;
|
|
|
}
|
|
|
+ this.checkPermissions();
|
|
|
} else {
|
|
|
console.error('获取月度工分汇总数据失败:', response.msg);
|
|
|
}
|
|
|
@@ -658,13 +659,6 @@ export default {
|
|
|
// 获取选择月份的数据
|
|
|
this.fetchScoreSummaryData(value,this.monthScore.deptId);
|
|
|
},
|
|
|
-
|
|
|
- addMonthScore() {
|
|
|
- // console.log('提交上月评分按钮被点击')
|
|
|
- this.isList = false;
|
|
|
- this.initMonthOptions(0,null);
|
|
|
- this.checkPermissions();
|
|
|
- },
|
|
|
|
|
|
// 处理取消按钮点击事件
|
|
|
handleCancel() {
|
|
|
@@ -702,13 +696,15 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success('评分提交成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
this.$message.error(response.msg)
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
}
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
}).catch(error => {
|
|
|
console.error('评分提交失败:', error)
|
|
|
this.$message.error('评分提交失败,请查看控制台错误信息')
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -727,13 +723,15 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success('取消全组扣分成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
this.$message.error(response.msg)
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
}
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
}).catch(error => {
|
|
|
console.error('审核提交失败:', error)
|
|
|
this.$message.error('审核提交失败,请查看控制台错误信息')
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -752,13 +750,15 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success('审核提交成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
this.$message.error(response.msg)
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
}
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
}).catch(error => {
|
|
|
console.error('审核提交失败:', error)
|
|
|
this.$message.error('审核提交失败,请查看控制台错误信息')
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -776,13 +776,15 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success('系数提交成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
this.$message.error(response.msg)
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
}
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
}).catch(error => {
|
|
|
console.error('系数提交失败:', error)
|
|
|
this.$message.error('系数提交失败,请查看控制台错误信息')
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -818,14 +820,7 @@ export default {
|
|
|
|
|
|
// 检查权限
|
|
|
checkPermissions() {
|
|
|
- this.isFirst = checkPermi(['gxt:scoresummary:first']) && this.monthScore.status==0;
|
|
|
- this.isSecond = checkPermi(['gxt:scoresummary:second']) && this.monthScore.status==1;
|
|
|
- this.isThird = checkPermi(['gxt:scoresummary:third']) && this.monthScore.status==2;
|
|
|
this.isInfo = checkPermi(['gxt:scoresummary:first']) || checkPermi(['gxt:scoresummary:second']) || checkPermi(['gxt:scoresummary:third']);
|
|
|
- // console.log(this.isFirst);
|
|
|
- // console.log(this.isSecond);
|
|
|
- // console.log(this.isThird);
|
|
|
- // console.log(this.monthScore.status);
|
|
|
},
|
|
|
|
|
|
// 处理反馈弹窗关闭
|
|
|
@@ -873,13 +868,15 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success('反馈提交成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
this.$message.error(response.msg)
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
}
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
}).catch(error => {
|
|
|
console.error('反馈提交失败:', error)
|
|
|
this.$message.error('反馈提交失败,请查看控制台错误信息')
|
|
|
+ this.monthScore.status = this.monthScore.previousStatus;
|
|
|
})
|
|
|
// 提交后关闭弹窗
|
|
|
this.feedbackDialogVisible = false;
|