成本核算清单
This commit is contained in:
47
src/api/bidding/biddingLimit/index.ts
Normal file
47
src/api/bidding/biddingLimit/index.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 导入成本-投标excel
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const BiddingImportExcelFile = (data?, params?) => {
|
||||
return request({
|
||||
url: '/bidding/biddingLimitList/importExcelFile',
|
||||
method: 'post',
|
||||
params,
|
||||
data
|
||||
});
|
||||
};
|
||||
// 导出成本-投标excel
|
||||
export const biddingLimitListExport = (data?) => {
|
||||
return request({
|
||||
url: '/bidding/biddingLimitList/export',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
// 获取成本-投标详细信息
|
||||
export const biddingLimitList = (id?) => {
|
||||
return request({
|
||||
url: '/bidding/biddingLimitList/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
// 查询成本-投标列表
|
||||
export const getTreeLimit = (params?) => {
|
||||
return request({
|
||||
url: '/bidding/biddingLimitList/getTree',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
};
|
||||
// 修改成本-投标
|
||||
export const biddingLimitListUpdate = (data?) => {
|
||||
return request({
|
||||
url: '/bidding/biddingLimitList',
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
};
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="p-6 bg-gray-50 main">
|
||||
<div class="appWidth1 mx-auto mt-38 bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||
<div class="appWidth2 mx-auto mt-38 bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||
<!-- 表单标题区域 -->
|
||||
<div class="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-6">
|
||||
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>人员配置</h2>
|
||||
@ -184,7 +184,7 @@ onUnmounted(() => {
|
||||
.main {
|
||||
height: calc(100vh - 90px);
|
||||
}
|
||||
.appWidth1 {
|
||||
.appWidth2 {
|
||||
width: 50vw;
|
||||
max-width: 1200px;
|
||||
.el-select__wrapper {
|
||||
@ -303,7 +303,7 @@ onUnmounted(() => {
|
||||
|
||||
// 适配小屏幕
|
||||
@media (max-width: 768px) {
|
||||
.appWidth1 {
|
||||
.appWidth2 {
|
||||
width: 95vw;
|
||||
}
|
||||
|
||||
|
269
src/views/biddingManagemen/biddingLimit/index.vue
Normal file
269
src/views/biddingManagemen/biddingLimit/index.vue
Normal file
@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<el-card shadow="always">
|
||||
<el-form :model="queryForm" :inline="true">
|
||||
<!-- <el-form-item label="表名" prop="sheet">
|
||||
<el-select v-model="queryForm.sheet" placeholder="选择表名" @change="changeSheet">
|
||||
<el-option v-for="item in sheets" :key="item" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
:http-request="importExcel"
|
||||
:show-file-list="false"
|
||||
v-hasPermi="['bidding:biddingLimitList:importExcelFile']"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">导入excel</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['bidding:biddingLimitList:export']">导出excel</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</transition>
|
||||
<el-card shadow="never" class="mb8">
|
||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" row-key="id" border lazy default-expand-all>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="工程或费用名称" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<el-table-column prop="remark" label="单价" align="center">
|
||||
<template #default="scope">
|
||||
<el-input-number
|
||||
:model-value="scope.row.unitPrice"
|
||||
@change="(val) => (scope.row.unitPrice = val)"
|
||||
:precision="2"
|
||||
:step="0.1"
|
||||
:controls="false"
|
||||
v-if="scope.row.quantity && scope.row.quantity != 0"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="总价" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.price }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleSave(scope.row)"
|
||||
v-if="scope.row.quantity && scope.row.quantity != 0"
|
||||
v-hasPermi="['bidding:biddingLimitList:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { obtainAllVersionNumbers, sheetList } from '@/api/contract/index';
|
||||
import { BiddingImportExcelFile, getTreeLimit, biddingLimitListUpdate } from '@/api/bidding/biddingLimit';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const queryForm = ref({
|
||||
versions: '',
|
||||
sheet: ''
|
||||
});
|
||||
const loading = ref(false);
|
||||
const options = ref<any[]>([]);
|
||||
const sheets = ref<any[]>([]);
|
||||
const tableData = ref<any[]>([]);
|
||||
const isExpandAll = ref(true);
|
||||
|
||||
//获取版本号
|
||||
const getVersionNums = async () => {
|
||||
try {
|
||||
const params = {
|
||||
projectId: currentProject.value?.id,
|
||||
pageSize: 1000,
|
||||
pageNum: 1
|
||||
};
|
||||
|
||||
const res = await obtainAllVersionNumbers(params);
|
||||
if (res.code == 200) {
|
||||
options.value = res.data;
|
||||
if (res.data.length > 0) {
|
||||
queryForm.value.versions = res.data[0];
|
||||
getSheetName();
|
||||
} else {
|
||||
queryForm.value.versions = '';
|
||||
ElMessage({
|
||||
message: '获取版本号失败',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
ElMessage({
|
||||
message: '获取版本号失败',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
};
|
||||
//选择版本号
|
||||
const changeVersions = () => {
|
||||
getSheetName();
|
||||
};
|
||||
|
||||
//选择表名
|
||||
const changeSheet = () => {
|
||||
getTableData();
|
||||
};
|
||||
|
||||
//获取表名
|
||||
const getSheetName = async () => {
|
||||
try {
|
||||
const params = {
|
||||
projectId: currentProject.value?.id
|
||||
// versions: queryForm.value.versions
|
||||
};
|
||||
const res = await sheetList(params);
|
||||
if (res.code == 200) {
|
||||
sheets.value = res.data;
|
||||
if (res.data.length > 0) {
|
||||
queryForm.value.sheet = res.data[0];
|
||||
} else {
|
||||
queryForm.value.sheet = '';
|
||||
ElMessage({
|
||||
message: '获取表名失败',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
ElMessage({
|
||||
message: '获取表名失败',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
};
|
||||
//获取表格
|
||||
const getTableData = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const params = {
|
||||
projectId: currentProject.value?.id,
|
||||
sheet: queryForm.value.sheet
|
||||
};
|
||||
const res = await getTreeLimit(params);
|
||||
if (res.code == 200) {
|
||||
tableData.value = [res.data[0]];
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: '获取表格失败',
|
||||
type: 'error'
|
||||
});
|
||||
tableData.value = [];
|
||||
loading.value = false;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
//修改单价
|
||||
const handleSave = (row: any) => {
|
||||
try {
|
||||
if (!row.unitPrice) {
|
||||
ElMessage({
|
||||
message: '请输入单价',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
biddingLimitListUpdate(row).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: '修改失败',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
};
|
||||
const tableRef = ref<any>();
|
||||
|
||||
const toggleExpandAll = () => {
|
||||
isExpandAll.value = !isExpandAll.value;
|
||||
console.log(isExpandAll.value);
|
||||
|
||||
tableData.value.forEach((row) => {
|
||||
tableRef.value.toggleRowExpansion(row, isExpandAll.value);
|
||||
});
|
||||
};
|
||||
//导入
|
||||
const importExcel = (options: any): any => {
|
||||
let formData = new FormData();
|
||||
formData.append('file', options.file);
|
||||
loading.value = true;
|
||||
BiddingImportExcelFile({ projectId: currentProject.value?.id }, formData)
|
||||
.then((res) => {
|
||||
const { code } = res;
|
||||
if (code == 200) {
|
||||
proxy.$modal.msgSuccess(res.msg || '导入成功');
|
||||
getTableData();
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '导入失败');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
proxy.$modal.msgError(err.msg || '导入失败');
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
getVersionNums();
|
||||
}
|
||||
);
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'/bidding/biddingLimitList/export',
|
||||
{
|
||||
projectId: currentProject.value?.id,
|
||||
sheet: queryForm.value.sheet
|
||||
},
|
||||
`限价一览表${queryForm.value.sheet}.xlsx`
|
||||
);
|
||||
};
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
onMounted(() => {
|
||||
getTableData();
|
||||
|
||||
// getSheetName();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
@ -41,22 +41,14 @@
|
||||
<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="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.bidWinningDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.projectApplicantTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
|
Reference in New Issue
Block a user