city_edit.tpl 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. {include file="public/header-begin" /}
  2. <link rel="stylesheet" href="{$Think.config.base_url}/static/admin/css/plugins/datapicker/datepicker3.css">
  3. <link rel="stylesheet" href="{$Think.config.base_url}/static/admin/css/plugins/chosen/chosen.css">
  4. <link rel="stylesheet" href="{$Think.config.base_url}/static/admin/css/style.min.css?v=4.0.0">
  5. <script src="{$Think.config.base_url}/static/common/js/vue.js"></script>
  6. {include file="public/header-end" /}
  7. <div class="wrapper wrapper-content">
  8. <div id="vue" class="row">
  9. <div class="col-sm-12 animated fadeInRight">
  10. <div class="mail-box-header">
  11. <div class="pull-right mail-search" style="max-width: inherit">
  12. <table class="zq_search">
  13. <tr>
  14. <td>
  15. <button onclick="window.location.href='{:url('index', ['cityid'=>$cityid, 'ptype'=>$ptype])}'" type="button" class="btn btn-sm btn-primary">返回 价格规则列表</button>
  16. </td>
  17. </tr>
  18. </table>
  19. </div>
  20. <h2>
  21. {$ptype_text}价格设置 - {{city.name_cn}} {{city.name_en}}
  22. </h2>
  23. <div class="mail-tools tooltip-demo m-t-md">
  24. <div class="btn-group pull-right">
  25. <table class="zq_search">
  26. <tr>
  27. <td>
  28. <button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="left" title="保存" @click="update()">保存</button>
  29. </td>
  30. </tr>
  31. </table>
  32. </div>
  33. <span v-if="pricenature.nature == 0">
  34. 报价规则:{{pricenature.nature_text}} - 有效时间(永久)
  35. </span>
  36. <span v-if="pricenature.nature == 1">
  37. 报价规则:{{pricenature.nature_text}} - 有效时间(周六和周天)
  38. </span>
  39. <span v-if="pricenature.nature == 2">
  40. 报价规则:{{pricenature.nature_text}} - 有效时间(周天)
  41. </span>
  42. <span v-if="pricenature.nature > 2">
  43. 报价规则:{{pricenature.nature_text}} - {{pricenature.title}} - 有效时间({{pricenature.begintime}} - {{pricenature.endtime}} 包含当天)
  44. </span>
  45. </div>
  46. </div>
  47. <div class="mail-box" style="position: relative; padding: 20px">
  48. <div class="row">
  49. <div class="col-sm-3 b-r">
  50. <h3 class="m-t-none m-b">经济型</h3>
  51. <div class="form-horizontal">
  52. <div class="hr-line-dashed"></div>
  53. <div class="form-group" v-for="(index,item) in cartypeList1">
  54. <label class="col-sm-4 control-label">{{item.name}}</label>
  55. <div class="col-sm-8">
  56. <div class="input-group m-b"><span class="input-group-addon">¥</span>
  57. <input type="text" class="form-control" v-model="item.price">
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="col-sm-3 b-r">
  64. <h3 class="m-t-none m-b">舒适性</h3>
  65. <div class="form-horizontal">
  66. <div class="hr-line-dashed"></div>
  67. <div class="form-group" v-for="(index,item) in cartypeList2">
  68. <label class="col-sm-4 control-label">{{item.name}}</label>
  69. <div class="col-sm-8">
  70. <div class="input-group m-b"><span class="input-group-addon">¥</span>
  71. <input type="text" class="form-control" v-model="item.price">
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="col-sm-3 b-r">
  78. <h3 class="m-t-none m-b">豪华型</h3>
  79. <div class="form-horizontal">
  80. <div class="hr-line-dashed"></div>
  81. <div class="form-group" v-for="(index,item) in cartypeList3">
  82. <label class="col-sm-4 control-label">{{item.name}}</label>
  83. <div class="col-sm-8">
  84. <div class="input-group m-b"><span class="input-group-addon">¥</span>
  85. <input type="text" class="form-control" v-model="item.price">
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="col-sm-3">
  92. <h3 class="m-t-none m-b color1">价格系数</h3>
  93. <div class="hr-line-dashed"></div>
  94. <div class="form-horizontal">
  95. <div class="form-group">
  96. <label class="col-sm-4 control-label">市区套餐里程</label>
  97. <div class="col-sm-8">
  98. <div class="input-group m-b">
  99. <input type="text" class="form-control" v-model="addroute.free_distance">
  100. <span class="input-group-addon">米</span>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="form-group">
  105. <label class="col-sm-4 control-label">郊区套餐里程</label>
  106. <div class="col-sm-8">
  107. <div class="input-group m-b">
  108. <input type="text" class="form-control" v-model="addroute.free_distance1">
  109. <span class="input-group-addon">米</span>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="form-group">
  114. <label class="col-sm-4 control-label">套餐时长</label>
  115. <div class="col-sm-8">
  116. <div class="input-group m-b">
  117. <input type="text" class="form-control" v-model="addroute.free_time">
  118. <span class="input-group-addon">分</span>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="form-group">
  123. <label class="col-sm-4 control-label">超出套餐里程费用</label>
  124. <div class="col-sm-8">
  125. <div class="input-group m-b">
  126. <span class="input-group-addon">¥</span>
  127. <input type="text" class="form-control" v-model="addroute.over_distance_priceper">
  128. <span class="input-group-addon">元/公里</span>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="form-group">
  133. <label class="col-sm-4 control-label">超出套餐时长费用</label>
  134. <div class="col-sm-8">
  135. <div class="input-group m-b">
  136. <span class="input-group-addon">¥</span>
  137. <input type="text" class="form-control" v-model="addroute.over_time_priceper">
  138. <span class="input-group-addon">元/15分钟</span>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="form-group">
  143. <label class="col-sm-4 control-label">夜间服务费</label>
  144. <div class="col-sm-8">
  145. <div class="input-group m-b">
  146. <span class="input-group-addon">¥</span>
  147. <input type="text" class="form-control" v-model="addroute.night">
  148. <span class="input-group-addon">元</span>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. {include file="public/footer-js" /}
  160. <script>
  161. Vue.filter('reverse', function (value) {
  162. return value.split('').reverse().join('')
  163. })
  164. Vue.filter('statusFilter', function (value) {
  165. switch(value)
  166. {
  167. case 0:
  168. return 'label-info';
  169. case 1:
  170. return 'label-danger';
  171. case 2:
  172. return 'label-danger';
  173. case 3:
  174. return 'label-danger';
  175. case 4:
  176. return 'label-danger';
  177. case 5:
  178. return 'label-danger';
  179. default:
  180. return 'label-danger';
  181. }
  182. });
  183. new Vue({
  184. el: '#vue',
  185. data: {
  186. cartypeList: [],
  187. addroute:{},
  188. city:{},
  189. pricenatureid: {$pricenatureid},
  190. ptype:{$ptype},
  191. pricenature:{},
  192. nature:{
  193. 0:true,
  194. 1:true,
  195. 2:true,
  196. 3:true,
  197. 4:true,
  198. 5:true
  199. },
  200. naturekey:0
  201. },
  202. methods: {
  203. search:function() {
  204. //有些非标准组件无法进行双向绑定;this.$els.area是需要在节点设置的
  205. var that = this;
  206. $.ajax( {
  207. url:'{:url('getCityByCityid')}',
  208. data:{
  209. cityid: {$cityid}
  210. },
  211. type:'post',
  212. dataType:'json',
  213. success:function(data) {
  214. if(data.code == 1) {
  215. that.city = data.content;
  216. $.ajax({
  217. url:'{:url('getCartypeList')}',
  218. data:{
  219. cityid: that.city.cityid,
  220. pricenatureid:that.pricenatureid,
  221. ptype:that.ptype
  222. },
  223. type:'post',
  224. dataType:'json',
  225. success:function(data) {
  226. if(data.code == 1) {
  227. that.cartypeList = data.content;
  228. }
  229. },
  230. error : function() {
  231. //alert("异常!");
  232. }
  233. });
  234. $.ajax({
  235. url:'{:url('getAddroute')}',
  236. data:{
  237. cityid: that.city.cityid,
  238. pricenatureid:that.pricenatureid,
  239. ptype:that.ptype
  240. },
  241. type:'post',
  242. dataType:'json',
  243. success:function(data) {
  244. if(data.code == 1) {
  245. that.addroute = data.content;
  246. }
  247. },
  248. error : function() {
  249. //alert("异常!");
  250. }
  251. });
  252. $.ajax({
  253. url:'{:url('getCityPricenature')}',
  254. data:{
  255. pricenatureid:that.pricenatureid,
  256. },
  257. type:'post',
  258. dataType:'json',
  259. success:function(data) {
  260. if(data.code == 1) {
  261. that.pricenature = data.content;
  262. }
  263. },
  264. error : function() {
  265. //alert("异常!");
  266. }
  267. });
  268. }
  269. },
  270. error : function() {
  271. //alert("异常!");
  272. }
  273. });
  274. },
  275. update:function() {
  276. var that = this;
  277. $.ajax({
  278. url: '{:url('setPriceByCartypeAndAddroute')}',
  279. data: {
  280. cartype_list: this.cartypeList,
  281. addroute: this.addroute,
  282. cityid:this.city.cityid,
  283. ptype:that.ptype,
  284. pricenatureid:that.pricenatureid
  285. },
  286. type: 'post',
  287. dataType: 'json',
  288. success: function (data) {
  289. that.search();
  290. swal(data.msg);
  291. },
  292. error : function() {
  293. //alert("异常!");
  294. }
  295. });
  296. },
  297. natureEvent:function(nature) {
  298. this.search();
  299. }
  300. },
  301. ready : function () {
  302. this.search();
  303. },
  304. computed : {
  305. cartypeList1:function(){
  306. var _item = [];
  307. for(var item of this.cartypeList) {
  308. if(item.type == 1) {
  309. _item.push(item);
  310. }
  311. }
  312. return _item;
  313. },
  314. cartypeList2:function(){
  315. var _item = [];
  316. for(var item of this.cartypeList) {
  317. if(item.type == 2) {
  318. _item.push(item);
  319. }
  320. }
  321. return _item;
  322. },
  323. cartypeList3:function(){
  324. var _item = [];
  325. for(var item of this.cartypeList) {
  326. if(item.type == 3) {
  327. _item.push(item);
  328. }
  329. }
  330. return _item;
  331. }
  332. }
  333. })
  334. </script>
  335. <script src="{$Think.config.base_url}/static/admin/js/plugins/datapicker/bootstrap-datepicker.js"></script>
  336. <script>
  337. //日期
  338. $("div[datepicker='datepicker']").datepicker({
  339. keyboardNavigation: !1,
  340. forceParse: !1,
  341. autoclose: !0
  342. });
  343. </script>
  344. <script src="{$Think.config.base_url}/static/admin/js/plugins/suggest/bootstrap-suggest.min.js"></script>
  345. <script>
  346. var testdataBsSuggest = $("#area").bsSuggest({
  347. indexId: 0,
  348. indexKey: 1,
  349. getDataMethod: "url",
  350. effectiveFieldsAlias: {
  351. cityid: "编号",
  352. name_la: "地区",
  353. },
  354. showHeader: true,
  355. data: {
  356. "value": [{
  357. "cityid": "0",
  358. "name_la": "lzw",
  359. },
  360. {
  361. "cityid": "1",
  362. "name_la": "lzwme",
  363. }],
  364. "defaults": "http://lzw.me"
  365. },
  366. url: "{:url('getCityListByKeyword')}" + "/?keyword=",
  367. processData: function(json) {
  368. var i, len, data = {
  369. value: []
  370. };
  371. if (json.code!=1) {
  372. return;
  373. }
  374. len = json.content.length;
  375. for (i = 0; i < len; i++) {
  376. data.value.push({
  377. "cityid": json.content[i]['cityid'],
  378. "name_la": json.content[i]['name_la'],
  379. })
  380. }
  381. return data;
  382. }
  383. });
  384. </script>
  385. {include file="public/footer" /}