|
@@ -12,7 +12,7 @@
|
|
|
<div class="Deltitle">删除源数据</div>
|
|
|
<div class="content er">
|
|
|
<div class="log">
|
|
|
- 是否确认删除{{ rmObj.AuthName }}?
|
|
|
+ 是否确认删除{{ rmObj.locationCode }}?
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="DelFoot right t30">
|
|
@@ -31,7 +31,7 @@
|
|
|
<el-input v-model="ruleForm.locationCode" size="medium" placeholder="请输入节点名称(必填)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="跟踪节点标识符" prop="nodeCode">
|
|
|
- <el-input v-model="ruleForm.nodeCode" size="medium" placeholder="请输入跟踪节点标识符(必填)" />
|
|
|
+ <el-input v-model="ruleForm.nodeCode" :disabled="disFlag" size="medium" placeholder="请输入跟踪节点标识符(必填)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="跟踪节点描述" prop="locationCodeDescribe">
|
|
|
<el-input v-model="ruleForm.locationCodeDescribe" size="medium" type="textarea" :rows="3" placeholder="请输入跟踪节点描述" />
|
|
@@ -108,6 +108,7 @@ export default {
|
|
|
nodeCode: [{ required: true, message: '请输入跟踪节点标识符', trigger: 'blur' }]
|
|
|
},
|
|
|
type: '',
|
|
|
+ disFlag: false,
|
|
|
typeObj: {}
|
|
|
}
|
|
|
},
|
|
@@ -167,10 +168,20 @@ export default {
|
|
|
},
|
|
|
onNodeSub (data, e) {
|
|
|
e.stopPropagation();
|
|
|
+ const { Type, nodeCode } = data
|
|
|
this.editDialogTitle = '新增节点信息'
|
|
|
this.editDialogVisible = true
|
|
|
this.type = 'add'
|
|
|
this.typeObj = data
|
|
|
+ if (Type != 0) {
|
|
|
+ this.disFlag = true
|
|
|
+ this.ruleForm.nodeCode = nodeCode
|
|
|
+ } else {
|
|
|
+ this.disFlag = false
|
|
|
+ this.ruleForm.nodeCode = ''
|
|
|
+ }
|
|
|
+ this.ruleForm.locationCode = ''
|
|
|
+ this.ruleForm.locationCodeDescribe = ''
|
|
|
},
|
|
|
onNodeEdit (data, e) {
|
|
|
e.stopPropagation();
|
|
@@ -179,12 +190,18 @@ export default {
|
|
|
this.type = 'edit'
|
|
|
this.typeObj = data
|
|
|
this.ruleForm = data
|
|
|
+ this.disFlag = true
|
|
|
},
|
|
|
// 新增/编辑-确认
|
|
|
submitClickHandler () {
|
|
|
this.$refs['ruleForm'].validate(valid => {
|
|
|
if (valid) {
|
|
|
const { Type } = this.typeObj
|
|
|
+ if (this.ruleForm.operate) {
|
|
|
+ delete this.ruleForm.operate
|
|
|
+ }
|
|
|
+ delete this.ruleForm.Type
|
|
|
+ delete this.ruleForm.children
|
|
|
if (this.type == 'add') {
|
|
|
if (Type == 0) {
|
|
|
this.nodeTreeData(20, this.ruleForm)
|
|
@@ -192,12 +209,8 @@ export default {
|
|
|
this.nodeTreeData(21, this.ruleForm)
|
|
|
}
|
|
|
} else {
|
|
|
- if (Type == 1) {
|
|
|
- this.ruleForm.operate = 2
|
|
|
- this.nodeTreeData(21, this.ruleForm)
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
+ this.ruleForm.operate = "2"
|
|
|
+ this.nodeTreeData(21, this.ruleForm)
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.resetForm('ruleForm')
|
|
@@ -208,7 +221,9 @@ export default {
|
|
|
// 重置
|
|
|
resetForm (formName) {
|
|
|
// this.ruleForm = {}
|
|
|
- this.$refs[formName].resetFields()
|
|
|
+ // if (this.type == 'add') {
|
|
|
+ // this.$refs[formName].resetFields()
|
|
|
+ // }
|
|
|
this.editDialogVisible = false
|
|
|
},
|
|
|
// 删除-弹框
|
|
@@ -218,41 +233,12 @@ export default {
|
|
|
},
|
|
|
// 确认删除
|
|
|
removeSubmit () {
|
|
|
- this.ruleForm.operate = 3
|
|
|
+ this.ruleForm = this.rmObj
|
|
|
+ this.ruleForm.operate = "3"
|
|
|
this.nodeTreeData(21, this.ruleForm)
|
|
|
this.removeDialogVisible = false
|
|
|
// this.$message.success('删除成功')
|
|
|
},
|
|
|
- async addSubmit () {
|
|
|
- try {
|
|
|
- const res = await GeneralDataReception({
|
|
|
- serviceId: '1',
|
|
|
- dataContent: JSON.stringify(this.ruleForm)
|
|
|
- })
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success(res.message ?? '成功')
|
|
|
- } else {
|
|
|
- this.$message.error(res.message ?? '失败')
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('错误', error)
|
|
|
- }
|
|
|
- },
|
|
|
- async editSubmit () {
|
|
|
- try {
|
|
|
- const res = await GeneralDataReception({
|
|
|
- serviceId: '1',
|
|
|
- dataContent: JSON.stringify(this.ruleForm)
|
|
|
- })
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success(res.message ?? '成功')
|
|
|
- } else {
|
|
|
- this.$message.error(res.message ?? '失败')
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('错误', error)
|
|
|
- }
|
|
|
- },
|
|
|
// 获取二级节点
|
|
|
async getTreeData () {
|
|
|
try {
|
|
@@ -266,7 +252,6 @@ export default {
|
|
|
item['children'] = [{}]
|
|
|
})
|
|
|
this.dataList.children = returnData
|
|
|
- console.log(this.dataList)
|
|
|
} else {
|
|
|
this.$message.error(message)
|
|
|
}
|
|
@@ -278,11 +263,12 @@ export default {
|
|
|
async nodeTreeData (serviceId, dataContent) {
|
|
|
try {
|
|
|
const { message, code } = await generalDataReception({
|
|
|
- serviceId,
|
|
|
- dataContent
|
|
|
+ "serviceId": `${serviceId}`,
|
|
|
+ "dataContent": JSON.stringify(dataContent)
|
|
|
})
|
|
|
if (code == 0) {
|
|
|
this.$message.success(message)
|
|
|
+ this.getTreeData()
|
|
|
} else {
|
|
|
this.$message.error(message)
|
|
|
}
|
|
@@ -299,7 +285,6 @@ export default {
|
|
|
})
|
|
|
if (returnData && returnData.length) {
|
|
|
const datas = this.dataList.children
|
|
|
- console.log(datas)
|
|
|
returnData.forEach(item => {
|
|
|
item['Type'] = 2
|
|
|
})
|