|
@@ -13,7 +13,18 @@
|
|
|
<el-row :gutter="15">
|
|
|
<el-col :span="21">
|
|
|
<el-form-item label="上级节点" prop="parentId">
|
|
|
- <el-input v-model="inputForm.parentId" placeholder="请选择上级节点"></el-input>
|
|
|
+ <SelectTree
|
|
|
+ ref="areaTree"
|
|
|
+ :props="{
|
|
|
+ value: 'id', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+ url="/reimbursement/type/treeData"
|
|
|
+ :value="inputForm.parentId"
|
|
|
+ :clearable="true"
|
|
|
+ :accordion="true"
|
|
|
+ @getValue="(value) => {inputForm.parentId=value}"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="21">
|
|
@@ -41,6 +52,7 @@
|
|
|
|
|
|
<script>
|
|
|
import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
|
|
|
+ import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -59,6 +71,9 @@
|
|
|
created () {
|
|
|
this.reimbursementTypeService = new ReimbursementTypeService()
|
|
|
},
|
|
|
+ components: {
|
|
|
+ SelectTree
|
|
|
+ },
|
|
|
methods: {
|
|
|
init (method, id) {
|
|
|
this.method = method
|
|
@@ -82,9 +97,9 @@
|
|
|
this.visible = true
|
|
|
this.loading = false
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
this.loading = true
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
this.reimbursementTypeService.findById(this.inputForm.id).then(({data}) => {
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|