|
|
@@ -41,133 +41,59 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<!-- 数据表格 -->
|
|
|
- <el-table
|
|
|
+ <cost-audit-table
|
|
|
v-loading="loading"
|
|
|
- :data="tableData"
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- row-key="id"
|
|
|
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
- default-expand-all
|
|
|
+ :table-data="tableData"
|
|
|
+ :columns="tableColumns"
|
|
|
+ :border="true"
|
|
|
:row-class-name="getRowClassName"
|
|
|
+ :show-pagination="false"
|
|
|
+ :table-props="{
|
|
|
+ rowKey: 'id',
|
|
|
+ treeProps: { children: 'children', hasChildren: 'hasChildren' },
|
|
|
+ defaultExpandAll: true,
|
|
|
+ }"
|
|
|
>
|
|
|
- <el-table-column
|
|
|
- prop="serialNumber"
|
|
|
- label="序号"
|
|
|
- width="60"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.pid == 0">
|
|
|
- {{ scope.row.parentIndex }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="year"
|
|
|
- label="立项年度"
|
|
|
- width="100"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.year">{{ scope.row.year }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="projectName"
|
|
|
- label="成本监审项目名称"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="auditedUnitName"
|
|
|
- label="被监审单位"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="auditPeriod"
|
|
|
- label="监审期间"
|
|
|
- width="150"
|
|
|
- align="center"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="sourceType"
|
|
|
- label="立项来源"
|
|
|
- width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ getDictName('projectProposal', scope.row.sourceType) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="auditType"
|
|
|
- label="监审形式"
|
|
|
- width="120"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ getDictName('auditType', scope.row.auditType) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="status" label="状态" width="100" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span :style="scope.row.style">{{ scope.row.status }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="warning" label="预警" width="80" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span
|
|
|
- v-if="scope.row.warning === 'red'"
|
|
|
- class="warning-point red"
|
|
|
- ></span>
|
|
|
- <span
|
|
|
- v-else-if="scope.row.warning === 'yellow'"
|
|
|
- class="warning-point yellow"
|
|
|
- ></span>
|
|
|
+ <!-- 预警列自定义内容 -->
|
|
|
+ <template #warning="{ row }">
|
|
|
+ <span v-if="row.warning === 'red'" class="warning-point red"></span>
|
|
|
+ <span
|
|
|
+ v-else-if="row.warning === 'yellow'"
|
|
|
+ class="warning-point yellow"
|
|
|
+ ></span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 操作列自定义内容 -->
|
|
|
+ <template #action="{ row }">
|
|
|
+ <template v-if="row.isSubTask">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleViewTaskDetail(row)"
|
|
|
+ >
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="220" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <template v-if="scope.row.isSubTask">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- @click="handleViewTaskDetail(scope.row)"
|
|
|
- >
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- @click="handleViewTaskDetail(scope.row)"
|
|
|
- >
|
|
|
- 详情
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- @click="handlePause(scope.row)"
|
|
|
- >
|
|
|
- 中止
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- @click="handleDelegate(scope.row)"
|
|
|
- >
|
|
|
- 代办
|
|
|
- </el-button>
|
|
|
- <el-button size="mini" type="text" @click="handleUrge(scope.row)">
|
|
|
- 督办
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleViewTaskDetail(row)"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" @click="handlePause(row)">
|
|
|
+ 中止
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" @click="handleDelegate(row)">
|
|
|
+ 代办
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" @click="handleUrge(row)">
|
|
|
+ 督办
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </template>
|
|
|
+ </cost-audit-table>
|
|
|
</div>
|
|
|
<!-- 详情内容 -->
|
|
|
<div v-if="activeView == 'detail'" class="detail-content">
|
|
|
@@ -196,12 +122,12 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="handlePauseFormSubmit">
|
|
|
确定
|
|
|
</el-button>
|
|
|
<el-button @click="handlePauseFormCancel">取消</el-button>
|
|
|
- </span>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 任务督办弹窗 -->
|
|
|
@@ -218,12 +144,14 @@
|
|
|
<el-select
|
|
|
v-model="urgeForm.remindPerson"
|
|
|
placeholder="请选择选择督办人员"
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
- label="张**、李**、王**"
|
|
|
- value="张**、李**、王**"
|
|
|
+ v-for="(item, index) in userList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.fullname"
|
|
|
+ :value="item.userId"
|
|
|
></el-option>
|
|
|
- <!-- 其他选项 -->
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="督办要求:">
|
|
|
@@ -235,17 +163,17 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="发送方式:">
|
|
|
- <el-radio-group v-model="urgeForm.sendType">
|
|
|
- <el-radio label="站内消息">站内消息</el-radio>
|
|
|
- <el-radio label="短信通知">短信通知</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-checkbox-group v-model="urgeForm.sendType">
|
|
|
+ <el-checkbox label="站内消息">站内消息</el-checkbox>
|
|
|
+ <el-checkbox label="短信通知">短信通知</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="handleUrgeCancel">取消</el-button>
|
|
|
<el-button type="primary" @click="handleUrgeSubmit">发送</el-button>
|
|
|
- </span>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 任务代办弹窗 -->
|
|
|
@@ -262,10 +190,14 @@
|
|
|
<el-select
|
|
|
v-model="delegateForm.agentPerson"
|
|
|
placeholder="请选择代理人员"
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
- <el-option label="张**" value="张**"></el-option>
|
|
|
- <el-option label="李**" value="李**"></el-option>
|
|
|
- <!-- 其他选项 -->
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in userList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.fullname"
|
|
|
+ :value="item.userId"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="代为内容:">
|
|
|
@@ -277,17 +209,17 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="发送方式:">
|
|
|
- <el-radio-group v-model="delegateForm.sendType">
|
|
|
- <el-radio label="站内消息">站内消息</el-radio>
|
|
|
- <el-radio label="短信通知">短信通知</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-checkbox-group v-model="delegateForm.sendType">
|
|
|
+ <el-checkbox label="站内消息">站内消息</el-checkbox>
|
|
|
+ <el-checkbox label="短信通知">短信通知</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="handleDelegateCancel">取消</el-button>
|
|
|
<el-button type="primary" @click="handleDelegateSubmit">发送</el-button>
|
|
|
- </span>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -296,10 +228,13 @@
|
|
|
import { taskList } from '@/api/taskProgressManage'
|
|
|
import { dictMixin } from '@/mixins/useDict'
|
|
|
import detailTabs from './detailTabs.vue'
|
|
|
-
|
|
|
+ import { getAllUnitList } from '@/api/auditEntityManage'
|
|
|
+ import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
|
|
|
+ import { getAllUserList } from '@/api/uc'
|
|
|
export default {
|
|
|
components: {
|
|
|
detailTabs,
|
|
|
+ CostAuditTable,
|
|
|
},
|
|
|
mixins: [dictMixin],
|
|
|
data() {
|
|
|
@@ -317,6 +252,91 @@
|
|
|
},
|
|
|
currentDetailTask: {},
|
|
|
tableData: [],
|
|
|
+ // 表格列配置
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ prop: 'serialNumber',
|
|
|
+ label: '序号',
|
|
|
+ width: 60,
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return row.pid == 0 ? row.parentIndex : ''
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'year',
|
|
|
+ label: '立项年度',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return row.year || ''
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'projectName',
|
|
|
+ label: '成本监审项目名称',
|
|
|
+ align: 'left',
|
|
|
+ headerAlign: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'auditedUnitId',
|
|
|
+ label: '被监审单位',
|
|
|
+ align: 'left',
|
|
|
+ headerAlign: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (row) => {
|
|
|
+ return this.getUnitName(row.auditedUnitId)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'auditPeriod',
|
|
|
+ label: '监审期间',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'sourceType',
|
|
|
+ label: '立项来源',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return this.getDictName('projectProposal', row.sourceType)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'auditType',
|
|
|
+ label: '监审形式',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return this.getDictName('auditType', row.auditType)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return this.getStatusName(row.status)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'warning',
|
|
|
+ label: '预警',
|
|
|
+ width: 80,
|
|
|
+ align: 'center',
|
|
|
+ slotName: 'warning',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 220,
|
|
|
+ align: 'center',
|
|
|
+ slotName: 'action',
|
|
|
+ },
|
|
|
+ ],
|
|
|
// 弹窗状态
|
|
|
showPauseConfirm: false,
|
|
|
showPauseForm: false,
|
|
|
@@ -338,18 +358,68 @@
|
|
|
content: '',
|
|
|
sendType: '站内消息',
|
|
|
},
|
|
|
+ unitList: [],
|
|
|
+ userList: [],
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.getAllUnitList()
|
|
|
+ this.getUser()
|
|
|
this.generateTableData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getUser() {
|
|
|
+ getAllUserList()
|
|
|
+ .then((res) => {
|
|
|
+ this.userList = res.value || []
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ getStatusName(status) {
|
|
|
+ // 100待提交、200审核中、400办结、300中止
|
|
|
+ switch (status) {
|
|
|
+ case '100':
|
|
|
+ return '待提交'
|
|
|
+ case '200':
|
|
|
+ return '审核中'
|
|
|
+ case '400':
|
|
|
+ return '办结'
|
|
|
+ case '300':
|
|
|
+ return '中止'
|
|
|
+ default:
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getAllUnitList() {
|
|
|
+ getAllUnitList().then((res) => {
|
|
|
+ this.unitList = res.value || []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getUnitName(unitId) {
|
|
|
+ // 直接处理unitId值,而不是row对象
|
|
|
+ if (unitId && typeof unitId === 'string' && unitId.includes(',')) {
|
|
|
+ // 如果包含逗号,分割成数组并查找对应的unitName
|
|
|
+ const unitIds = unitId.split(',')
|
|
|
+ return unitIds
|
|
|
+ .map((id) => {
|
|
|
+ const unit = this.unitList.find((item) => item.unitId == id)
|
|
|
+ return unit ? unit.unitName : ''
|
|
|
+ })
|
|
|
+ .filter((name) => name) // 过滤空值
|
|
|
+ .join(',')
|
|
|
+ } else {
|
|
|
+ // 单个unitId的情况
|
|
|
+ const unit = this.unitList.find((item) => item.unitId == unitId)
|
|
|
+ return unit ? unit.unitName : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
generateTableData() {
|
|
|
taskList({
|
|
|
projectName: this.searchForm.projectName,
|
|
|
year: this.searchForm.year,
|
|
|
}).then((res) => {
|
|
|
this.tableData = res.value
|
|
|
+ // 移除不需要的属性
|
|
|
this.tableData = this.removeItemFromTree(this.tableData)
|
|
|
let parentIndex = 1
|
|
|
this.tableData.forEach((item, index) => {
|
|
|
@@ -359,26 +429,22 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- handleReset() {
|
|
|
- this.searchForm = {
|
|
|
- projectName: '',
|
|
|
- year: '',
|
|
|
- }
|
|
|
- this.generateTableData()
|
|
|
- },
|
|
|
removeItemFromTree(treeData) {
|
|
|
// 边界条件检查
|
|
|
if (!treeData || !Array.isArray(treeData)) {
|
|
|
return []
|
|
|
}
|
|
|
+
|
|
|
// 创建新数组,避免修改原数据
|
|
|
return treeData.map((item) => {
|
|
|
// 创建当前节点的副本
|
|
|
const newItem = { ...item }
|
|
|
+
|
|
|
// 如果有hasChildren属性则删除
|
|
|
if ('hasChildren' in newItem) {
|
|
|
delete newItem.hasChildren
|
|
|
}
|
|
|
+
|
|
|
// 递归处理子节点 先检查children是否存在且为数组
|
|
|
if (
|
|
|
newItem.children &&
|
|
|
@@ -387,9 +453,18 @@
|
|
|
) {
|
|
|
newItem.children = this.removeItemFromTree(newItem.children)
|
|
|
}
|
|
|
+
|
|
|
return newItem
|
|
|
})
|
|
|
},
|
|
|
+ handleReset() {
|
|
|
+ this.searchForm = {
|
|
|
+ projectName: '',
|
|
|
+ year: '',
|
|
|
+ }
|
|
|
+ this.generateTableData()
|
|
|
+ },
|
|
|
+
|
|
|
getRowClassName({ row }) {
|
|
|
if (row.isSubTask) {
|
|
|
return 'sub-task-row'
|
|
|
@@ -445,6 +520,11 @@
|
|
|
handleUrge(row) {
|
|
|
console.log('任务督办:', row)
|
|
|
this.currentTask = row
|
|
|
+ this.urgeForm = {
|
|
|
+ remindPerson: '',
|
|
|
+ content: '',
|
|
|
+ sendType: [],
|
|
|
+ }
|
|
|
this.showUrgeForm = true
|
|
|
},
|
|
|
handleUrgeCancel() {
|
|
|
@@ -452,17 +532,22 @@
|
|
|
this.urgeForm = {
|
|
|
remindPerson: '',
|
|
|
content: '',
|
|
|
- sendType: '站内消息',
|
|
|
+ sendType: [],
|
|
|
}
|
|
|
},
|
|
|
handleUrgeSubmit() {
|
|
|
- console.log('提交督办:', this.urgeForm)
|
|
|
+ // 提交前将数组转换为逗号分隔字符串
|
|
|
+ const submitForm = { ...this.urgeForm }
|
|
|
+ if (Array.isArray(submitForm.sendType)) {
|
|
|
+ submitForm.sendType = submitForm.sendType.join(',')
|
|
|
+ }
|
|
|
+ console.log('提交督办:', submitForm)
|
|
|
// 这里可以添加提交逻辑
|
|
|
this.showUrgeForm = false
|
|
|
this.urgeForm = {
|
|
|
remindPerson: '',
|
|
|
content: '',
|
|
|
- sendType: '站内消息',
|
|
|
+ sendType: [],
|
|
|
}
|
|
|
this.currentTask = null
|
|
|
this.$message.success('督办信息已发送')
|