居民档案结构重组

This commit is contained in:
aixianling
2022-04-20 14:19:14 +08:00
parent d1e3e69006
commit 86c8722638
6 changed files with 114 additions and 1162 deletions

View File

@@ -0,0 +1,77 @@
<template>
<section class="tagsManage">
<el-form ref="PersonalAssets" :model="form" size="small" label-width="0">
<ai-edit-card title="标签信息" :show-btn="permissions('app_appresident_edit')"
@save="submitTags" @cancel="getTags">
<template #edit>
<el-form-item prop="">
<el-checkbox label="1">标签1</el-checkbox>
</el-form-item>
</template>
<template>
<el-tag effect="dark">标签二</el-tag>
</template>
</ai-edit-card>
</el-form>
</section>
</template>
<script>
import {mapState} from "vuex";
import AiEditCard from "./AiEditCard";
export default {
name: "tagsManage",
components: {AiEditCard},
props: {
instance: Function,
dict: Object,
permissions: Function,
residentId: {required: true, default: ""}
},
computed: {
...mapState(['user']),
},
data() {
return {
form: {}
}
},
methods: {
getTags() {
let {residentId} = this
this.instance.post("/app/appresidentvehicle/list", null, {
params: {residentId}
}).then(res => {
if (res?.data) {
this.form.cars = res.data.records || []
}
})
},
submitTags(cb) {
this.$refs.PersonalAssets.validate(v => {
if (v) {
let {residentId, form: {cars: residentVehicleList}} = this
this.instance.post("/app/appresidentvehicle/update", {
residentId, residentVehicleList
}).then(res => {
if (res?.code == 0) {
this.$message.success("提交成功")
this.getCars()
cb?.()
}
})
}
})
},
},
created() {
this.getTags()
}
}
</script>
<style lang="scss" scoped>
.tagsManage {
}
</style>