正在显示
3 个修改的文件
包含
49 行增加
和
7 行删除
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | 44 | ||
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
47 | - <div class="form-group"> | 47 | + <div class="form-group" id="d-send_rule_limit"> |
48 | <label class="control-label col-xs-12 col-sm-2">{:__('Send_rule_limit')}:</label> | 48 | <label class="control-label col-xs-12 col-sm-2">{:__('Send_rule_limit')}:</label> |
49 | <div class="col-xs-12 col-sm-8"> | 49 | <div class="col-xs-12 col-sm-8"> |
50 | <input id="c-send_rule_limit" class="form-control" name="row[send_rule_limit]" type="number" > | 50 | <input id="c-send_rule_limit" class="form-control" name="row[send_rule_limit]" type="number" > |
@@ -30,37 +30,37 @@ | @@ -30,37 +30,37 @@ | ||
30 | 30 | ||
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | - <div class="form-group"> | 33 | + <div class="form-group" id="d-send_rule_limit"> |
34 | <label class="control-label col-xs-12 col-sm-2">{:__('Send_rule_limit')}:</label> | 34 | <label class="control-label col-xs-12 col-sm-2">{:__('Send_rule_limit')}:</label> |
35 | <div class="col-xs-12 col-sm-8"> | 35 | <div class="col-xs-12 col-sm-8"> |
36 | <input id="c-send_rule_limit" class="form-control" name="row[send_rule_limit]" type="number" value="{$row.send_rule_limit|htmlentities}"> | 36 | <input id="c-send_rule_limit" class="form-control" name="row[send_rule_limit]" type="number" value="{$row.send_rule_limit|htmlentities}"> |
37 | </div> | 37 | </div> |
38 | </div> | 38 | </div> |
39 | - <div class="form-group"> | 39 | + <div id="d-voucher_amount" class="form-group"> |
40 | <label class="control-label col-xs-12 col-sm-2">{:__('Voucher_amount')}:</label> | 40 | <label class="control-label col-xs-12 col-sm-2">{:__('Voucher_amount')}:</label> |
41 | <div class="col-xs-12 col-sm-8"> | 41 | <div class="col-xs-12 col-sm-8"> |
42 | <input id="c-voucher_amount" class="form-control" name="row[voucher_amount]" type="number" value="{$row.voucher_amount|htmlentities}"> | 42 | <input id="c-voucher_amount" class="form-control" name="row[voucher_amount]" type="number" value="{$row.voucher_amount|htmlentities}"> |
43 | </div> | 43 | </div> |
44 | </div> | 44 | </div> |
45 | - <div class="form-group"> | 45 | + <div id="d-gift" class="form-group"> |
46 | <label class="control-label col-xs-12 col-sm-2">{:__('Gift')}:</label> | 46 | <label class="control-label col-xs-12 col-sm-2">{:__('Gift')}:</label> |
47 | <div class="col-xs-12 col-sm-8"> | 47 | <div class="col-xs-12 col-sm-8"> |
48 | <input id="c-gift" class="form-control" name="row[gift]" type="text" value="{$row.gift|htmlentities}"> | 48 | <input id="c-gift" class="form-control" name="row[gift]" type="text" value="{$row.gift|htmlentities}"> |
49 | </div> | 49 | </div> |
50 | </div> | 50 | </div> |
51 | - <div class="form-group"> | 51 | + <div id="d-consumption" class="form-group"> |
52 | <label class="control-label col-xs-12 col-sm-2">{:__('Consumption')}:</label> | 52 | <label class="control-label col-xs-12 col-sm-2">{:__('Consumption')}:</label> |
53 | <div class="col-xs-12 col-sm-8"> | 53 | <div class="col-xs-12 col-sm-8"> |
54 | <input id="c-consumption" class="form-control" name="row[consumption]" type="number" value="{$row.consumption|htmlentities}"> | 54 | <input id="c-consumption" class="form-control" name="row[consumption]" type="number" value="{$row.consumption|htmlentities}"> |
55 | </div> | 55 | </div> |
56 | </div> | 56 | </div> |
57 | - <div class="form-group"> | 57 | + <div id="d-reduction" class="form-group"> |
58 | <label class="control-label col-xs-12 col-sm-2">{:__('Reduction')}:</label> | 58 | <label class="control-label col-xs-12 col-sm-2">{:__('Reduction')}:</label> |
59 | <div class="col-xs-12 col-sm-8"> | 59 | <div class="col-xs-12 col-sm-8"> |
60 | <input id="c-reduction" class="form-control" name="row[reduction]" type="number" value="{$row.reduction|htmlentities}"> | 60 | <input id="c-reduction" class="form-control" name="row[reduction]" type="number" value="{$row.reduction|htmlentities}"> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
63 | - <div class="form-group"> | 63 | + <div id="d-consumption_name" class="form-group"> |
64 | <label class="control-label col-xs-12 col-sm-2">{:__('Consumption_name')}:</label> | 64 | <label class="control-label col-xs-12 col-sm-2">{:__('Consumption_name')}:</label> |
65 | <div class="col-xs-12 col-sm-8"> | 65 | <div class="col-xs-12 col-sm-8"> |
66 | <input id="c-consumption_name" class="form-control" name="row[consumption_name]" type="text" value="{$row.consumption_name|htmlentities}"> | 66 | <input id="c-consumption_name" class="form-control" name="row[consumption_name]" type="text" value="{$row.consumption_name|htmlentities}"> |
@@ -54,6 +54,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -54,6 +54,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
54 | showhide(row) | 54 | showhide(row) |
55 | $("#c-type").change(function(){ | 55 | $("#c-type").change(function(){ |
56 | var row=$("#c-type").val() | 56 | var row=$("#c-type").val() |
57 | + | ||
57 | showhide(row) | 58 | showhide(row) |
58 | }); | 59 | }); |
59 | function showhide(row) { | 60 | function showhide(row) { |
@@ -74,6 +75,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -74,6 +75,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
74 | if(row==2){ | 75 | if(row==2){ |
75 | $("#d-voucher_amount").hide() | 76 | $("#d-voucher_amount").hide() |
76 | $("#d-gift").hide() | 77 | $("#d-gift").hide() |
78 | + $("#d-send_rule_limit").hide(); | ||
77 | $("#d-consumption").hide() | 79 | $("#d-consumption").hide() |
78 | $("#d-reduction").hide() | 80 | $("#d-reduction").hide() |
79 | $("#d-consumption_name").show() | 81 | $("#d-consumption_name").show() |
@@ -92,6 +94,46 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -92,6 +94,46 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
92 | 94 | ||
93 | }, | 95 | }, |
94 | edit: function () { | 96 | edit: function () { |
97 | + var row=$("#c-type").val() | ||
98 | + | ||
99 | + showhide(row) | ||
100 | + $("#c-type").change(function(){ | ||
101 | + var row=$("#c-type").val() | ||
102 | + | ||
103 | + showhide(row) | ||
104 | + }); | ||
105 | + function showhide(row) { | ||
106 | + if(row==0){ | ||
107 | + $("#d-voucher_amount").show() | ||
108 | + $("#d-gift").hide() | ||
109 | + $("#d-consumption").hide() | ||
110 | + $("#d-reduction").hide() | ||
111 | + $("#d-consumption_name").hide() | ||
112 | + } | ||
113 | + if(row==1){ | ||
114 | + $("#d-voucher_amount").hide() | ||
115 | + $("#d-gift").show() | ||
116 | + $("#d-consumption").hide() | ||
117 | + $("#d-reduction").hide() | ||
118 | + $("#d-consumption_name").hide() | ||
119 | + } | ||
120 | + if(row==2){ | ||
121 | + $("#d-voucher_amount").hide() | ||
122 | + $("#d-gift").hide() | ||
123 | + $("#d-send_rule_limit").hide(); | ||
124 | + $("#d-consumption").hide() | ||
125 | + $("#d-reduction").hide() | ||
126 | + $("#d-consumption_name").show() | ||
127 | + } | ||
128 | + if(row==3){ | ||
129 | + $("#d-voucher_amount").hide() | ||
130 | + $("#d-gift").hide() | ||
131 | + $("#d-consumption").show() | ||
132 | + $("#d-reduction").show() | ||
133 | + $("#d-consumption_name").hide() | ||
134 | + } | ||
135 | + } | ||
136 | + | ||
95 | Controller.api.bindevent(); | 137 | Controller.api.bindevent(); |
96 | }, | 138 | }, |
97 | api: { | 139 | api: { |
-
请 注册 或 登录 后发表评论