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
<?php
/**
* 领导机构-二维码编辑
* $Id: government_qr_edit.inc,v 1.1 2015/10/08 11:18:53 Exp $
* @author lixq
* @access public
* @package manager.templates
**/
?>
<div id="change">
<p class="edit_title">领导机构-二维码编辑</p>
<form id="government_qr_edit" action="government_qr_edit_result.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?=$id?>"/>
<input type="hidden" name="government_title" value="<?=$government_title?>"/>
<input type="hidden" name="government_id" value="<?=$government_id?>"/>
<input type="hidden" name="action_type" value="<?=$action_type?>"/>
<div class="edit_content">
<p>教育管局名称</p>
<p class="begin_blank"><?=htmlspecialchars($government_title) ?></p>
<p>最大使用次数</p>
<el-input v-model="max_count" type="number" name="max_count" class="input_200"></el-input>
<p>已使用次数</p>
<p class="begin_blank"><?=empty($use_count)?'0':$use_count?> </p>
<p>截止使用时间</p>
<el-date-picker v-model="limit_date" name="limit_date"id="limit_date" type="date" align="right" ></el-date-picker>
<p>二维码</p>
<img v-if="qr_image != ''" src="<?=$qr_image?>"/>
<br/>
<br/>
<el-button v-if="!qr_image"type="primary" @click="edit()" class="edit_btn">编辑并生成二维码</el-button>
<el-button v-if="qr_image"type="primary" @click="edit()" class="edit_btn">编辑</el-button>
<el-button type="primary" @click="back()" class="edit_btn">返回</el-button>
<br/><br/>
</div>
</form>
</div>
<script type="text/javascript">
new Vue({
el:'#change',
data:{
action_type:'<?=$action_type?>',
max_count:'<?=$max_count?>',
limit_date:'<?=$limit_date?>',
qr_image:'<?=$qr_image?>'
},
methods:{
back:function(){
window.history.go(-1);
},
clearDate(){
$('#limit_date').val('');
},
edit:function(){
if(!this.max_count){
this.$message({
type: 'error',
message: '请输入最大使用次数!'
});
return;
}
if(!isNumber(this.max_count)){
this.$message({
type: 'error',
message: '最大使用次数请输入数字!'
});
return;
}
if(!$('#limit_date').val()){
this.$message({
type: 'error',
message: '选择截止使用时间!'
});
return;
}
$('#government_qr_edit').submit();
}
}
})
</script>