|
@@ -131,7 +131,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="完工状态" align="center" prop="completionStatus"/>
|
|
|
- <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="300">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
@@ -156,6 +156,13 @@
|
|
|
@click="addNewPipe(scope.row)"
|
|
|
>新增顶管工程
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="addMaterial(scope.row)"
|
|
|
+ >新增物料
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -175,6 +182,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="行政区" prop="district">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.district"
|
|
|
placeholder="请选择行政区"
|
|
|
@change="districtHasChanged"
|
|
@@ -191,6 +199,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="小区" prop="areaId">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.areaId"
|
|
|
placeholder="请选择小区"
|
|
|
@change="communityHasChanged"
|
|
@@ -209,6 +218,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="楼栋" prop="buildingId">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.buildingId"
|
|
|
placeholder="请选择楼栋"
|
|
|
@change="buildingHasChanged"
|
|
@@ -225,6 +235,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="单元" prop="unitId">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.unitId"
|
|
|
placeholder="请选择单元"
|
|
|
@change="unitHasChanged"
|
|
@@ -243,6 +254,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="房间" prop="houseId">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.houseId"
|
|
|
placeholder="请选择房间"
|
|
|
>
|
|
@@ -258,6 +270,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="工程类型" prop="enginType">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.enginType"
|
|
|
placeholder="请选择工程类型"
|
|
|
@change="enginTypeHasChanged"
|
|
@@ -274,9 +287,10 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="工程分类" prop="currentEnginTypeChange">
|
|
|
+ <el-form-item label="工程分类" prop="enginClassification">
|
|
|
<el-select
|
|
|
- v-model="queryParams.currentEnginTypeChange"
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
+ v-model="queryParams.enginClassification"
|
|
|
placeholder="请选择工程分类"
|
|
|
@change="currentEnginTypeChanged"
|
|
|
>
|
|
@@ -292,6 +306,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="工程周期" prop="enginCycle">
|
|
|
<el-select
|
|
|
+ :disabled="title == '添加用料' "
|
|
|
v-model="queryParams.enginCycle"
|
|
|
placeholder="请填写工程周期"
|
|
|
>
|
|
@@ -337,7 +352,7 @@
|
|
|
</el-tabs> -->
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">新增</el-button>
|
|
|
+ <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">{{ enginNodeStatus }}</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -616,7 +631,7 @@ export default {
|
|
|
enginClassification: undefined,
|
|
|
enginCycle: undefined,
|
|
|
completionStatus: undefined,
|
|
|
- currentEnginTypeChange: undefined,
|
|
|
+ enginClassification: undefined,
|
|
|
imgUrl: undefined,
|
|
|
zEngineeringNodeBoList: {
|
|
|
type: undefined,
|
|
@@ -743,14 +758,47 @@ export default {
|
|
|
type: '民用工程'
|
|
|
}, 'add')
|
|
|
},
|
|
|
+ // 新增物料
|
|
|
+ addMaterial(data){
|
|
|
+ this.title = "添加用料";
|
|
|
+ // this.enginNodeStatus = '修改'
|
|
|
+ this.loading = true;
|
|
|
+ this.reset();
|
|
|
+ const id = data.id || this.ids
|
|
|
+ getEngineeringCivil(id).then(res => {
|
|
|
+ this.loading = false;
|
|
|
+ let newData = res.data
|
|
|
+ // 手动调用行政区发生改变
|
|
|
+ this.districtHasChanged(newData.district)
|
|
|
+ this.communityHasChanged(newData.areaId)
|
|
|
+ this.buildingHasChanged(newData.buildingId,newData.areaId)
|
|
|
+ this.unitHasChanged(newData.unitId)
|
|
|
+ // 获取工程分类
|
|
|
+ this.enginTypeHasChanged(newData.enginType)
|
|
|
+ let val = newData.enginType + "_" + newData.enginClassification
|
|
|
+ this.currentCheckList = []
|
|
|
+ getDicts(val).then(res => {
|
|
|
+ this.checkList = res.data
|
|
|
+ })
|
|
|
+
|
|
|
+ this.queryParams = newData
|
|
|
+ console.log(this.queryParams.areaId)
|
|
|
+
|
|
|
+ // console.log('选中节点集合',this.currentCheckList)
|
|
|
+ // this.enginClassification = zEngineeringNodeBo.type
|
|
|
+ // newData.zEngineeringNodeBo = zEngineeringNodeBo
|
|
|
+ this.currentType = 'addMaterial'
|
|
|
+ this.open = true
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
currentEnginTypeChanged() {
|
|
|
this.currentCheckList = []
|
|
|
if (this.queryParams.enginType == undefined || this.queryParams.enginType == ''
|
|
|
- || this.queryParams.currentEnginTypeChange == undefined || this.queryParams.currentEnginTypeChange == ''
|
|
|
+ || this.queryParams.enginClassification == undefined || this.queryParams.enginClassification == ''
|
|
|
)
|
|
|
return
|
|
|
- console.log(this.queryParams)
|
|
|
- let val = this.queryParams.enginType + "_" + this.queryParams.currentEnginTypeChange
|
|
|
+ let val = this.queryParams.enginType + "_" + this.queryParams.enginClassification
|
|
|
getDicts(val).then(res => {
|
|
|
this.checkList = res.data
|
|
|
})
|
|
@@ -772,10 +820,10 @@ export default {
|
|
|
this.buildingOptions = res.data
|
|
|
})
|
|
|
},
|
|
|
- buildingHasChanged(buildingId) {
|
|
|
+ buildingHasChanged(buildingId,areaId) {
|
|
|
console.log(buildingId)
|
|
|
this.queryParams.unitId = null
|
|
|
- getUnits(this.queryParams.areaId,buildingId ).then(res => {
|
|
|
+ getUnits(areaId || this.queryParams.areaId,buildingId ).then(res => {
|
|
|
this.unitOptions = res.data
|
|
|
})
|
|
|
},
|
|
@@ -785,11 +833,11 @@ export default {
|
|
|
this.houseOptions = res.data
|
|
|
})
|
|
|
},
|
|
|
- enginTypeHasChanged() {
|
|
|
+ enginTypeHasChanged(enginType = null) {
|
|
|
this.currentCheckList = []
|
|
|
- this.queryParams.currentEnginTypeChange = ''
|
|
|
+ this.queryParams.enginClassification = ''
|
|
|
this.currentEnginTypeChangeOptions = []
|
|
|
- getDicts(this.queryParams.enginType).then(res => {
|
|
|
+ getDicts(enginType || this.queryParams.enginType).then(res => {
|
|
|
this.currentEnginTypeChangeOptions = res.data
|
|
|
})
|
|
|
},
|
|
@@ -912,7 +960,6 @@ export default {
|
|
|
this.nodeDetailVisible = false
|
|
|
},
|
|
|
toNodeDetail() {
|
|
|
- this.enginNodeStatus = '新增'
|
|
|
let nodeCollection = []
|
|
|
// 收集节点信息
|
|
|
this.currentCheckList.forEach((e,idx) => {
|
|
@@ -921,18 +968,34 @@ export default {
|
|
|
nodeCollection.push(nodeItem)
|
|
|
})
|
|
|
this.queryParams.zEngineeringNodeBoList = nodeCollection
|
|
|
- addEngineeringCivil(this.queryParams).then(res => {
|
|
|
- if(res.code == 200){
|
|
|
- this.$message({
|
|
|
- message: '新增成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- this.open = false
|
|
|
- console.log('选中节点集合',this.currentCheckList)
|
|
|
- this.currentCheckList = []
|
|
|
- // this.$emit('closeToSucceed')
|
|
|
- }
|
|
|
+ if(this.enginNodeStatus == '修改'){
|
|
|
+ putEngineeringCivil(this.queryParams).then(res => {
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.open = false
|
|
|
+ console.log('选中节点集合',this.currentCheckList)
|
|
|
+ this.currentCheckList = []
|
|
|
+ // this.$emit('closeToSucceed')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ addEngineeringCivil(this.queryParams).then(res => {
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message({
|
|
|
+ message: '新增成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.open = false
|
|
|
+ console.log('选中节点集合',this.currentCheckList)
|
|
|
+ this.currentCheckList = []
|
|
|
+ // this.$emit('closeToSucceed')
|
|
|
+ }
|
|
|
})
|
|
|
+ }
|
|
|
+
|
|
|
return
|
|
|
getDictList({enginType: ['new_built', 'old_renovation']}).then(res => {
|
|
|
this.nodeList = res.data
|
|
@@ -962,6 +1025,7 @@ export default {
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
+ this.enginNodeStatus = '新增'
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.title = "添加民用工程";
|
|
@@ -972,17 +1036,14 @@ export default {
|
|
|
this.loading = true;
|
|
|
// this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
- // getEngineeringCivil(id).then(response => {
|
|
|
- // this.loading = false;
|
|
|
- // this.queryParams = response.data;
|
|
|
- // console.log(this.form)
|
|
|
- // this.open = true;
|
|
|
- //
|
|
|
- // });
|
|
|
getEngineeringCivil(id).then(res => {
|
|
|
this.loading = false;
|
|
|
let newData = res.data
|
|
|
+ // 手动调用行政区发生改变
|
|
|
+ // this.districtHasChanged(newData.district)
|
|
|
+ this.queryParams = newData
|
|
|
this.updateOption = res.data.zEngineeringNodeBoList
|
|
|
+ console.log(this.queryParams.areaId)
|
|
|
// start update修改数据
|
|
|
res.data.zEngineeringNodeBoList.forEach((e,idx) => {
|
|
|
this.currentCheckList.push(e.type)
|
|
@@ -1014,7 +1075,6 @@ export default {
|
|
|
this.enginClassification = zEngineeringNodeBo.type
|
|
|
newData.zEngineeringNodeBo = zEngineeringNodeBo
|
|
|
this.currentType = 'put'
|
|
|
- this.queryParams = newData
|
|
|
console.log('修改queryparams传值', this.queryParams)
|
|
|
console.log(this.queryParams)
|
|
|
this.zEngineeringInfoBo = newData.zEngineeringNodeBo.zEngineeringInfoBo
|