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.
 
 
 
 
simple-yewu/frontend/views/car/edit.php

343 lines
15 KiB

<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="bg_tr">车牌号</td>
<td height="25" class="td_bg">
<input name="car_no" type="text" id="car_no" value="<?=$info->car_no?>" style="width:200px;"/>
</td>
<td width="100" height="25" class="bg_tr">厂牌型号</td>
<td height="25" class="td_bg">
<input name="factory_model" type="text" id="factory_model" value="<?=$info->factory_model?>" style="width:200px;"/>
</td>
<td width="100" height="25" class="bg_tr">发动机号</td>
<td height="25" class="td_bg">
<input name="engine_no" type="text" id="engine_no" value="<?=$info->engine_no?>" style="width:200px;"/>
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车主</td>
<td height="25" class="td_bg">
<input type="text" id="car_man" name="car_man" value="<?=$info->car_man?>" style="width:200px;" >
</td>
<td width="100" height="25" class="bg_tr">联系电话</td>
<td height="25" class="td_bg">
<input type="text" id="phone" name="phone" value="<?=$info->phone?>" style="width:200px;" >
</td>
<td width="100" height="25" class="bg_tr">证件号码</td>
<td height="25" class="td_bg">
<input type="text" name="car_man_number" id="car_man_number" value="<?=$info->car_man_number?>" style="width:200px;">
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">年份</td>
<td height="25" class="td_bg">
<input type="text" id="car_year" name="car_year" value="<?=$info->car_year?>" style="width:100px;">
</td>
<td width="100" height="25" class="bg_tr">车架号</td>
<td height="25" class="td_bg">
<input name="car_frame_no" type="text" id="car_frame_no" value="<?=$info->car_frame_no?>" style="width:200px;"/>
</td>
<td width="100" height="25" class="bg_tr">初登日期</td>
<td height="25" class="td_bg">
<input class="act_date" name="register_date" type="text" id="register_date" value="<?=$info->register_date?>" onclick="WdatePicker()"/>
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车辆类型</td>
<td height="25" class="td_bg">
<select id="car_type_id" name="car_type_id">
<option value="0">---请选择---</option>
<?php
foreach($car_type_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->car_type_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
<td width="100" height="25" class="bg_tr">运营性质</td>
<td height="25" class="td_bg">
<select name="car_use_id" id="car_use_id">
<option value="0">---请选择---</option>
<?php
foreach($car_use_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->car_use_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
<td width="100" height="25" class="bg_tr">座位数</td>
<td height="25" class="td_bg">
<input name="seats" type="text" id="seats" value="<?=$info->seats?>" style="width:50px;"/>
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">品牌</td>
<td height="25" class="td_bg">
<select id="brand_id" name="brand_id">
<option value="0">---请选择---</option>
<?php
foreach($brand_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->brand_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
<td width="100" height="25" class="bg_tr">厂家</td>
<td height="25" class="td_bg">
<select name="factory_id" id="factory_id">
<option value="0">---请选择---</option>
<?php
foreach($factory_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->factory_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
<td width="100" height="25" class="bg_tr">车型</td>
<td height="25" class="td_bg">
<select name="model_id" id="model_id">
<option value="0">---请选择---</option>
<?php
foreach($model_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<!-- <td width="100" height="25" class="bg_tr">排量</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <select name="displacement_id" id="displacement_id">-->
<!-- <option value="0">---请选择---</option>-->
<!-- --><?php
// foreach($displacement_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($info->displacement_id == $item->id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<!-- <td width="100" height="25" class="bg_tr">年份</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <select id="year_id" name="year_id">-->
<!-- <option value="0">---请选择---</option>-->
<!-- --><?php
// foreach($year_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($info->year_id == $item->id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<td width="100" height="25" class="bg_tr">车系</td>
<td height="25" class="td_bg">
<select name="series_id" id="series_id">
<option value="0">---请选择---</option>
<?php
foreach($series_items as $item) {
echo '<option value="'.$item->id.'"';
if($info->series_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
<td width="100" height="25" class="bg_tr">新保业务员</td>
<td height="25" class="td_bg">
<input type="text" id="op_user1" name="op_user1" value="<?=$info->op_user1?>" style="width:200px;" >
</td>
<!-- <td width="100" height="25" class="bg_tr">跟踪业务员</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input type="text" id="op_user2" name="op_user2" value="--><?//=$info->op_user2?><!--" style="width:200px;" >-->
<!-- </td>-->
<td width="100" height="25" class="bg_tr">续保业务员</td>
<td height="25" class="td_bg">
<input type="text" id="op_user3" name="op_user3" value="<?=$info->op_user3?>" style="width:200px;" >
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">备注</td>
<td colspan="5" height="25" class="td_bg">
<textarea style="width:97%; height: 50px;" name="remark" id="remark"><?=$info->remark?></textarea>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="6" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/car/save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/database/a-index?<?=$back_params?>';
});
//品牌选择
$('#brand_id').change(function(){
var brand_id = $(this).val();
$('#factory_id').html('<option value="0">---请选择---</option>');
$('#series_id').html('<option value="0">---请选择---</option>');
$('#displacement_id').html('<option value="0">---请选择---</option>');
$('#year_id').html('<option value="0">---请选择---</option>');
$('#model_id').html('<option value="0">---请选择---</option>');
if(brand_id > 0) {
$.get('/car/factories',{brand_id:brand_id},function(obj){
if(obj.success) {
$('#factory_id').html(obj.html);
}
},'json');
}
});
//选择厂家
$('#factory_id').change(function(){
$('#series_id').html('<option value="0">---请选择---</option>');
$('#displacement_id').html('<option value="0">---请选择---</option>');
$('#year_id').html('<option value="0">---请选择---</option>');
$('#model_id').html('<option value="0">---请选择---</option>');
var factory_id = $(this).val();
if(factory_id > 0){
$.get('/car/series',{factory_id:factory_id},function(obj){
if(obj.success){
$('#series_id').html(obj.html);
}
},'json');
$.get('/car/models',{factory_id:factory_id},function(obj) {
$('#model_id').html(obj.html);
});
}
});
//选择车系
$('#series_id').change(function(){
$('#displacement_id').html('<option value="0">---请选择---</option>');
$('#year_id').html('<option value="0">---请选择---</option>');
// $('#model_id').html('<option value="0">---请选择---</option>');
var series_id = $(this).val();
if(series_id > 0) {
$.get('/car/displacements',{series_id:series_id},function(obj){
if(obj.success){
//判断当前车系是否有排量
if(obj.html.length == '36'){
//不存在排量 获取年份
var displacement_id = $('#displacement_id').val();
$.get('/car/years',{series_id:series_id,displacement_id:displacement_id},function(obj){
//不存在年份获取车型
if(obj.html.length == '36'){
var year_id = $('#year_id').val();
// $.get('/car/models',{series_id:series_id,displacement_id:displacement_id,year_id:year_id},function(obj){
// $('#model_id').html(obj.html);
// },'json');
}else{
$('#year_id').html(obj.html);
}
},'json');
}else{
//返回值带36个字符
$('#displacement_id').html(obj.html);
}
}
},'json');
}
});
//选择排量
$('#displacement_id').change(function(){
$('#year_id').html('<option value="0">---请选择---</option>');
$('#model_id').html('<option value="0">---请选择---</option>');
var displacement_id = $('#displacement_id').val();
var series_id = $('#series_id').val();
if(displacement_id > 0){
$.get('/car/years',{displacement_id:displacement_id,series_id:series_id},function(obj){
if(obj.success) {
//判断当前排量是否有对应年份
if(obj.html.length == '36'){
var year_id = $('#year_id').val();
$.get('/car/models',{year_id:year_id,displacement_id:displacement_id,series_id:series_id},function(obj){
if(obj.success){
$('#model_id').html(obj.html);
}
},'json');
}else{
$('#year_id').html(obj.html);
}
}
},'json');
}
});
//选择年份
$('#year_id').change(function(){
$('#model_id').html('<option value="0">---请选择---</option>');
var displacement_id = $('#displacement_id').val();
var series_id = $('#series_id').val();
var year_id = $('#year_id').val();
if(year_id > 0){
$.get('/car/models',{displacement_id:displacement_id,series_id:series_id,year_id:year_id},function(obj){
if(obj.success){
$('#model_id').html(obj.html);
}
},'json');
}
});
})
</script>