|
@@ -169,6 +169,7 @@
|
|
|
督办情况
|
|
督办情况
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ v-if="scope.row.supervisionStatus === '0'"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
@click="handleEndSupervision(scope.row)"
|
|
@click="handleEndSupervision(scope.row)"
|
|
@@ -223,6 +224,7 @@
|
|
|
<span
|
|
<span
|
|
|
v-if="scope.row.relatedFiles"
|
|
v-if="scope.row.relatedFiles"
|
|
|
style="color: #409eff; cursor: pointer"
|
|
style="color: #409eff; cursor: pointer"
|
|
|
|
|
+ @click="handleDownload(scope.row.relatedFiles)"
|
|
|
>
|
|
>
|
|
|
{{ scope.row.relatedFiles }}
|
|
{{ scope.row.relatedFiles }}
|
|
|
</span>
|
|
</span>
|
|
@@ -238,6 +240,11 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import {
|
|
|
|
|
+ deleteSuperviseTask,
|
|
|
|
|
+ getSuperviseReportList,
|
|
|
|
|
+ getSuperviseReportDetail,
|
|
|
|
|
+ } from '@/api/audit/supervise'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -361,20 +368,116 @@
|
|
|
this.generateTableData()
|
|
this.generateTableData()
|
|
|
},
|
|
},
|
|
|
generateTableData() {
|
|
generateTableData() {
|
|
|
- // 将主任务和子任务展平为表格数据
|
|
|
|
|
- const data = []
|
|
|
|
|
- this.projectList.forEach((project) => {
|
|
|
|
|
- data.push(project)
|
|
|
|
|
- if (project.subTasks && project.subTasks.length > 0) {
|
|
|
|
|
- project.subTasks.forEach((subTask) => {
|
|
|
|
|
- data.push({
|
|
|
|
|
- ...subTask,
|
|
|
|
|
- style: { paddingLeft: '40px' },
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ const statusLabel = (this.searchForm.status || '').toString().trim()
|
|
|
|
|
+ const status =
|
|
|
|
|
+ statusLabel === '在办'
|
|
|
|
|
+ ? '0'
|
|
|
|
|
+ : statusLabel === '办结'
|
|
|
|
|
+ ? '1'
|
|
|
|
|
+ : statusLabel
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ year: (this.searchForm.year || '').toString().trim(),
|
|
|
|
|
+ status,
|
|
|
|
|
+ supervisor: (this.searchForm.supervisor || '').toString().trim(),
|
|
|
|
|
+ project: (this.searchForm.project || '').toString().trim(),
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 9999,
|
|
|
|
|
+ }
|
|
|
|
|
+ getSuperviseReportList(params)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ // 兼容不同返回结构
|
|
|
|
|
+ const raw =
|
|
|
|
|
+ (res &&
|
|
|
|
|
+ res.value &&
|
|
|
|
|
+ (res.value.records || res.value.list || res.value)) ||
|
|
|
|
|
+ (res &&
|
|
|
|
|
+ res.data &&
|
|
|
|
|
+ (res.data.records || res.data.list || res.data)) ||
|
|
|
|
|
+ []
|
|
|
|
|
+ const arr = Array.isArray(raw) ? raw : []
|
|
|
|
|
+
|
|
|
|
|
+ const mapStatus = (s) => {
|
|
|
|
|
+ const v = s != null ? String(s) : ''
|
|
|
|
|
+ if (v === '100') return '待提交'
|
|
|
|
|
+ if (v === '200') return '审核中'
|
|
|
|
|
+ if (v === '300') return '中止'
|
|
|
|
|
+ if (v === '400') return '办结'
|
|
|
|
|
+ return v
|
|
|
|
|
+ }
|
|
|
|
|
+ const mapSupervise = (s) => {
|
|
|
|
|
+ const v = s != null ? String(s) : ''
|
|
|
|
|
+ if (v === '0') return '在办'
|
|
|
|
|
+ if (v === '1') return '办结'
|
|
|
|
|
+ return v || ''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const flat = []
|
|
|
|
|
+ arr.forEach((item, idx) => {
|
|
|
|
|
+ const parent = {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ serialNumber: idx + 1,
|
|
|
|
|
+ isSubTask: false,
|
|
|
|
|
+ // 映射列字段,避免后端字段名不一致
|
|
|
|
|
+ planYear: item.planYear || item.year || '',
|
|
|
|
|
+ auditedUnit:
|
|
|
|
|
+ item.auditedUnit ||
|
|
|
|
|
+ item.auditedUnitName ||
|
|
|
|
|
+ item.auditedUnitNames ||
|
|
|
|
|
+ '',
|
|
|
|
|
+ expectedDeadline:
|
|
|
|
|
+ item.expectedDeadline ||
|
|
|
|
|
+ item.processDeadline ||
|
|
|
|
|
+ item.deadline ||
|
|
|
|
|
+ '',
|
|
|
|
|
+ taskStatus:
|
|
|
|
|
+ item.taskStatus || item.statusName || mapStatus(item.status),
|
|
|
|
|
+ supervisionStatus:
|
|
|
|
|
+ item.supervisionStatus || mapSupervise(item.superviseStatus),
|
|
|
|
|
+ supervisionMessage:
|
|
|
|
|
+ item.supervisionMessage || item.message || item.remark || '',
|
|
|
|
|
+ }
|
|
|
|
|
+ flat.push(parent)
|
|
|
|
|
+ const children =
|
|
|
|
|
+ (item && (item.children || item.subTasks || item.childTasks)) ||
|
|
|
|
|
+ []
|
|
|
|
|
+ if (Array.isArray(children) && children.length > 0) {
|
|
|
|
|
+ children.forEach((c) => {
|
|
|
|
|
+ flat.push({
|
|
|
|
|
+ ...c,
|
|
|
|
|
+ isSubTask: true,
|
|
|
|
|
+ serialNumber: '',
|
|
|
|
|
+ style: { paddingLeft: '40px' },
|
|
|
|
|
+ planYear: c.planYear || c.year || '',
|
|
|
|
|
+ auditedUnit:
|
|
|
|
|
+ c.auditedUnit ||
|
|
|
|
|
+ c.auditedUnitName ||
|
|
|
|
|
+ c.auditedUnitNames ||
|
|
|
|
|
+ '',
|
|
|
|
|
+ expectedDeadline:
|
|
|
|
|
+ c.expectedDeadline ||
|
|
|
|
|
+ c.processDeadline ||
|
|
|
|
|
+ c.deadline ||
|
|
|
|
|
+ '',
|
|
|
|
|
+ taskStatus:
|
|
|
|
|
+ c.taskStatus || c.statusName || mapStatus(c.status),
|
|
|
|
|
+ supervisionStatus:
|
|
|
|
|
+ c.supervisionStatus || mapSupervise(c.superviseStatus),
|
|
|
|
|
+ supervisionMessage:
|
|
|
|
|
+ c.supervisionMessage || c.message || c.remark || '',
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- this.tableData = data
|
|
|
|
|
|
|
+ this.tableData = flat
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$message.error('获取数据失败')
|
|
|
|
|
+ this.tableData = []
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
getRowClassName({ row }) {
|
|
getRowClassName({ row }) {
|
|
|
if (row.isSubTask) {
|
|
if (row.isSubTask) {
|
|
@@ -383,8 +486,7 @@
|
|
|
return ''
|
|
return ''
|
|
|
},
|
|
},
|
|
|
handleSearch() {
|
|
handleSearch() {
|
|
|
- console.log('搜索:', this.searchForm)
|
|
|
|
|
- // 这里可以添加搜索逻辑
|
|
|
|
|
|
|
+ this.generateTableData()
|
|
|
},
|
|
},
|
|
|
handleView(row) {
|
|
handleView(row) {
|
|
|
this.isViewDetails = true
|
|
this.isViewDetails = true
|
|
@@ -395,33 +497,56 @@
|
|
|
console.log('查看任务详情:', row)
|
|
console.log('查看任务详情:', row)
|
|
|
},
|
|
},
|
|
|
handleSupervisionDetail(row) {
|
|
handleSupervisionDetail(row) {
|
|
|
- console.log('查看督办情况:', row)
|
|
|
|
|
this.isSupervisionDetail = true
|
|
this.isSupervisionDetail = true
|
|
|
this.currentTask = row
|
|
this.currentTask = row
|
|
|
- // 模拟督办记录数据
|
|
|
|
|
- this.supervisionRecords = [
|
|
|
|
|
- {
|
|
|
|
|
- serialNumber: 1,
|
|
|
|
|
- supervisor: '李***',
|
|
|
|
|
- reportTime: '2025-5-11 09:30',
|
|
|
|
|
- reportContent: '监审任务进展情况:.....................',
|
|
|
|
|
- relatedFiles: '******文件.doc',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- serialNumber: 2,
|
|
|
|
|
- supervisor: '李***',
|
|
|
|
|
- reportTime: '2025-5-23 09:30',
|
|
|
|
|
- reportContent: '监审任务进展情况:.....................',
|
|
|
|
|
- relatedFiles: '******文件.pdf',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- serialNumber: 3,
|
|
|
|
|
- supervisor: '.......',
|
|
|
|
|
- reportTime: '.......',
|
|
|
|
|
- reportContent: '.......',
|
|
|
|
|
- relatedFiles: '.......',
|
|
|
|
|
- },
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ const id = row && (row.superviseId || row.id || row.ID)
|
|
|
|
|
+ if (!id) {
|
|
|
|
|
+ this.supervisionRecords = []
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '加载中...',
|
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.3)',
|
|
|
|
|
+ })
|
|
|
|
|
+ getSuperviseReportDetail({ id })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ const raw = (res && (res.value || res.data)) || []
|
|
|
|
|
+ const arr = Array.isArray(raw)
|
|
|
|
|
+ ? raw
|
|
|
|
|
+ : Array.isArray(raw?.records)
|
|
|
|
|
+ ? raw.records
|
|
|
|
|
+ : []
|
|
|
|
|
+ this.supervisionRecords = arr.map((it, idx) => ({
|
|
|
|
|
+ serialNumber: idx + 1,
|
|
|
|
|
+ supervisor: it.supervisor || it.supervisorName || '',
|
|
|
|
|
+ reportTime: it.reportTime || it.createTime || it.reportDate || '',
|
|
|
|
|
+ reportContent: it.reportContent || it.content || '',
|
|
|
|
|
+ relatedFiles:
|
|
|
|
|
+ it.attachmentUrls || it.attachmentIds || it.relatedFiles || '',
|
|
|
|
|
+ }))
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$message.error('获取督办情况失败')
|
|
|
|
|
+ this.supervisionRecords = []
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ loading && loading.close && loading.close()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleDownload(paths) {
|
|
|
|
|
+ if (!paths) return
|
|
|
|
|
+ const base =
|
|
|
|
|
+ window.context && window.context.form ? window.context.form : ''
|
|
|
|
|
+ const list = String(paths)
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((s) => s.trim())
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ list.forEach((p) => {
|
|
|
|
|
+ const url = p.startsWith('http') ? p : base + p
|
|
|
|
|
+ window.open(url)
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handleEndSupervision(row) {
|
|
handleEndSupervision(row) {
|
|
|
console.log('结束督办:', row)
|
|
console.log('结束督办:', row)
|
|
@@ -431,7 +556,33 @@
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
- //todo
|
|
|
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '处理中...',
|
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.3)',
|
|
|
|
|
+ })
|
|
|
|
|
+ const id = row && (row.superviseId || row.ID)
|
|
|
|
|
+ if (!id) {
|
|
|
|
|
+ loading && loading.close && loading.close()
|
|
|
|
|
+ this.$message.error('缺少ID,无法结束督办')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ deleteSuperviseTask({ id })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res && Number(res.code) === 200) {
|
|
|
|
|
+ this.$message.success('已结束督办')
|
|
|
|
|
+ this.generateTableData()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error((res && res.message) || '操作失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$message.error('操作失败')
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ loading && loading.close && loading.close()
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
this.$message.info('已取消')
|
|
this.$message.info('已取消')
|