|
@@ -167,7 +167,7 @@
|
|
<script >
|
|
<script >
|
|
import ManualSorting from '@/components/WbsTree/ManualSorting'
|
|
import ManualSorting from '@/components/WbsTree/ManualSorting'
|
|
import { getLazyTree,add,getDetail,getChildList,updateNode,removeNode,getSameList,sortNode,getEngineeringTypeName,getNodeTypeList } from "@/api/measure/template.js";
|
|
import { getLazyTree,add,getDetail,getChildList,updateNode,removeNode,getSameList,sortNode,getEngineeringTypeName,getNodeTypeList } from "@/api/measure/template.js";
|
|
-import { getDictionary } from "@/api/system/dict";
|
|
|
|
|
|
+import {getDictionary as getDictbiz} from "@/api/system/dictbiz";
|
|
import {isObjectEmpty} from "@/util/util";
|
|
import {isObjectEmpty} from "@/util/util";
|
|
import { getStore, setStore } from "@/util/store";
|
|
import { getStore, setStore } from "@/util/store";
|
|
|
|
|
|
@@ -230,6 +230,9 @@ import { getStore, setStore } from "@/util/store";
|
|
],
|
|
],
|
|
engineeringType: [
|
|
engineeringType: [
|
|
{ required: true, message: '请输入工程类型', trigger: 'blur' }
|
|
{ required: true, message: '请输入工程类型', trigger: 'blur' }
|
|
|
|
+ ],
|
|
|
|
+ nodeType:[
|
|
|
|
+ { required: true, message: '请选择工程类型', trigger: 'change' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
sortTag2: false,
|
|
sortTag2: false,
|
|
@@ -266,12 +269,22 @@ import { getStore, setStore } from "@/util/store";
|
|
if (this.dataTypeList.length > 1) {
|
|
if (this.dataTypeList.length > 1) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- getNodeTypeList({id}).then((res) => {
|
|
|
|
- res.data.data.forEach(element => {
|
|
|
|
- element.dictKey = Number(element.dictKey)
|
|
|
|
- });
|
|
|
|
|
|
+ // getNodeTypeList({id}).then((res) => {
|
|
|
|
+ // res.data.data.forEach(element => {
|
|
|
|
+ // element.dictKey = Number(element.dictKey)
|
|
|
|
+ // });
|
|
|
|
+ // this.dataTypeList = res.data.data;
|
|
|
|
+ // })
|
|
|
|
+ getDictbiz({
|
|
|
|
+ code: 'meter_unit_type'
|
|
|
|
+ }).then((res) => {
|
|
|
|
+
|
|
this.dataTypeList = res.data.data;
|
|
this.dataTypeList = res.data.data;
|
|
|
|
+ this.dataTypeList.forEach((ele)=>{
|
|
|
|
+ ele.dictKey=Number(ele.dictKey)
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
+
|
|
},
|
|
},
|
|
//获取节点类型对应的名称
|
|
//获取节点类型对应的名称
|
|
getNodeTypeName(type){
|
|
getNodeTypeName(type){
|
|
@@ -398,7 +411,7 @@ import { getStore, setStore } from "@/util/store";
|
|
},
|
|
},
|
|
saveAddform(){
|
|
saveAddform(){
|
|
//新增节点确定
|
|
//新增节点确定
|
|
- this.adddialogVisible=false
|
|
|
|
|
|
+
|
|
if( this.menuKey==='add'){
|
|
if( this.menuKey==='add'){
|
|
this.$refs.ruleForm.validate(async (valid) => {
|
|
this.$refs.ruleForm.validate(async (valid) => {
|
|
if(valid){
|
|
if(valid){
|
|
@@ -409,6 +422,7 @@ import { getStore, setStore } from "@/util/store";
|
|
let subobj=this.addForm
|
|
let subobj=this.addForm
|
|
add(subobj).then(() => {
|
|
add(subobj).then(() => {
|
|
this.saveNodeLoading=false
|
|
this.saveNodeLoading=false
|
|
|
|
+ this.adddialogVisible=false
|
|
this.updateTreeNewNode();
|
|
this.updateTreeNewNode();
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
this.addForm={}
|
|
this.addForm={}
|
|
@@ -419,6 +433,7 @@ import { getStore, setStore } from "@/util/store";
|
|
//刷新页面
|
|
//刷新页面
|
|
// window.location.reload()
|
|
// window.location.reload()
|
|
this.defaultExpandedKeys = getStore({ name: this.expandName });
|
|
this.defaultExpandedKeys = getStore({ name: this.expandName });
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -426,21 +441,27 @@ import { getStore, setStore } from "@/util/store";
|
|
}
|
|
}
|
|
if(this.menuKey==='edit'){
|
|
if(this.menuKey==='edit'){
|
|
let subobj=this.addForm
|
|
let subobj=this.addForm
|
|
- updateNode(subobj).then(() => {
|
|
|
|
- this.saveNodeLoading=false
|
|
|
|
- this.updateTreeNewNode();
|
|
|
|
- this.dialogVisible = false;
|
|
|
|
- this.addForm={}
|
|
|
|
- this.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "修改成功!"
|
|
|
|
- });
|
|
|
|
- getDetail(subobj.id).then((res) => {
|
|
|
|
- this.nodeDetail = Object.assign({}, res.data.data);
|
|
|
|
- this.getNodeTypeName(this.nodeDetail.nodeType)
|
|
|
|
-
|
|
|
|
|
|
+ this.$refs.ruleForm.validate(async (valid) => {
|
|
|
|
+ if(valid){
|
|
|
|
+ updateNode(subobj).then(() => {
|
|
|
|
+ this.adddialogVisible=false
|
|
|
|
+ this.saveNodeLoading=false
|
|
|
|
+ this.updateTreeNewNode();
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.addForm={}
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "修改成功!"
|
|
|
|
+ });
|
|
|
|
+ getDetail(subobj.id).then((res) => {
|
|
|
|
+ this.nodeDetail = Object.assign({}, res.data.data);
|
|
|
|
+ this.getNodeTypeName(this.nodeDetail.nodeType)
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getNodeDetail (data, node) {
|
|
getNodeDetail (data, node) {
|