add.html
17.9 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<style>
.form-group .col-sm-2 {
min-width: 120px;
}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="">
<div class="panel panel-success">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse"
href="#collapseOne">
<span>{:__('基本信息')}</span>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<div class="col-md-4 col-xs-12 form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('合同编号')}:</label>
<div class="col-xs-12 col-sm-8" style="height: 30px;">
<div class="input-group">
<input id="c-number" data-rule="required" type="text" class="form-control"
name="row[number]" value="{$cprefix|htmlentities}"/>
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="number-create"
class="btn btn-primary "> {:__('生成')}</button></span>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('合同名称')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" type="text" class="form-control" name="row[name]"
value="{:isset($customer)?htmlentities($customer.name).'合同':''}"/>
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('选择客户')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-customer_id" data-rule="required"
data-source="facrm/customer/index/selectpage/{$addtype=='add'?'type/all':''}"
class="form-control selectpage" name="row[customer_id]" type="text"
value="{:input('customer_id')}">
</div>
</div>
<div class="col-md-4 col-xs-12 form-group business_id_div ">
<label for="c-business_id" class="control-label col-xs-12 col-sm-2">{:__('选择商机')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="clickbox">
<input type="hidden" name="row[business_id]" id="c-eventkey" class="form-control"
value="0" data-rule="required" readonly/>
<label class="control-label">
<a href="javascript:;"
data-url="{$addtype=='add'?'facrm/contract/index/selectbusiness':'facrm/business/index/index/select/1'}"
id="select-resources">
{:__('选择商机')}</a>
</label>
</div>
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('合同金额')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-money" type="number" class="form-control" name="row[money]" value=""/>
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-order_time" class="control-label col-xs-12 col-sm-2">{:__('下单时间')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-order_time" value="{:datetime(time())}" class="form-control datetimepicker"
data-date-format="YYYY-MM-DD" data-use-current="true" name="row[order_time]"
type="text">
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-start_time"
class="control-label col-xs-12 col-sm-2">{:__('合同开始时间')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" value="{:datetime(time())}" class="form-control datetimepicker"
data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[start_time]"
type="text">
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-end_time" class="control-label col-xs-12 col-sm-2">{:__('合同结束时间')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" value="" class="form-control datetimepicker"
data-date-format="YYYY-MM-DD HH:mm"
data-use-current="true" name="row[end_time]" type="text">
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-contacts_id" class="control-label col-xs-12 col-sm-2">{:__('客户签约人')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-contacts_id"
data-source="{$addtype=='add'?'facrm/contract/index/selectcontact':'facrm/customer/contacts/index'}"
class="form-control selectpage" name="row[contacts_id]" type="text" value="">
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-order_admin_id"
class="control-label col-xs-12 col-sm-2">{:__('公司签约人')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-order_admin_id"
data-source="facrm/common/selectpage/model/admin{$addtype=='add'?'/type/all':''}"
data-field="nickname" data-rule="required"
class="form-control selectpage" name="row[order_admin_id]" type="text"
value="{:isset($customer)?$customer.owner_user_id:$auth->id}">
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-flow_admin_id" class="control-label col-xs-12 col-sm-2">{:__('审批人')}:</label>
<div class="col-xs-12 col-sm-8">
{:\\app\\admin\\model\\facrm\\Flow::getFlowHtml($flow,$auth->id)}
</div>
</div>
<div class="col-md-4 col-xs-12 form-group">
<label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-remark" class="form-control" name="row[remark]"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('附件')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-attachfiles" class="form-control" size="20"
name="row[attachfiles]" type="text" value="{$row.attachfiles|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-attachfiles"
class="btn btn-danger faupload" data-input-id="c-attachfiles"
data-multiple="true" data-preview-id="p-attachfiles"><i
class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-attachfiles"
class="btn btn-primary fachoose" data-input-id="c-attachfiles"
data-multiple="true"><i
class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-attachfiles"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-attachfiles"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('图片')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-smallimages" class="form-control" size="50" name="row[smallimages]"
type="text" value="{$row.smallimages|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-smallimages"
class="btn btn-danger plupload" data-input-id="c-smallimages"
data-multiple="true" data-preview-id="p-smallimages"><i
class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-smallimages"
class="btn btn-primary fachoose" data-input-id="c-smallimages"
data-multiple="true"><i
class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-smallimages"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-smallimages"></ul>
</div>
</div>
</div>
</div>
</div>
<div class="panel-group" id="accordion">
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse"
href="#collapseThree">
合同扩展
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse in">
<div class="panel-body">
<div id="extend"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="table-responsive" style="margin: 20px">
<table id="table" class="table table-striped table-bordered table-hover table-nowrap">
<thead>
<th style="width: 120px">{:__('操作')}</th>
<th style="width: 50px">{:__('序号')}</th>
<th>{:__('编码')}</th>
<th style="width: 100px">{:__('商品')}</th>
<th style="width: 80px">{:__('数量')}</th>
<th style="width: 80px">{:__('售价')}</th>
<th>{:__('备注')}</th>
<th>{:__('规格')}</th>
<th>{:__('属性')}</th>
<th>{:__('单位')}</th>
<th>{:__('小计')}</th>
</thead>
<tbody>
<tr>
<td>
<button type="button" class="btn btn-primary" onclick="addRow()">{:__('添加')}</button>
<button type="button" class="btn btn-default" onclick="delRow(this)">{:__('删除')}</button>
</td>
<td></td>
<td></td>
<td>
<input date-rule="required;" style="width: 100px" type="text" name="product[0][name]"
data-index="0" class="find" class="" data-toggle="modal" data-target="#modelProduct">
<input type="hidden" name="product[0][product_id]">
<input type="hidden" name="product[0][sku]">
<input type="hidden" name="product[0][specification]">
<input type="hidden" name="product[0][prop]">
<input type="hidden" name="product[0][unit]">
</td>
<td>
<input type="number" style="width: 80px" name="product[0][nums]"
data-rule="required;integer;range(0~);" class="nums" onchange="totalNums(this)"
onblur="totalNums(this)">
</td>
<td><input type="number" style="width: 80px" data-rule="required;range(0~);"
onchange="calMoney(this)" onblur="calMoney(this)"
class="unit-price" name="product[0][price]">
<input type="hidden" name="product[0][subtotal]">
</td>
<td><textarea rows="1" class="remarks" name="product[0][remarks]" cols="20"></textarea></td>
<td class="gg"></td>
<td></td>
<td class="unit"></td>
<td class="subtotal">
</td>
</tr>
<tr>
<td>{:__('合计')}</td>
<td></td>
<td></td>
<td></td>
<td class="totalnums">0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td id="allMoney"></td>
</tr>
</tbody>
</table>
</div>
<div>
<div class="row">
<div class="col-md-4 col-xs-12">
</div>
<div class="col-md-4 col-xs-12">
<label class="control-label col-xs-12 col-sm-6">{:__('优惠率%')}:</label>
<div class="col-xs-12 col-sm-6">
<input id="c-rate" class="form-control" data-rule="required;float;range(0~100);"
name="row[discount_rate]" type="number" value="0" onblur="calTotalMoneys()">
</div>
</div>
<div class="col-md-4 col-xs-12">
<label class="control-label col-xs-12 col-sm-6"> {:__('产品总额$')}:</label>
<div class="col-xs-12 col-sm-6">
<input id="totalMoneys" class="form-control" name="row[total_price]" type="number">
<input id="money" style="display: none;" readonly="readonly" type="number">
<input id="allNums" style="display: none;" name="row[totalNums]" readonly="readonly"
type="number">
</div>
</div>
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
<!-- Modal -->
<div class="modal fade" id="modelProduct" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content" style="padding: 15px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">{:__('选择产品')}</h4>
</div>
<div class="modal-body">
<div id="lays-row" class="row">
<table id="table2" class="table table-striped table-bordered table-hover " data-show-export="false"
data-show-toggle="false" data-show-columns="false">
</table>
</div>
</div>
</div>
</div>
</div>