|
@@ -0,0 +1,249 @@
|
|
|
+<template>
|
|
|
+ <div class="oa-sys-list-view">
|
|
|
+ <div class="tableBox">
|
|
|
+ <div class="table" ref="tableRef">
|
|
|
+ <el-table
|
|
|
+ stripe
|
|
|
+ :data="dataSource"
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :style="{ height: tableHeight + 'px' }"
|
|
|
+ row-key="id"
|
|
|
+ :header-cell-style="{
|
|
|
+ background: '#E5F0FB',
|
|
|
+ color: '#233755',
|
|
|
+ height: '50px'
|
|
|
+ }"
|
|
|
+ v-loading="loading"
|
|
|
+ >
|
|
|
+ <el-table-column label="序号" width="100" align="center">
|
|
|
+ <template #default="scope">{{ scope.$index + 1 }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :show-overflow-tooltip="true" prop="xmmc" label="项目名称" width="280" />
|
|
|
+ <el-table-column label="项目经理" prop="xmjl" width="160" />
|
|
|
+ <el-table-column label="项目状态" width="120" align="center">
|
|
|
+ <template #default="scope">{{ getCustomerType(scope.row.xmzt) }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="合同额(万元)" width="140" align="center">
|
|
|
+ <template #default="scope">{{ scope.row.virtualAmount }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="已回款" width="140" align="center">
|
|
|
+ <template #default="scope">{{ scope.row.returnAmount }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="本年初始进度" width="140" align="center">
|
|
|
+ <template #default="scope">{{ scope.row.finishProgress }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="现进度" width="220" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="!scope.row.isEditor">{{ scope.row.reportProgress }}%</span>
|
|
|
+ <el-input
|
|
|
+ v-else
|
|
|
+ v-model="scope.row.reportProgress"
|
|
|
+ @change="reportProgressHandle(scope.row)"
|
|
|
+ >
|
|
|
+ <template #append>%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="进度说明" width="220" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="!scope.row.isEditor">{{ scope.row.progressComment }}</span>
|
|
|
+ <el-input v-else v-model="scope.row.progressComment" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="本年产值" width="140" align="center">
|
|
|
+ <template #default="scope">{{ scope.row.periodValue }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="剩余产值(万元)" width="160" align="center">
|
|
|
+ <template #default="scope">{{ scope.row.surplusValue }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="考核比例" width="140" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="!scope.row.isEditor">{{ scope.row.shareRatio }}</span>
|
|
|
+ <el-input v-else v-model="scope.row.shareRatio" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="本年考核产值(万元)" width="180" align="center">
|
|
|
+ <template #default="scope">{{ scope.row.periodCheckValue }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" width="140" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ getDictLabel(DICT_TYPE.PROJECT_REPORT_STATUS, scope.row.reportStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" fixed="right" width="260">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" plain round @click="getProjectReportAuditList(scope.row)">
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="['00', '11'].includes(scope.row.reportStatus) || !scope.row.reportId"
|
|
|
+ plain
|
|
|
+ round
|
|
|
+ @click="editorHandle(scope.row)"
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.isEditor">保存</span>
|
|
|
+ <span v-else>编辑</span>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="['00', '11'].includes(scope.row.reportStatus)"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ round
|
|
|
+ @click="commitProjectReport(scope.row)"
|
|
|
+ >
|
|
|
+ 审核
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog title="审核记录" v-model:visible="auditorVisiabled" width="600px" append-to-body>
|
|
|
+ <div class="timeLineBox">
|
|
|
+ <el-timeline style="max-width: 600px">
|
|
|
+ <el-timeline-item
|
|
|
+ v-for="(activity, index) in activities"
|
|
|
+ :key="index"
|
|
|
+ type="primary"
|
|
|
+ :hollow="true"
|
|
|
+ :timestamp="activity.auditDate"
|
|
|
+ >
|
|
|
+ <p>
|
|
|
+ <span>审核人:{{ activity.auditor }}</span>
|
|
|
+ <span>状态:{{ activity.auditStatus }}</span>
|
|
|
+ </p>
|
|
|
+ <p> {{ activity.comments }}</p>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script lang="ts" setup>
|
|
|
+import request from '@/config/axios'
|
|
|
+import { getDictOptions, DICT_TYPE, getDictLabel } from '@/utils/dict'
|
|
|
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
|
|
+
|
|
|
+defineOptions({ name: 'ProjectReport' })
|
|
|
+
|
|
|
+const dataSource = ref([])
|
|
|
+
|
|
|
+const tableRef: any = ref(null)
|
|
|
+const tableHeight: any = ref(0)
|
|
|
+const message = useMessage()
|
|
|
+
|
|
|
+const loading = ref(false)
|
|
|
+const getProjectReportByList = async () => {
|
|
|
+ loading.value = true
|
|
|
+ const result: any = await request.get(
|
|
|
+ {
|
|
|
+ url: '/projectReport/list'
|
|
|
+ },
|
|
|
+ '/business'
|
|
|
+ )
|
|
|
+ result.forEach((item) => {
|
|
|
+ item['isEditor'] = false
|
|
|
+ })
|
|
|
+ dataSource.value = result ?? []
|
|
|
+ loading.value = false
|
|
|
+}
|
|
|
+const { wsCache } = useCache()
|
|
|
+const user = wsCache.get(CACHE_KEY.USER)
|
|
|
+const saveProjectReport = async (data = {}) => {
|
|
|
+ const sendData = {}
|
|
|
+ Object.assign(sendData, data)
|
|
|
+ sendData['reportProgress'] = data['reportProgress'] / 100
|
|
|
+ data['xmbm'] = user.user.deptName ? user.user.deptName : '部门信息'
|
|
|
+ const result: any = await request.post(
|
|
|
+ {
|
|
|
+ url: '/projectReport/save',
|
|
|
+ data
|
|
|
+ },
|
|
|
+ '/business'
|
|
|
+ )
|
|
|
+ if (result) {
|
|
|
+ message.success('保存成功!')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const commitProjectReport = async (row: { reportId: string }) => {
|
|
|
+ const result: any = await request.get(
|
|
|
+ {
|
|
|
+ url: '/projectReport/commit',
|
|
|
+ params: {
|
|
|
+ id: row.reportId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ '/business'
|
|
|
+ )
|
|
|
+ if (result) {
|
|
|
+ message.success('提交审核成功!')
|
|
|
+ getProjectReportByList()
|
|
|
+ }
|
|
|
+}
|
|
|
+const customerType: any = ref([])
|
|
|
+const getCustomerType = (str) => {
|
|
|
+ return customerType.value.find((item) => item.value == str)?.label ?? str
|
|
|
+}
|
|
|
+const reportProgressHandle = (row) => {
|
|
|
+ if (row.reportProgress) {
|
|
|
+ row.periodValue = ((row.reportProgress - row.finishProgress) / 100) * row.virtualAmount
|
|
|
+ row.surplusValue = ((100 - row.reportProgress) / 100) * row.virtualAmount
|
|
|
+ row.periodCheckValue = row.shareRatio * row.periodValue
|
|
|
+ }
|
|
|
+}
|
|
|
+const editorHandle = (row) => {
|
|
|
+ if (row.isEditor) {
|
|
|
+ saveProjectReport(row)
|
|
|
+ }
|
|
|
+ row.isEditor = !row.isEditor
|
|
|
+}
|
|
|
+const auditorVisiabled = ref<boolean>(false)
|
|
|
+const activities = ref<any[]>([])
|
|
|
+
|
|
|
+const getProjectReportAuditList = async (row: { reportId: string }) => {
|
|
|
+ const result: any = await request.get(
|
|
|
+ {
|
|
|
+ url: '/projectReportAudit/list',
|
|
|
+ params: {
|
|
|
+ reportId: row.reportId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ '/business'
|
|
|
+ )
|
|
|
+ console.log(result)
|
|
|
+}
|
|
|
+onMounted(() => {
|
|
|
+ customerType.value = getDictOptions('customer_type')
|
|
|
+ tableHeight.value = tableRef.value.clientHeight
|
|
|
+ getProjectReportByList()
|
|
|
+})
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.titleBox {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ line-height: 60px;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #121518;
|
|
|
+}
|
|
|
+.tableBox {
|
|
|
+ margin-top: 0 !important;
|
|
|
+}
|
|
|
+.searchBox {
|
|
|
+ .customer {
|
|
|
+ width: 300px !important;
|
|
|
+ }
|
|
|
+ .company {
|
|
|
+ width: 320px !important;
|
|
|
+ }
|
|
|
+ .area {
|
|
|
+ width: 280px !important;
|
|
|
+ }
|
|
|
+ .type {
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|