-
-
+
@@ -71,19 +70,18 @@ export default {
id: '',
deptId: ''
},
- options: []
+ options: [],
+ deptIdList: []
}
},
- methods: {
- deptIdChangeHandle (value, selectedData) {
- let len = 'value' + value
- // len.length == 5 表示 未勾选任何所属机构
- if (5 < len.length) {
- this.dataForm.deptId = this.$refs['org'].getCheckedNodes()[0].value
- } else {
+ watch: {
+ 'deptIdList': function (val) {
+ if (val.length === 0) {
this.dataForm.deptId = ''
+ } else {
+ this.dataForm.deptId = val[val.length - 1]
}
- },
+ }
},
created () {
this.$http