履约验收
This commit is contained in:
@@ -76,6 +76,20 @@ export function submitObj(obj: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分配招标代理(指定或随机),仅学校统一采购或部门自行采购且委托采购中心采购时可用
|
||||||
|
* @param applyId 采购申请ID
|
||||||
|
* @param mode random | designated
|
||||||
|
* @param agentId 指定模式时的代理ID
|
||||||
|
*/
|
||||||
|
export function assignAgent(applyId: number | string, mode: 'random' | 'designated', agentId?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/purchasingapply/assign-agent',
|
||||||
|
method: 'post',
|
||||||
|
data: { id: Number(applyId), mode, agentId: agentId || undefined }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改采购申请
|
* 修改采购申请
|
||||||
* @param obj 对象数据
|
* @param obj 对象数据
|
||||||
|
|||||||
@@ -403,6 +403,17 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 查看时:招标代理(与实施采购信息同风格:分割线+标签值同行) -->
|
||||||
|
<div v-if="isViewMode && dataForm.agentName" class="implement-info-block mb20">
|
||||||
|
<el-divider content-position="left">招标代理</el-divider>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="12" class="mb16">
|
||||||
|
<div class="view-label">代理名称</div>
|
||||||
|
<div class="view-value">{{ dataForm.agentName }}</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 查看时:实施采购信息 -->
|
<!-- 查看时:实施采购信息 -->
|
||||||
<div v-if="isViewMode && (dataForm.implementType || viewImplementPurchaseFiles.length)" class="implement-info-block mb20">
|
<div v-if="isViewMode && (dataForm.implementType || viewImplementPurchaseFiles.length)" class="implement-info-block mb20">
|
||||||
<el-divider content-position="left">实施采购信息</el-divider>
|
<el-divider content-position="left">实施采购信息</el-divider>
|
||||||
@@ -616,6 +627,8 @@ const dataForm = reactive({
|
|||||||
implementType: '',
|
implementType: '',
|
||||||
fileFlowInstId: '',
|
fileFlowInstId: '',
|
||||||
fileFlowStatus: '',
|
fileFlowStatus: '',
|
||||||
|
agentId: '',
|
||||||
|
agentName: '',
|
||||||
});
|
});
|
||||||
/** 查看时展示的采购文件列表(实施采购上传的 type=130) */
|
/** 查看时展示的采购文件列表(实施采购上传的 type=130) */
|
||||||
const viewImplementPurchaseFiles = ref<{ id: string; fileTitle?: string; createTime?: string; remark?: string }[]>([]);
|
const viewImplementPurchaseFiles = ref<{ id: string; fileTitle?: string; createTime?: string; remark?: string }[]>([]);
|
||||||
@@ -1147,6 +1160,8 @@ async function loadDetail(applyId: string | number) {
|
|||||||
implementType: detail.implementType ?? '',
|
implementType: detail.implementType ?? '',
|
||||||
fileFlowInstId: detail.fileFlowInstId ?? '',
|
fileFlowInstId: detail.fileFlowInstId ?? '',
|
||||||
fileFlowStatus: detail.fileFlowStatus ?? '',
|
fileFlowStatus: detail.fileFlowStatus ?? '',
|
||||||
|
agentId: detail.agentId ?? '',
|
||||||
|
agentName: detail.agentName ?? '',
|
||||||
});
|
});
|
||||||
setCategoryCodePath();
|
setCategoryCodePath();
|
||||||
currentStep.value = 0;
|
currentStep.value = 0;
|
||||||
|
|||||||
@@ -336,6 +336,61 @@
|
|||||||
|
|
||||||
<!-- 实施采购:iframe 嵌入 implement.vue,供列表与流程页面使用 -->
|
<!-- 实施采购:iframe 嵌入 implement.vue,供列表与流程页面使用 -->
|
||||||
<ImplementForm ref="implementFormRef" @refresh="getDataList" />
|
<ImplementForm ref="implementFormRef" @refresh="getDataList" />
|
||||||
|
|
||||||
|
<!-- 分配代理弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
v-model="assignAgentDialogVisible"
|
||||||
|
title="分配代理"
|
||||||
|
width="420px"
|
||||||
|
destroy-on-close
|
||||||
|
@close="assignAgentForm.agentId = ''; assignAgentForm.mode = 'designated'"
|
||||||
|
>
|
||||||
|
<el-form label-width="90px">
|
||||||
|
<el-form-item label="分配方式">
|
||||||
|
<el-radio-group v-model="assignAgentForm.mode">
|
||||||
|
<el-radio label="designated">指定</el-radio>
|
||||||
|
<el-radio label="random">随机</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="assignAgentForm.mode === 'designated'" label="招标代理">
|
||||||
|
<el-select
|
||||||
|
v-model="assignAgentForm.agentId"
|
||||||
|
placeholder="请选择招标代理"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
:loading="agentListLoading"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in agentList" :key="item.id" :label="item.agentName" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="assignAgentCurrentRow?.agentName" label="当前代理">
|
||||||
|
<span>{{ assignAgentCurrentRow.agentName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span>
|
||||||
|
<el-button @click="assignAgentDialogVisible = false">取消</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="assignAgentForm.mode === 'random'"
|
||||||
|
type="primary"
|
||||||
|
:loading="assignAgentSubmitting"
|
||||||
|
@click="handleAssignAgentRandom"
|
||||||
|
>
|
||||||
|
随机分配
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
type="primary"
|
||||||
|
:loading="assignAgentSubmitting"
|
||||||
|
:disabled="!assignAgentForm.agentId"
|
||||||
|
@click="handleAssignAgentDesignated"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -343,7 +398,8 @@
|
|||||||
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
|
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||||
import { getPage, delObj, submitObj, getArchiveDownloadUrl, getApplyTemplateDownloadUrl, getFileApplyTemplateDownloadUrl } from "/@/api/finance/purchasingrequisition";
|
import { getPage, delObj, submitObj, getArchiveDownloadUrl, getApplyTemplateDownloadUrl, getFileApplyTemplateDownloadUrl, assignAgent } from "/@/api/finance/purchasingrequisition";
|
||||||
|
import { getPage as getAgentPage } from '/@/api/finance/purchaseagent';
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||||
import { getDicts } from '/@/api/admin/dict';
|
import { getDicts } from '/@/api/admin/dict';
|
||||||
import { getTree } from '/@/api/finance/purchasingcategory';
|
import { getTree } from '/@/api/finance/purchasingcategory';
|
||||||
@@ -382,6 +438,75 @@ const currFlowCommentType = ref<'apply' | 'file'>('apply')
|
|||||||
|
|
||||||
const implementFormRef = ref()
|
const implementFormRef = ref()
|
||||||
|
|
||||||
|
/** 分配代理弹窗 */
|
||||||
|
const assignAgentDialogVisible = ref(false)
|
||||||
|
const assignAgentCurrentRow = ref<any>(null)
|
||||||
|
const assignAgentForm = reactive({ mode: 'designated' as 'designated' | 'random', agentId: '' })
|
||||||
|
const agentList = ref<any[]>([])
|
||||||
|
const agentListLoading = ref(false)
|
||||||
|
const assignAgentSubmitting = ref(false)
|
||||||
|
|
||||||
|
const openAssignAgentDialog = async (row: any) => {
|
||||||
|
assignAgentCurrentRow.value = row
|
||||||
|
assignAgentForm.mode = 'designated'
|
||||||
|
assignAgentForm.agentId = ''
|
||||||
|
assignAgentDialogVisible.value = true
|
||||||
|
agentListLoading.value = true
|
||||||
|
try {
|
||||||
|
const res = await getAgentPage({ size: 500, current: 1 })
|
||||||
|
const records = res?.data?.records ?? res?.records ?? []
|
||||||
|
agentList.value = Array.isArray(records) ? records : []
|
||||||
|
} catch (_) {
|
||||||
|
agentList.value = []
|
||||||
|
} finally {
|
||||||
|
agentListLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAssignAgentRandom = async () => {
|
||||||
|
const row = assignAgentCurrentRow.value
|
||||||
|
const id = row?.id ?? row?.purchaseId
|
||||||
|
if (id == null || id === '') {
|
||||||
|
useMessage().warning('无法获取申请单ID')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
assignAgentSubmitting.value = true
|
||||||
|
try {
|
||||||
|
await assignAgent(Number(id), 'random')
|
||||||
|
useMessage().success('随机分配代理成功')
|
||||||
|
assignAgentDialogVisible.value = false
|
||||||
|
getDataList()
|
||||||
|
} catch (e: any) {
|
||||||
|
useMessage().error(e?.msg || '随机分配代理失败')
|
||||||
|
} finally {
|
||||||
|
assignAgentSubmitting.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAssignAgentDesignated = async () => {
|
||||||
|
const row = assignAgentCurrentRow.value
|
||||||
|
const id = row?.id ?? row?.purchaseId
|
||||||
|
if (id == null || id === '') {
|
||||||
|
useMessage().warning('无法获取申请单ID')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!assignAgentForm.agentId) {
|
||||||
|
useMessage().warning('请选择招标代理')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
assignAgentSubmitting.value = true
|
||||||
|
try {
|
||||||
|
await assignAgent(Number(id), 'designated', assignAgentForm.agentId)
|
||||||
|
useMessage().success('指定代理成功')
|
||||||
|
assignAgentDialogVisible.value = false
|
||||||
|
getDataList()
|
||||||
|
} catch (e: any) {
|
||||||
|
useMessage().error(e?.msg || '指定代理失败')
|
||||||
|
} finally {
|
||||||
|
assignAgentSubmitting.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定义响应式表格数据
|
* 定义响应式表格数据
|
||||||
*/
|
*/
|
||||||
@@ -561,6 +686,12 @@ const getActionMenuItems = (row: any) => {
|
|||||||
icon: Download,
|
icon: Download,
|
||||||
visible: () => true,
|
visible: () => true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
command: 'assignAgent',
|
||||||
|
label: '分配代理',
|
||||||
|
icon: Collection,
|
||||||
|
visible: () => row?.purchaseMode === '2' || (row?.purchaseMode === '0' && row?.purchaseType === '4'),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -591,6 +722,9 @@ const handleMoreCommand = (command: string, row: any) => {
|
|||||||
case 'downloadFileApply':
|
case 'downloadFileApply':
|
||||||
handleDownloadFileApply(row);
|
handleDownloadFileApply(row);
|
||||||
break;
|
break;
|
||||||
|
case 'assignAgent':
|
||||||
|
openAssignAgentDialog(row);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user