|
|
@@ -23,24 +23,37 @@
|
|
|
v-model="statusFilter"
|
|
|
placeholder="请选择状态"
|
|
|
clearable
|
|
|
- style="width: 120px;"
|
|
|
+ style="width: 120px;margin-right: 20px;"
|
|
|
@change="handleStatusChange"
|
|
|
>
|
|
|
<el-option style="margin-left: 10px;" label="待处理" :value="1"></el-option>
|
|
|
</el-select>
|
|
|
+ <el-button style="padding: 10px;" type="primary" v-hasPermi="['gxt:scoresummary:first']" @click="addMonthScore">+ 提交上月评分</el-button>
|
|
|
</div>
|
|
|
<div class="form-content">
|
|
|
<el-table :data="departmentStats" style="width: 100%">
|
|
|
- <el-table-column prop="department" label="部门"></el-table-column>
|
|
|
+ <el-table-column prop="deptName" label="部门"></el-table-column>
|
|
|
+ <el-table-column prop="monthPeriod" label="汇总月份"></el-table-column>
|
|
|
+ <el-table-column prop="status" label="状态">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span v-if="row.status === 0">未提交</span>
|
|
|
+ <span v-else-if="row.status === 1" style="color: orange;">反馈待处理</span>
|
|
|
+ <span v-else-if="row.status === 2" style="color: blue;">待终审</span>
|
|
|
+ <span v-else-if="row.status === 3" style="color: green;">完成</span>
|
|
|
+ <span v-else>未知状态</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="plannedCount" label="计划维保台数"></el-table-column>
|
|
|
<el-table-column prop="actualCount" label="实际维保台数"></el-table-column>
|
|
|
<el-table-column prop="groupDeduction" label="全组扣分"></el-table-column>
|
|
|
<el-table-column prop="explainCode" label="说明"></el-table-column>
|
|
|
- <el-table-column prop="workOrderCoefficient" label="本月维保工单系数"></el-table-column>
|
|
|
- <el-table-column prop="repairOrderCoefficient" label="本月维修工单系数"></el-table-column>
|
|
|
+ <el-table-column prop="workOrderCoefficient" label="上月维保工单系数"></el-table-column>
|
|
|
+ <el-table-column prop="repairOrderCoefficient" label="上月维修工单系数"></el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-tag type="primary" @click="handleReview(scope.row)" style="cursor: pointer;">审核</el-tag>
|
|
|
+ <el-tag type="primary" @click="handleReview(scope.row)" style="cursor: pointer;padding: 5px 10px;margin-right: 10px;">查看</el-tag>
|
|
|
+ <el-tag v-hasPermi="['gxt:scoresummary:second']" v-if="scope.row.status==1" type="warning" @click="handleReview(scope.row)" style="cursor: pointer;padding: 5px 10px;margin-right: 10px;">处理反馈</el-tag>
|
|
|
+ <el-tag v-hasPermi="['gxt:scoresummary:third']" v-if="scope.row.status==2" type="danger" @click="handleReview(scope.row)" style="cursor: pointer;padding: 5px 10px;">终审</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -90,8 +103,14 @@
|
|
|
<el-col :span="4">
|
|
|
<div class="statistic-item">
|
|
|
<div class="statistic-label">
|
|
|
- 说明
|
|
|
- <span v-if="isRemarksRequired" class="required-mark">*</span>
|
|
|
+ <el-tooltip placement="top" effect="light">
|
|
|
+ <template #content>
|
|
|
+ <el-tag style="padding: 5px;" v-if="monthScore.coefficientScore.status==2" type="danger">取消扣分申请已拒绝</el-tag>
|
|
|
+ <el-tag style="padding: 5px;" v-else-if="monthScore.coefficientScore.status==1" type="success">取消扣分申请已通过</el-tag>
|
|
|
+ <el-tag style="padding: 5px;" v-else type="primary">全组扣分未处理</el-tag>
|
|
|
+ </template>
|
|
|
+ <span style="cursor: pointer;">说明<span v-if="isRemarksRequired" class="required-mark">*</span></span>
|
|
|
+ </el-tooltip>
|
|
|
</div>
|
|
|
<el-input
|
|
|
v-model="maintenanceOrderStats.explainCode"
|
|
|
@@ -261,12 +280,44 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
+
|
|
|
+ <el-card v-if="!isList && !isFirst" class="card-form" shadow="hover">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <el-tooltip placement="top" effect="light">
|
|
|
+ <template #content>
|
|
|
+ <el-tag style="padding: 5px;" v-if="monthScore.coefficientScore.status==2" type="danger">取消扣分申请已拒绝</el-tag>
|
|
|
+ <el-tag style="padding: 5px;" v-else-if="monthScore.coefficientScore.status==1" type="success">取消扣分申请已通过</el-tag>
|
|
|
+ <el-tag style="padding: 5px;" v-else type="primary">全组扣分未处理</el-tag>
|
|
|
+ </template>
|
|
|
+ <span style="font-weight: bold;margin-right: 20px;">评分更改说明</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <div class="form-content">
|
|
|
+ <el-form style="margin-top: 20px;">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ style="width: 100%"
|
|
|
+ :rows="4"
|
|
|
+ placeholder="请输入评分更改的详细说明"
|
|
|
+ v-model="monthScore.feedbackContent"
|
|
|
+ maxlength="200"
|
|
|
+ readonly
|
|
|
+ show-word-limit>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
<div v-if="!isList" class="button-group">
|
|
|
- <el-button @click="handleCancel">取消</el-button>
|
|
|
- <el-button @click="handleFeedback">反馈</el-button>
|
|
|
- <el-button @click="handleSubmit">提交评分</el-button>
|
|
|
+ <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>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -320,7 +371,7 @@ export default {
|
|
|
isInfo:false,
|
|
|
monthScore: {
|
|
|
status: 0,
|
|
|
- deptId: null,
|
|
|
+ deptId: 0,
|
|
|
feedbackContent: '' // 添加feedbackContent属性
|
|
|
},
|
|
|
selectedMonth: null, // 默认选中的月份
|
|
|
@@ -358,7 +409,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.initMonthOptions();
|
|
|
+ this.initMonthOptions(0,null);
|
|
|
this.checkPermissions();
|
|
|
this.initDict();
|
|
|
},
|
|
|
@@ -386,11 +437,12 @@ export default {
|
|
|
this.maintenanceOrderStats.groupDeduction = 0; // 或设为 0
|
|
|
}
|
|
|
},
|
|
|
- // 处理审核点击事件
|
|
|
handleReview(row) {
|
|
|
- console.log('审核按钮被点击,行数据:', row);
|
|
|
- // 在这里添加审核操作的逻辑
|
|
|
- this.$message.success('审核功能待实现,选中行的部门为: ' + row.department);
|
|
|
+ this.isList = false;
|
|
|
+ this.monthScore.id=row.id;
|
|
|
+ this.monthScore.status = row.status;
|
|
|
+ this.initMonthOptions(row.deptId);
|
|
|
+ this.checkPermissions();
|
|
|
},
|
|
|
// 根据inspectionTypeId获取inspectionType标签
|
|
|
getInspectionTypeLabel(inspectionTypeId) {
|
|
|
@@ -416,17 +468,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 初始化月份选项
|
|
|
- initMonthOptions() {
|
|
|
+ initMonthOptions(param,monthParam) {
|
|
|
// 从后端接口获取月份选项数据
|
|
|
- getSummaryMonths(0).then(response => {
|
|
|
+ getSummaryMonths(param).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.monthOptions = response.dictList || [];
|
|
|
|
|
|
// 如果有月份选项数据,设置默认选中第一个
|
|
|
if (this.monthOptions.length > 0) {
|
|
|
- this.selectedMonth = this.monthOptions[0].value;
|
|
|
+ if(monthParam && monthParam!=null) {
|
|
|
+ this.selectedMonth = monthParam;
|
|
|
+ }else{
|
|
|
+ this.selectedMonth = this.monthOptions[0].value;
|
|
|
+ }
|
|
|
// 获取默认月份的数据
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth);
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,param);
|
|
|
}
|
|
|
} else {
|
|
|
console.error('获取月份选项数据失败:', response.msg);
|
|
|
@@ -441,19 +497,31 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 获取月度工分汇总数据
|
|
|
- fetchScoreSummaryData(monthPeriod) {
|
|
|
+ fetchScoreSummaryData(monthPeriod,deptParam) {
|
|
|
if(this.isList) {
|
|
|
- if(this.statusFilter==1 && checkPermi(['gxt:scoresummary:second'])) {
|
|
|
- this.queryParams.status = 1;
|
|
|
- }else if (this.statusFilter==1 && checkPermi(['gxt:scoresummary:third'])) {
|
|
|
- this.queryParams.status = 2;
|
|
|
+ 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;
|
|
|
}
|
|
|
- console.log(this.queryParams);
|
|
|
+ // console.log(this.queryParams);
|
|
|
getMonthScoreList(this.queryParams).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.departmentStats = response.monthScoreList;
|
|
|
+ // console.log(this.departmentStats);
|
|
|
}else{
|
|
|
this.departmentStats = [];
|
|
|
}
|
|
|
@@ -466,11 +534,11 @@ export default {
|
|
|
// 根据权限设置rtType参数
|
|
|
const rtType = this.isInfo ? 1 : 0;
|
|
|
|
|
|
- getScoreSummary(monthPeriod, rtType).then(response => {
|
|
|
+ getScoreSummary(monthPeriod, rtType, deptParam).then(response => {
|
|
|
if (response.code === 200 && response.monthScore) {
|
|
|
const monthScoreGet = response.monthScore;
|
|
|
this.monthScore = monthScoreGet;
|
|
|
- console.log(monthScoreGet);
|
|
|
+ // console.log(monthScoreGet);
|
|
|
|
|
|
// 设置本月维保工单统计数据
|
|
|
if (monthScoreGet.coefficientScore) {
|
|
|
@@ -517,35 +585,46 @@ export default {
|
|
|
|
|
|
// 处理月份变化
|
|
|
handleMonthChange(value) {
|
|
|
- console.log('选择的月份:', value);
|
|
|
+ // console.log('选择的月份:', value);
|
|
|
// 获取选择月份的数据
|
|
|
- this.fetchScoreSummaryData(value);
|
|
|
+ this.fetchScoreSummaryData(value,this.monthScore.deptId);
|
|
|
+ },
|
|
|
+
|
|
|
+ addMonthScore() {
|
|
|
+ // console.log('提交上月评分按钮被点击')
|
|
|
+ this.isList = false;
|
|
|
+ this.initMonthOptions(0,null);
|
|
|
+ this.checkPermissions();
|
|
|
},
|
|
|
|
|
|
// 处理取消按钮点击事件
|
|
|
handleCancel() {
|
|
|
- console.log('取消按钮被点击')
|
|
|
+ // console.log('返回按钮被点击')
|
|
|
+ this.isList = true;
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
// 在这里添加取消操作的逻辑
|
|
|
},
|
|
|
|
|
|
// 处理反馈按钮点击事件
|
|
|
handleFeedback() {
|
|
|
- console.log('反馈按钮被点击')
|
|
|
+ // console.log('反馈按钮被点击')
|
|
|
// 只有当isFirst为true时才显示弹窗
|
|
|
- if (this.isFirst) {
|
|
|
- const planned = parseInt(this.maintenanceOrderStats.plannedCount) || 0;
|
|
|
- const actual = parseInt(this.maintenanceOrderStats.actualCount) || 0;
|
|
|
- if(actual < planned && this.maintenanceOrderStats.explainCode=='') {
|
|
|
- this.$message.warning('请输入全组扣分说明');
|
|
|
- return;
|
|
|
- }
|
|
|
- this.feedbackDialogVisible = true;
|
|
|
+ const planned = parseInt(this.maintenanceOrderStats.plannedCount) || 0;
|
|
|
+ const actual = parseInt(this.maintenanceOrderStats.actualCount) || 0;
|
|
|
+ if(actual < planned && this.maintenanceOrderStats.explainCode=='') {
|
|
|
+ this.$message.warning('请输入全组扣分说明');
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.feedbackDialogVisible = true;
|
|
|
},
|
|
|
|
|
|
// 处理提交评分按钮点击事件
|
|
|
handleSubmit() {
|
|
|
- console.log('提交评分按钮被点击')
|
|
|
+ // console.log('提交评分按钮被点击')
|
|
|
+ if(this.monthScore.status != 0) {
|
|
|
+ this.$message.warning('请勿重复提交评分!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 在这里添加提交评分操作的逻辑
|
|
|
this.monthScore.previousStatus = this.monthScore.status;
|
|
|
this.monthScore.status = 2;
|
|
|
@@ -554,7 +633,7 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
alert('评分提交成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth);
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
alert(response.msg)
|
|
|
}
|
|
|
@@ -563,6 +642,80 @@ export default {
|
|
|
alert('评分提交失败,请查看控制台错误信息')
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ agreeFeedBack() {
|
|
|
+ // console.log('通过反馈按钮被点击')
|
|
|
+ if(this.monthScore.status != 1) {
|
|
|
+ this.$message.warning('反馈已审核,请勿重复操作!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 在这里添加提交评分操作的逻辑
|
|
|
+ this.monthScore.previousStatus = this.monthScore.status;
|
|
|
+ this.monthScore.status = 2;
|
|
|
+ this.maintenanceOrderStats.status = 1;
|
|
|
+ this.monthScore.coefficientScore = this.maintenanceOrderStats;
|
|
|
+ submitMonthScore(this.monthScore).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ alert('取消全组扣分成功!');
|
|
|
+ this.checkPermissions();
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
+ } else {
|
|
|
+ alert(response.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('审核提交失败:', error)
|
|
|
+ alert('审核提交失败,请查看控制台错误信息')
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ againstFeedBack() {
|
|
|
+ // console.log('不通过反馈按钮被点击')
|
|
|
+ if(this.monthScore.status != 1) {
|
|
|
+ this.$message.warning('反馈已审核,请勿重复操作!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 在这里添加提交评分操作的逻辑
|
|
|
+ this.monthScore.previousStatus = this.monthScore.status;
|
|
|
+ this.monthScore.status = 2;
|
|
|
+ this.maintenanceOrderStats.status = 2;
|
|
|
+ this.monthScore.coefficientScore = this.maintenanceOrderStats;
|
|
|
+ submitMonthScore(this.monthScore).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ alert('审核提交成功!');
|
|
|
+ this.checkPermissions();
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
+ } else {
|
|
|
+ alert(response.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('审核提交失败:', error)
|
|
|
+ alert('审核提交失败,请查看控制台错误信息')
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ submitCoefficient() {
|
|
|
+ // console.log('主任提交本月系数按钮被点击')
|
|
|
+ if(this.monthScore.status != 2) {
|
|
|
+ this.$message.warning('系数已提交,请勿重复操作!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 在这里添加提交评分操作的逻辑
|
|
|
+ this.monthScore.previousStatus = this.monthScore.status;
|
|
|
+ this.monthScore.status = 3;
|
|
|
+ this.monthScore.coefficientScore = this.maintenanceOrderStats;
|
|
|
+ submitMonthScore(this.monthScore).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ alert('系数提交成功!');
|
|
|
+ this.checkPermissions();
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
+ } else {
|
|
|
+ alert(response.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('系数提交失败:', error)
|
|
|
+ alert('系数提交失败,请查看控制台错误信息')
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 初始化默认月份选项(原有逻辑)
|
|
|
initDefaultMonthOptions() {
|
|
|
@@ -591,7 +744,7 @@ export default {
|
|
|
this.selectedMonth = `${defaultYear}-${defaultMonth}`;
|
|
|
|
|
|
// 获取默认月份的数据
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth);
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
},
|
|
|
|
|
|
// 检查权限
|
|
|
@@ -600,9 +753,10 @@ export default {
|
|
|
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.isFirst);
|
|
|
+ // console.log(this.isSecond);
|
|
|
+ // console.log(this.isThird);
|
|
|
+ // console.log(this.monthScore.status);
|
|
|
},
|
|
|
|
|
|
// 处理反馈弹窗关闭
|
|
|
@@ -621,14 +775,16 @@ export default {
|
|
|
|
|
|
// 处理反馈弹窗提交按钮
|
|
|
handleFeedbackSubmit() {
|
|
|
+ if(this.monthScore.status != 0) {
|
|
|
+ this.$message.warning('请勿重复提交反馈!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 添加验证逻辑,确保用户输入了反馈内容
|
|
|
if (!this.monthScore.feedbackContent || this.monthScore.feedbackContent.trim() === '') {
|
|
|
this.$message.warning('请输入评分更改说明');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- // 这里可以添加提交反馈的逻辑
|
|
|
- console.log('提交反馈:', this.monthScore.feedbackContent);
|
|
|
+ // console.log('提交反馈:', this.monthScore.feedbackContent);
|
|
|
this.monthScore.previousStatus = this.monthScore.status;
|
|
|
this.monthScore.status = 1;
|
|
|
this.monthScore.coefficientScore = this.maintenanceOrderStats;
|
|
|
@@ -636,7 +792,7 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
alert('反馈提交成功!');
|
|
|
this.checkPermissions();
|
|
|
- this.fetchScoreSummaryData(this.selectedMonth);
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
} else {
|
|
|
alert(response.msg)
|
|
|
}
|
|
|
@@ -650,7 +806,8 @@ export default {
|
|
|
|
|
|
// 处理状态筛选变化
|
|
|
handleStatusChange(value) {
|
|
|
- console.log('状态筛选变化:', value);
|
|
|
+ // console.log('状态筛选变化:', value);
|
|
|
+ this.fetchScoreSummaryData(this.selectedMonth,this.monthScore.deptId);
|
|
|
// 在这里可以添加根据状态筛选数据的逻辑
|
|
|
// 例如:重新加载部门统计数据或其他相关操作
|
|
|
}
|
|
|
@@ -727,6 +884,7 @@ export default {
|
|
|
gap: 10px;
|
|
|
margin-top: 20px;
|
|
|
margin-right: 20px;
|
|
|
+ margin-bottom: 10px;
|
|
|
}
|
|
|
|
|
|
.button-group .el-button {
|