|
|
@@ -7,12 +7,15 @@
|
|
|
<span>{{ title }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="6">
|
|
|
<span class="tip">说明:红色-未达标,黄色-未评价。</span>
|
|
|
</el-col>
|
|
|
- <el-col :span="6" class="right flex-rt">
|
|
|
+ <el-col :span="12" class="right flex-rt">
|
|
|
<p class="current-score"> 当月分值: <span> {{ hosScore }} </span>分</p>
|
|
|
+ <el-button type="primary" icon="el-icon-document-copy" size="mini" @click="handleCopy">复制上月</el-button>
|
|
|
+
|
|
|
<el-button type="primary" icon="el-icon-document" size="mini" @click="handleExport">导出</el-button>
|
|
|
+
|
|
|
<el-button style="margin-left: 10px;" type="primary" icon="el-icon-printer" size="mini" @click="handlePrint">打印</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -81,6 +84,7 @@ import PointAssess from '@/views/hos/components/PointAssess'
|
|
|
import AssessRecord from '@/views/hos/components/AssessRecord'
|
|
|
import commonMethodMixin from '@/mixin/commonMethodMixin'
|
|
|
import { getAssessByList, getAssessById } from '@/api/hos/hosAssessApi'
|
|
|
+import { storyCopy } from '@/api/hos/hosAssessMonthRecordApi'
|
|
|
import { getMonthScoreOfStory } from '@/api/hos/hosStatisApi'
|
|
|
export default {
|
|
|
name: 'AssessList',
|
|
|
@@ -131,7 +135,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- var now = new Date()
|
|
|
+ const now = new Date()
|
|
|
this.curYear = now.getFullYear()
|
|
|
this.curMonth = now.getMonth() + 1
|
|
|
},
|
|
|
@@ -249,13 +253,41 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // Copy上月记录
|
|
|
+ handleCopy() {
|
|
|
+ const yearTo = this.conditions.year
|
|
|
+ const monthTo = this.conditions.month
|
|
|
+ let fromYear = this.conditions.year
|
|
|
+ let fromMonth = this.conditions.month - 1
|
|
|
+ if (monthTo <= 1) {
|
|
|
+ fromYear = yearTo - 1
|
|
|
+ fromMonth = 12
|
|
|
+ }
|
|
|
+
|
|
|
+ const storyId = this.conditions.storyId
|
|
|
+ this.listLoading = true
|
|
|
+ storyCopy(storyId, fromYear, fromMonth, yearTo, monthTo).then((resp) => {
|
|
|
+ const { code, msg } = resp
|
|
|
+ this.listLoading = false
|
|
|
+ if (code === 0) {
|
|
|
+ this.$message.success(msg)
|
|
|
+ this.getData()
|
|
|
+ this.getMonthScore()
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg)
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
formSuccess() {
|
|
|
this.updateRow()
|
|
|
this.$emit('actionUpdate')
|
|
|
},
|
|
|
updateRow() {
|
|
|
- var year = this.conditions.year
|
|
|
- var month = this.conditions.month
|
|
|
+ const year = this.conditions.year
|
|
|
+ const month = this.conditions.month
|
|
|
const { storyId, targetId, itemId, pointId } = this.handleAssessRows.row
|
|
|
const index = this.handleAssessRows.index
|
|
|
getAssessById(year, month, storyId, targetId, itemId, pointId).then((res) => {
|
|
|
@@ -306,6 +338,7 @@ export default {
|
|
|
iframe.contentWindow.print()
|
|
|
document.body.removeChild(iframe)
|
|
|
},
|
|
|
+
|
|
|
formatJson(filterVal, jsonData) {
|
|
|
return jsonData.map(v => filterVal.map(j => {
|
|
|
return v[j]
|