|
|
@ -12,8 +12,11 @@ |
|
|
|
<el-cascader |
|
|
|
v-model="form.subjectId" |
|
|
|
:options="treeData" |
|
|
|
ref="cascaderV" |
|
|
|
:props="props" |
|
|
|
style="width: 100%" |
|
|
|
@change="handleChangeCascaderV" |
|
|
|
|
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="迁入网格" prop="gridId"> |
|
|
@ -21,6 +24,8 @@ |
|
|
|
v-model="form.targetId" |
|
|
|
:options="treeData" |
|
|
|
:props="props2" |
|
|
|
ref="cascaderG" |
|
|
|
@change="handleChangeCascaderG" |
|
|
|
style="width: 100%" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
@ -49,6 +54,9 @@ export default { |
|
|
|
optionsG: [], |
|
|
|
treeData: [], |
|
|
|
autoOpenArr: [], |
|
|
|
checkedGLevel:'', |
|
|
|
sourceId:'', |
|
|
|
checkedVLevel:'', |
|
|
|
props: { |
|
|
|
children: "children", |
|
|
|
label: "label", |
|
|
@ -76,7 +84,6 @@ export default { |
|
|
|
value: "id", |
|
|
|
lazy: true, |
|
|
|
async lazyLoad(node, resolve) { |
|
|
|
|
|
|
|
const url = `/actual/base/communityBuilding/tree/nextTreeNode?id=${node.data.id}&level=${node.data.level}`; |
|
|
|
const {data, code, msg} = await requestGet(url); |
|
|
|
if (code === 0) { |
|
|
@ -100,14 +107,23 @@ export default { |
|
|
|
this.loadTree() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleChangeCascaderG(){ |
|
|
|
this.checkedGLevel = this.$refs.cascaderG.getCheckedNodes()[0].data.level; |
|
|
|
this.form.targetId = this.$refs.cascaderG.getCheckedNodes()[0].data.id; |
|
|
|
}, |
|
|
|
handleChangeCascaderV(){ |
|
|
|
this.checkedVLevel = this.$refs.cascaderV.getCheckedNodes()[0].data.level; |
|
|
|
this.form.subjectId = this.$refs.cascaderV.getCheckedNodes()[0].data.id; |
|
|
|
this.sourceId = this.$refs.cascaderV.getCheckedNodes()[0].data.pid |
|
|
|
}, |
|
|
|
async loadTree(isRefresh) { |
|
|
|
const url = "/actual/base/communityBuilding/tree/initTree"; |
|
|
|
const {data, code, msg} = await requestGet(url); |
|
|
|
if (code === 0) { |
|
|
|
this.treeData = []; |
|
|
|
data.children = null |
|
|
|
this.treeData.push(data); |
|
|
|
// 默认加载第一层 |
|
|
|
|
|
|
|
this.autoOpenArr.push(data.id) |
|
|
|
if (!isRefresh && data) { |
|
|
|
this.selTreeObj = data; |
|
|
@ -129,18 +145,18 @@ export default { |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
console.log(this.form.subjectId, 'form') |
|
|
|
if (this.form.subjectId.length < 5) { |
|
|
|
if (this.checkedVLevel!='neighborHood') { |
|
|
|
this.$message.error('请选择迁出小区') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.form.targetId.length < 4) { |
|
|
|
if (this.checkedGLevel!='grid') { |
|
|
|
this.$message.error('请选择迁入网格') |
|
|
|
return |
|
|
|
} |
|
|
|
let params = { |
|
|
|
subjectId: this.form.subjectId[4], |
|
|
|
targetId: this.form.targetId[3], |
|
|
|
sourceId: this.form.targetId[3], |
|
|
|
subjectId: this.form.subjectId, |
|
|
|
targetId: this.form.targetId, |
|
|
|
sourceId: this.sourceId, |
|
|
|
} |
|
|
|
let url = '/actual/base/baseDataTransfer/quarter/submit' |
|
|
|
this.$http.post(url, params).then(res => { |
|
|
|