标段工程页面完善接口调试完成

This commit is contained in:
BianLzhaoMin 2025-08-14 15:29:23 +08:00
parent b50e6f9305
commit ab9d2d856c
5 changed files with 68 additions and 34 deletions

View File

@ -10,10 +10,11 @@ export const addAndEditLotLotProjectAPI = (data) => {
}
// 删除标段工程
export const deleteLotLotProjectAPI = (id) => {
export const deleteLotLotProjectAPI = (data) => {
return request({
url: `/project/****/${id}`,
method: 'DELETE',
url: '/bmw/pmProject/delProject',
method: 'POST',
data,
})
}

View File

@ -291,14 +291,13 @@ export default {
})
.then(async () => {
const res = await deleteAllProjectAPI({ id: data.id })
console.log(res, '删除结果')
if (res.code === 200) {
this.$modal.msgSuccess('删除成功')
this.$refs.allProjectTableRef.getTableList() //
}
})
.catch(() => {
console.log('取消')
// console.log('')
})
},
@ -331,7 +330,6 @@ export default {
//
onHandleViewLotProject(data) {
console.log(data, '查看标段工程数量')
this.lotProjectList = data.pmProjectVoList
if (data.pmProjectVoList.length === 0) {

View File

@ -202,6 +202,11 @@ export default {
type: Object,
default: () => {},
},
formType: {
type: Number,
default: 1,
},
},
data() {
//
@ -220,7 +225,6 @@ export default {
}
return {
formType: 1,
addOrEditForm: {
mainProId: '', // id
orgId: '', // id
@ -369,8 +373,6 @@ export default {
return new Promise((resolve, reject) => {
this.$refs.addOrEditFormRef.validate(async (valid) => {
if (valid) {
console.log(this.addOrEditForm)
const params = {
...this.addOrEditForm,
}
@ -379,13 +381,12 @@ export default {
delete params.id
}
const res = await addAndEditLotLotProjectAPI(
this.addOrEditForm,
)
console.log(res, '新增或修改结果')
const res = await addAndEditLotLotProjectAPI(params)
if (res.code === 200) {
resolve()
this.$modal.msgSuccess('新增成功')
this.$modal.msgSuccess(
this.formType === 1 ? '新增成功' : '修改成功',
)
} else {
reject(new Error(res.msg))
this.$modal.msgError(res.msg)
@ -407,9 +408,6 @@ export default {
editFormData: {
handler(newVal) {
if (Object.keys(newVal).length > 0) {
// this.addOrEditForm = newVal
console.log(newVal, 'newVal')
const {
mainProId,
orgId,

View File

@ -35,10 +35,10 @@ export const columnsList = [
{ t_props: 'mainProName', t_label: '所属总工程' },
{ t_props: 'orgName', t_label: '所属项目部' },
{ t_props: 'proName', t_label: '工程名称' },
{ t_props: 'proType', t_label: '工程类型' },
{ t_slot: 'proType', t_label: '工程类型' },
{ t_props: 'volLevel', t_label: '电压等级' },
{ t_props: 'proAddress', t_label: '工程地址' },
{ t_props: 'proStatus', t_label: '状态' },
{ t_slot: 'proStatus', t_label: '状态' },
]
export const dialogConfig = {

View File

@ -15,7 +15,7 @@
size="mini"
type="success"
icon="el-icon-download"
@click="onHandleExportAllProject(queryParams)"
@click="onHandleExportLotProject(queryParams)"
>
导出
</el-button>
@ -32,11 +32,17 @@
</el-button>
</template>
<!-- 标段工程数量 -->
<template slot="count" slot-scope="{ data }">
<span class="cursor-blue" @click="onHandleViewLotProject(data)">
{{ data.count }}
</span>
<!-- 工程类型 -->
<template slot="proType" slot-scope="{ data }">
<el-tag size="mini" type="primary">
{{ initProType(data.proType) }}
</el-tag>
</template>
<!-- 标段工程状态 -->
<template slot="proStatus" slot-scope="{ data }">
<el-tag size="mini" type="primary">
{{ initProStatus(data.proStatus) }}
</el-tag>
</template>
<template slot="handle" slot-scope="{ data }">
@ -78,6 +84,7 @@
>
<template slot="outerContent">
<AddOrEditForm
:formType="formType"
:editFormData="editFormData"
ref="addOrEditLotProjectFormRef"
/>
@ -111,6 +118,7 @@ import {
} from '@/api/basic-manage/project-manage/lot-project'
export default {
name: 'LotProject',
dicts: ['project_type', 'project_status'],
components: {
TableModel,
DialogModel,
@ -119,6 +127,7 @@ export default {
data() {
return {
formType: 1,
formLabel,
columnsList,
dialogConfig,
@ -129,12 +138,19 @@ export default {
},
methods: {
//
onHandleExportAllProject(queryParams) {
console.log(queryParams, '导出')
onHandleExportLotProject(queryParams) {
this.download(
'/bmw/pmProject/export',
{
...queryParams,
},
`标段工程列表.xlsx`,
)
},
//
onHandleAddOrEditAllProject(type, data) {
this.formType = type
this.dialogConfig.outerTitle =
type === 1 ? '新增标段工程' : '修改标段工程'
@ -185,15 +201,16 @@ export default {
type: 'warning',
})
.then(async () => {
const res = await deleteLotLotProjectAPI(data.id)
console.log(res, '删除结果')
const res = await deleteLotLotProjectAPI({
id: data.id,
})
if (res.code === 200) {
this.$msgSuccess('删除成功')
this.$refs.allProjectTableRef.getTableList() //
this.$modal.msgSuccess('删除成功')
this.$refs.lotProjectTableRef.getTableList() //
}
})
.catch(() => {
console.log('取消')
// console.log('')
})
},
@ -230,17 +247,37 @@ export default {
})
.then(async () => {
const res = await completeLotLotProjectAPI(data.id)
console.log(res, '完工结果')
if (res.code === 200) {
this.$msgSuccess('完工成功')
this.$refs.allProjectTableRef.getTableList() //
}
})
.catch(() => {
console.log('取消')
// console.log('')
})
},
initProType(data) {
if (typeof data === 'string') {
return this.dict.type.project_type.find(
(item) => item.value == data,
).label
}
return data || ''
},
initProStatus(data) {
if (typeof data === 'string') {
return this.dict.type.project_status.find(
(item) => item.value == data,
).label
}
return data || ''
},
//
async onHandleConfirmAddOrEdit() {
// this.$refs.addOrEditLotProjectFormRef.formType =