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

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({ return request({
url: `/project/****/${id}`, url: '/bmw/pmProject/delProject',
method: 'DELETE', method: 'POST',
data,
}) })
} }

View File

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

View File

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

View File

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

View File

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