pull/480/head
liting 2024-06-12 22:30:20 +08:00
parent 19a7a063cf
commit 382e31d530
2 changed files with 83 additions and 22 deletions

View File

@ -78,10 +78,17 @@ export const MainApi = {
generateContract: async (params: any) => {
return await request.post({ url: `/contract/main/generateContract`, params })
},
//提宝
//审核
auditContract: async (data: MainVO) => {
return await request.post({ url: `/contract/main/auditContract`, data })
},
//提报
presentingContract: async (params: any) => {
return await request.post({ url: `/contract/main/presentingContract`, params })
},
getAuditList: async (params) => {
return await request.get({ url: `/contract/main/getAuditList`, params })
},
// ==================== 子表(任务书详细信息) ====================
// 获得任务书详细信息

View File

@ -72,20 +72,26 @@
<el-table-column label="审核单位名称" align="center" prop="reviewUnitName" />
<el-table-column label="状态" align="center" prop="state" />
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center" width="300">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['contract:main:update']">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['contract:main:delete']">
删除
</el-button>
<el-button link type="primary" @click="handlePresenting(scope.row.id)" v-if="scope.row.state == '1'">
提报
</el-button>
<template v-if="scope.row.state == '1'">
<el-button link type="primary" @click="openForm('update', scope.row.id)"
v-hasPermi="['contract:main:update']">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['contract:main:delete']">
删除
</el-button>
<el-button link type="primary" @click="handlePresenting(scope.row.id)">
提报
</el-button>
</template>
<el-button link type="primary" @click="handleauditContract(scope.row.id)" v-if="scope.row.state == '2'">
审核
</el-button>
<el-button link type="primary" @click="handleRecord(scope.row.id)" v-if="scope.row.state == '2'">
审核记录
</el-button>
</template>
</el-table-column>
</el-table>
@ -123,22 +129,41 @@
<el-form label-width="80px" :model="formData" class="m-t-8px" :rules="formRules">
<el-form-item label="" prop="status">
<el-radio-group v-model="formData.status">
<el-radio label="1">审核通过</el-radio>
<el-radio label="0">审核不通过</el-radio>
</el-radio-group>
<el-radio label="1">审核通过</el-radio>
<el-radio label="0">审核不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核意见" prop="des" v-if="formData.status == 0">
<el-form-item label="审核意见" prop="comment" v-if="formData.status == '0'">
<el-input type="textarea" v-model="formData.comment" resize="vertical" :autosize="{ minRows: 2, maxRows: 4 }" />
</el-form-item>
</el-form>
</ContentWrap>
<template #footer>
<el-button :disabled="!currentRow" type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm1"> </el-button>
<el-button @click="dialogVisible1 = false"> </el-button>
</template>
</Dialog>
<Dialog title="审核记录" v-model="dialogVisible2">
<ContentWrap>
<el-timeline>
<el-timeline-item v-for="(log, index) in logList" :key="index" :timestamp="formatDate(log.createTime)"
placement="top">
<div class="el-timeline-right-content">
<el-tag class="mr-10px" type="success">{{ log.userName }}</el-tag>
{{ log.action }}
</div>
<template #dot>
</template>
</el-timeline-item>
</el-timeline>
<div v-if="logList.length == 0"> </div>
</ContentWrap>
</Dialog>
<!-- 表单弹窗添加/修改 -->
<MainForm ref="formRef" @success="getList" />
<MainForm ref="formRef" @success="getList" />0
</template>
<script setup lang="ts">
@ -147,7 +172,8 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { MainApi, MainVO } from '@/api/contract/contract'
import MainForm from './MainForm.vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
/** 任务书主 列表 */
defineOptions({ name: 'ContractMain' })
@ -156,6 +182,8 @@ const { t } = useI18n() // 国际化
const dialogVisible = ref(false) //
const dialogVisible1 = ref(false) //
const dialogVisible2 = ref(false) //
const logList = ref([]) //
const loading = ref(true) //
const loading1 = ref(true) //
const list = ref<MainVO[]>([]) //
@ -181,11 +209,13 @@ const queryParams1 = reactive({
technicalField: undefined,
year: undefined,
})
const { wsCache } = useCache()
const user = wsCache.get(CACHE_KEY.USER).user
const formData = ref({
itemId: undefined,
moduleId: undefined,
creatorName: undefined,
status: 1,
moduleId: "2",
creatorName: user.nickname,
status: '1',
comment: '',
})
const formRules = reactive({
@ -223,7 +253,19 @@ const handleCurrentChange = (row) => {
}
const submitForm = async () => {
try {
const data = await MainApi.generateContract({ id: currentRow.value })
await MainApi.generateContract({ id: currentRow.value })
message.success("提报成功")
} finally {
//
currentRow.value = undefined
currentRowValue.value = undefined
dialogVisible.value = false
}
}
const submitForm1 = async () => {
try {
await MainApi.auditContract(formData.value as unknown as MainVO)
message.success("审核成功")
} finally {
//
currentRow.value = undefined
@ -278,7 +320,19 @@ const handlePresenting = async (id: number) => {
}
//
const handleauditContract = async (id: number) => {
formData.value.itemId = id;
dialogVisible1.value = true
}
const handleRecord = async (id: number) => {
dialogVisible2.value = true
try {
const data = await MainApi.getAuditList({ id: id })
console.log(data)
logList.value = data.list
} finally {
loading.value = false
}
}
/** 导出按钮操作 */
const handleExport = async () => {