345 lines
14 KiB
Vue
345 lines
14 KiB
Vue
<template>
|
|
<div class="p-2">
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
<el-card shadow="hover">
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item label="建设单位" prop="construction">
|
|
<el-input v-model="queryParams.construction" placeholder="请输入建设单位" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item label="立项申请人" prop="projectApplicant">
|
|
<el-input v-model="queryParams.projectApplicant" placeholder="请输入立项申请人" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-card>
|
|
</div>
|
|
</transition>
|
|
<el-card shadow="never">
|
|
<template #header>
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['bidding:listOfWinningBids:add']">新增</el-button>
|
|
</el-col>
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</template>
|
|
|
|
<el-table v-loading="loading" :data="listOfWinningBidsList" @selection-change="handleSelectionChange">
|
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
<el-table-column label="序号" align="center" type="index" width="60" />
|
|
<el-table-column label="项目状态" align="center" prop="projectStatus" />
|
|
<el-table-column label="项目名称" align="center" prop="projectName" />
|
|
<el-table-column label="中标价" align="center" prop="winningBidOriginal" />
|
|
<el-table-column label="汇率" align="center" prop="exchangeRate" />
|
|
<el-table-column label="币种" align="center" prop="currency" />
|
|
<el-table-column label="所属主体" align="center" prop="subject" />
|
|
<el-table-column label="中标价" align="center" prop="winningBid" />
|
|
<el-table-column label="中标日期" align="center" prop="bidWinningDate" width="120"> </el-table-column>
|
|
<el-table-column label="投标保证金" align="center" prop="bidDeposit" width="120" />
|
|
<el-table-column label="是否退还" align="center" prop="whetherSendBack" />
|
|
<el-table-column label="建设单位" align="center" prop="construction" />
|
|
<el-table-column label="总造价" align="center" prop="totalCost" />
|
|
<el-table-column label="立项申请人" align="center" prop="projectApplicant" width="120" />
|
|
<el-table-column label="立项部门" align="center" prop="projectApplicantDept" />
|
|
<el-table-column label="立项申请日期" align="center" prop="projectApplicantTime" width="120"> </el-table-column>
|
|
<el-table-column label="流程状态" align="center" prop="processStatus" />
|
|
<el-table-column label="项目编号" align="center" prop="projectNumbering" />
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
|
<template #default="scope">
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['bidding:listOfWinningBids:edit']"
|
|
>修改</el-button
|
|
>
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['bidding:listOfWinningBids:remove']">
|
|
删除</el-button
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
</el-card>
|
|
<!-- 添加或修改中标项目一览对话框 -->
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
|
<el-form ref="listOfWinningBidsFormRef" :model="form" :rules="rules" label-width="110px">
|
|
<el-row :gutter="24">
|
|
<el-col :span="12">
|
|
<el-form-item label="项目名称" prop="projectName"> <el-input v-model="form.projectName" placeholder="请输入项目名称" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="中标价" prop="winningBidOriginal">
|
|
<el-input v-model="form.winningBidOriginal" placeholder="请输入中标价" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="汇率" prop="exchangeRate"> <el-input v-model="form.exchangeRate" placeholder="请输入汇率" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="币种" prop="currency"> <el-input v-model="form.currency" placeholder="请输入币种" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="所属主体" prop="subject"> <el-input v-model="form.subject" placeholder="请输入所属主体" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12"
|
|
><el-form-item label="中标价" prop="winningBid"> <el-input v-model="form.winningBid" placeholder="请输入中标价" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12"
|
|
><el-form-item label="中标日期" prop="bidWinningDate">
|
|
<el-date-picker
|
|
clearable
|
|
v-model="form.bidWinningDate"
|
|
type="date"
|
|
format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
placeholder="请选择中标日期"
|
|
>
|
|
</el-date-picker> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="投标保证金" prop="bidDeposit"> <el-input v-model="form.bidDeposit" placeholder="请输入投标保证金" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="是否退还" prop="whetherSendBack">
|
|
<el-input v-model="form.whetherSendBack" placeholder="请输入是否退还" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12"
|
|
><el-form-item label="建设单位" prop="construction"> <el-input v-model="form.construction" placeholder="请输入建设单位" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="总造价" prop="totalCost"> <el-input v-model="form.totalCost" placeholder="请输入总造价" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="立项申请人" prop="projectApplicant">
|
|
<el-input v-model="form.projectApplicant" placeholder="请输入立项申请人" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12"
|
|
><el-form-item label="立项部门" prop="projectApplicantDept">
|
|
<el-input v-model="form.projectApplicantDept" placeholder="请输入立项部门" /> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12"
|
|
><el-form-item label="立项申请日期" prop="projectApplicantTime">
|
|
<el-date-picker
|
|
clearable
|
|
v-model="form.projectApplicantTime"
|
|
type="date"
|
|
format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
placeholder="请选择立项申请日期"
|
|
>
|
|
</el-date-picker> </el-form-item
|
|
></el-col>
|
|
<el-col :span="12"
|
|
><el-form-item label="项目编号" prop="projectNumbering">
|
|
<el-input v-model="form.projectNumbering" placeholder="请输入项目编号" /> </el-form-item
|
|
></el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</template>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup name="ListOfWinningBids" lang="ts">
|
|
import {
|
|
listListOfWinningBids,
|
|
getListOfWinningBids,
|
|
delListOfWinningBids,
|
|
addListOfWinningBids,
|
|
updateListOfWinningBids
|
|
} from '@/api/bidding/listOfWinningBids';
|
|
import { ListOfWinningBidsVO, ListOfWinningBidsQuery, ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types';
|
|
import { useUserStoreHook } from '@/store/modules/user';
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
// 获取用户 store
|
|
const userStore = useUserStoreHook();
|
|
// 从 store 中获取当前选中的项目
|
|
const currentProject = computed(() => userStore.selectedProject);
|
|
const listOfWinningBidsList = ref<ListOfWinningBidsVO[]>([]);
|
|
const buttonLoading = ref(false);
|
|
const loading = ref(true);
|
|
const showSearch = ref(true);
|
|
const ids = ref<Array<string | number>>([]);
|
|
const single = ref(true);
|
|
const multiple = ref(true);
|
|
const total = ref(0);
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
const listOfWinningBidsFormRef = ref<ElFormInstance>();
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
visible: false,
|
|
title: ''
|
|
});
|
|
|
|
const initFormData: ListOfWinningBidsForm = {
|
|
id: undefined,
|
|
projectId: currentProject.value?.id,
|
|
projectStatus: undefined,
|
|
projectName: undefined,
|
|
winningBidOriginal: undefined,
|
|
exchangeRate: undefined,
|
|
currency: undefined,
|
|
subject: undefined,
|
|
winningBid: undefined,
|
|
bidWinningDate: undefined,
|
|
bidDeposit: undefined,
|
|
whetherSendBack: undefined,
|
|
construction: undefined,
|
|
totalCost: undefined,
|
|
projectApplicant: undefined,
|
|
projectApplicantDept: undefined,
|
|
projectApplicantTime: undefined,
|
|
processStatus: undefined,
|
|
projectNumbering: undefined
|
|
};
|
|
const data = reactive<PageData<ListOfWinningBidsForm, ListOfWinningBidsQuery>>({
|
|
form: { ...initFormData },
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
projectId: currentProject.value?.id,
|
|
projectStatus: undefined,
|
|
projectName: undefined,
|
|
winningBidOriginal: undefined,
|
|
exchangeRate: undefined,
|
|
currency: undefined,
|
|
subject: undefined,
|
|
winningBid: undefined,
|
|
bidWinningDate: undefined,
|
|
bidDeposit: undefined,
|
|
whetherSendBack: undefined,
|
|
construction: undefined,
|
|
totalCost: undefined,
|
|
projectApplicant: undefined,
|
|
projectApplicantDept: undefined,
|
|
projectApplicantTime: undefined,
|
|
processStatus: undefined,
|
|
projectNumbering: undefined,
|
|
params: {}
|
|
},
|
|
rules: {
|
|
id: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }]
|
|
}
|
|
});
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
/** 查询中标项目一览列表 */
|
|
const getList = async () => {
|
|
loading.value = true;
|
|
const res = await listListOfWinningBids(queryParams.value);
|
|
listOfWinningBidsList.value = res.rows;
|
|
total.value = res.total;
|
|
loading.value = false;
|
|
};
|
|
|
|
/** 取消按钮 */
|
|
const cancel = () => {
|
|
reset();
|
|
dialog.visible = false;
|
|
};
|
|
|
|
/** 表单重置 */
|
|
const reset = () => {
|
|
form.value = { ...initFormData };
|
|
listOfWinningBidsFormRef.value?.resetFields();
|
|
};
|
|
|
|
/** 搜索按钮操作 */
|
|
const handleQuery = () => {
|
|
queryParams.value.pageNum = 1;
|
|
getList();
|
|
};
|
|
|
|
/** 重置按钮操作 */
|
|
const resetQuery = () => {
|
|
queryFormRef.value?.resetFields();
|
|
handleQuery();
|
|
};
|
|
|
|
/** 多选框选中数据 */
|
|
const handleSelectionChange = (selection: ListOfWinningBidsVO[]) => {
|
|
ids.value = selection.map((item) => item.id);
|
|
single.value = selection.length != 1;
|
|
multiple.value = !selection.length;
|
|
};
|
|
|
|
/** 新增按钮操作 */
|
|
const handleAdd = () => {
|
|
reset();
|
|
dialog.visible = true;
|
|
dialog.title = '添加中标项目一览';
|
|
};
|
|
|
|
/** 修改按钮操作 */
|
|
const handleUpdate = async (row?: ListOfWinningBidsVO) => {
|
|
reset();
|
|
const _id = row?.id || ids.value[0];
|
|
const res = await getListOfWinningBids(_id);
|
|
Object.assign(form.value, res.data);
|
|
dialog.visible = true;
|
|
dialog.title = '修改中标项目一览';
|
|
};
|
|
|
|
/** 提交按钮 */
|
|
const submitForm = () => {
|
|
listOfWinningBidsFormRef.value?.validate(async (valid: boolean) => {
|
|
if (valid) {
|
|
buttonLoading.value = true;
|
|
if (form.value.id) {
|
|
await updateListOfWinningBids(form.value).finally(() => (buttonLoading.value = false));
|
|
} else {
|
|
await addListOfWinningBids(form.value).finally(() => (buttonLoading.value = false));
|
|
}
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
dialog.visible = false;
|
|
await getList();
|
|
}
|
|
});
|
|
};
|
|
|
|
/** 删除按钮操作 */
|
|
const handleDelete = async (row?: ListOfWinningBidsVO) => {
|
|
const _ids = row?.id || ids.value;
|
|
await proxy?.$modal.confirm('是否确认删除中标项目一览编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
await delListOfWinningBids(_ids);
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
await getList();
|
|
};
|
|
|
|
/** 导出按钮操作 */
|
|
const handleExport = () => {
|
|
proxy?.download(
|
|
'bidding/listOfWinningBids/export',
|
|
{
|
|
...queryParams.value
|
|
},
|
|
`listOfWinningBids_${new Date().getTime()}.xlsx`
|
|
);
|
|
};
|
|
//监听项目id刷新数据
|
|
const listeningProject = watch(
|
|
() => currentProject.value?.id,
|
|
(nid, oid) => {
|
|
getList();
|
|
}
|
|
);
|
|
|
|
onUnmounted(() => {
|
|
listeningProject();
|
|
});
|
|
onMounted(() => {
|
|
getList();
|
|
});
|
|
</script>
|