|
|
|
@ -14,7 +14,6 @@ |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_2" |
|
|
|
:disabled="defaultRole==='1'" |
|
|
|
placeholder="请输入角色名称" |
|
|
|
clearable |
|
|
|
v-model="formData.tagName"> |
|
|
|
@ -64,10 +63,7 @@ export default { |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
btnDisable: false, |
|
|
|
orgOptions:[], |
|
|
|
roleId: '', |
|
|
|
sbid:'', |
|
|
|
menuList: [], |
|
|
|
menuListShuju: [], |
|
|
|
tagId:'', |
|
|
|
formData: { |
|
|
|
tagName: '', |
|
|
|
agencyId:'', |
|
|
|
@ -82,8 +78,6 @@ export default { |
|
|
|
{ required: true, message: '应用范围不能为空', trigger: 'blur' } |
|
|
|
] |
|
|
|
}, |
|
|
|
|
|
|
|
defaultRole: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
@ -93,15 +87,25 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async initForm (type, row, defaultRole) { |
|
|
|
async initForm (type, row) { |
|
|
|
this.startLoading() |
|
|
|
this.formType = type |
|
|
|
this.formData = {...row} |
|
|
|
console.log(row); |
|
|
|
if(type!='add'){ |
|
|
|
this.formData.tagName = row.tagName |
|
|
|
this.tagId = row.id |
|
|
|
if(row.agencyList.length>1){ |
|
|
|
this.formData.agencyId = row.agencyList[0].orgIdPath.split(':')[1] |
|
|
|
this.formData.orgIdPath = row.agencyList[0].orgIdPath.split(':')[0] +':'+ row.agencyList[0].orgIdPath.split(':')[1] |
|
|
|
}else{ |
|
|
|
this.formData.agencyId = row.agencyList[0].agencyId |
|
|
|
this.formData.orgIdPath = row.agencyList[0].orgIdPath |
|
|
|
} |
|
|
|
} |
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
}, |
|
|
|
async getOrgTreeList() { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.dataListLoading = true |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customeragency/staffinagencylist') |
|
|
|
@ -111,8 +115,6 @@ export default { |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
let { agencyList, subAgencyList } = res.data |
|
|
|
// this.optionsA = res.data |
|
|
|
// console.log(this.optionsA); |
|
|
|
const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }] |
|
|
|
this.orgOptions = this.deepTree(_arr) |
|
|
|
} |
|
|
|
@ -135,19 +137,17 @@ export default { |
|
|
|
}, |
|
|
|
cascaderClick () { |
|
|
|
let obj = this.$refs["cascaderUnit"].getCheckedNodes()[0].data |
|
|
|
var arr = [] |
|
|
|
this.formDatam = [] |
|
|
|
if (obj) { |
|
|
|
if (obj.level === "street" && obj.subAgencyList!= null) { |
|
|
|
if (obj.level === "street") { |
|
|
|
for(let i in obj.subAgencyList){ |
|
|
|
this.formDatam.push({'agencyId':obj.subAgencyList[i].agencyId,'orgIdPath':obj.orgIdPath}) |
|
|
|
this.formData.push({'agencyId':obj.subAgencyList[i].agencyId,'orgIdPath':obj.subAgencyList[i].orgIdPath}) |
|
|
|
} |
|
|
|
console.log( this.formDatam); |
|
|
|
} else { |
|
|
|
this.$set(this.formData,'agencyId',obj.agencyId) |
|
|
|
this.$set(this.formData,'orgIdPath',obj.orgIdPath) |
|
|
|
this.formDatam.push({'agencyId':obj.agencyId,'orgIdPath':obj.orgIdPath}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.formData.agencyId = '' |
|
|
|
this.formDatam = [] |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
@ -171,27 +171,26 @@ export default { |
|
|
|
let url = '' |
|
|
|
if (this.formType === 'add') { |
|
|
|
url = '/gov/voice/tag/save' |
|
|
|
|
|
|
|
} else { |
|
|
|
url = '/gov/voice/tag/update' |
|
|
|
|
|
|
|
} |
|
|
|
console.log(this.formData); |
|
|
|
const { tagName,orgIdPath,agencyId} = this.formData |
|
|
|
const { tagName} = this.formData |
|
|
|
let params = {} |
|
|
|
if(agencyId &&this.formDatam.length==0){ |
|
|
|
params = { |
|
|
|
tagName, |
|
|
|
agencyList:{ |
|
|
|
orgIdPath, |
|
|
|
agencyId, |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
if(this.formType != 'add'){ |
|
|
|
if(this.formDatam.length == 0){ |
|
|
|
this.formDatam.push({'agencyId':this.formData.agencyId,'orgIdPath':this.formData.orgIdPath}) |
|
|
|
} |
|
|
|
params = { |
|
|
|
tagName, |
|
|
|
agencyList:this.formDatam, |
|
|
|
id:this.tagId |
|
|
|
} |
|
|
|
}else{ |
|
|
|
params = { |
|
|
|
tagName, |
|
|
|
agencyList:this.formDatam |
|
|
|
} |
|
|
|
params = { |
|
|
|
tagName, |
|
|
|
agencyList:this.formDatam, |
|
|
|
} |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url,params) |
|
|
|
if (code === 0) { |
|
|
|
@ -207,7 +206,6 @@ export default { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
this.formDatam = [] |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle () { |
|
|
|
@ -217,9 +215,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
resetData () { |
|
|
|
|
|
|
|
this.roleId = '' |
|
|
|
|
|
|
|
this.formData = { |
|
|
|
tagName: '', |
|
|
|
} |
|
|
|
@ -242,17 +237,8 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
props: { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|