Merge branch 'main' of http://xny.yj-3d.com:3000/taoge/new_project into ljx
This commit is contained in:
@ -8,7 +8,7 @@ VITE_APP_ENV = 'development'
|
|||||||
#朱银
|
#朱银
|
||||||
# VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
# VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||||
#曾涛
|
#曾涛
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||||
|
|
||||||
# 无人机接口地址
|
# 无人机接口地址
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -61,3 +61,12 @@ export const delProgressCategory = (id: string | number | Array<string | number>
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//下载
|
||||||
|
export const downloadProgressCategory = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/progress/progressCategory/export',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -44,6 +44,7 @@ export const importExcelFile = (query: any, data: any): AxiosPromise<any> => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//招标计划列表
|
//招标计划列表
|
||||||
|
|
||||||
export const tenderPlanList = (query: any): AxiosPromise<any> => {
|
export const tenderPlanList = (query: any): AxiosPromise<any> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/tender/biddingPlan/list',
|
url: '/tender/biddingPlan/list',
|
||||||
@ -121,3 +122,11 @@ export const editStatus = (query: any): AxiosPromise<any> => {
|
|||||||
data: query
|
data: query
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//获取审核状态
|
||||||
|
export const getApproval = (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/tender/tenderPlanLimitList/getVersionDetail',
|
||||||
|
method: 'get',
|
||||||
|
params: { versions: id }
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -288,3 +288,14 @@ h6 {
|
|||||||
.top-right-btn {
|
.top-right-btn {
|
||||||
margin-left: auto;
|
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>
|
<template>
|
||||||
<div class="upload-file">
|
<div class="upload-file">
|
||||||
<el-upload ref="fileUploadRef" multiple :action="realUploadUrl" :before-upload="handleBeforeUpload"
|
<el-upload
|
||||||
:file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
|
ref="fileUploadRef"
|
||||||
:on-success="handleUploadSuccess" :show-file-list="showFileList" :headers="headers" class="upload-file-uploader"
|
multiple
|
||||||
:list-type="isConstruction ? 'picture-card' : 'text'" :accept="accept" :drag="isDarg" :data="data"
|
:action="realUploadUrl"
|
||||||
:auto-upload="autoUpload" :on-change="handleChange" :on-remove="handleRemove" :method="method"
|
:before-upload="handleBeforeUpload"
|
||||||
:http-request="customUpload">
|
: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>
|
<slot>
|
||||||
<div>
|
<div>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
@ -24,10 +41,14 @@
|
|||||||
的文件
|
的文件
|
||||||
</div>
|
</div>
|
||||||
<!-- 文件列表 -->
|
<!-- 文件列表 -->
|
||||||
<transition-group v-if="!isConstruction && !isImportInfo"
|
<transition-group
|
||||||
class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul" @click.stop>
|
v-if="!isConstruction && !isImportInfo"
|
||||||
<li style="margin-top: 10px" v-for="(file, index) in fileList" :key="file.uid"
|
class="upload-file-list el-upload-list el-upload-list--text"
|
||||||
class="el-upload-list__item ele-upload-list__item-content">
|
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">
|
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
@ -180,13 +201,16 @@ watch(
|
|||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
watch(() => props.defaultFileList, () => {
|
watch(
|
||||||
|
() => props.defaultFileList,
|
||||||
|
() => {
|
||||||
if (props.defaultFileList.length === 0) return;
|
if (props.defaultFileList.length === 0) return;
|
||||||
props.defaultFileList.forEach((item: any) => {
|
props.defaultFileList.forEach((item: any) => {
|
||||||
fileList.value.push(item);
|
fileList.value.push(item);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
}, { deep: true, immediate: true });
|
{ deep: true, immediate: true }
|
||||||
|
);
|
||||||
// 上传前校检格式和大小
|
// 上传前校检格式和大小
|
||||||
const handleBeforeUpload = (file: any) => {
|
const handleBeforeUpload = (file: any) => {
|
||||||
// 校检文件类型
|
// 校检文件类型
|
||||||
|
@ -176,22 +176,26 @@ service.interceptors.response.use(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
// 通用下载方法
|
// 通用下载方法
|
||||||
export function download(url: string, params: any, fileName: string) {
|
export function download(url: string, params: any, fileName: string, isHeader?: boolean) {
|
||||||
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
return service.post(url, params, {
|
let data={
|
||||||
transformRequest: [
|
transformRequest: [
|
||||||
(params: any) => {
|
(params: any) => {
|
||||||
|
|
||||||
return tansParams(params);
|
return tansParams(params);
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
headers: isHeader?{'Content-Type': 'application/json'}:{ 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
}).then(async (resp: any) => {
|
}
|
||||||
|
if (isHeader) delete data.transformRequest;
|
||||||
|
return service
|
||||||
|
.post(url, params, data as any)
|
||||||
|
.then(async (resp: any) => {
|
||||||
const isLogin = blobValidate(resp);
|
const isLogin = blobValidate(resp);
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
console.log("🚀 ~ download ~ resp:", resp)
|
console.log('🚀 ~ download ~ resp:', resp);
|
||||||
const blob = new Blob([resp]);
|
const blob = new Blob([resp]);
|
||||||
FileSaver.saveAs(blob, fileName);
|
FileSaver.saveAs(blob, fileName);
|
||||||
} else {
|
} else {
|
||||||
@ -201,7 +205,8 @@ export function download(url: string, params: any, fileName: string) {
|
|||||||
ElMessage.error(errMsg);
|
ElMessage.error(errMsg);
|
||||||
}
|
}
|
||||||
downloadLoadingInstance.close();
|
downloadLoadingInstance.close();
|
||||||
}).catch((r: any) => {
|
})
|
||||||
|
.catch((r: any) => {
|
||||||
console.error(r);
|
console.error(r);
|
||||||
ElMessage.error('下载文件出现错误,请联系管理员!');
|
ElMessage.error('下载文件出现错误,请联系管理员!');
|
||||||
downloadLoadingInstance.close();
|
downloadLoadingInstance.close();
|
||||||
|
@ -58,7 +58,7 @@ import type { ComponentInternalInstance } from 'vue';
|
|||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { ElMessage, ElLoading } from 'element-plus';
|
import { ElMessage, ElLoading } from 'element-plus';
|
||||||
import { biddingGetUser, AddbiddingUser, biddingUserList } from '@/api/bidding/appointment';
|
import { biddingGetUser, AddbiddingUser, biddingUserList } from '@/api/bidding/appointment';
|
||||||
|
import { getProject } from '@/api/project/project';
|
||||||
// 获取当前实例
|
// 获取当前实例
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
@ -68,7 +68,7 @@ const currentProject = computed(() => userStore.selectedProject);
|
|||||||
// 专业字典数据
|
// 专业字典数据
|
||||||
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
||||||
const isDisabled = ref(false);
|
const isDisabled = ref(false);
|
||||||
|
const projectInfo = ref({}); //项目信息
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
id: null,
|
id: null,
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<!-- <el-form-item>
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="uploadRef"
|
ref="uploadRef"
|
||||||
class="upload-demo"
|
class="upload-demo"
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<el-button type="primary">导入excel</el-button>
|
<el-button type="primary">导入excel</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['bidding:biddingLimitList:export']">导出excel</el-button>
|
<el-button type="primary" @click="handleExport()" v-hasPermi="['bidding:biddingLimitList:export']">导出excel</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
{{ scope.row.price }}
|
{{ scope.row.price }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="price" label="操作" align="center">
|
<!-- <el-table-column prop="price" label="操作" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -89,7 +89,7 @@
|
|||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</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">
|
<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">
|
<el-card shadow="hover" class="max-w-6xl mx-auto rounded-xl overflow-hidden border-0" style="background-color: #ffffff">
|
||||||
<!-- 卡片头部:独立背景色+内边距+圆角 -->
|
<!-- 卡片头部:项目信息展示区 -->
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="bg-blue-50 px-6 py-4 rounded-t-xl mb-0">
|
<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>
|
<h3 class="el-card__header-title text-lg font-semibold text-blue-800">投标项目信息</h3>
|
||||||
<span>{{ currentProject.name }}</span>
|
<h4>{{ currentProject.name }}</h4>
|
||||||
<div style="margin-top: 10px">
|
<!-- 项目信息部分 -->
|
||||||
|
<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 @click="isDisabled = false" type="primary" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled">
|
||||||
点击编辑
|
点击编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 中标信息表单区域 -->
|
||||||
<el-form
|
<el-form
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
ref="listOfWinningBidsFormRef"
|
ref="listOfWinningBidsFormRef"
|
||||||
@ -24,100 +72,125 @@
|
|||||||
style="background-color: #ffffff"
|
style="background-color: #ffffff"
|
||||||
>
|
>
|
||||||
<el-row :gutter="32">
|
<el-row :gutter="32">
|
||||||
|
<!-- 是否中标(必填) -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="中标价(美元)" prop="winningBidOriginal" class="rounded-lg border border-gray-100 p-1 mb-5">
|
<el-form-item label="是否中标" prop="whetherBid" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||||
<el-input v-model.number="form.winningBidOriginal" type="number" placeholder="请输入中标价" @input="calculateWinningBid" />
|
<el-radio-group v-model="form.whetherBid">
|
||||||
</el-form-item>
|
<el-radio label="0" border>中标</el-radio>
|
||||||
</el-col>
|
<el-radio label="1" border>未中标</el-radio>
|
||||||
<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-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<!-- 中标价(必填,仅中标时显示) -->
|
||||||
<el-form-item label="所属主体" prop="subject" class="rounded-lg border border-gray-100 p-1 mb-5">
|
<el-col :span="12" v-if="form.whetherBid == '0'">
|
||||||
<el-input v-model="form.subject" placeholder="请输入所属主体" />
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<!-- 中标通知书(必填,仅中标时显示) -->
|
||||||
<el-form-item label="建设单位" prop="construction" class="rounded-lg border border-gray-100 p-1 mb-5">
|
<el-col :span="12" v-if="form.whetherBid == '0'">
|
||||||
<el-input v-model="form.construction" placeholder="请输入建设单位" />
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- 招标代理机构 -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="总造价" prop="totalCost" class="rounded-lg border border-gray-100 p-1 mb-5">
|
<el-form-item label="招标代理机构" prop="biddingAgency" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||||
<el-input v-model="form.totalCost" placeholder="请输入总造价" />
|
<el-input v-model="form.biddingAgency" placeholder="请输入招标代理机构" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- 招标人 -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="立项申请人" prop="projectApplicant" class="rounded-lg border border-gray-100 p-1 mb-5">
|
<el-form-item label="招标人" prop="tenderer" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||||
<el-input v-model="form.projectApplicant" placeholder="请输入立项申请人" />
|
<el-input v-model="form.tenderer" placeholder="请输入招标人" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12"></el-col>
|
||||||
|
<!-- 投标截止时间 -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="立项部门" prop="projectApplicantDept" 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-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
|
<el-date-picker
|
||||||
clearable
|
v-model="form.biddingDeadline"
|
||||||
v-model="form.projectApplicantTime"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
type="date"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD"
|
type="datetime"
|
||||||
value-format="YYYY-MM-DD"
|
placeholder="请选择投标截止时间"
|
||||||
placeholder="请选择立项申请日期"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- 开标时间 -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="项目编号" prop="projectNumbering" class="rounded-lg border border-gray-100 p-1 mb-5">
|
<el-form-item label="开标时间" prop="bidopeningTime" class="rounded-lg border border-gray-100 p-1 mb-5">
|
||||||
<el-input v-model="form.projectNumbering" placeholder="请输入项目编号" />
|
<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-form-item>
|
||||||
</el-col>
|
</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-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>
|
||||||
<!-- 操作按钮区域 -->
|
<!-- 操作按钮区域 -->
|
||||||
<el-row v-if="!isDisabled" class="mt-8">
|
<el-row v-if="!isDisabled" class="mt-8">
|
||||||
@ -142,172 +215,291 @@
|
|||||||
|
|
||||||
<script setup name="ListOfWinningBidsForm" lang="ts">
|
<script setup name="ListOfWinningBidsForm" lang="ts">
|
||||||
import { ref, reactive, toRefs, watch, onMounted, onUnmounted, getCurrentInstance, ComponentInternalInstance, computed } from 'vue';
|
import { ref, reactive, toRefs, watch, onMounted, onUnmounted, getCurrentInstance, ComponentInternalInstance, computed } from 'vue';
|
||||||
import { addListOfWinningBids, updateListOfWinningBids, listListOfWinningBids, getListOfWinningBids } from '@/api/bidding/listOfWinningBids';
|
import { addListOfWinningBids, updateListOfWinningBids, listListOfWinningBids } from '@/api/bidding/listOfWinningBids';
|
||||||
import { ListOfWinningBidsVO, ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types';
|
import { ListOfWinningBidsForm } from '@/api/bidding/listOfWinningBids/types';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { ElFormInstance, ElMessage } from 'element-plus';
|
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 { 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();
|
const userStore = useUserStoreHook();
|
||||||
// 当前选中项目(从store获取)
|
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
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 listOfWinningBidsFormRef = ref<ElFormInstance>();
|
||||||
// 加载状态
|
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
const isDisabled = ref(false);
|
const isDisabled = ref(false);
|
||||||
// 表单初始数据
|
const fileObj = ref({
|
||||||
const initFormData: ListOfWinningBidsForm = {
|
bidFile: undefined,
|
||||||
|
bidFileName: undefined
|
||||||
|
});
|
||||||
|
// 表单初始数据(新增招标相关参数)
|
||||||
|
const initFormData = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
projectStatus: undefined,
|
whetherBid: '1', // 是否中标:0=中标,1=未中标
|
||||||
projectName: undefined,
|
bidPrice: undefined, // 中标价(人民币)
|
||||||
winningBidOriginal: undefined,
|
bidFileId: undefined, // 中标通知书
|
||||||
exchangeRate: undefined,
|
biddingAgency: undefined, //招标代理机构
|
||||||
currency: undefined,
|
tenderer: undefined, //招标人
|
||||||
subject: undefined,
|
biddingDeadline: undefined, //投标截止时间
|
||||||
winningBid: undefined,
|
bidopeningTime: undefined, //开标时间
|
||||||
bidWinningDate: undefined,
|
projectOverview: undefined, //项目概况
|
||||||
bidDeposit: undefined,
|
constructionsite: undefined, //建设地点
|
||||||
whetherSendBack: undefined,
|
planDuration: undefined, //计划工期
|
||||||
construction: undefined,
|
answeringDeadlineTime: undefined, //答疑截止时间
|
||||||
totalCost: undefined,
|
clarifyDeadlineTime: undefined //澄清截止时间
|
||||||
projectApplicant: undefined,
|
|
||||||
projectApplicantDept: undefined,
|
|
||||||
projectApplicantTime: undefined,
|
|
||||||
processStatus: undefined,
|
|
||||||
projectNumbering: undefined
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表单数据与验证规则
|
// 表单数据与验证规则(核心:是否中标/中标价/中标通知书均设为必填,新增参数添加基础验证)
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: { ...initFormData } as ListOfWinningBidsForm,
|
form: { ...initFormData } as ListOfWinningBidsForm,
|
||||||
rules: {
|
rules: {
|
||||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
// 是否中标:必填
|
||||||
projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
whetherBid: [{ required: true, message: '请选择是否中标', trigger: 'change' }],
|
||||||
winningBidOriginal: [{ required: true, message: '请输入原始中标价', trigger: 'blur' }],
|
// 中标价:仅中标时必填,且为正数
|
||||||
exchangeRate: [
|
bidPrice: [
|
||||||
{ required: true, message: '请输入汇率', trigger: 'blur' },
|
{
|
||||||
{ type: 'number', min: 0.001, message: '汇率需大于0', trigger: 'blur' }
|
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' }],
|
bidFileId: [
|
||||||
winningBid: [{ required: true, message: '请输入中标价', trigger: 'blur' }],
|
{
|
||||||
bidWinningDate: [{ required: true, message: '请选择中标日期', trigger: 'blur' }],
|
required: true,
|
||||||
projectNumbering: [{ required: true, message: '请输入项目编号', trigger: 'blur' }]
|
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>
|
} as Record<string, any>
|
||||||
});
|
});
|
||||||
|
|
||||||
// 解构响应式数据
|
|
||||||
const { form, rules } = toRefs(data);
|
const { form, rules } = toRefs(data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算人民币中标价
|
* 字典标签转换(项目类型/阶段)
|
||||||
* 显式触发的计算函数,确保执行时机可靠
|
|
||||||
*/
|
*/
|
||||||
const calculateWinningBid = () => {
|
const getDictLabel = (dictList: any[], value: any) => {
|
||||||
// 确保数据类型正确
|
if (!dictList || !value) return '';
|
||||||
const dollarAmount = Number(form.value.winningBidOriginal);
|
const dictItem = dictList.find((item) => item.value === value);
|
||||||
const rate = Number(form.value.exchangeRate);
|
return dictItem ? dictItem.label : '';
|
||||||
|
|
||||||
// 验证输入有效性
|
|
||||||
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 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 () => {
|
const initData = async () => {
|
||||||
try {
|
try {
|
||||||
if (currentProject.value?.id) {
|
if (currentProject.value?.id) {
|
||||||
const res = await listListOfWinningBids({ projectId: currentProject.value.id });
|
const res = await listListOfWinningBids({ projectId: currentProject.value.id });
|
||||||
if (res.code == 200) {
|
console.log(res);
|
||||||
console.log(res.data);
|
if (res.code === 200) {
|
||||||
resetForm();
|
resetForm();
|
||||||
if (!res.data) {
|
if (res.data) {
|
||||||
isDisabled.value = false;
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
Object.assign(form.value, res.data);
|
Object.assign(form.value, res.data);
|
||||||
}
|
|
||||||
isDisabled.value = true;
|
isDisabled.value = true;
|
||||||
|
} else {
|
||||||
|
isDisabled.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// ElMessage.error('初始化数据失败');
|
console.error('初始化中标数据失败:', error);
|
||||||
|
ElMessage.error('初始化数据失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交表单
|
* 提交表单(含项目信息更新+中标信息提交)
|
||||||
*/
|
*/
|
||||||
const submitForm = () => {
|
const submitForm = async () => {
|
||||||
listOfWinningBidsFormRef.value?.validate(async (valid: boolean) => {
|
listOfWinningBidsFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
try {
|
try {
|
||||||
// 提交前确保计算正确
|
// 1. 同步项目ID和名称
|
||||||
calculateWinningBid();
|
|
||||||
form.value.projectId = currentProject.value?.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;
|
isDisabled.value = true;
|
||||||
ElMessage.success('提交成功');
|
ElMessage.success('提交成功');
|
||||||
} catch (error) {
|
|
||||||
ElMessage.error('提交失败,请重试');
|
|
||||||
console.error('提交表单失败:', error);
|
|
||||||
} finally {
|
} finally {
|
||||||
buttonLoading.value = false;
|
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 = () => {
|
const resetForm = () => {
|
||||||
form.value = { ...initFormData, projectId: currentProject.value?.id };
|
form.value = { ...initFormData, projectId: currentProject.value?.id };
|
||||||
listOfWinningBidsFormRef.value?.resetFields();
|
listOfWinningBidsFormRef.value?.resetFields();
|
||||||
|
getProjectDetail();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听项目ID变化 - 重新初始化数据
|
* 监听项目ID变化,重新初始化数据
|
||||||
*/
|
*/
|
||||||
const projectIdWatcher = watch(
|
const projectIdWatcher = watch(
|
||||||
() => currentProject.value?.id,
|
() => currentProject.value?.id,
|
||||||
(newId) => {
|
(newId) => {
|
||||||
if (newId) {
|
if (newId) {
|
||||||
form.value.projectId = newId;
|
form.value.projectId = newId;
|
||||||
|
getProjectDetail();
|
||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 页面挂载时初始化
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getProjectDetail();
|
||||||
initData();
|
initData();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 页面卸载时清除监听
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
projectIdWatcher();
|
projectIdWatcher();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 全局背景色:柔和灰色,区分页面与卡片 */
|
/* 全局背景色 */
|
||||||
.bg-gray-50 {
|
.bg-gray-50 {
|
||||||
background-color: #f9fafb;
|
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 {
|
.el-form-item {
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
@ -316,30 +508,51 @@ onUnmounted(() => {
|
|||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 输入框/选择器统一圆角 */
|
/* 响应式网格布局适配 */
|
||||||
.el-input__wrapper,
|
@media (max-width: 767px) {
|
||||||
.el-date-editor .el-input__wrapper {
|
.grid {
|
||||||
border-radius: 6px !important;
|
display: grid;
|
||||||
|
}
|
||||||
|
.grid-cols-1 {
|
||||||
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 卡片头部文字对齐优化 */
|
@media (min-width: 768px) and (max-width: 1023px) {
|
||||||
.el-card__header-title {
|
.md\:grid-cols-2 {
|
||||||
display: flex;
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
align-items: center;
|
}
|
||||||
height: 100%;
|
.md\:col-span-2 {
|
||||||
|
grid-column: span 2 / span 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 按钮间距与过渡效果 */
|
@media (min-width: 1024px) {
|
||||||
.el-button {
|
.lg\:grid-cols-3 {
|
||||||
transition: all 0.2s ease;
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
.lg\:col-span-3 {
|
||||||
|
grid-column: span 3 / span 3;
|
||||||
}
|
}
|
||||||
.el-button:hover {
|
|
||||||
transform: translateY(-1px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 只读输入框样式优化(区分可编辑状态) */
|
/* 间距样式 */
|
||||||
.el-input--readonly .el-input__wrapper {
|
.gap-6 {
|
||||||
background-color: #f9fafb;
|
gap: 1.5rem;
|
||||||
cursor: not-allowed;
|
}
|
||||||
|
.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>
|
</style>
|
||||||
|
@ -36,7 +36,10 @@
|
|||||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:billofquantitiesLimitList:export']">导出excel</el-button>
|
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:billofquantitiesLimitList:export']">导出excel</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -134,7 +137,12 @@ const getVersionNums = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
//选择版本号
|
//选择版本号
|
||||||
const changeVersions = () => {
|
const changeVersions = (val) => {
|
||||||
|
options.value.forEach((item) => {
|
||||||
|
if (item.versions == val) {
|
||||||
|
reviewStatus.value = item.status;
|
||||||
|
}
|
||||||
|
});
|
||||||
getSheetName();
|
getSheetName();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
<el-form-item label="合同金额" prop="amount">
|
<el-form-item label="合同金额" prop="amount">
|
||||||
<el-input v-model="queryParams.amount" placeholder="请输入合同金额" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.amount" placeholder="请输入合同金额" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- <el-form-item label="招标Id" prop="tenderId">
|
<!-- <el-form-item label="招标Id" prop="tenderId">
|
||||||
<el-input v-model="queryParams.tenderId" placeholder="请输入招标Id" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.tenderId" placeholder="请输入招标Id" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
@ -66,8 +67,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="供应商" align="center" prop="contractSupplier" />
|
<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="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="招标Id" align="center" prop="tenderId" /> -->
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<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">
|
||||||
|
@ -62,10 +62,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="业主单位" align="center" prop="contractOwner" />
|
<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="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" 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">
|
<template #default="scope">
|
||||||
<!-- <el-tooltip content="修改" placement="top">
|
<!-- <el-tooltip content="修改" placement="top">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<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)"
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['ctr:incomeContract:remove']"></el-button>
|
v-hasPermi="['ctr:incomeContract:remove']"></el-button>
|
||||||
</el-tooltip> -->
|
</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-tooltip content="查看附件列表" placement="top">
|
||||||
<el-button link type="primary" icon="View" @click="handleShowFileList(scope.row)">查看附件列表</el-button>
|
<el-button link type="primary" icon="View" @click="handleShowFileList(scope.row)">查看附件列表</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -284,6 +292,7 @@ const handleShowFileList = async (row: IncomeContractVO) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
@ -107,20 +107,16 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预付款比例(%)" prop="advancePayRatio">
|
<el-form-item label="预付款比例(%)" prop="advancePayRatio">
|
||||||
<el-input v-model="form.advancePayRatio" placeholder="请输入预付款比例"
|
<el-input-number v-model="form.advancePayRatio" :max="100" :min="0" />
|
||||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="尾款比例(%)" prop="balancePayRatio">
|
<el-form-item label="尾款比例(%)" prop="balancePayRatio">
|
||||||
<el-input v-model="form.balancePayRatio" placeholder="请输入尾款比例"
|
<el-input-number v-model="form.balancePayRatio" :max="100" :min="0" />
|
||||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="质保金比例(%)" prop="assuranceDepositRatio;">
|
<el-form-item label="质保金比例(%)" prop="assuranceDepositRatio">
|
||||||
<el-input v-model="form.assuranceDepositRatio" placeholder="请输入质保金比例"
|
<el-input-number v-model="form.assuranceDepositRatio" :max="100" :min="0" />
|
||||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="付款比例(%)" prop="payRatio">
|
<el-form-item label="付款比例(%)" prop="payRatio">
|
||||||
<el-input v-model="form.payRatio" placeholder="请输入付款比例"
|
<el-input-number v-model="payRatioComputed" disabled />
|
||||||
oninput="value=value.replace(/[^0-9.]/g,'').replace(/\.{2,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div>
|
<div>
|
||||||
@ -198,7 +194,7 @@ const payMentRules = {
|
|||||||
advancePayRatio: [{ required: true, message: '请输入预付款比例', trigger: 'blur' }],
|
advancePayRatio: [{ required: true, message: '请输入预付款比例', trigger: 'blur' }],
|
||||||
balancePayRatio: [{ required: true, message: '请输入尾款比例', trigger: 'blur' }],
|
balancePayRatio: [{ required: true, message: '请输入尾款比例', trigger: 'blur' }],
|
||||||
assuranceDepositRatio: [{ required: true, message: '请输入质保金比例', trigger: 'blur' }],
|
assuranceDepositRatio: [{ required: true, message: '请输入质保金比例', trigger: 'blur' }],
|
||||||
payRatio: [{ required: true, message: '请输入付款比例', trigger: 'blur' }],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const project = computed(() => {
|
const project = computed(() => {
|
||||||
@ -207,6 +203,16 @@ const project = computed(() => {
|
|||||||
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) => {
|
const checkContractType = (type) => {
|
||||||
contract_type.value = type;
|
contract_type.value = type;
|
||||||
form.value.contract_type = type;
|
form.value.contract_type = type;
|
||||||
@ -282,10 +288,16 @@ const resetForm = () => {
|
|||||||
}, 0);
|
}, 0);
|
||||||
};
|
};
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
console.log(payMentRef.value);
|
|
||||||
|
|
||||||
await payMentRef.value.validate(async (valid) => {
|
await payMentRef.value.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
|
if (payRatioComputed.value < 0) {
|
||||||
|
|
||||||
|
ElMessage.error('四项付款比例之和必须等于100%');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
form.value.payRatio = payRatioComputed.value;
|
||||||
|
|
||||||
// 提交付款信息逻辑
|
// 提交付款信息逻辑
|
||||||
console.log('提交付款信息', form.value, fileList.value);
|
console.log('提交付款信息', form.value, fileList.value);
|
||||||
// 这里可以调用API提交数据
|
// 这里可以调用API提交数据
|
||||||
@ -304,6 +316,7 @@ const submitForm = async () => {
|
|||||||
}
|
}
|
||||||
resetForm();
|
resetForm();
|
||||||
ElMessage.success('合同提交成功');
|
ElMessage.success('合同提交成功');
|
||||||
|
active.value = 0; // 重置步骤
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('请填写完整的付款信息');
|
ElMessage.error('请填写完整的付款信息');
|
||||||
}
|
}
|
||||||
@ -358,9 +371,10 @@ const handleChoose = async () => {
|
|||||||
const handleChooseData = (row) => {
|
const handleChooseData = (row) => {
|
||||||
form.value.tenderId = row.id;
|
form.value.tenderId = row.id;
|
||||||
form.value.name = row.name;
|
form.value.name = row.name;
|
||||||
form.value.contractPrice = row.contractPrice;
|
// form.value.contractPrice = row.contractPrice;
|
||||||
form.value.content = row.content;
|
form.value.content = row.content;
|
||||||
form.value.winningBidder = row.winningBidder;
|
form.value.contractSupplier = row.winningBidder;
|
||||||
|
form.value.amount = row.contractPrice;
|
||||||
dialogVisible.value = false;
|
dialogVisible.value = false;
|
||||||
};
|
};
|
||||||
watch(form, (val) => {
|
watch(form, (val) => {
|
||||||
|
@ -63,8 +63,7 @@ const props = defineProps({
|
|||||||
// 计算百分比变化的样式类(红色或绿色)
|
// 计算百分比变化的样式类(红色或绿色)
|
||||||
const percentageClass = computed(() => {
|
const percentageClass = computed(() => {
|
||||||
// 检查变化值是否为正数
|
// 检查变化值是否为正数
|
||||||
const isPositive = props.percentageChange.startsWith('+') ||
|
const isPositive = props.percentageChange.startsWith('+') || (!props.percentageChange.startsWith('-') && props.percentageChange !== '0.00%');
|
||||||
(!props.percentageChange.startsWith('-') && props.percentageChange !== '0.00%');
|
|
||||||
return isPositive ? 'green' : 'red';
|
return isPositive ? 'green' : 'red';
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,26 +5,9 @@
|
|||||||
|
|
||||||
<!-- 数值区域 -->
|
<!-- 数值区域 -->
|
||||||
<div class="stat-card__value-container">
|
<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>
|
<span class="stat-card__unit">{{ unit }}</span>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -78,6 +61,10 @@ const props = defineProps({
|
|||||||
customStyles: {
|
customStyles: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
|
},
|
||||||
|
showIcon: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -103,20 +90,22 @@ const trendText = computed(() => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 20px;
|
padding: 35px 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid rgba(29, 214, 255, 0.1);
|
border: 1px solid rgba(29, 214, 255, 0.1);
|
||||||
border-radius: 4px; // 增加轻微圆角,提升视觉效果
|
border-radius: 4px; // 增加轻微圆角,提升视觉效果
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #8FABBF;
|
color: #8fabbf;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__value-container {
|
&__value-container {
|
||||||
display: flex;
|
// display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
|
// align-items: center;
|
||||||
|
// flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__value {
|
&__value {
|
||||||
@ -128,7 +117,7 @@ const trendText = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__unit {
|
&__unit {
|
||||||
color: #8FABBF;
|
color: #8fabbf;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +140,7 @@ const trendText = computed(() => {
|
|||||||
|
|
||||||
&__trend-text {
|
&__trend-text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #8FABBF;
|
color: #8fabbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__badge {
|
&__badge {
|
||||||
|
@ -1,45 +1,162 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- 材料成本展示框 -->
|
||||||
<div class="bottom_box">
|
<div class="bottom_box">
|
||||||
<div class="bottom_box_title">收入合同</div>
|
<div class="bottom_box_title">材料成本</div>
|
||||||
<div>
|
|
||||||
<span class="bottom_box_number">205,805.17</span>
|
|
||||||
<span>万元</span>
|
|
||||||
</div>
|
|
||||||
<div class="bottom_box_bottom">
|
<div class="bottom_box_bottom">
|
||||||
<el-progress :percentage="50" color="rgba(255, 147, 42, 1)" />
|
<el-progress :percentage="materialProgressPercent" color="rgba(255, 147, 42, 1)"
|
||||||
|
:format="(percent) => `${percent.toFixed(1)}%`" />
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom_box_text">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.bottom_box {
|
.bottom_box {
|
||||||
width: 225px;
|
width: 225px;
|
||||||
height: 147px;
|
height: auto;
|
||||||
height: 100%;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
gap: 8px;
|
||||||
|
background: rgba(12, 24, 46, 0.8);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom_box_title {
|
||||||
|
color: rgba(143, 171, 191, 1);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom_box_title,
|
|
||||||
.bottom_box_text {
|
.bottom_box_text {
|
||||||
color: rgba(143, 171, 191, 1);
|
color: rgba(143, 171, 191, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom_box_number {
|
.bottom_box_bottom {
|
||||||
font-size: 24px;
|
width: 100%;
|
||||||
color: #fff;
|
height: 8px;
|
||||||
line-height: 30px;
|
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>
|
</style>
|
@ -1,146 +1,160 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="centerPage">
|
<div class="centerPage">
|
||||||
<div>
|
<div>
|
||||||
<div style="height: 147px;width: 100%;display: flex;justify-content: space-between;">
|
<div style="height: 147px; width: 100%; display: flex; justify-content: space-between">
|
||||||
<!-- <div class="top_box">
|
<!-- 收入合同:保持万元显示 -->
|
||||||
<div class="top_box_title">收入合同</div>
|
<RevenueContractCard title="收入合同" :value="formatToTenThousand(data.incomeTotalAmount, 'tenThousand')" />
|
||||||
<div>
|
<!-- 支出合同:保持万元显示 -->
|
||||||
<span class="top_box_number">205,805.17</span>
|
<RevenueContractCard title="支出合同" :value="formatToTenThousand(data.expensesTotalAmount, 'tenThousand')" />
|
||||||
<span>万元</span>
|
<!-- 合同利润:保持万元显示 -->
|
||||||
</div>
|
<RevenueContractCard title="合同利润" :value="formatToTenThousand(data.profitAmount, 'tenThousand')" />
|
||||||
<div class="top_box_bottom">
|
<!-- 工程变更:改为百分比显示 -->
|
||||||
<div>
|
<RevenueContractCard title="工程变更" :value="formatToTenThousand(data.changeAmount, 'percentage')" unit="" />
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="centerPage_map">
|
<div class="centerPage_map">
|
||||||
<div ref="mapRef" class="map-container" style="width: 100%; height: 100%" />
|
<div ref="mapRef" class="map-container" style="width: 100%; height: 100%" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="height: 147px;width: 100%;display: flex;justify-content: space-between;">
|
<div style="height: 147px; width: 100%; display: flex; justify-content: space-between">
|
||||||
<!-- <div class="bottom_box">
|
<bottomboxconpoent />
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// import { getPowerStationOverview } from '@/api/large';
|
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import china from '@/assets/china.json';
|
import china from '@/assets/china.json';
|
||||||
import RevenueContractCard from './RevenueContractCard.vue';
|
import RevenueContractCard from './RevenueContractCard.vue';
|
||||||
import bottomboxconpoent from './bottomboxconpoent.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);
|
const mapRef = ref<HTMLDivElement | null>(null);
|
||||||
// ECharts实例
|
|
||||||
let myChart: any = null;
|
let myChart: any = null;
|
||||||
|
const projectData = ref<any[]>([]); // 存储项目地理信息数据
|
||||||
|
|
||||||
// 响应窗口大小变化
|
// 接口请求:获取合同数据
|
||||||
const handleResize = () => {
|
const getContractData = async () => {
|
||||||
if (myChart) {
|
try {
|
||||||
myChart.resize();
|
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 = () => {
|
const initEcharts = () => {
|
||||||
if (!mapRef.value) {
|
if (!mapRef.value || projectData.value.length === 0) {
|
||||||
console.error('未找到地图容器元素');
|
console.error('未找到地图容器或项目数据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册地图
|
|
||||||
echarts.registerMap('china', china as any);
|
echarts.registerMap('china', china as any);
|
||||||
|
|
||||||
// 地图数据
|
// 从接口数据生成散点数据
|
||||||
const mapData: any = [{ name: '田东县', value: 1, itemStyle: { color: '#fff' } }];
|
const scatterData = projectData.value.map((item) => ({
|
||||||
|
name: item.projectName,
|
||||||
// 散点数据
|
value: [parseFloat(item.lng), parseFloat(item.lat)], // 转换为数值类型
|
||||||
// 散点数据 - 使用图片标记并调整名称位置
|
shortName: item.shortName,
|
||||||
const scatterData: any[] = [
|
projectSite: item.projectSite,
|
||||||
{
|
|
||||||
name: '田东光伏智慧生态工地开发项目',
|
|
||||||
value: [107.15, 23.63],
|
|
||||||
// 使用图片作为标记(注意:需替换为你的图片实际路径)
|
|
||||||
symbol: 'diamond',
|
symbol: 'diamond',
|
||||||
// 标记颜色
|
itemStyle: { color: '#0166d6' },
|
||||||
itemStyle: {
|
|
||||||
color: '#0166d6'
|
|
||||||
},
|
|
||||||
// 图片标记大小(宽, 高)
|
|
||||||
symbolSize: [20, 20],
|
symbolSize: [20, 20],
|
||||||
// 名称样式设置
|
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
formatter: '{b}', // 显示名称
|
formatter: '{b}', // 显示项目名称
|
||||||
position: 'top', // 名称在图片上方
|
position: 'top',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
// 可选:添加文字背景以增强可读性
|
|
||||||
backgroundColor: 'rgba(3, 26, 52, 0.7)',
|
backgroundColor: 'rgba(3, 26, 52, 0.7)',
|
||||||
padding: [3, 6],
|
padding: [3, 6],
|
||||||
borderRadius: 3
|
borderRadius: 3
|
||||||
}
|
}
|
||||||
}
|
}));
|
||||||
];
|
|
||||||
// 初始化新实例,强制清除缓存
|
|
||||||
myChart = echarts.init(mapRef.value, null, {
|
myChart = echarts.init(mapRef.value, null, {
|
||||||
renderer: 'canvas', // 明确指定渲染器
|
renderer: 'canvas',
|
||||||
useDirtyRect: false // 禁用脏矩形渲染,避免样式缓存
|
useDirtyRect: false
|
||||||
});
|
});
|
||||||
// 配置项
|
|
||||||
const option: any = {
|
const option: any = {
|
||||||
roam: true, // 关键配置:允许鼠标滚轮缩放和拖拽平移
|
roam: true, // 允许缩放和平移
|
||||||
geo: {
|
geo: {
|
||||||
type: 'map',
|
type: 'map',
|
||||||
map: 'china',
|
map: 'china',
|
||||||
zoom: 5,
|
zoom: 4, // 调整初始缩放级别
|
||||||
center: [107.15, 23.63],
|
center: [108.95, 34.27], // 中国中心位置经纬度
|
||||||
label: {
|
label: { show: false, color: '#fff' },
|
||||||
show: false,
|
|
||||||
color: '#fff'
|
|
||||||
},
|
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
areaColor: '#031a34', // 地图区域底色
|
areaColor: '#031a34',
|
||||||
borderColor: '#1e3a6e', // 区域边框颜色
|
borderColor: '#1e3a6e',
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'item',
|
||||||
formatter: function (params: any) {
|
formatter: (params: any) => {
|
||||||
return params.name + (params.value ? `:${params.value}` : '');
|
// 自定义提示框内容,显示更多项目信息
|
||||||
|
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: [
|
series: [
|
||||||
@ -148,47 +162,39 @@ const initEcharts = () => {
|
|||||||
type: 'map',
|
type: 'map',
|
||||||
map: 'china',
|
map: 'china',
|
||||||
geoIndex: 0,
|
geoIndex: 0,
|
||||||
// 关键:在series级别定义emphasis,优先级最高
|
|
||||||
emphasis: {
|
emphasis: {
|
||||||
areaColor: '#fff', // 强制设置hover颜色
|
areaColor: '#fff',
|
||||||
label: {
|
label: { show: true, color: '#fff' },
|
||||||
show: true,
|
itemStyle: { areaColor: '#02417e' }
|
||||||
color: '#fff'
|
|
||||||
},
|
},
|
||||||
itemStyle: {
|
select: { itemStyle: { areaColor: '#02417e' } },
|
||||||
areaColor: '#02417e' // 重复设置确保生效
|
data: [] // 可以留空,或根据需要添加区域数据
|
||||||
}
|
|
||||||
},
|
|
||||||
// 确保没有使用默认样式
|
|
||||||
select: {
|
|
||||||
itemStyle: {
|
|
||||||
areaColor: '#02417e'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: mapData
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'scatter',
|
type: 'scatter',
|
||||||
coordinateSystem: 'geo',
|
coordinateSystem: 'geo',
|
||||||
data: scatterData
|
data: scatterData,
|
||||||
|
emphasis: {
|
||||||
|
scale: true, // 鼠标悬停时放大
|
||||||
|
symbolSize: [25, 25]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
// 设置配置项
|
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 组件挂载时初始化
|
// 组件生命周期
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 确保DOM渲染完成
|
nextTick(async () => {
|
||||||
nextTick(() => {
|
// 先获取合同数据和项目地理数据,再初始化地图
|
||||||
|
await Promise.all([getContractData(), getProjectGisData()]);
|
||||||
initEcharts();
|
initEcharts();
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener('resize', handleResize);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 组件卸载时清理
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener('resize', handleResize);
|
window.removeEventListener('resize', handleResize);
|
||||||
if (myChart) {
|
if (myChart) {
|
||||||
@ -196,15 +202,6 @@ onUnmounted(() => {
|
|||||||
myChart = null;
|
myChart = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// const getDataList = () => {
|
|
||||||
// getPowerStationOverview().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// data.value = res.data;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
// getDataList();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@ -215,14 +212,11 @@ onUnmounted(() => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 10px 10px 10px;
|
padding: 0 10px 10px 10px;
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.centerPage_map {
|
.centerPage_map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60%;
|
height: 60%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,56 +1,300 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="leftPage">
|
<div class="leftPage">
|
||||||
<!-- -->
|
|
||||||
<div class="kpi_box">
|
<div class="kpi_box">
|
||||||
<TitleComponent :title="'支付KPI'" style="margin-bottom: 20px;"/>
|
<TitleComponent :title="'支付KPI'" style="margin-bottom: 20px" />
|
||||||
<ProgressComponent
|
<ProgressComponent title="应收账款" :value="formatCurrency(incomeData.planAmount)"
|
||||||
title="应收账款"
|
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
|
||||||
value="123,456.78"
|
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
|
||||||
percentageChange="+25.30%"
|
progressColor="rgba(255, 77, 79, 1)" />
|
||||||
progressPercentage="75"
|
<ProgressComponent title="应付账款" :value="formatCurrency(expensesData.planAmount)"
|
||||||
progressColor="rgba(255, 77, 79, 1)"
|
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
|
||||||
/>
|
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
|
||||||
<ProgressComponent
|
progressColor="rgba(29, 214, 255, 1)" />
|
||||||
title="应付账款"
|
<ProgressComponent title="本月付款" :value="formatCurrency(expensesData.actualAmount)"
|
||||||
value="123,456.78"
|
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
|
||||||
percentageChange="+25.30%"
|
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
|
||||||
progressPercentage="25"
|
progressColor="rgba(0, 227, 150, 1)" />
|
||||||
progressColor="rgba(29, 214, 255, 1)"
|
<ProgressComponent title="本月收款" :value="formatCurrency(incomeData.actualAmount)"
|
||||||
/>
|
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
|
||||||
<ProgressComponent
|
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
|
||||||
title="本月付款"
|
progressColor="rgba(255, 147, 42, 1)" />
|
||||||
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)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="contract_box">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, computed, toRefs, getCurrentInstance, nextTick } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
// import echarts from 'echarts';
|
|
||||||
import TitleComponent from './TitleComponent.vue';
|
import TitleComponent from './TitleComponent.vue';
|
||||||
import ProgressComponent from './ProgressComponent.vue';
|
import ProgressComponent from './ProgressComponent.vue';
|
||||||
import EchartBox from '@/components/EchartBox/index.vue';
|
import EchartBox from '@/components/EchartBox/index.vue';
|
||||||
import { getBarOptions2 } from './optionList';
|
import { incomePay, expensesPay, incomeAnalyze, expensesAnalyze } from '@/api/largeScreen/index';
|
||||||
const barOption = ref();
|
|
||||||
const getCapitalData = (data) => {
|
// 初始化数据容器
|
||||||
barOption.value = getBarOptions2();
|
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(() => {
|
const activeBtnStyle = {
|
||||||
getCapitalData();
|
...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>
|
</script>
|
||||||
|
|
||||||
@ -58,13 +302,23 @@ onMounted(() => {
|
|||||||
.leftPage {
|
.leftPage {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.kpi_box {
|
.kpi_box {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contract_box {
|
.contract_box {
|
||||||
height: 35vh;
|
height: 33vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column; // 按钮区和图表区垂直排列
|
||||||
}
|
}
|
||||||
.kpi_box,.contract_box {
|
|
||||||
|
.chart-container {
|
||||||
|
height: 28vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi_box,
|
||||||
|
.contract_box {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid rgba(29, 214, 255, 0.3);
|
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 maxData = Math.max(...lineData.line1.flat());
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
|
|
||||||
backgroundColor: '',
|
backgroundColor: '',
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
@ -312,7 +313,7 @@ export const getLineOption = (lineData: any) => {
|
|||||||
axisLabel: {
|
axisLabel: {
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#fff'
|
color: '#fff'
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
@ -698,17 +699,31 @@ export const getBarOptions = (data: any) => {
|
|||||||
backgroundColor: '',
|
backgroundColor: '',
|
||||||
grid: {
|
grid: {
|
||||||
left: '8%',
|
left: '8%',
|
||||||
top: '4%',
|
top: '10%', // 顶部留一点空间给 legend
|
||||||
bottom: '8%',
|
bottom: '8%',
|
||||||
right: '2%'
|
right: '2%'
|
||||||
},
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['现金流入', '现金流出'], // 与 series.name 对应
|
||||||
|
top: '0%',
|
||||||
|
textStyle: { color: '#fff', fontSize: 12 }
|
||||||
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
show: true,
|
show: true,
|
||||||
backgroundColor: '',
|
backgroundColor: '',
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
formatter: '{b0}:{c0}万元',
|
// formatter: '{b0}:{c0}万元',
|
||||||
|
formatter: (params: any) => {
|
||||||
|
// params 是数组,对应每条柱子
|
||||||
|
return params
|
||||||
|
.map((p: any) => `${p.seriesName}:${p.value} 万元`)
|
||||||
|
.join('<br/>');
|
||||||
|
},
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#fff'
|
color: '#fff'
|
||||||
|
},
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow',
|
||||||
}
|
}
|
||||||
// borderColor: 'rgba(252, 217, 18, 1)'
|
// borderColor: 'rgba(252, 217, 18, 1)'
|
||||||
},
|
},
|
||||||
@ -779,6 +794,7 @@ export const getBarOptions = (data: any) => {
|
|||||||
// ],
|
// ],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
name: '现金流入',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: data.value[0],
|
data: data.value[0],
|
||||||
// stack: '合并',
|
// stack: '合并',
|
||||||
@ -817,6 +833,7 @@ export const getBarOptions = (data: any) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
name: '现金流出',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: data.value[1],
|
data: data.value[1],
|
||||||
// stack: '合并',
|
// stack: '合并',
|
||||||
@ -846,12 +863,12 @@ export const getBarOptions = (data: any) => {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
show: false,
|
show: true,
|
||||||
formatter: '{c}',
|
formatter: '{c}',
|
||||||
position: 'top',
|
position: 'top',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontSize: 10
|
fontSize: 10,
|
||||||
// padding: 5
|
padding: 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -879,7 +896,9 @@ export const getBarOptions2 = (data: any) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item'
|
trigger: 'item',
|
||||||
|
show: true
|
||||||
|
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
top: '5%',
|
top: '5%',
|
||||||
@ -907,7 +926,7 @@ export const getBarOptions2 = (data: any) => {
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
{ value: 3, name: '100万一下' },
|
{ value: 3, name: '100万以下' },
|
||||||
{ value: 4, name: '100-500万' },
|
{ value: 4, name: '100-500万' },
|
||||||
{ value: 5, name: '500-1000万' },
|
{ value: 5, name: '500-1000万' },
|
||||||
{ value: 4, name: '1000万以上' },
|
{ value: 4, name: '1000万以上' },
|
||||||
|
@ -11,17 +11,17 @@
|
|||||||
<div class="inflowData">
|
<div class="inflowData">
|
||||||
<div class="inflow">
|
<div class="inflow">
|
||||||
<div class="title">现金流入</div>
|
<div class="title">现金流入</div>
|
||||||
<div class="number">1000000</div>
|
<div class="number">{{ bigDataObj.incomeCash }}</div>
|
||||||
<div class="unit">万元</div>
|
<div class="unit">万元</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="inflow">
|
<div class="inflow">
|
||||||
<div class="title">现金流出</div>
|
<div class="title">现金流出</div>
|
||||||
<div class="number">1000000</div>
|
<div class="number">{{ bigDataObj.expensesCash }}</div>
|
||||||
<div class="unit">万元</div>
|
<div class="unit">万元</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="inflow">
|
<div class="inflow">
|
||||||
<div class="title">净现金流</div>
|
<div class="title">净现金流</div>
|
||||||
<div class="number">1000000</div>
|
<div class="number">{{ bigDataObj.profitCash }}</div>
|
||||||
<div class="unit">万元</div>
|
<div class="unit">万元</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<div class="title">项目进度</div>
|
<div class="title">项目进度</div>
|
||||||
<div class="number">100%</div>
|
<div class="number">100%</div>
|
||||||
</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" />
|
progressColor="rgba(29, 214, 255, 1)" :isShowPrice="false" class="progress_text" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -45,45 +45,63 @@ import TitleComponent from './TitleComponent.vue';
|
|||||||
import EchartBox from '@/components/EchartBox/index.vue';
|
import EchartBox from '@/components/EchartBox/index.vue';
|
||||||
import { getLineOption, getBarOptions } from './optionList';
|
import { getLineOption, getBarOptions } from './optionList';
|
||||||
import ProgressComponent from './ProgressComponent.vue';
|
import ProgressComponent from './ProgressComponent.vue';
|
||||||
|
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen/index';
|
||||||
|
|
||||||
const lineOption = ref();
|
const lineOption = ref();
|
||||||
const barOption = 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 = {
|
const lineData = {
|
||||||
xLabel: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
xLabel: month,
|
||||||
line1: [
|
line1: [
|
||||||
[100, 200, 150, 300, 250, 350, 400, 350, 450, 500, 400, 550],
|
income,
|
||||||
[220, 250, 230, 280, 270, 300, 350, 320, 380, 400, 450, 500],
|
expenses,
|
||||||
[300, 350, 320, 380, 400, 450, 500, 480, 520, 550, 600, 650]
|
profit
|
||||||
]
|
]
|
||||||
|
|
||||||
// line2: ['20', '50', '12', '65', '30', '60']
|
// line2: ['20', '50', '12', '65', '30', '60']
|
||||||
};
|
};
|
||||||
lineOption.value = getLineOption(lineData);
|
lineOption.value = getLineOption(lineData);
|
||||||
};
|
};
|
||||||
const getTurnoverList = (data?: any) => {
|
const getTurnoverList = async () => {
|
||||||
// const xData = data.map((item) => item.time);
|
// const xData = data.map((item) => item.time);
|
||||||
// const yData = data.map((item) => {
|
// const yData = data.map((item) => {
|
||||||
// // 先将content转换为数字,再调用toFixed
|
// // 先将content转换为数字,再调用toFixed
|
||||||
// const num = Number(item.content);
|
// const num = Number(item.content);
|
||||||
// return isNaN(num) ? 0 : Number(num.toFixed(2));
|
// 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 = {
|
const barData = {
|
||||||
name: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
name: month,
|
||||||
value: [
|
value: [
|
||||||
[2, 5, 15, 30, 25, 35, 40, 35, 45, 50, 40, 55],
|
income,
|
||||||
[4, 3, 6, 11, 15, 22, 30, 14, 48, 22, 25, 60]
|
expenses
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
console.log(barData);
|
||||||
|
|
||||||
barOption.value = getBarOptions(barData);
|
barOption.value = getBarOptions(barData);
|
||||||
};
|
};
|
||||||
|
const getTotalAmonunt = async () => {
|
||||||
|
const { data } = await cashTotal()
|
||||||
|
bigDataObj.value = data
|
||||||
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getCapitalData();
|
getCapitalData();
|
||||||
getTurnoverList();
|
getTurnoverList();
|
||||||
|
getTotalAmonunt();
|
||||||
});
|
});
|
||||||
|
|
||||||
//资金KPI
|
//资金KPI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<template>
|
ID<template>
|
||||||
<div class="large-screen">
|
<div class="large-screen">
|
||||||
<Header />
|
<Header />
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
@ -21,6 +21,7 @@ import leftPage from './components/leftPage.vue';
|
|||||||
import centerPage from './components/centerPage.vue';
|
import centerPage from './components/centerPage.vue';
|
||||||
import rightPage from './components/rightPage.vue';
|
import rightPage from './components/rightPage.vue';
|
||||||
// import '@/assets/styles/element.scss';
|
// import '@/assets/styles/element.scss';
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@ -31,6 +32,7 @@ import rightPage from './components/rightPage.vue';
|
|||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-color: rgba(4, 7, 17, 1);
|
background-color: rgba(4, 7, 17, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 80px);
|
height: calc(100vh - 80px);
|
||||||
|
@ -140,7 +140,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '名称' : ''"
|
label="名称"
|
||||||
:prop="`itemList.${index}.name`"
|
:prop="`itemList.${index}.name`"
|
||||||
:rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]"
|
||||||
>
|
>
|
||||||
@ -149,7 +149,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '规格' : ''"
|
label="规格"
|
||||||
:prop="`itemList.${index}.specification`"
|
:prop="`itemList.${index}.specification`"
|
||||||
:rules="[{ required: true, message: '规格不能为空', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '规格不能为空', trigger: 'blur' }]"
|
||||||
>
|
>
|
||||||
@ -158,7 +158,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '单位' : ''"
|
label="单位"
|
||||||
:prop="`itemList.${index}.unit`"
|
:prop="`itemList.${index}.unit`"
|
||||||
:rules="[{ required: true, message: '单位不能为空', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '单位不能为空', trigger: 'blur' }]"
|
||||||
>
|
>
|
||||||
@ -167,7 +167,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '库存' : ''"
|
label="库存"
|
||||||
:prop="`itemList.${index}.stockQuantity`"
|
:prop="`itemList.${index}.stockQuantity`"
|
||||||
:rules="[{ required: true, message: '库存不能为空', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '库存不能为空', trigger: 'blur' }]"
|
||||||
>
|
>
|
||||||
@ -176,7 +176,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '领取' : ''"
|
label="领取"
|
||||||
:prop="`itemList.${index}.issuedQuantity`"
|
:prop="`itemList.${index}.issuedQuantity`"
|
||||||
:rules="[{ required: true, message: '领取数量不能为空', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '领取数量不能为空', trigger: 'blur' }]"
|
||||||
>
|
>
|
||||||
@ -185,7 +185,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '剩余' : ''"
|
label="剩余"
|
||||||
:prop="`itemList.${index}.remainingQuantity`"
|
:prop="`itemList.${index}.remainingQuantity`"
|
||||||
:rules="[{ required: true, message: '剩余数量不能为空', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '剩余数量不能为空', trigger: 'blur' }]"
|
||||||
>
|
>
|
||||||
@ -193,7 +193,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<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-input v-model="item.remark" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -54,31 +54,32 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="150">序号</th>
|
<!-- 去掉重复的 width 属性,统一用 CSS 控制 -->
|
||||||
<th width="150">名称</th>
|
<th style="width: 80px; word-wrap: break-word">序号</th>
|
||||||
<th width="150">规格</th>
|
<th style="width: 120px; word-wrap: break-word">名称</th>
|
||||||
<th width="150">单位</th>
|
<th style="width: 120px; word-wrap: break-word">规格</th>
|
||||||
<th width="150">库存</th>
|
<th style="width: 80px; word-wrap: break-word">单位</th>
|
||||||
<th width="150">领取</th>
|
<th style="width: 80px; word-wrap: break-word">库存</th>
|
||||||
<th width="150">剩余</th>
|
<th style="width: 80px; word-wrap: break-word">领取</th>
|
||||||
<th width="150">备注</th>
|
<th style="width: 80px; word-wrap: break-word">剩余</th>
|
||||||
|
<th style="width: 120px; word-wrap: break-word">备注</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, i) of formData.itemList" :key="i">
|
<tr v-for="(item, i) of formData.itemList" :key="i">
|
||||||
<th width="150">{{ i + 1 }}</th>
|
<td width="150">{{ i + 1 }}</td>
|
||||||
<th width="150">{{ item.name }}</th>
|
<td width="150">{{ item.name }}</td>
|
||||||
<th width="150">{{ item.specification }}</th>
|
<td width="150">{{ item.specification }}</td>
|
||||||
<th width="150">{{ item.unit }}</th>
|
<td width="150">{{ item.unit }}</td>
|
||||||
<th width="150">{{ item.stockQuantity }}</th>
|
<td width="150">{{ item.stockQuantity }}</td>
|
||||||
<th width="150">{{ item.issuedQuantity }}</th>
|
<td width="150">{{ item.issuedQuantity }}</td>
|
||||||
<th width="150">{{ item.remainingQuantity }}</th>
|
<td width="150">{{ item.remainingQuantity }}</td>
|
||||||
<th width="150">{{ item.remark }}</th>
|
<td width="150">{{ item.remark }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7">
|
<td colspan="7" style="word-wrap: break-word">
|
||||||
<div style="margin-bottom: 10px">缺陷情况:</div>
|
<div style="margin-bottom: 10px">缺陷情况:</div>
|
||||||
{{ formData.defectDescription }}
|
{{ formData.defectDescription }}
|
||||||
</td>
|
</td>
|
||||||
@ -296,5 +297,6 @@ tbody {
|
|||||||
box-shadow: 0px 0px 10px #ddd;
|
box-shadow: 0px 0px 10px #ddd;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
/* overflow: auto; */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
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,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<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]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
@ -21,10 +22,12 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<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>
|
||||||
<el-col :span="1.5">
|
<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>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -56,10 +59,10 @@
|
|||||||
<el-table-column label="任务状态" align="center" prop="taskStatus">
|
<el-table-column label="任务状态" align="center" prop="taskStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<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>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -71,13 +74,15 @@
|
|||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['patch:patch:edit']"></el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['patch:patch:edit']"></el-button>
|
||||||
</el-tooltip> -->
|
</el-tooltip> -->
|
||||||
<el-tooltip content="删除" placement="top">
|
<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>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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">
|
<div class="mb-4">
|
||||||
<!-- v-hasPermi="['patch:progress:add']" -->
|
<!-- v-hasPermi="['patch:progress:add']" -->
|
||||||
<el-button type="primary" plain icon="Plus" size="small" @click="handleProgressAdd()"> 新增进度 </el-button>
|
<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">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改进度" placement="top">
|
<el-tooltip content="修改进度" placement="top">
|
||||||
<el-button
|
<el-button link type="primary" icon="Edit" size="small" @click="handleProgressUpdate(scope.row)"
|
||||||
link
|
v-hasPermi="['patch:progress:edit']"></el-button>
|
||||||
type="primary"
|
|
||||||
icon="Edit"
|
|
||||||
size="small"
|
|
||||||
@click="handleProgressUpdate(scope.row)"
|
|
||||||
v-hasPermi="['patch:progress:edit']"
|
|
||||||
></el-button>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除进度" placement="top">
|
<el-tooltip content="删除进度" placement="top">
|
||||||
<el-button
|
<el-button link type="primary" icon="Delete" size="small" @click="handleProgressDelete(scope.row)"
|
||||||
link
|
v-hasPermi="['patch:progress:remove']"></el-button>
|
||||||
type="primary"
|
|
||||||
icon="Delete"
|
|
||||||
size="small"
|
|
||||||
@click="handleProgressDelete(scope.row)"
|
|
||||||
v-hasPermi="['patch:progress:remove']"
|
|
||||||
></el-button>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
</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-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.projectId" type="hidden" />
|
||||||
<el-input v-model="progressForm.slaveId" placeholder="请输入执行人ID" v-if="false" />
|
<el-input v-model="progressForm.slaveId" placeholder="请输入执行人ID" v-if="false" />
|
||||||
<el-form-item label="进度" prop="progress">
|
<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>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="progressForm.remark" type="textarea" placeholder="请输入备注" rows="3" />
|
<el-input v-model="progressForm.remark" type="textarea" placeholder="请输入备注" rows="3" />
|
||||||
@ -139,13 +135,15 @@
|
|||||||
</el-dialog>
|
</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-card>
|
||||||
|
|
||||||
<!-- 新增/修改任务弹窗 -->
|
<!-- 新增/修改任务弹窗 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body destroy-on-close>
|
<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-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>
|
<template #help>
|
||||||
<span v-if="currentProjectId" class="text-success">已自动关联当前选中项目</span>
|
<span v-if="currentProjectId" class="text-success">已自动关联当前选中项目</span>
|
||||||
</template>
|
</template>
|
||||||
@ -154,14 +152,17 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="执行人姓名" prop="userId">
|
<el-form-item label="执行人姓名" prop="userId">
|
||||||
<el-select v-model="form.userId" placeholder="请选择执行人姓名" clearable style="width: 100%">
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计划完成时间" prop="pcd">
|
<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>
|
||||||
<el-form-item label="实际完成时间" prop="act">
|
<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>
|
||||||
<el-form-item label="任务描述" prop="describe">
|
<el-form-item label="任务描述" prop="describe">
|
||||||
<el-input v-model="form.describe" type="textarea" placeholder="请输入任务描述" />
|
<el-input v-model="form.describe" type="textarea" placeholder="请输入任务描述" />
|
||||||
@ -631,7 +632,9 @@ const handleProgressInput = () => {
|
|||||||
const handleExport = () => {
|
const handleExport = () => {
|
||||||
proxy?.download('patch/patch/export', { ...queryParams.value }, `任务列表_${new Date().getTime()}.xlsx`);
|
proxy?.download('patch/patch/export', { ...queryParams.value }, `任务列表_${new Date().getTime()}.xlsx`);
|
||||||
};
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
// 监听项目id刷新数据
|
// 监听项目id刷新数据
|
||||||
const listeningProject = watch(
|
const listeningProject = watch(
|
||||||
() => currentProject.value?.id,
|
() => currentProject.value?.id,
|
||||||
@ -651,12 +654,15 @@ onUnmounted(() => {
|
|||||||
.mb-4 {
|
.mb-4 {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table .small-padding .cell {
|
.el-table .small-padding .cell {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table .fixed-width {
|
.el-table .fixed-width {
|
||||||
width: 120px !important;
|
width: 120px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table-column .el-button--text+.el-button--text {
|
.el-table-column .el-button--text+.el-button--text {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ const getList = async () => {
|
|||||||
matrixOptions.value = matrixList;
|
matrixOptions.value = matrixList;
|
||||||
queryParams.value.matrixId = matrixList[0].children[0].matrixId;
|
queryParams.value.matrixId = matrixList[0].children[0].matrixId;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
proxy?.$modal.msgError('获取方阵失败');
|
// proxy?.$modal.msgError('获取方阵失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<!-- <el-input v-model="queryParams.pid" placeholder="请选择" clearable /> -->
|
<!-- <el-input v-model="queryParams.pid" placeholder="请选择" clearable /> -->
|
||||||
<el-cascader
|
<el-cascader
|
||||||
:options="matrixOptions"
|
:options="matrixOptions"
|
||||||
|
ref="treeRef"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
:props="{ value: 'matrixId', label: 'name' }"
|
:props="{ value: 'matrixId', label: 'name' }"
|
||||||
@ -29,6 +30,9 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Export" @click="handleExport">导出</el-button>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -144,7 +148,8 @@ import {
|
|||||||
getProgressCategory,
|
getProgressCategory,
|
||||||
delProgressCategory,
|
delProgressCategory,
|
||||||
addProgressCategory,
|
addProgressCategory,
|
||||||
updateProgressCategory
|
updateProgressCategory,
|
||||||
|
downloadProgressCategory
|
||||||
} from '@/api/progress/progressCategory';
|
} from '@/api/progress/progressCategory';
|
||||||
import { ProgressCategoryVO, ProgressCategoryQuery, ProgressCategoryForm } from '@/api/progress/progressCategory/types';
|
import { ProgressCategoryVO, ProgressCategoryQuery, ProgressCategoryForm } from '@/api/progress/progressCategory/types';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
@ -161,7 +166,7 @@ type ProgressCategoryOption = {
|
|||||||
name: string;
|
name: string;
|
||||||
children?: ProgressCategoryOption[];
|
children?: ProgressCategoryOption[];
|
||||||
};
|
};
|
||||||
|
const treeRef = ref();
|
||||||
const matrixOptions = ref([]);
|
const matrixOptions = ref([]);
|
||||||
|
|
||||||
const progressCategoryList = ref<ProgressCategoryVO[]>([]);
|
const progressCategoryList = ref<ProgressCategoryVO[]>([]);
|
||||||
@ -236,6 +241,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
const matrixIdList = ref([]);
|
||||||
|
|
||||||
/** 查询分项工程单价列表 */
|
/** 查询分项工程单价列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
@ -252,7 +258,6 @@ const getList = async () => {
|
|||||||
});
|
});
|
||||||
if (!matrixValue.value) matrixValue.value = matrixList[0].id;
|
if (!matrixValue.value) matrixValue.value = matrixList[0].id;
|
||||||
matrixOptions.value = matrixList;
|
matrixOptions.value = matrixList;
|
||||||
console.log('🚀 ~ getList ~ matrixList:', matrixList);
|
|
||||||
queryParams.value.matrixId = matrixList[0].children[0].matrixId;
|
queryParams.value.matrixId = matrixList[0].children[0].matrixId;
|
||||||
form.value.projectId = matrixList[0].projectId;
|
form.value.projectId = matrixList[0].projectId;
|
||||||
form.value.matrixId = matrixList[0].children[0].matrixId;
|
form.value.matrixId = matrixList[0].children[0].matrixId;
|
||||||
@ -300,9 +305,7 @@ const reset = () => {
|
|||||||
const handleChange = (value: number) => {
|
const handleChange = (value: number) => {
|
||||||
form.value.matrixId = value[1];
|
form.value.matrixId = value[1];
|
||||||
form.value.projectId = value[0];
|
form.value.projectId = value[0];
|
||||||
|
|
||||||
queryParams.value.matrixId = value[1];
|
queryParams.value.matrixId = value[1];
|
||||||
|
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -361,6 +364,18 @@ const handleUpdate = async (row: ProgressCategoryVO) => {
|
|||||||
dialog.title = '修改分项工程单价';
|
dialog.title = '修改分项工程单价';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleExport = async () => {
|
||||||
|
const ids = treeRef.value.getCheckedNodes()[0].pathNodes[0].childrenData.map((item) => item.matrixId);
|
||||||
|
proxy?.download(
|
||||||
|
'/progress/progressCategory/export',
|
||||||
|
{
|
||||||
|
ids: ids
|
||||||
|
},
|
||||||
|
`qualityInspection_${new Date().getTime()}.xlsx`,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
progressCategoryFormRef.value?.validate(async (valid: boolean) => {
|
progressCategoryFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:tenderPlanLimitList: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-form-item>
|
||||||
|
<el-button type="primary" @click="handleAudit()">审核</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
</transition>
|
</transition>
|
||||||
@ -104,6 +107,8 @@ const queryForm = ref({
|
|||||||
sheet: ''
|
sheet: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const versionsData = ref<any>({});
|
||||||
|
|
||||||
const activeTab = ref('2');
|
const activeTab = ref('2');
|
||||||
const sheets = ref([]);
|
const sheets = ref([]);
|
||||||
const options = ref([]);
|
const options = ref([]);
|
||||||
@ -118,7 +123,8 @@ const handleTabChange = (tab: string) => {
|
|||||||
getVersionNums();
|
getVersionNums();
|
||||||
};
|
};
|
||||||
//切换版本
|
//切换版本
|
||||||
const changeVersions = () => {
|
const changeVersions = (value) => {
|
||||||
|
versionsData.value = options.value.find((item) => item.versions == value);
|
||||||
getSheetName();
|
getSheetName();
|
||||||
};
|
};
|
||||||
//切换表格
|
//切换表格
|
||||||
@ -148,6 +154,8 @@ const getVersionNums = async () => {
|
|||||||
options.value = res.data;
|
options.value = res.data;
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
queryForm.value.versions = res.data[0].versions;
|
queryForm.value.versions = res.data[0].versions;
|
||||||
|
versionsData.value = options.value.find((item) => item.versions == queryForm.value.versions);
|
||||||
|
console.log('🚀 ~ changeVersions ~ versionsData.value:', versionsData.value);
|
||||||
getSheetName();
|
getSheetName();
|
||||||
} else {
|
} else {
|
||||||
queryForm.value.versions = '';
|
queryForm.value.versions = '';
|
||||||
@ -261,6 +269,17 @@ const handleSave = (row: any) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 审核按钮操作 */
|
||||||
|
const handleAudit = async () => {
|
||||||
|
proxy?.$tab.openPage('/approval/tenderBidd/indexEdit', '审核招标一览', {
|
||||||
|
id: queryForm.value.versions,
|
||||||
|
type: 'update',
|
||||||
|
activeTab: activeTab.value,
|
||||||
|
status: versionsData.value.status
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
//监听项目id刷新数据
|
//监听项目id刷新数据
|
||||||
const listeningProject = watch(
|
const listeningProject = watch(
|
||||||
() => currentProject.value?.id,
|
() => currentProject.value?.id,
|
||||||
|
409
src/views/tender/bidd/indexEdit.vue
Normal file
409
src/views/tender/bidd/indexEdit.vue
Normal file
@ -0,0 +1,409 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-4 bg-gray-50">
|
||||||
|
<div class="max-w-4xl mx-auto">
|
||||||
|
<!-- 顶部按钮区域 -->
|
||||||
|
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||||
|
<approvalButton
|
||||||
|
@submitForm="submitForm"
|
||||||
|
@approvalVerifyOpen="approvalVerifyOpen"
|
||||||
|
@handleApprovalRecord="handleApprovalRecord"
|
||||||
|
:buttonLoading="buttonLoading"
|
||||||
|
:id="form.id"
|
||||||
|
:status="form.status"
|
||||||
|
:pageType="routeParams.type"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-800">招标一览</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-6">
|
||||||
|
<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="单位" />
|
||||||
|
<el-table-column prop="quantity" 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>
|
||||||
|
<!-- 提交组件 -->
|
||||||
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
|
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||||
|
<!-- 流程选择对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
v-model="dialogVisible.visible"
|
||||||
|
:title="dialogVisible.title"
|
||||||
|
:before-close="handleClose"
|
||||||
|
width="500"
|
||||||
|
class="rounded-lg shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||||
|
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||||
|
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||||
|
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Leave" lang="ts">
|
||||||
|
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||||
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
|
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 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';
|
||||||
|
import { getConstructionValue } from '@/api/out/constructionValue';
|
||||||
|
import { workScheduleListDetail } from '@/api/progress/plan';
|
||||||
|
import { sheetList } from '@/api/contract';
|
||||||
|
import { getApproval, getTableList } from '@/api/tender';
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
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>({
|
||||||
|
visible: false,
|
||||||
|
title: '流程定义'
|
||||||
|
});
|
||||||
|
//提交组件
|
||||||
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
|
//审批记录组件
|
||||||
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||||
|
//按钮组件
|
||||||
|
const flowCodeOptions = [
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_bLimitEquipmentList',
|
||||||
|
label: '招标一览审批'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const sheets = ref([]);
|
||||||
|
const queryForm = ref({
|
||||||
|
versions: '',
|
||||||
|
sheet: ''
|
||||||
|
});
|
||||||
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
|
const dialog = reactive({
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
isEdit: false
|
||||||
|
});
|
||||||
|
const tableData = ref([]);
|
||||||
|
const submitFormData = ref<StartProcessBo>({
|
||||||
|
businessId: '',
|
||||||
|
flowCode: '',
|
||||||
|
variables: {}
|
||||||
|
});
|
||||||
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
|
||||||
|
const initFormData = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
versions: undefined,
|
||||||
|
sheet: undefined,
|
||||||
|
type: undefined,
|
||||||
|
status: undefined
|
||||||
|
};
|
||||||
|
const data = reactive({
|
||||||
|
form: { ...initFormData },
|
||||||
|
rules: {}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
flowCode.value = '';
|
||||||
|
buttonLoading.value = false;
|
||||||
|
};
|
||||||
|
const { form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
leaveFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取详情 */
|
||||||
|
const getInfo = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
nextTick(async () => {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
versions: form.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 = '';
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await getTableList(form.value);
|
||||||
|
if (res.code == 200) {
|
||||||
|
tableData.value = res.data;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
getApproval(form.value.versions).then((res) => {
|
||||||
|
form.value.status = res.data.status;
|
||||||
|
});
|
||||||
|
if (routeParams.value.type === 'approval') {
|
||||||
|
form.value.id = routeParams.value.id;
|
||||||
|
} else {
|
||||||
|
form.value.id = routeParams.value.id + '_' + routeParams.value.activeTab;
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = (status1: string) => {
|
||||||
|
status.value = status1;
|
||||||
|
submit(status.value, form.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFlow = async () => {
|
||||||
|
handleStartWorkFlow(form.value);
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
};
|
||||||
|
//提交申请
|
||||||
|
const handleStartWorkFlow = async (data: any) => {
|
||||||
|
try {
|
||||||
|
submitFormData.value.flowCode = flowCode.value;
|
||||||
|
submitFormData.value.businessId = data.versions + '_xianjiayilan';
|
||||||
|
//流程变量
|
||||||
|
taskVariables.value = {
|
||||||
|
// leave4/5 使用的流程变量
|
||||||
|
userList: ['1', '3', '4']
|
||||||
|
};
|
||||||
|
submitFormData.value.variables = taskVariables.value;
|
||||||
|
const resp = await startWorkFlow(submitFormData.value);
|
||||||
|
if (submitVerifyRef.value) {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//审批记录
|
||||||
|
const handleApprovalRecord = () => {
|
||||||
|
approvalRecordRef.value.init(form.value.id);
|
||||||
|
};
|
||||||
|
//提交回调
|
||||||
|
const submitCallback = async () => {
|
||||||
|
await proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.go(-1);
|
||||||
|
};
|
||||||
|
//审批
|
||||||
|
const approvalVerifyOpen = async () => {
|
||||||
|
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||||
|
};
|
||||||
|
// 图纸上传成功之后 开始提交
|
||||||
|
const submit = async (status, data) => {
|
||||||
|
form.value = data;
|
||||||
|
if (status === 'draft') {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.go(-1);
|
||||||
|
} else {
|
||||||
|
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||||
|
flowCode.value = flowCodeOptions[0].value;
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//说明启动过先随意穿个参数
|
||||||
|
if (flowCode.value === '' || flowCode.value === null) {
|
||||||
|
flowCode.value = 'xx';
|
||||||
|
}
|
||||||
|
await handleStartWorkFlow(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(async () => {
|
||||||
|
routeParams.value = proxy.$route.query;
|
||||||
|
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];
|
||||||
|
form.value.type = routeParams.value.id.split('_')[1];
|
||||||
|
} else {
|
||||||
|
form.value.versions = routeParams.value.id;
|
||||||
|
form.value.type = routeParams.value.activeTab;
|
||||||
|
}
|
||||||
|
getInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 全局样式 */
|
||||||
|
:root {
|
||||||
|
--primary: #409eff;
|
||||||
|
--primary-light: #66b1ff;
|
||||||
|
--primary-dark: #3a8ee6;
|
||||||
|
--success: #67c23a;
|
||||||
|
--warning: #e6a23c;
|
||||||
|
--danger: #f56c6c;
|
||||||
|
--info: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单样式优化 */
|
||||||
|
.el-form-item {
|
||||||
|
.el-form-item__label {
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__inner,
|
||||||
|
.el-select .el-input__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式优化 */
|
||||||
|
.el-button {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.is-primary {
|
||||||
|
background-color: var(--primary);
|
||||||
|
border-color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary-light);
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: var(--primary-dark);
|
||||||
|
border-color: var(--primary-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-text {
|
||||||
|
color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--primary-light);
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片样式优化 */
|
||||||
|
.el-card {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
/* transform: translateY(-2px); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 对话框样式优化 */
|
||||||
|
.el-dialog {
|
||||||
|
.el-dialog__header {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding: 15px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__footer {
|
||||||
|
padding: 15px 20px;
|
||||||
|
border-top: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,77 +1,245 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" title="招标文件" width="500" draggable @close="closeDialog">
|
<div class="p-2">
|
||||||
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<el-form-item label="招标文件" prop="name">
|
<el-card shadow="always">
|
||||||
<file-upload
|
<el-form :model="queryForm" :inline="true">
|
||||||
:fileSize="100"
|
<el-form-item label="表名" prop="sheet">
|
||||||
:auto-upload="false"
|
<el-select v-model="queryForm.sheet" placeholder="选择表名" @change="changeSheet">
|
||||||
uploadUrl="/tender/biddingPlan/uploadBiddingDocuments"
|
<el-option v-for="item in sheets" :key="item" :label="item" :value="item" />
|
||||||
method="put"
|
</el-select>
|
||||||
ref="fileUploadRef"
|
</el-form-item>
|
||||||
:data="{
|
<el-form-item>
|
||||||
projectId: currentProject?.id,
|
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
|
||||||
type: planType,
|
</el-form-item>
|
||||||
fileType: '1',
|
<el-form-item>
|
||||||
bidStatus: '0',
|
<el-upload
|
||||||
id: row.id
|
ref="uploadRef"
|
||||||
}"
|
class="upload-demo"
|
||||||
showFileList
|
: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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
</el-card>
|
||||||
<div class="dialog-footer">
|
</transition>
|
||||||
<el-button @click="closeDialog()"> 取消 </el-button>
|
<el-card shadow="never" class="mb8">
|
||||||
<el-button type="primary" @click="submitForm()">确定</el-button>
|
<el-table ref="tableRef" v-loading="loading" :data="tableData" row-key="id" border lazy default-expand-all>
|
||||||
</div>
|
<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>
|
</template>
|
||||||
</el-dialog>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
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 userStore = useUserStoreHook();
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const dialogVisible = ref(false);
|
const queryForm = ref({
|
||||||
const row = ref<any>();
|
versions: '',
|
||||||
const planType = ref<any>('');
|
sheet: ''
|
||||||
const fileUploadRef = ref<any>();
|
|
||||||
const ruleForm = ref<any>();
|
|
||||||
const rules = ref({
|
|
||||||
costEstimationFile: [{ required: true, message: '请上传招标文件', trigger: ['blur'] }]
|
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['success']);
|
const loading = ref(false);
|
||||||
const form = ref({
|
const options = ref<any[]>([]);
|
||||||
costEstimationFile: ''
|
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 open = (rows: any, type: string) => {
|
const res = await obtainAllVersionNumbers(params);
|
||||||
dialogVisible.value = true;
|
if (res.code == 200) {
|
||||||
console.log(rows, type);
|
options.value = res.data;
|
||||||
row.value = rows;
|
if (res.data.length > 0) {
|
||||||
planType.value = type;
|
queryForm.value.versions = res.data[0];
|
||||||
|
getSheetName();
|
||||||
|
} else {
|
||||||
|
queryForm.value.versions = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const resetForm = () => {};
|
//选择版本号
|
||||||
const submitForm = () => {
|
const changeVersions = () => {
|
||||||
fileUploadRef.value.submitUpload().then((res) => {
|
getSheetName();
|
||||||
if (res == 'noFile') {
|
};
|
||||||
|
|
||||||
|
//选择表名
|
||||||
|
const changeSheet = () => {
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取表名
|
||||||
|
const getSheetName = async () => {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
projectId: currentProject.value?.id
|
||||||
|
// versions: queryForm.value.versions
|
||||||
|
};
|
||||||
|
const res = await sheetList(params);
|
||||||
|
if (res.code == 200) {
|
||||||
|
sheets.value = res.data;
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
queryForm.value.sheet = res.data[0];
|
||||||
|
} else {
|
||||||
|
queryForm.value.sheet = '';
|
||||||
|
}
|
||||||
|
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({
|
ElMessage({
|
||||||
message: '请上传招标文件',
|
message: '请输入单价',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dialogVisible.value = false;
|
loading.value = true;
|
||||||
emit('success');
|
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>
|
</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,7 +10,6 @@
|
|||||||
<el-form-item label="内容" prop="sheet">
|
<el-form-item label="内容" prop="sheet">
|
||||||
<el-input v-model="queryForm.content" placeholder="请输入内容" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryForm.content" placeholder="请输入内容" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
@ -106,6 +105,7 @@
|
|||||||
v-hasPermi="['tender:biddingPlan:getMore']"
|
v-hasPermi="['tender:biddingPlan:getMore']"
|
||||||
>详情</el-button
|
>详情</el-button
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
@ -209,7 +209,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
<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>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="详情" v-model="detailDialog" width="75%" draggable>
|
<el-dialog title="详情" v-model="detailDialog" width="75%" draggable>
|
||||||
@ -257,8 +257,6 @@ import { useUserStoreHook } from '@/store/modules/user';
|
|||||||
import { getDicts } from '@/api/system/dict/data';
|
import { getDicts } from '@/api/system/dict/data';
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
import { Plus } from '@element-plus/icons-vue';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import information from './comm/planPage.vue';
|
|
||||||
import winTheBid from './comm/winTheBid.vue';
|
|
||||||
import {
|
import {
|
||||||
sheetList,
|
sheetList,
|
||||||
tenderPlanList,
|
tenderPlanList,
|
||||||
@ -517,14 +515,12 @@ const getTreeList = async () => {
|
|||||||
treeLoading.value = false;
|
treeLoading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const subLoading = ref(false);
|
|
||||||
|
|
||||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
await formEl.validate(async (valid, fields) => {
|
await formEl.validate(async (valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
subLoading.value = true;
|
|
||||||
if (selectionData.value.length == 0) {
|
if (selectionData.value.length == 0) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '请选择项目材料',
|
message: '请选择项目材料',
|
||||||
@ -559,10 +555,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
});
|
});
|
||||||
closeDialog();
|
closeDialog();
|
||||||
getList();
|
getList();
|
||||||
subLoading.value = false;
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
subLoading.value = false;
|
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -323,18 +323,21 @@
|
|||||||
<script setup name="SupplierInput" lang="ts">
|
<script setup name="SupplierInput" lang="ts">
|
||||||
import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue';
|
||||||
import { ElFormInstance } from 'element-plus';
|
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 { SupplierInputVO, SupplierInputQuery, SupplierInputForm, PageData, DialogOption } from '@/api/supplierInput/supplierInput/types';
|
||||||
import Pagination from '@/components/Pagination/index.vue';
|
import Pagination from '@/components/Pagination/index.vue';
|
||||||
import RightToolbar from '@/components/RightToolbar/index.vue';
|
import RightToolbar from '@/components/RightToolbar/index.vue';
|
||||||
import FileUpload from '@/components/FileUpload/index.vue';
|
import FileUpload from '@/components/FileUpload/index.vue';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||||
// 组件引用
|
// 组件引用
|
||||||
const fileUploadRef = ref<InstanceType<typeof FileUpload> | null>(null);
|
const fileUploadRef = ref<InstanceType<typeof FileUpload> | null>(null);
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const supplierInputFormRef = ref<ElFormInstance>();
|
const supplierInputFormRef = ref<ElFormInstance>();
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
// 基础数据
|
// 基础数据
|
||||||
const supplierInputList = ref<SupplierInputVO[]>([]);
|
const supplierInputList = ref<SupplierInputVO[]>([]);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
@ -393,6 +396,7 @@ const initFormData: any = {
|
|||||||
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
supplierType: undefined,
|
supplierType: undefined,
|
||||||
@ -506,7 +510,7 @@ const cancel = () => {
|
|||||||
|
|
||||||
/** 表单重置:清空所有字段 */
|
/** 表单重置:清空所有字段 */
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = { ...initFormData };
|
form.value = { ...initFormData, projectId: currentProject.value?.id };
|
||||||
fileUrl.value = '';
|
fileUrl.value = '';
|
||||||
form.value.inputFile = '';
|
form.value.inputFile = '';
|
||||||
supplierInputFormRef.value?.resetFields();
|
supplierInputFormRef.value?.resetFields();
|
||||||
@ -606,8 +610,6 @@ const handleUpdate = async (row?: SupplierInputVO) => {
|
|||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
console.log(1);
|
|
||||||
|
|
||||||
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
supplierInputFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
if (form.value.supplierType === '劳务') {
|
if (form.value.supplierType === '劳务') {
|
||||||
@ -662,10 +664,29 @@ const handleDelete = async (row?: SupplierInputVO) => {
|
|||||||
const handleExport = () => {
|
const handleExport = () => {
|
||||||
proxy?.download('supplierInput/supplierInput/export', { ...queryParams.value }, `supplierInput_${new Date().getTime()}.xlsx`);
|
proxy?.download('supplierInput/supplierInput/export', { ...queryParams.value }, `supplierInput_${new Date().getTime()}.xlsx`);
|
||||||
};
|
};
|
||||||
|
//调用projectId并获取列表
|
||||||
/** 页面挂载时查询列表 */
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 若需要依赖项目ID,可先判断项目是否已选中,再调用接口
|
||||||
|
if (currentProject.value?.id) {
|
||||||
|
queryParams.value.projectId = currentProject.value.id;
|
||||||
|
form.value.projectId = currentProject.value.id;
|
||||||
|
getList(); // 首次进入自动调取listSupplierInput接口
|
||||||
|
} else {
|
||||||
|
// 若项目未选中,可提示或后续监听项目变化时再加载(已有监听逻辑)
|
||||||
getList();
|
getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value?.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
form.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -437,9 +437,7 @@ onMounted(() => {
|
|||||||
.el-input__inner,
|
.el-input__inner,
|
||||||
.el-select .el-input__inner {
|
.el-select .el-input__inner {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
transition:
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
border-color 0.2s,
|
|
||||||
box-shadow 0.2s;
|
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: var(--primary-light);
|
border-color: var(--primary-light);
|
||||||
@ -449,9 +447,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
.el-textarea__inner {
|
.el-textarea__inner {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
transition:
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
border-color 0.2s,
|
|
||||||
box-shadow 0.2s;
|
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: var(--primary-light);
|
border-color: var(--primary-light);
|
||||||
|
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