srv rebate display, effect_time display

This commit is contained in:
qianhy
2023-03-08 10:15:59 +08:00
parent 8426025969
commit 85de7fce07
4 changed files with 22 additions and 13 deletions
+10 -6
View File
@@ -49,13 +49,16 @@ class Srv extends HD_Controller{
}
foreach ($rows as $val) {
$other_data = $this->biz_settle_srv_model->get_jsondata($val['type'],$val['jsondata']);
$s_effect_time = $val['s_effect_time'] == '0000-00-00' ? '长期' : $val['s_effect_time'];
$s_effect_time = $other_data['时间区间'] ? $other_data['时间区间'] : $s_effect_time;
unset($other_data['时间区间']);
$lists[] = [
'id' => $val['id'],
'biz_id' => $val['biz_id'],
'biz_name' => $map_biz[$val['biz_id']],
'title' => $val['title'],
'other_data' => $other_data,
's_effect_time' =>$val['s_effect_time'],
's_effect_time' => $s_effect_time,
'is_def' => $val['is_def'] ? '是':'否',
'type_cn' => $this->biz_settle_srv_model->get_type($val['type']),
'status_cn' => $this->biz_settle_srv_model->get_status($val['status']),
@@ -90,7 +93,7 @@ class Srv extends HD_Controller{
'biz_id' => $biz_id,
'type' => $type,
'is_def' => 0,
's_effect_time' => date('Y-m-d'),
's_effect_time' => date('Y-m-d') ,
'action' => 'biz/srv/add',
'is_tiexi' => 0,
'step' => 1, # 1仅用于新增时默认第一步,2为第二步
@@ -107,7 +110,7 @@ class Srv extends HD_Controller{
$jsondata = json_decode($row['jsondata'],true);
$jsondata['s_time'] && $jsondata['s_time'] = date('Y-m-d H:i:s',$jsondata['s_time']);
$jsondata['e_time'] && $jsondata['e_time'] = date('Y-m-d H:i:s',$jsondata['e_time']);
$info['is_tiexi'] = $row['type'] == 3 && floatval($jsondata['rebate']) > 0 ? 1 : 0;
$info['is_tiexi'] = $row['type'] == 3 && floatval($jsondata['rebate']) > 0 ? 0 : 1;
$jsondata['supplier_id'] = $jsondata['supplier_id'] ? intval($jsondata['supplier_id']) : 0;
$info['jsondata'] = $jsondata;
$view = 'biz/srv/edit';
@@ -137,6 +140,7 @@ class Srv extends HD_Controller{
'is_def' => $info['is_def'] ? 1 : 0,
];
$info['s_effect_time'] && $data['s_effect_time'] = date('Y-m-d',strtotime($info['s_effect_time']));
$info['type'] == 3 && $info['is_def'] && $data['s_effect_time'] = '';
$jsondata = [];
$jsondata['supplier_id'] = $info['jsondata']['supplier_id'];
$supplier = $this->sys_supplier_model->get(['id'=>intval($jsondata['supplier_id'])],'title');
@@ -157,7 +161,7 @@ class Srv extends HD_Controller{
$jsondata['rebate'] = floatval($info['jsondata']['rebate']);
$jsondata['type'] = $info['jsondata']['type'];
}else{
$jsondata['rebate'] = $info['is_tiexi'] ? floatval($info['jsondata']['rebate']) : 0;
$jsondata['rebate'] = $info['is_tiexi'] ? 0 : floatval($info['jsondata']['rebate']);
$jsondata['finance_num'] = $info['jsondata']['finance_num'];
}
//只能有一条默认
@@ -207,7 +211,7 @@ class Srv extends HD_Controller{
'is_def' => $info['is_def'] ? 1 : 0,
];
$info['s_effect_time'] && $data['s_effect_time'] = date('Y-m-d',strtotime($info['s_effect_time']));
$info['type'] == 3 && $info['is_def'] && $data['s_effect_time'] = '';
$jsondata['supplier_id'] = $info['jsondata']['supplier_id'];
$supplier = $this->sys_supplier_model->get(['id'=>intval($jsondata['supplier_id'])],'title');
$jsondata['supplier_title'] = $supplier['title'];
@@ -228,7 +232,7 @@ class Srv extends HD_Controller{
$jsondata['rebate'] = floatval($info['jsondata']['rebate']);
$jsondata['type'] = $info['jsondata']['type'];
}else{
$jsondata['rebate'] = $info['is_tiexi'] ? floatval($info['jsondata']['rebate']) : 0;
$jsondata['rebate'] = $info['is_tiexi'] ? 0 : floatval($info['jsondata']['rebate']);
$jsondata['finance_num'] = $info['jsondata']['finance_num'];
}
//只能有一条默认
+2 -2
View File
@@ -39,7 +39,7 @@
</div>
</template>
<div class="am-form-group wp50" v-if="info.type!=2">
<div class="am-form-group wp50" v-if="info.type==1 || info.type==3 && info.is_def==0">
<label class="am-para-label">生效时间:</label>
<div class="am-para-input">
<input type="text" placeholder="" id="id-time" v-model="info.s_effect_time" autocomplete="off"/>
@@ -72,7 +72,7 @@
</div>
</div>
<template v-if="info.type==2 || info.type==3 && info.is_tiexi > 0">
<template v-if="info.type==2 || info.type==3 && info.is_tiexi == 0">
<div class="am-form-group fl">
<label class="am-para-label">返点:</label>
<div class="input-group am-para-input w150">
+2 -2
View File
@@ -48,7 +48,7 @@
<b>第二步:配置业务数据</b>
</div>
<div class="am-form-group wp50" v-if="info.type!=2">
<div class="am-form-group wp50" v-if="info.type==1 || info.type==3 && info.is_def==0">
<label class="am-para-label">生效时间:</label>
<div class="am-para-input">
<input type="text" placeholder="" id="id-time" v-model="info.s_effect_time" autocomplete="off"/>
@@ -79,7 +79,7 @@
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" v-model="info.is_tiexi"/>
</div>
</div>
<template v-if="info.type==2 || info.type==3 && info.is_tiexi > 0">
<template v-if="info.type==2 || info.type==3 && info.is_tiexi == 0">
<div class="am-form-group fl">
<label class="am-para-label">返点:</label>
<div class="input-group am-para-input w150">
+8 -3
View File
@@ -68,17 +68,22 @@ class Biz_settle_srv_model extends HD_Model
if($jsondata){
switch ($type){
case 1:
$res['结算价'] = $jsondata['price'];
$res['结算价'] = $jsondata['price'].'元';
break;
case 2:
$res['返点'] = $jsondata['rebate'];
$res['返点'] = $jsondata['rebate'].'%';
#$res['保险类型'] = $jsondata['type'] ==1 ? '商业险' : '交强险';
$res['保险类型'] = intval($jsondata['type']) ? $this->get_insure_type(intval($jsondata['type'])) : '';
$res['时间区间'] = $jsondata['s_time']&&$jsondata['e_time'] ? date('Y-m-d',$jsondata['s_time'])."".date('Y-m-d',$jsondata['e_time']) : "";
break;
case 3:
$res['期数'] = $jsondata['finance_num'];
$res['返点'] = $jsondata['rebate'];
if ($jsondata['rebate'] > 0){
$res['返点'] = $jsondata['rebate'].'%';
}
else{
$res['贴息'] = '是';
}
#$res['产品'] = $jsondata['supplier_title'] ? $jsondata['supplier_title'] : $jsondata['finance_title'];
break;
default: