From f0dc45f02240ebdf3c71f4813c018c8d07d140a8 Mon Sep 17 00:00:00 2001 From: zhaocheng <578322713@qq.com> Date: Thu, 17 Oct 2019 18:04:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/layouts/blue-main.php | 1 + frontend/views/statistics/work-info.bak.php | 65 ++ frontend/views/statistics/work-info.php | 648 ++++++++++++++++++-- frontend/views/statistics/work.bak.php | 108 ++++ frontend/views/statistics/work.php | 301 ++++++--- frontend/web/assets/js/myfunc.js | 64 ++ 6 files changed, 1025 insertions(+), 162 deletions(-) create mode 100644 frontend/views/statistics/work-info.bak.php create mode 100644 frontend/views/statistics/work.bak.php create mode 100644 frontend/web/assets/js/myfunc.js diff --git a/frontend/views/layouts/blue-main.php b/frontend/views/layouts/blue-main.php index 8387c9a..32ffc29 100644 --- a/frontend/views/layouts/blue-main.php +++ b/frontend/views/layouts/blue-main.php @@ -39,6 +39,7 @@ use yii\helpers\Html; + blocks['footer_js'])): ?> blocks['footer_js'] ?> diff --git a/frontend/views/statistics/work-info.bak.php b/frontend/views/statistics/work-info.bak.php new file mode 100644 index 0000000..019139e --- /dev/null +++ b/frontend/views/statistics/work-info.bak.php @@ -0,0 +1,65 @@ + + + + + + + + + + + + +
+ + 提单日期: + 正本日期: +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
车主车牌号商业总净保费折扣后商业净保费减免金额商业折扣率状态详情
car_man?>car_no?>total1_clear?>total1_real?>total1_dis?>total1_percent?>status->name?> + [详情] +
汇总
diff --git a/frontend/views/statistics/work-info.php b/frontend/views/statistics/work-info.php index 019139e..4c157c6 100644 --- a/frontend/views/statistics/work-info.php +++ b/frontend/views/statistics/work-info.php @@ -1,65 +1,591 @@ - - - - - + + + + - - - - - - -
- - 提单日期: - 正本日期: -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
车主车牌号商业总净保费折扣后商业净保费减免金额商业折扣率状态详情
car_man?>car_no?>total1_clear?>total1_real?>total1_dis?>total1_percent?>status->name?> - [详情] -
汇总
+ + function init(){ + console.log(params); + carInfoInit(params['car_info']); + + if(!params['order_info']['shangye_src']){ + $('#business_print_btn').hide(); + } + if(!params['order_info']['jiaoqiang_src']){ + $('#compulsory_print_btn').hide(); + } + orderInfoInit(params['order_info']); + + orderInsurerInfoInit(params['order_insurer_info']); + + var free_gift = [], + private_gift = []; + $.each(params['gift_info'],function (i,d) { + if(d['is_free'] == 1){ + free_gift.push(d); + }else { + private_gift.push(d); + } + }); + var tables = { + 'insurer_type': params['insurer_type_info'], + 'free_gift': free_gift, + 'private_gift': private_gift, + 'car_history': { + url: '/car/ajax-history-index-json', + queryParamsFunc: function (param) { + param['car_id'] = params['car_info']['id']; + param['limit'] = param['limit']; + param['offset'] = param['offset']; + return param; + } + } + }; + tableInfoInit(tables, params); + } + + function insurer_files_print(type) { + if(type == 'compulsory' && params['order_info']['jiaoqiang_src']){ + window.open('/upload/files'+ params['order_info']['jiaoqiang_src']) + } + if(type == 'compulsory' && !params['order_info']['jiaoqiang_src']){ + alert('找不到文件,加载失败'); + } + if(type == 'business' && params['order_info']['shangye_src']){ + window.open('/upload/files'+ params['order_info']['shangye_src']) + } + if(type == 'business' && !params['order_info']['shangye_src']){ + alert('找不到文件,加载失败'); + } + } + + function insurer_files_save() { + var param = $(this).closest('form').serialize(); + $.post('/insurer/pdf-save',param,function(obj){ + console.log(obj); + if(obj.success) { + alert('保单上传成功'); + window.location.reload(); + } + },'json'); + } + + function reBack(){ + if(confirm('请核对好出单日期,确认退回到正本?')) { + $.post('/insurer/tuidan-save',{id:params['order_info']['id']},function(obj){ + if(obj.success) { + alert('退单成功'); + } + },'json'); + } + } + + function goBack(){ + window.close(); + } + + function tableInfoInit(tables){ + $.each(tables,function(name,data){ + var $table = $('#'+ name +'_table'); + var options = {}; + if(typeof data == 'String'){ + options = { + url: data.url, + pagination: true, + sidePagination: 'server', + queryParams: data.queryParamsFunc + } + }else { + options = { + data: data + } + } + $table.bootstrapTable('destroy'); + $table.bootstrapTable(options); + }); + } + + // 页面车辆数据初始化 + function carInfoInit(data){ + $('.car-info:not(input)').each(function(key,item) { + $(item).html(data[$(item).data('name')]); + }); + $('.car-info:input').each(function(key,item) { + $(item).val(data[$(item).data('name')]); + }); + } + + function orderInfoInit(data){ + $('.order-info:not(input)').each(function(key,item) { + $(item).html(data[$(item).data('name')]); + }); + $('.order-info:input').each(function(key,item) { + $(item).val(data[$(item).data('name')]); + }); + } + + function orderInsurerInfoInit(data){ + $('.order-insurer-info:not(input)').each(function(key,item) { + $(item).html(data[$(item).data('name')]); + }); + $('.order-insurer-info:input').each(function(key,item) { + $(item).val(data[$(item).data('name')]); + }); + } + + function buttonInit(param) { + if(param){ + $('#appointment_btn').prepend(''); + } + } + +endBlock('footer_js'); ?> \ No newline at end of file diff --git a/frontend/views/statistics/work.bak.php b/frontend/views/statistics/work.bak.php new file mode 100644 index 0000000..61e09b1 --- /dev/null +++ b/frontend/views/statistics/work.bak.php @@ -0,0 +1,108 @@ + + + + + + + + + + + + +
+ 提单日期:从截止 + 正本日期:从截止 + 工号: + 级别: + + + + 当天   + &date_end=">7天   + &date_end=">1个月   + &date_end=">3个月   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
工号真实姓名通时提车总数提单总数商业总净保费交强总净保费商业已收净保费交强已收净保费总签单净保费详情
0?$row['total'][7]:''?>0?$row['total'][1]:''?>0?'¥'.number_format($row['total'][2],2):''?>0?'¥'.number_format($row['total'][3],2):''?>0?'¥'.number_format($row['total'][4],2):''?>0?'¥'.number_format($row['total'][5],2):''?>0?'¥'.number_format($row['total'][6],2):''?>[详情]
汇总
diff --git a/frontend/views/statistics/work.php b/frontend/views/statistics/work.php index 61e09b1..0dd608c 100644 --- a/frontend/views/statistics/work.php +++ b/frontend/views/statistics/work.php @@ -1,108 +1,207 @@ - - - - - + + + - - - - - - -
- 提单日期:从截止 - 正本日期:从截止 - 工号: - 级别: - - - - 当天   - &date_end=">7天   - &date_end=">1个月   - &date_end=">3个月   -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
工号真实姓名通时提车总数提单总数商业总净保费交强总净保费商业已收净保费交强已收净保费总签单净保费详情
0?$row['total'][7]:''?>0?$row['total'][1]:''?>0?'¥'.number_format($row['total'][2],2):''?>0?'¥'.number_format($row['total'][3],2):''?>0?'¥'.number_format($row['total'][4],2):''?>0?'¥'.number_format($row['total'][5],2):''?>0?'¥'.number_format($row['total'][6],2):''?>[详情]
汇总
+endBlock(); ?> diff --git a/frontend/web/assets/js/myfunc.js b/frontend/web/assets/js/myfunc.js new file mode 100644 index 0000000..fd955bc --- /dev/null +++ b/frontend/web/assets/js/myfunc.js @@ -0,0 +1,64 @@ +/** + * 选择框初始化 + * @param selects + * @structure{ + * name: { + * option_infos: [{ + * id: id, + * name: name. + * }], + * selected: selected-id + * } + * @structure} + */ +function selectInfoInit(selects){ + $.each(selects,function(name,data){ + var html = ''; + $.each(data['option_infos'],function(i,item){ + var val = item['code']?item['code']:item['id']; + var selected = data['selected'] && data['selected'] == val? 'selected': ''; + html += '' + }); + $('#'+ name + '_info').html(html); + }); +} + +/** + * 数据表格初始化 + * @param tables + * @structure{ + * name: { + * data: table-data, + * data: [ + * url: url, + * queryPrams: function + * ] + * selected: selected-id + * } + * @structure} + */ +function tableInfoInit(tables){ + $.each(tables,function(name,data){ + var $table = $('#'+ name +'_table'); + var options = {}; + if(data['url']){ + options = { + url: data.url, + pagination: true, + sidePagination: 'server', + queryParams: function (param) { + typeof data['queryParamsFunc'] == 'function' && data['queryParamsFunc'](param); + }, + responseHandler: function (param) { + typeof data['responseFunc'] == 'function' && data['responseFunc'](param); + }, + }; + }else { + options = { + data: data + } + } + $table.bootstrapTable('destroy'); + $table.bootstrapTable(options); + }); +} \ No newline at end of file