1.1.24 新增项目流程中 项目关联合同添加查看合同信息、下载终版合同附件按钮。

dev
yinq 2 days ago
parent 3464274df8
commit dcece62410

@ -55,9 +55,15 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="备注" align="center" prop="remark" min-width="150" show-overflow-tooltip />--> <!-- <el-table-column label="备注" align="center" prop="remark" min-width="150" show-overflow-tooltip />-->
<el-table-column label="操作" align="center" width="120" fixed="right" v-if="routeParams.type !== 'view'"> <el-table-column label="操作" align="center" width="180" fixed="right">
<template #default="scope"> <template #default="scope">
<el-tooltip content="删除" placement="top"> <el-tooltip content="查看合同信息" placement="top">
<el-button link type="primary" icon="View" @click="handleViewContractInfo(scope.row)"></el-button>
</el-tooltip>
<el-tooltip content="下载终版合同附件" placement="top">
<el-button link type="primary" icon="Download" @click="handleDownloadFinalContract(scope.row)"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top" v-if="routeParams.type !== 'view'">
<el-button link type="danger" icon="Delete" @click="handleDeleteContract(scope.row)"></el-button> <el-button link type="danger" icon="Delete" @click="handleDeleteContract(scope.row)"></el-button>
</el-tooltip> </el-tooltip>
</template> </template>
@ -287,7 +293,7 @@ import { ProjectTypeVO } from '@/api/oa/erp/projectType/types';
import { getUserList } from '@/api/system/user'; import { getUserList } from '@/api/system/user';
import { CodeRuleEnum, FlowCodeEnum, ProjectCategoryEnum } from '@/enums/OAEnum'; import { CodeRuleEnum, FlowCodeEnum, ProjectCategoryEnum } from '@/enums/OAEnum';
import { getErpProjectContractsList } from '@/api/oa/erp/projectContracts'; import { getErpProjectContractsList } from '@/api/oa/erp/projectContracts';
import { listContractInfo } from '@/api/oa/erp/contractInfo'; import { getContractInfo, listContractInfo } from '@/api/oa/erp/contractInfo';
import { ContractInfoVO, ContractInfoQuery } from '@/api/oa/erp/contractInfo/types'; import { ContractInfoVO, ContractInfoQuery } from '@/api/oa/erp/contractInfo/types';
import { getInfo } from '@/api/login'; import { getInfo } from '@/api/login';
@ -754,6 +760,39 @@ const handleDeleteContract = async (row: any) => {
console.error('删除合同关联失败:', error); console.error('删除合同关联失败:', error);
} }
}; };
/** 查看合同信息 */
const handleViewContractInfo = (row: any) => {
if (!row?.contractId) {
proxy?.$modal.msgWarning('未获取到合同ID无法查看合同信息');
return;
}
proxy?.$tab.openPage('/oa/erp/contractInfo/edit', '合同信息', {
id: row.contractId,
type: 'view'
});
};
/** 下载终版合同附件 */
const handleDownloadFinalContract = async (row: any) => {
if (!row?.contractId) {
proxy?.$modal.msgWarning('未获取到合同ID无法下载终版合同附件');
return;
}
try {
const res = await getContractInfo(row.contractId);
const contractData = res?.data as any;
const signatureAppendix = contractData?.signatureAppendix;
if (!signatureAppendix) {
proxy?.$modal.msgWarning('该合同暂无终版合同附件');
return;
}
proxy?.$download.oss(signatureAppendix);
} catch (error) {
console.error('下载终版合同附件失败:', error);
proxy?.$modal.msgError('下载终版合同附件失败');
}
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

Loading…
Cancel
Save