合并
This commit is contained in:
99
src/api/largeScreen/index.ts
Normal file
99
src/api/largeScreen/index.ts
Normal file
@ -0,0 +1,99 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MasterVO, MasterForm, MasterQuery } from '@/api/patch/types';
|
||||
/**
|
||||
* 合同金额
|
||||
*
|
||||
*/
|
||||
export const totalAmount = () => {
|
||||
return request({
|
||||
url: '/money/big/screen/totalAmount',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询项目位置列表
|
||||
*
|
||||
*/ export const projectGis = (clientid) => {
|
||||
return request({
|
||||
url: '/money/big/screen/project/gis',
|
||||
method: 'get',
|
||||
params: clientid
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 应收实收
|
||||
*
|
||||
*/ export const incomePay = (clientid) => {
|
||||
return request({
|
||||
url: '/money/big/screen/income/pay',
|
||||
method: 'get',
|
||||
params: clientid
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 收入合同分析
|
||||
*
|
||||
*/ export const incomeAnalyze = (clientid) => {
|
||||
return request({
|
||||
url: '/money/big/screen/income/analyze',
|
||||
method: 'get',
|
||||
params: clientid
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 应付实付
|
||||
*
|
||||
*/ export const expensesPay = (clientid) => {
|
||||
return request({
|
||||
url: '/money/big/screen/expenses/pay',
|
||||
method: 'get',
|
||||
params: clientid
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 支出合同分析
|
||||
*
|
||||
*/ export const expensesAnalyze = (clientid) => {
|
||||
return request({
|
||||
url: '/money/big/screen/expenses/analyze',
|
||||
method: 'get',
|
||||
params: clientid
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 成本
|
||||
*
|
||||
*/ export const cost = (clientid) => {
|
||||
return request({
|
||||
url: '/money/big/screen/cost',
|
||||
method: 'get',
|
||||
params: clientid
|
||||
});
|
||||
};
|
||||
|
||||
// 资金KPI
|
||||
export const monthMoney = () => {
|
||||
return request({
|
||||
url: '/money/big/screen/monthMoney',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
// 现金流
|
||||
export const monthCash = () => {
|
||||
return request({
|
||||
url: '/money/big/screen/monthCash',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
// 现金流总和
|
||||
|
||||
export const cashTotal = () => {
|
||||
return request({
|
||||
url: '/money/big/screen/cashTotal',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
70
src/api/materials/materialsUseRecord/index.ts
Normal file
70
src/api/materials/materialsUseRecord/index.ts
Normal file
@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MaterialsUseRecordVO, MaterialsUseRecordForm, MaterialsUseRecordQuery } from '@/api/materials/materialsUseRecord/types';
|
||||
|
||||
/**
|
||||
* 查询材料使用登记列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMaterialsUseInventory = (query?: MaterialsUseRecordQuery): AxiosPromise<MaterialsUseRecordVO[]> => {
|
||||
return request({
|
||||
url: '/materials/materialsInventory/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
export const listMaterialsUseRecord = (query?: MaterialsUseRecordQuery): AxiosPromise<MaterialsUseRecordVO[]> => {
|
||||
return request({
|
||||
url: '/materials/materialsUseRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询材料使用登记详细
|
||||
* @param id
|
||||
*/
|
||||
export const getMaterialsUseRecord = (id: string | number): AxiosPromise<MaterialsUseRecordVO> => {
|
||||
return request({
|
||||
url: '/materials/materialsUseRecord/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增材料使用登记
|
||||
* @param data
|
||||
*/
|
||||
export const addMaterialsUseRecord = (data: MaterialsUseRecordForm) => {
|
||||
return request({
|
||||
url: '/materials/materialsUseRecord',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改材料使用登记
|
||||
* @param data
|
||||
*/
|
||||
export const updateMaterialsUseRecord = (data: MaterialsUseRecordForm) => {
|
||||
return request({
|
||||
url: '/materials/materialsUseRecord',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除材料使用登记
|
||||
* @param id
|
||||
*/
|
||||
export const delMaterialsUseRecord = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/materials/materialsUseRecord/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
111
src/api/materials/materialsUseRecord/types.ts
Normal file
111
src/api/materials/materialsUseRecord/types.ts
Normal file
@ -0,0 +1,111 @@
|
||||
export interface MaterialsUseRecordVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 库存ID
|
||||
*/
|
||||
inventoryId: string | number;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
usePart: string;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
useNumber: number;
|
||||
|
||||
/**
|
||||
* 剩余量
|
||||
*/
|
||||
residueNumber: string | number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MaterialsUseRecordForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 库存ID
|
||||
*/
|
||||
inventoryId?: string | number;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
usePart?: string;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
useNumber?: number;
|
||||
|
||||
/**
|
||||
* 剩余量
|
||||
*/
|
||||
residueNumber?: string | number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MaterialsUseRecordQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 库存ID
|
||||
*/
|
||||
inventoryId?: string | number;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
usePart?: string;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
useNumber?: number;
|
||||
|
||||
/**
|
||||
* 剩余量
|
||||
*/
|
||||
residueNumber?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,6 +44,7 @@ export const importExcelFile = (query: any, data: any): AxiosPromise<any> => {
|
||||
};
|
||||
|
||||
//招标计划列表
|
||||
|
||||
export const tenderPlanList = (query: any): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/tender/biddingPlan/list',
|
||||
@ -113,7 +114,14 @@ export const getUnitList = (query: any): AxiosPromise<any> => {
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
//修改状态
|
||||
export const editStatus = (query: any): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/tender/biddingPlan/editStatus',
|
||||
method: 'put',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
//获取审核状态
|
||||
export const getApproval = (id) => {
|
||||
return request({
|
||||
|
@ -288,3 +288,14 @@ h6 {
|
||||
.top-right-btn {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.text-two-lines {
|
||||
display: -webkit-box; /* 触发弹性盒模型 */
|
||||
-webkit-box-orient: vertical; /* 垂直排列文本行 */
|
||||
-webkit-line-clamp: 2; /* 限制显示2行 */
|
||||
/* 3. 超出部分处理 */
|
||||
overflow: hidden; /* 隐藏超出容器的内容 */
|
||||
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
||||
/* 可选:优化文本间距 */
|
||||
line-height: 1.5; /* 行高,控制两行的垂直间距 */
|
||||
}
|
||||
|
@ -1,11 +1,28 @@
|
||||
<template>
|
||||
<div class="upload-file">
|
||||
<el-upload ref="fileUploadRef" multiple :action="realUploadUrl" :before-upload="handleBeforeUpload"
|
||||
:file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess" :show-file-list="showFileList" :headers="headers" class="upload-file-uploader"
|
||||
:list-type="isConstruction ? 'picture-card' : 'text'" :accept="accept" :drag="isDarg" :data="data"
|
||||
:auto-upload="autoUpload" :on-change="handleChange" :on-remove="handleRemove" :method="method"
|
||||
:http-request="customUpload">
|
||||
<el-upload
|
||||
ref="fileUploadRef"
|
||||
multiple
|
||||
:action="realUploadUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:file-list="fileList"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="showFileList"
|
||||
:headers="headers"
|
||||
class="upload-file-uploader"
|
||||
:list-type="isConstruction ? 'picture-card' : 'text'"
|
||||
:accept="accept"
|
||||
:drag="isDarg"
|
||||
:data="data"
|
||||
:auto-upload="autoUpload"
|
||||
:on-change="handleChange"
|
||||
:on-remove="handleRemove"
|
||||
:method="method"
|
||||
:http-request="customUpload"
|
||||
>
|
||||
<slot>
|
||||
<div>
|
||||
<!-- 上传按钮 -->
|
||||
@ -24,10 +41,14 @@
|
||||
的文件
|
||||
</div>
|
||||
<!-- 文件列表 -->
|
||||
<transition-group v-if="!isConstruction && !isImportInfo"
|
||||
class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul" @click.stop>
|
||||
<li style="margin-top: 10px" v-for="(file, index) in fileList" :key="file.uid"
|
||||
class="el-upload-list__item ele-upload-list__item-content">
|
||||
<transition-group
|
||||
v-if="!isConstruction && !isImportInfo"
|
||||
class="upload-file-list el-upload-list el-upload-list--text"
|
||||
name="el-fade-in-linear"
|
||||
tag="ul"
|
||||
@click.stop
|
||||
>
|
||||
<li style="margin-top: 10px" v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
@ -180,13 +201,16 @@ watch(
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
watch(() => props.defaultFileList, () => {
|
||||
if (props.defaultFileList.length === 0) return;
|
||||
props.defaultFileList.forEach((item: any) => {
|
||||
fileList.value.push(item);
|
||||
});
|
||||
|
||||
}, { deep: true, immediate: true });
|
||||
watch(
|
||||
() => props.defaultFileList,
|
||||
() => {
|
||||
if (props.defaultFileList.length === 0) return;
|
||||
props.defaultFileList.forEach((item: any) => {
|
||||
fileList.value.push(item);
|
||||
});
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
// 上传前校检格式和大小
|
||||
const handleBeforeUpload = (file: any) => {
|
||||
// 校检文件类型
|
||||
@ -424,7 +448,7 @@ defineExpose({ submitUpload });
|
||||
}
|
||||
}
|
||||
|
||||
>span {
|
||||
> span {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ import type { ComponentInternalInstance } from 'vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { ElMessage, ElLoading } from 'element-plus';
|
||||
import { biddingGetUser, AddbiddingUser, biddingUserList } from '@/api/bidding/appointment';
|
||||
|
||||
import { getProject } from '@/api/project/project';
|
||||
// 获取当前实例
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 获取用户 store
|
||||
@ -68,7 +68,7 @@ const currentProject = computed(() => userStore.selectedProject);
|
||||
// 专业字典数据
|
||||
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
||||
const isDisabled = ref(false);
|
||||
|
||||
const projectInfo = ref({}); //项目信息
|
||||
// 表单数据
|
||||
const form = reactive({
|
||||
id: null,
|
||||
|
@ -16,7 +16,7 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
@ -28,7 +28,7 @@
|
||||
<el-button type="primary">导入excel</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['bidding:biddingLimitList:export']">导出excel</el-button>
|
||||
</el-form-item>
|
||||
@ -78,7 +78,7 @@
|
||||
{{ scope.row.price }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="操作" align="center">
|
||||
<!-- <el-table-column prop="price" label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
@ -89,7 +89,7 @@
|
||||
>修改</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
|
524
src/views/biddingManagemen/listOfWinningBids/index copy 2.vue
Normal file
524
src/views/biddingManagemen/listOfWinningBids/index copy 2.vue
Normal file
@ -0,0 +1,524 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50 min-h-screen">
|
||||
<!-- 卡片容器:控制最大宽度+居中+圆角阴影 -->
|
||||
<el-card shadow="hover" class="max-w-6xl mx-auto rounded-xl overflow-hidden border-0" style="background-color: #ffffff">
|
||||
<!-- 卡片头部:项目信息展示区(非表单布局) -->
|
||||
<template #header>
|
||||
<div class="bg-blue-50 px-6 rounded-t-xl" style="padding: 10px 20px">
|
||||
<h3 class="el-card__header-title text-lg font-semibold text-blue-800">投标项目信息</h3>
|
||||
<h4>{{ currentProject.name }}</h4>
|
||||
<!-- 项目信息部分 -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
<div class="project-info-item">
|
||||
<span>负责人:</span>
|
||||
<span> {{ projectInfo.principal || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>负责人电话:</span>
|
||||
<span> {{ projectInfo.principalPhone || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>项目类型:</span>
|
||||
<span> {{ getDictLabel(project_type, projectInfo.projectType) || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>项目阶段:</span>
|
||||
<span> {{ getDictLabel(project_stage, projectInfo.projectStage) || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>开工时间:</span>
|
||||
<span> {{ projectInfo.onStreamTime || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>经纬度:</span>
|
||||
<span> {{ projectInfo.lng || '-' }},{{ projectInfo.lat || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item md:col-span-2 lg:col-span-3">
|
||||
<span>项目地址:</span>
|
||||
<span> {{ projectInfo.projectSite || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>计划容量(M):</span>
|
||||
<span> {{ projectInfo.plan || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>实际容量(M):</span>
|
||||
<span> {{ projectInfo.actual || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>设计总量(M):</span>
|
||||
<span> {{ projectInfo.designTotal || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item md:col-span-2 lg:col-span-3">
|
||||
<span>备注:</span>
|
||||
<span> {{ projectInfo.remark || '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 mb-6">
|
||||
<el-button @click="isDisabled = false" type="primary" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled">
|
||||
点击编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 中标信息表单区域(保持原有逻辑) -->
|
||||
<el-form
|
||||
:disabled="isDisabled"
|
||||
ref="listOfWinningBidsFormRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="150px"
|
||||
class="p-6 pt-4"
|
||||
style="background-color: #ffffff"
|
||||
>
|
||||
<el-row :gutter="32">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标价(美元)" prop="winningBidOriginal" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model.number="form.winningBidOriginal" type="number" placeholder="请输入中标价" @input="calculateWinningBid" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="汇率" prop="exchangeRate" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model.number="form.exchangeRate" type="number" placeholder="请输入汇率" step="0.0001" @input="calculateWinningBid" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="币种" prop="currency" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.currency" placeholder="请输入币种" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标价(人民币)" prop="winningBid" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.winningBid" type="number" placeholder="根据美元中标价和汇率自动计算" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标日期" prop="bidWinningDate" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.bidWinningDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择中标日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="投标保证金(人民币)" prop="bidDeposit" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.bidDeposit" type="number" placeholder="请输入投标保证金" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否退还" prop="whetherSendBack" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-radio-group v-model="form.whetherSendBack">
|
||||
<el-radio label="是" border>是</el-radio>
|
||||
<el-radio label="否" border>否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属主体" prop="subject" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.subject" placeholder="请输入所属主体" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="建设单位" prop="construction" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.construction" placeholder="请输入建设单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总造价" prop="totalCost" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.totalCost" placeholder="请输入总造价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项申请人" prop="projectApplicant" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectApplicant" placeholder="请输入立项申请人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项部门" prop="projectApplicantDept" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectApplicantDept" placeholder="请输入立项部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项申请日期" prop="projectApplicantTime" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.projectApplicantTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择立项申请日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="项目编号" prop="projectNumbering" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectNumbering" placeholder="请输入项目编号" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标通知书" prop="projectNumbering" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<file-upload v-model="form.bidFile" :limit="10" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 操作按钮区域 -->
|
||||
<el-row v-if="!isDisabled" class="mt-8">
|
||||
<el-col :span="24" class="text-center">
|
||||
<el-button
|
||||
:loading="buttonLoading"
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
v-hasPermi="['bidding:listOfWinningBids:add', 'bidding:listOfWinningBids:edit']"
|
||||
class="rounded-full px-8"
|
||||
size="large"
|
||||
>
|
||||
确认提交
|
||||
</el-button>
|
||||
<el-button type="default" @click="resetForm" class="ml-6 rounded-full px-8" size="large"> 重置 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ListOfWinningBidsForm" lang="ts">
|
||||
import { ref, reactive, toRefs, watch, onMounted, onUnmounted, getCurrentInstance, ComponentInternalInstance, computed } from 'vue';
|
||||
import { addListOfWinningBids, updateListOfWinningBids, listListOfWinningBids, getListOfWinningBids } from '@/api/bidding/listOfWinningBids';
|
||||
import { ListOfWinningBidsVO, ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { ElFormInstance, ElMessage } from 'element-plus';
|
||||
import { getProject, updateProject } from '@/api/project/project'; // 补充项目信息更新接口
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { project_type, project_stage } = toRefs<any>(proxy?.useDict('project_type', 'project_stage'));
|
||||
|
||||
// 用户状态管理
|
||||
const userStore = useUserStoreHook();
|
||||
// 当前选中项目(从store获取)
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
// 项目信息(非表单绑定,直接响应式数据)
|
||||
const projectInfo = reactive({
|
||||
projectName: undefined,
|
||||
shortName: undefined,
|
||||
pId: undefined,
|
||||
status: undefined,
|
||||
picUrl: undefined,
|
||||
remark: undefined,
|
||||
projectType: undefined,
|
||||
projectCategory: undefined,
|
||||
deletedAt: undefined,
|
||||
projectSite: undefined,
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
actual: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
plan: undefined,
|
||||
onStreamTime: undefined,
|
||||
playCardStart: undefined,
|
||||
playCardEnd: undefined,
|
||||
designTotal: undefined,
|
||||
securityAgreement: undefined,
|
||||
sort: 0,
|
||||
showHidden: undefined,
|
||||
isDelete: undefined
|
||||
});
|
||||
|
||||
// 表单相关引用
|
||||
const listOfWinningBidsFormRef = ref<ElFormInstance>();
|
||||
// 加载状态
|
||||
const buttonLoading = ref(false);
|
||||
// 编辑/查看状态控制
|
||||
const isDisabled = ref(false);
|
||||
|
||||
// 表单初始数据
|
||||
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({
|
||||
form: { ...initFormData } as ListOfWinningBidsForm,
|
||||
rules: {
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
||||
winningBidOriginal: [{ required: true, message: '请输入原始中标价', trigger: 'blur' }],
|
||||
exchangeRate: [
|
||||
{ required: true, message: '请输入汇率', trigger: 'blur' },
|
||||
{ type: 'number', min: 0.001, message: '汇率需大于0', trigger: 'blur' }
|
||||
],
|
||||
currency: [{ required: true, message: '请输入币种', trigger: 'blur' }],
|
||||
subject: [{ required: true, message: '请输入所属主体', trigger: 'blur' }],
|
||||
winningBid: [{ required: true, message: '请输入中标价', trigger: 'blur' }],
|
||||
bidWinningDate: [{ required: true, message: '请选择中标日期', trigger: 'blur' }],
|
||||
projectNumbering: [{ required: true, message: '请输入项目编号', trigger: 'blur' }]
|
||||
} as Record<string, any>
|
||||
});
|
||||
|
||||
// 解构响应式数据
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/**
|
||||
* 根据字典值获取字典标签(用于项目类型/阶段的文本展示)
|
||||
*/
|
||||
const getDictLabel = (dictList: any[], value: any) => {
|
||||
if (!dictList || !value) return '';
|
||||
const dictItem = dictList.find((item) => item.value === value);
|
||||
return dictItem ? dictItem.label : '';
|
||||
};
|
||||
|
||||
/**
|
||||
* 计算人民币中标价
|
||||
*/
|
||||
const calculateWinningBid = () => {
|
||||
const dollarAmount = Number(form.value.winningBidOriginal);
|
||||
const rate = Number(form.value.exchangeRate);
|
||||
|
||||
if (isNaN(dollarAmount) || isNaN(rate) || dollarAmount <= 0 || rate <= 0) {
|
||||
form.value.winningBid = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
const result = dollarAmount * rate;
|
||||
form.value.winningBid = Number(result.toFixed(2));
|
||||
};
|
||||
|
||||
/**
|
||||
* 页面初始化 - 获取已有数据(如存在)
|
||||
*/
|
||||
const initData = async () => {
|
||||
try {
|
||||
if (currentProject.value?.id) {
|
||||
const res = await listListOfWinningBids({ projectId: currentProject.value.id });
|
||||
if (res.code === 200) {
|
||||
resetForm();
|
||||
if (!res.data) {
|
||||
isDisabled.value = false;
|
||||
return;
|
||||
}
|
||||
Object.assign(form.value, res.data);
|
||||
isDisabled.value = true;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('初始化中标数据失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交表单(含项目信息+中标信息同步提交)
|
||||
*/
|
||||
const submitForm = () => {
|
||||
listOfWinningBidsFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
try {
|
||||
// 1. 计算人民币中标价
|
||||
calculateWinningBid();
|
||||
// 2. 绑定项目ID和项目名称(从项目信息同步)
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
form.value.projectName = projectInfo.projectName;
|
||||
|
||||
// 3. 先更新项目信息(若项目信息有修改)
|
||||
if (currentProject.value?.id) {
|
||||
await updateProject({ id: currentProject.value.id, ...projectInfo });
|
||||
}
|
||||
|
||||
// 4. 再提交中标信息(新增/编辑逻辑)
|
||||
const isEdit = !!form.value.id;
|
||||
if (isEdit) {
|
||||
await updateListOfWinningBids(form.value);
|
||||
} else {
|
||||
await addListOfWinningBids(form.value);
|
||||
}
|
||||
|
||||
// 5. 提交成功后切换为查看状态
|
||||
isDisabled.value = true;
|
||||
ElMessage.success(isEdit ? '编辑成功' : '提交成功');
|
||||
} catch (error) {
|
||||
ElMessage.error('提交失败,请重试');
|
||||
console.error('提交表单失败:', error);
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取项目详细信息
|
||||
*/
|
||||
const getProjectDetail = async () => {
|
||||
try {
|
||||
if (currentProject.value?.id) {
|
||||
const res = await getProject(currentProject.value.id);
|
||||
Object.assign(projectInfo, res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取项目详情失败:', error);
|
||||
ElMessage.error('获取项目信息失败');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置表单(含项目信息重置)
|
||||
*/
|
||||
const resetForm = () => {
|
||||
// 重置中标表单
|
||||
form.value = { ...initFormData, projectId: currentProject.value?.id };
|
||||
listOfWinningBidsFormRef.value?.resetFields();
|
||||
|
||||
// 重置项目信息(恢复为当前项目的原始数据)
|
||||
getProjectDetail();
|
||||
};
|
||||
|
||||
/**
|
||||
* 监听项目ID变化 - 重新初始化数据
|
||||
*/
|
||||
const projectIdWatcher = watch(
|
||||
() => currentProject.value?.id,
|
||||
(newId) => {
|
||||
if (newId) {
|
||||
form.value.projectId = newId;
|
||||
getProjectDetail();
|
||||
initData();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 页面挂载时初始化
|
||||
onMounted(() => {
|
||||
getProjectDetail();
|
||||
initData();
|
||||
});
|
||||
|
||||
// 页面卸载时清除监听
|
||||
onUnmounted(() => {
|
||||
projectIdWatcher();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 全局背景色 */
|
||||
.bg-gray-50 {
|
||||
background-color: #f9fafb;
|
||||
}
|
||||
|
||||
/* 项目信息项布局样式 */
|
||||
.project-info-item {
|
||||
transition: all 0.2s ease;
|
||||
padding: 4px 0;
|
||||
color: #696969;
|
||||
}
|
||||
|
||||
/* 输入框/选择器统一样式 */
|
||||
.el-input__wrapper,
|
||||
.el-date-editor .el-input__wrapper,
|
||||
.el-select__wrapper {
|
||||
border-radius: 6px !important;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
/* 输入框hover效果 */
|
||||
.el-input__wrapper:hover,
|
||||
.el-date-editor .el-input__wrapper:hover,
|
||||
.el-select__wrapper:hover {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
/* 卡片头部文字样式 */
|
||||
.el-card__header-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.el-button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* 表单项样式优化 */
|
||||
.el-form-item {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.el-form-item:hover {
|
||||
border-color: #e6f7ff;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* 响应式网格布局适配 */
|
||||
@media (max-width: 767px) {
|
||||
.grid {
|
||||
display: grid;
|
||||
}
|
||||
.grid-cols-1 {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1023px) {
|
||||
.md\:grid-cols-2 {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.md\:col-span-2 {
|
||||
grid-column: span 2 / span 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.lg\:grid-cols-3 {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
.lg\:col-span-3 {
|
||||
grid-column: span 3 / span 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* 间距样式 */
|
||||
.gap-6 {
|
||||
gap: 1.5rem;
|
||||
}
|
||||
.mb-1 {
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.mb-6 {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
.mt-4 {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.mt-6 {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.mt-8 {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
</style>
|
@ -1,344 +0,0 @@
|
||||
<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>
|
@ -2,18 +2,66 @@
|
||||
<div class="p-4 bg-gray-50 min-h-screen">
|
||||
<!-- 卡片容器:控制最大宽度+居中+圆角阴影 -->
|
||||
<el-card shadow="hover" class="max-w-6xl mx-auto rounded-xl overflow-hidden border-0" style="background-color: #ffffff">
|
||||
<!-- 卡片头部:独立背景色+内边距+圆角 -->
|
||||
<!-- 卡片头部:项目信息展示区 -->
|
||||
<template #header>
|
||||
<div class="bg-blue-50 px-6 py-4 rounded-t-xl mb-0">
|
||||
<h3 class="el-card__header-title text-lg font-semibold text-blue-800">投标项目信息填写</h3>
|
||||
<span>{{ currentProject.name }}</span>
|
||||
<div style="margin-top: 10px">
|
||||
<el-button @click="isDisabled = false" type="primary" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled">
|
||||
点击编辑
|
||||
</el-button>
|
||||
<div class="bg-blue-50 px-6 rounded-t-xl" style="padding: 10px 20px">
|
||||
<h3 class="el-card__header-title text-lg font-semibold text-blue-800">投标项目信息</h3>
|
||||
<h4>{{ currentProject.name }}</h4>
|
||||
<!-- 项目信息部分 -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
<div class="project-info-item">
|
||||
<span>负责人:</span>
|
||||
<span> {{ projectInfo.principal || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>负责人电话:</span>
|
||||
<span> {{ projectInfo.principalPhone || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>项目类型:</span>
|
||||
<span> {{ getDictLabel(project_type, projectInfo.projectType) || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>项目阶段:</span>
|
||||
<span> {{ getDictLabel(project_stage, projectInfo.projectStage) || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>开工时间:</span>
|
||||
<span> {{ projectInfo.onStreamTime || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>经纬度:</span>
|
||||
<span> {{ projectInfo.lng || '-' }},{{ projectInfo.lat || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item md:col-span-2 lg:col-span-3">
|
||||
<span>项目地址:</span>
|
||||
<span> {{ projectInfo.projectSite || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>计划容量(M):</span>
|
||||
<span> {{ projectInfo.plan || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>实际容量(M):</span>
|
||||
<span> {{ projectInfo.actual || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item">
|
||||
<span>设计总量(M):</span>
|
||||
<span> {{ projectInfo.designTotal || '-' }}</span>
|
||||
</div>
|
||||
<div class="project-info-item md:col-span-2 lg:col-span-3">
|
||||
<span>备注:</span>
|
||||
<span> {{ projectInfo.remark || '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 mb-6">
|
||||
<el-button @click="isDisabled = false" type="primary" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled">
|
||||
点击编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 中标信息表单区域 -->
|
||||
<el-form
|
||||
:disabled="isDisabled"
|
||||
ref="listOfWinningBidsFormRef"
|
||||
@ -24,100 +72,125 @@
|
||||
style="background-color: #ffffff"
|
||||
>
|
||||
<el-row :gutter="32">
|
||||
<!-- 是否中标(必填) -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标价(美元)" prop="winningBidOriginal" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model.number="form.winningBidOriginal" type="number" placeholder="请输入中标价" @input="calculateWinningBid" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="汇率" prop="exchangeRate" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model.number="form.exchangeRate" type="number" placeholder="请输入汇率" step="0.0001" @input="calculateWinningBid" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="币种" prop="currency" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.currency" placeholder="请输入币种" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标价(人民币)" prop="winningBid" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<!-- 人民币输入框:添加readonly禁止手动修改 -->
|
||||
<el-input v-model="form.winningBid" type="number" placeholder="根据美元中标价和汇率自动计算" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 其他表单项保持不变 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="中标日期" prop="bidWinningDate" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.bidWinningDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择中标日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="投标保证金(人民币)" prop="bidDeposit" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.bidDeposit" type="number" placeholder="请输入投标保证金" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否退还" prop="whetherSendBack" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-radio-group v-model="form.whetherSendBack">
|
||||
<el-radio label="是" border>是</el-radio>
|
||||
<el-radio label="否" border>否</el-radio>
|
||||
<el-form-item label="是否中标" prop="whetherBid" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-radio-group v-model="form.whetherBid">
|
||||
<el-radio label="0" border>中标</el-radio>
|
||||
<el-radio label="1" border>未中标</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属主体" prop="subject" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.subject" placeholder="请输入所属主体" />
|
||||
<!-- 中标价(必填,仅中标时显示) -->
|
||||
<el-col :span="12" v-if="form.whetherBid == '0'">
|
||||
<el-form-item label="中标价(人民币)" prop="bidPrice" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.bidPrice" type="number" placeholder="请输入中标价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="建设单位" prop="construction" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.construction" placeholder="请输入建设单位" />
|
||||
<!-- 中标通知书(必填,仅中标时显示) -->
|
||||
<el-col :span="12" v-if="form.whetherBid == '0'">
|
||||
<el-form-item label="中标通知书" prop="bidFileId" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<!-- <el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action="http://192.168.110.149:8899/resource/oss/upload"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess"
|
||||
:file-list="fileList"
|
||||
:auto-upload="true"
|
||||
:headers="headers"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-red">上传pdf文件,仅支持.pdf文件</div>
|
||||
</template>
|
||||
</el-upload> -->
|
||||
<file-upload @onUploadSuccess="handleUploadSuccess" v-model="form.bidFileId" :limit="1" :file-type="['pdf']" :file-size="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 招标代理机构 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总造价" prop="totalCost" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.totalCost" placeholder="请输入总造价" />
|
||||
<el-form-item label="招标代理机构" prop="biddingAgency" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.biddingAgency" placeholder="请输入招标代理机构" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 招标人 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项申请人" prop="projectApplicant" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectApplicant" placeholder="请输入立项申请人" />
|
||||
<el-form-item label="招标人" prop="tenderer" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.tenderer" placeholder="请输入招标人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12"></el-col>
|
||||
<!-- 投标截止时间 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项部门" prop="projectApplicantDept" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectApplicantDept" placeholder="请输入立项部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项申请日期" prop="projectApplicantTime" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-form-item label="投标截止时间" prop="biddingDeadline" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.projectApplicantTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择立项申请日期"
|
||||
v-model="form.biddingDeadline"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
placeholder="请选择投标截止时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 开标时间 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编号" prop="projectNumbering" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectNumbering" placeholder="请输入项目编号" />
|
||||
<el-form-item label="开标时间" prop="bidopeningTime" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
v-model="form.bidopeningTime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
placeholder="请选择开标时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="项目状态" prop="projectStatus" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectStatus" placeholder="请输入项目状态(如:进行中/已完成)" />
|
||||
|
||||
<!-- 建设地点 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="建设地点" prop="constructionsite" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.constructionsite" placeholder="请输入建设地点" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
<!-- 计划工期 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划工期" prop="planDuration" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.planDuration" placeholder="请输入计划工期(如:180天)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 答疑截止时间 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="答疑截止时间" prop="answeringDeadlineTime" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
v-model="form.answeringDeadlineTime"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择答疑截止时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 澄清截止时间 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="澄清截止时间" prop="clarifyDeadlineTime" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss "
|
||||
v-model="form.clarifyDeadlineTime"
|
||||
type="datetime"
|
||||
placeholder="请选择澄清截止时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 项目概况 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="项目概况" prop="projectOverview" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||
<el-input v-model="form.projectOverview" type="textarea" rows="3" placeholder="请输入项目概况" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 操作按钮区域 -->
|
||||
<el-row v-if="!isDisabled" class="mt-8">
|
||||
@ -142,172 +215,291 @@
|
||||
|
||||
<script setup name="ListOfWinningBidsForm" lang="ts">
|
||||
import { ref, reactive, toRefs, watch, onMounted, onUnmounted, getCurrentInstance, ComponentInternalInstance, computed } from 'vue';
|
||||
import { addListOfWinningBids, updateListOfWinningBids, listListOfWinningBids, getListOfWinningBids } from '@/api/bidding/listOfWinningBids';
|
||||
import { ListOfWinningBidsVO, ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types';
|
||||
import { addListOfWinningBids, updateListOfWinningBids, listListOfWinningBids } from '@/api/bidding/listOfWinningBids';
|
||||
import { ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { ElFormInstance, ElMessage } from 'element-plus';
|
||||
|
||||
// 获取组件实例
|
||||
import { getProject, updateProject } from '@/api/project/project';
|
||||
import { globalHeaders } from '@/utils/request';
|
||||
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { genFileId } from 'element-plus';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 用户状态管理
|
||||
const { project_type, project_stage } = toRefs<any>(proxy?.useDict('project_type', 'project_stage'));
|
||||
const headers = ref(globalHeaders());
|
||||
const fileList = ref([]);
|
||||
// 用户状态管理与当前项目
|
||||
const userStore = useUserStoreHook();
|
||||
// 当前选中项目(从store获取)
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
// const realUploadUrl = computed(() => {
|
||||
// const search = new URLSearchParams().toString();
|
||||
// return search ? `${baseUrl}${props.uploadUrl}?${search}` : `${baseUrl}${props.uploadUrl}`;
|
||||
// });
|
||||
// 项目信息(仅展示,非表单编辑)
|
||||
const projectInfo = reactive({
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
projectType: undefined,
|
||||
projectStage: undefined,
|
||||
onStreamTime: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
projectSite: undefined,
|
||||
plan: undefined,
|
||||
actual: undefined,
|
||||
designTotal: undefined,
|
||||
remark: undefined,
|
||||
projectName: undefined
|
||||
});
|
||||
|
||||
// 表单相关引用
|
||||
// 表单核心变量
|
||||
const listOfWinningBidsFormRef = ref<ElFormInstance>();
|
||||
// 加载状态
|
||||
const buttonLoading = ref(false);
|
||||
const isDisabled = ref(false);
|
||||
// 表单初始数据
|
||||
const initFormData: ListOfWinningBidsForm = {
|
||||
const fileObj = ref({
|
||||
bidFile: undefined,
|
||||
bidFileName: undefined
|
||||
});
|
||||
// 表单初始数据(新增招标相关参数)
|
||||
const initFormData = {
|
||||
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
|
||||
whetherBid: '1', // 是否中标:0=中标,1=未中标
|
||||
bidPrice: undefined, // 中标价(人民币)
|
||||
bidFileId: undefined, // 中标通知书
|
||||
biddingAgency: undefined, //招标代理机构
|
||||
tenderer: undefined, //招标人
|
||||
biddingDeadline: undefined, //投标截止时间
|
||||
bidopeningTime: undefined, //开标时间
|
||||
projectOverview: undefined, //项目概况
|
||||
constructionsite: undefined, //建设地点
|
||||
planDuration: undefined, //计划工期
|
||||
answeringDeadlineTime: undefined, //答疑截止时间
|
||||
clarifyDeadlineTime: undefined //澄清截止时间
|
||||
};
|
||||
|
||||
// 表单数据与验证规则
|
||||
// 表单数据与验证规则(核心:是否中标/中标价/中标通知书均设为必填,新增参数添加基础验证)
|
||||
const data = reactive({
|
||||
form: { ...initFormData } as ListOfWinningBidsForm,
|
||||
rules: {
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
||||
winningBidOriginal: [{ required: true, message: '请输入原始中标价', trigger: 'blur' }],
|
||||
exchangeRate: [
|
||||
{ required: true, message: '请输入汇率', trigger: 'blur' },
|
||||
{ type: 'number', min: 0.001, message: '汇率需大于0', trigger: 'blur' }
|
||||
// 是否中标:必填
|
||||
whetherBid: [{ required: true, message: '请选择是否中标', trigger: 'change' }],
|
||||
// 中标价:仅中标时必填,且为正数
|
||||
bidPrice: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入中标价',
|
||||
trigger: 'blur',
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (form.value.whetherBid === '0') {
|
||||
if (!value && value !== 0) {
|
||||
return callback(new Error('请输入中标价'));
|
||||
}
|
||||
if (Number(value) <= 0) {
|
||||
return callback(new Error('中标价需大于0'));
|
||||
}
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
],
|
||||
currency: [{ required: true, message: '请输入币种', trigger: 'blur' }],
|
||||
subject: [{ required: true, message: '请输入所属主体', trigger: 'blur' }],
|
||||
winningBid: [{ required: true, message: '请输入中标价', trigger: 'blur' }],
|
||||
bidWinningDate: [{ required: true, message: '请选择中标日期', trigger: 'blur' }],
|
||||
projectNumbering: [{ required: true, message: '请输入项目编号', trigger: 'blur' }]
|
||||
// 中标通知书:仅中标时必填
|
||||
bidFileId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请上传中标通知书',
|
||||
trigger: 'change',
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (form.value.whetherBid === '0' && !value) {
|
||||
return callback(new Error('请上传中标通知书'));
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
],
|
||||
// 招标代理机构:必填
|
||||
biddingAgency: [{ required: true, message: '请输入招标代理机构', trigger: 'blur' }],
|
||||
// 招标人:必填
|
||||
tenderer: [{ required: true, message: '请输入招标人', trigger: 'blur' }],
|
||||
// 投标截止时间:必填
|
||||
biddingDeadline: [{ required: true, message: '请选择投标截止时间', trigger: 'change' }],
|
||||
// 开标时间:必填
|
||||
bidopeningTime: [{ required: true, message: '请选择开标时间', trigger: 'change' }],
|
||||
// 项目概况:必填
|
||||
projectOverview: [{ required: true, message: '请输入项目概况', trigger: 'blur' }],
|
||||
// 建设地点:必填
|
||||
constructionsite: [{ required: true, message: '请输入建设地点', trigger: 'blur' }],
|
||||
// 计划工期:必填
|
||||
planDuration: [{ required: true, message: '请输入计划工期', trigger: 'blur' }],
|
||||
// 答疑截止时间:必填
|
||||
answeringDeadlineTime: [{ required: true, message: '请选择答疑截止时间', trigger: 'change' }],
|
||||
// 澄清截止时间:必填
|
||||
clarifyDeadlineTime: [{ required: true, message: '请选择澄清截止时间', trigger: 'change' }]
|
||||
} as Record<string, any>
|
||||
});
|
||||
|
||||
// 解构响应式数据
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/**
|
||||
* 计算人民币中标价
|
||||
* 显式触发的计算函数,确保执行时机可靠
|
||||
* 字典标签转换(项目类型/阶段)
|
||||
*/
|
||||
const calculateWinningBid = () => {
|
||||
// 确保数据类型正确
|
||||
const dollarAmount = Number(form.value.winningBidOriginal);
|
||||
const rate = Number(form.value.exchangeRate);
|
||||
|
||||
// 验证输入有效性
|
||||
if (isNaN(dollarAmount) || isNaN(rate) || dollarAmount <= 0 || rate <= 0) {
|
||||
form.value.winningBid = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算并保留2位小数
|
||||
const result = dollarAmount * rate;
|
||||
form.value.winningBid = Number(result.toFixed(2));
|
||||
const getDictLabel = (dictList: any[], value: any) => {
|
||||
if (!dictList || !value) return '';
|
||||
const dictItem = dictList.find((item) => item.value === value);
|
||||
return dictItem ? dictItem.label : '';
|
||||
};
|
||||
const handleUploadSuccess = (val) => {
|
||||
fileObj.value.bidFile = val.url;
|
||||
fileObj.value.bidFileName = val.fileName;
|
||||
};
|
||||
const upload = ref<UploadInstance>();
|
||||
|
||||
const handleExceed: UploadProps['onExceed'] = (files) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
};
|
||||
/**
|
||||
* 页面初始化 - 获取已有数据(如存在)
|
||||
* 初始化中标数据(根据项目ID查询已有记录)
|
||||
*/
|
||||
const initData = async () => {
|
||||
try {
|
||||
if (currentProject.value?.id) {
|
||||
const res = await listListOfWinningBids({ projectId: currentProject.value.id });
|
||||
if (res.code == 200) {
|
||||
console.log(res.data);
|
||||
console.log(res);
|
||||
if (res.code === 200) {
|
||||
resetForm();
|
||||
if (!res.data) {
|
||||
isDisabled.value = false;
|
||||
return;
|
||||
} else {
|
||||
if (res.data) {
|
||||
Object.assign(form.value, res.data);
|
||||
isDisabled.value = true;
|
||||
} else {
|
||||
isDisabled.value = false;
|
||||
}
|
||||
isDisabled.value = true;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
// ElMessage.error('初始化数据失败');
|
||||
console.error('初始化中标数据失败:', error);
|
||||
ElMessage.error('初始化数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交表单
|
||||
* 提交表单(含项目信息更新+中标信息提交)
|
||||
*/
|
||||
const submitForm = () => {
|
||||
const submitForm = async () => {
|
||||
listOfWinningBidsFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
try {
|
||||
// 提交前确保计算正确
|
||||
calculateWinningBid();
|
||||
// 1. 同步项目ID和名称
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
await addListOfWinningBids(form.value);
|
||||
form.value.projectName = projectInfo.projectName;
|
||||
await addListOfWinningBids({ ...form.value, ...projectInfo });
|
||||
// 4. 提交成功后切换为查看状态
|
||||
isDisabled.value = true;
|
||||
ElMessage.success('提交成功');
|
||||
} catch (error) {
|
||||
ElMessage.error('提交失败,请重试');
|
||||
console.error('提交表单失败:', error);
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置表单
|
||||
* 获取项目详细信息(用于展示)
|
||||
*/
|
||||
const getProjectDetail = async () => {
|
||||
try {
|
||||
if (currentProject.value?.id) {
|
||||
const res = await getProject(currentProject.value.id);
|
||||
|
||||
Object.assign(projectInfo, res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取项目详情失败:', error);
|
||||
ElMessage.error('获取项目信息失败');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置表单(恢复初始状态+重新拉取项目信息)
|
||||
*/
|
||||
const resetForm = () => {
|
||||
form.value = { ...initFormData, projectId: currentProject.value?.id };
|
||||
listOfWinningBidsFormRef.value?.resetFields();
|
||||
getProjectDetail();
|
||||
};
|
||||
|
||||
/**
|
||||
* 监听项目ID变化 - 重新初始化数据
|
||||
* 监听项目ID变化,重新初始化数据
|
||||
*/
|
||||
const projectIdWatcher = watch(
|
||||
() => currentProject.value?.id,
|
||||
(newId) => {
|
||||
if (newId) {
|
||||
form.value.projectId = newId;
|
||||
getProjectDetail();
|
||||
initData();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 页面挂载时初始化
|
||||
// 生命周期钩子
|
||||
onMounted(() => {
|
||||
getProjectDetail();
|
||||
initData();
|
||||
});
|
||||
|
||||
// 页面卸载时清除监听
|
||||
onUnmounted(() => {
|
||||
projectIdWatcher();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 全局背景色:柔和灰色,区分页面与卡片 */
|
||||
/* 全局背景色 */
|
||||
.bg-gray-50 {
|
||||
background-color: #f9fafb;
|
||||
}
|
||||
|
||||
/* 表单项优化:hover效果+边框过渡,提升交互感 */
|
||||
/* 项目信息项样式 */
|
||||
.project-info-item {
|
||||
transition: all 0.2s ease;
|
||||
padding: 4px 0;
|
||||
color: #696969;
|
||||
}
|
||||
|
||||
/* 输入框/选择器统一样式 */
|
||||
.el-input__wrapper,
|
||||
.el-date-editor .el-input__wrapper,
|
||||
.el-select__wrapper {
|
||||
border-radius: 6px !important;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
/* 输入框hover效果 */
|
||||
.el-input__wrapper:hover,
|
||||
.el-date-editor .el-input__wrapper:hover,
|
||||
.el-select__wrapper:hover {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
/* 卡片头部文字样式 */
|
||||
.el-card__header-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.el-button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* 表单项样式优化 */
|
||||
.el-form-item {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
@ -316,30 +508,51 @@ onUnmounted(() => {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* 输入框/选择器统一圆角 */
|
||||
.el-input__wrapper,
|
||||
.el-date-editor .el-input__wrapper {
|
||||
border-radius: 6px !important;
|
||||
/* 响应式网格布局适配 */
|
||||
@media (max-width: 767px) {
|
||||
.grid {
|
||||
display: grid;
|
||||
}
|
||||
.grid-cols-1 {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片头部文字对齐优化 */
|
||||
.el-card__header-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
@media (min-width: 768px) and (max-width: 1023px) {
|
||||
.md\:grid-cols-2 {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.md\:col-span-2 {
|
||||
grid-column: span 2 / span 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮间距与过渡效果 */
|
||||
.el-button {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.el-button:hover {
|
||||
transform: translateY(-1px);
|
||||
@media (min-width: 1024px) {
|
||||
.lg\:grid-cols-3 {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
.lg\:col-span-3 {
|
||||
grid-column: span 3 / span 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* 只读输入框样式优化(区分可编辑状态) */
|
||||
.el-input--readonly .el-input__wrapper {
|
||||
background-color: #f9fafb;
|
||||
cursor: not-allowed;
|
||||
/* 间距样式 */
|
||||
.gap-6 {
|
||||
gap: 1.5rem;
|
||||
}
|
||||
.mb-5 {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
.mb-6 {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
.mt-4 {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.mt-6 {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.mt-8 {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
</style>
|
||||
|
@ -25,6 +25,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="content" label="内容" />
|
||||
<el-table-column prop="price" label="限价" />
|
||||
<el-table-column prop="plannedBiddingTime" label="计划招标时间" align="center">
|
||||
<template #default="scope">
|
||||
<el-date-picker v-model="scope.row.plannedBiddingTime" type="date" value-format="YYYY-MM-DD" placeholder="选择时间" />
|
||||
|
@ -36,7 +36,10 @@
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:billofquantitiesLimitList:export']">导出excel</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="clickApprovalSheet()" v-hasPermi="['tender:billofquantitiesLimitList:export']">审核</el-button>
|
||||
<el-button type="primary" v-if="reviewStatus == 'draft'" @click="clickApprovalSheet()">审核</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" v-if="reviewStatus != 'draft'" @click="clickApprovalSheet()">查看流程</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@ -47,7 +50,7 @@
|
||||
<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">
|
||||
<el-table-column prop="unitPrice" label="单价" align="center">
|
||||
<template #default="scope">
|
||||
<el-input-number
|
||||
:model-value="scope.row.unitPrice"
|
||||
@ -84,7 +87,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listBillofquantitiesLimitList, obtainAllVersionNumbers, sheetList, updatePrice, importExcelFile } from '@/api/contract/index';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
@ -97,6 +100,7 @@ const options = ref<any[]>([]);
|
||||
const sheets = ref<any[]>([]);
|
||||
const tableData = ref<any[]>([]);
|
||||
const isExpandAll = ref(false);
|
||||
const reviewStatus = ref('');
|
||||
|
||||
//获取版本号
|
||||
const getVersionNums = async () => {
|
||||
@ -113,6 +117,7 @@ const getVersionNums = async () => {
|
||||
options.value = res.data;
|
||||
if (res.data.length > 0) {
|
||||
queryForm.value.versions = res.data[0].versions;
|
||||
reviewStatus.value = res.data[0].status;
|
||||
|
||||
getSheetName();
|
||||
} else {
|
||||
@ -132,7 +137,12 @@ const getVersionNums = async () => {
|
||||
}
|
||||
};
|
||||
//选择版本号
|
||||
const changeVersions = () => {
|
||||
const changeVersions = (val) => {
|
||||
options.value.forEach((item) => {
|
||||
if (item.versions == val) {
|
||||
reviewStatus.value = item.status;
|
||||
}
|
||||
});
|
||||
getSheetName();
|
||||
};
|
||||
|
||||
@ -182,14 +192,10 @@ const getTableData = async () => {
|
||||
};
|
||||
const res = await listBillofquantitiesLimitList(params);
|
||||
if (res.code == 200) {
|
||||
tableData.value = [res.data[0]];
|
||||
tableData.value = res.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
ElMessage({
|
||||
message: '获取表格失败',
|
||||
type: 'error'
|
||||
});
|
||||
tableData.value = [];
|
||||
loading.value = false;
|
||||
} finally {
|
||||
@ -273,18 +279,22 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
// 审批
|
||||
function clickApprovalSheet() {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
const clickApprovalSheet = () => {
|
||||
proxy.$tab.closePage(proxy?.$route);
|
||||
proxy?.$router.push({
|
||||
path: `/approval/contractLimitPrice/indexEdit`,
|
||||
query: {
|
||||
id: '',
|
||||
type: 'update'
|
||||
projectId: currentProject.value?.id,
|
||||
versions: queryForm.value.versions,
|
||||
sheet: queryForm.value.sheet,
|
||||
type: 'update',
|
||||
status: reviewStatus.value
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
console.log(11111111);
|
||||
});
|
||||
onMounted(() => {
|
||||
getVersionNums();
|
||||
|
@ -34,17 +34,25 @@
|
||||
<el-form-item label="版本号" prop="formNo">
|
||||
<el-input disabled v-model="form.versions" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表名" prop="formNo">
|
||||
<el-input disabled v-model="form.sheet" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" default-expand-all border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="unitPrice" label="单价" align="center" />
|
||||
<el-table-column prop="price" label="总价" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.price }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -88,10 +96,10 @@ import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { detailsMaterialAndEquipmentApproval } from '@/api/design/billofQuantities/index';
|
||||
import { listBillofquantitiesLimitList } from '@/api/contract/index';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -100,6 +108,7 @@ const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
@ -113,8 +122,8 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_contractPriceLimit',
|
||||
label: '合同限价审核'
|
||||
value: currentProject.value?.id + '_xianjiayilan',
|
||||
label: '合约限价审核'
|
||||
}
|
||||
];
|
||||
|
||||
@ -132,11 +141,9 @@ const submitFormData = ref<StartProcessBo>({
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
status: undefined,
|
||||
originalName: undefined
|
||||
versions: '',
|
||||
sheet: '',
|
||||
status: ''
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
@ -162,13 +169,16 @@ const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await detailsMaterialAndEquipmentApproval(routeParams.value.id);
|
||||
const res = await listBillofquantitiesLimitList({
|
||||
projectId: routeParams.value?.id,
|
||||
versions: routeParams.value.versions,
|
||||
sheet: routeParams.value.sheet
|
||||
});
|
||||
console.log('res.data', res.data);
|
||||
|
||||
Object.assign(form.value, res.data);
|
||||
Object.assign(form.value, routeParams.value);
|
||||
console.log('form', form.value);
|
||||
|
||||
tableData.value = res.data.auditData;
|
||||
tableData.value = res.data;
|
||||
console.log('tableData', tableData.value);
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
@ -185,10 +195,10 @@ const submitFlow = async () => {
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
const handleStartWorkFlow = async (data: any) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.versions;
|
||||
submitFormData.value.businessId = data.versions + '_xianjiayilan';
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
@ -244,6 +254,8 @@ onMounted(() => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
console.log(routeParams.value);
|
||||
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
|
@ -18,6 +18,7 @@
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input v-model="queryParams.amount" placeholder="请输入合同金额" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="招标Id" prop="tenderId">
|
||||
<el-input v-model="queryParams.tenderId" placeholder="请输入招标Id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
@ -66,8 +67,12 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" prop="contractSupplier" />
|
||||
<el-table-column label="分包内容" align="center" prop="contractedContent" />
|
||||
<!-- <el-table-column label="分包内容" align="center" prop="contractedContent" /> -->
|
||||
<el-table-column label="合同金额" align="center" prop="amount" />
|
||||
<el-table-column label="预付款比例(%)" align="center" prop="advancePayRatio" />
|
||||
<el-table-column label="尾款比例(%)" align="center" prop="balancePayRatio" />
|
||||
<el-table-column label="质保金比例(%)" align="center" prop="assuranceDepositRatio" />
|
||||
<el-table-column label="付款比例(%)" align="center" prop="payRatio" />
|
||||
<!-- <el-table-column label="招标Id" align="center" prop="tenderId" /> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
|
@ -62,10 +62,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业主单位" align="center" prop="contractOwner" />
|
||||
<el-table-column label="承包内容" align="center" prop="contractedContent" />
|
||||
<!-- <el-table-column label="承包内容" align="center" prop="contractedContent" /> -->
|
||||
<el-table-column label="合同金额" align="center" prop="amount" />
|
||||
<el-table-column label="预付款比例(%)" align="center" prop="advancePayRatio" />
|
||||
<el-table-column label="尾款比例(%)" align="center" prop="balancePayRatio" />
|
||||
<el-table-column label="质保金比例(%)" align="center" prop="assuranceDepositRatio" />
|
||||
<el-table-column label="付款比例(%)" align="center" prop="payRatio" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template #default="scope">
|
||||
<!-- <el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
@ -75,9 +79,13 @@
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['ctr:incomeContract:remove']"></el-button>
|
||||
</el-tooltip> -->
|
||||
<!-- <el-tooltip content="查看承包内容" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)">详情</el-button>
|
||||
</el-tooltip> -->
|
||||
<el-tooltip content="查看附件列表" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleShowFileList(scope.row)">查看附件列表</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -284,6 +292,7 @@ const handleShowFileList = async (row: IncomeContractVO) => {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
@ -1,429 +1,422 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<el-steps style="max-width: 100%" :active="active" finish-status="success" align-center>
|
||||
<el-step title="选择合同类型" />
|
||||
<el-step title="录入合同内容" />
|
||||
<el-step title="录入收款方式" />
|
||||
</el-steps>
|
||||
<div class="content">
|
||||
<template v-if="active == 0">
|
||||
<div>
|
||||
<el-button type="success" size="large" @click="checkContractType('income')">收入合同</el-button>
|
||||
<el-button type="primary" size="large" @click="checkContractType('expenses')">支出合同</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="active == 1">
|
||||
<h1>{{ contract_type == 'income' ? '收入合同' : '支出合同' }}</h1>
|
||||
<template v-if="contract_type == 'income'">
|
||||
<el-form ref="incomeContractFormRef" :model="form" :rules="incomeContractFormRules" label-width="80px">
|
||||
<!-- <el-form-item label="项目名称">
|
||||
<div class="container">
|
||||
<el-steps style="max-width: 100%" :active="active" finish-status="success" align-center>
|
||||
<el-step title="选择合同类型" />
|
||||
<el-step title="录入合同内容" />
|
||||
<el-step title="录入收款方式" />
|
||||
</el-steps>
|
||||
<div class="content">
|
||||
<template v-if="active == 0">
|
||||
<div>
|
||||
<el-button type="success" size="large" @click="checkContractType('income')">收入合同</el-button>
|
||||
<el-button type="primary" size="large" @click="checkContractType('expenses')">支出合同</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<template v-else-if="active == 1">
|
||||
<h1>{{ contract_type == "income" ? "收入合同" : "支出合同" }}</h1>
|
||||
<template v-if="contract_type == 'income'">
|
||||
<el-form ref="incomeContractFormRef" :model="form" :rules="incomeContractFormRules"
|
||||
label-width="80px">
|
||||
<!-- <el-form-item label="项目名称">
|
||||
<el-input :model-value="project.name" disabled />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contractType">
|
||||
<el-select v-model="form.contractType" placeholder="请选择合同类型">
|
||||
<el-option v-for="item in income_contract_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业主单位" prop="contractOwner">
|
||||
<el-input v-model="form.contractOwner" placeholder="请输入业主单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="承包内容">
|
||||
<editor v-model="form.contractedContent" :min-height="192" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input
|
||||
v-model="form.amount"
|
||||
placeholder="请输入合同金额"
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload :multiple="true" :fileType="['pdf']" :onUploadSuccess="onUploadSuccess" :ref="fileRef" :defaultFileList="tempFileList" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template v-else-if="contract_type == 'expenses'">
|
||||
<el-form ref="expensesContractFormRef" :model="form" :rules="expensesContractFormRules" label-width="80px">
|
||||
<!-- <el-form-item label="项目名称">
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contractType">
|
||||
<el-select v-model="form.contractType" placeholder="请选择合同类型">
|
||||
<el-option v-for="item in income_contract_type" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业主单位" prop="contractOwner">
|
||||
<el-input v-model="form.contractOwner" placeholder="请输入业主单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="承包内容">
|
||||
<editor v-model="form.contractedContent" :min-height="192" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入合同金额"
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload :multiple="true" :fileType="['pdf']" :onUploadSuccess="onUploadSuccess"
|
||||
:ref="fileRef" :defaultFileList="tempFileList" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template v-else-if="contract_type == 'expenses'">
|
||||
<el-form ref="expensesContractFormRef" :model="form" :rules="expensesContractFormRules"
|
||||
label-width="80px">
|
||||
<!-- <el-form-item label="项目名称">
|
||||
<el-input :model-value="projectName" placeholder="请输入项目ID" disabled />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contractType">
|
||||
<el-select v-model="form.contractType" placeholder="请选择合同类型">
|
||||
<el-option v-for="item in expenses_contract_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="招标计划" prop="tenderId">
|
||||
<!-- <el-input v-model="form.tenderId" placeholder="请输入招标Id" /> -->
|
||||
<el-input v-model="form.name" placeholder="请选择招标计划" disabled />
|
||||
<el-button type="primary" @click="handleChoose">选择招标</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="winningBidder">
|
||||
<el-input v-model="form.winningBidder" placeholder="请输入供应商" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包内容">
|
||||
<!-- <editor v-model="form.contractedContent" :min-height="192" disabled /> -->
|
||||
<el-input v-model="form.contractedContent" style="width: 300px" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同金额" prop="contractPrice">
|
||||
<el-input
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
v-model="form.contractPrice"
|
||||
placeholder="请输入合同金额"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contractType">
|
||||
<el-select v-model="form.contractType" placeholder="请选择合同类型">
|
||||
<el-option v-for="item in expenses_contract_type" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="招标计划" prop="tenderId">
|
||||
<!-- <el-input v-model="form.tenderId" placeholder="请输入招标Id" /> -->
|
||||
<el-input v-model="form.name" placeholder="请选择招标计划" disabled />
|
||||
<el-button type="primary" @click="handleChoose">选择招标</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="contractSupplier">
|
||||
<el-input v-model="form.contractSupplier" placeholder="请输入供应商" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包内容">
|
||||
<!-- <editor v-model="form.contractedContent" :min-height="192" disabled /> -->
|
||||
<el-input v-model="form.contractedContent" style="width: 300px"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }" type="textarea" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
v-model="form.amount" placeholder="请输入合同金额" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload :multiple="true" :fileType="['pdf']" :onUploadSuccess="onUploadSuccess" :ref="fileRef" :defaultFileList="tempFileList" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<div>
|
||||
<el-button @click="back(true)">上一步</el-button>
|
||||
<el-button type="primary" @click="next">下一步</el-button>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload :multiple="true" :fileType="['pdf']" :onUploadSuccess="onUploadSuccess"
|
||||
:ref="fileRef" :defaultFileList="tempFileList" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<div>
|
||||
<el-button @click="back(true)">上一步</el-button>
|
||||
<el-button type="primary" @click="next">下一步</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="active == 2">
|
||||
<h1>{{ contract_type == "income" ? "收入合同" : "支出合同" }}</h1>
|
||||
<el-form :model="form" :rules="payMentRules" label-width="150" ref="payMentRef">
|
||||
<el-form-item label="支付方式" placeholder="请选择支付方式" prop="payType">
|
||||
<el-select v-model="form.payType">
|
||||
<el-option :value="1" label="月结算">月结算</el-option>
|
||||
<el-option :value="2" label="形象节点">形象节点</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预付款比例(%)" prop="advancePayRatio">
|
||||
<el-input-number v-model="form.advancePayRatio" :max="100" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="尾款比例(%)" prop="balancePayRatio">
|
||||
<el-input-number v-model="form.balancePayRatio" :max="100" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质保金比例(%)" prop="assuranceDepositRatio">
|
||||
<el-input-number v-model="form.assuranceDepositRatio" :max="100" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="付款比例(%)" prop="payRatio">
|
||||
<el-input-number v-model="payRatioComputed" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div>
|
||||
<el-button @click="back(false)">上一步</el-button>
|
||||
<el-button type="success" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="active == 2">
|
||||
<h1>{{ contract_type == 'income' ? '收入合同' : '支出合同' }}</h1>
|
||||
<el-form :model="form" :rules="payMentRules" label-width="150" ref="payMentRef">
|
||||
<el-form-item label="支付方式" placeholder="请选择支付方式" prop="payType">
|
||||
<el-select v-model="form.payType">
|
||||
<el-option :value="1" label="月结算">月结算</el-option>
|
||||
<el-option :value="2" label="形象节点">形象节点</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预付款比例(%)" prop="advancePayRatio">
|
||||
<el-input
|
||||
v-model="form.advancePayRatio"
|
||||
placeholder="请输入预付款比例"
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="尾款比例(%)" prop="balancePayRatio">
|
||||
<el-input
|
||||
v-model="form.balancePayRatio"
|
||||
placeholder="请输入尾款比例"
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="质保金比例(%)" prop="assuranceDepositRatio;">
|
||||
<el-input
|
||||
v-model="form.assuranceDepositRatio"
|
||||
placeholder="请输入质保金比例"
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款比例(%)" prop="payRatio">
|
||||
<el-input
|
||||
v-model="form.payRatio"
|
||||
placeholder="请输入付款比例"
|
||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div>
|
||||
<el-button @click="back(false)">上一步</el-button>
|
||||
<el-button type="success" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<el-dialog v-model="dialogVisible" title="选择招标计划" width="45%">
|
||||
<el-table :data="planList">
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="合同额" align="center" prop="contractPrice" />
|
||||
<el-table-column label="分包内容" align="center" prop="content" />
|
||||
<el-table-column label="中标单位" align="center" prop="winningBidder" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="handleChooseData(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">
|
||||
关闭
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="选择招标计划" width="45%">
|
||||
<el-table :data="planList">
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="合同额" align="center" prop="contractPrice" />
|
||||
<el-table-column label="分包内容" align="center" prop="content" />
|
||||
<el-table-column label="中标单位" align="center" prop="winningBidder" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="handleChooseData(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false"> 关闭 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
import {
|
||||
listExpensesContract,
|
||||
getExpensesContract,
|
||||
delExpensesContract,
|
||||
addExpensesContract,
|
||||
updateExpensesContract,
|
||||
getTenderPlan
|
||||
} from '@/api/ctr/expensesContract';
|
||||
import { listExpensesContract, getExpensesContract, delExpensesContract, addExpensesContract, updateExpensesContract, getTenderPlan } from '@/api/ctr/expensesContract';
|
||||
import { listIncomeContract, getIncomeContract, delIncomeContract, addIncomeContract, updateIncomeContract } from '@/api/ctr/incomeContract';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
const active = ref(0);
|
||||
const contract_type = ref('');
|
||||
const form = ref({ payType: 1 });
|
||||
const fileList = ref([]);
|
||||
const tempFileList = ref([]);
|
||||
const contract_type = ref("")
|
||||
const form = ref({ payType: 1 })
|
||||
const fileList = ref([])
|
||||
const tempFileList = ref([])
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore();
|
||||
const planList = ref([]);
|
||||
const dialogVisible = ref(false);
|
||||
|
||||
const { expenses_contract_type, income_contract_type } = toRefs(proxy?.useDict('income_contract_type', 'expenses_contract_type'));
|
||||
const { expenses_contract_type, income_contract_type } = toRefs(
|
||||
proxy?.useDict('income_contract_type', 'expenses_contract_type')
|
||||
);
|
||||
const fileRef = ref(null);
|
||||
const incomeContractFormRef = ref(null);
|
||||
const expensesContractFormRef = ref(null);
|
||||
const payMentRef = ref(null);
|
||||
const incomeContractFormRules = {
|
||||
contractCode: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
|
||||
contractType: [{ required: true, message: '请选择合同类型', trigger: 'change' }],
|
||||
contractOwner: [{ required: true, message: '请输入业主单位', trigger: 'blur' }],
|
||||
amount: [{ required: true, message: '请输入合同金额', trigger: 'blur' }],
|
||||
remark: [{ required: false, message: '请输入备注', trigger: 'blur' }]
|
||||
contractCode: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
|
||||
contractType: [{ required: true, message: '请选择合同类型', trigger: 'change' }],
|
||||
contractOwner: [{ required: true, message: '请输入业主单位', trigger: 'blur' }],
|
||||
amount: [{ required: true, message: '请输入合同金额', trigger: 'blur' }],
|
||||
remark: [{ required: false, message: '请输入备注', trigger: 'blur' }],
|
||||
};
|
||||
const expensesContractFormRules = {
|
||||
contractCode: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
|
||||
contractType: [{ required: true, message: '请选择合同类型', trigger: 'change' }],
|
||||
contractCode: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
|
||||
contractType: [{ required: true, message: '请选择合同类型', trigger: 'change' }],
|
||||
|
||||
winningBidder: [{ required: true, message: '请输入供应商', trigger: 'blur' }],
|
||||
amount: [{ required: true, message: '请输入合同金额', trigger: 'blur' }],
|
||||
tenderId: [{ required: true, message: '请选择招标计划', trigger: 'blur' }],
|
||||
contractSupplier: [{ required: true, message: '请输入供应商', trigger: 'blur' }],
|
||||
amount: [{ required: true, message: '请输入合同金额', trigger: 'blur' }],
|
||||
tenderId: [{ required: true, message: '请选择招标计划', trigger: 'blur' }],
|
||||
|
||||
remark: [{ required: false, message: '请输入备注', trigger: 'blur' }]
|
||||
remark: [{ required: false, message: '请输入备注', trigger: 'blur' }],
|
||||
};
|
||||
const payMentRules = {
|
||||
payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
|
||||
advancePayRatio: [{ required: true, message: '请输入预付款比例', trigger: 'blur' }],
|
||||
balancePayRatio: [{ required: true, message: '请输入尾款比例', trigger: 'blur' }],
|
||||
assuranceDepositRatio: [{ required: true, message: '请输入质保金比例', trigger: 'blur' }],
|
||||
payRatio: [{ required: true, message: '请输入付款比例', trigger: 'blur' }]
|
||||
payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
|
||||
advancePayRatio: [{ required: true, message: '请输入预付款比例', trigger: 'blur' }],
|
||||
balancePayRatio: [{ required: true, message: '请输入尾款比例', trigger: 'blur' }],
|
||||
assuranceDepositRatio: [{ required: true, message: '请输入质保金比例', trigger: 'blur' }],
|
||||
|
||||
};
|
||||
|
||||
const project = computed(() => {
|
||||
console.log(111);
|
||||
console.log(111);
|
||||
|
||||
return JSON.parse(localStorage.getItem('selectedProject'));
|
||||
return JSON.parse(localStorage.getItem("selectedProject"))
|
||||
});
|
||||
|
||||
const payRatioComputed = computed({
|
||||
get: () => {
|
||||
const { advancePayRatio = 0, balancePayRatio = 0, assuranceDepositRatio = 0 } = form.value;
|
||||
const total = 100 - (advancePayRatio + balancePayRatio + assuranceDepositRatio);
|
||||
// form.value.payRatio = total;
|
||||
return total;
|
||||
},
|
||||
// 只读
|
||||
set: () => { }
|
||||
});
|
||||
const checkContractType = (type) => {
|
||||
contract_type.value = type;
|
||||
form.value.contract_type = type;
|
||||
active.value = 1;
|
||||
form.value.step = active.value;
|
||||
contract_type.value = type;
|
||||
form.value.contract_type = type;
|
||||
active.value = 1;
|
||||
form.value.step = active.value;
|
||||
};
|
||||
const onUploadSuccess = (data) => {
|
||||
fileList.value = data;
|
||||
};
|
||||
fileList.value = data
|
||||
}
|
||||
const back = async (reset) => {
|
||||
console.log(active.value);
|
||||
console.log(active.value);
|
||||
|
||||
if (reset) {
|
||||
await ElMessageBox.confirm('返回上一步将清空目前填写的内容,确定返回?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
resetForm();
|
||||
if (reset) {
|
||||
await ElMessageBox.confirm('返回上一步将清空目前填写的内容,确定返回?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
resetForm();
|
||||
active.value--;
|
||||
}).catch(() => {
|
||||
return;
|
||||
});
|
||||
} else {
|
||||
active.value--;
|
||||
})
|
||||
.catch(() => {
|
||||
return;
|
||||
});
|
||||
} else {
|
||||
active.value--;
|
||||
}
|
||||
console.log(active.value);
|
||||
}
|
||||
console.log(active.value);
|
||||
|
||||
form.value.step = active.value;
|
||||
|
||||
form.value.step = active.value;
|
||||
};
|
||||
const next = async () => {
|
||||
if (contract_type.value === 'income') {
|
||||
await incomeContractFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
active.value++;
|
||||
} else {
|
||||
ElMessage.error('请填写完整的收入合同信息');
|
||||
}
|
||||
});
|
||||
} else if (contract_type.value === 'expenses') {
|
||||
await expensesContractFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
active.value++;
|
||||
} else {
|
||||
ElMessage.error('请填写完整的支出合同信息');
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(active.value);
|
||||
if (contract_type.value === 'income') {
|
||||
await incomeContractFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
active.value++;
|
||||
} else {
|
||||
ElMessage.error('请填写完整的收入合同信息');
|
||||
}
|
||||
});
|
||||
} else if (contract_type.value === 'expenses') {
|
||||
await expensesContractFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
active.value++;
|
||||
} else {
|
||||
ElMessage.error('请填写完整的支出合同信息');
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(active.value);
|
||||
|
||||
form.value.step = active.value;
|
||||
form.value.step = active.value;
|
||||
};
|
||||
const resetForm = () => {
|
||||
form.value = {
|
||||
payType: 1,
|
||||
contractCode: '',
|
||||
contractType: '',
|
||||
contractOwner: '',
|
||||
contractedContent: '',
|
||||
amount: '',
|
||||
remark: '',
|
||||
advancePayRatio: '',
|
||||
balancePayRatio: '',
|
||||
assuranceDepositRatio: '',
|
||||
payRatio: ''
|
||||
};
|
||||
fileList.value = [];
|
||||
tempFileList.value = [];
|
||||
contract_type.value = '';
|
||||
setTimeout(() => {
|
||||
localStorage.removeItem('tempContractForm');
|
||||
}, 0);
|
||||
form.value = {
|
||||
payType: 1,
|
||||
contractCode: '',
|
||||
contractType: '',
|
||||
contractOwner: '',
|
||||
contractedContent: '',
|
||||
amount: '',
|
||||
remark: '',
|
||||
advancePayRatio: '',
|
||||
balancePayRatio: '',
|
||||
assuranceDepositRatio: '',
|
||||
payRatio: ''
|
||||
};
|
||||
fileList.value = [];
|
||||
tempFileList.value = [];
|
||||
contract_type.value = '';
|
||||
setTimeout(() => {
|
||||
localStorage.removeItem("tempContractForm");
|
||||
}, 0);
|
||||
};
|
||||
const submitForm = async () => {
|
||||
console.log(payMentRef.value);
|
||||
await payMentRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
||||
await payMentRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
// 提交付款信息逻辑
|
||||
console.log('提交付款信息', form.value, fileList.value);
|
||||
// 这里可以调用API提交数据
|
||||
form.value.projectId = project.value.id;
|
||||
form.value.fileList = fileList.value.map((data) => {
|
||||
return {
|
||||
...data,
|
||||
fileName: data.name,
|
||||
fileUrl: data.url
|
||||
};
|
||||
});
|
||||
if (contract_type.value === 'income') {
|
||||
await addIncomeContract({ ...form.value });
|
||||
} else if (contract_type.value === 'expenses') {
|
||||
await addExpensesContract({ ...form.value });
|
||||
}
|
||||
resetForm();
|
||||
ElMessage.success('合同提交成功');
|
||||
} else {
|
||||
ElMessage.error('请填写完整的付款信息');
|
||||
}
|
||||
});
|
||||
// if (contract_type.value === 'income') {
|
||||
// const incomeContractFormRef = ref(null);
|
||||
// await incomeContractFormRef.value.validate(async (valid) => {
|
||||
// if (valid) {
|
||||
// // 提交收入合同逻辑
|
||||
// console.log('提交收入合同', form.value, fileList.value);
|
||||
// // 这里可以调用API提交数据
|
||||
// resetForm();
|
||||
// ElMessage.success('收入合同提交成功');
|
||||
// } else {
|
||||
// ElMessage.error('请填写完整的收入合同信息');
|
||||
// }
|
||||
// });
|
||||
// } else if (contract_type.value === 'expenses') {
|
||||
// const expensesContractFormRef = ref(null);
|
||||
// await expensesContractFormRef.value.validate(async (valid) => {
|
||||
// if (valid) {
|
||||
// // 提交支出合同逻辑
|
||||
// console.log('提交支出合同', form.value, fileList.value);
|
||||
// // 这里可以调用API提交数据
|
||||
// resetForm();
|
||||
// ElMessage.success('支出合同提交成功');
|
||||
// } else {
|
||||
// ElMessage.error('请填写完整的支出合同信息');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
};
|
||||
if (payRatioComputed.value < 0) {
|
||||
|
||||
ElMessage.error('四项付款比例之和必须等于100%');
|
||||
return;
|
||||
}
|
||||
form.value.payRatio = payRatioComputed.value;
|
||||
|
||||
// 提交付款信息逻辑
|
||||
console.log('提交付款信息', form.value, fileList.value);
|
||||
// 这里可以调用API提交数据
|
||||
form.value.projectId = project.value.id;
|
||||
form.value.fileList = fileList.value.map((data) => {
|
||||
return {
|
||||
...data,
|
||||
fileName: data.name,
|
||||
fileUrl: data.url,
|
||||
}
|
||||
})
|
||||
if (contract_type.value === 'income') {
|
||||
await addIncomeContract({ ...form.value });
|
||||
} else if (contract_type.value === 'expenses') {
|
||||
await addExpensesContract({ ...form.value });
|
||||
}
|
||||
resetForm();
|
||||
ElMessage.success('合同提交成功');
|
||||
active.value = 0; // 重置步骤
|
||||
} else {
|
||||
ElMessage.error('请填写完整的付款信息');
|
||||
}
|
||||
});
|
||||
// if (contract_type.value === 'income') {
|
||||
// const incomeContractFormRef = ref(null);
|
||||
// await incomeContractFormRef.value.validate(async (valid) => {
|
||||
// if (valid) {
|
||||
// // 提交收入合同逻辑
|
||||
// console.log('提交收入合同', form.value, fileList.value);
|
||||
// // 这里可以调用API提交数据
|
||||
// resetForm();
|
||||
// ElMessage.success('收入合同提交成功');
|
||||
// } else {
|
||||
// ElMessage.error('请填写完整的收入合同信息');
|
||||
// }
|
||||
// });
|
||||
// } else if (contract_type.value === 'expenses') {
|
||||
// const expensesContractFormRef = ref(null);
|
||||
// await expensesContractFormRef.value.validate(async (valid) => {
|
||||
// if (valid) {
|
||||
// // 提交支出合同逻辑
|
||||
// console.log('提交支出合同', form.value, fileList.value);
|
||||
// // 这里可以调用API提交数据
|
||||
// resetForm();
|
||||
// ElMessage.success('支出合同提交成功');
|
||||
// } else {
|
||||
// ElMessage.error('请填写完整的支出合同信息');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
const handleChoose = async () => {
|
||||
if (!form.value.contractType) {
|
||||
ElMessage.error('请先选择合同类型');
|
||||
return;
|
||||
}
|
||||
const formData = {
|
||||
projectId: userStore.selectedProject.id,
|
||||
dictName: form.value.contractType,
|
||||
bidStatus: 1
|
||||
};
|
||||
const { data } = await getTenderPlan(formData);
|
||||
if (data.length === 0) {
|
||||
ElMessage.warning('当前没有招标计划,请先创建招标计划');
|
||||
return;
|
||||
}
|
||||
planList.value = data;
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
if (!form.value.contractType) {
|
||||
ElMessage.error('请先选择合同类型');
|
||||
return;
|
||||
}
|
||||
const formData = {
|
||||
projectId: userStore.selectedProject.id,
|
||||
dictName: form.value.contractType,
|
||||
status: 1,
|
||||
}
|
||||
const { data } = await getTenderPlan(formData)
|
||||
if (data.length === 0) {
|
||||
ElMessage.warning('当前没有招标计划,请先创建招标计划');
|
||||
return;
|
||||
}
|
||||
planList.value = data
|
||||
dialogVisible.value = true;
|
||||
|
||||
}
|
||||
const handleChooseData = (row) => {
|
||||
form.value.tenderId = row.id;
|
||||
form.value.name = row.name;
|
||||
form.value.contractPrice = row.contractPrice;
|
||||
form.value.content = row.content;
|
||||
form.value.winningBidder = row.winningBidder;
|
||||
dialogVisible.value = false;
|
||||
form.value.tenderId = row.id;
|
||||
form.value.name = row.name;
|
||||
// form.value.contractPrice = row.contractPrice;
|
||||
form.value.content = row.content;
|
||||
form.value.contractSupplier = row.winningBidder;
|
||||
form.value.amount = row.contractPrice;
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
watch(
|
||||
form,
|
||||
(val) => {
|
||||
localStorage.setItem('tempContractForm', JSON.stringify({ ...val, fileList: fileList.value }));
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
watch(
|
||||
fileList,
|
||||
(val) => {
|
||||
localStorage.setItem('tempContractForm', JSON.stringify({ ...form.value, fileList: val }));
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
watch(form, (val) => {
|
||||
localStorage.setItem("tempContractForm", JSON.stringify({ ...val, fileList: fileList.value }));
|
||||
}, { deep: true });
|
||||
watch(fileList, (val) => {
|
||||
localStorage.setItem("tempContractForm", JSON.stringify({ ...form.value, fileList: val }));
|
||||
}, { deep: true });
|
||||
onMounted(() => {
|
||||
const tempForm = localStorage.getItem('tempContractForm');
|
||||
if (tempForm) {
|
||||
ElMessageBox.confirm('检测到有未完成的合同录入,是否继续?', '提示', {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
const t = JSON.parse(tempForm);
|
||||
const { fileList: files, ...rest } = JSON.parse(tempForm);
|
||||
form.value = rest;
|
||||
fileList.value = files || [];
|
||||
tempFileList.value = files || [];
|
||||
contract_type.value = form.value.contract_type;
|
||||
active.value = form.value.step || 0;
|
||||
})
|
||||
.catch(() => {
|
||||
localStorage.removeItem('tempContractForm');
|
||||
});
|
||||
}
|
||||
const tempForm = localStorage.getItem("tempContractForm");
|
||||
if (tempForm) {
|
||||
ElMessageBox.confirm('检测到有未完成的合同录入,是否继续?', '提示', {
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
const t = JSON.parse(tempForm);
|
||||
const { fileList: files, ...rest } = JSON.parse(tempForm);
|
||||
form.value = rest;
|
||||
fileList.value = files || [];
|
||||
tempFileList.value = files || [];
|
||||
contract_type.value = form.value.contract_type;
|
||||
active.value = form.value.step || 0;
|
||||
|
||||
}).catch(() => {
|
||||
localStorage.removeItem("tempContractForm");
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 20px;
|
||||
padding: 20px;
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30px;
|
||||
flex-direction: column;
|
||||
}
|
||||
.content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30px;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div class="progress_component">
|
||||
<div class="title">
|
||||
<span class="progress_title">{{ title }}</span>
|
||||
<span :class="percentageClass" class="roboto">{{ percentageChange }}</span>
|
||||
</div>
|
||||
<div class="roboto" v-if="isShowPrice">
|
||||
<span>{{ value }}</span>
|
||||
<span>{{ unit }}</span>
|
||||
</div>
|
||||
<div class="my_el_progress">
|
||||
<el-progress :percentage="progressPercentage" :color="progressColor" :show-text="false" />
|
||||
</div>
|
||||
<div class="progress_component">
|
||||
<div class="title">
|
||||
<span class="progress_title">{{ title }}</span>
|
||||
<span :class="percentageClass" class="roboto">{{ percentageChange }}</span>
|
||||
</div>
|
||||
<div class="roboto" v-if="isShowPrice">
|
||||
<span>{{ value }}</span>
|
||||
<span>{{ unit }}</span>
|
||||
</div>
|
||||
<div class="my_el_progress">
|
||||
<el-progress :percentage="progressPercentage" :color="progressColor" :show-text="false" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -19,103 +19,102 @@ import { defineProps, computed } from 'vue';
|
||||
|
||||
// 定义组件属性
|
||||
const props = defineProps({
|
||||
// 标题文本
|
||||
title: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '指标名称'
|
||||
},
|
||||
// 数值
|
||||
value: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '0.00'
|
||||
},
|
||||
// 单位
|
||||
unit: {
|
||||
type: String,
|
||||
default: '万元'
|
||||
},
|
||||
// 百分比变化值(如:-327.55%)
|
||||
percentageChange: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '0.00%'
|
||||
},
|
||||
// 进度条百分比
|
||||
progressPercentage: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0
|
||||
},
|
||||
// 进度条颜色,默认红色
|
||||
progressColor: {
|
||||
type: String,
|
||||
default: 'rgba(255, 77, 79, 1)'
|
||||
},
|
||||
// 是否显示价格
|
||||
isShowPrice: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
// 标题文本
|
||||
title: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '指标名称'
|
||||
},
|
||||
// 数值
|
||||
value: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '0.00'
|
||||
},
|
||||
// 单位
|
||||
unit: {
|
||||
type: String,
|
||||
default: '万元'
|
||||
},
|
||||
// 百分比变化值(如:-327.55%)
|
||||
percentageChange: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '0.00%'
|
||||
},
|
||||
// 进度条百分比
|
||||
progressPercentage: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0
|
||||
},
|
||||
// 进度条颜色,默认红色
|
||||
progressColor: {
|
||||
type: String,
|
||||
default: 'rgba(255, 77, 79, 1)'
|
||||
},
|
||||
// 是否显示价格
|
||||
isShowPrice: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
});
|
||||
|
||||
// 计算百分比变化的样式类(红色或绿色)
|
||||
const percentageClass = computed(() => {
|
||||
// 检查变化值是否为正数
|
||||
const isPositive = props.percentageChange.startsWith('+') ||
|
||||
(!props.percentageChange.startsWith('-') && props.percentageChange !== '0.00%');
|
||||
return isPositive ? 'green' : 'red';
|
||||
// 检查变化值是否为正数
|
||||
const isPositive = props.percentageChange.startsWith('+') || (!props.percentageChange.startsWith('-') && props.percentageChange !== '0.00%');
|
||||
return isPositive ? 'green' : 'red';
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.progress_component {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-bottom: 10px;
|
||||
|
||||
:deep(.el-progress-bar__outer) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
:deep(.el-progress-bar__inner),
|
||||
:deep(.el-progress-bar__outer) {
|
||||
border-radius: unset;
|
||||
}
|
||||
|
||||
.my_el_progress {
|
||||
margin-top: 15px;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
:deep(.el-progress-bar__outer) {
|
||||
background-color: transparent;
|
||||
}
|
||||
.progress_title {
|
||||
color: rgba(143, 171, 191, 1);
|
||||
font-size: 12px;
|
||||
font-family: SourceHanSansCN-Regular;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
:deep(.el-progress-bar__inner),
|
||||
:deep(.el-progress-bar__outer) {
|
||||
border-radius: unset;
|
||||
}
|
||||
.roboto {
|
||||
font-family: Roboto-Regular;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.my_el_progress {
|
||||
margin-top: 15px;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
.red {
|
||||
color: rgba(255, 77, 79, 1);
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.progress_title {
|
||||
color: rgba(143, 171, 191, 1);
|
||||
font-size: 12px;
|
||||
font-family: SourceHanSansCN-Regular;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.roboto {
|
||||
font-family: Roboto-Regular;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: rgba(255, 77, 79, 1);
|
||||
}
|
||||
|
||||
.green {
|
||||
color: rgba(0, 227, 150, 1);
|
||||
}
|
||||
.green {
|
||||
color: rgba(0, 227, 150, 1);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -5,26 +5,9 @@
|
||||
|
||||
<!-- 数值区域 -->
|
||||
<div class="stat-card__value-container">
|
||||
<span class="stat-card__value">{{ formattedValue }}</span>
|
||||
<span class="stat-card__value">{{ props.value }}</span>
|
||||
<span class="stat-card__unit">{{ unit }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 底部信息区域 -->
|
||||
<div class="stat-card__footer">
|
||||
<div class="stat-card__trend">
|
||||
<img
|
||||
class="stat-card__trend-icon"
|
||||
:src="'/src/assets/large/' + trendIcon+'.png'"
|
||||
:alt="trendDirection === 'up' ? '上升' : '下降'"
|
||||
>
|
||||
<span class="stat-card__trend-text">{{ trendText }}</span>
|
||||
</div>
|
||||
<img
|
||||
class="stat-card__badge"
|
||||
:src="'/src/assets/large/'+badgeIcon+'.png'"
|
||||
alt="徽章图标"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -78,6 +61,10 @@ const props = defineProps({
|
||||
customStyles: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
@ -103,20 +90,22 @@ const trendText = computed(() => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 20px;
|
||||
padding: 35px 10px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgba(29, 214, 255, 0.1);
|
||||
border-radius: 4px; // 增加轻微圆角,提升视觉效果
|
||||
|
||||
&__title {
|
||||
font-size: 14px;
|
||||
color: #8FABBF;
|
||||
color: #8fabbf;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__value-container {
|
||||
display: flex;
|
||||
// display: flex;
|
||||
align-items: baseline;
|
||||
// align-items: center;
|
||||
// flex-direction: column;
|
||||
}
|
||||
|
||||
&__value {
|
||||
@ -128,7 +117,7 @@ const trendText = computed(() => {
|
||||
}
|
||||
|
||||
&__unit {
|
||||
color: #8FABBF;
|
||||
color: #8fabbf;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@ -151,7 +140,7 @@ const trendText = computed(() => {
|
||||
|
||||
&__trend-text {
|
||||
font-size: 14px;
|
||||
color: #8FABBF;
|
||||
color: #8fabbf;
|
||||
}
|
||||
|
||||
&__badge {
|
||||
|
@ -1,45 +1,162 @@
|
||||
<template>
|
||||
<div class="bottom_box">
|
||||
<div class="bottom_box_title">收入合同</div>
|
||||
<div>
|
||||
<span class="bottom_box_number">205,805.17</span>
|
||||
<span>万元</span>
|
||||
</div>
|
||||
<div class="bottom_box_bottom">
|
||||
<el-progress :percentage="50" color="rgba(255, 147, 42, 1)" />
|
||||
</div>
|
||||
<div class="bottom_box_text">
|
||||
成本率
|
||||
</div>
|
||||
<!-- 材料成本展示框 -->
|
||||
<div class="bottom_box">
|
||||
<div class="bottom_box_title">材料成本</div>
|
||||
<div class="bottom_box_bottom">
|
||||
<el-progress :percentage="materialProgressPercent" color="rgba(255, 147, 42, 1)"
|
||||
:format="(percent) => `${percent.toFixed(1)}%`" />
|
||||
</div>
|
||||
<div class="bottom_box_text">成本使用率</div>
|
||||
<div class="cost-item">
|
||||
<span class="cost-label">材料成本:</span>
|
||||
<span class="cost-value">{{ materialCost.toFixed(2) }} 万元</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分包成本展示框 -->
|
||||
<div class="bottom_box">
|
||||
<div class="bottom_box_title">分包成本</div>
|
||||
<div class="bottom_box_bottom">
|
||||
<el-progress :percentage="subcontractProgressPercent" color="rgba(0, 227, 150, 1)"
|
||||
:format="(percent) => `${percent.toFixed(1)}%`" />
|
||||
</div>
|
||||
<div class="bottom_box_text">成本使用率</div>
|
||||
<div class="cost-item">
|
||||
<span class="cost-label">分包成本:</span>
|
||||
<span class="cost-value">{{ subcontractCost.toFixed(2) }} 万元</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 劳务成本展示框 -->
|
||||
<div class="bottom_box">
|
||||
<div class="bottom_box_title">劳务成本</div>
|
||||
<div class="bottom_box_bottom">
|
||||
<el-progress :percentage="laborProgressPercent" color="rgba(255, 77, 79, 1)"
|
||||
:format="(percent) => `${percent.toFixed(1)}%`" />
|
||||
</div>
|
||||
<div class="bottom_box_text">成本使用率</div>
|
||||
<div class="cost-item">
|
||||
<span class="cost-label">劳务成本:</span>
|
||||
<span class="cost-value">{{ laborCost.toFixed(2) }} 万元</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 管理成本展示框 -->
|
||||
<div class="bottom_box">
|
||||
<div class="bottom_box_title">管理成本</div>
|
||||
<div class="bottom_box_bottom">
|
||||
<el-progress :percentage="manageProgressPercent" color="rgba(29, 214, 255, 1)"
|
||||
:format="(percent) => `${percent.toFixed(1)}%`" />
|
||||
</div>
|
||||
<div class="bottom_box_text">成本使用率</div>
|
||||
<div class="cost-item">
|
||||
<span class="cost-label">管理成本:</span>
|
||||
<span class="cost-value">{{ manageCost.toFixed(2) }} 万元</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from 'vue';
|
||||
import { ElProgress } from 'element-plus';
|
||||
import { cost } from '@/api/largeScreen/index';
|
||||
|
||||
// 定义各类成本的响应式数据
|
||||
const materialCost = ref(0); // 材料成本
|
||||
const subcontractCost = ref(0); // 分包成本
|
||||
const laborCost = ref(0); // 劳务成本
|
||||
const manageCost = ref(0); // 管理成本
|
||||
|
||||
// 进度条相关配置(每个成本单独设置预算,这里假设每个成本预算相同,可根据实际调整)
|
||||
const budgetCost = 10000; // 单个成本项的预算总成本(用于计算使用率)
|
||||
|
||||
// 计算每个成本项的进度百分比
|
||||
const materialProgressPercent = computed(() => {
|
||||
const percent = (materialCost.value / budgetCost) * 100;
|
||||
return Math.min(percent, 100);
|
||||
});
|
||||
const subcontractProgressPercent = computed(() => {
|
||||
const percent = (subcontractCost.value / budgetCost) * 100;
|
||||
return Math.min(percent, 100);
|
||||
});
|
||||
const laborProgressPercent = computed(() => {
|
||||
const percent = (laborCost.value / budgetCost) * 100;
|
||||
return Math.min(percent, 100);
|
||||
});
|
||||
const manageProgressPercent = computed(() => {
|
||||
const percent = (manageCost.value / budgetCost) * 100;
|
||||
return Math.min(percent, 100);
|
||||
});
|
||||
|
||||
// 请求成本数据
|
||||
const getCostData = async () => {
|
||||
try {
|
||||
const res = await cost();
|
||||
if (res.code === 200) {
|
||||
// 为各类成本赋值(转换为数字类型)
|
||||
materialCost.value = Number(res.data.materialCost);
|
||||
subcontractCost.value = Number(res.data.subcontractCost);
|
||||
laborCost.value = Number(res.data.laborCost);
|
||||
manageCost.value = Number(res.data.manageCost);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取成本数据失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 页面挂载时请求数据
|
||||
onMounted(() => {
|
||||
getCostData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.bottom_box {
|
||||
width: 225px;
|
||||
height: 147px;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
width: 225px;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
background: rgba(12, 24, 46, 0.8);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.bottom_box_title,
|
||||
.bottom_box_text {
|
||||
color: rgba(143, 171, 191, 1);
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.bottom_box_title {
|
||||
color: rgba(143, 171, 191, 1);
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bottom_box_number {
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
.bottom_box_text {
|
||||
color: rgba(143, 171, 191, 1);
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.bottom_box_bottom {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.cost-item {
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cost-label {
|
||||
color: rgba(143, 171, 191, 1);
|
||||
}
|
||||
|
||||
.cost-value {
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
@ -1,146 +1,160 @@
|
||||
<template>
|
||||
<div class="centerPage">
|
||||
<div>
|
||||
<div style="height: 147px;width: 100%;display: flex;justify-content: space-between;">
|
||||
<!-- <div class="top_box">
|
||||
<div class="top_box_title">收入合同</div>
|
||||
<div>
|
||||
<span class="top_box_number">205,805.17</span>
|
||||
<span>万元</span>
|
||||
</div>
|
||||
<div class="top_box_bottom">
|
||||
<div>
|
||||
<img class="up_img" src="@/assets/large/up.png" alt=""></img>
|
||||
<span class="top_box_title"> 3.2% 较上月</span>
|
||||
</div>
|
||||
<img class="top_img" src="@/assets/large/top1.png" alt=""></img>
|
||||
</div>
|
||||
</div> -->
|
||||
<RevenueContractCard title="收入合同" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
|
||||
badgeIcon="top1" period="较上月" />
|
||||
<RevenueContractCard title="支出合同" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
|
||||
badgeIcon="top2" period="较上月" />
|
||||
<RevenueContractCard title="合同利润" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="down"
|
||||
badgeIcon="top3" period="较上月" />
|
||||
<RevenueContractCard title="工程变更" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
|
||||
badgeIcon="top4" period="较上月" />
|
||||
<div style="height: 147px; width: 100%; display: flex; justify-content: space-between">
|
||||
<!-- 收入合同:保持万元显示 -->
|
||||
<RevenueContractCard title="收入合同" :value="formatToTenThousand(data.incomeTotalAmount, 'tenThousand')" />
|
||||
<!-- 支出合同:保持万元显示 -->
|
||||
<RevenueContractCard title="支出合同" :value="formatToTenThousand(data.expensesTotalAmount, 'tenThousand')" />
|
||||
<!-- 合同利润:保持万元显示 -->
|
||||
<RevenueContractCard title="合同利润" :value="formatToTenThousand(data.profitAmount, 'tenThousand')" />
|
||||
<!-- 工程变更:改为百分比显示 -->
|
||||
<RevenueContractCard title="工程变更" :value="formatToTenThousand(data.changeAmount, 'percentage')" unit="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="centerPage_map">
|
||||
<div ref="mapRef" class="map-container" style="width: 100%; height: 100%" />
|
||||
</div>
|
||||
<div>
|
||||
<div style="height: 147px;width: 100%;display: flex;justify-content: space-between;">
|
||||
<!-- <div class="bottom_box">
|
||||
<div class="bottom_box_title">收入合同</div>
|
||||
<div>
|
||||
<span class="bottom_box_number">205,805.17</span>
|
||||
<span>万元</span>
|
||||
</div>
|
||||
<div class="bottom_box_bottom">
|
||||
<el-progress :percentage="50" color="rgba(255, 147, 42, 1)" />
|
||||
</div>
|
||||
<div class="bottom_box_text">
|
||||
成本率
|
||||
</div>
|
||||
</div> -->
|
||||
<bottomboxconpoent> </bottomboxconpoent>
|
||||
<bottomboxconpoent> </bottomboxconpoent>
|
||||
<bottomboxconpoent> </bottomboxconpoent>
|
||||
<bottomboxconpoent> </bottomboxconpoent>
|
||||
<div style="height: 147px; width: 100%; display: flex; justify-content: space-between">
|
||||
<bottomboxconpoent />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// import { getPowerStationOverview } from '@/api/large';
|
||||
import * as echarts from 'echarts';
|
||||
import china from '@/assets/china.json';
|
||||
import RevenueContractCard from './RevenueContractCard.vue';
|
||||
import bottomboxconpoent from './bottomboxconpoent.vue';
|
||||
const data = ref<any>({});
|
||||
import { totalAmount, projectGis } from '@/api/largeScreen/index'; // 导入projectGis接口
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue';
|
||||
|
||||
// 地图容器引用
|
||||
// 响应式数据(所有字段均为string,匹配接口返回)
|
||||
const data = ref({
|
||||
incomeTotalAmount: '0.00',
|
||||
expensesTotalAmount: '0.00',
|
||||
profitAmount: '0.00',
|
||||
changeAmount: '0.00' // 接口返回的原始数值(如"0.05"代表5%)
|
||||
});
|
||||
|
||||
// 地图相关变量
|
||||
const mapRef = ref<HTMLDivElement | null>(null);
|
||||
// ECharts实例
|
||||
let myChart: any = null;
|
||||
const projectData = ref<any[]>([]); // 存储项目地理信息数据
|
||||
|
||||
// 响应窗口大小变化
|
||||
const handleResize = () => {
|
||||
if (myChart) {
|
||||
myChart.resize();
|
||||
// 接口请求:获取合同数据
|
||||
const getContractData = async () => {
|
||||
try {
|
||||
const response = await totalAmount();
|
||||
if (response.code === 200) {
|
||||
data.value = response.data;
|
||||
} else {
|
||||
console.error('合同数据请求失败:', response.msg);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('合同数据调用异常:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化地图
|
||||
// 新增:获取项目地理信息数据
|
||||
const getProjectGisData = async () => {
|
||||
try {
|
||||
const response = await projectGis();
|
||||
if (response.code === 200) {
|
||||
// 过滤掉没有经纬度的项目
|
||||
projectData.value = response.data.filter((item: any) => item.lng !== null && item.lat !== null && item.lng !== '' && item.lat !== '');
|
||||
console.log('项目地理数据:', projectData.value);
|
||||
} else {
|
||||
console.error('项目地理数据请求失败:', response.msg);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('项目地理数据调用异常:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 工具函数:根据类型处理数据显示
|
||||
* @param value 接口返回的原始string数值
|
||||
* @param type 处理类型:tenThousand(万元)、percentage(百分比)
|
||||
* @returns 直接显示的字符串
|
||||
*/
|
||||
const formatToTenThousand = (value: string, type: 'tenThousand' | 'percentage') => {
|
||||
const num = parseFloat(value);
|
||||
if (isNaN(num)) return type === 'percentage' ? '0.00%' : '0.00';
|
||||
|
||||
if (type === 'percentage') {
|
||||
return (num * 100).toFixed(2) + '%';
|
||||
}
|
||||
|
||||
return (num / 10000).toFixed(2);
|
||||
};
|
||||
|
||||
// 地图resize处理
|
||||
const handleResize = () => {
|
||||
if (myChart) myChart.resize();
|
||||
};
|
||||
|
||||
// 初始化地图(修改为使用接口数据)
|
||||
const initEcharts = () => {
|
||||
if (!mapRef.value) {
|
||||
console.error('未找到地图容器元素');
|
||||
if (!mapRef.value || projectData.value.length === 0) {
|
||||
console.error('未找到地图容器或项目数据');
|
||||
return;
|
||||
}
|
||||
|
||||
// 注册地图
|
||||
echarts.registerMap('china', china as any);
|
||||
|
||||
// 地图数据
|
||||
const mapData: any = [{ name: '田东县', value: 1, itemStyle: { color: '#fff' } }];
|
||||
|
||||
// 散点数据
|
||||
// 散点数据 - 使用图片标记并调整名称位置
|
||||
const scatterData: any[] = [
|
||||
{
|
||||
name: '田东光伏智慧生态工地开发项目',
|
||||
value: [107.15, 23.63],
|
||||
// 使用图片作为标记(注意:需替换为你的图片实际路径)
|
||||
symbol: 'diamond',
|
||||
// 标记颜色
|
||||
itemStyle: {
|
||||
color: '#0166d6'
|
||||
},
|
||||
// 图片标记大小(宽, 高)
|
||||
symbolSize: [20, 20],
|
||||
// 名称样式设置
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '{b}', // 显示名称
|
||||
position: 'top', // 名称在图片上方
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
// 可选:添加文字背景以增强可读性
|
||||
backgroundColor: 'rgba(3, 26, 52, 0.7)',
|
||||
padding: [3, 6],
|
||||
borderRadius: 3
|
||||
}
|
||||
// 从接口数据生成散点数据
|
||||
const scatterData = projectData.value.map((item) => ({
|
||||
name: item.projectName,
|
||||
value: [parseFloat(item.lng), parseFloat(item.lat)], // 转换为数值类型
|
||||
shortName: item.shortName,
|
||||
projectSite: item.projectSite,
|
||||
symbol: 'diamond',
|
||||
itemStyle: { color: '#0166d6' },
|
||||
symbolSize: [20, 20],
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '{b}', // 显示项目名称
|
||||
position: 'top',
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
backgroundColor: 'rgba(3, 26, 52, 0.7)',
|
||||
padding: [3, 6],
|
||||
borderRadius: 3
|
||||
}
|
||||
];
|
||||
// 初始化新实例,强制清除缓存
|
||||
}));
|
||||
|
||||
myChart = echarts.init(mapRef.value, null, {
|
||||
renderer: 'canvas', // 明确指定渲染器
|
||||
useDirtyRect: false // 禁用脏矩形渲染,避免样式缓存
|
||||
renderer: 'canvas',
|
||||
useDirtyRect: false
|
||||
});
|
||||
// 配置项
|
||||
|
||||
const option: any = {
|
||||
roam: true, // 关键配置:允许鼠标滚轮缩放和拖拽平移
|
||||
roam: true, // 允许缩放和平移
|
||||
geo: {
|
||||
type: 'map',
|
||||
map: 'china',
|
||||
zoom: 5,
|
||||
center: [107.15, 23.63],
|
||||
label: {
|
||||
show: false,
|
||||
color: '#fff'
|
||||
},
|
||||
zoom: 4, // 调整初始缩放级别
|
||||
center: [108.95, 34.27], // 中国中心位置经纬度
|
||||
label: { show: false, color: '#fff' },
|
||||
itemStyle: {
|
||||
areaColor: '#031a34', // 地图区域底色
|
||||
borderColor: '#1e3a6e', // 区域边框颜色
|
||||
areaColor: '#031a34',
|
||||
borderColor: '#1e3a6e',
|
||||
borderWidth: 1
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params: any) {
|
||||
return params.name + (params.value ? `:${params.value}` : '');
|
||||
formatter: (params: any) => {
|
||||
// 自定义提示框内容,显示更多项目信息
|
||||
const data = params.data;
|
||||
return `
|
||||
<div style="font-weight: bold;">${data.name}</div>
|
||||
<div>地点:${data.projectSite}</div>
|
||||
<div>经纬度:${data.value[0].toFixed(6)}, ${data.value[1].toFixed(6)}</div>
|
||||
`;
|
||||
}
|
||||
},
|
||||
series: [
|
||||
@ -148,47 +162,39 @@ const initEcharts = () => {
|
||||
type: 'map',
|
||||
map: 'china',
|
||||
geoIndex: 0,
|
||||
// 关键:在series级别定义emphasis,优先级最高
|
||||
emphasis: {
|
||||
areaColor: '#fff', // 强制设置hover颜色
|
||||
label: {
|
||||
show: true,
|
||||
color: '#fff'
|
||||
},
|
||||
itemStyle: {
|
||||
areaColor: '#02417e' // 重复设置确保生效
|
||||
}
|
||||
areaColor: '#fff',
|
||||
label: { show: true, color: '#fff' },
|
||||
itemStyle: { areaColor: '#02417e' }
|
||||
},
|
||||
// 确保没有使用默认样式
|
||||
select: {
|
||||
itemStyle: {
|
||||
areaColor: '#02417e'
|
||||
}
|
||||
},
|
||||
data: mapData
|
||||
select: { itemStyle: { areaColor: '#02417e' } },
|
||||
data: [] // 可以留空,或根据需要添加区域数据
|
||||
},
|
||||
{
|
||||
type: 'scatter',
|
||||
coordinateSystem: 'geo',
|
||||
data: scatterData
|
||||
data: scatterData,
|
||||
emphasis: {
|
||||
scale: true, // 鼠标悬停时放大
|
||||
symbolSize: [25, 25]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 设置配置项
|
||||
myChart.setOption(option);
|
||||
};
|
||||
|
||||
// 组件挂载时初始化
|
||||
// 组件生命周期
|
||||
onMounted(() => {
|
||||
// 确保DOM渲染完成
|
||||
nextTick(() => {
|
||||
nextTick(async () => {
|
||||
// 先获取合同数据和项目地理数据,再初始化地图
|
||||
await Promise.all([getContractData(), getProjectGisData()]);
|
||||
initEcharts();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
});
|
||||
|
||||
// 组件卸载时清理
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
if (myChart) {
|
||||
@ -196,15 +202,6 @@ onUnmounted(() => {
|
||||
myChart = null;
|
||||
}
|
||||
});
|
||||
// const getDataList = () => {
|
||||
// getPowerStationOverview().then((res) => {
|
||||
// console.log(res);
|
||||
// if (res.code == 200) {
|
||||
// data.value = res.data;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
// getDataList();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -215,14 +212,11 @@ onUnmounted(() => {
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 0 10px 10px 10px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
.centerPage_map {
|
||||
width: 100%;
|
||||
height: 60%;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
@ -1,56 +1,300 @@
|
||||
<template>
|
||||
<div class="leftPage">
|
||||
<!-- -->
|
||||
<div class="kpi_box">
|
||||
<TitleComponent :title="'支付KPI'" style="margin-bottom: 20px;"/>
|
||||
<ProgressComponent
|
||||
title="应收账款"
|
||||
value="123,456.78"
|
||||
percentageChange="+25.30%"
|
||||
progressPercentage="75"
|
||||
progressColor="rgba(255, 77, 79, 1)"
|
||||
/>
|
||||
<ProgressComponent
|
||||
title="应付账款"
|
||||
value="123,456.78"
|
||||
percentageChange="+25.30%"
|
||||
progressPercentage="25"
|
||||
progressColor="rgba(29, 214, 255, 1)"
|
||||
/>
|
||||
<ProgressComponent
|
||||
title="本月付款"
|
||||
value="123,456.78"
|
||||
percentageChange="+25.30%"
|
||||
progressPercentage="45"
|
||||
progressColor="rgba(0, 227, 150, 1)"
|
||||
/>
|
||||
<ProgressComponent
|
||||
title="本月收款"
|
||||
value="123,456.78"
|
||||
percentageChange="+25.30%"
|
||||
progressPercentage="10"
|
||||
progressColor="rgba(255, 147, 42, 1)"
|
||||
/>
|
||||
<TitleComponent :title="'支付KPI'" style="margin-bottom: 20px" />
|
||||
<ProgressComponent title="应收账款" :value="formatCurrency(incomeData.planAmount)"
|
||||
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
|
||||
progressColor="rgba(255, 77, 79, 1)" />
|
||||
<ProgressComponent title="应付账款" :value="formatCurrency(expensesData.planAmount)"
|
||||
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
|
||||
progressColor="rgba(29, 214, 255, 1)" />
|
||||
<ProgressComponent title="本月付款" :value="formatCurrency(expensesData.actualAmount)"
|
||||
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
|
||||
progressColor="rgba(0, 227, 150, 1)" />
|
||||
<ProgressComponent title="本月收款" :value="formatCurrency(incomeData.actualAmount)"
|
||||
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
|
||||
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
|
||||
progressColor="rgba(255, 147, 42, 1)" />
|
||||
</div>
|
||||
<div class="contract_box">
|
||||
<EchartBox :option="barOption" />
|
||||
<div style="height: 60px;">
|
||||
<TitleComponent :title="'收支合同分析'" style="margin-bottom: 20px" />
|
||||
</div>
|
||||
<!-- 切换按钮 -->
|
||||
|
||||
<div style="margin-bottom: 10px; text-align: center">
|
||||
<button @click="switchChart('income')"
|
||||
:style="activeChart === 'income' ? activeBtnStyle : defaultBtnStyle">收入合同</button>
|
||||
<button @click="switchChart('expenses')" :style="activeChart === 'expenses' ? activeBtnStyle : defaultBtnStyle"
|
||||
style="margin-left: 15px">
|
||||
支出合同
|
||||
</button>
|
||||
</div>
|
||||
<!-- 环形图容器:固定高度确保图表不拉伸,添加flex居中 -->
|
||||
<div class="chart-container">
|
||||
<EchartBox :option="pieOption" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed, toRefs, getCurrentInstance, nextTick } from 'vue';
|
||||
// import echarts from 'echarts';
|
||||
import TitleComponent from './TitleComponent.vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import TitleComponent from './TitleComponent.vue';
|
||||
import ProgressComponent from './ProgressComponent.vue';
|
||||
import EchartBox from '@/components/EchartBox/index.vue';
|
||||
import { getBarOptions2 } from './optionList';
|
||||
const barOption = ref();
|
||||
const getCapitalData = (data) => {
|
||||
barOption.value = getBarOptions2();
|
||||
import { incomePay, expensesPay, incomeAnalyze, expensesAnalyze } from '@/api/largeScreen/index';
|
||||
|
||||
// 初始化数据容器
|
||||
const incomeData = ref({ planAmount: '0.00', actualAmount: '0.00' }); // 收入相关数据(应收/收款)
|
||||
const expensesData = ref({ planAmount: '0.00', actualAmount: '0.00' }); // 支出相关数据(应付/付款)
|
||||
const pieOption = ref({}); // 环形图配置
|
||||
const activeChart = ref('income'); // 当前激活的图表类型:income-收入合同,expenses-支出合同
|
||||
// 新增:存储合同数据及对应总数(避免重复计算)
|
||||
const chartData = ref({
|
||||
income: { firstCount: 0, secondCount: 0, thirdCount: 0, fourthCount: 0, total: 0 }, // 收入合同+总数
|
||||
expenses: { firstCount: 0, secondCount: 0, thirdCount: 0, fourthCount: 0, total: 0 } // 支出合同+总数
|
||||
});
|
||||
|
||||
// 按钮样式
|
||||
const defaultBtnStyle = {
|
||||
padding: '4px 16px',
|
||||
border: '1px solid rgba(29, 214, 255, 0.5)',
|
||||
backgroundColor: 'transparent',
|
||||
color: 'rgba(29, 214, 255, 1)',
|
||||
cursor: 'pointer',
|
||||
borderRadius: '4px'
|
||||
};
|
||||
onMounted(() => {
|
||||
getCapitalData();
|
||||
const activeBtnStyle = {
|
||||
...defaultBtnStyle,
|
||||
backgroundColor: 'rgba(29, 214, 255, 0.2)',
|
||||
borderColor: 'rgba(29, 214, 255, 1)'
|
||||
};
|
||||
|
||||
/**
|
||||
* 格式化金额为带千分位的格式
|
||||
* @param {string} amount 金额字符串
|
||||
* @returns {string} 格式化后的金额
|
||||
*/
|
||||
const formatCurrency = (amount) => {
|
||||
if (!amount) return '0.00';
|
||||
return Number(amount).toLocaleString('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 计算百分比变化(保留两位小数)
|
||||
* @param {string} plan 计划金额
|
||||
* @param {string} actual 实际金额
|
||||
* @returns {string} 带正负号的百分比字符串
|
||||
*/
|
||||
const getPercentageChange = (plan, actual) => {
|
||||
const planNum = Number(plan);
|
||||
const actualNum = Number(actual);
|
||||
|
||||
if (planNum === 0) {
|
||||
return planNum === actualNum ? '0.00%' : '+100.00%';
|
||||
}
|
||||
|
||||
const change = ((actualNum - planNum) / planNum) * 100;
|
||||
return `${change >= 0 ? '+' : ''}${change.toFixed(2)}%`;
|
||||
};
|
||||
|
||||
/**
|
||||
* 计算进度百分比(保留整数)
|
||||
* @param {string} plan 计划金额
|
||||
* @param {string} actual 实际金额
|
||||
* @returns {number} 进度百分比(0-100)
|
||||
*/
|
||||
const getProgressPercentage = (plan, actual) => {
|
||||
const planNum = Number(plan);
|
||||
const actualNum = Number(actual);
|
||||
|
||||
if (planNum === 0) {
|
||||
return actualNum === 0 ? 0 : 100;
|
||||
}
|
||||
|
||||
const percentage = (actualNum / planNum) * 100;
|
||||
return Math.min(Math.round(percentage), 100); // 限制最大为100
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取并处理资金数据(原逻辑保留)
|
||||
*/
|
||||
const getCapitalData = async () => {
|
||||
try {
|
||||
const [incomeRes, expensesRes] = await Promise.all([incomePay(), expensesPay()]);
|
||||
|
||||
if (incomeRes.code === 200) {
|
||||
incomeData.value = incomeRes.data;
|
||||
}
|
||||
if (expensesRes.code === 200) {
|
||||
expensesData.value = expensesRes.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取资金数据失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 计算单类合同总数(复用方法)
|
||||
* @param {Object} data 单类合同数据(收入/支出)
|
||||
* @returns {number} 合同总数
|
||||
*/
|
||||
const calculateTotalCount = (data) => {
|
||||
return data.firstCount + data.secondCount + data.thirdCount + data.fourthCount;
|
||||
};
|
||||
|
||||
// 新增:标记合同图表数据是否加载完成
|
||||
const isChartDataLoaded = ref(false);
|
||||
|
||||
// 修改 getContractChartData 方法:请求成功后标记加载完成
|
||||
const getContractChartData = async () => {
|
||||
try {
|
||||
const [incomeChartRes, expensesChartRes] = await Promise.all([incomeAnalyze(), expensesAnalyze()]);
|
||||
|
||||
// 收入合同数据处理(原逻辑保留)
|
||||
if (incomeChartRes.code === 200) {
|
||||
const incomeRaw = incomeChartRes.data;
|
||||
chartData.value.income = {
|
||||
...incomeRaw,
|
||||
total: calculateTotalCount(incomeRaw)
|
||||
};
|
||||
}
|
||||
|
||||
// 支出合同数据处理(原逻辑保留)
|
||||
if (expensesChartRes.code === 200) {
|
||||
const expensesRaw = expensesChartRes.data;
|
||||
chartData.value.expenses = {
|
||||
...expensesRaw,
|
||||
total: calculateTotalCount(expensesRaw)
|
||||
};
|
||||
}
|
||||
|
||||
// ✅ 关键:所有数据请求完成后,标记为“已加载”
|
||||
isChartDataLoaded.value = true;
|
||||
} catch (error) {
|
||||
console.error('获取合同图表数据失败:', error);
|
||||
// 可选:失败时也标记加载完成,避免一直显示“加载中”(可替换为“加载失败”提示)
|
||||
isChartDataLoaded.value = true;
|
||||
}
|
||||
};
|
||||
|
||||
const generatePieOption = (data) => {
|
||||
// 1. 未加载:返回“加载中”配置
|
||||
if (!isChartDataLoaded.value) {
|
||||
return {
|
||||
tooltip: { trigger: 'none' }, // 未加载时不需要tooltip
|
||||
legend: { show: false }, // 隐藏图例(无数据可展示)
|
||||
series: [
|
||||
{
|
||||
name: '合同数量',
|
||||
type: 'pie',
|
||||
radius: ['30%', '60%'],
|
||||
center: ['50%', '80%'],
|
||||
data: [], // 空数据,避免显示圆环
|
||||
itemStyle: { borderColor: '#000', borderWidth: 1 },
|
||||
// 中心显示“加载中”提示
|
||||
label: {
|
||||
show: true,
|
||||
position: 'center',
|
||||
formatter: '合同数据加载中...',
|
||||
textStyle: { color: 'rgba(255, 255, 255, 0.9)', fontSize: 16 }
|
||||
},
|
||||
emphasis: { label: { show: false } },
|
||||
labelLine: { show: false }
|
||||
}
|
||||
],
|
||||
grid: { top: '15%', bottom: '5%', left: '5%', right: '5%' }
|
||||
};
|
||||
}
|
||||
|
||||
// 2. 已加载:返回真实数据配置(原逻辑保留,仅优化中心文本)
|
||||
const pieData = [
|
||||
{ name: '100万以下', value: data.firstCount },
|
||||
{ name: '100-500万', value: data.secondCount },
|
||||
{ name: '500-1000万', value: data.thirdCount },
|
||||
{ name: '1000万以上', value: data.fourthCount }
|
||||
];
|
||||
|
||||
return {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} 份'
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center',
|
||||
textStyle: { color: 'rgba(255, 255, 255, 0.8)' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '合同数量',
|
||||
type: 'pie',
|
||||
radius: ['70%', '80%'], // 恢复原半径(原代码中70%/80%可能过窄,可根据需求调整)
|
||||
center: ['50%', '60%'],
|
||||
avoidLabelOverlap: false,
|
||||
itemStyle: {
|
||||
borderRadius: 8,
|
||||
borderColor: '#000',
|
||||
borderWidth: 1
|
||||
},
|
||||
// 中心文本:显示真实总数(此时data.total已可靠)
|
||||
label: {
|
||||
show: true,
|
||||
position: 'center',
|
||||
formatter: `合同总数\n{total|${data.total} 份}`,
|
||||
rich: {
|
||||
total: {
|
||||
fontSize: 20,
|
||||
fontWeight: 'bold',
|
||||
color: 'rgba(29, 214, 255, 1)',
|
||||
marginTop: 8
|
||||
}
|
||||
},
|
||||
textStyle: { color: 'rgba(255, 255, 255, 0.9)', fontSize: 14 }
|
||||
},
|
||||
emphasis: { label: { show: false } },
|
||||
labelLine: { show: false },
|
||||
data: pieData,
|
||||
color: ['rgba(255, 77, 79, 1)', 'rgba(29, 214, 255, 1)', 'rgba(0, 227, 150, 1)', 'rgba(255, 147, 42, 1)']
|
||||
}
|
||||
],
|
||||
grid: {
|
||||
top: '15%',
|
||||
bottom: '5%',
|
||||
left: '5%',
|
||||
right: '5%'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* 切换图表类型(收入/支出)
|
||||
* @param {string} type 目标类型:income/expenses
|
||||
*/
|
||||
const switchChart = (type) => {
|
||||
activeChart.value = type;
|
||||
};
|
||||
|
||||
watch(
|
||||
[activeChart, isChartDataLoaded], // 监听两个变量:图表类型 + 加载状态
|
||||
([newType]) => {
|
||||
pieOption.value = generatePieOption(chartData.value[newType]);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 组件挂载后初始化数据(并行请求,提升速度)
|
||||
onMounted(async () => {
|
||||
await Promise.all([getCapitalData(), getContractChartData()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -58,13 +302,23 @@ onMounted(() => {
|
||||
.leftPage {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.kpi_box{
|
||||
|
||||
.kpi_box {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.contract_box{
|
||||
height: 35vh;
|
||||
|
||||
.contract_box {
|
||||
height: 33vh;
|
||||
display: flex;
|
||||
flex-direction: column; // 按钮区和图表区垂直排列
|
||||
}
|
||||
.kpi_box,.contract_box {
|
||||
|
||||
.chart-container {
|
||||
height: 28vh;
|
||||
}
|
||||
|
||||
.kpi_box,
|
||||
.contract_box {
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid rgba(29, 214, 255, 0.3);
|
||||
|
@ -255,6 +255,7 @@ export const getLineOption = (lineData: any) => {
|
||||
const maxData = Math.max(...lineData.line1.flat());
|
||||
|
||||
const option = {
|
||||
|
||||
backgroundColor: '',
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@ -312,7 +313,7 @@ export const getLineOption = (lineData: any) => {
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
@ -698,17 +699,31 @@ export const getBarOptions = (data: any) => {
|
||||
backgroundColor: '',
|
||||
grid: {
|
||||
left: '8%',
|
||||
top: '4%',
|
||||
top: '10%', // 顶部留一点空间给 legend
|
||||
bottom: '8%',
|
||||
right: '2%'
|
||||
},
|
||||
legend: {
|
||||
data: ['现金流入', '现金流出'], // 与 series.name 对应
|
||||
top: '0%',
|
||||
textStyle: { color: '#fff', fontSize: 12 }
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
backgroundColor: '',
|
||||
trigger: 'axis',
|
||||
formatter: '{b0}:{c0}万元',
|
||||
// formatter: '{b0}:{c0}万元',
|
||||
formatter: (params: any) => {
|
||||
// params 是数组,对应每条柱子
|
||||
return params
|
||||
.map((p: any) => `${p.seriesName}:${p.value} 万元`)
|
||||
.join('<br/>');
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow',
|
||||
}
|
||||
// borderColor: 'rgba(252, 217, 18, 1)'
|
||||
},
|
||||
@ -779,6 +794,7 @@ export const getBarOptions = (data: any) => {
|
||||
// ],
|
||||
series: [
|
||||
{
|
||||
name: '现金流入',
|
||||
type: 'bar',
|
||||
data: data.value[0],
|
||||
// stack: '合并',
|
||||
@ -817,6 +833,7 @@ export const getBarOptions = (data: any) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '现金流出',
|
||||
type: 'bar',
|
||||
data: data.value[1],
|
||||
// stack: '合并',
|
||||
@ -846,12 +863,12 @@ export const getBarOptions = (data: any) => {
|
||||
)
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
show: true,
|
||||
formatter: '{c}',
|
||||
position: 'top',
|
||||
color: '#fff',
|
||||
fontSize: 10
|
||||
// padding: 5
|
||||
fontSize: 10,
|
||||
padding: 5
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -862,7 +879,7 @@ export const getBarOptions = (data: any) => {
|
||||
// 收支合同分析
|
||||
export const getBarOptions2 = (data: any) => {
|
||||
const option = {
|
||||
color:['#FF932A', '#678FE6', '#1DD6FF', '#00E396'],
|
||||
color: ['#FF932A', '#678FE6', '#1DD6FF', '#00E396'],
|
||||
title: {
|
||||
text: '数量(个)',
|
||||
subtext: '16',
|
||||
@ -872,14 +889,16 @@ export const getBarOptions2 = (data: any) => {
|
||||
color: '#9DADB7',
|
||||
fontSize: 16
|
||||
},
|
||||
subtextStyle:{
|
||||
subtextStyle: {
|
||||
color: '#707070',
|
||||
fontSize: 32,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
trigger: 'item',
|
||||
show: true
|
||||
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
@ -907,7 +926,7 @@ export const getBarOptions2 = (data: any) => {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{ value: 3, name: '100万一下' },
|
||||
{ value: 3, name: '100万以下' },
|
||||
{ value: 4, name: '100-500万' },
|
||||
{ value: 5, name: '500-1000万' },
|
||||
{ value: 4, name: '1000万以上' },
|
||||
|
@ -11,17 +11,17 @@
|
||||
<div class="inflowData">
|
||||
<div class="inflow">
|
||||
<div class="title">现金流入</div>
|
||||
<div class="number">1000000</div>
|
||||
<div class="number">{{ bigDataObj.incomeCash }}</div>
|
||||
<div class="unit">万元</div>
|
||||
</div>
|
||||
<div class="inflow">
|
||||
<div class="title">现金流出</div>
|
||||
<div class="number">1000000</div>
|
||||
<div class="number">{{ bigDataObj.expensesCash }}</div>
|
||||
<div class="unit">万元</div>
|
||||
</div>
|
||||
<div class="inflow">
|
||||
<div class="title">净现金流</div>
|
||||
<div class="number">1000000</div>
|
||||
<div class="number">{{ bigDataObj.profitCash }}</div>
|
||||
<div class="unit">万元</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -33,7 +33,7 @@
|
||||
<div class="title">项目进度</div>
|
||||
<div class="number">100%</div>
|
||||
</div> -->
|
||||
<ProgressComponent title="现金比率" value="123,456.78" percentageChange="3479.61%" :progressPercentage="100"
|
||||
<ProgressComponent title="现金比率" value="123,456.78" percentageChange="98.11%" :progressPercentage="100"
|
||||
progressColor="rgba(29, 214, 255, 1)" :isShowPrice="false" class="progress_text" />
|
||||
</div>
|
||||
</div>
|
||||
@ -45,45 +45,63 @@ import TitleComponent from './TitleComponent.vue';
|
||||
import EchartBox from '@/components/EchartBox/index.vue';
|
||||
import { getLineOption, getBarOptions } from './optionList';
|
||||
import ProgressComponent from './ProgressComponent.vue';
|
||||
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen/index';
|
||||
|
||||
const lineOption = ref();
|
||||
const barOption = ref();
|
||||
const bigDataObj = ref<any>({});
|
||||
|
||||
const getCapitalData = async () => {
|
||||
const { data } = await monthMoney()
|
||||
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
|
||||
const income = data.map((item: any) => item.incomeAmount);
|
||||
const expenses = data.map((item: any) => item.expensesAmount);
|
||||
const profit = data.map((item: any) => item.profitAmount);
|
||||
|
||||
const getCapitalData = (data?: any) => {
|
||||
// const xData = data.map((item) => item.time);
|
||||
// const yData = data.map((item) => item.content);
|
||||
const lineData = {
|
||||
xLabel: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
xLabel: month,
|
||||
line1: [
|
||||
[100, 200, 150, 300, 250, 350, 400, 350, 450, 500, 400, 550],
|
||||
[220, 250, 230, 280, 270, 300, 350, 320, 380, 400, 450, 500],
|
||||
[300, 350, 320, 380, 400, 450, 500, 480, 520, 550, 600, 650]
|
||||
income,
|
||||
expenses,
|
||||
profit
|
||||
]
|
||||
|
||||
// line2: ['20', '50', '12', '65', '30', '60']
|
||||
};
|
||||
lineOption.value = getLineOption(lineData);
|
||||
};
|
||||
const getTurnoverList = (data?: any) => {
|
||||
const getTurnoverList = async () => {
|
||||
// const xData = data.map((item) => item.time);
|
||||
// const yData = data.map((item) => {
|
||||
// // 先将content转换为数字,再调用toFixed
|
||||
// const num = Number(item.content);
|
||||
// return isNaN(num) ? 0 : Number(num.toFixed(2));
|
||||
// });
|
||||
const { data } = await monthCash()
|
||||
// const month = data.map((item: any) => item.month);
|
||||
const month = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
|
||||
|
||||
const income = data.map((item: any) => item.incomeAmount);
|
||||
const expenses = data.map((item: any) => item.expensesAmount);
|
||||
const barData = {
|
||||
name: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
name: month,
|
||||
value: [
|
||||
[2, 5, 15, 30, 25, 35, 40, 35, 45, 50, 40, 55],
|
||||
[4, 3, 6, 11, 15, 22, 30, 14, 48, 22, 25, 60]
|
||||
income,
|
||||
expenses
|
||||
]
|
||||
};
|
||||
console.log(barData);
|
||||
|
||||
barOption.value = getBarOptions(barData);
|
||||
};
|
||||
const getTotalAmonunt = async () => {
|
||||
const { data } = await cashTotal()
|
||||
bigDataObj.value = data
|
||||
};
|
||||
onMounted(() => {
|
||||
getCapitalData();
|
||||
getTurnoverList();
|
||||
getTotalAmonunt();
|
||||
});
|
||||
|
||||
//资金KPI
|
||||
|
@ -1,4 +1,4 @@
|
||||
<template>
|
||||
ID<template>
|
||||
<div class="large-screen">
|
||||
<Header />
|
||||
<div class="nav">
|
||||
@ -21,6 +21,7 @@ import leftPage from './components/leftPage.vue';
|
||||
import centerPage from './components/centerPage.vue';
|
||||
import rightPage from './components/rightPage.vue';
|
||||
// import '@/assets/styles/element.scss';
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -31,6 +32,7 @@ import rightPage from './components/rightPage.vue';
|
||||
background-size: 100% 100%;
|
||||
background-color: rgba(4, 7, 17, 1);
|
||||
}
|
||||
|
||||
.nav {
|
||||
width: 100%;
|
||||
height: calc(100vh - 80px);
|
||||
|
@ -140,7 +140,7 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '名称' : ''"
|
||||
label="名称"
|
||||
:prop="`itemList.${index}.name`"
|
||||
:rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
@ -149,7 +149,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '规格' : ''"
|
||||
label="规格"
|
||||
:prop="`itemList.${index}.specification`"
|
||||
:rules="[{ required: true, message: '规格不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
@ -158,7 +158,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '单位' : ''"
|
||||
label="单位"
|
||||
:prop="`itemList.${index}.unit`"
|
||||
:rules="[{ required: true, message: '单位不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
@ -167,7 +167,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '库存' : ''"
|
||||
label="库存"
|
||||
:prop="`itemList.${index}.stockQuantity`"
|
||||
:rules="[{ required: true, message: '库存不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
@ -176,7 +176,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '领取' : ''"
|
||||
label="领取"
|
||||
:prop="`itemList.${index}.issuedQuantity`"
|
||||
:rules="[{ required: true, message: '领取数量不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
@ -185,7 +185,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '剩余' : ''"
|
||||
label="剩余"
|
||||
:prop="`itemList.${index}.remainingQuantity`"
|
||||
:rules="[{ required: true, message: '剩余数量不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
@ -193,7 +193,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="index === 0 ? '备注' : ''" prop="remark">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="item.remark" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -54,31 +54,32 @@
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="150">序号</th>
|
||||
<th width="150">名称</th>
|
||||
<th width="150">规格</th>
|
||||
<th width="150">单位</th>
|
||||
<th width="150">库存</th>
|
||||
<th width="150">领取</th>
|
||||
<th width="150">剩余</th>
|
||||
<th width="150">备注</th>
|
||||
<!-- 去掉重复的 width 属性,统一用 CSS 控制 -->
|
||||
<th style="width: 80px; word-wrap: break-word">序号</th>
|
||||
<th style="width: 120px; word-wrap: break-word">名称</th>
|
||||
<th style="width: 120px; word-wrap: break-word">规格</th>
|
||||
<th style="width: 80px; word-wrap: break-word">单位</th>
|
||||
<th style="width: 80px; word-wrap: break-word">库存</th>
|
||||
<th style="width: 80px; word-wrap: break-word">领取</th>
|
||||
<th style="width: 80px; word-wrap: break-word">剩余</th>
|
||||
<th style="width: 120px; word-wrap: break-word">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, i) of formData.itemList" :key="i">
|
||||
<th width="150">{{ i + 1 }}</th>
|
||||
<th width="150">{{ item.name }}</th>
|
||||
<th width="150">{{ item.specification }}</th>
|
||||
<th width="150">{{ item.unit }}</th>
|
||||
<th width="150">{{ item.stockQuantity }}</th>
|
||||
<th width="150">{{ item.issuedQuantity }}</th>
|
||||
<th width="150">{{ item.remainingQuantity }}</th>
|
||||
<th width="150">{{ item.remark }}</th>
|
||||
<td width="150">{{ i + 1 }}</td>
|
||||
<td width="150">{{ item.name }}</td>
|
||||
<td width="150">{{ item.specification }}</td>
|
||||
<td width="150">{{ item.unit }}</td>
|
||||
<td width="150">{{ item.stockQuantity }}</td>
|
||||
<td width="150">{{ item.issuedQuantity }}</td>
|
||||
<td width="150">{{ item.remainingQuantity }}</td>
|
||||
<td width="150">{{ item.remark }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<td colspan="7" style="word-wrap: break-word">
|
||||
<div style="margin-bottom: 10px">缺陷情况:</div>
|
||||
{{ formData.defectDescription }}
|
||||
</td>
|
||||
@ -296,5 +297,6 @@ tbody {
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
/* overflow: auto; */
|
||||
}
|
||||
</style>
|
||||
|
@ -485,15 +485,13 @@ const addItem = () => {
|
||||
// 监听条目数据变化,自动计算缺件数量
|
||||
const watchItemChanges = (index: number) => {
|
||||
watch(
|
||||
() => [form.value.itemList[index]?.quantity, form.value.itemList[index]?.acceptedQuantity],
|
||||
() => [form.value.itemList[index].quantity, form.value.itemList[index].acceptedQuantity],
|
||||
([quantity, acceptedQuantity]) => {
|
||||
// 确保数量和验收数量都是数字
|
||||
const qty = Number(quantity) || 0;
|
||||
const acceptedQty = Number(acceptedQuantity) || 0;
|
||||
// 计算缺件数量(数量 - 验收数量)
|
||||
if (form.value.itemList[index]) {
|
||||
form.value.itemList[index].shortageQuantity = qty - acceptedQty;
|
||||
}
|
||||
form.value.itemList[index].shortageQuantity = qty - acceptedQty;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
327
src/views/materials/materialsUseRecord/index.vue
Normal file
327
src/views/materials/materialsUseRecord/index.vue
Normal file
@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> </transition>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="使用部位" prop="usePart">
|
||||
<el-input v-model="queryParams.usePart" 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>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- 外层表格:添加ref用于控制展开状态 -->
|
||||
<el-table ref="outerTableRef" v-loading="loading" :data="materialsUseInventoryList" @expand-change="handleExpandChange" border>
|
||||
<el-table-column type="expand">
|
||||
<template #default="props">
|
||||
<div style="margin-left: 60px">
|
||||
<el-table :data="materialsUseRecordList" border v-loading="loadingChild">
|
||||
<el-table-column label="序号" align="center" type="index" width="60" />
|
||||
<el-table-column label="使用数量" align="center" prop="useNumber" />
|
||||
<el-table-column label="剩余量" align="center" prop="residueNumber" />
|
||||
<el-table-column label="使用部位" align="center" prop="usePart" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="delete"
|
||||
v-if="scope.row.ishow"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['materials:materialsUseRecord:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="totalChild > 0"
|
||||
:total="totalChild"
|
||||
v-model:page="queryParamsChild.pageNum"
|
||||
v-model:limit="queryParamsChild.pageSize"
|
||||
@pagination="getListChild"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" align="center" type="index" width="60" />
|
||||
<el-table-column label="物资名称" align="center" prop="materialsName" />
|
||||
<el-table-column label="交接单位" align="center" prop="recipient" />
|
||||
<el-table-column label="计划数量" align="center" prop="quantityCount" />
|
||||
<el-table-column label="数量" align="center" prop="number" />
|
||||
<el-table-column label="出库人" align="center" prop="operator" />
|
||||
<el-table-column label="领用人" align="center" prop="shipper" />
|
||||
<el-table-column label="剩余量" align="center" prop="residue" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['materials:materialsUseRecord:add']"
|
||||
>添加登记</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="500px" append-to-body>
|
||||
<el-form ref="materialsUseRecordFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="使用数量" prop="useNumber">
|
||||
<el-input v-model="form.useNumber" type="number" placeholder="请输入使用数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用部位" prop="usePart">
|
||||
<el-input v-model="form.usePart" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</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="MaterialsUseRecord" lang="ts">
|
||||
import {
|
||||
listMaterialsUseRecord,
|
||||
listMaterialsUseInventory,
|
||||
getMaterialsUseRecord,
|
||||
delMaterialsUseRecord,
|
||||
addMaterialsUseRecord,
|
||||
updateMaterialsUseRecord
|
||||
} from '@/api/materials/materialsUseRecord';
|
||||
import { MaterialsUseRecordVO, MaterialsUseRecordQuery, MaterialsUseRecordForm } from '@/api/materials/materialsUseRecord/types';
|
||||
import { getCurrentInstance, ComponentInternalInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
||||
import { ElFormInstance, ElTable } from 'element-plus';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { get } from 'lodash';
|
||||
|
||||
// 类型定义补充(若项目中无全局DialogOption类型需添加)
|
||||
interface DialogOption {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const userStore = useUserStore();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
// 核心数据响应式定义
|
||||
const materialsUseRecordList = ref<MaterialsUseRecordVO[]>([]);
|
||||
const materialsUseInventoryList = ref<any[]>([]); // 外层列表数据类型可根据实际接口返回调整
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const loadingChild = 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 totalChild = ref(0);
|
||||
|
||||
// 组件Ref定义
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const materialsUseRecordFormRef = ref<ElFormInstance>();
|
||||
const outerTableRef = ref<InstanceType<typeof ElTable> | undefined>(undefined); // 外层表格Ref(控制展开)
|
||||
const currentExpandInventoryId = ref<number | undefined>(undefined); // 存储当前展开行的inventoryId
|
||||
|
||||
// 对话框与表单数据
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
inventoryId: undefined,
|
||||
usePart: undefined,
|
||||
useNumber: undefined,
|
||||
residueNumber: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData } as MaterialsUseRecordForm,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
outPut: 1,
|
||||
usePart: undefined // 补充usePart字段(与表单prop对应)
|
||||
} as MaterialsUseRecordQuery & { outPut?: number; usePart?: string },
|
||||
queryParamsChild: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inventoryId: undefined,
|
||||
usePart: undefined,
|
||||
useNumber: undefined,
|
||||
residueNumber: undefined
|
||||
} as MaterialsUseRecordQuery,
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
inventoryId: [{ required: true, message: '库存ID不能为空', trigger: 'blur' }],
|
||||
usePart: [{ required: true, message: '使用部位不能为空', trigger: 'blur' }],
|
||||
useNumber: [{ required: true, message: '使用数量不能为空', trigger: 'blur' }],
|
||||
residueNumber: [{ required: true, message: '剩余量不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules, queryParamsChild } = toRefs(data);
|
||||
|
||||
/** 查询材料使用登记列表(外层列表) */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listMaterialsUseInventory(queryParams.value);
|
||||
materialsUseInventoryList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 处理外层表格展开/折叠:记录当前展开行的inventoryId */
|
||||
const handleExpandChange = (row: any) => {
|
||||
currentExpandInventoryId.value = row.id; // 记录展开行ID
|
||||
queryParamsChild.value.inventoryId = row.id;
|
||||
getListChild();
|
||||
};
|
||||
|
||||
/** 查询材料子级登记列表(内层列表) */
|
||||
const getListChild = async () => {
|
||||
loadingChild.value = true;
|
||||
try {
|
||||
const res = await listMaterialsUseRecord(queryParamsChild.value);
|
||||
materialsUseRecordList.value = res.rows;
|
||||
// 控制首行删除按钮显示
|
||||
if (res.rows.length > 0) {
|
||||
materialsUseRecordList.value[0].ishow = true;
|
||||
}
|
||||
totalChild.value = res.total;
|
||||
} finally {
|
||||
loadingChild.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
materialsUseRecordFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据(当前模板未使用,保留原逻辑) */
|
||||
const handleSelectionChange = (selection: MaterialsUseRecordVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = async (row: any) => {
|
||||
reset();
|
||||
form.value.inventoryId = row.id;
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加材料使用登记';
|
||||
};
|
||||
|
||||
/** 修改按钮操作(当前模板未使用,保留原逻辑) */
|
||||
const handleUpdate = async (row?: MaterialsUseRecordVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMaterialsUseRecord(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改材料使用登记';
|
||||
};
|
||||
|
||||
/** 提交按钮:核心优化逻辑(刷新外层列表+保留展开状态) */
|
||||
const submitForm = () => {
|
||||
materialsUseRecordFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
try {
|
||||
// 1. 执行添加/修改接口请求
|
||||
await addMaterialsUseRecord(form.value);
|
||||
// 2. 刷新外层列表(确保外层数据同步,如剩余量)
|
||||
await getList();
|
||||
// 3. 刷新当前展开行的子列表
|
||||
await getListChild();
|
||||
// 4. 恢复展开状态:根据记录的inventoryId重新展开行
|
||||
if (currentExpandInventoryId.value && outerTableRef.value) {
|
||||
const targetRow = materialsUseInventoryList.value.find((item) => item.id === currentExpandInventoryId.value);
|
||||
if (targetRow) {
|
||||
outerTableRef.value.toggleRowExpansion(targetRow, true);
|
||||
}
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MaterialsUseRecordVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认删除材料使用登记编号为"${_ids}"的数据项?`);
|
||||
await delMaterialsUseRecord(_ids);
|
||||
await getList();
|
||||
await getListChild();
|
||||
if (currentExpandInventoryId.value && outerTableRef.value) {
|
||||
const targetRow = materialsUseInventoryList.value.find((item) => item.id === currentExpandInventoryId.value);
|
||||
if (targetRow) {
|
||||
outerTableRef.value.toggleRowExpansion(targetRow, true);
|
||||
}
|
||||
}
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getListChild();
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作(保留原逻辑) */
|
||||
const handleExport = () => {
|
||||
proxy?.download('materials/materialsUseRecord/export', { ...queryParams.value }, `materialsUseRecord_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
/** 页面挂载时加载外层列表 */
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
@ -1,7 +1,7 @@
|
||||
<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-tabs type="border-card" @tab-change="handleTabChange" v-model="activeTab">
|
||||
<el-tab-pane v-for="(item, index) in tabList" :key="index" :label="item.label" :name="item.value">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="计划月份" prop="month">
|
||||
@ -13,70 +13,66 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="valueAllocationList">
|
||||
<el-table-column label="项目" align="center" prop="projectName" />
|
||||
<el-table-column label="项目总产值" align="center" prop="totalValue" />
|
||||
<el-table-column label="月预计产值" align="center" prop="monthlyEstimatedValue" />
|
||||
<el-table-column label="完成产值(第一周)" align="center" prop="firstWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第二周)" align="center" prop="secondWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第三周)" align="center" prop="thirdWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第四周)" align="center" prop="fourthWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第五周)" align="center" prop="fifthWeekCompletionValue" />
|
||||
<el-table-column label="完成产值月合计" align="center" prop="totalCompletionValue" />
|
||||
<el-table-column label="产值差额" align="center" prop="valueDifference" />
|
||||
<el-table-column label="预计累计产值" align="center" prop="estimatedAccumulatedValue" />
|
||||
<el-table-column label="累计完成产值" align="center" prop="accumulatedCompletionValue" />
|
||||
<el-table-column label="产值差额" align="center" prop="valueDifferenceAccumulation" />
|
||||
<el-table-column label="项目完成总进度" align="center" prop="totalCompletionProgress" />
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<el-table v-loading="loading" :data="tableData">
|
||||
<el-table-column label="项目" align="center" prop="projectName" />
|
||||
<el-table-column label="项目总产值" align="center" prop="totalValue" />
|
||||
<el-table-column label="月预计产值" align="center" prop="monthlyEstimatedValue" />
|
||||
<el-table-column label="完成产值(第一周)" align="center" prop="firstWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第二周)" align="center" prop="secondWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第三周)" align="center" prop="thirdWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第四周)" align="center" prop="fourthWeekCompletionValue" />
|
||||
<el-table-column label="完成产值(第五周)" align="center" prop="fifthWeekCompletionValue" />
|
||||
<el-table-column label="完成产值月合计" align="center" prop="totalCompletionValue" />
|
||||
<el-table-column label="产值差额" align="center" prop="valueDifference" />
|
||||
<el-table-column label="预计累计产值" align="center" prop="estimatedAccumulatedValue" />
|
||||
<el-table-column label="累计完成产值" align="center" prop="accumulatedCompletionValue" />
|
||||
<el-table-column label="产值差额" align="center" prop="valueDifferenceAccumulation" />
|
||||
<el-table-column label="项目完成总进度" align="center" prop="totalCompletionProgress" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ValueAllocation" lang="ts">
|
||||
import { listOutTable } from '@/api/out/outTable';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
<script setup lang="ts">
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { dayjs } from 'element-plus';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const valueAllocationList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
month: undefined
|
||||
}
|
||||
const activeTab = ref('1');
|
||||
const queryParams = ref({
|
||||
month: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
const total = ref(0);
|
||||
const tableData = ref([]);
|
||||
const loading = ref(false);
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
const tabList = [
|
||||
{
|
||||
value: '1',
|
||||
label: '对甲施工报表'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '对乙施工报表'
|
||||
}
|
||||
];
|
||||
|
||||
/** 查询项目总产值分配列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
const res = await listOutTable(queryParams.value);
|
||||
valueAllocationList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
//切换表单
|
||||
const handleTabChange = (tab) => {
|
||||
activeTab.value = tab;
|
||||
queryParams.value.month = '';
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@ -87,38 +83,18 @@ const handleQuery = () => {
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
queryParams.value.month = '';
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'out/valueAllocation/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`valueAllocation_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
// 获取列表
|
||||
const getList = async () => {
|
||||
const params = {
|
||||
...queryParams.value,
|
||||
projectId: currentProject.value?.id,
|
||||
activeTab: activeTab.value
|
||||
};
|
||||
console.log(params);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
// 也可以使用字符串格式(例如 YYYY-MM)
|
||||
const currentMonthString = ref(dayjs().format('YYYY-MM'));
|
||||
queryParams.value.month = currentMonthString.value;
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
@ -105,7 +105,7 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="产值类型" prop="valueType">
|
||||
<el-select v-model="form.valueType" placeholder="请选择产值类型" @change="changeValue">
|
||||
<el-select v-model="form.valueType" placeholder="请选择产值类型">
|
||||
<el-option v-for="item in out_value_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -121,9 +121,7 @@
|
||||
<el-input v-model="form.remark" placeholder="请输入说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编码" prop="contractCode">
|
||||
<el-select v-model="form.contractCode" value-key="id" placeholder="请输入合同编码" clearable filterable :disabled="!form.valueType">
|
||||
<el-option v-for="item in contractCodeList" :key="item.contractCode" :label="item.contractCode" :value="item.contractCode"> </el-option>
|
||||
</el-select>
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="contractName">
|
||||
<el-input v-model="form.contractName" placeholder="请输入合同名称" />
|
||||
@ -140,7 +138,6 @@
|
||||
</template>
|
||||
|
||||
<script setup name="SettlementValueSubcontract" lang="ts">
|
||||
import { listExpensesContract } from '@/api/ctr/expensesContract';
|
||||
import {
|
||||
listSettlementValueSubcontract,
|
||||
getSettlementValueSubcontract,
|
||||
@ -157,27 +154,7 @@ import { listContractor } from '@/api/project/contractor';
|
||||
import { ContractorVO } from '@/api/project/contractor/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
const out_value_type = [
|
||||
{
|
||||
'label': '设计',
|
||||
'value': '3',
|
||||
'elTagType': 'primary',
|
||||
'elTagClass': ''
|
||||
},
|
||||
{
|
||||
'label': '采购',
|
||||
'value': '2',
|
||||
'elTagType': 'warning',
|
||||
'elTagClass': ''
|
||||
},
|
||||
{
|
||||
'label': '施工',
|
||||
'value': '1',
|
||||
'elTagType': 'success',
|
||||
'elTagClass': ''
|
||||
}
|
||||
];
|
||||
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -262,13 +239,6 @@ const getContractorList = async () => {
|
||||
contractorList.value = res.rows;
|
||||
};
|
||||
|
||||
//获取合同编码
|
||||
const contractCodeList = ref<any[]>([]);
|
||||
const changeValue = async (contractType: string) => {
|
||||
const res = await listExpensesContract({ projectId: currentProject.value?.id, contractType } as any);
|
||||
contractCodeList.value = res.rows as any;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<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">
|
||||
@ -21,10 +22,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['patch:patch:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['patch:patch:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['patch:patch:export']">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['patch:patch:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -56,10 +59,10 @@
|
||||
<el-table-column label="任务状态" align="center" prop="taskStatus">
|
||||
<template #default="scope">
|
||||
<span
|
||||
:class="[Number(scope.row.taskStatus) === 0 ? 'text-warning' : Number(scope.row.taskStatus) === 1 ? 'text-success' : 'text-danger']"
|
||||
>
|
||||
:class="[Number(scope.row.taskStatus) === 0 ? 'text-warning' : Number(scope.row.taskStatus) === 1 ? 'text-success' : 'text-danger']">
|
||||
{{
|
||||
Number(scope.row.taskStatus) === 0 ? '未完成' : Number(scope.row.taskStatus) === 1 ? '已完成' : `未知状态(${scope.row.taskStatus})`
|
||||
Number(scope.row.taskStatus) === 0 ? '未完成' : Number(scope.row.taskStatus) === 1 ? '已完成' :
|
||||
`未知状态(${scope.row.taskStatus})`
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
@ -71,13 +74,15 @@
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['patch:patch:edit']"></el-button>
|
||||
</el-tooltip> -->
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['patch:patch:remove']"></el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['patch:patch:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 进度详情弹窗 -->
|
||||
<el-dialog :title="`进度详情(当前总进度:${currentTotalProgress}%)`" v-model="progressDialogVisible" width="1000px" destroy-on-close>
|
||||
<el-dialog :title="`进度详情(当前总进度:${currentTotalProgress}%)`" v-model="progressDialogVisible" width="1000px"
|
||||
destroy-on-close>
|
||||
<div class="mb-4">
|
||||
<!-- v-hasPermi="['patch:progress:add']" -->
|
||||
<el-button type="primary" plain icon="Plus" size="small" @click="handleProgressAdd()"> 新增进度 </el-button>
|
||||
@ -94,37 +99,28 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改进度" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
@click="handleProgressUpdate(scope.row)"
|
||||
v-hasPermi="['patch:progress:edit']"
|
||||
></el-button>
|
||||
<el-button link type="primary" icon="Edit" size="small" @click="handleProgressUpdate(scope.row)"
|
||||
v-hasPermi="['patch:progress:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除进度" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
@click="handleProgressDelete(scope.row)"
|
||||
v-hasPermi="['patch:progress:remove']"
|
||||
></el-button>
|
||||
<el-button link type="primary" icon="Delete" size="small" @click="handleProgressDelete(scope.row)"
|
||||
v-hasPermi="['patch:progress:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<!-- 新增/修改进度弹窗 -->
|
||||
<el-dialog :title="progressDialog.title" v-model="progressDialog.visible" width="500px" append-to-body destroy-on-close>
|
||||
<el-dialog :title="progressDialog.title" v-model="progressDialog.visible" width="500px" append-to-body
|
||||
destroy-on-close>
|
||||
<el-form ref="progressFormRef" :model="progressForm" :rules="progressRules" label-width="120px">
|
||||
<el-input v-model="progressForm.ordersId" placeholder="关联的任务ID" readonly style="color: #666; background: #f5f7fa" type="hidden" />
|
||||
<el-input v-model="progressForm.ordersId" placeholder="关联的任务ID" readonly
|
||||
style="color: #666; background: #f5f7fa" type="hidden" />
|
||||
<el-input v-model="progressForm.projectId" type="hidden" />
|
||||
<el-input v-model="progressForm.slaveId" placeholder="请输入执行人ID" v-if="false" />
|
||||
<el-form-item label="进度" prop="progress">
|
||||
<el-input v-model="progressForm.progress" placeholder="请输入进度(0-100之间的数字)" type="number" @input="handleProgressInput" />
|
||||
<el-input v-model="progressForm.progress" placeholder="请输入进度(0-100之间的数字)" type="number"
|
||||
@input="handleProgressInput" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="progressForm.remark" type="textarea" placeholder="请输入备注" rows="3" />
|
||||
@ -139,13 +135,15 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<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="500px" append-to-body destroy-on-close>
|
||||
<el-form ref="masterFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" :readonly="!!currentProjectId" :disabled="!!currentProjectId" v-if="false" />
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" :readonly="!!currentProjectId"
|
||||
:disabled="!!currentProjectId" v-if="false" />
|
||||
<template #help>
|
||||
<span v-if="currentProjectId" class="text-success">已自动关联当前选中项目</span>
|
||||
</template>
|
||||
@ -154,14 +152,17 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="执行人姓名" prop="userId">
|
||||
<el-select v-model="form.userId" placeholder="请选择执行人姓名" clearable style="width: 100%">
|
||||
<el-option v-for="item in slaveOptions" :key="item.id" :label="item.nickName" :value="item.userId"></el-option>
|
||||
<el-option v-for="item in slaveOptions" :key="item.id" :label="item.nickName"
|
||||
:value="item.userId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划完成时间" prop="pcd">
|
||||
<el-date-picker clearable v-model="form.pcd" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划完成时间" />
|
||||
<el-date-picker clearable v-model="form.pcd" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择计划完成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际完成时间" prop="act">
|
||||
<el-date-picker clearable v-model="form.act" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择实际完成时间" />
|
||||
<el-date-picker clearable v-model="form.act" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择实际完成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务描述" prop="describe">
|
||||
<el-input v-model="form.describe" type="textarea" placeholder="请输入任务描述" />
|
||||
@ -243,7 +244,7 @@ interface ProgressDetail {
|
||||
updateTime?: string;
|
||||
projectId?: string | number;
|
||||
}
|
||||
interface ProgressForm extends Omit<ProgressDetail, 'updateTime'> {}
|
||||
interface ProgressForm extends Omit<ProgressDetail, 'updateTime'> { }
|
||||
|
||||
// 4. 获取组件实例
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -631,11 +632,9 @@ const handleProgressInput = () => {
|
||||
const handleExport = () => {
|
||||
proxy?.download('patch/patch/export', { ...queryParams.value }, `任务列表_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
// 监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
@ -655,13 +654,16 @@ onUnmounted(() => {
|
||||
.mb-4 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.el-table .small-padding .cell {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.el-table .fixed-width {
|
||||
width: 120px !important;
|
||||
}
|
||||
.el-table-column .el-button--text + .el-button--text {
|
||||
|
||||
.el-table-column .el-button--text+.el-button--text {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -288,7 +288,7 @@ const getList = async () => {
|
||||
matrixOptions.value = matrixList;
|
||||
queryParams.value.matrixId = matrixList[0].children[0].matrixId;
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('获取方阵失败');
|
||||
// proxy?.$modal.msgError('获取方阵失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@
|
||||
{{ row.parentId == 0 ? '' : row.outputValue }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总数量" align="center" prop="total">
|
||||
<el-table-column label="总数量/百分比" align="center" prop="total">
|
||||
<template #default="{ row }">
|
||||
{{ row.parentId == 0 ? '' : row.total }}
|
||||
</template>
|
||||
|
@ -27,7 +27,7 @@
|
||||
class="upload-demo"
|
||||
:http-request="importExcel"
|
||||
:show-file-list="false"
|
||||
v-hasPermi="['tender:billofquantitiesLimitList:importExcelFile']"
|
||||
v-hasPermi="['tender:tenderPlanLimitList:importExcelFile']"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">导入excel</el-button>
|
||||
@ -35,7 +35,7 @@
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:billofquantitiesLimitList:export']">导出excel</el-button>
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:tenderPlanLimitList:export']">导出excel</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleAudit('update')" v-if="versionsData.status == 'draft'">审核</el-button>
|
||||
@ -75,7 +75,7 @@
|
||||
size="small"
|
||||
@click="handleSave(scope.row)"
|
||||
v-if="scope.row.quantity && scope.row.quantity != 0"
|
||||
v-hasPermi="['tender:billofquantitiesLimitList:edit']"
|
||||
v-hasPermi="['tender:tenderPlanLimitList:edit']"
|
||||
>确定</el-button
|
||||
>
|
||||
</template>
|
||||
|
@ -19,7 +19,29 @@
|
||||
<h3 class="text-lg font-semibold text-gray-800">招标一览</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" row-key="id" border lazy default-expand-all>
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="版本号" prop="formNo">
|
||||
<el-input disabled v-model="form.versions" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表名" prop="formNo">
|
||||
<el-input disabled v-model="form.sheet" placeholder="请输入文件名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" default-expand-all border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="工程或费用名称" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
@ -73,7 +95,7 @@ import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { getKnowledgeDocument } from '@/api/design/technicalStandard';
|
||||
@ -89,6 +111,7 @@ const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
@ -205,10 +228,10 @@ const submitFlow = async () => {
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
const handleStartWorkFlow = async (data: any) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
submitFormData.value.businessId = data.versions + '_xianjiayilan';
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
@ -265,6 +288,8 @@ onMounted(() => {
|
||||
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
|
||||
reset();
|
||||
loading.value = false;
|
||||
console.log(routeParams.value);
|
||||
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
if (routeParams.value.type === 'approval') {
|
||||
form.value.versions = routeParams.value.id.split('_')[0];
|
||||
|
@ -1,77 +1,245 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable @close="closeDialog">
|
||||
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto">
|
||||
<el-form-item label="招标文件" prop="name">
|
||||
<file-upload
|
||||
:fileSize="100"
|
||||
:auto-upload="false"
|
||||
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
|
||||
method="put"
|
||||
ref="fileUploadRef"
|
||||
:data="{
|
||||
projectId: currentProject?.id,
|
||||
type: planType,
|
||||
fileType: '1',
|
||||
bidStatus: '0',
|
||||
id: row.id
|
||||
}"
|
||||
showFileList
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeDialog()"> 取消 </el-button>
|
||||
<el-button type="primary" @click="submitForm()">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<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 } from '@/api/contract/index';
|
||||
import { BiddingImportExcelFile, getTreeLimit, biddingLimitListUpdate, sheetList } from '@/api/bidding/biddingLimit';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const dialogVisible = ref(false);
|
||||
const row = ref<any>();
|
||||
const planType = ref<any>('');
|
||||
const fileUploadRef = ref<any>();
|
||||
const ruleForm = ref<any>();
|
||||
const rules = ref({
|
||||
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
|
||||
const queryForm = ref({
|
||||
versions: '',
|
||||
sheet: ''
|
||||
});
|
||||
const emit = defineEmits(['success']);
|
||||
const form = ref({
|
||||
costEstimationFile: ''
|
||||
const loading = ref(false);
|
||||
const options = ref<any[]>([]);
|
||||
const sheets = ref<any[]>([]);
|
||||
const tableData = ref<any[]>([]);
|
||||
const isExpandAll = ref(true);
|
||||
// 接受父组件传递的参数
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
});
|
||||
const closeDialog = () => {
|
||||
dialogVisible.value = false;
|
||||
emit('success');
|
||||
|
||||
//获取版本号
|
||||
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 = '';
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
//选择版本号
|
||||
const changeVersions = () => {
|
||||
getSheetName();
|
||||
};
|
||||
|
||||
const open = (rows: any, type: string) => {
|
||||
dialogVisible.value = true;
|
||||
console.log(rows, type);
|
||||
row.value = rows;
|
||||
planType.value = type;
|
||||
//选择表名
|
||||
const changeSheet = () => {
|
||||
getTableData();
|
||||
};
|
||||
const resetForm = () => {};
|
||||
const submitForm = () => {
|
||||
fileUploadRef.value.submitUpload().then((res) => {
|
||||
if (res == 'noFile') {
|
||||
|
||||
//获取表名
|
||||
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 = '';
|
||||
}
|
||||
getTableData();
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
//获取表格
|
||||
const getTableData = async () => {
|
||||
loading.value = true;
|
||||
const params = {
|
||||
projectId: currentProject.value?.id,
|
||||
sheet: queryForm.value.sheet,
|
||||
type: props.type
|
||||
};
|
||||
const res = await getTreeLimit(params);
|
||||
loading.value = false;
|
||||
if (res.code == 200) {
|
||||
tableData.value = [res.data[0]];
|
||||
}
|
||||
console.log(loading.value);
|
||||
};
|
||||
//修改单价
|
||||
const handleSave = (row: any) => {
|
||||
try {
|
||||
if (!row.unitPrice) {
|
||||
ElMessage({
|
||||
message: '请上传招标文件',
|
||||
message: '请输入单价',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
dialogVisible.value = false;
|
||||
emit('success');
|
||||
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);
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
open
|
||||
//导入
|
||||
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();
|
||||
}
|
||||
})
|
||||
.catch((err) => {})
|
||||
.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(() => {
|
||||
getSheetName();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<style scoped></style>
|
||||
|
@ -1,112 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable @close="closeDialog">
|
||||
<el-form ref="ruleFormRef" style="max-width: 600px" :model="form" :rules="rules" label-width="auto">
|
||||
<el-form-item label="中标单位" prop="winningBidder">
|
||||
<el-select v-model="form.winningBidder" filterable placeholder="请选择单位" style="width: 240px">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="招标文件" prop="name">
|
||||
<file-upload
|
||||
v-model="form.costEstimationFile"
|
||||
:fileSize="100"
|
||||
:auto-upload="false"
|
||||
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
|
||||
method="put"
|
||||
ref="fileUploadRef"
|
||||
:limit="1"
|
||||
:data="{
|
||||
projectId: currentProject?.id,
|
||||
type: planType,
|
||||
fileType: '0',
|
||||
bidStatus: '0',
|
||||
id: row.id,
|
||||
winningBidderId: form.winningBidder
|
||||
}"
|
||||
showFileList
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeDialog()"> 取消 </el-button>
|
||||
<el-button type="primary" @click="submitForm()">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getUnitList } from '@/api/tender/index';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const dialogVisible = ref(false);
|
||||
const row = ref<any>();
|
||||
const planType = ref<any>('');
|
||||
const fileUploadRef = ref<any>();
|
||||
const ruleForm = ref<any>();
|
||||
const options = ref<any>([]);
|
||||
|
||||
const rules = ref({
|
||||
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
|
||||
});
|
||||
const emit = defineEmits(['success']);
|
||||
const form = ref({
|
||||
costEstimationFile: '',
|
||||
winningBidder: ''
|
||||
});
|
||||
|
||||
const open = (rows: any, type: string) => {
|
||||
dialogVisible.value = true;
|
||||
console.log(rows, type);
|
||||
row.value = rows;
|
||||
planType.value = type;
|
||||
getUnitListData();
|
||||
};
|
||||
const closeDialog = () => {
|
||||
dialogVisible.value = false;
|
||||
form.value.winningBidder = '';
|
||||
emit('success');
|
||||
};
|
||||
const getUnitListData = async () => {
|
||||
let res = await getUnitList({
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
if (res.code == 200) {
|
||||
options.value = res.data.map((item: any) => {
|
||||
return {
|
||||
label: item.supplierName,
|
||||
value: item.id
|
||||
};
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
};
|
||||
const resetForm = () => {};
|
||||
const submitForm = () => {
|
||||
if (!form.value.winningBidder) {
|
||||
ElMessage({
|
||||
message: '请选择中标单位',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
fileUploadRef.value.submitUpload().then((res) => {
|
||||
if (res == 'noFile') {
|
||||
ElMessage({
|
||||
message: '请上传招标文件',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
dialogVisible.value = false;
|
||||
emit('success');
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
open
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
@ -10,11 +10,10 @@
|
||||
<el-form-item label="内容" prop="sheet">
|
||||
<el-input v-model="queryForm.content" 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-button type="primary" plain :icon="Plus" @click="openDialog" v-hasPermi="['tender:segmentedIndicatorPlanning:add']">新增</el-button>
|
||||
<el-button type="primary" plain :icon="Plus" @click="openDialog" v-hasPermi="['tender:biddingPlan:add']">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@ -26,27 +25,19 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="content" label="内容" />
|
||||
<el-table-column prop="price" label="限价" />
|
||||
<el-table-column prop="bidd" label="招标文件">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
link
|
||||
v-hasPermi="['tender:segmentedIndicatorPlanning:getMore']"
|
||||
@click="biddView(scope.row)"
|
||||
>查看文件</el-button
|
||||
>
|
||||
<el-button type="primary" link v-hasPermi="['tender:biddingPlan:getAnnex']" @click="biddView(scope.row)">查看文件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="winningBidder" label="中标单位" />
|
||||
<el-table-column prop="bidFileName" label="中标文件">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link :disabled="scope.row.bidStatus == 1" @click="openPdf(scope.row.bidFile)"
|
||||
>{{ scope.row.bidFileName }}
|
||||
</el-button>
|
||||
<el-button type="primary" link @click="openPdf(scope.row.bidFile)">{{ scope.row.bidFileName }} </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="plannedBiddingTime" label="计划招标时间" align="center">
|
||||
<el-table-column prop="plannedBiddingTime" label="计划招标时间" align="center" width="250">
|
||||
<template #default="scope">
|
||||
<el-date-picker
|
||||
v-model="scope.row.plannedBiddingTime"
|
||||
@ -59,28 +50,48 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择时间"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
v-hasPermi="['tender:biddingPlan:edit']"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="操作" align="center">
|
||||
<el-table-column prop="contractPrice" label="合同金额" align="center" width="200">
|
||||
<template #default="scope">
|
||||
<el-input-number
|
||||
:model-value="scope.row.contractPrice"
|
||||
@change="
|
||||
(val) => {
|
||||
scope.row.contractPrice = val;
|
||||
changeContractPrice(val, scope.row);
|
||||
}
|
||||
"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
v-hasPermi="['tender:biddingPlan:edit']"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="price" label="操作" align="center" width="400">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="FolderOpened"
|
||||
@click="handleSave(scope.row)"
|
||||
v-hasPermi="['tender:segmentedIndicatorPlanning:edit']"
|
||||
v-hasPermi="['tender:biddingPlan:uploadBiddingDocuments']"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
>上传投标资料
|
||||
>招标上传
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="FolderOpened"
|
||||
@click="handleWinTheBid(scope.row)"
|
||||
v-hasPermi="['tender:segmentedIndicatorPlanning:edit']"
|
||||
v-hasPermi="['tender:biddingPlan:uploadBiddingDocuments']"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
>上传中标资料
|
||||
>中标上传
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" link icon="Edit" @click="handleSave(scope.row)" v-hasPermi="['tender:segmentedIndicatorPlanning:edit']"
|
||||
>信息
|
||||
@ -91,7 +102,7 @@
|
||||
icon="View"
|
||||
@click="handleDetail(scope.row)"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
v-hasPermi="['tender:segmentedIndicatorPlanning:getMore']"
|
||||
v-hasPermi="['tender:biddingPlan:getMore']"
|
||||
>详情</el-button
|
||||
>
|
||||
|
||||
@ -101,9 +112,18 @@
|
||||
icon="Delete"
|
||||
@click="delHandle(scope.row)"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
v-hasPermi="['tender:segmentedIndicatorPlanning:remove']"
|
||||
v-hasPermi="['tender:biddingPlan:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Lock"
|
||||
@click="editStatusBtn(scope.row)"
|
||||
:disabled="scope.row.bidStatus == 1"
|
||||
v-hasPermi="['tender:biddingPlan:editStatus']"
|
||||
>确定</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -189,7 +209,7 @@
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm(formRef)" :loading="subLoading">确定</el-button>
|
||||
<el-button type="primary" @click="submitForm(formRef)">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="详情" v-model="detailDialog" width="75%" draggable>
|
||||
@ -213,7 +233,15 @@
|
||||
<el-table-column prop="price" label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link icon="View" @click="openPdf(scope.row.url)">查看</el-button>
|
||||
<el-button type="primary" link icon="Delete" @click="delHandlebidd(scope.row)">删除</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Delete"
|
||||
@click="delHandlebidd(scope.row)"
|
||||
v-if="scope.row.bidStatus != 1"
|
||||
v-hasPermi="['tender:biddingPlanAnnex:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -229,8 +257,6 @@ import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { getDicts } from '@/api/system/dict/data';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import information from './comm/planPage.vue';
|
||||
import winTheBid from './comm/winTheBid.vue';
|
||||
import {
|
||||
sheetList,
|
||||
tenderPlanList,
|
||||
@ -241,9 +267,11 @@ import {
|
||||
getTenderPlanDetail,
|
||||
obtainAllVersionNumbers,
|
||||
biddViewLook,
|
||||
delBiddView
|
||||
delBiddView,
|
||||
editStatus
|
||||
} from '@/api/tender/index';
|
||||
const { proxy } = getCurrentInstance();
|
||||
import { it } from 'element-plus/es/locale/index.mjs';
|
||||
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const tabList = ref<any[]>([]);
|
||||
@ -487,14 +515,12 @@ const getTreeList = async () => {
|
||||
treeLoading.value = false;
|
||||
}
|
||||
};
|
||||
const subLoading = ref(false);
|
||||
|
||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
await formEl.validate(async (valid, fields) => {
|
||||
if (valid) {
|
||||
try {
|
||||
subLoading.value = true;
|
||||
if (selectionData.value.length == 0) {
|
||||
ElMessage({
|
||||
message: '请选择项目材料',
|
||||
@ -529,10 +555,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
});
|
||||
closeDialog();
|
||||
getList();
|
||||
subLoading.value = false;
|
||||
}
|
||||
} catch (error) {
|
||||
subLoading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
} else {
|
||||
@ -540,6 +564,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
//修改计划时间
|
||||
const changeBiddingTime = (value: any, row: any) => {
|
||||
updateTenderPlan({
|
||||
...row
|
||||
@ -553,6 +578,21 @@ const changeBiddingTime = (value: any, row: any) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
//修改合同金额
|
||||
const changeContractPrice = (value: any, row: any) => {
|
||||
updateTenderPlan({
|
||||
...row
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//上传投标文件
|
||||
const handleSave = (row: any) => {
|
||||
informationRef.value.open(row, planType.value);
|
||||
@ -613,6 +653,7 @@ const biddView = async (row: any) => {
|
||||
};
|
||||
const res = await biddViewLook(params);
|
||||
if (res.code == 200) {
|
||||
res.data.forEach((item) => (item.bidStatus = biddViewRow.value.bidStatus));
|
||||
biddViewData.value = res.data;
|
||||
}
|
||||
};
|
||||
@ -631,6 +672,20 @@ const delHandlebidd = (row: any) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
//修改状态
|
||||
const editStatusBtn = (row: any) => {
|
||||
editStatus({
|
||||
...row
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//查看文件
|
||||
const openPdf = (url: any) => {
|
||||
|
@ -323,18 +323,21 @@
|
||||
<script setup name="SupplierInput" lang="ts">
|
||||
import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
||||
import { ElFormInstance } from 'element-plus';
|
||||
import { listSupplierInput, getSupplierInput, delSupplierInput } from '@/api/supplierInput/supplierInput';
|
||||
import { listSupplierInput, getSupplierInput, delSupplierInput } from '@/api/supplierInput/supplierInput/index';
|
||||
import { SupplierInputVO, SupplierInputQuery, SupplierInputForm, PageData, DialogOption } from '@/api/supplierInput/supplierInput/types';
|
||||
import Pagination from '@/components/Pagination/index.vue';
|
||||
import RightToolbar from '@/components/RightToolbar/index.vue';
|
||||
import FileUpload from '@/components/FileUpload/index.vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
// 组件引用
|
||||
const fileUploadRef = ref<InstanceType<typeof FileUpload> | null>(null);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const supplierInputFormRef = ref<ElFormInstance>();
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
// 基础数据
|
||||
const supplierInputList = ref<SupplierInputVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@ -393,6 +396,7 @@ const initFormData: any = {
|
||||
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
supplierType: undefined,
|
||||
@ -506,7 +510,7 @@ const cancel = () => {
|
||||
|
||||
/** 表单重置:清空所有字段 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
form.value = { ...initFormData, projectId: currentProject.value?.id };
|
||||
fileUrl.value = '';
|
||||
form.value.inputFile = '';
|
||||
supplierInputFormRef.value?.resetFields();
|
||||
@ -606,8 +610,6 @@ const handleUpdate = async (row?: SupplierInputVO) => {
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = () => {
|
||||
console.log(1);
|
||||
|
||||
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (!valid) return;
|
||||
if (form.value.supplierType === '劳务') {
|
||||
@ -662,10 +664,29 @@ const handleDelete = async (row?: SupplierInputVO) => {
|
||||
const handleExport = () => {
|
||||
proxy?.download('supplierInput/supplierInput/export', { ...queryParams.value }, `supplierInput_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
/** 页面挂载时查询列表 */
|
||||
//调用projectId并获取列表
|
||||
onMounted(() => {
|
||||
getList();
|
||||
// 若需要依赖项目ID,可先判断项目是否已选中,再调用接口
|
||||
if (currentProject.value?.id) {
|
||||
queryParams.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
getList(); // 首次进入自动调取listSupplierInput接口
|
||||
} else {
|
||||
// 若项目未选中,可提示或后续监听项目变化时再加载(已有监听逻辑)
|
||||
getList();
|
||||
}
|
||||
});
|
||||
// 监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -437,9 +437,7 @@ onMounted(() => {
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
@ -449,9 +447,7 @@ onMounted(() => {
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
|
@ -48,7 +48,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||
},
|
||||
'/auth': {
|
||||
'/auth': {
|
||||
target: env.VITE_APP_BASE_API,
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
|
230
vite.config.ts.timestamp-1755827449287-2282fd4d0109d.mjs
Normal file
230
vite.config.ts.timestamp-1755827449287-2282fd4d0109d.mjs
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user