优化以及分包统计页面接口调试

This commit is contained in:
BianLzhaoMin 2025-10-10 15:55:13 +08:00
parent 0f3646ed40
commit 5d4eede169
14 changed files with 210 additions and 134 deletions

View File

@ -3,7 +3,16 @@ import request from '@/utils/request'
// 综合查询 获取分包统计列表 // 综合查询 获取分包统计列表
export const getSubCountListAPI = (data) => { export const getSubCountListAPI = (data) => {
return request({ return request({
url: '/bmw/workerLight/xxx', url: '/bmw/subStatistics/getSubStatisticsTable',
method: 'GET',
params: data,
})
}
// 综合查询 获取分包统计详情卡片统计
export const getSubCountDetailCardStatisticsAPI = (data) => {
return request({
url: '/bmw/subStatistics/getSubDataOverview',
method: 'GET', method: 'GET',
params: data, params: data,
}) })

View File

@ -141,6 +141,40 @@
<el-form-item <el-form-item
prop="businessLicense" prop="businessLicense"
label="农民工工资已支付完成承诺书" label="农民工工资已支付完成承诺书"
v-if="addOrEditForm.isShanghai === 0"
>
<!-- <el-tag
type="primary"
:key="item.id"
v-for="item in addOrEditForm.fileList_2"
>
{{ item.name }}
</el-tag> -->
<div
:key="item.id"
class="files-content"
v-for="item in addOrEditForm.fileList_2"
>
<el-tag
@click="onHandlePreviewFile(item)"
style="cursor: pointer"
>
{{ item.name }}
</el-tag>
<span
class="cursor-blue"
@click="onHandleDownloadFile(item)"
>
下载
</span>
</div>
</el-form-item>
<el-form-item
label="农民工工资已支付完成承诺书"
v-if="addOrEditForm.isShanghai == 1"
> >
<!-- <el-tag <!-- <el-tag
type="primary" type="primary"
@ -329,6 +363,7 @@ export default {
subContractName, subContractName,
subContractCode, subContractCode,
contractFile, contractFile,
isShanghai,
} = res } = res
Object.assign(this.addOrEditForm, { Object.assign(this.addOrEditForm, {
@ -339,6 +374,7 @@ export default {
subExitTime, subExitTime,
subContractName, subContractName,
subContractCode, subContractCode,
isShanghai,
}) })
if (contractFile && contractFile.length > 0) { if (contractFile && contractFile.length > 0) {

View File

@ -64,7 +64,6 @@
placeholder="请选择工程名称" placeholder="请选择工程名称"
v-model="addOrEditForm.proId" v-model="addOrEditForm.proId"
:disabled="queryDetailId !== ''" :disabled="queryDetailId !== ''"
@change="handleProIdChange"
> >
<el-option <el-option
:key="item.value" :key="item.value"
@ -79,31 +78,9 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item
label="法定代表人授权书"
v-show="isShanghai === 0"
>
<UploadFileFormData
:limit="3"
uploadTip=" "
:file-size="20"
:multiple="true"
:file-type="[
'jpg',
'png',
'jpeg',
'pdf',
'doc',
'docx',
]"
:file-list.sync="addOrEditForm.businessLicense"
/>
</el-form-item>
<el-form-item <el-form-item
label="法定代表人授权书" label="法定代表人授权书"
prop="businessLicense" prop="businessLicense"
v-show="isShanghai === 1"
> >
<UploadFileFormData <UploadFileFormData
:limit="3" :limit="3"

View File

@ -85,8 +85,30 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item <el-form-item
label="农民工工资已支付完成承诺书"
prop="businessLicense" prop="businessLicense"
label="农民工工资已支付完成承诺书"
v-if="exitFormData.isShanghai == 0"
>
<UploadFileFormData
:limit="3"
:file-size="20"
:multiple="true"
uploadTip=" "
:file-type="[
'jpg',
'png',
'jpeg',
'pdf',
'doc',
'docx',
]"
:file-list.sync="addOrEditForm.businessLicense"
/>
</el-form-item>
<el-form-item
label="农民工工资已支付完成承诺书"
v-if="exitFormData.isShanghai == 1"
> >
<UploadFileFormData <UploadFileFormData
:limit="3" :limit="3"

View File

@ -236,11 +236,19 @@ export default {
// //
onHandleExit(data) { onHandleExit(data) {
const { id, subId, proId, subContractCode, subContractName } = data const {
id,
subId,
proId,
isShanghai,
subContractCode,
subContractName,
} = data
this.exitFormData = { this.exitFormData = {
id, id,
subId, subId,
proId, proId,
isShanghai,
subContractCode, subContractCode,
subContractName, subContractName,
} }

View File

@ -107,7 +107,7 @@
<el-row v-if="formType === 2 || formType === 3"> <el-row v-if="formType === 2 || formType === 3">
<el-col :span="24"> <el-col :span="24">
<el-form-item <el-form-item
v-show="isShanghai === 0" v-if="editFormData.isShanghai === 1"
label="农民工工资已支付完成承诺书" label="农民工工资已支付完成承诺书"
> >
<UploadFileFormData <UploadFileFormData
@ -156,7 +156,7 @@
<el-form-item <el-form-item
prop="businessLicense" prop="businessLicense"
v-show="isShanghai === 1" v-if="editFormData.isShanghai === 0"
label="农民工工资已支付完成承诺书" label="农民工工资已支付完成承诺书"
> >
<UploadFileFormData <UploadFileFormData
@ -410,7 +410,7 @@ export default {
(item) => item.value === val, (item) => item.value === val,
) )
this.addOrEditForm.proName = proItem.label this.addOrEditForm.proName = proItem.label
this.isShanghai = proItem.isShanghai // this.isShanghai = proItem.isShanghai
// this.addOrEditForm.proName = this.lotProjectSelectList.find( // this.addOrEditForm.proName = this.lotProjectSelectList.find(
// (item) => item.value === val, // (item) => item.value === val,
// ).label // ).label

View File

@ -166,6 +166,7 @@ export default {
teamEinTime, teamEinTime,
teamExitTime, teamExitTime,
contractFile, contractFile,
isShanghai,
} = data } = data
this.editFormData = { this.editFormData = {
id, id,
@ -178,6 +179,7 @@ export default {
teamEinTime, teamEinTime,
teamExitTime, teamExitTime,
contractFile, contractFile,
isShanghai,
} }
} }

View File

@ -209,6 +209,8 @@ export default {
id: item.id, id: item.id,
proId: item.proId, proId: item.proId,
workerId: item.workerId, workerId: item.workerId,
subId: item.subId,
teamId: item.teamId,
} }
}) })
const res = await batchExitPersonAPI(params) const res = await batchExitPersonAPI(params)
@ -233,6 +235,8 @@ export default {
idNumber, idNumber,
workerId, workerId,
teamName, teamName,
subId,
teamId,
} = data } = data
this.exitFormData = { this.exitFormData = {
@ -244,6 +248,8 @@ export default {
teamName, teamName,
idNumber, idNumber,
workerId, workerId,
subId,
teamId,
} }
this.dialogConfig.outerWidth = '' this.dialogConfig.outerWidth = ''
this.dialogConfig.minHeight = '' this.dialogConfig.minHeight = ''

View File

@ -128,12 +128,14 @@ export default {
onHandleConfirmAddOrEditFun() { onHandleConfirmAddOrEditFun() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
if (this.isExitUpload === 1) { if (this.isExitUpload === 1) {
const { id, workerId, fileList, proId } = const { id, workerId, fileList, proId, subId, teamId } =
this.personExitFormData this.personExitFormData
const params = { const params = {
id, id,
proId, proId,
workerId, workerId,
subId,
teamId,
exitWay: '后端', exitWay: '后端',
} }
const fileMsg = [] const fileMsg = []

View File

@ -3,17 +3,17 @@ export const formLabel = [
isShow: false, // 是否展示label isShow: false, // 是否展示label
f_type: 'ipt', f_type: 'ipt',
f_label: '分包名称', f_label: '分包名称',
f_model: 'proName', f_model: 'subName',
}, },
] ]
export const columnsList = [ export const columnsList = [
{ t_props: 'mainProName', t_label: '分包名称' }, { t_props: 'subName', t_label: '分包名称' },
{ t_label: '工程数量', t_props: 'volLevel' }, { t_label: '工程数量', t_props: 'proNum' },
{ {
t_label: '班组数量', t_label: '班组数量',
t_props: 'volLevel', t_props: 'teamNum',
}, },
{ t_slot: 'proStatus', t_label: '在场人数' }, { t_props: 'einNum', t_label: '在场人数' },
] ]

View File

@ -38,7 +38,8 @@
<div class="card-content"> <div class="card-content">
<!-- 数字 --> <!-- 数字 -->
<div class="card-number"> <div class="card-number">
{{ formatNumber(card.value) }} <!-- {{ formatNumber(card.value) }} -->
{{ card.value }}
</div> </div>
<!-- 标签 --> <!-- 标签 -->
@ -65,21 +66,16 @@
</template> </template>
<script> <script>
import { getProjectCountListAPI } from '@/api/synthesize-query/project-count' import { getSubCountDetailCardStatisticsAPI } from '@/api/synthesize-query/sub-count'
export default { export default {
name: 'CardCount', name: 'CardCount',
props: { props: {
// ID // ID
projectId: { subId: {
type: [String, Number], type: [String, Number],
default: null, default: null,
}, },
//
autoLoad: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
@ -88,68 +84,62 @@ export default {
{ {
type: 'subcontractor', type: 'subcontractor',
label: '标段工程/分包合同', label: '标段工程/分包合同',
value: 0,
color: '#EF4444', color: '#EF4444',
dotColor: '#EF4444', dotColor: '#EF4444',
dataKey: 'subcontractorCount', dataKey: 'proNum',
}, },
{ {
type: 'team', type: 'team',
label: '施工班组', label: '施工班组',
value: 0,
color: '#3B82F6', color: '#3B82F6',
dotColor: '#3B82F6', dotColor: '#3B82F6',
dataKey: 'teamCount', dataKey: 'teamNum',
}, },
{ {
type: 'entry', type: 'entry',
label: '累计入场', label: '累计入场',
value: 0,
color: '#8B5CF6', color: '#8B5CF6',
dotColor: '#8B5CF6', dotColor: '#8B5CF6',
dataKey: 'totalEntryCount', dataKey: 'einNumHis',
}, },
{ {
type: 'attendance', type: 'attendance',
label: '累计考勤', label: '累计考勤',
value: 0,
color: '#06B6D4', color: '#06B6D4',
dotColor: '#06B6D4', dotColor: '#06B6D4',
dataKey: 'totalAttendanceCount', dataKey: 'attNumHis',
}, },
{ {
type: 'wage', type: 'wage',
label: '累计工资', label: '累计工资',
value: 0,
color: '#EC4899', color: '#EC4899',
dotColor: '#EC4899', // 绿 dotColor: '#EC4899', // 绿
dataKey: 'totalWageCount', dataKey: 'salaryMoneyNum',
}, },
{ {
type: 'machine', type: 'machine',
label: '考勤机', label: '考勤机',
value: 0,
color: '#10B981', color: '#10B981',
dotColor: '#10B981', dotColor: '#10B981',
dataKey: 'attendanceMachineCount', dataKey: 'salaryMoneyNum',
}, },
], ],
} }
}, },
created() {
if (this.autoLoad) {
this.loadData()
}
},
watch: { watch: {
projectId: { subId: {
handler() { handler() {
if (this.autoLoad) { this.loadData()
this.loadData()
}
}, },
immediate: false, immediate: true,
}, },
}, },
methods: { methods: {
@ -162,29 +152,34 @@ export default {
this.loading = true this.loading = true
try { try {
// API // API
// const response = await getProjectCountListAPI({ const res = await getSubCountDetailCardStatisticsAPI({
// projectId: this.projectId subId: this.subId,
// }) })
// API const {
proNum,
teamNum,
einNumHis,
attNumHis,
salaryMoneyNum,
} = res.data
console.log(res, '卡片统计')
// // API
const mockData = { const mockData = {
subcontractorCount: 5, proNum,
teamCount: 12, teamNum,
totalEntryCount: 1200, einNumHis,
currentOnsiteCount: 200, attNumHis,
totalAttendanceCount: 9600, salaryMoneyNum,
totalWageCount: 745635,
attendanceMachineCount: 14,
} }
// //
this.updateCardData(mockData) this.updateCardData(mockData)
this.$emit('data-loaded', mockData) // this.$emit('data-loaded', mockData)
} catch (error) { } catch (error) {
console.error('加载统计数据失败:', error)
this.$message.error('加载统计数据失败')
this.$emit('data-error', error)
} finally { } finally {
this.loading = false this.loading = false
} }

View File

@ -14,7 +14,7 @@
<!-- 项目信息区域 --> <!-- 项目信息区域 -->
<div class="project-details"> <div class="project-details">
<div class="project-title"> <div class="project-title">
{{ projectInfo.projectName }} {{ subName }}
</div> </div>
</div> </div>
</div> </div>
@ -30,12 +30,14 @@
<span class="attribute-label">{{ item.label }}</span> <span class="attribute-label">{{ item.label }}</span>
<span <span
class="attribute-value" class="attribute-value"
:class="{ style="color: #3b82f6"
'status-active': v-if="item.label === '营业执照/电子公章等'"
item.valueKey === 'currentStatus',
}"
> >
{{ projectInfo[item.valueKey] }} {{ item.value.length }}
</span>
<span v-else class="attribute-value">
{{ item.value || '-' }}
</span> </span>
</div> </div>
</div> </div>
@ -47,40 +49,46 @@
<script> <script>
export default { export default {
name: 'HeaderInfo', name: 'HeaderInfo',
props: {
subName: {
type: String,
default: '',
},
legalPerson: {
type: String,
default: '',
},
legalPersonPhone: {
type: String,
default: '',
},
subAddress: {
type: String,
default: '',
},
contractFile: {
type: Array,
default: [],
},
},
data() { data() {
return { return {
projectInfo: {
projectName: '重庆市万州水电建筑工程有限公司',
companyName: '输电一公司',
currentStatus: '在建',
projectType: '基建线路',
voltageLevel: '220kV',
plannedStartDate: '2025-02-01',
plannedCompletionDate: '2025-11-30',
projectLocation:
'广东省-东莞市广东省-东莞市广东省-东莞市广东省-东莞市广东省-东莞市广东省-东莞市',
},
labelList: [ labelList: [
{ {
label: '法定代表人', label: '法定代表人',
value: '李思思', value: this.legalPerson,
valueKey: 'currentStatus',
}, },
{ {
label: '联系电话', label: '联系电话',
value: '136562356236', value: this.legalPersonPhone,
valueKey: 'projectType',
}, },
{ {
label: '营业执照/电子公章等', label: '营业执照/电子公章等',
value: '5', value: this.contractFile,
valueKey: 'voltageLevel',
}, },
{ {
label: '营业住址', label: '营业住址',
value: '安徽省合肥市火星路', value: this.subAddress,
valueKey: 'plannedStartDate',
}, },
], ],
} }

View File

@ -1,12 +1,14 @@
<template> <template>
<!-- 综合查询 ---- 工程统计详情 --> <!-- 综合查询 ---- 工程统计详情 -->
<div class="app-container"> <div class="app-container">
<HeaderInfo /> <HeaderInfo
<CardCount :subName="subName"
:auto-load="true" :subAddress="subAddress"
:project-id="projectId" :legalPerson="legalPerson"
@cardClick="handleCardClick" :contractFile="contractFile"
:legalPersonPhone="legalPersonPhone"
/> />
<CardCount :sub-id="subId" @cardClick="handleCardClick" />
<SubTeamCard /> <SubTeamCard />
<PersonInfoCard /> <PersonInfoCard />
<AttMachineCard /> <AttMachineCard />
@ -31,12 +33,30 @@ export default {
}, },
data() { data() {
return { return {
projectId: null, // ID subName: null, //
legalPerson: null, //
legalPersonPhone: null, //
subAddress: null, //
contractFile: [], //
subId: null, // ID
} }
}, },
created() { created() {
// ID // ID
this.projectId = this.$route.params.id || this.$route.query.id const {
id,
legalPerson,
legalPersonPhone,
subAddress,
contractFile,
subName,
} = this.$route.query
this.subId = id
this.legalPerson = legalPerson
this.legalPersonPhone = legalPersonPhone
this.subAddress = subAddress
this.contractFile = contractFile
this.subName = subName
}, },
methods: { methods: {
// //

View File

@ -7,16 +7,15 @@
:showRightTools="true" :showRightTools="true"
ref="subCountTableRef" ref="subCountTableRef"
:columnsList="columnsList" :columnsList="columnsList"
:testTableList="testTableList"
:request-api="getSubCountListAPI" :request-api="getSubCountListAPI"
> >
<template slot="handle" slot-scope="{ queryParams }"> <template slot="handle" slot-scope="{ data }">
<el-button <el-button
plain plain
size="mini" size="mini"
type="primary" type="primary"
icon="el-icon-view" icon="el-icon-view"
@click="onHandleViewDetail(queryParams)" @click="onHandleViewDetail(data)"
> >
详情 详情
</el-button> </el-button>
@ -39,31 +38,23 @@ export default {
formLabel, formLabel,
columnsList, columnsList,
getSubCountListAPI, getSubCountListAPI,
testTableList: [
{
mainProName: '分公司1',
volLevel: '工程1',
subNum: 1,
teamNum: 1,
teamNum: 1,
},
{
mainProName: '分公司1',
volLevel: '工程1',
subNum: 1,
teamNum: 1,
teamNum: 1,
},
],
} }
}, },
methods: { methods: {
onHandleViewDetail(queryParams) { onHandleViewDetail(data) {
console.log(queryParams) console.log(data)
this.$router.push({ this.$router.push({
name: 'SubCountDetail', name: 'SubCountDetail',
query: {
id: data.id,
legalPerson: data.legalPerson,
legalPersonPhone: data.legalPersonPhone,
subAddress: data.subAddress,
contractFile: data.contractFile,
subName: data.subName,
},
}) })
}, },
}, },