add-admin-accident_ins
This commit is contained in:
@@ -445,6 +445,7 @@ class Orders extends HD_Controller
|
||||
}
|
||||
//获取审核资料信息
|
||||
$img_data = $this->receiver_order_datas_model->get(['o_id'=>$row['id'],'status>='=>0]);
|
||||
$img_data_jsondata = json_decode($img_data['jsondata'],true);
|
||||
$row['imgs_status'] = $this->order_datas_entity->data_ckinfo($img_data,$row['main_type']);
|
||||
//获取开票
|
||||
$bill_ck_img = json_decode($img_data['bill_ck_img'],true);
|
||||
@@ -516,6 +517,8 @@ class Orders extends HD_Controller
|
||||
$agent['business_price'] = $business_img['price'] ? $business_img['price'] : '';
|
||||
$agent['business_product'] = $business_img['product'] ? $business_img['product'] : '';
|
||||
$agent['car_num'] = $agent['car_num'] ? $agent['car_num'] : '';
|
||||
$agent['accident_price'] = $img_data_jsondata['accident_price'] ? $img_data_jsondata['accident_price'] : '';
|
||||
$agent['accident_title'] = $img_data_jsondata['accident_title'] ? $img_data_jsondata['accident_title'] : '';
|
||||
if(!$agent['ins_time'] && $business_img){
|
||||
$img_jsondata = json_decode($img_data['jsondata'],true);
|
||||
$business_img_key = md5(build_qiniu_image_url($business_img['img']));
|
||||
@@ -1191,7 +1194,7 @@ class Orders extends HD_Controller
|
||||
public function edit_imgs(){
|
||||
$id = $this->input->post('id');
|
||||
$field = $this->input->post('filed');
|
||||
$value = $this->input->post('value');
|
||||
$save_value = $value = $this->input->post('value');
|
||||
$row = $this->receiver_orders_v2_model->get(['id'=>$id]);
|
||||
if(!$row){
|
||||
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
||||
@@ -1205,10 +1208,10 @@ class Orders extends HD_Controller
|
||||
if($field=='ins_img' || $field=='other_img'){
|
||||
$val_arr = json_decode($re_data[$field],true);
|
||||
$val_arr[] = $value;
|
||||
$value = json_encode($val_arr,JSON_UNESCAPED_UNICODE);
|
||||
$save_value = json_encode($val_arr,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
$update = [
|
||||
$field => $value
|
||||
$field => $save_value
|
||||
];
|
||||
if($field=='insurance_img'||$field=='business_img'){
|
||||
$jsondata = json_decode($re_data['jsondata'],true);
|
||||
@@ -1244,6 +1247,18 @@ class Orders extends HD_Controller
|
||||
$jsondata['car_info'] = $result['data']['FrontInfo'];
|
||||
$update['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
//识别其它保单
|
||||
if($field=='ins_img'){
|
||||
$jsondata = json_decode($re_data['jsondata'],true);
|
||||
$img_url = build_qiniu_image_url($value);
|
||||
$result = $this->tcmarket->autoInsurance($img_url);
|
||||
if ($result['code']) {
|
||||
$jsondata['ins_info'][md5($img_url)] = $result;
|
||||
$jsondata['accident_price'] = $result['data']['premium'];
|
||||
$jsondata['accident_title'] = $result['data']['companyName'];
|
||||
$update['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}
|
||||
$res = $this->receiver_order_datas_model->update($update,['id'=>$re_data_id]);
|
||||
if($res){
|
||||
if($field=='car_img'){//更新车牌号
|
||||
@@ -1312,15 +1327,19 @@ class Orders extends HD_Controller
|
||||
}
|
||||
if ($result) {
|
||||
$img_data = $this->receiver_order_datas_model->get(['o_id'=>$row['id']]);
|
||||
$img_data_jsondata = json_decode($img_data['jsondata'],true);
|
||||
$insurance_img = json_decode($img_data['insurance_img'],true);
|
||||
$business_img = json_decode($img_data['business_img'],true);
|
||||
$insurance_img['product'] = $params['insurance_product'];
|
||||
$insurance_img['price'] = $params['insurance_price'];
|
||||
$business_img['product'] = $params['business_product'];
|
||||
$business_img['price'] = $params['business_price'];
|
||||
$img_data_jsondata['accident_title'] = $params['accident_title'];
|
||||
$img_data_jsondata['accident_price'] = $params['accident_price'];
|
||||
$up_data = [
|
||||
'insurance_img' => json_encode($insurance_img,JSON_UNESCAPED_UNICODE),
|
||||
'business_img' => json_encode($business_img,JSON_UNESCAPED_UNICODE)
|
||||
'business_img' => json_encode($business_img,JSON_UNESCAPED_UNICODE),
|
||||
'jsondata' => json_encode($img_data_jsondata,JSON_UNESCAPED_UNICODE)
|
||||
];
|
||||
$this->receiver_order_datas_model->update($up_data,['o_id'=>$row['id']]);
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">保险到期时间:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label" style="width: 90%;text-align: left">
|
||||
<label class="am-para-label" style="width: 50%;text-align: left">
|
||||
<? if ($info['agent']['business_time']) { ?>
|
||||
<?= $info['agent']['business_time'] ?>
|
||||
<? } else { ?>
|
||||
@@ -50,10 +50,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-12"></div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">商业险公司:</span></label>
|
||||
<div class="am-para-input">
|
||||
@@ -67,7 +63,23 @@
|
||||
<label class="am-para-label" style="width: 50%">
|
||||
<input type="number" name="business_price" v-model="info.agent.business_price"></label>
|
||||
</div>
|
||||
<div class="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险公司:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label" style="width: 50%">
|
||||
<input type="text" name="accident_title" v-model="info.agent.accident_title"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline am-u-lg-6">
|
||||
<label class="am-para-label label-width"><span class="span-bold">意外险费用:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label" style="width: 50%">
|
||||
<input type="text" name="accident_price" v-model="info.agent.accident_price"></label>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<input type="hidden" name="oid" v-model="info.id">
|
||||
<a href='javascript:;' class='am-btn am-btn-primary am-btn-xs' @click="save_agent">
|
||||
保存
|
||||
|
||||
Reference in New Issue
Block a user