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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* 机构账号编辑
* $Id: org_account_edit_input.inc,v 1.1 2015/10/08 11:18:53 Exp $
* @author lixq
* @access public
* @package manager.templates
**/
global $id;
global $login;
global $password;
global $name;
global $contact;
global $comment;
global $error_message;
?>
<div id="change">
<p class="edit_title">机构账号编辑</p>
<div class="edit_content">
<form id="form" method="post" action="org_account_edit_result.php" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?=$id?>"/>
<input type="hidden" name="uid" value="<?=$uid?>"/>
<input type="hidden" name="action_type" value="<?=$action_type?>"/>
<p>登陆帐号</p>
<el-input v-model="login" name="login" class="input_200"></el-input><br />
<p>登陆密码</p>
<el-input v-model="password" name="password" class="input_200"></el-input><br />
<p>账户名称</p>
<el-input v-model="name" name="name" class="input_200"></el-input><br />
<p>联系方式</p>
<el-input v-model="contact" name="contact" class="input_200"></el-input><br />
<p>备注</p>
<textarea v-model="comment" name="comment" rows="5" class="input_200"></textarea>
<br/><br/>
<el-button type="primary" class="edit_btn" @click="submitForm()">编辑</el-button>
<el-button type="primary" class="edit_btn" @Click="window.location='./org_account_list.php?id=<?=$uid?>'" />返回</el-button>
<br/><br/>
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var vm = new Vue({
el: '#form',
data: {
login: '<?=htmlspecialchars($login) ?>',
password:'<?=htmlspecialchars($password) ?>',
contact:'<?=htmlspecialchars($contact) ?>',
name:'<?=htmlspecialchars($name) ?>',
comment:'<?=htmlspecialchars($comment) ?>'
},
methods: {
submitForm() {
if(!this.login){
this.$message({
type: 'error',
message: '请输入登陆帐号。'
});
return;
}
if (!isAlpaNum(this.login)) {
this.$message({
type: 'error',
message: '登陆帐号只能使用半角英文或数字。'
});
return;
}
if (!this.password) {
this.$message({
type: 'error',
message: '请输入登陆密码。'
});
return;
}
if (!isAlpaNum(this.password)) {
this.$message({
type: 'error',
message: '登陆密码只能使用半角英文或数字。'
});
return;
}
if (!this.name) {
this.$message({
type: 'error',
message: '请输入账户名称。'
});
return;
}
$('#form').submit();
}
}
})
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
</script>