采购合同
This commit is contained in:
@@ -5,10 +5,6 @@
|
|||||||
|
|
||||||
import request from '/@/utils/request';
|
import request from '/@/utils/request';
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
* @param params 查询参数
|
|
||||||
*/
|
|
||||||
export function getPage(params?: any) {
|
export function getPage(params?: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/purchase/purchasingcontract/page',
|
url: '/purchase/purchasingcontract/page',
|
||||||
@@ -17,10 +13,6 @@ export function getPage(params?: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
* @param id ID
|
|
||||||
*/
|
|
||||||
export function getObj(id: string | number) {
|
export function getObj(id: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: '/purchase/purchasingcontract/' + id,
|
url: '/purchase/purchasingcontract/' + id,
|
||||||
@@ -28,10 +20,44 @@ export function getObj(id: string | number) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export function getByPurchaseId(purchaseId: string | number) {
|
||||||
* 新增采购合同
|
return request({
|
||||||
* @param obj 对象数据
|
url: '/purchase/purchasingcontract/by-purchase/' + purchaseId,
|
||||||
*/
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetail(purchaseId: string | number) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/purchasingcontract/detail/' + purchaseId,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function tempStore(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/purchasingcontract/temp-store',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function submit(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/purchasingcontract/submit',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateContract(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/purchasingcontract/update',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function addObj(obj: any) {
|
export function addObj(obj: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/purchase/purchasingcontract',
|
url: '/purchase/purchasingcontract',
|
||||||
@@ -40,10 +66,6 @@ export function addObj(obj: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改采购合同
|
|
||||||
* @param obj 对象数据
|
|
||||||
*/
|
|
||||||
export function editObj(obj: any) {
|
export function editObj(obj: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/purchase/purchasingcontract/edit',
|
url: '/purchase/purchasingcontract/edit',
|
||||||
@@ -52,10 +74,6 @@ export function editObj(obj: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除采购合同
|
|
||||||
* @param id ID
|
|
||||||
*/
|
|
||||||
export function delObj(id: number) {
|
export function delObj(id: number) {
|
||||||
return request({
|
return request({
|
||||||
url: '/purchase/purchasingcontract/delete',
|
url: '/purchase/purchasingcontract/delete',
|
||||||
@@ -64,13 +82,10 @@ export function delObj(id: number) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export function getByFlowInstId(flowInstId: number) {
|
||||||
* 根据采购申请ID查询合同
|
|
||||||
* @param purchaseId 采购申请ID
|
|
||||||
*/
|
|
||||||
export function getByPurchaseId(purchaseId: string | number) {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/purchase/purchasingcontract/by-purchase/' + purchaseId,
|
url: '/purchase/purchasingcontract/getByFlowInstId',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: { flowInstId },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="visible" title="采购合同详情" width="1000px" destroy-on-close append-to-body>
|
||||||
|
<el-descriptions :column="2" border class="apply-info">
|
||||||
|
<el-descriptions-item label="采购编号">{{ purchaseNo || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="采购项目名称">{{ projectName || '-' }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<el-divider content-position="left">合同信息</el-divider>
|
||||||
|
|
||||||
|
<el-descriptions v-if="contractData" :column="2" border>
|
||||||
|
<el-descriptions-item label="合同编号">{{ contractData.contractNo || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合同名称">{{ contractData.contractName || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合同金额">{{ contractData.money ? Number(contractData.money).toLocaleString() + ' 元' : '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合同状态">
|
||||||
|
<el-tag v-if="contractData.flowStatus === '0'" type="warning">运行中</el-tag>
|
||||||
|
<el-tag v-else-if="contractData.flowStatus === '1'" type="success">已完成</el-tag>
|
||||||
|
<el-tag v-else-if="contractData.flowStatus === '2'" type="info">已作废</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否需要招标">
|
||||||
|
<el-tag v-if="contractData.isBidding === '1'" type="success">是</el-tag>
|
||||||
|
<el-tag v-else type="info">否</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否需要法律顾问">
|
||||||
|
<el-tag v-if="contractData.isLegalAdviser === '1'" type="success">是</el-tag>
|
||||||
|
<el-tag v-else type="info">否</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否涉及多个部门">
|
||||||
|
<el-tag v-if="contractData.isDepts === '1'" type="success">是</el-tag>
|
||||||
|
<el-tag v-else type="info">否</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否全校合同">
|
||||||
|
<el-tag v-if="contractData.isSchool === '1'" type="success">是</el-tag>
|
||||||
|
<el-tag v-else type="info">否</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item v-if="contractData.isLegalAdviser === '1'" label="法律顾问意见" :span="2">
|
||||||
|
{{ contractData.legalAdviserOpinion || '-' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="备注" :span="2">{{ contractData.remarks || '-' }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<el-empty v-else description="暂无合同信息" />
|
||||||
|
|
||||||
|
<template v-if="contractData">
|
||||||
|
<el-divider content-position="left">附件信息</el-divider>
|
||||||
|
|
||||||
|
<el-tabs v-model="activeTab">
|
||||||
|
<el-tab-pane label="合同文件" name="contract">
|
||||||
|
<el-table :data="contractFiles" border stripe v-if="contractFiles.length > 0">
|
||||||
|
<el-table-column type="index" label="序号" width="60" />
|
||||||
|
<el-table-column prop="name" label="文件名称" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作" width="160" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||||
|
<el-button type="success" link icon="Download" @click="handleDownload(scope.row)">下载</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-empty v-else description="暂无合同文件" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同补充材料" name="supplement">
|
||||||
|
<el-table :data="supplementFiles" border stripe v-if="supplementFiles.length > 0">
|
||||||
|
<el-table-column type="index" label="序号" width="60" />
|
||||||
|
<el-table-column prop="name" label="文件名称" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作" width="160" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||||
|
<el-button type="success" link icon="Download" @click="handleDownload(scope.row)">下载</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-empty v-else description="暂无补充材料" />
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
|
<el-divider content-position="left">审核流程</el-divider>
|
||||||
|
|
||||||
|
<flow-comment-timeline v-if="flowInstId" :flow-inst-id="flowInstId" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="visible = false">关闭</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog v-model="previewVisible" :title="previewTitle" width="80%" top="5vh" destroy-on-close append-to-body>
|
||||||
|
<div class="preview-container">
|
||||||
|
<iframe v-if="previewUrl" :src="previewUrl" class="preview-iframe" />
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useMessage } from '/@/hooks/message';
|
||||||
|
import { getDetail } from '/@/api/purchase/purchasingcontract';
|
||||||
|
import { previewFileById, downloadFileById } from '/@/api/purchase/purchasingrequisition';
|
||||||
|
|
||||||
|
interface FileItem {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const visible = ref(false);
|
||||||
|
const loading = ref(false);
|
||||||
|
const purchaseId = ref('');
|
||||||
|
const purchaseNo = ref('');
|
||||||
|
const projectName = ref('');
|
||||||
|
const contractData = ref<any>(null);
|
||||||
|
const flowInstId = ref<number | null>(null);
|
||||||
|
const contractFiles = ref<FileItem[]>([]);
|
||||||
|
const supplementFiles = ref<FileItem[]>([]);
|
||||||
|
const activeTab = ref('contract');
|
||||||
|
|
||||||
|
const previewVisible = ref(false);
|
||||||
|
const previewTitle = ref('');
|
||||||
|
const previewUrl = ref('');
|
||||||
|
|
||||||
|
const open = async (id: string) => {
|
||||||
|
purchaseId.value = id;
|
||||||
|
visible.value = true;
|
||||||
|
loading.value = true;
|
||||||
|
contractData.value = null;
|
||||||
|
contractFiles.value = [];
|
||||||
|
supplementFiles.value = [];
|
||||||
|
flowInstId.value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await getDetail(id);
|
||||||
|
const data = res?.data || {};
|
||||||
|
purchaseNo.value = data.purchaseNo || '';
|
||||||
|
projectName.value = data.projectName || '';
|
||||||
|
contractData.value = data.contract || null;
|
||||||
|
|
||||||
|
if (data.contract) {
|
||||||
|
flowInstId.value = data.contract.flowInstId || null;
|
||||||
|
|
||||||
|
if (data.contract.contractFiles && data.contract.contractFiles.length > 0) {
|
||||||
|
contractFiles.value = data.contract.contractFiles.map((f: any) => ({
|
||||||
|
id: f.id,
|
||||||
|
name: f.fileTitle || '合同文件',
|
||||||
|
url: f.fileUrl,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.contract.supplementFiles && data.contract.supplementFiles.length > 0) {
|
||||||
|
supplementFiles.value = data.contract.supplementFiles.map((f: any) => ({
|
||||||
|
id: f.id,
|
||||||
|
name: f.fileTitle || '补充材料',
|
||||||
|
url: f.fileUrl,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取合同详情失败', e);
|
||||||
|
useMessage().error('获取合同详情失败');
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePreview = async (row: FileItem) => {
|
||||||
|
if (!row.id) {
|
||||||
|
useMessage().warning('文件ID不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const blob = await previewFileById(row.id);
|
||||||
|
previewUrl.value = window.URL.createObjectURL(blob);
|
||||||
|
previewTitle.value = row.name || '文件预览';
|
||||||
|
previewVisible.value = true;
|
||||||
|
} catch (e) {
|
||||||
|
console.error('预览失败', e);
|
||||||
|
useMessage().error('预览失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDownload = async (row: FileItem) => {
|
||||||
|
if (!row.id) {
|
||||||
|
useMessage().warning('文件ID不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const blob = await downloadFileById(row.id);
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = row.name || '附件.pdf';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('下载失败', e);
|
||||||
|
useMessage().error('下载失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.apply-info {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 75vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="visible" :title="dialogTitle" width="900px" destroy-on-close append-to-body :close-on-click-modal="false">
|
||||||
|
<el-descriptions :column="2" border class="apply-info">
|
||||||
|
<el-descriptions-item label="采购编号">{{ applyData.purchaseNo || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="采购项目名称">{{ applyData.projectName || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="项目预算">{{ applyData.budget ? Number(applyData.budget).toLocaleString() + ' 元' : '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="状态">
|
||||||
|
<el-tag v-if="applyData.status === '1'" type="success">已完成</el-tag>
|
||||||
|
<el-tag v-else>{{ applyData.status }}</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<el-divider content-position="left">合同信息</el-divider>
|
||||||
|
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="160px" :disabled="mode === 'view'">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同编号" prop="contractNo">
|
||||||
|
<el-input v-model="formData.contractNo" placeholder="请输入合同编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同名称" prop="contractName">
|
||||||
|
<el-input v-model="formData.contractName" placeholder="请输入合同名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同金额(元)" prop="money">
|
||||||
|
<el-input-number v-model="formData.money" :precision="2" :min="0" :controls="false" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否需要招标" prop="isBidding">
|
||||||
|
<el-radio-group v-model="formData.isBidding">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否需要法律顾问" prop="isLegalAdviser">
|
||||||
|
<el-radio-group v-model="formData.isLegalAdviser">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否涉及多个部门" prop="isDepts">
|
||||||
|
<el-radio-group v-model="formData.isDepts">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否全校合同" prop="isSchool">
|
||||||
|
<el-radio-group v-model="formData.isSchool">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item v-if="formData.isLegalAdviser === '1'" label="法律顾问意见" prop="legalAdviserOpinion">
|
||||||
|
<el-input v-model="formData.legalAdviserOpinion" type="textarea" :rows="3" placeholder="请输入法律顾问意见" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input v-model="formData.remarks" type="textarea" :rows="2" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-divider content-position="left">附件上传</el-divider>
|
||||||
|
|
||||||
|
<el-form label-width="160px">
|
||||||
|
<el-form-item label="合同文件" required>
|
||||||
|
<upload-file
|
||||||
|
v-model="contractFileList"
|
||||||
|
:limit="5"
|
||||||
|
:file-type="['pdf']"
|
||||||
|
:data="{ fileType: CONTRACT_FILE_TYPE, purchaseId: applyId }"
|
||||||
|
upload-file-url="/purchase/purchasingfiles/upload"
|
||||||
|
:disabled="mode === 'view'"
|
||||||
|
/>
|
||||||
|
<div class="file-tips">请上传PDF格式的合同文件</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同补充材料">
|
||||||
|
<upload-file
|
||||||
|
v-model="supplementFileList"
|
||||||
|
:limit="10"
|
||||||
|
:file-type="['pdf']"
|
||||||
|
:data="{ fileType: SUPPLEMENT_FILE_TYPE, purchaseId: applyId }"
|
||||||
|
upload-file-url="/purchase/purchasingfiles/upload"
|
||||||
|
:disabled="mode === 'view'"
|
||||||
|
/>
|
||||||
|
<div class="file-tips">请上传PDF格式的合同补充材料</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button v-if="mode !== 'view'" type="primary" :loading="submitting" @click="handleTempStore">暂存</el-button>
|
||||||
|
<el-button v-if="mode !== 'view'" type="success" :loading="submitting" :disabled="!canSubmit" @click="handleSubmit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { useMessage } from '/@/hooks/message';
|
||||||
|
import { getObj } from '/@/api/purchase/purchasingrequisition';
|
||||||
|
import { getByPurchaseId, tempStore, submit as submitContract } from '/@/api/purchase/purchasingcontract';
|
||||||
|
import { getApplyFiles } from '/@/api/purchase/purchasingrequisition';
|
||||||
|
|
||||||
|
const CONTRACT_FILE_TYPE = '160';
|
||||||
|
const SUPPLEMENT_FILE_TYPE = '170';
|
||||||
|
|
||||||
|
interface FileItem {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const visible = ref(false);
|
||||||
|
const submitting = ref(false);
|
||||||
|
const applyId = ref('');
|
||||||
|
const mode = ref<'add' | 'edit' | 'view'>('add');
|
||||||
|
const applyData = ref<any>({});
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
purchaseId: '',
|
||||||
|
contractNo: '',
|
||||||
|
contractName: '',
|
||||||
|
money: null as number | null,
|
||||||
|
isBidding: '0',
|
||||||
|
isLegalAdviser: '0',
|
||||||
|
legalAdviserOpinion: '',
|
||||||
|
isDepts: '0',
|
||||||
|
isSchool: '0',
|
||||||
|
remarks: '',
|
||||||
|
contractFileIds: [] as string[],
|
||||||
|
supplementFileIds: [] as string[],
|
||||||
|
});
|
||||||
|
|
||||||
|
const contractFileList = ref<FileItem[]>([]);
|
||||||
|
const supplementFileList = ref<FileItem[]>([]);
|
||||||
|
|
||||||
|
const formRules = {
|
||||||
|
contractNo: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
|
||||||
|
contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
|
||||||
|
money: [{ required: true, message: '请输入合同金额', trigger: 'blur' }],
|
||||||
|
};
|
||||||
|
|
||||||
|
const dialogTitle = computed(() => {
|
||||||
|
if (mode.value === 'view') return '查看采购合同';
|
||||||
|
if (mode.value === 'edit') return '编辑采购合同';
|
||||||
|
return '新增采购合同';
|
||||||
|
});
|
||||||
|
|
||||||
|
const canSubmit = computed(() => {
|
||||||
|
return formData.value.contractNo && formData.value.contractName && formData.value.money !== null && contractFileList.value.length > 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
const open = async (id: string, openMode: 'add' | 'edit' | 'view' = 'add') => {
|
||||||
|
applyId.value = id || '';
|
||||||
|
mode.value = openMode;
|
||||||
|
visible.value = true;
|
||||||
|
resetForm();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await getObj(id);
|
||||||
|
applyData.value = res?.data || {};
|
||||||
|
|
||||||
|
const contractRes = await getByPurchaseId(id);
|
||||||
|
const contractData = contractRes?.data;
|
||||||
|
if (contractData) {
|
||||||
|
formData.value = {
|
||||||
|
purchaseId: id,
|
||||||
|
contractNo: contractData.contractNo || '',
|
||||||
|
contractName: contractData.contractName || '',
|
||||||
|
money: contractData.money,
|
||||||
|
isBidding: contractData.isBidding || '0',
|
||||||
|
isLegalAdviser: contractData.isLegalAdviser || '0',
|
||||||
|
legalAdviserOpinion: contractData.legalAdviserOpinion || '',
|
||||||
|
isDepts: contractData.isDepts || '0',
|
||||||
|
isSchool: contractData.isSchool || '0',
|
||||||
|
remarks: contractData.remarks || '',
|
||||||
|
contractFileIds: [],
|
||||||
|
supplementFileIds: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
if (contractData.contractFiles && contractData.contractFiles.length > 0) {
|
||||||
|
contractFileList.value = contractData.contractFiles.map((f: any) => ({
|
||||||
|
id: f.id,
|
||||||
|
name: f.fileTitle || '合同文件',
|
||||||
|
url: f.fileUrl,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
if (contractData.supplementFiles && contractData.supplementFiles.length > 0) {
|
||||||
|
supplementFileList.value = contractData.supplementFiles.map((f: any) => ({
|
||||||
|
id: f.id,
|
||||||
|
name: f.fileTitle || '补充材料',
|
||||||
|
url: f.fileUrl,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取数据失败', e);
|
||||||
|
useMessage().error('获取数据失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
purchaseId: applyId.value,
|
||||||
|
contractNo: '',
|
||||||
|
contractName: '',
|
||||||
|
money: null,
|
||||||
|
isBidding: '0',
|
||||||
|
isLegalAdviser: '0',
|
||||||
|
legalAdviserOpinion: '',
|
||||||
|
isDepts: '0',
|
||||||
|
isSchool: '0',
|
||||||
|
remarks: '',
|
||||||
|
contractFileIds: [],
|
||||||
|
supplementFileIds: [],
|
||||||
|
};
|
||||||
|
contractFileList.value = [];
|
||||||
|
supplementFileList.value = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleTempStore = async () => {
|
||||||
|
await formRef.value?.validate();
|
||||||
|
|
||||||
|
const contractFileIds = contractFileList.value.filter((f) => f.id).map((f) => f.id);
|
||||||
|
const supplementFileIds = supplementFileList.value.filter((f) => f.id).map((f) => f.id);
|
||||||
|
|
||||||
|
submitting.value = true;
|
||||||
|
try {
|
||||||
|
await tempStore({
|
||||||
|
...formData.value,
|
||||||
|
purchaseId: applyId.value,
|
||||||
|
contractFileIds,
|
||||||
|
supplementFileIds,
|
||||||
|
});
|
||||||
|
useMessage().success('暂存成功');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err?.msg || '暂存失败');
|
||||||
|
} finally {
|
||||||
|
submitting.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
await formRef.value?.validate();
|
||||||
|
|
||||||
|
if (contractFileList.value.length === 0) {
|
||||||
|
useMessage().warning('请上传合同文件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const contractFileIds = contractFileList.value.filter((f) => f.id).map((f) => f.id);
|
||||||
|
const supplementFileIds = supplementFileList.value.filter((f) => f.id).map((f) => f.id);
|
||||||
|
|
||||||
|
submitting.value = true;
|
||||||
|
try {
|
||||||
|
await submitContract({
|
||||||
|
...formData.value,
|
||||||
|
purchaseId: applyId.value,
|
||||||
|
contractFileIds,
|
||||||
|
supplementFileIds,
|
||||||
|
});
|
||||||
|
useMessage().success('提交成功,合同审核流程已启动');
|
||||||
|
visible.value = false;
|
||||||
|
emit('refresh');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err?.msg || '提交失败');
|
||||||
|
} finally {
|
||||||
|
submitting.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'refresh'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.apply-info {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-tips {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
397
src/views/purchase/purchasingrequisition/contract-audit.vue
Normal file
397
src/views/purchase/purchasingrequisition/contract-audit.vue
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
<template>
|
||||||
|
<div class="contract-audit-container">
|
||||||
|
<el-card shadow="never" class="info-card">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span class="card-title">
|
||||||
|
<el-icon><Document /></el-icon>
|
||||||
|
采购申请信息
|
||||||
|
</span>
|
||||||
|
<el-tag v-if="flowStatus === '0'" type="warning">运行中</el-tag>
|
||||||
|
<el-tag v-else-if="flowStatus === '1'" type="success">已完成</el-tag>
|
||||||
|
<el-tag v-else-if="flowStatus === '2'" type="info">已作废</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-descriptions :column="2" border>
|
||||||
|
<el-descriptions-item label="采购编号">{{ applyData.purchaseNo || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="项目名称">{{ applyData.projectName || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="预算金额">{{ applyData.budget ? Number(applyData.budget).toLocaleString() + ' 元' : '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="申请人">{{ applyData.createName || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="申请部门" :span="2">{{ applyData.deptName || '-' }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="contract-card">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span class="card-title">
|
||||||
|
<el-icon><Tickets /></el-icon>
|
||||||
|
合同信息
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="160px" :disabled="isViewMode">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同编号" prop="contractNo">
|
||||||
|
<el-input v-model="formData.contractNo" placeholder="请输入合同编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同名称" prop="contractName">
|
||||||
|
<el-input v-model="formData.contractName" placeholder="请输入合同名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合同金额(元)" prop="money">
|
||||||
|
<el-input-number v-model="formData.money" :precision="2" :min="0" :controls="false" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否需要招标" prop="isBidding">
|
||||||
|
<el-radio-group v-model="formData.isBidding">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否需要法律顾问" prop="isLegalAdviser">
|
||||||
|
<el-radio-group v-model="formData.isLegalAdviser">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否涉及多个部门" prop="isDepts">
|
||||||
|
<el-radio-group v-model="formData.isDepts">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否全校合同" prop="isSchool">
|
||||||
|
<el-radio-group v-model="formData.isSchool">
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item v-if="formData.isLegalAdviser === '1'" label="法律顾问意见" prop="legalAdviserOpinion">
|
||||||
|
<el-input v-model="formData.legalAdviserOpinion" type="textarea" :rows="3" placeholder="请输入法律顾问意见" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input v-model="formData.remarks" type="textarea" :rows="2" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="file-card">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span class="card-title">
|
||||||
|
<el-icon><FolderOpened /></el-icon>
|
||||||
|
附件信息
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-tabs v-model="activeTab">
|
||||||
|
<el-tab-pane label="合同文件" name="contract">
|
||||||
|
<el-table v-loading="fileLoading" :data="contractFiles" stripe border v-if="contractFiles.length > 0">
|
||||||
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
|
<el-table-column prop="fileTitle" label="文件名称" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作" width="160" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||||
|
<el-button type="success" link icon="Download" @click="handleDownload(scope.row)">下载</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-empty v-else description="暂无合同文件" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="合同补充材料" name="supplement">
|
||||||
|
<el-table v-loading="fileLoading" :data="supplementFiles" stripe border v-if="supplementFiles.length > 0">
|
||||||
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
|
<el-table-column prop="fileTitle" label="文件名称" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作" width="160" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||||
|
<el-button type="success" link icon="Download" @click="handleDownload(scope.row)">下载</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-empty v-else description="暂无补充材料" />
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog v-model="previewVisible" :title="previewTitle" width="80%" top="5vh" destroy-on-close append-to-body>
|
||||||
|
<div class="preview-container">
|
||||||
|
<iframe v-if="previewUrl" :src="previewUrl" class="preview-iframe" />
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="ContractAudit">
|
||||||
|
import { ref, reactive, computed, onMounted, watch } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { Document, Tickets, FolderOpened } from '@element-plus/icons-vue';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { getObj } from '/@/api/purchase/purchasingrequisition';
|
||||||
|
import { getByPurchaseId, updateContract } from '/@/api/purchase/purchasingcontract';
|
||||||
|
import { previewFileById, downloadFileById } from '/@/api/purchase/purchasingrequisition';
|
||||||
|
import { currElTabIsSave } from '/@/api/order/order-key-vue';
|
||||||
|
|
||||||
|
const CONTRACT_FILE_TYPE = '160';
|
||||||
|
const SUPPLEMENT_FILE_TYPE = '170';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
currJob: { type: Object, default: null },
|
||||||
|
currElTab: { type: Object, default: null },
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['handleJob']);
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const loading = ref(false);
|
||||||
|
const fileLoading = ref(false);
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
|
const isFlowEmbed = computed(() => !!props.currJob);
|
||||||
|
const isViewMode = computed(() => {
|
||||||
|
if (isFlowEmbed.value && props.currJob) {
|
||||||
|
return !!props.currJob.hiJob || props.currElTab?.isFormEdit === '0';
|
||||||
|
}
|
||||||
|
return route.query.mode === 'view';
|
||||||
|
});
|
||||||
|
|
||||||
|
const applyData = ref<any>({});
|
||||||
|
const formData = ref({
|
||||||
|
purchaseId: '',
|
||||||
|
contractNo: '',
|
||||||
|
contractName: '',
|
||||||
|
money: null as number | null,
|
||||||
|
isBidding: '0',
|
||||||
|
isLegalAdviser: '0',
|
||||||
|
legalAdviserOpinion: '',
|
||||||
|
isDepts: '0',
|
||||||
|
isSchool: '0',
|
||||||
|
remarks: '',
|
||||||
|
contractFileIds: [] as string[],
|
||||||
|
supplementFileIds: [] as string[],
|
||||||
|
});
|
||||||
|
|
||||||
|
const formRules = {
|
||||||
|
contractNo: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
|
||||||
|
contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
|
||||||
|
money: [{ required: true, message: '请输入合同金额', trigger: 'blur' }],
|
||||||
|
};
|
||||||
|
|
||||||
|
const flowStatus = computed(() => formData.value.flowStatus || '0');
|
||||||
|
const activeTab = ref('contract');
|
||||||
|
const contractFiles = ref<any[]>([]);
|
||||||
|
const supplementFiles = ref<any[]>([]);
|
||||||
|
|
||||||
|
const previewVisible = ref(false);
|
||||||
|
const previewTitle = ref('');
|
||||||
|
const previewUrl = ref('');
|
||||||
|
|
||||||
|
const effectivePurchaseId = computed(() => {
|
||||||
|
if (props.currJob?.orderId) {
|
||||||
|
return String(props.currJob.orderId);
|
||||||
|
}
|
||||||
|
return (route.query.id as string) || (route.query.purchaseId as string) || '';
|
||||||
|
});
|
||||||
|
|
||||||
|
const loadApplyData = async () => {
|
||||||
|
if (!effectivePurchaseId.value) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await getObj(effectivePurchaseId.value);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
applyData.value = res.data;
|
||||||
|
}
|
||||||
|
} catch (e: any) {
|
||||||
|
ElMessage.error(e?.msg || '加载采购申请失败');
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadContractData = async () => {
|
||||||
|
if (!effectivePurchaseId.value) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileLoading.value = true;
|
||||||
|
const res = await getByPurchaseId(effectivePurchaseId.value);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
const data = res.data;
|
||||||
|
formData.value = {
|
||||||
|
purchaseId: effectivePurchaseId.value,
|
||||||
|
contractNo: data.contractNo || '',
|
||||||
|
contractName: data.contractName || '',
|
||||||
|
money: data.money,
|
||||||
|
isBidding: data.isBidding || '0',
|
||||||
|
isLegalAdviser: data.isLegalAdviser || '0',
|
||||||
|
legalAdviserOpinion: data.legalAdviserOpinion || '',
|
||||||
|
isDepts: data.isDepts || '0',
|
||||||
|
isSchool: data.isSchool || '0',
|
||||||
|
remarks: data.remarks || '',
|
||||||
|
contractFileIds: [],
|
||||||
|
supplementFileIds: [],
|
||||||
|
};
|
||||||
|
(formData.value as any).flowStatus = data.flowStatus;
|
||||||
|
|
||||||
|
if (data.contractFiles && data.contractFiles.length > 0) {
|
||||||
|
contractFiles.value = data.contractFiles;
|
||||||
|
}
|
||||||
|
if (data.supplementFiles && data.supplementFiles.length > 0) {
|
||||||
|
supplementFiles.value = data.supplementFiles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: any) {
|
||||||
|
ElMessage.error(e?.msg || '加载合同信息失败');
|
||||||
|
} finally {
|
||||||
|
fileLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePreview = async (row: any) => {
|
||||||
|
if (!row.id) {
|
||||||
|
ElMessage.warning('文件ID不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const blob = await previewFileById(row.id);
|
||||||
|
previewUrl.value = window.URL.createObjectURL(blob);
|
||||||
|
previewTitle.value = row.fileTitle || '文件预览';
|
||||||
|
previewVisible.value = true;
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error('预览失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDownload = async (row: any) => {
|
||||||
|
if (!row.id) {
|
||||||
|
ElMessage.warning('文件ID不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const blob = await downloadFileById(row.id);
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = row.fileTitle || '附件.pdf';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error('下载失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFlowSave = async () => {
|
||||||
|
try {
|
||||||
|
await formRef.value?.validate();
|
||||||
|
|
||||||
|
const contractFileIds = contractFiles.value.filter((f: any) => f.id).map((f: any) => f.id);
|
||||||
|
const supplementFileIds = supplementFiles.value.filter((f: any) => f.id).map((f: any) => f.id);
|
||||||
|
|
||||||
|
await updateContract({
|
||||||
|
...formData.value,
|
||||||
|
purchaseId: effectivePurchaseId.value,
|
||||||
|
contractFileIds,
|
||||||
|
supplementFileIds,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (props.currJob && props.currElTab?.id) {
|
||||||
|
currElTabIsSave(props.currJob, props.currElTab.id, true, emit);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (e: any) {
|
||||||
|
ElMessage.error(e?.msg || '保存失败');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const registerFlowCallbacks = () => {
|
||||||
|
if (!isFlowEmbed.value) return;
|
||||||
|
|
||||||
|
if (props.currJob?.resolveSaves) {
|
||||||
|
props.currJob.resolveSaves.push(handleFlowSave);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await loadApplyData();
|
||||||
|
await loadContractData();
|
||||||
|
registerFlowCallbacks();
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.currJob,
|
||||||
|
async (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
await loadApplyData();
|
||||||
|
await loadContractData();
|
||||||
|
registerFlowCallbacks();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: false }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.contract-audit-container {
|
||||||
|
padding: 16px;
|
||||||
|
min-height: 100%;
|
||||||
|
background: var(--el-fill-color-lighter);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-card,
|
||||||
|
.contract-card,
|
||||||
|
.file-card {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 75vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -308,6 +308,34 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- 采购合同列 -->
|
||||||
|
<el-table-column prop="contractFlowStatus" label="采购合同" width="100" align="center">
|
||||||
|
<template #header>
|
||||||
|
<el-icon>
|
||||||
|
<Tickets />
|
||||||
|
</el-icon>
|
||||||
|
<span style="margin-left: 4px">采购合同</span>
|
||||||
|
</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="scope.row.status === '1'">
|
||||||
|
<el-tooltip v-if="scope.row.contractFlowStatus" content="点击查看合同详情" placement="top">
|
||||||
|
<el-tag v-if="scope.row.contractFlowStatus === '0'" type="warning" class="status-tag-clickable" @click="handleShowContractDetail(scope.row)"
|
||||||
|
>运行中
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.contractFlowStatus === '1'" type="success" class="status-tag-clickable" @click="handleShowContractDetail(scope.row)"
|
||||||
|
>已完成
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.contractFlowStatus === '2'" type="info" class="status-tag-clickable" @click="handleShowContractDetail(scope.row)"
|
||||||
|
>已作废
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else type="info" class="status-tag-clickable" @click="handleShowContractDetail(scope.row)">{{ scope.row.contractFlowStatus }}</el-tag>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-button v-else type="primary" link size="small" @click="handleAddContract(scope.row)">添加合同</el-button>
|
||||||
|
</template>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" fixed="right" width="150">
|
<el-table-column label="操作" align="center" fixed="right" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="op-cell">
|
<div class="op-cell">
|
||||||
@@ -374,6 +402,18 @@
|
|||||||
<!-- 招标文件审批查看弹窗 -->
|
<!-- 招标文件审批查看弹窗 -->
|
||||||
<DocAuditViewDialog ref="docAuditViewDialogRef" @refresh="getDataList" />
|
<DocAuditViewDialog ref="docAuditViewDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
|
<!-- 采购合同弹窗 -->
|
||||||
|
<PurchaseContractDialog ref="purchaseContractDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
|
<!-- 采购合同详情弹窗 -->
|
||||||
|
<PurchaseContractDetailDialog ref="purchaseContractDetailDialogRef" />
|
||||||
|
|
||||||
|
<!-- 采购合同弹窗 -->
|
||||||
|
<PurchaseContractDialog ref="purchaseContractDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
|
<!-- 采购合同详情弹窗 -->
|
||||||
|
<PurchaseContractDetailDialog ref="purchaseContractDetailDialogRef" />
|
||||||
|
|
||||||
<!-- 招标文件审核弹窗 -->
|
<!-- 招标文件审核弹窗 -->
|
||||||
<!-- <DocAuditDialog ref="docAuditDialogRef" @refresh="getDataList" />-->
|
<!-- <DocAuditDialog ref="docAuditDialogRef" @refresh="getDataList" />-->
|
||||||
|
|
||||||
@@ -459,6 +499,7 @@ import {
|
|||||||
OfficeBuilding,
|
OfficeBuilding,
|
||||||
Warning,
|
Warning,
|
||||||
DocumentChecked,
|
DocumentChecked,
|
||||||
|
Tickets,
|
||||||
Edit,
|
Edit,
|
||||||
Delete,
|
Delete,
|
||||||
Upload,
|
Upload,
|
||||||
@@ -492,6 +533,8 @@ const ContractDialog = defineAsyncComponent(() => import('./contract/ContractDia
|
|||||||
const SupplementFilesDialog = defineAsyncComponent(() => import('./SupplementFilesDialog.vue'));
|
const SupplementFilesDialog = defineAsyncComponent(() => import('./SupplementFilesDialog.vue'));
|
||||||
const SupplementViewDialog = defineAsyncComponent(() => import('./SupplementViewDialog.vue'));
|
const SupplementViewDialog = defineAsyncComponent(() => import('./SupplementViewDialog.vue'));
|
||||||
const DocAuditViewDialog = defineAsyncComponent(() => import('./DocAuditViewDialog.vue'));
|
const DocAuditViewDialog = defineAsyncComponent(() => import('./DocAuditViewDialog.vue'));
|
||||||
|
const PurchaseContractDialog = defineAsyncComponent(() => import('./PurchaseContractDialog.vue'));
|
||||||
|
const PurchaseContractDetailDialog = defineAsyncComponent(() => import('./PurchaseContractDetailDialog.vue'));
|
||||||
// const DocAuditDialog = defineAsyncComponent(() => import('./docAudit/DocAuditDialog.vue'));
|
// const DocAuditDialog = defineAsyncComponent(() => import('./docAudit/DocAuditDialog.vue'));
|
||||||
|
|
||||||
// 字典数据和品目树数据
|
// 字典数据和品目树数据
|
||||||
@@ -526,6 +569,8 @@ const contractDialogRef = ref();
|
|||||||
const supplementFilesDialogRef = ref();
|
const supplementFilesDialogRef = ref();
|
||||||
const supplementViewDialogRef = ref();
|
const supplementViewDialogRef = ref();
|
||||||
const docAuditViewDialogRef = ref();
|
const docAuditViewDialogRef = ref();
|
||||||
|
const purchaseContractDialogRef = ref();
|
||||||
|
const purchaseContractDetailDialogRef = ref();
|
||||||
|
|
||||||
/** 采购代表弹窗 */
|
/** 采购代表弹窗 */
|
||||||
const representorDialogVisible = ref(false);
|
const representorDialogVisible = ref(false);
|
||||||
@@ -692,6 +737,26 @@ const handleShowSupplement = (row: any) => {
|
|||||||
supplementViewDialogRef.value?.open(String(id), row);
|
supplementViewDialogRef.value?.open(String(id), row);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 点击添加合同:打开采购合同弹窗 */
|
||||||
|
const handleAddContract = (row: any) => {
|
||||||
|
const id = row?.id ?? row?.purchaseId;
|
||||||
|
if (!id) {
|
||||||
|
useMessage().warning('无法获取采购申请ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
purchaseContractDialogRef.value?.open(String(id), 'add');
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 点击采购合同状态:打开采购合同详情弹窗 */
|
||||||
|
const handleShowContractDetail = (row: any) => {
|
||||||
|
const id = row?.id ?? row?.purchaseId;
|
||||||
|
if (!id) {
|
||||||
|
useMessage().warning('无法获取采购申请ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
purchaseContractDetailDialogRef.value?.open(String(id));
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打开查看对话框
|
* 打开查看对话框
|
||||||
* @param row - 当前行数据
|
* @param row - 当前行数据
|
||||||
|
|||||||
Reference in New Issue
Block a user