|
|
@ -53,7 +53,7 @@ |
|
|
|
v-model="dataForm.deptIdsArr" |
|
|
|
:options="options" |
|
|
|
:props="{ checkStrictly: true }" |
|
|
|
@visible-change="changeHandle" |
|
|
|
@change="changeHandle" |
|
|
|
style="width:50%;" |
|
|
|
> |
|
|
|
</el-cascader> |
|
|
@ -164,22 +164,7 @@ export default { |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
changeHandle (value, selectedData) { |
|
|
|
let allDeptIds = '0,' |
|
|
|
let allDeptNames = '市北区委-' |
|
|
|
if (this.$refs['name']._data.checkedValue !== null && this.$refs['name']._data.checkedValue.length > 0) { |
|
|
|
let nameArrStr = this.$refs['name']._data.inputValue |
|
|
|
let nameArr = nameArrStr.split(' / ') |
|
|
|
for (var i = 0; i < this.$refs['name']._data.checkedValue.length; i++) { |
|
|
|
allDeptIds += this.$refs['name']._data.checkedValue[i] + ',' |
|
|
|
allDeptNames += nameArr[i] + '-' |
|
|
|
} |
|
|
|
} |
|
|
|
this.dataForm.allDeptIds = allDeptIds.length > 0 ? allDeptIds.substring(0, allDeptIds.length - 1) : allDeptIds |
|
|
|
this.dataForm.allDeptNames = allDeptNames.length > 0 ? allDeptNames.substring(0, allDeptNames.length - 1) : allDeptNames |
|
|
|
this.dataForm.parentDeptIds = this.dataForm.allDeptIds.substring(0, this.dataForm.allDeptIds.lastIndexOf(',')) |
|
|
|
this.dataForm.parentDeptNames = this.dataForm.allDeptNames.substring(0, this.dataForm.allDeptNames.lastIndexOf('-')) |
|
|
|
this.dataForm.deptId = this.dataForm.allDeptIds.substring(this.dataForm.allDeptIds.lastIndexOf(',')).replace(',', '') |
|
|
|
this.dataForm.deptName = this.dataForm.allDeptNames.substring(this.dataForm.allDeptNames.lastIndexOf('-')).replace('-', '') |
|
|
|
this.dataForm.deptId = value[value.length - 1] |
|
|
|
}, |
|
|
|
// 上传图片 |
|
|
|
handleAvatarSuccess (res, file) { |
|
|
|