pull/480/head
parent
19a7a063cf
commit
382e31d530
|
|
@ -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 })
|
||||
},
|
||||
// ==================== 子表(任务书详细信息) ====================
|
||||
|
||||
// 获得任务书详细信息
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue