1
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
| <template>
| <GlobalAlertWindow
| :title="title"
| :visible.sync="visible"
| :confirm-working="isWorking"
| @confirm="confirm"
| >
| <el-form :model="form" ref="form" :rules="rules" label-width="100px" label-suffix=":" inline>
| <div>
| <el-form-item label="姓名" prop="realname">
| <el-input v-model="form.realname" placeholder="请输入姓名" v-trim/>
| </el-form-item>
| </div>
| <div>
| <el-form-item label="手机号" prop="mobile">
| <el-input v-model="form.mobile" placeholder="请输入手机号" v-trim/>
| </el-form-item>
| </div>
| </el-form>
| </GlobalAlertWindow>
| </template>
|
| <script>
| import BaseOpera from '@/components/base/BaseOpera'
| import GlobalAlertWindow from '@/components/common/GlobalAlertWindow'
| import { updateSystemUser } from '@/api/business/account'
| import { checkMobile, nameRule, creditCode } from '@/utils/form'
| export default {
| name: 'OperaChangeUserInfoWindow',
| extends: BaseOpera,
| components: { GlobalAlertWindow },
| data () {
| return {
| // 表单数据
| form: {
| id: null,
| type: 0,
| realname: '',
| mobile: ''
| },
| // 验证规则
| rules: {
| realname: [
| { required: false, validator: nameRule, trigger: 'blur' }
| ],
| mobile: [
| { required: false, validator: checkMobile, trigger: 'blur' }
| ]
| },
| }
| },
| created () {
| this.config({
| api: '/business/childrenUser',
| 'field.id': 'id'
| })
| },
| methods: {
| confirm() {
| console.log(this.form);
|
| this.isWorking = true
| updateSystemUser(this.form)
| .then(() => {
| this.visible = false
| this.$message.success('修改成功')
| this.$emit('success')
| })
| .catch(e => {
| this.$message.error(e)
| })
| .finally(() => {
| this.isWorking = false
| })
| }
| },
| }
| </script>
|
| <style lang="scss" scoped>
| ::v-deep .el-form-item__content {
| .el-input__inner {
| width: 200px;
| }
| }
| </style>
|
|