You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

461 lines
24 KiB

  1. <?php
  2. /**
  3. * 新增自由行产品资源组合--lmn 2017-06-22
  4. */
  5. use backend\modules\zzcs\assets\ZzcsNewAsset;
  6. ZzcsNewAsset::addCss($this, '/tourist/css/combination.css');
  7. ZzcsNewAsset::addCss($this, '/plug/My97DatePicker/skin/WdatePicker.css');
  8. ZzcsNewAsset::addScript($this, '/tourist/js/upt-combination.js');
  9. ZzcsNewAsset::addScript($this, '/tourist/js/upt-select-res.js');
  10. ZzcsNewAsset::addScript($this, '/plug/My97DatePicker/WdatePicker.js');
  11. ZzcsNewAsset::addScript($this, '/plug/layer/layer.js');
  12. ?>
  13. <div class="top" data-tourist-id="<?php echo $tourist_id;?>">
  14. <div class="trip-days">
  15. <span>行程天数:
  16. <select onchange="change_day()" class="all-day" >
  17. <?php for($i=0;$i<=7;$i++){?>
  18. <option value="<?php echo $i?>" <?php if($i==$tourist_arr['day_num']){?> selected <?php }?>><?php echo $i?></option>
  19. <?php };?>
  20. </select> 天
  21. <?php if($list['main_corporation']==1){?>
  22. <select class="all-night" onchange="change_night()">
  23. <?php for($i=0;$i<=7;$i++){?>
  24. <option value="<?php echo $i?>" <?php if($i==$tourist_arr['night_num']){?> selected <?php }?>><?php echo $i?></option>
  25. <?php };?>
  26. </select> 晚
  27. <?php };?>
  28. </div>
  29. <div class="res-type">
  30. <span>资源类型:</span>
  31. <label><input class="main-res" type="checkbox" <?php if(!empty($list['bus'])){?>checked="checked"<?php };?> onclick="check_res(this)" value="1"/><span>巴士</span></label>
  32. <?php if($list['main_corporation']==1){?>
  33. <label><input class="main-res" type="checkbox" <?php if(!empty($list['hotel'])){?>checked="checked"<?php };?>onclick="check_res(this)" value="2"/><span>酒店</span></label>
  34. <?php };?>
  35. <label><input class="main-res" type="checkbox" <?php if(!empty($list['ticket'])){?>checked="checked"<?php };?> onclick="check_res(this)" value="3"/><span>门票</span></label>
  36. </div>
  37. </div>
  38. <div class="bus" <?php if(empty($list['bus'])){?>style="display: none" <?php }?>>
  39. <div class="bus-top">
  40. <span class="res-title">巴士</span>
  41. <label><input type="checkbox" checked="checked" disabled="disabled"/><span>成人</span></label>
  42. <label><input type="checkbox" checked="checked" disabled="disabled"/><span>儿童</span></label>
  43. </div>
  44. <?php if(!empty($list['bus'])){ ?>
  45. <?php for($i=1;$i<=$tourist_arr['day_num'];$i++){?>
  46. <div class="bus-day">
  47. <span class="bus-trip-num">第 <span class="day-index"><?php echo $i;?></span> 天</span>
  48. <label class="is-arrange pull-right" onclick="change_arrange(this)">
  49. <input type="checkbox" <?php echo isset($list['bus'][$i])? '':'checked';?>/>
  50. <span >当日无安排</span>
  51. </label>
  52. <table class="bus-table" style="display:<?php echo isset($list['bus'][$i])? 'block':'none';?>">
  53. <?php if(isset($list['bus'][$i])){?>
  54. <?php foreach($list['bus'][$i] as $k=> $v){?>
  55. <tr data-ticket-info='<?php echo json_encode($v['ticket_arr']['ticket_arr']);?>' ticket-id="<?php echo $v['sub_res_id']; ?>">
  56. <td class="bus-td1">
  57. <span class="circular-number"><?php echo ($k+1);?></span>
  58. </td>
  59. <td class="bus-td2">
  60. <select class="select-line" onchange="change_line(this)">
  61. <option value="0">选择线路</option>
  62. <?php foreach($line_arr as $val){?>
  63. <option value="<?php echo $val['line_id'];?>"<?php if($val['line_id']==$v['top_res_id']){?> selected <?php };?>><?php echo $val['line_name'];?>(<?php echo $val['line_code']?>)</option>
  64. <?php };?>
  65. </select>
  66. </td>
  67. <td class="bus-td3">
  68. <select class="select-start-station" onchange="change_start_station(this)">
  69. <?php foreach($v['ticket_arr']['start_station_arr'] as $start_key=>$start_val){?>
  70. <option value="<?php echo $start_key;?>" <?php if($start_key==$v['start_station_res_id']){ ?> selected<?php };?>><?php echo $start_val;?></option>
  71. <?php };?>
  72. </select>
  73. </td>
  74. <td class="bus-td4"><span>- </span></td>
  75. <td class="bus-td5">
  76. <select class="select-end-station" onchange="change_end_station(this)">
  77. <?php foreach($v['ticket_arr']['end_station_arr'] as $end_key=>$end_val){?>
  78. <option value="<?php echo $end_key;?>" <?php if($end_key==$v['end_station_res_id']){ ?> selected<?php };?>><?php echo $end_val;?></option>
  79. <?php };?>
  80. </select>
  81. </td>
  82. <td class="bus-td6">
  83. <label>出发时间 :
  84. <div id="time_id_<?php echo $i;?>_<?php echo ($k+1);?>" class="timepicker_box">
  85. <span class="form-inline timepicker">
  86. <input type="text" class="form-control bus_start_time" readonly value="<?php echo $v['extra_res_info'];?>">
  87. <span class="glyphicon glyphicon-time"></span>
  88. </span>
  89. <div class="timepicker_select">
  90. <div class="select_hour_box"></div>
  91. <div class="select_minute_box"></div>
  92. </div>
  93. </div>
  94. </label>
  95. </td>
  96. <td class="bus-td7">
  97. <?php if($k!=0){?>
  98. <span class="circular-reduce" onclick="reduce_bus(this)">-</span>
  99. <?php };?>
  100. </td>
  101. </tr>
  102. <?php };?>
  103. <?php }else{?>
  104. <tr>
  105. <td class="bus-td1">
  106. <span class="circular-number">1</span>
  107. </td>
  108. <td class="bus-td2">
  109. <select class="select-line" onchange="change_line(this)">
  110. <option value="0">选择线路</option>
  111. <?php foreach($line_arr as $val){?>
  112. <option value="<?php echo $val['line_id'];?>"><?php echo $val['line_name'];?></option>
  113. <?php };?>
  114. </select>
  115. </td>
  116. <td class="bus-td3">
  117. <select class="select-start-station" onchange="change_start_station(this)">
  118. <option value="0">选择出发站</option>
  119. </select>
  120. </td>
  121. <td class="bus-td4"><span>- </span></td>
  122. <td class="bus-td5">
  123. <select class="select-end-station" onchange="change_end_station(this)">
  124. <option value="0">选择到达站</option>
  125. </select>
  126. </td>
  127. <td class="bus-td6">
  128. <label>出发时间 :
  129. <div id="time_id_1_1" class="timepicker_box">
  130. <span class="form-inline timepicker">
  131. <input type="text" class="form-control bus_start_time" readonly>
  132. <span class="glyphicon glyphicon-time"></span>
  133. </span>
  134. <div class="timepicker_select">
  135. <div class="select_hour_box"></div>
  136. <div class="select_minute_box"></div>
  137. </div>
  138. </div>
  139. </label>
  140. </td>
  141. <td class="bus-td7">
  142. </td>
  143. </tr>
  144. <?php };?>
  145. <tr>
  146. <td class="bus-td8" colspan="7">
  147. <span class="circular-add" onclick="add_bus(this)">+</span>
  148. </td>
  149. </tr>
  150. </table>
  151. </div>
  152. <?php } ?>
  153. <?php }else{ ?>
  154. <div class="bus-day">
  155. <span class="bus-trip-num">第 <span class="day-index">1</span> 天</span>
  156. <label class="is-arrange pull-right" onclick="change_arrange(this)">
  157. <input type="checkbox" />
  158. <span >当日无安排</span>
  159. </label>
  160. <table class="bus-table bus-copy">
  161. <tr>
  162. <td class="bus-td1">
  163. <span class="circular-number">1</span>
  164. </td>
  165. <td class="bus-td2">
  166. <select class="select-line" onchange="change_line(this)">
  167. <option value="0">选择线路</option>
  168. <?php foreach($line_arr as $val){?>
  169. <option value="<?php echo $val['line_id'];?>"><?php echo $val['line_name'];?></option>
  170. <?php };?>
  171. </select>
  172. </td>
  173. <td class="bus-td3">
  174. <select class="select-start-station" onchange="change_start_station(this)">
  175. <option value="0">选择出发站</option>
  176. </select>
  177. </td>
  178. <td class="bus-td4"><span>- </span></td>
  179. <td class="bus-td5">
  180. <select class="select-end-station" onchange="change_end_station(this)">
  181. <option value="0">选择到达站</option>
  182. </select>
  183. </td>
  184. <td class="bus-td6">
  185. <label>出发时间 :
  186. <div id="time_id_1_1" class="timepicker_box">
  187. <span class="form-inline timepicker">
  188. <input type="text" class="form-control bus_start_time" readonly>
  189. <span class="glyphicon glyphicon-time"></span>
  190. </span>
  191. <div class="timepicker_select">
  192. <div class="select_hour_box"></div>
  193. <div class="select_minute_box"></div>
  194. </div>
  195. </div>
  196. </label>
  197. </td>
  198. <td class="bus-td7">
  199. </td>
  200. </tr>
  201. <tr>
  202. <td class="bus-td8" colspan="7">
  203. <span class="circular-add" onclick="add_bus(this)">+</span>
  204. </td>
  205. </tr>
  206. </table>
  207. </div>
  208. <?php }?>
  209. </div>
  210. <?php if($list['main_corporation']==1){?>
  211. <div class="hotel" <?php if(empty($list['hotel'])){?>style="display: none" <?php }?>>
  212. <div class="hotel-top">
  213. <span class="res-title">酒店</span>
  214. <label><input type="checkbox" disabled="disabled" <?php if($list['hotel']['crowd_type']=='10' || $list['hotel']['crowd_type']=='11' || empty($list['hotel'])){?> checked="checked"<?php };?> id="hotel_adult"/><span>成人</span></label>
  215. <label><input type="checkbox" <?php if($list['hotel']['crowd_type']=='01' || $list['hotel']['crowd_type']=='11'){?> checked="checked"<?php };?> id="hotel_child"/><span>儿童</span></label>
  216. </div>
  217. <?php if(!empty($list['hotel'])){?>
  218. <?php for($i=1;$i<=$tourist_arr['night_num'];$i++){?>
  219. <div class="hotel-day">
  220. <span class="hotel-trip-num">第 <span class="day-index"><?php echo $i;?></span> 晚</span>
  221. <label class="is-arrange pull-right" onclick="change_arrange(this)">
  222. <input type="checkbox" <?php echo isset($list['hotel'][$i])? '':'checked';?>/>
  223. <span >当日无安排</span>
  224. </label>
  225. <table class="hotel-table" style="display:<?php echo isset($list['hotel'][$i])? 'block':'none';?>">
  226. <?php if(isset($list['hotel'][$i])){?>
  227. <?php foreach($list['hotel'][$i] as $k=>$v){?>
  228. <tr>
  229. <td class="hotel-td1">
  230. <span class="circular-number"><?php echo ($k+1);?></span>
  231. </td>
  232. <td class="hotel-td2">
  233. <select class="select-hotel" onchange="change_hotel(this)">
  234. <option value="0">选择酒店</option>
  235. <?php foreach($hotel_arr as $val){?>
  236. <option value="<?php echo $val['hotel_id']?>" <?php if($val['hotel_id'] ==$v['extra_res_info']){?> selected <?php };?>><?php echo $val['hotel_name']?></option>
  237. <?php };?>
  238. </select>
  239. </td>
  240. <td class="hotel-td3">
  241. <select class="select-room-type">
  242. <option value="0" data-room-type="0">选择房型</option>
  243. <?php foreach($v['room_type'] as $val_room){?>
  244. <option value="<?php echo $val_room['parent_room_type']?>" <?php if($val_room['parent_room_type']==$v['top_res_id'] && $val_room['room_type']==$v['sub_res_id']){?> selected<?php };?> data-room-type="<?php echo $val_room['room_type']?>"><?php echo $val_room['room_name']?></option>
  245. <?php };?>
  246. </select>
  247. </td>
  248. <td class="hotel-td4">
  249. <label>入住人数 :
  250. <input type="text" placeholder=" 最大入住人数" size="15" class="max_num" value="<?php echo $v['max_num'];?>"/>
  251. </label>
  252. </td>
  253. </tr>
  254. <?php }?>
  255. <?php }else{?>
  256. <tr>
  257. <td class="hotel-td1">
  258. <span class="circular-number">1</span>
  259. </td>
  260. <td class="hotel-td2">
  261. <select class="select-hotel" onchange="change_hotel(this)">
  262. <option value="0">选择酒店</option>
  263. <?php foreach($hotel_arr as $val){?>
  264. <option value="<?php echo $val['hotel_id']?>"><?php echo $val['hotel_name']?></option>
  265. <?php };?>
  266. </select>
  267. </td>
  268. <td class="hotel-td3">
  269. <select class="select-room-type">
  270. <option value="0" data-room-type="0">选择房型</option>
  271. </select>
  272. </td>
  273. <td class="hotel-td4">
  274. <label>入住人数 :
  275. <input type="text" placeholder=" 最大入住人数" size="15" class="max_num" value="2"/>
  276. </label>
  277. </td>
  278. </tr>
  279. <?php }?>
  280. </table>
  281. </div>
  282. <?php };?>
  283. <?php }else{;?>
  284. <div class="hotel-day">
  285. <span class="hotel-trip-num">第 <span class="day-index">1</span> 晚</span>
  286. <label class="is-arrange pull-right" onclick="change_arrange(this)">
  287. <input type="checkbox" />
  288. <span >当日无安排</span>
  289. </label>
  290. <table class="hotel-table">
  291. <tr>
  292. <td class="hotel-td1">
  293. <span class="circular-number">1</span>
  294. </td>
  295. <td class="hotel-td2">
  296. <select class="select-hotel" onchange="change_hotel(this)">
  297. <option value="0">选择酒店</option>
  298. <?php foreach($hotel_arr as $val){?>
  299. <option value="<?php echo $val['hotel_id']?>"><?php echo $val['hotel_name']?></option>
  300. <?php };?>
  301. </select>
  302. </td>
  303. <td class="hotel-td3">
  304. <select class="select-room-type">
  305. <option value="0" data-room-type="0">选择房型</option>
  306. </select>
  307. </td>
  308. <td class="hotel-td4">
  309. <label>入住人数 :
  310. <input type="text" placeholder=" 最大入住人数" size="15" class="max_num" value="2"/>
  311. </label>
  312. </td>
  313. </tr>
  314. </table>
  315. </div>
  316. <?php };?>
  317. </div>
  318. <?php };?>
  319. <div class="ticket" <?php if(empty($list['ticket'])){?>style="display: none" <?php }?>>
  320. <div class="ticket-top">
  321. <span class="res-title">门票</span>
  322. <label><input type="checkbox" disabled="disabled" <?php if($list['ticket']['crowd_type']=='10' || $list['ticket']['crowd_type']=='11' || empty($list['ticket'])){?> checked="checked"<?php };?> onclick="change_ticket_crowd()" id="ticket_crowd_adult"/><span>成人</span></label>
  323. <label><input type="checkbox" <?php if($list['ticket']['crowd_type']=='01' || $list['ticket']['crowd_type']=='11'){?> checked="checked"<?php };?> onclick="change_ticket_crowd()" id="ticket_crowd_child"/><span>儿童</span></label>
  324. </div>
  325. <?php if(!empty($list['ticket'])){ ?>
  326. <?php for($i=1;$i<=$tourist_arr['day_num'];$i++){?>
  327. <div class="ticket-day">
  328. <span class="ticket-trip-num">第 <span class="day-index"><?php echo $i;?></span> 天</span>
  329. <label class="is-arrange pull-right" onclick="change_arrange(this)">
  330. <input type="checkbox" <?php echo isset($list['ticket'][$i])? '':'checked';?>/>
  331. <span >当日无安排</span>
  332. </label>
  333. <table class="ticket-table" style="display:<?php echo isset($list['ticket'][$i])? 'block':'none';?>">
  334. <?php if(isset($list['ticket'][$i])){?>
  335. <?php foreach($list['ticket'][$i] as $k=>$v){?>
  336. <tr>
  337. <td class="ticket-td1">
  338. <span class="circular-number"><?php echo $k+1?></span>
  339. </td>
  340. <td class="ticket-td2">
  341. <select class="select-ticket" onchange="change_ticket(this)">
  342. <option value="0">选择门票</option>
  343. <?php foreach($ticket_arr as $val){?>
  344. <option value="<?php echo $val['ticket_id']?>" <?php if($val['ticket_id']==$v['top_res_id']){?> selected <?php };?>><?php echo $val['ticket_name']?></option>
  345. <?php };?>
  346. </select>
  347. </td>
  348. <td class="ticket-td3">
  349. <select class="select-son-ticket adult_son_ticket">
  350. <option value="0">选择票种</option>
  351. <?php foreach($v['son_ticket'] as $son_val){?>
  352. <option value="<?php echo $son_val['prod_id'];?>" <?php if($v['sub_res_id']==$son_val['prod_id']){?> selected <?php };?>><?php echo $son_val['prod_name'];?></option>
  353. <?php };?>
  354. </select>
  355. </td>
  356. <td class="ticket-td5" <?php if($list['ticket']['crowd_type']=='10'){?>style="display: none" <?php };?>>
  357. <label>儿童票种:</label>
  358. <select class="select-son-ticket child_son_ticket">
  359. <option value="0">选择票种</option>
  360. <?php foreach($v['son_ticket'] as $son_val){?>
  361. <option value="<?php echo $son_val['prod_id'];?>" <?php if($v['sub_res_id1']==$son_val['prod_id']){?> selected <?php };?>><?php echo $son_val['prod_name'];?></option>
  362. <?php };?>
  363. </select>
  364. </td>
  365. <td class="ticket-td4">
  366. <?php if($k!=0){?>
  367. <span class="circular-reduce" onclick="reduce_ticket(this)">-</span>
  368. <?php }?>
  369. </td>
  370. </tr>
  371. <?php };?>
  372. <?php }else{?>
  373. <tr>
  374. <td class="ticket-td1">
  375. <span class="circular-number">1</span>
  376. </td>
  377. <td class="ticket-td2">
  378. <select class="select-ticket" onchange="change_ticket(this)">
  379. <option value="0">选择门票</option>
  380. <?php foreach($ticket_arr as $val){?>
  381. <option value="<?php echo $val['ticket_id']?>"><?php echo $val['ticket_name']?></option>
  382. <?php };?>
  383. </select>
  384. </td>
  385. <td class="ticket-td3">
  386. <select class="select-son-ticket adult_son_ticket">
  387. <option value="0">选择票种</option>
  388. </select>
  389. </td>
  390. <td class="ticket-td5" <?php if($list['ticket']['crowd_type']=='10'){?> style="display: none" <?php };?>>
  391. <label>儿童票种:</label>
  392. <select class="select-son-ticket child_son_ticket">
  393. <option value="0">选择票种</option>
  394. </select>
  395. </td>
  396. <td class="ticket-td4">
  397. </td>
  398. </tr>
  399. <?php };?>
  400. <tr>
  401. <td class="bus-td8" colspan="7">
  402. <span class="circular-add" onclick="add_ticket(this)">+</span>
  403. </td>
  404. </tr>
  405. </table>
  406. </div>
  407. <?php };?>
  408. <?php }else{;?>
  409. <div class="ticket-day">
  410. <span class="ticket-trip-num">第 <span class="day-index">1</span> 天</span>
  411. <label class="is-arrange pull-right" onclick="change_arrange(this)">
  412. <input type="checkbox" />
  413. <span >当日无安排</span>
  414. </label>
  415. <table class="ticket-table ticket-copy">
  416. <tr>
  417. <td class="ticket-td1">
  418. <span class="circular-number">1</span>
  419. </td>
  420. <td class="ticket-td2">
  421. <select class="select-ticket" onchange="change_ticket(this)">
  422. <option value="0">选择门票</option>
  423. <?php foreach($ticket_arr as $val){?>
  424. <option value="<?php echo $val['ticket_id']?>"><?php echo $val['ticket_name']?></option>
  425. <?php };?>
  426. </select>
  427. </td>
  428. <td class="ticket-td3">
  429. <select class="select-son-ticket adult_son_ticket">
  430. <option value="0">选择票种</option>
  431. </select>
  432. </td>
  433. <td class="ticket-td5" style="display: none" >
  434. <label>儿童票种:</label>
  435. <select class="select-son-ticket child_son_ticket">
  436. <option value="0">选择票种</option>
  437. </select>
  438. </td>
  439. <td class="ticket-td4">
  440. </td>
  441. </tr>
  442. <tr>
  443. <td class="bus-td8" colspan="7">
  444. <span class="circular-add" onclick="add_ticket(this)">+</span>
  445. </td>
  446. </tr>
  447. </table>
  448. </div>
  449. <?php };?>
  450. </div>
  451. <div class="footer">
  452. <button type="button" class="btn btn-primary btn-lg" id="submit-res" onclick="add_submit()">保存</button>
  453. <button type="button" class="btn btn-default btn-lg" id="cancel-res" onclick="cancel_save()">取消</button>
  454. </div>