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.

3 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: luocj
  5. * Date: 2017/2/15
  6. * Time: 11:38
  7. */
  8. use common\components\zActiveForm;
  9. use yii\widgets\Pjax;
  10. use common\models\BaseButtonPermission;
  11. use yii\helpers\Html;
  12. use backend\modules\motorcade\models\BusSearch;
  13. use backend\modules\api\models\DictType;
  14. use yii\helpers\Url;
  15. if ($model == '') {
  16. $model = new BusSearch(['scenario' => 'add_bus']);
  17. }
  18. ?>
  19. <style>
  20. body {
  21. background: none;
  22. }
  23. #bus_department {
  24. display: inline-block;
  25. }
  26. .form-group {
  27. display: inline-block;
  28. }
  29. /*p{*/
  30. /*display: inherit!important;*/
  31. /*}*/
  32. /*.help-block{*/
  33. /*display: inline-block!important;*/
  34. /*}*/
  35. .main {
  36. height: 65px;
  37. }
  38. .modal-open .datepicker {
  39. z-index: 101005 !important;
  40. }
  41. #seat_count1 {
  42. display: inline-block;
  43. }
  44. .modal-footer {
  45. text-align: left;
  46. }
  47. #bussearch-bus_belong {
  48. line-height: 25px;
  49. }
  50. .portlet > .portlet-body p {
  51. margin-top: 0;
  52. font-size: 12px;
  53. }
  54. .field-seat_type {
  55. vertical-align: top;
  56. }
  57. .field-seat_count {
  58. vertical-align: top;
  59. }
  60. #bus_company1 {
  61. margin-left: 35px;
  62. }
  63. .tab-content .form-group label {
  64. width: 50px !important;
  65. text-align: right;
  66. }
  67. .c_red {
  68. color: #e02222;
  69. }
  70. .date {
  71. width: 275px !important;
  72. }
  73. .search_name_this {
  74. display: inline-block !important;
  75. /*padding-left: 40px!important;*/
  76. padding-left: 0px !important;
  77. width: 91px !important;
  78. text-align: right !important;
  79. color: #80889a;
  80. }
  81. .search_name {
  82. display: inline-block !important;
  83. /*padding-left: 40px!important;*/
  84. padding-left: 15px !important;
  85. width: 115px !important;
  86. text-align: right !important;;
  87. }
  88. #bussearch-bus_belong > label {
  89. margin-left: 5px;
  90. margin-right: 10px
  91. }
  92. .form-inline {
  93. margin-bottom: 25px;
  94. margin-left: 0px;
  95. }
  96. .help-block {
  97. position: absolute;
  98. margin-left: 0px !important;
  99. }
  100. .form-horizontal .form-group {
  101. margin-right: 0 !important;
  102. margin-left: 0 !important;
  103. }
  104. .span_left {
  105. width: 90px;
  106. text-align: right;
  107. display: inline-block;
  108. color: #80889a;
  109. }
  110. li > a {
  111. color: #80889a;
  112. }
  113. li > .active > a {
  114. color: #3e4355;
  115. }
  116. .old-nav {
  117. color: #80889a;
  118. cursor: pointer;
  119. }
  120. .old-nav:hover, .old-nav:focus, .old-nav:active {
  121. text-decoration: none;
  122. }
  123. .new-nav {
  124. color: #3e4355;
  125. text-decoration: none;
  126. }
  127. .new-nav:hover, .new-nav:focus, .new-nav:active {
  128. text-decoration: none;
  129. }
  130. * {
  131. color: #80889a;
  132. font-size: 12px;
  133. }
  134. label {
  135. color: #80889a;
  136. }
  137. /*.toGrey {*/
  138. /*background: lightgrey !important;*/
  139. /*border: lightgray !important;*/
  140. /*}*/
  141. </style>
  142. <?php $this->registerJs('z.init()'); ?>
  143. <div class="iframe_box">
  144. <header style="margin-top:15px">
  145. <a class="old-nav" href="/motorcade/resource/bus-list">安全机务 / </a>
  146. <a class="old-nav" href="/motorcade/resource/bus-list">车辆管理 / </a>
  147. <span class="new-nav">添加车辆</>
  148. </header>
  149. <ul class="nav nav-tabs nav_title" role="tablist" style="margin-top:40px">
  150. <li href="#tab1" role="presentation" class="active" data-toggle="tab">
  151. <a style="cursor: pointer">基本信息</a>
  152. </li>
  153. <li href="#tab4" onclick='Command: parent.toastr["warning"]("请先保存车辆基本信息");' disabled="disabled"
  154. id="bus_attached" role="presentation" class="width5 hidden">
  155. <a style="cursor: pointer">合作经营协议</a>
  156. </li>
  157. <li href="#tab2" onclick='Command: parent.toastr["warning"]("请先保存车辆基本信息");' disabled="disabled"
  158. role="presentation" class="">
  159. <a style="cursor: pointer">运营资质</a>
  160. </li>
  161. <li href="#tab3" onclick='Command: parent.toastr["warning"]("请先保存车辆基本信息");' role="presentation" class="">
  162. <a style="cursor: pointer">保养</a>
  163. </li>
  164. </ul>
  165. <div role="tabpanel" class="tab-pane" id="tab1">
  166. <?php $form = zActiveForm::begin(['action' => '/motorcade/base-bus/add-bus?tab=tab2', 'id' => 'form', 'enableAjaxValidation' => true, 'validationUrl' => Url::toRoute(['validate-form']), 'options' => ['class' => 'form-horizontal', 'style' => 'border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd']]); ?>
  167. <!--所属车队-->
  168. <div class="form-inline">
  169. <div class="form-group" style="margin-top: 10px;">
  170. <span class="span_left">
  171. <span class="c_red">*</span>所属车队:
  172. </span>
  173. <?= $form->field($model, 'BUS_BELONG')->radioList(\yii\helpers\ArrayHelper::map(DictType::findAll(['PARENT_ID' => 522]), 'ID', 'TYPE_NAME'), ['style' => 'display:inline-block;', 'onclick' => 'showBusCompany(\'BusSearch\')'])->label(false) ?>
  174. <div id="bus_company" style="display: none;vertical-align: top;">
  175. <?= $form->field($model, 'ORG_ID')->dropDownList(\yii\helpers\ArrayHelper::map(BusSearch::getBusCompany(), 'id', 'supplier_name'), ['class' => 'form-control select2 select2-hidden-accessible js-example-placeholder-single1', 'style' => 'display:inline-block', 'id' => 'bus_company'])->label(false); ?>
  176. </div>
  177. </div>
  178. </div>
  179. <!--车牌号-->
  180. <div class="form-inline">
  181. <div class="form-group">
  182. <span class="span_left">
  183. <span class="c_red">*</span>车牌号:
  184. </span>
  185. <?= $form->field($model, 'BUS_NO')->textInput(['placeholder' => '请输入车牌号', 'style' => 'width:275px;'])->label(false) ?>
  186. </div>
  187. </div>
  188. <!--品牌-->
  189. <div class="form-inline">
  190. <div class="form-group">
  191. <span class="span_left">
  192. <span class="c_red">*</span>品牌:
  193. </span>
  194. <?= $form->field($model, 'BRAND_ID')->dropDownList(\yii\helpers\ArrayHelper::map(BusSearch::getBrands(), 'res_id', 'res_name'), ['prompt' => '请选择', 'class' => 'form-control', 'style' => 'width:275px'])->label(false)->error(false) ?>
  195. </div>
  196. </div>
  197. <!--型号-->
  198. <div class="form-inline">
  199. <div class="form-group">
  200. <span class="span_left">
  201. 型号:
  202. </span>
  203. <?= $form->field($model, 'BUS_LICENSE')->textInput(['placeholder' => '请输入型号', 'style' => 'width:275px;display:inline-block'])->label(false)->error(false) ?>
  204. </div>
  205. </div>
  206. <!--燃料形式-->
  207. <div class="form-inline">
  208. <div class="form-group">
  209. <span class="span_left">
  210. <span class="c_red">*</span>燃料形式:
  211. </span>
  212. <?= $form->field($model, 'FUEL_FORM')->dropDownList(\yii\helpers\ArrayHelper::map(BusSearch::getFuel(), 'id', 'type_name'), ['prompt' => '请选择', 'class' => 'form-control', 'id' => 'fuelType', 'onChange' => 'fuelChange()', 'style' => 'width:275px;display:inline-block'])->label(false)->error(false) ?>
  213. </div>
  214. </div>
  215. <!--标准油耗-->
  216. <div class="form-inline">
  217. <div class="form-group">
  218. <span id="staFuel" class="span_left">标准油耗:</span>
  219. <?= $form->field($model, 'MPG')->textInput(['placeholder' => '请输入标准油耗', 'style' => 'width:150px;display:inline-block;'])->label(false); ?>
  220. </div>
  221. <div class="form-group">
  222. <span id="Units" class=""> 升 / 百公里</span>
  223. </div>
  224. </div>
  225. <!--座位-->
  226. <div class="form-inline">
  227. <div class="form-group">
  228. <span class="search_name_this"><span class="c_red">*</span>座位:</span>
  229. </div>
  230. <div class="form-group">
  231. <span style="margin-left: 17px;">客座数:</span>
  232. <?= $form->field($model, 'SEAT_TYPE')->dropDownList(\yii\helpers\ArrayHelper::map($model->getSeatType(), 'id', 'type_name'), ['prompt' => '请选择', 'class' => 'form-control', 'style' => 'display:inline-block;', 'id' => 'seat_type', 'onchange' => 'changeSeatCount()'])->label(false)->error(false) ?>
  233. <?php Pjax::begin(['id' => 'seat_count1']) ?>
  234. <?= $form->field($model, 'BUS_TYPE_RES_ID')->dropDownList(\yii\helpers\ArrayHelper::map($data, 'res_id', 'res_name'), ['prompt' => '请选择', 'class' => 'form-control', 'id' => 'seat_count', 'style' => 'display:inline-block;width:100px;vertical-align: top;', 'onchange' => 'changeSeatCount1()'])->label(false)->error(false) ?>
  235. <?php Pjax::end() ?>
  236. </div>
  237. <div class="form-group">
  238. <span
  239. style="margin-left: 17px;height: 16px;display: inline-block;vertical-align: middle;">核载数:</span>
  240. <?= $form->field($model, 'MAX_COUNT')->textInput(['placeholder' => '请输入核载数', 'style' => 'width:100px;display:inline-block;'])->label(false); ?>
  241. </div>
  242. </div>
  243. <!--购车日期-->
  244. <div class="form-inline">
  245. <div class="form-group">
  246. <span class="search_name_this"><span class="c_red">*</span>购车日期:</span>
  247. <?= $form->field($model, 'BUY_DATE', ['template' => '<div class="input-group date form_date">' .
  248. '{input}<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>' .
  249. '</div>'])->textInput([$op_true_false => '', 'value' => $basic_info['BUY_DATE']])
  250. ?>
  251. </div>
  252. </div>
  253. <!--注册日期-->
  254. <div class="form-inline">
  255. <div class="form-group">
  256. <span class="search_name_this"><span class="c_red">*</span>注册日期:</span>
  257. <?= $form->field($model, 'REGISTER_TIME', ['template' => '<div class="input-group date form_date">' .
  258. '{input}<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>' .
  259. '</div>'])->textInput([$op_true_false => '', 'value' => $basic_info['REGISTER_TIME']])
  260. ?>
  261. </div>
  262. </div>
  263. <!--业务范围、经营属性-->
  264. <div class="form-inline">
  265. <div class="form-group">
  266. <span class="span_left">
  267. 经营属性:
  268. </span>
  269. <?= $form->field($model, 'BUSINESS_TYPE')->dropDownList(BusSearch::BUS_BUSINESS_TYPE, ['prompt' => '请选择', 'class' => 'form-control', 'id' => 'business_type', 'style' => 'width:275px;display:inline-block'])->label(false)->error(false) ?>
  270. </div>
  271. </div>
  272. <!--车身属性-->
  273. <div class="form-inline">
  274. <div class="form-group">
  275. <span class="span_left">
  276. 车身属性:
  277. </span>
  278. <?= $form->field($model, 'SURFACE_TYPE')->dropDownList(BusSearch::BUS_SURFACE_TYPE, ['prompt' => '请选择', 'class' => 'form-control', 'id' => 'surface_type', 'style' => 'width:275px;display:inline-block'])->label(false)->error(false) ?>
  279. </div>
  280. </div>
  281. <!--保存按钮-->
  282. <div class="form-inline">
  283. <div class="form-group" style="margin-top: 30px">
  284. <div style="display: none">
  285. <input type="text" name="BusSearch[SEAT_DESC]" id="seat_type2">
  286. <input type="text" name="BusSearch[SEAT_COUNT]" id="seat_count2">
  287. </div>
  288. <div class="modal-footer" style="margin-left: 30px;border:0px">
  289. <?= Html::submitButton('保存', ['class' => 'btn btn-primary', 'name' => 'submit-button']) ?>
  290. </div>
  291. <?php zActiveForm::end(); ?>
  292. </div>
  293. </div>
  294. <!-- **********************************************************-->
  295. </div>
  296. </div>
  297. <script>
  298. //燃料形式的变更联动标准油耗或者电耗
  299. function fuelChange() {
  300. var fuel_type = $("#fuelType").find("option:selected").val();
  301. if (fuel_type == 487) {
  302. $("#staFuel").text('标准电耗:');
  303. $("#Units").text(' 度 / 百公里');
  304. $('#bussearch-mpg').attr('placeholder','请输入标准电耗');
  305. } else {
  306. $("#staFuel").text('标准油耗:');
  307. $("#Units").text(' 升 / 百公里');
  308. $('#bussearch-mpg').attr('placeholder','请输入标准油耗');
  309. }
  310. }
  311. </script>