|
@@ -11,12 +11,13 @@
|
|
|
<div style="width: 100%; height: 100%;">
|
|
|
<el-dialog :visible="nodeDetailVisible" :rules="nodeRules" title="节点信息" append-to-body customClass="appendElNodeDialog" width="70% !important">
|
|
|
<!-- 节点选项卡 -->
|
|
|
- <el-tabs type="border-card" class="engineNodeTypes" @tab-click="nodeHasChanged">
|
|
|
- <el-tab-pane label="基本信息"></el-tab-pane>
|
|
|
+ <el-tabs type="border-card" class="engineNodeTypes" @tab-click="nodeHasChanged" :before-leave="confirmLeave" v-model="tabsModel">
|
|
|
+ <!-- <el-tab-pane label="基本信息"></el-tab-pane> -->
|
|
|
<el-tab-pane
|
|
|
:label="e"
|
|
|
v-for="e in currentNode"
|
|
|
:key="e"
|
|
|
+ :name="e"
|
|
|
>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -46,13 +47,13 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="工程类型">
|
|
|
+ <!-- <el-form-item label="工程类型">
|
|
|
<el-cascader
|
|
|
v-model="value"
|
|
|
:options="options"
|
|
|
@change="currentEnginTypeChange">
|
|
|
</el-cascader>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<!-- <el-form-item label="工程节点">
|
|
|
<el-select
|
|
|
v-model="enginClassification"
|
|
@@ -75,9 +76,9 @@
|
|
|
<el-form-item label="施工人" prop="constructUser">
|
|
|
<el-input v-model="zEngineeringInfoBo.constructUser" placeholder="请填写施工人"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="负责人" prop="headName">
|
|
|
+ <!-- <el-form-item label="负责人" prop="headName">
|
|
|
<el-input v-model="zEngineeringInfoBo.headName" placeholder="请填写负责人"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="负责人电话" prop="headPhone">
|
|
|
<el-input v-model="zEngineeringInfoBo.headPhone" placeholder="请填写负责人电话"></el-input>
|
|
|
</el-form-item>
|
|
@@ -124,9 +125,9 @@
|
|
|
<!-- 节点复选框 -->
|
|
|
<el-checkbox-group v-model="currentNode" @change="currentNodeHasChanged">
|
|
|
<el-checkbox
|
|
|
- :label="e"
|
|
|
+ :label="e.name"
|
|
|
v-for="e in nodeList"
|
|
|
- :key="e"
|
|
|
+ :key="e.name"
|
|
|
></el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
<div style="display: flex;margin-top: 3%;">
|
|
@@ -302,7 +303,6 @@ export default {
|
|
|
],
|
|
|
enginClassification:'',
|
|
|
enginClassificationOption:[],
|
|
|
-
|
|
|
currentType:null , // 民用工程 0 ,市政工程 1,工业工程 2 ,顶管工程 3,危险作业工程 4,基建工程 5
|
|
|
drawer: false,
|
|
|
direction: 'rtl',
|
|
@@ -313,9 +313,14 @@ export default {
|
|
|
visitType:'', // 上门类型
|
|
|
selfClosingValveType:'', // 自闭阀类型
|
|
|
},
|
|
|
+ beforeNodeName:null, // 上一个所选的节点全名称
|
|
|
currentNode:[],
|
|
|
nodeList:[],
|
|
|
currentPickedNode:{} , // 当前所选中的节点界面
|
|
|
+ zEngineeringNodeBoList:[
|
|
|
+
|
|
|
+ ], // 节点信息大集合
|
|
|
+ tabsModel:""
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -323,17 +328,57 @@ export default {
|
|
|
this.options[1].children = this.dict.type.new_built
|
|
|
},
|
|
|
methods:{
|
|
|
+ confirmLeave(){
|
|
|
+ let p = new Promise((resolve, reject) => {
|
|
|
+ this.$refs.nodeForm.validate(e => {
|
|
|
+ e ? resolve() : reject();
|
|
|
+ if(e){
|
|
|
+ this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '请完善当前节点信息',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ return p;
|
|
|
+ },
|
|
|
nodeHasChanged(el){
|
|
|
- this.$nodeForm.validate(e => {
|
|
|
+ if(el.label == this.beforeNodeName ) return
|
|
|
+ // todo: 校验当前表单
|
|
|
+ this.$refs.nodeForm.validate(e => {
|
|
|
if(e){
|
|
|
- // 通过校验
|
|
|
- this.currentPickedNode
|
|
|
+ this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'sucess'
|
|
|
+ });
|
|
|
+ // todo: 将当前的节点信息录入到大集合中
|
|
|
+ if(this.beforeNodeName != null){
|
|
|
+ const beforeNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => this.beforeNodeName == e.name)
|
|
|
+ this.zEngineeringNodeBoList[beforeNodeInfoIndex].zEngineeringInfoBo = this.zEngineeringInfoBo
|
|
|
+ }
|
|
|
+ // end
|
|
|
+ const currentNodeInfo = this.zEngineeringNodeBoList.find(e => el.label == e.name)
|
|
|
+ const currentNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => el.label == e.name)
|
|
|
+ // todo: 将当前tab页所选节点信息录入
|
|
|
+ this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
|
|
|
+ this.beforeNodeName = this.zEngineeringNodeBoList[currentNodeInfoIndex].name
|
|
|
+ console.log('节点信息大集合',this.zEngineeringNodeBoList)
|
|
|
}else{
|
|
|
- this.$message.error('请完善当前节点信息!');
|
|
|
+ this.$message({
|
|
|
+ message: '请完善当前节点信息',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- return
|
|
|
+ return
|
|
|
// 拿到当前所选择的节点info
|
|
|
const nodeItem = this.dict.type.engineering_infrastructure.find(e => e.label == this.currentNode[el.index -1])
|
|
|
this.currentPickedNode = nodeItem
|
|
@@ -341,6 +386,28 @@ export default {
|
|
|
},
|
|
|
// 当前所选节点发生改变
|
|
|
currentNodeHasChanged(e){
|
|
|
+ const currentName = e[e.length -1]
|
|
|
+ const currentNodeInfo = this.nodeList.find(e => e.name == currentName)
|
|
|
+ // todo: 填入节点大集合
|
|
|
+ this.zEngineeringNodeBoList.push({
|
|
|
+ type:currentNodeInfo.value,
|
|
|
+ validateFlag:null, // 校验当前集合是否通过标识
|
|
|
+ name:currentNodeInfo.name, // 节点完整名称
|
|
|
+ zEngineeringInfoBo:{
|
|
|
+ constructAddre:'', // 施工地址
|
|
|
+ constructPhone:'', // 施工人电话
|
|
|
+ constructUser:'', // 施工人
|
|
|
+ headName:'', // 负责人
|
|
|
+ headPhone:'', // 负责人电话
|
|
|
+ constructAccordingDrawings:'', // 是否按图纸施工
|
|
|
+ segmentedCompressionQualified:'', // 分段打压是否合格
|
|
|
+ backfillTime:'', // 回填时间
|
|
|
+ constructTime:'', // 施工时间
|
|
|
+ zEngiineeringPhotoBoList:[], // 图片列表
|
|
|
+ zEngineeringMaterialBo:[], // 用料对象
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('节点信息大集合',this.zEngineeringNodeBoList)
|
|
|
},
|
|
|
// 添加用料
|
|
|
addMaterial(){
|
|
@@ -367,7 +434,18 @@ export default {
|
|
|
switch(this.currentType){
|
|
|
case 0 :
|
|
|
// 民用工程 新增
|
|
|
- this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
|
|
|
+ console.log('节点信息大集合',this.zEngineeringNodeBoList)
|
|
|
+ console.log('节点option',this.nodeList)
|
|
|
+ // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
|
|
|
+ this.params.zEngineeringNodeBoList = []
|
|
|
+ this.zEngineeringNodeBoList.forEach(e => {
|
|
|
+ this.params.zEngineeringNodeBoList.push({
|
|
|
+ type:e.type,
|
|
|
+ zEngineeringInfoBo:e.zEngineeringInfoBo
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.params.enginType = this.nodeList[0].enginType
|
|
|
+ this.params.enginClassification = this.nodeList[0].enginClassification
|
|
|
addEngineeringCivil(this.params).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.$message({
|
|
@@ -399,9 +477,18 @@ export default {
|
|
|
break;
|
|
|
case 4 :
|
|
|
// 基建工程新增
|
|
|
- this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
|
|
|
- this.params.zEngineeringNodeBo.type = this.nodeType
|
|
|
- this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
|
|
|
+ this.params.zEngineeringNodeBoList = []
|
|
|
+ this.zEngineeringNodeBoList.forEach(e => {
|
|
|
+ this.params.zEngineeringNodeBoList.push({
|
|
|
+ type:e.type,
|
|
|
+ zEngineeringInfoBo:e.zEngineeringInfoBo
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
|
|
|
+ // this.params.zEngineeringNodeBo.type = this.nodeType
|
|
|
+ // this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
|
|
|
addEngineeringInfrastructure(this.params).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.$message({
|
|
@@ -500,12 +587,33 @@ export default {
|
|
|
// }
|
|
|
// });
|
|
|
},
|
|
|
- open(queryParams,type = null,nodeList = []){
|
|
|
- this.nodeList = [] // 节点初始化
|
|
|
- // 初始化工程节点
|
|
|
- this.dict.type.engineering_infrastructure.forEach(e => {
|
|
|
- this.nodeList.push(e.label)
|
|
|
+ open(queryParams,type = null,nodeOptions = []){
|
|
|
+ // this.nodeList = []
|
|
|
+ this.nodeList = nodeOptions // 节点初始化
|
|
|
+ console.log('节点option',this.nodeList)
|
|
|
+ this.currentNode = []
|
|
|
+ this.currentNode.push(nodeOptions[0].name) // tab页默认选中第一条节点
|
|
|
+ console.log(nodeOptions[0])
|
|
|
+ this.beforeNodeName = nodeOptions[0].name
|
|
|
+ this.zEngineeringNodeBoList.push({
|
|
|
+ type:nodeOptions[0].value,
|
|
|
+ validateFlag:null, // 校验当前集合是否通过标识
|
|
|
+ name:nodeOptions[0].name, // 节点完整名称
|
|
|
+ zEngineeringInfoBo:{
|
|
|
+ constructAddre:'', // 施工地址
|
|
|
+ constructPhone:'', // 施工人电话
|
|
|
+ constructUser:'', // 施工人
|
|
|
+ headName:'', // 负责人
|
|
|
+ headPhone:'', // 负责人电话
|
|
|
+ constructAccordingDrawings:'', // 是否按图纸施工
|
|
|
+ segmentedCompressionQualified:'', // 分段打压是否合格
|
|
|
+ backfillTime:'', // 回填时间
|
|
|
+ constructTime:'', // 施工时间
|
|
|
+ zEngiineeringPhotoBoList:[], // 图片列表
|
|
|
+ zEngineeringMaterialBo:[], // 用料对象
|
|
|
+ }
|
|
|
})
|
|
|
+ this.tabsModel = nodeOptions[0].name
|
|
|
console.log('当前工程所有节点',this.nodeList)
|
|
|
// end
|
|
|
this.currentType = type
|
|
@@ -551,11 +659,20 @@ export default {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.el-checkbox{
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
+::v-deep .el-dialog:not(.is-fullscreen) {
|
|
|
+ margin-top: 4vh !important;
|
|
|
+}
|
|
|
::v-deep .appendElNodeDialog{
|
|
|
// width: 70%;
|
|
|
- height: 80%;
|
|
|
-
|
|
|
+ height: 93%;
|
|
|
|
|
|
+ .el-checkbox-group{
|
|
|
+ padding-left: 5%;
|
|
|
+ }
|
|
|
.el-dialog__body{
|
|
|
height: 85%;
|
|
|
}
|