|
|
@ -45,6 +45,14 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="填写人" |
|
|
|
prop="realName" /> |
|
|
|
<el-table-column label="组织/部门/网格" |
|
|
|
prop="orgName" /> |
|
|
|
<el-table-column label="来源" |
|
|
|
prop="clientType" /> |
|
|
|
<!-- <el-table-column label="填写时间" prop="createdTime" /> --> |
|
|
|
|
|
|
|
<el-table-column v-for="col in otherCustomColumns" |
|
|
|
:key="col" |
|
|
|
:label="projectItemColumns[col]" |
|
|
@ -61,9 +69,8 @@ |
|
|
|
{{ scope.row[col] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column :render-header="renderHeader" |
|
|
|
fixed="right" |
|
|
|
<!-- :render-header="renderHeader" --> |
|
|
|
<el-table-column fixed="right" |
|
|
|
width="50"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="small" |
|
|
@ -85,7 +92,7 @@ |
|
|
|
<div v-for="item in projectItemList" |
|
|
|
:key="item.id"> |
|
|
|
<h4>{{ item.label }}</h4> |
|
|
|
<result-item :field-item-id="item.formItemId" |
|
|
|
<result-item :field-item-id="Number(item.formItemId)" |
|
|
|
:project-item-data="item" |
|
|
|
:result-data="activeResultRow" /> |
|
|
|
<el-divider /> |
|
|
@ -103,6 +110,28 @@ |
|
|
|
layout="total, prev, pager, next" |
|
|
|
@current-change="queryProjectResult" /> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div v-for="item in projectItemList" |
|
|
|
:key="item.id"> |
|
|
|
<h4>{{ item.label }}</h4> |
|
|
|
<result-item :field-item-id="item.formItemId" |
|
|
|
:project-item-data="item" |
|
|
|
:result-data="activeResultRow" /> |
|
|
|
<el-divider /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-scrollbar> |
|
|
|
</el-drawer> |
|
|
|
<div style="display: flex; justify-content: center; margin-top: 10px;"> |
|
|
|
<el-pagination v-if="total>10" |
|
|
|
:current-page.sync="queryConditions.current" |
|
|
|
:page-size.sync="queryConditions.size" |
|
|
|
:total="total" |
|
|
|
background |
|
|
|
layout="total, prev, pager, next" |
|
|
|
@current-change="queryProjectResult" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="custom-col-container"> |
|
|
|
<el-dialog :visible.sync="customColumnDialogVisible" |
|
|
@ -234,98 +263,125 @@ export default { |
|
|
|
this.projectData = res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
conditionFilterHandle () { |
|
|
|
this.$refs.dataFilter.showDialogHandle() |
|
|
|
}, |
|
|
|
dataFilterHandle (params, comparisons) { |
|
|
|
this.queryConditions.extParams = params |
|
|
|
this.queryConditions.extComparisons = comparisons |
|
|
|
mounted () { |
|
|
|
this.projectKey = this.$route.query.key |
|
|
|
this.queryConditions.projectKey = this.projectKey |
|
|
|
this.queryProjectResult() |
|
|
|
this.queryProjectItems() |
|
|
|
this.queryProject() |
|
|
|
}, |
|
|
|
queryProjectResult () { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/page`, { params: this.queryConditions }).then(res => { |
|
|
|
let { records, total, size } = res.data |
|
|
|
this.projectResultList = records |
|
|
|
this.total = total |
|
|
|
this.queryConditions.size = size |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveStatisticsCheckedColumns () { |
|
|
|
this.customColumnDialogVisible = false |
|
|
|
this.fixedCustomColumns = this.checkedFixedCustomColumns |
|
|
|
this.otherCustomColumns = this.checkOtherCustomColumns |
|
|
|
this.fixedFormTailColumns = this.checkedFixedTailCustomColumns |
|
|
|
saveCheckedColumn(this.projectKey, { |
|
|
|
fixedCustomColumns: this.fixedCustomColumns, |
|
|
|
otherCustomColumns: this.otherCustomColumns, |
|
|
|
fixedCustomTailColumns: this.fixedFormTailColumns |
|
|
|
}) |
|
|
|
}, |
|
|
|
getDbCheckedColumns () { |
|
|
|
let checkedColumn = getCheckedColumn(this.projectKey) |
|
|
|
if (!checkedColumn) { |
|
|
|
return |
|
|
|
} |
|
|
|
let { fixedCustomColumns, otherCustomColumns, fixedCustomTailColumns } = checkedColumn |
|
|
|
if (fixedCustomColumns) { |
|
|
|
this.fixedCustomColumns = fixedCustomColumns |
|
|
|
this.checkedFixedCustomColumns = fixedCustomColumns |
|
|
|
} |
|
|
|
if (otherCustomColumns) { |
|
|
|
this.otherCustomColumns = otherCustomColumns |
|
|
|
this.checkOtherCustomColumns = otherCustomColumns |
|
|
|
} |
|
|
|
if (fixedCustomTailColumns) { |
|
|
|
this.fixedCustomTailColumns = fixedCustomTailColumns |
|
|
|
this.checkedFixedTailCustomColumns = fixedCustomTailColumns |
|
|
|
} |
|
|
|
}, |
|
|
|
downloadProjectResultFile () { |
|
|
|
if (!this.total) { |
|
|
|
this.$message.error('无附件,无法导出') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/download/file`, { |
|
|
|
params: this.queryConditions |
|
|
|
}).then(res => { |
|
|
|
this.$process({ |
|
|
|
message: '附件导出中', |
|
|
|
key: res.data |
|
|
|
methods: { |
|
|
|
renderHeader () { |
|
|
|
return ( |
|
|
|
<i class="el-icon-setting" style="color:currentColor" |
|
|
|
onClick={() => this.customColumnDialogVisible = true}></i> |
|
|
|
) |
|
|
|
}, |
|
|
|
openDetailDrawerHandle (row) { |
|
|
|
this.activeResultRow = row |
|
|
|
this.detailDrawer = true |
|
|
|
}, |
|
|
|
queryProject () { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => { |
|
|
|
this.projectData = res.data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
exportProjectResult () { |
|
|
|
if (!this.total) { |
|
|
|
this.$message.error('无表单有效反馈结果,无法导出') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}user/project/result/export`, { |
|
|
|
params: this.queryConditions, |
|
|
|
responseType: 'blob' |
|
|
|
}).then(res => { |
|
|
|
let blob = res |
|
|
|
let downloadElement = document.createElement('a') |
|
|
|
let href = window.URL.createObjectURL(blob) // 创建下载的链接 |
|
|
|
downloadElement.href = href |
|
|
|
downloadElement.download = this.projectData.name + this.$dayjs().format('YYYYMMDDHHMM') + '.xls' // 下载后文件名 |
|
|
|
document.body.appendChild(downloadElement) |
|
|
|
downloadElement.click() // 点击下载 |
|
|
|
document.body.removeChild(downloadElement) // 下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(href) // 释放掉blob对象 |
|
|
|
}) |
|
|
|
}, |
|
|
|
queryProjectItems () { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/list`, { params: { key: this.projectKey, displayType: false } }).then(res => { |
|
|
|
if (res.data) { |
|
|
|
res.data.map(item => { |
|
|
|
_.set(this.projectItemColumns, `field${item.formItemId}`, item.label) |
|
|
|
}, |
|
|
|
conditionFilterHandle () { |
|
|
|
this.$refs.dataFilter.showDialogHandle() |
|
|
|
}, |
|
|
|
dataFilterHandle (params, comparisons) { |
|
|
|
this.queryConditions.extParams = params |
|
|
|
this.queryConditions.extComparisons = comparisons |
|
|
|
this.queryProjectResult() |
|
|
|
}, |
|
|
|
queryProjectResult () { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/page`, { params: this.queryConditions }).then(res => { |
|
|
|
let { records, total, size } = res.data |
|
|
|
this.projectResultList = records |
|
|
|
this.total = total |
|
|
|
this.queryConditions.size = size |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveStatisticsCheckedColumns () { |
|
|
|
this.customColumnDialogVisible = false |
|
|
|
this.fixedCustomColumns = this.checkedFixedCustomColumns |
|
|
|
this.otherCustomColumns = this.checkOtherCustomColumns |
|
|
|
this.fixedFormTailColumns = this.checkedFixedTailCustomColumns |
|
|
|
saveCheckedColumn(this.projectKey, { |
|
|
|
fixedCustomColumns: this.fixedCustomColumns, |
|
|
|
otherCustomColumns: this.otherCustomColumns, |
|
|
|
fixedCustomTailColumns: this.fixedFormTailColumns |
|
|
|
}) |
|
|
|
}, |
|
|
|
getDbCheckedColumns () { |
|
|
|
let checkedColumn = getCheckedColumn(this.projectKey) |
|
|
|
if (!checkedColumn) { |
|
|
|
return |
|
|
|
} |
|
|
|
let { fixedCustomColumns, otherCustomColumns, fixedCustomTailColumns } = checkedColumn |
|
|
|
if (fixedCustomColumns) { |
|
|
|
this.fixedCustomColumns = fixedCustomColumns |
|
|
|
this.checkedFixedCustomColumns = fixedCustomColumns |
|
|
|
} |
|
|
|
if (otherCustomColumns) { |
|
|
|
this.otherCustomColumns = otherCustomColumns |
|
|
|
this.checkOtherCustomColumns = otherCustomColumns |
|
|
|
} |
|
|
|
if (fixedCustomTailColumns) { |
|
|
|
this.fixedCustomTailColumns = fixedCustomTailColumns |
|
|
|
this.checkedFixedTailCustomColumns = fixedCustomTailColumns |
|
|
|
} |
|
|
|
}, |
|
|
|
downloadProjectResultFile () { |
|
|
|
if (!this.total) { |
|
|
|
this.$message.error('无附件,无法导出') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/download/file`, { |
|
|
|
params: this.queryConditions |
|
|
|
}).then(res => { |
|
|
|
this.$process({ |
|
|
|
message: '附件导出中', |
|
|
|
key: res.data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
exportProjectResult () { |
|
|
|
if (!this.total) { |
|
|
|
this.$message.error('无表单有效反馈结果,无法导出') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/export`, { |
|
|
|
params: this.queryConditions, |
|
|
|
responseType: 'blob' |
|
|
|
}).then(res => { |
|
|
|
let blob = res |
|
|
|
let downloadElement = document.createElement('a') |
|
|
|
let href = window.URL.createObjectURL(blob) // 创建下载的链接 |
|
|
|
downloadElement.href = href |
|
|
|
downloadElement.download = this.projectData.name + this.$dayjs().format('YYYYMMDDHHMM') + '.xls' // 下载后文件名 |
|
|
|
document.body.appendChild(downloadElement) |
|
|
|
downloadElement.click() // 点击下载 |
|
|
|
document.body.removeChild(downloadElement) // 下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(href) // 释放掉blob对象 |
|
|
|
}) |
|
|
|
}, |
|
|
|
queryProjectItems () { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/item/list`, { params: { key: this.projectKey, displayType: false } }).then(res => { |
|
|
|
if (res.data) { |
|
|
|
res.data.map(item => { |
|
|
|
_.set(this.projectItemColumns, `field${item.formItemId}`, item.label) |
|
|
|
}) |
|
|
|
} |
|
|
|
this.projectItemList = res.data |
|
|
|
this.getDbCheckedColumns() |
|
|
|
}) |
|
|
|
} |
|
|
|
this.projectItemList = res.data |
|
|
|
this.getDbCheckedColumns() |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|