order_input.tpl 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. {include file="public/header-begin" /}
  2. <link rel="stylesheet" href="{$Think.config.base_url}/static/admin/css/style.min.css?v=4.0.0">
  3. <link rel="stylesheet" href="{$Think.config.base_url}/static/admin/css/plugins/steps/jquery.steps.css">
  4. <link rel="stylesheet" href="{$Think.config.base_url}/static/admin/css/plugins/chosen/chosen.css">
  5. <script src="{$Think.config.base_url}/static/common/js/vue.js"></script>
  6. {include file="public/header-end" /}
  7. <div id="vue" class="wrapper wrapper-content animated fadeInRight">
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox">
  11. <div class="ibox-content">
  12. <h2>
  13. 订单录入
  14. </h2>
  15. <p>
  16. &nbsp;
  17. </p>
  18. <div id="wizard" class="wizard clearfix">
  19. <div class="steps clearfix">
  20. <ul>
  21. <li @click="thisStep(1)" class="{{step == 1 ? 'current' : 'disabled'}}">
  22. <a>
  23. <span class="number">1.</span>用车及行程信息</a></li>
  24. <li @click="thisStep(2)" class="{{step == 2 ? 'current' : 'disabled'}}">
  25. <a>
  26. <span class="number">2.</span>行程及价格核算</a></li>
  27. <li @click="thisStep(3)" class="{{step == 3 ? 'current' : 'disabled'}}">
  28. <a>
  29. <span class="number">3.</span>乘车联系人</a></li>
  30. <li @click="thisStep(4)" class="{{step == 4 ? 'current' : 'disabled'}}">
  31. <a>
  32. <span class="number">4.</span>其他信息</a></li>
  33. </ul>
  34. </div>
  35. <div class="content clearfix">
  36. <div v-show="step == 1" class="step-content">
  37. <div class="m-t-md">
  38. <div class="row">
  39. <div class="col-sm-12">
  40. <h2>用车及行程信息</h2>
  41. <div class="hr-line-dashed"></div>
  42. <div class="row">
  43. <div class="col-sm-12" style="padding-left: 0;">
  44. <table class="zq_search">
  45. <tr>
  46. <td style="width:20%;padding-left: 15px;" valign="top">
  47. <label>产品类型</label>
  48. <select v-model="item.ptype" class="form-control input-sm select-sm" name="account">
  49. <option value="1" selected>接机</option>
  50. <option value="2">送机</option>
  51. <option value="3">包车</option>
  52. </select>
  53. </td>
  54. <td style="width:60%;padding-left: 15px ;">
  55. <label>城市</label>
  56. <div class="form-group input-group" style="width:100%">
  57. <input id="area" data-id="" placeholder="在这里输入城市关键词,比如曼谷" type="text" class="form-control input-sm" value="" v-el:area>
  58. <div class="input-group-btn">
  59. <button type="button" class="btn btn-sm btn-white dropdown-toggle" data-toggle="dropdown">
  60. <span class="caret"></span>
  61. </button>
  62. <ul class="dropdown-menu dropdown-menu-right" role="menu">
  63. </ul>
  64. </div>
  65. </div>
  66. </td>
  67. <td style="width:100px;" align="left" valign="top">
  68. <label>用车时间 *</label>
  69. <input v-model="item.usetime" type="datetime-local" class="form-control input-sm">
  70. </td>
  71. <td style="width:100px;" align="right" valign="top">
  72. <label>&nbsp;</label>
  73. <button @click="getCitySomeInfo()" type="button" class="btn btn-sm btn-primary">加载车型</button>
  74. </td>
  75. <td style="width:50px;" align="right" valign="top">
  76. </td>
  77. <td align="left" valign="top">
  78. <label>车型 *</label>
  79. <select id="carType" data-placeholder="选择车型" class="form-control input-sm select-sm chosen-select" style="height: 30px;width:150px;" v-model="carTypeid" v-el:carType>
  80. <option v-for="option in cartype" v-bind:value="option.id" hassubinfo="true">
  81. {{ option.name }}
  82. </option>
  83. </select>
  84. </td>
  85. <td style="width:100px;" align="right" valign="top">
  86. <label>&nbsp;</label>
  87. <button @click="caradd()" type="button" class="btn btn-sm btn-primary">选中车型</button>
  88. </td>
  89. </tr>
  90. </table>
  91. </div>
  92. </div>
  93. <div class="row">
  94. <div class="col-sm-1" style="padding-right: 0">
  95. <div class="form-group">
  96. <label>总人数 *</label>
  97. <input type="number" v-model="item.person" class="form-control input-sm">
  98. </div>
  99. </div>
  100. <div class="col-sm-1" style="padding-right: 0">
  101. <div class="form-group">
  102. <label>行李数 *</label>
  103. <input type="number" v-model="item.luggage" class="form-control input-sm">
  104. </div>
  105. </div>
  106. <div class="col-sm-1" style="padding-right: 0">
  107. <div class="form-group">
  108. <label>儿童数 *</label>
  109. <input type="number" v-model="item.child" class="form-control input-sm">
  110. </div>
  111. </div>
  112. <div v-if="item.addservice.hasOwnProperty('child_chair')" class="col-sm-1" style="padding-right: 0">
  113. <div class="form-group">
  114. <label>{{item.addservice.child_chair[0].name}}</label>
  115. <input type="number" v-model="item.addservice.child_chair[0].count" class="form-control input-sm">
  116. </div>
  117. </div>
  118. <div v-if="item.addservice.hasOwnProperty('child_chair')" class="col-sm-1" style="padding-right: 0">
  119. <div class="form-group">
  120. <label>{{item.addservice.child_chair[1].name}}</label>
  121. <input type="number" v-model="item.addservice.child_chair[1].count" class="form-control input-sm">
  122. </div>
  123. </div>
  124. <div class="col-sm-7">
  125. <div class="form-group" style="position: relative; ">
  126. <label>已选车型 *</label>
  127. <input type="text" class="form-control input-sm" value="{{_cartypes}}" readonly>
  128. <div style="margin-top: 8px; position: absolute; right: 10px;top:20px"><a href="javascript://" @click="clearCar()">[重选车型]</a></div>
  129. </div>
  130. </div>
  131. </div>
  132. <div v-if="item.ptype == 1 || item.ptype == 2" class="row">
  133. <div class="col-sm-6" style="padding-right: 0">
  134. <div class="form-group">
  135. <label>机场名称 *</label>
  136. <select class="form-control input-sm select-sm" v-model="item.flight.aid">
  137. <option v-for="option in airportList" v-bind:value="option.id">
  138. {{ option.name_cn }}
  139. </option>
  140. </select>
  141. </div>
  142. </div>
  143. <div v-if="item.ptype == 1 && item.addservice.hasOwnProperty('flight_pickup')" class="col-sm-6">
  144. <div class="form-group">
  145. <label>举牌接机 </label>
  146. <input type="text" class="form-control input-sm">
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. <div class="row">
  153. <div v-show="item.ptype == 1" class="col-sm-12 b-r">
  154. <div class="row">
  155. <div class="col-sm-4">
  156. <div class="form-group">
  157. <label>目的地址 *</label>
  158. <input v-model="item.address.to_name" type="text" class="form-control input-sm">
  159. </div>
  160. </div>
  161. <div class="col-sm-8" style="margin-right: 0">
  162. <div class="form-group">
  163. <label>目的详细地址 *</label>
  164. <input v-model="item.address.to_detail" type="text" class="form-control input-sm">
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <div v-show="item.ptype == 2" class="col-sm-12 b-r">
  170. <div class="row">
  171. <div class="col-sm-4">
  172. <div class="form-group">
  173. <label>出发地址 *</label>
  174. <input id="address" name="address" type="text" class="form-control input-sm">
  175. </div>
  176. </div>
  177. <div class="col-sm-8" style="margin-right: 0">
  178. <div class="form-group">
  179. <label>出发详细地址 *</label>
  180. <input id="address" name="address" type="text" class="form-control input-sm">
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. <div v-show="item.ptype == 3" class="col-sm-12 b-r">
  186. <div class="row">
  187. <div class="col-sm-4">
  188. <div class="form-group">
  189. <label>上车地址 *</label>
  190. <input id="address" name="address" type="text" class="form-control input-sm">
  191. </div>
  192. </div>
  193. <div class="col-sm-8" style="margin-right: 0">
  194. <div class="form-group">
  195. <label>上车详细地址 *</label>
  196. <input id="address" name="address" type="text" class="form-control input-sm">
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. <div v-show="step == 2" class="step-content">
  205. <div class="m-t-md">
  206. <div class="row">
  207. <div class="col-sm-4">
  208. <h2>里程核算</h2>
  209. <div class="hr-line-dashed"></div>
  210. <div class="row">
  211. <div class="col-sm-12">
  212. <div class="form-group">
  213. <label>预计行驶总里程</label>
  214. <table width="100%">
  215. <tr>
  216. <td valign="middle">
  217. <div class="input-group">
  218. <input type="text" class="form-control" v-model="distancematrix.distance.value"> <span class="input-group-addon">米</span>
  219. </div>
  220. </td>
  221. </tr>
  222. </table>
  223. </div>
  224. </div>
  225. </div>
  226. <div class="row">
  227. <div class="col-sm-12">
  228. <div class="ibox-content" style="border:1px solid #cccccc">
  229. <table class="table">
  230. <thead>
  231. <tr>
  232. <th>项目</th>
  233. <th>数字</th>
  234. <th>单位</th>
  235. </tr>
  236. </thead>
  237. <tbody>
  238. <tr>
  239. <td>预计总里程</td>
  240. <td>{{distancematrix.distance.value/1000}}</td>
  241. <td>公里</td>
  242. </tr>
  243. <tr>
  244. <td>套餐里程</td>
  245. <td>{{item.addroute.free_distance/1000}}</td>
  246. <td>公里</td>
  247. </tr>
  248. <tr>
  249. <td>预计超出里程</td>
  250. <td>{{(distancematrix.distance.value - item.addroute.free_distance)/1000}}</td>
  251. <td>公里</td>
  252. </tr>
  253. </tbody>
  254. </table>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. <div class="col-sm-4">
  260. <h2>时间核算</h2>
  261. <div class="hr-line-dashed"></div>
  262. <div class="row">
  263. <div class="col-sm-12">
  264. <div class="form-group">
  265. <label>预计行驶总时间</label>
  266. <table width="100%">
  267. <tr>
  268. <td valign="middle">
  269. <div class="input-group">
  270. <input type="text" class="form-control" v-model="distancematrix.duration.value"> <span class="input-group-addon">分钟</span>
  271. </div>
  272. </td>
  273. </tr>
  274. </table>
  275. </div>
  276. </div>
  277. </div>
  278. <div class="row">
  279. <div class="col-sm-12">
  280. <div class="ibox-content" style="border:1px solid #cccccc">
  281. <table class="table">
  282. <thead>
  283. <tr>
  284. <th>项目</th>
  285. <th>数字</th>
  286. <th>单位</th>
  287. </tr>
  288. </thead>
  289. <tbody>
  290. <tr>
  291. <td>预计行驶总时间</td>
  292. <td>{{distancematrix.duration.value}}</td>
  293. <td>分钟</td>
  294. </tr>
  295. <tr>
  296. <td>套餐时间</td>
  297. <td>{{item.addroute.free_time}}</td>
  298. <td>分钟</td>
  299. </tr>
  300. <tr>
  301. <td>预计超出时间</td>
  302. <td>{{(distancematrix.duration.value - item.addroute.free_time)}}</td>
  303. <td>分钟</td>
  304. </tr>
  305. </tbody>
  306. </table>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. <div class="col-sm-4">
  312. <h2>价格核算</h2>
  313. <div class="hr-line-dashed"></div>
  314. <div class="row">
  315. <div class="col-sm-6">
  316. <div class="form-group">
  317. <label>预估总价格</label>
  318. <table width="100%">
  319. <tr>
  320. <td valign="middle">
  321. <div class="input-group">
  322. <span class="input-group-addon">¥</span><input type="text" class="form-control" v-model="_amount"> <span class="input-group-addon">元</span>
  323. </div>
  324. </td>
  325. </tr>
  326. </table>
  327. </div>
  328. </div>
  329. <div class="col-sm-1">
  330. <div class="form-group">
  331. <label>&nbsp;</label>
  332. <table width="100%">
  333. <tr>
  334. <td valign="middle" style="height:34px">
  335. <a href="javascript://" @click="amountCopy()">-></a>
  336. </td>
  337. </tr>
  338. </table>
  339. </div>
  340. </div>
  341. <div class="col-sm-5">
  342. <div class="form-group">
  343. <label style="color: red">实际总价格</label>
  344. <table width="100%">
  345. <tr>
  346. <td valign="middle">
  347. <div class="input-group">
  348. <span class="input-group-addon">¥</span><input type="text" class="form-control" v-model="item.amount"> <span class="input-group-addon">元</span>
  349. </div>
  350. </td>
  351. </tr>
  352. </table>
  353. </div>
  354. </div>
  355. </div>
  356. <div class="row">
  357. <div class="col-sm-12">
  358. <div class="ibox-content" style="border:1px solid #cccccc">
  359. <table class="table">
  360. <thead>
  361. <tr>
  362. <th>项目</th>
  363. <th>数字</th>
  364. <th>单位</th>
  365. <th>单元</th>
  366. </tr>
  367. </thead>
  368. <tbody>
  369. <tr>
  370. <td>套餐费用</td>
  371. <td>{{_carTypeItem.price}}</td>
  372. <td>¥</td>
  373. <td></td>
  374. </tr>
  375. <tr>
  376. <td>超里程费用</td>
  377. <td>{{_over_distance_price}}</td>
  378. <td>¥</td>
  379. <td>¥{{item.addroute.over_distance_priceper}} 元/米</td>
  380. </tr>
  381. <tr>
  382. <td>超时费用</td>
  383. <td>{{_over_time_price}}</td>
  384. <td>¥</td>
  385. <td>¥{{item.addroute.over_time_priceper}} 元/分钟</td>
  386. </tr>
  387. <tr>
  388. <td>夜间服务费用</td>
  389. <td>{{item.addroute.night}}</td>
  390. <td>¥</td>
  391. </tr>
  392. <tr>
  393. <td>其他费用(举牌座椅等)</td>
  394. <td>10</td>
  395. <td>¥</td>
  396. <td></td>
  397. </tr>
  398. <tr>
  399. <td>合计</td>
  400. <td>{{_amount}}</td>
  401. <td>¥</td>
  402. </tr>
  403. </tbody>
  404. </table>
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. </div>
  412. <div v-show="step == 3" class="step-content">
  413. <div class="m-t-md">
  414. <div class="row">
  415. <div class="col-sm-12">
  416. <h2>乘车联系人</h2>
  417. <div class="hr-line-dashed"></div>
  418. <div class="row">
  419. <div class="col-sm-12" style="padding-left: 0;">
  420. <div class="col-sm-2">
  421. <div class="form-group">
  422. <label>联系人 *</label>
  423. <input v-model="item.userinfo.truename" type="text" class="form-control input-sm">
  424. </div>
  425. </div>
  426. <div class="col-sm-2" style="margin-right: 0">
  427. <div class="form-group">
  428. <label>联系电话 *</label>
  429. <input v-model="item.userinfo.phone" type="text" class="form-control input-sm">
  430. </div>
  431. </div>
  432. <div class="col-sm-2" style="margin-right: 0">
  433. <div class="form-group">
  434. <label>微信 </label>
  435. <input v-model="item.userinfo.wechat" type="text" class="form-control input-sm">
  436. </div>
  437. </div>
  438. <div class="col-sm-2" style="margin-right: 0">
  439. <div class="form-group">
  440. <label>备用电话 </label>
  441. <input v-model="item.userinfo.phone2" type="text" class="form-control input-sm">
  442. </div>
  443. </div>
  444. <div class="col-sm-4" style="margin-right: 0">
  445. <div class="form-group">
  446. <label>备注 </label>
  447. <input v-model="item.userinfo.remark" type="text" class="form-control input-sm">
  448. </div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. </div>
  454. </div>
  455. </div>
  456. <div v-show="step == 4" class="step-content">
  457. <div class="m-t-md">
  458. <div class="row">
  459. <div class="col-sm-12">
  460. <h2>其他信息</h2>
  461. <div class="hr-line-dashed"></div>
  462. <div class="row">
  463. <div class="col-sm-2" style="padding-right:0 ">
  464. <div class="form-group">
  465. <label>订单来源</label>
  466. <select class="form-control input-sm select-sm" v-model="item.partnerid">
  467. <option v-for="option in partnerList" v-bind:value="option.id">
  468. {{ option.name }}
  469. </option>
  470. </select>
  471. </div>
  472. </div>
  473. <div class="col-sm-3">
  474. <div class="form-group">
  475. <label>第三方订单号 *</label>
  476. <input v-model="item.partner_ordernumber" type="text" class="form-control input-sm">
  477. </div>
  478. </div>
  479. <div class="col-sm-7">
  480. <div class="form-group">
  481. <label>第三方订单生成时间 *</label>
  482. <input v-model="item.partner_addtime" type="datetime-local" class="form-control input-sm">
  483. </div>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. </div>
  489. </div>
  490. </div>
  491. <div class="actions clearfix">
  492. <ul>
  493. <li class=" " >
  494. <a href="javascript://" @click="changeStep(-1)">上一步</a></li>
  495. <li>
  496. <a href="javascript://" @click="changeStep(1)">下一步</a></li>
  497. <li>
  498. <a href="javascript://" @click="addOrder()">完成</a></li>
  499. <li>
  500. <a href="javascript://" @click="">取消</a></li>
  501. <li>
  502. <a href="javascript://" @click="showSelect()">选择</a></li>
  503. </ul>
  504. </div>
  505. </div>
  506. </div>
  507. </div>
  508. </div>
  509. </div>
  510. </div>
  511. <!--
  512. <div class="modal inmodal" id="modal-watch" tabindex="-1" role="dialog" aria-hidden="true">
  513. <div class="modal-dialog" style="width: 1000px">
  514. <div class="modal-content animated bounceInRight">
  515. <div class="modal-header">
  516. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
  517. </button>
  518. <h4 class="modal-title">选择车型(如果一辆车,则选中其中一辆即可)</h4>
  519. </div>
  520. <div class="modal-body">
  521. <table class="table table-hover">
  522. <thead>
  523. <tr>
  524. <th>ID</th>
  525. <th>用车时间</th>
  526. <th>用车天数</th>
  527. <th>总人数</th>
  528. <th>儿童数</th>
  529. <th>0~4岁童座</th>
  530. <th>5~7岁童座</th>
  531. <th>8-12童座</th>
  532. </tr>
  533. </thead>
  534. <tbody>
  535. <tr>
  536. <td valign="middle">
  537. <select id="carType" data-placeholder="选择车型" class="form-control input-sm select-sm chosen-select" style="height: 30px;width: 150px" v-model="carTypeid" v-el:carType>
  538. <option v-for="option in cartype" v-bind:value="option.id" hassubinfo="true">
  539. {{ option.name }}
  540. </option>
  541. </select>
  542. </td>
  543. <td><input v-model="addroute.usetime" type="datetime-local" class="form-control input-sm"></td>
  544. <td><input v-model="addroute.cardays" type="number" class="form-control input-sm"></td>
  545. <td><input v-model="addroute.person" type="number" class="form-control input-sm"></td>
  546. <td><input v-model="addroute.child" type="number" class="form-control input-sm"></td>
  547. <td><input v-model="addroute.usetime" type="number" class="form-control input-sm"></td>
  548. <td><input v-model="addroute.usetime" type="number" class="form-control input-sm"></td>
  549. <td><input v-model="addroute.usetime" type="number" class="form-control input-sm"></td>
  550. </tr>
  551. <tr v-if="cartype.length == 0">
  552. <td>该城市还没有配置车型信息</td>
  553. </tr>
  554. </tbody>
  555. </table>
  556. <table class="table table-hover">
  557. <thead>
  558. <tr>
  559. <th>ID</th>
  560. <th>用车时间</th>
  561. <th>用车天数</th>
  562. <th>乘车人数</th>
  563. </tr>
  564. </thead>
  565. <tbody>
  566. <tr v-for="routeitem of item.addroute">
  567. <td valign="middle">
  568. {{ routeitem.cartypeid }}
  569. </td>
  570. <td>
  571. {{ routeitem.cartype }}
  572. </td>
  573. <td>
  574. {{ routeitem.cardays }}
  575. </td>
  576. <td>
  577. {{ routeitem.person }}
  578. </td>
  579. </tr>
  580. </tbody>
  581. </table>
  582. </div>
  583. <div class="modal-footer">
  584. <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. -->
  590. {include file="public/footer-js" /}
  591. <script>
  592. new Vue({
  593. el: 'body',
  594. data: {
  595. step:1,
  596. items:[],
  597. city:{},
  598. addroute:{},
  599. item: {
  600. //产品类型
  601. ptype:1,
  602. //航班
  603. flight:{
  604. aid:0,
  605. flightnum: '',
  606. },
  607. usetime:'',
  608. person: 0,
  609. luggage: 0,
  610. child:0,
  611. //地址信息
  612. address:{
  613. from_name: '',
  614. from_detail: '',
  615. from_x: 0,
  616. from_y: 0,
  617. from_cid: 0,
  618. from_city: '',
  619. to_name: '白宫大酒店',
  620. to_detail: 'Phetchaburi 15 Alley, Thanon Phaya Thai, Ratchathewi, Bangkok',
  621. to_x: 0,
  622. to_y: 0,
  623. to_cid: 0,
  624. to_city: '',
  625. },
  626. //addroute
  627. addroute:{},
  628. //addservice
  629. addservice: {},
  630. //car
  631. car: [],
  632. //联系人
  633. userinfo:{
  634. truename:'',
  635. phone:'',
  636. phone2:'',
  637. wechat:'',
  638. remark:'',
  639. cartype:'',
  640. },
  641. //合作商
  642. partner: {
  643. partnerid:0,
  644. partner_ordernumber:'',
  645. partner_addtime:'',
  646. },
  647. //价值
  648. amount:0,
  649. },
  650. carTypeid:0,
  651. cartype:[],
  652. airportList
  653. airportList:[],
  654. distancematrix:{
  655. duration:{
  656. value :0
  657. },
  658. distance:{
  659. value :0
  660. }
  661. },
  662. partnerList:[],
  663. },
  664. computed : {
  665. _airportItem: function() {
  666. for (var item of this.airportList) {
  667. if(item.id == this.item.aid) {
  668. return item;
  669. }
  670. }
  671. return null;
  672. },
  673. _carTypeItem: function() {
  674. for (var item of this.cartype) {
  675. if(item.id == this.carTypeid) {
  676. return item;
  677. }
  678. }
  679. return {
  680. price :0
  681. };
  682. },
  683. //儿童座椅
  684. _childChair: function () {
  685. var childChair = [];
  686. for(var item of this.addservice) {
  687. if(item.keyword.indexOf('child_chair') >= 0) {
  688. item.count = 0;
  689. childChair.push(item);
  690. }
  691. }
  692. return childChair;
  693. },
  694. _cartypes: function () {
  695. var rescars = '';
  696. for(var item of this.item.car) {
  697. rescars = rescars + item.name + '、'
  698. }
  699. return rescars.substring(0,rescars.length-1);
  700. },
  701. _over_time_price: function () {
  702. return (this.item.addroute.over_time_priceper * (this.distancematrix.duration.value - this.item.addroute.free_time) * 1 < 0 ? 0 : this.item.addroute.over_time_priceper * (this.distancematrix.duration.value - this.item.addroute.free_time) * 1).toFixed(2);
  703. },
  704. _over_distance_price: function () {
  705. return ((this.distancematrix.distance.value * 1 - this.item.addroute.free_distance * 1)* 1 < 0 ? 0 : this.item.addroute.over_distance_priceper * (this.distancematrix.distance.value - this.item.addroute.free_distance)/1000 * 1).toFixed(2);
  706. },
  707. _amount: function () {
  708. if(this._carTypeItem == undefined) {
  709. return 0;
  710. }
  711. return (this._carTypeItem.price * 1 +
  712. this._over_time_price * 1 +
  713. this._over_distance_price * 1 +
  714. this.item.addroute.night * 1).toFixed(2);
  715. },
  716. _partnerItem:function () {
  717. for (var item of this.partnerList) {
  718. if(item.id == this.item.partnerid) {
  719. return item;
  720. }
  721. }
  722. return;
  723. }
  724. },
  725. methods: {
  726. getCitySomeInfo:function() {
  727. var that = this;
  728. var req1 = function(){
  729. return $.ajax({
  730. url: '{:url('city/getCityByCityid')}',
  731. data: {
  732. cityid: $(that.$els.area).attr('data-id')
  733. },
  734. type: 'post',
  735. dataType: 'json'
  736. }).then(function (data) {
  737. if (data.code == 1) {
  738. that.city = data.content;
  739. }
  740. else {
  741. swal(data.msg);
  742. //req1.reject();//非常好,不再走下一个then
  743. throw null;
  744. }
  745. });
  746. }
  747. var req2 = function(){
  748. return $.ajax({
  749. url: '{:url('city/getCartypeListOnEffective')}',
  750. data: {
  751. cityid: $(that.$els.area).attr('data-id'),
  752. ptype: that.item.ptype,
  753. usetime: that.item.usetime
  754. },
  755. type: 'post',
  756. dataType: 'json',
  757. }).then(function (data) {
  758. if (data.code == 1) {
  759. that.cartype = data.content.cartype;
  760. that.item.addroute = data.content.addroute;
  761. that.item.addservice = data.content.addservice;
  762. if(that.item.addservice.hasOwnProperty('child_chair')) {
  763. for (var item of that.item.addservice.child_chair) {
  764. item.count = 0;
  765. }
  766. }
  767. if(that.item.addservice.hasOwnProperty('flight_pickup')) {
  768. that.item.addservice.flight_pickup.title = '';
  769. }
  770. setTimeout(function () {
  771. that.carSelect();
  772. }, 300);
  773. }
  774. else {
  775. swal(data.msg);
  776. req2.reject();//非常好,不再走下一个then
  777. }
  778. });
  779. }
  780. var req3 = function(){
  781. return $.ajax({
  782. url: '{:url('city/getAirportList')}',
  783. data: {
  784. cityid: $(that.$els.area).attr('data-id')
  785. },
  786. type: 'post',
  787. dataType: 'json',
  788. }).then(function (data) {
  789. if (data.code == 1) {
  790. that.airportList = data.content;
  791. }
  792. else {
  793. swal(data.msg);
  794. req3.reject();//非常好,不再走下一个then
  795. }
  796. })
  797. }
  798. if(this.item.ptype == 1 || this.item.ptype == 2) {
  799. req1().then(req2).then(req3).done(function () {
  800. //console.log('请求发送完毕');
  801. });
  802. }
  803. else {
  804. req1().then(req2).done(function () {
  805. //console.log('请求发送完毕');
  806. });
  807. }
  808. },
  809. changeStep: function(step) {
  810. if(step > 0 && this.step == 4) {
  811. return;
  812. }
  813. if(step < 0 && this.step == 1) {
  814. return;
  815. }
  816. if(step > 0 && this.step == 1) {
  817. this.getDistancematrix();
  818. }
  819. this.step += step;
  820. },
  821. thisStep: function (step) {
  822. this.step = step;
  823. },
  824. getDistancematrix: function() {
  825. console.log(this._carTypeItem);
  826. var that = this;
  827. var param;
  828. //接机
  829. if(this.item.ptype == 1) {
  830. param = {
  831. from_name: this._airportItem.name_cn,//起始地址
  832. from_city: this.city.name_cn,//起始城市名称
  833. to_name: this.item.address.to_name,//到达地址
  834. to_city: this.city.name_cn,//到达城市名称
  835. to_detail: this.item.address.to_detail,//到达详细地址
  836. };
  837. }
  838. //送机
  839. else if(this.item.ptype == 2){
  840. param = {
  841. from_name: this.item.to_name,//起始地址
  842. from_city: this._airportItem.name_cn,//起始城市名称
  843. to_name: this.item.to_name,//到达地址
  844. to_city: this.city.name_cn,//到达城市名称
  845. };
  846. }
  847. $.ajax({
  848. url: '{:url('map/getDistancematrix')}',
  849. data: param,
  850. type: 'post',
  851. dataType: 'json',
  852. success: function (data) {
  853. if (data.code == 1) {
  854. that.distancematrix = data.content;
  855. }
  856. else {
  857. swal("机场" + data.msg);
  858. }
  859. }
  860. });
  861. },
  862. getPartnerList:function () {
  863. var that = this;
  864. $.ajax({
  865. url: '{:url('system/getPartnerList')}',
  866. data: [],
  867. type: 'post',
  868. dataType: 'json',
  869. success: function (data) {
  870. if (data.code == 1) {
  871. that.partnerList = data.content;
  872. }
  873. else {
  874. swal(data.msg);
  875. }
  876. }
  877. });
  878. },
  879. amountCopy: function () {
  880. this.item.amount = this._amount;
  881. },
  882. addOrder: function () {
  883. //接机
  884. if(this.item.ptype == 1) {
  885. this.item.address.from_name = this._airportItem.name_cn;//起始地址
  886. this.item.address.from_detail = this._airportItem.name_cn;//起始地址
  887. this.item.address.from_cid = this.city.cityid;//起始城市名称
  888. this.item.address.from_city = this.city.name_cn;//起始城市名称
  889. this.item.address.from_x = this._airportItem.x;//经度
  890. this.item.address.from_y = this._airportItem.y;//维度
  891. this.item.address.to_name = this.item.to_name;//到达地址
  892. this.item.address.to_detail = this.item.to_detail;//到达详细地址
  893. this.item.address.to_cid = this.city.cityid;//到达城市名称
  894. this.item.address.to_city = this.city.name_cn;//到达城市名称
  895. this.item.address.to_x = 0;//经度
  896. this.item.address.to_y = 0;//维度
  897. }
  898. //送机
  899. else if(this.item.ptype == 2) {
  900. }
  901. this.item.addroute.cartypeid = this._carTypeItem.id;
  902. this.item.addroute.cartype = this._carTypeItem.name;
  903. this.item.addroute.price = this._carTypeItem.price;
  904. this.item.addroute.carcount = this._carTypeItem.carcount;
  905. this.item.addroute.over_time_price = this._over_time_price;
  906. this.item.addroute.over_distance_price = this._over_distance_price;
  907. this.item.addroute.estimated_time = this.distancematrix.duration.value;
  908. this.item.addroute.estimated_distance = this.distancematrix.distance.value;
  909. this.item.addroute.over_time = (this.distancematrix.duration.value - this.item.addroute.free_time) * 1 < 0 ? 0 : (this.distancematrix.duration.value - this.item.addroute.free_time) * 1;
  910. this.item.addroute.over_distance = (this.distancematrix.distance.value - this.item.addroute.free_distance ) * 1 < 0 ? 0 : (this.distancematrix.distance.value - this.item.addroute.free_distance) * 1;
  911. var that = this;
  912. console.log(this.item);
  913. $.ajax({
  914. url: '{:url('order/addOrder')}',
  915. data: this.item,
  916. type: 'post',
  917. dataType: 'json',
  918. success: function (data) {
  919. if (data.code == 1) {
  920. swal(data.msg);
  921. }
  922. else {
  923. swal(data.msg);
  924. }
  925. }
  926. });
  927. },
  928. caradd:function () {
  929. var cartypeid = 0;
  930. $(this.$els.cartype).find("option:selected").each(function(){
  931. cartypeid = $(this).val();
  932. }); //这里得到的就是 });
  933. for (var item of this.cartype) {
  934. if(item.id == cartypeid) {
  935. this.item.car.push(item);
  936. console.log(this.item.car);
  937. return;
  938. }
  939. }
  940. return {
  941. price :0
  942. };
  943. },
  944. clearCar: function () {
  945. this.item.car = [];
  946. },
  947. carSelect: function () {
  948. var that = this;
  949. $("#carType").chosen({
  950. no_results_text: "没有找到!",
  951. allow_single_deselect: true,
  952. display_disabled_options: false
  953. }).change(function(){
  954. that.carTypeid
  955. });;
  956. $("#carType").trigger("liszt:updated");
  957. //$(".dept-select").chosen().
  958. },
  959. showSelect: function () {
  960. //$(that.$els.cartype).attr('data-id');
  961. //console.log(this.carTypeid);
  962. $(this.$els.cartype).find("option:selected").each(function(){
  963. alert($(this).val());
  964. }); //这里得到的就是 });
  965. }
  966. },
  967. ready : function () {
  968. this.getPartnerList();
  969. },
  970. })
  971. </script>
  972. <style>
  973. .chosen-container-single .chosen-single { padding-top: 3px;padding-bottom: 0;padding-left:10px;}
  974. .chosen-container-single .chosen-single div b { background-position: 0px 4px; }
  975. .chosen-container-active.chosen-with-drop .chosen-single div b { background-position-y:4px; }
  976. .chosen-container-multi .chosen-choices {
  977. padding: 0;
  978. }
  979. .chosen-container-active .chosen-choices {
  980. border: 1px solid #ccc;
  981. box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
  982. }
  983. .chosen-container-multi .chosen-results {
  984. padding:4px;
  985. }
  986. .chosen-container .chosen-results li {
  987. }
  988. </style>
  989. <script src="{$Think.config.base_url}/static/admin/js/plugins/chosen/chosen.jquery.js"></script>
  990. <script src="{$Think.config.base_url}/static/admin/js/plugins/suggest/bootstrap-suggest.min.js"></script>
  991. <script>
  992. $("#area").bsSuggest({
  993. indexId: 0,
  994. indexKey: 1,
  995. getDataMethod: "url",
  996. effectiveFieldsAlias: {
  997. cityid: "编号",
  998. name_la: "地区",
  999. },
  1000. showHeader: true,
  1001. data: {
  1002. value:[]
  1003. },
  1004. url: "{:url('city/getCityListByKeyword')}" + "/?keyword=",
  1005. processData: function(json) {
  1006. var i, len, data = {
  1007. value: []
  1008. };
  1009. if (json.code!=1) {
  1010. return;
  1011. }
  1012. len = json.content.length;
  1013. for (i = 0; i < len; i++) {
  1014. data.value.push({
  1015. "cityid": json.content[i]['cityid'],
  1016. "name_la": json.content[i]['name_la'],
  1017. })
  1018. }
  1019. return data;
  1020. }
  1021. });
  1022. $("#toCity").bsSuggest({
  1023. indexId: 0,
  1024. indexKey: 1,
  1025. getDataMethod: "url",
  1026. effectiveFieldsAlias: {
  1027. cityid: "编号",
  1028. name_la: "地区",
  1029. },
  1030. showHeader: true,
  1031. data: {
  1032. value:[]
  1033. },
  1034. url: "{:url('city/getCityListByKeyword')}" + "/?keyword=",
  1035. processData: function(json) {
  1036. var i, len, data = {
  1037. value: []
  1038. };
  1039. if (json.code!=1) {
  1040. return;
  1041. }
  1042. len = json.content.length;
  1043. for (i = 0; i < len; i++) {
  1044. data.value.push({
  1045. "cityid": json.content[i]['cityid'],
  1046. "name_la": json.content[i]['name_la'],
  1047. })
  1048. }
  1049. return data;
  1050. }
  1051. });
  1052. </script>
  1053. {include file="public/footer" /}