6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
1
|
<template>
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<el-dialog
:title="$t('org.editOrg')"
:visible.sync="visible"
width="50%"
@close="handleClose"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item :label="$t('org.orgName')" prop="orgName">
<el-input v-model="form.orgName" :placeholder="$t('org.orgName')" />
</el-form-item>
<el-form-item :label="$t('org.parentOrg')" prop="parentOrgName">
<el-input v-model="form.parentOrgName" disabled />
</el-form-item>
<el-form-item :label="$t('org.description')" prop="description">
<el-input
v-model="form.description"
type="textarea"
:placeholder="$t('org.description')"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('org.cancel') }}</el-button>
<el-button type="primary" @click="handleSubmit">{{ $t('org.save') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { updateOrg, listOrgs } from '@/api/org/orgApi'
export default {
name: 'EditOrg',
data() {
return {
visible: false,
form: {
orgId: '',
orgName: '',
orgLevel:'',
parentOrgId: '',
parentOrgName: '',
description: ''
},
rules: {
orgName: [
|
d68ff4b5
wuxw
v1.9 优化admin下组织顶级...
|
48
|
{ required: true, message: this.$t('org.orgName'), trigger: 'blur' }
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
49
50
|
],
parentOrgId: [
|
d68ff4b5
wuxw
v1.9 优化admin下组织顶级...
|
51
|
{ required: true, message: this.$t('org.parentOrg') }
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
52
53
|
],
description: [
|
d68ff4b5
wuxw
v1.9 优化admin下组织顶级...
|
54
|
{ required: true, message: this.$t('org.description'), trigger: 'blur' }
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
],
orgId: [
{ required: true, message: this.$t('org.orgIdRequired') }
]
}
}
},
methods: {
show(data) {
console.log(data)
this.form = {
orgId: data.id,
orgName: data.text,
orgLevel: '',
|
5077115f
wuxw
v1.9 优化组织修改显示不正确bug
|
69
70
71
|
// parentOrgId: data.parentId,
// parentOrgName: data.parentText || '',
//description: data.text || ''
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
72
73
74
75
76
|
}
this.visible = true
this.getList()
},
async getList() {
|
5077115f
wuxw
v1.9 优化组织修改显示不正确bug
|
77
|
const {orgs} = await listOrgs({
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
78
79
80
81
|
page: 1,
row: 1,
orgId: this.form.orgId
})
|
5077115f
wuxw
v1.9 优化组织修改显示不正确bug
|
82
83
|
this.form = {...orgs[0]}
console.log(orgs)
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
84
85
86
87
88
89
|
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
updateOrg(this.form).then(response => {
console.log(response)
|
6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
90
|
this.$message.success(this.$t('common.operationSuccess'))
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
91
92
|
this.visible = false
this.$emit('refresh')
|
d68ff4b5
wuxw
v1.9 优化admin下组织顶级...
|
93
94
|
},err=>{
this.$message.error(err)
|
a42b3256
wuxw
HC小区管理系统前段vue版正在开发中
|
95
96
97
98
99
100
101
102
103
104
|
})
}
})
},
handleClose() {
this.$refs.form.resetFields()
}
}
}
</script>
|