tijiao
This commit is contained in:
@@ -102,16 +102,10 @@
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" label="编号" min-width="120" show-overflow-tooltip>
|
||||
<el-table-column prop="code" label="申请单编号" min-width="140" show-overflow-tooltip>
|
||||
<template #header>
|
||||
<el-icon><DocumentCopy /></el-icon>
|
||||
<span style="margin-left: 4px">编号</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="purchaseNo" label="采购编号" min-width="120" show-overflow-tooltip>
|
||||
<template #header>
|
||||
<el-icon><DocumentCopy /></el-icon>
|
||||
<span style="margin-left: 4px">采购编号</span>
|
||||
<span style="margin-left: 4px">申请单编号</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectName" label="采购项目名称" min-width="200" show-overflow-tooltip>
|
||||
@@ -120,27 +114,57 @@
|
||||
<span style="margin-left: 4px">采购项目名称</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectType" label="项目类别" width="100" align="center">
|
||||
<el-table-column prop="applyDate" label="填报日期" width="120" align="center" show-overflow-tooltip>
|
||||
<template #header>
|
||||
<el-icon><Calendar /></el-icon>
|
||||
<span style="margin-left: 4px">填报日期</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" label="需求部门" min-width="150" show-overflow-tooltip>
|
||||
<template #header>
|
||||
<el-icon><OfficeBuilding /></el-icon>
|
||||
<span style="margin-left: 4px">需求部门</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectType" label="项目类别" min-width="200" align="left" show-overflow-tooltip>
|
||||
<template #header>
|
||||
<el-icon><Collection /></el-icon>
|
||||
<span style="margin-left: 4px">项目类别</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.projectType === 'A'" type="success">货物</el-tag>
|
||||
<el-tag v-else-if="scope.row.projectType === 'B'" type="warning">工程</el-tag>
|
||||
<el-tag v-else-if="scope.row.projectType === 'C'" type="info">服务</el-tag>
|
||||
<span v-else>-</span>
|
||||
<div>
|
||||
<el-tag v-if="scope.row.projectType === 'A'" type="success" style="margin-right: 8px;">货物</el-tag>
|
||||
<el-tag v-else-if="scope.row.projectType === 'B'" type="warning" style="margin-right: 8px;">工程</el-tag>
|
||||
<el-tag v-else-if="scope.row.projectType === 'C'" type="info" style="margin-right: 8px;">服务</el-tag>
|
||||
<span v-if="scope.row.categoryName" style="color: #606266; font-size: 12px;">
|
||||
{{ scope.row.categoryName }}
|
||||
</span>
|
||||
<span v-else-if="scope.row.categoryCode" style="color: #909399; font-size: 12px;">
|
||||
{{ scope.row.categoryCode }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="budget" label="预算金额(元)" width="120" align="right">
|
||||
<el-table-column prop="budget" label="项目预算(元)" width="130" align="right">
|
||||
<template #header>
|
||||
<el-icon><Money /></el-icon>
|
||||
<span style="margin-left: 4px">预算金额</span>
|
||||
<span style="margin-left: 4px">项目预算</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
{{ scope.row.budget ? Number(scope.row.budget).toLocaleString() : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isSpecial" label="是否特殊" width="100" align="center">
|
||||
<template #header>
|
||||
<el-icon><Warning /></el-icon>
|
||||
<span style="margin-left: 4px">是否特殊</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.isSpecial === '1' || scope.row.isSpecial === 1" type="warning">是</el-tag>
|
||||
<el-tag v-else-if="scope.row.isSpecial === '0' || scope.row.isSpecial === 0" type="info">否</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isCentralized" label="是否集采" width="100" align="center">
|
||||
<template #header>
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
@@ -152,10 +176,10 @@
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
||||
<el-table-column prop="status" label="审核状态" width="100" align="center">
|
||||
<template #header>
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
<span style="margin-left: 4px">状态</span>
|
||||
<span style="margin-left: 4px">审核状态</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.status === '-2'" type="info">撤回</el-tag>
|
||||
@@ -167,13 +191,7 @@
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="180" show-overflow-tooltip>
|
||||
<template #header>
|
||||
<el-icon><Clock /></el-icon>
|
||||
<span style="margin-left: 4px">创建时间</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="200">
|
||||
<el-table-column label="操作" align="center" fixed="right" width="300">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="View"
|
||||
@@ -204,10 +222,10 @@
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="state.total > 0"
|
||||
:total="state.total"
|
||||
v-model:page="state.page"
|
||||
v-model:limit="state.limit"
|
||||
v-if="state.pagination && state.pagination.total && state.pagination.total > 0"
|
||||
:total="state.pagination.total"
|
||||
:current="state.pagination.current"
|
||||
:size="state.pagination.size"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</el-card>
|
||||
@@ -217,7 +235,8 @@
|
||||
<el-dialog
|
||||
v-model="showAddIframe"
|
||||
title="新增采购申请"
|
||||
width="1000px"
|
||||
width="90%"
|
||||
:style="{ maxWidth: '1600px' }"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="true"
|
||||
destroy-on-close
|
||||
@@ -229,26 +248,42 @@
|
||||
:src="addIframeSrc"
|
||||
frameborder="0"
|
||||
class="add-iframe"
|
||||
@load="onIframeLoad" />
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 编辑、新增表单对话框 -->
|
||||
<FormDialog ref="formDialogRef" @refresh="getDataList" />
|
||||
<FormDialog
|
||||
ref="formDialogRef"
|
||||
:dict-data="dictData"
|
||||
@refresh="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="PurchasingRequisition">
|
||||
import { ref, reactive, defineAsyncComponent, onUnmounted } from 'vue'
|
||||
import { ref, reactive, defineAsyncComponent, onUnmounted, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { getPage, delObj } from "/@/api/finance/purchasingrequisition";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { List, Document, DocumentCopy, Search, Collection, Money, CircleCheck, InfoFilled, Clock } from '@element-plus/icons-vue'
|
||||
import { getDicts } from '/@/api/admin/dict';
|
||||
import { getTree } from '/@/api/finance/purchasingcategory';
|
||||
import { List, Document, DocumentCopy, Search, Collection, Money, CircleCheck, InfoFilled, Calendar, OfficeBuilding, Warning } from '@element-plus/icons-vue'
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
|
||||
// 字典数据和品目树数据
|
||||
const dictData = ref({
|
||||
fundSourceList: [] as any[],
|
||||
isCentralizedList: [] as any[],
|
||||
isSpecialList: [] as any[],
|
||||
purchaseTypeDeptList: [] as any[],
|
||||
purchaseModeSchoolList: [] as any[],
|
||||
purchaseTypeUnionList: [] as any[],
|
||||
categoryTreeData: [] as any[],
|
||||
});
|
||||
|
||||
// 定义变量内容
|
||||
const router = useRouter()
|
||||
const tableRef = ref()
|
||||
@@ -332,11 +367,7 @@ const handleIframeMessage = (event: MessageEvent) => {
|
||||
*/
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除该记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
await useMessageBox().confirm('确定要删除该记录吗?');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
@@ -350,6 +381,151 @@ const handleDelete = async (row: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 获取字典数据和品目树数据
|
||||
const loadDictData = async () => {
|
||||
try {
|
||||
const [
|
||||
fundSourceRes,
|
||||
isCentralizedRes,
|
||||
isSpecialRes,
|
||||
purchaseTypeDeptRes,
|
||||
purchaseModeSchoolRes,
|
||||
purchaseTypeUnionRes,
|
||||
categoryTreeRes
|
||||
] = await Promise.all([
|
||||
getDicts('PURCHASE_FUND_SOURCE'),
|
||||
getDicts('PURCHASE_IS_CEN'),
|
||||
getDicts('PURCHASE_IS_SPEC'),
|
||||
getDicts('PURCHASE_TYPE_DEPT'),
|
||||
getDicts('PURCHASE_MODE_SCHOOL'),
|
||||
getDicts('PURCHASE_TYPE_UNION'),
|
||||
getTree()
|
||||
]);
|
||||
|
||||
// 处理资金来源字典
|
||||
if (fundSourceRes.data && Array.isArray(fundSourceRes.data)) {
|
||||
dictData.value.fundSourceList = fundSourceRes.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
} else {
|
||||
dictData.value.fundSourceList = [
|
||||
{ label: '切块经费', value: '0' },
|
||||
{ label: '设备购置费', value: '1' },
|
||||
{ label: '专项经费', value: '2' },
|
||||
{ label: '代办费', value: '3' },
|
||||
{ label: '培训经费', value: '4' },
|
||||
{ label: '日常公用经费', value: '5' },
|
||||
{ label: '技能大赛经费', value: '6' },
|
||||
{ label: '基本建设资金', value: '7' },
|
||||
{ label: '暂存款', value: '8' },
|
||||
{ label: '会议费', value: '9' },
|
||||
];
|
||||
}
|
||||
|
||||
// 处理是否集采字典
|
||||
if (isCentralizedRes.data && Array.isArray(isCentralizedRes.data)) {
|
||||
dictData.value.isCentralizedList = isCentralizedRes.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
} else {
|
||||
dictData.value.isCentralizedList = [
|
||||
{ label: '否', value: '0' },
|
||||
{ label: '政府集中采购', value: '1' },
|
||||
{ label: '学校集中采购', value: '2' }
|
||||
];
|
||||
}
|
||||
|
||||
// 处理是否特殊情况字典
|
||||
if (isSpecialRes.data && Array.isArray(isSpecialRes.data)) {
|
||||
dictData.value.isSpecialList = isSpecialRes.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
} else {
|
||||
dictData.value.isSpecialList = [
|
||||
{ label: '否', value: '0' },
|
||||
{ label: '紧急', value: '1' },
|
||||
{ label: '单一', value: '2' },
|
||||
{ label: '进口', value: '3' }
|
||||
];
|
||||
}
|
||||
|
||||
// 处理部门采购方式字典
|
||||
if (purchaseTypeDeptRes.data && Array.isArray(purchaseTypeDeptRes.data)) {
|
||||
dictData.value.purchaseTypeDeptList = purchaseTypeDeptRes.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
}
|
||||
|
||||
// 处理学校采购形式字典
|
||||
if (purchaseModeSchoolRes.data && Array.isArray(purchaseModeSchoolRes.data)) {
|
||||
dictData.value.purchaseModeSchoolList = purchaseModeSchoolRes.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
} else {
|
||||
dictData.value.purchaseModeSchoolList = [
|
||||
{ label: '政府采购', value: '1' },
|
||||
{ label: '学校自主采购', value: '2' }
|
||||
];
|
||||
}
|
||||
|
||||
// 处理学校统一采购方式字典
|
||||
if (purchaseTypeUnionRes.data && Array.isArray(purchaseTypeUnionRes.data)) {
|
||||
dictData.value.purchaseTypeUnionList = purchaseTypeUnionRes.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}));
|
||||
}
|
||||
|
||||
// 处理品目树数据
|
||||
if (categoryTreeRes.data && Array.isArray(categoryTreeRes.data)) {
|
||||
dictData.value.categoryTreeData = categoryTreeRes.data;
|
||||
} else {
|
||||
dictData.value.categoryTreeData = [];
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('加载字典数据失败', err);
|
||||
// 设置默认值
|
||||
dictData.value.fundSourceList = [
|
||||
{ label: '切块经费', value: '0' },
|
||||
{ label: '设备购置费', value: '1' },
|
||||
{ label: '专项经费', value: '2' },
|
||||
{ label: '代办费', value: '3' },
|
||||
{ label: '培训经费', value: '4' },
|
||||
{ label: '日常公用经费', value: '5' },
|
||||
{ label: '技能大赛经费', value: '6' },
|
||||
{ label: '基本建设资金', value: '7' },
|
||||
{ label: '暂存款', value: '8' },
|
||||
{ label: '会议费', value: '9' },
|
||||
];
|
||||
dictData.value.isCentralizedList = [
|
||||
{ label: '否', value: '0' },
|
||||
{ label: '政府集中采购', value: '1' },
|
||||
{ label: '学校集中采购', value: '2' }
|
||||
];
|
||||
dictData.value.isSpecialList = [
|
||||
{ label: '否', value: '0' },
|
||||
{ label: '紧急', value: '1' },
|
||||
{ label: '单一', value: '2' },
|
||||
{ label: '进口', value: '3' }
|
||||
];
|
||||
dictData.value.purchaseModeSchoolList = [
|
||||
{ label: '政府采购', value: '1' },
|
||||
{ label: '学校自主采购', value: '2' }
|
||||
];
|
||||
dictData.value.categoryTreeData = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 页面加载时获取字典数据和品目树数据
|
||||
onMounted(() => {
|
||||
loadDictData();
|
||||
});
|
||||
|
||||
// 组件卸载时清理事件监听器
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('message', handleIframeMessage)
|
||||
|
||||
Reference in New Issue
Block a user