receipt_trave_component.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. /*
  2. * @description: 费用-差旅组件
  3. * @Author: CP
  4. * @Date: 2020-11-16 14:52:08
  5. * @FilePath: \cld\global\vue\fee\receipt_trave_component.js
  6. */
  7. Vue.component("trave", {
  8. data: function () {
  9. return {
  10. // 行程时间
  11. traveDay: 0,
  12. tripTime: "",
  13. regionOption: region,
  14. // regionLeve2Option: region[0].child,
  15. // arrivalLeve2Option: region[0].child,
  16. //新增下拉地区
  17. regionLeve2Option: region[defaultTraveProvinceIndex].child,
  18. arrivalLeve2Option: region[defaultTraveProvinceIndex].child,
  19. //编辑下拉地区
  20. regionLeve2OptionEdi: [],
  21. arrivalLeve2OptionEdi: [],
  22. // 出发地 省 市
  23. // departureProvince: region[0].name,
  24. // departureCity: region[0].child[0].name,
  25. departureProvince: defaultTraveProvince,
  26. departureCity: region[defaultTraveProvinceIndex].child[0].name,
  27. // 结束地 省 市
  28. // arrivalProvince: region[0].name,
  29. // arrivalCity: region[0].child[0].name,
  30. arrivalProvince: defaultTraveProvince,
  31. arrivalCity: region[defaultTraveProvinceIndex].child[0].name,
  32. // 目的地数组
  33. arrivalList: [],
  34. tripTimeEdi: "",
  35. departureProvinceEdi: '',
  36. departureCityEdi: '',
  37. arrivalProvinceEdi: '',
  38. arrivalCityEdi: '',
  39. ediIndex: '',
  40. // arrivalListEdi: [],
  41. }
  42. },
  43. props: ['traveItem', 'alertDia', 'traveList', 'traveExplain'],
  44. computed: {
  45. travePrice: function () {
  46. return travePrice(this.traveList);
  47. }
  48. },
  49. methods: {
  50. //行程时间验证
  51. changeCount: function (event) {
  52. this.tripTime = event.target.value;
  53. this.tripTimeEdi = event.target.value;
  54. let dateArray = event.target.value.split(" - ");
  55. if (dateArray.length == 2) {
  56. let dateFormat = /^(\d{4})-(\d{2})-(\d{2})$/;
  57. if (!dateFormat.test(dateArray[0])) {
  58. this.alertDia("差旅行程时间填写有误");
  59. return
  60. }
  61. if (!dateFormat.test(dateArray[1])) {
  62. this.alertDia("差旅行程时间填写有误");
  63. return
  64. }
  65. }
  66. // if(ValidTraveDate(dateArray)){
  67. // this.alertDia("差旅行程时间填写有误");
  68. // return
  69. // }
  70. traveDay = (Math.abs(Date.parse(dateArray[0]) - Date.parse(dateArray[1]))) / (1000 * 60 * 60 * 24) + 1;
  71. if (!isNaN(traveDay)) {
  72. this.traveDay = traveDay;
  73. let alertDia = this.alertDia;
  74. // 验证时间
  75. $.ajax({
  76. type: "GET",
  77. url: "/json/trave/date/all",
  78. dataType: "json",
  79. processData: false,
  80. contentType: false,
  81. }).success(function (sortList) {
  82. let item = new Array(new Date(Math.round(new Date(dateArray[0]).getTime() / 1000 - 28800)).getTime(), new Date(Math.round(new Date(dateArray[1]).getTime() / 1000 - 28800)).getTime());
  83. sortList.push(item);
  84. let TraveStatus = isTraveDate(sortList);
  85. if (TraveStatus == 2) {
  86. alertDia("差旅行程日期段-有重复");
  87. }
  88. }).fail(function (msg) {
  89. alertDia("历史差旅时间获取失败");
  90. });
  91. }
  92. // this.traveDay=new Date(dateArray[1]).getDate()-new Date(dateArray[0]).getDate()+1;
  93. },
  94. changeRegionLeve2: function (event, model) {
  95. this.regionOption.forEach(element => {
  96. if (element.name == event.target.value) {
  97. if (model == "departureCity") {
  98. this.regionLeve2Option = element.child;
  99. this.departureCity = element.child[0].name;
  100. this.departureCityEdi = element.child[0].name;
  101. this.arrivalProvinceEdi = element.name;
  102. this.arrivalProvince = element.name;
  103. this.arrivalLeve2Option = element.child;
  104. this.arrivalCity = element.child[0].name;
  105. this.arrivalCityEdi = element.child[0].name;
  106. } else if (model == "arrivalCity") {
  107. this.arrivalLeve2Option = element.child;
  108. this.arrivalCity = element.child[0].name;
  109. this.arrivalCityEdi = element.child[0].name;
  110. }
  111. return
  112. }
  113. });
  114. },
  115. changeArrivalCity: function (event) {
  116. this.arrivalCity = event.target.value
  117. this.arrivalCityEdi = event.target.value
  118. },
  119. // 行程单相关
  120. // 打开行程单
  121. openTrip: function () {
  122. this.arrivalList = [];
  123. this.tripTime = "";
  124. },
  125. deleteTrip(index) {
  126. this.traveList.splice(index, 1)
  127. },
  128. addTrip: function () {
  129. if (this.tripTime == "") {
  130. this.alertDia("请选择行程时间");
  131. return
  132. }
  133. // 构建行程信息
  134. tripList = [];
  135. // 出发地
  136. var newTripItem = NewTraveItem();
  137. tripList.push({
  138. province: this.departureProvince,
  139. city: this.departureCity,
  140. tripItem: newTripItem,
  141. subtotal: 0,
  142. });
  143. // 目的地
  144. this.arrivalList.forEach(element => {
  145. var newTripItem = NewTraveItem();
  146. tripList.push({
  147. province: element.arrivalProvince,
  148. city: element.arrivalCity,
  149. tripItem: newTripItem,
  150. subtotal: 0,
  151. });
  152. });
  153. // 结束地
  154. var newTripItem = NewTraveItem();
  155. tripList.push({
  156. province: this.arrivalProvince,
  157. city: this.arrivalCity,
  158. tripItem: newTripItem,
  159. subtotal: 0.00,
  160. });
  161. // 构建差旅信息
  162. trave = {
  163. tripTime: this.tripTime,
  164. tripList: tripList,
  165. total: 0.00,
  166. };
  167. this.traveList.push(trave);
  168. $('#route-add').modal('hide')
  169. },
  170. openEdiTrip(index) {
  171. this.ediIndex = index;
  172. let tripData = this.traveList[index];
  173. this.tripTimeEdi = tripData.tripTime;
  174. // 出发地
  175. this.departureProvinceEdi = tripData.tripList[0].province;
  176. this.departureCityEdi = tripData.tripList[0].city;
  177. this.regionOption.forEach(el => {
  178. if (el.name == this.departureProvinceEdi) {
  179. this.regionLeve2OptionEdi = el.child;
  180. return
  181. }
  182. });
  183. //this.regionLeve2Option= tripData.tripList;
  184. // 结束
  185. let endIndex = tripData.tripList.length - 1
  186. this.arrivalProvinceEdi = tripData.tripList[endIndex].province;
  187. this.arrivalCityEdi = tripData.tripList[endIndex].city;
  188. this.regionOption.forEach(el => {
  189. if (el.name == this.arrivalProvinceEdi) {
  190. this.arrivalLeve2OptionEdi = el.child;
  191. return
  192. }
  193. });
  194. //this.arrivalLeve2Option=tripData.tripList,
  195. // 目的地
  196. this.arrivalList = [];
  197. tripData.tripList.forEach((element, index) => {
  198. // 获得目的城市下拉菜单
  199. let arrivalCityOption = [];
  200. this.regionOption.forEach(el => {
  201. if (el.name == element.province) {
  202. arrivalCityOption = el.child;
  203. return
  204. }
  205. });
  206. if (index !== 0 && index !== endIndex) {
  207. this.arrivalList.push({
  208. "arrivalProvince": element.province,
  209. "arrivalCity": element.city,
  210. "arrivalCityOption": arrivalCityOption
  211. });
  212. }
  213. });
  214. },
  215. ediTrip() {
  216. if (this.tripTime == "") {
  217. this.alertDia("请选择行程时间");
  218. return
  219. }
  220. // // 构建行程信息
  221. // tripList = [];
  222. // // 出发地
  223. // var newTripItem = NewTraveItem();
  224. // tripList.push({
  225. // province: this.departureProvinceEdi,
  226. // city: this.departureCityEdi,
  227. // tripItem: newTripItem,
  228. // subtotal: 0,
  229. // });
  230. // // 目的地
  231. // this.arrivalList.forEach(element => {
  232. // var newTripItem = NewTraveItem();
  233. // tripList.push({
  234. // province: element.arrivalProvince,
  235. // city: element.arrivalCity,
  236. // tripItem: newTripItem,
  237. // subtotal: 0,
  238. // });
  239. // });
  240. // // 结束地
  241. // var newTripItem = NewTraveItem();
  242. // tripList.push({
  243. // province: this.arrivalProvinceEdi,
  244. // city: this.arrivalCityEdi,
  245. // tripItem: newTripItem,
  246. // subtotal: 0.00,
  247. // });
  248. // // 构建差旅信息
  249. // trave = {
  250. // tripTime: this.tripTime,
  251. // tripList: tripList,
  252. // total: 0.00,
  253. // };
  254. // this.traveList[this.ediIndex] = trave;
  255. // // 更新差旅信息
  256. this.traveList[this.ediIndex].tripList[0].province=this.departureProvinceEdi;
  257. this.traveList[this.ediIndex].tripList[0].city=this.departureCityEdi;
  258. // this.traveList[this.ediIndex].tripList[0].subtotal=0;
  259. // // 更新出发地
  260. // this.traveList[this.ediIndex].tripList[0].tripItem.forEach(element => {
  261. // element.price=0.00;
  262. // element.remark="";
  263. // });
  264. // 更新目的地
  265. let countOriginal=this.traveList[this.ediIndex].tripList.length-2;
  266. let countNow=this.arrivalList.length;
  267. if(countOriginal>countNow){
  268. let poor=countOriginal-countNow;
  269. this.traveList[this.ediIndex].tripList.splice(countNow,poor);
  270. }
  271. // 相等-更新省市,是否更新过
  272. if(countOriginal==countNow){
  273. let count=this.traveList[this.ediIndex].tripList.length-1;
  274. this.traveList[this.ediIndex].tripList.forEach((element,index) => {
  275. if(index>0&&index<count){
  276. element.province=this.arrivalList[index-1].arrivalProvince;
  277. element.city=this.arrivalList[index-1].arrivalCity;
  278. }
  279. });
  280. }
  281. if(countOriginal<countNow){
  282. // 更新原地区
  283. let count=this.traveList[this.ediIndex].tripList.length
  284. if(count>2){
  285. this.traveList[this.ediIndex].tripList.forEach((element,index) => {
  286. if(index>0&&index<count){
  287. element.province=this.arrivalList[index-1].arrivalProvince;
  288. element.city=this.arrivalList[index-1].arrivalCity;;
  289. }
  290. });
  291. }
  292. if(countOriginal==0){
  293. this.arrivalList.forEach(element => {
  294. var newTripItem = NewTraveItem();
  295. this.traveList[this.ediIndex].tripList.splice(1,0,{
  296. province: element.arrivalProvince,
  297. city: element.arrivalCity,
  298. tripItem: newTripItem,
  299. subtotal: 0,
  300. });
  301. });
  302. }else{
  303. let poor=countNow-countOriginal;
  304. for (let i = 0; i < poor; i++) {
  305. var newTripItem = NewTraveItem();
  306. this.traveList[this.ediIndex].tripList.splice(countOriginal+1,0,{
  307. province: this.arrivalList[poor+i].arrivalProvince,
  308. city: this.arrivalList[poor+i].arrivalCity,
  309. tripItem: newTripItem,
  310. subtotal: 0,
  311. });
  312. }
  313. }
  314. }
  315. // this.traveList[this.ediIndex].tripList.splice(1,countOriginal-2);
  316. // this.traveList[this.ediIndex].tripList.forEach((element,index) => {
  317. // if(index>0&&index<count){
  318. // delete this.traveList[this.ediIndex].tripList[index];
  319. // }
  320. // });
  321. // 目的地
  322. // this.arrivalList.forEach(element => {
  323. // var newTripItem = NewTraveItem();
  324. // this.traveList[this.ediIndex].tripList.splice(1,0,{
  325. // province: element.arrivalProvince,
  326. // city: element.arrivalCity,
  327. // tripItem: newTripItem,
  328. // subtotal: 0,
  329. // });
  330. // // this.traveList[this.ediIndex].tripList.push({
  331. // // province: element.arrivalProvince,
  332. // // city: element.arrivalCity,
  333. // // tripItem: newTripItem,
  334. // // subtotal: 0,
  335. // // });
  336. // });
  337. // 结束地
  338. let count=this.traveList[this.ediIndex].tripList.length;
  339. this.traveList[this.ediIndex].tripList[count-1].province=this.arrivalProvinceEdi;
  340. this.traveList[this.ediIndex].tripList[count-1].city=this.arrivalCityEdi;
  341. // this.traveList[this.ediIndex].tripList[count-1].subtotal=0.00;
  342. // var newTripItem = NewTraveItem();
  343. // this.traveList[this.ediIndex].tripList.push({
  344. // province: this.arrivalProvinceEdi,
  345. // city: this.arrivalCityEdi,
  346. // tripItem: newTripItem,
  347. // subtotal: 0.00,
  348. // });
  349. this.traveList[this.ediIndex].tripTime=this.tripTime;
  350. this.traveList[this.ediIndex].total=0.00;
  351. // 重新计算费用合计
  352. this.computeTraveItem();
  353. // this.travePrice();
  354. // this.traveItem=[];
  355. // 更新完成
  356. this.ediIndex = '';
  357. this.tripTimeEdi = '';
  358. this.departureProvinceEdi = '';
  359. this.departureCityEdi = '';
  360. this.arrivalProvinceEdi = '';
  361. this.arrivalCityEdi = '';
  362. this.arrivalList = [];
  363. $('#route-edi').modal('hide')
  364. },
  365. addArrivalDom: function (option) {
  366. // dom = {
  367. // "arrivalProvince": region[0].name,
  368. // "arrivalCity": region[0].child[0].name,
  369. // "arrivalCityOption": region[0].child,
  370. // }
  371. //1.没有目的地的时候
  372. let arrivalProvince = this.departureProvince;
  373. let arrivalCity = this.departureCity;
  374. let childIndexValue = this.departureProvince;
  375. if (option == "edi") {
  376. arrivalProvince = this.departureProvinceEdi;
  377. arrivalCity = this.departureCityEdi;
  378. childIndexValue = this.departureProvinceEdi;
  379. }
  380. if (this.arrivalList.length !== 0) {
  381. childIndexValue = this.arrivalList[this.arrivalList.length - 1].arrivalProvince
  382. arrivalProvince = childIndexValue;
  383. arrivalCity = this.arrivalList[this.arrivalList.length - 1].arrivalCity;
  384. }
  385. let index = 0;
  386. region.forEach((element, i) => {
  387. if (element.name === childIndexValue) {
  388. index = i;
  389. return;
  390. }
  391. });
  392. dom = {
  393. "arrivalProvince": arrivalProvince,
  394. "arrivalCity": arrivalCity,
  395. "arrivalCityOption": region[index].child,
  396. }
  397. this.arrivalList.push(dom);
  398. },
  399. delArrivalDom: function (index) {
  400. this.arrivalList.splice(index, 1)
  401. },
  402. changeArrivalLeve2: function (event, index) {
  403. this.regionOption.forEach(element => {
  404. if (element.name == event.target.value) {
  405. this.arrivalList[index].arrivalCityOption = element.child;
  406. this.arrivalList[index].arrivalCity = element.child[0].name;
  407. return
  408. }
  409. });
  410. },
  411. computeTraveItem: function (event) {
  412. this.traveItem.forEach((element, index) => {
  413. let sum = 0;
  414. // 每一列求和
  415. this.traveList.forEach(el => {
  416. el.tripList.forEach(elementlv2 => {
  417. elementlv2.tripItem.forEach(elementlv3 => {
  418. if (element.name == elementlv3.name) {
  419. sum += Number(elementlv3.price);
  420. }
  421. });
  422. });
  423. });
  424. this.traveItem[index].price = sum.toFixed(2);
  425. });
  426. // 每一个小目的地合计
  427. this.traveList.forEach((el, index) => {
  428. let total = 0;
  429. el.tripList.forEach((elementlv2, indexlv2) => {
  430. let sum = 0;
  431. elementlv2.tripItem.forEach(elementlv3 => {
  432. sum += Number(elementlv3.price);
  433. });
  434. total += sum
  435. this.traveList[index].tripList[indexlv2].subtotal = sum.toFixed(2);
  436. });
  437. this.traveList[index].total = total.toFixed(2);
  438. });
  439. },
  440. blurSetTraveDay:function (event){
  441. // 补齐日期
  442. // 交互事件没有合适的,日期控件会重复触发失去焦点
  443. console.log(event.target.value)
  444. console.log(this.tripTime)
  445. },
  446. },
  447. template:
  448. `
  449. <div>
  450. <div class="seTable">
  451. <table class="table table-bordered table-condensed mb-0">
  452. <tbody>
  453. <tr>
  454. <th colspan="2" class="taC">差旅相关费用</th>
  455. </tr>
  456. <tr>
  457. <td colspan="2">
  458. <!--行程1-->
  459. <table v-for="(trave,index) in traveList" class="table table-bordered table-condensed table-hover"
  460. style="margin-bottom: 5px;">
  461. <tr>
  462. <th colspan="3" class="taC">行程{{ index+1 }}#
  463. {{ trave.tripTime }}
  464. <div class="fR ">
  465. <a href="javascript:void(0)" @click="deleteTrip(index)" class="text-danger" data-toggle="modal">删除</a>
  466. <a href="#route-edi" @click="openEdiTrip(index)" data-toggle="modal">编辑</a>
  467. </div>
  468. </th>
  469. </tr>
  470. <tbody v-for="(trip,i) in trave.tripList" >
  471. <tr>
  472. <th colspan="3" class="ta"><i class="contactsMark icon-">P</i> {{trip.province}}-{{trip.city}}</th>
  473. </tr>
  474. <tr v-for="item in trip.tripItem" v-if="i!==trave.tripList.length-1" >
  475. <th width="90">{{item.name}}</th>
  476. <td class="taR" width="100">
  477. ¥<input type="number" v-model="item.price" @input="computeTraveItem" pattern="[0-9]" step="0.01" min="0" class="span1">
  478. </td>
  479. <th>
  480. <textarea required v-model="item.remark" rows="2" style="width: 99%; margin-bottom: 0" ></textarea>
  481. </th>
  482. </tr>
  483. </tbody>
  484. </table>
  485. </td>
  486. </tr>
  487. <tr>
  488. <th colspan="2" class="taC"><a href="#route-add" @click="openTrip" data-toggle="modal"
  489. class="button">添加新行程</a></th>
  490. </tr>
  491. <tr>
  492. <th colspan="2" class="taC">差旅相关费用合计</th>
  493. </tr>
  494. <tr v-for="item in traveItem" >
  495. <th>{{ item.name }}</th>
  496. <td class="taR" width="200">¥{{ item.price }}</td>
  497. </tr>
  498. <tr class="warning">
  499. <td class="taR"><b>差旅相关费用合计</b></td>
  500. <td class="colGreed taR"><b style="font-size: 24px">¥{{travePrice}}</b></td>
  501. </tr>
  502. <tr>
  503. <th colspan="2" class="taC">报销说明</th>
  504. </tr>
  505. <tr>
  506. <th colspan="2" v-for="item in traveExplain" >
  507. <textarea required rows="6" style="width: 99%" v-model="item.traveExplain" placeholder="差旅相关费用额外说明"></textarea>
  508. </th>
  509. </tr>
  510. </tbody>
  511. </table>
  512. </div>
  513. <div class="seCensor receipt-censor">
  514. <div class="title">报销单填写说明</div>
  515. <div class="detail">
  516. <p>1
  517. 请按先后发生顺序填写报销明细,交通费(市内交通费及往来交通费)、邮寄费需在批注明注明费用明细(例:珠海-广州70元-佛山20元);</p>
  518. <p>2 出差补助30元/天,不需提供发票,只需在报销单上填写清楚;</p>
  519. <p>
  520. 3 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处。
  521. </p>
  522. </div>
  523. <div class="itinerary">
  524. <h2 class="itineraryTitle">总行程单</h2>
  525. <div class="itineraryCon">
  526. <ul v-for="(trave,index) in traveList" >
  527. <li class="sub-title">行程{{ index+1 }}# {{ trave.tripTime }}</li>
  528. <li v-for="(trip,i) in trave.tripList" >
  529. <div class="itineraryList">
  530. <div class="addressName">
  531. <i class="contactsMark icon-">P</i> <b>{{trip.city}}</b>
  532. </div>
  533. <div class="pointLine " v-if="i!==trave.tripList.length-1" >
  534. <div class="timeList">
  535. <div class="priceList">
  536. <span class="priceTitle">小计</span>
  537. <span class="price">¥{{ trip.subtotal }}</span>
  538. </div>
  539. </div>
  540. </div>
  541. </div>
  542. </li>
  543. <li class="sub-title">行程{{ index+1 }}# 合计:{{ trave.total }}</li>
  544. </ul>
  545. </div>
  546. </div>
  547. </div>
  548. <!--弹出 编辑行程 -->
  549. <div class="modal hide fade" id="route-edi">
  550. <div class="modal-dialog">
  551. <div class="modal-content">
  552. <div class="modal-header">
  553. <h3>编辑行程</h3>
  554. </div>
  555. <div class="modal-body saeaList">
  556. <table class="table table-bordered table-condensed">
  557. <tr>
  558. <th class="taC" colspan="2">行程</th>
  559. </tr>
  560. <tr>
  561. <th>出发/结束日期</th>
  562. <td><input class="datepicker-here span3" placeholder="按时间筛选" type="text" data-range="true"
  563. data-multiple-dates-separator=" - " data-language="zh" @blur.prevent="changeCount" v-model="tripTimeEdi" >
  564. &nbsp;&nbsp;旅程合计:<b class="colRed">{{ traveDay }}</b>天
  565. </td>
  566. </tr>
  567. <tr>
  568. <th><span>┌</span> 出发地</th>
  569. <td>
  570. <select v-model="departureProvinceEdi" @change="changeRegionLeve2($event,'departureCity')" >
  571. <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
  572. </select>
  573. <select v-model="departureCityEdi" @change="changeArrivalCity($event)">
  574. <option v-for="option in regionLeve2OptionEdi">{{option.name}}</option>
  575. </select>
  576. <a href="javascript:void(0)" @click="addArrivalDom('edi')" >+添加目的地</a>
  577. </td>
  578. </tr>
  579. <tr v-for="(item,index) in arrivalList" >
  580. <th><span class="">├</span> 目的地</th>
  581. <td>
  582. <select v-model="item.arrivalProvince" @change="changeArrivalLeve2($event,index)" >
  583. <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
  584. </select>
  585. <select v-model="item.arrivalCity">
  586. <option v-for="option in item.arrivalCityOption">{{option.name}}</option>
  587. </select> <a href="javascript:void(0)" @click="delArrivalDom(index)">-移除</a>
  588. </td>
  589. </tr>
  590. <tr>
  591. <th><span class="">└</span> 结束</th>
  592. <td>
  593. <select v-model="arrivalProvinceEdi" @change="changeRegionLeve2($event,'arrivalCity')" >
  594. <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
  595. </select>
  596. <select v-model="arrivalCityEdi">
  597. <option v-for="option in arrivalLeve2OptionEdi">{{option.name}}</option>
  598. </select>
  599. </td>
  600. </tr>
  601. </table>
  602. </div>
  603. <div class="modal-footer">
  604. <a href="javascript:void(0)" class="button" @click="ediTrip" >确认</a>
  605. <a href="javascript:void(0)" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
  606. </div>
  607. </div>
  608. </div>
  609. </div>
  610. <!--弹出 添加行程 -->
  611. <div class="modal hide fade" id="route-add">
  612. <div class="modal-dialog">
  613. <div class="modal-content">
  614. <div class="modal-header">
  615. <h3>添加行程</h3>
  616. </div>
  617. <div class="modal-body saeaList">
  618. <table class="table table-bordered table-condensed">
  619. <tr>
  620. <th class="taC" colspan="2">行程</th>
  621. </tr>
  622. <tr>
  623. <th>出发/结束日期</th>
  624. <td><input class="datepicker-here span3" placeholder="按时间筛选" type="text" data-range="true"
  625. data-multiple-dates-separator=" - " data-language="zh" @blur.prevent="changeCount" v-model="tripTime" @blur="blurSetTraveDay" >
  626. &nbsp;&nbsp;旅程合计:<b class="colRed">{{ traveDay }}</b>天
  627. </td>
  628. </tr>
  629. <tr>
  630. <th><span>┌</span> 出发地</th>
  631. <td>
  632. <select v-model="departureProvince" @change="changeRegionLeve2($event,'departureCity')" >
  633. <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
  634. </select>
  635. <select v-model="departureCity" @change="changeArrivalCity($event)">
  636. <option v-for="option in regionLeve2Option">{{option.name}}</option>
  637. </select>
  638. <a href="javascript:void(0)" @click="addArrivalDom" >+添加目的地</a>
  639. </td>
  640. </tr>
  641. <tr v-for="(item,index) in arrivalList" >
  642. <th><span class="">├</span> 目的地</th>
  643. <td>
  644. <select v-model="item.arrivalProvince" @change="changeArrivalLeve2($event,index)" >
  645. <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
  646. </select>
  647. <select v-model="item.arrivalCity">
  648. <option v-for="option in item.arrivalCityOption">{{option.name}}</option>
  649. </select> <a href="javascript:void(0)" @click="delArrivalDom(index)">-移除</a>
  650. </td>
  651. </tr>
  652. <tr>
  653. <th><span class="">└</span> 结束</th>
  654. <td>
  655. <select v-model="arrivalProvince" @change="changeRegionLeve2($event,'arrivalCity')" >
  656. <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
  657. </select>
  658. <select v-model="arrivalCity">
  659. <option v-for="option in arrivalLeve2Option">{{option.name}}</option>
  660. </select>
  661. </td>
  662. </tr>
  663. </table>
  664. </div>
  665. <div class="modal-footer">
  666. <a href="javascript:void(0)" class="button" @click="addTrip" >确认</a>
  667. <a href="javascript:void(0)" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
  668. </div>
  669. </div>
  670. </div>
  671. </div>
  672. <!--结束 弹出 添加行程 -->
  673. </div>
  674. `
  675. })