c658d51f by Zelig

导入

1 parent c866c99d
...@@ -29,20 +29,15 @@ class Loan extends CI_Controller { ...@@ -29,20 +29,15 @@ class Loan extends CI_Controller {
29 29
30 public function import($state = 1) 30 public function import($state = 1)
31 { 31 {
32 switch ($state) { 32 $this->load->driver('enum');
33 case 1: 33 $this->load->driver('configure');
34 $this->load->view('/loan/还款导入'); 34 $this->load->driver('LoanAfter');
35 break; 35 $ret = new stdClass();
36 case 2: 36 $ret->enumRepayStatus = $this->enum->repaymentPlan->status();
37 $this->load->view('/loan/还款批量导入'); 37 $ret->enumSource = $this->enum->repaymentPlan->source();
38 break; 38 $ret->prosecuteStatus = $state - 1;
39 case 3: 39
40 $this->load->view('/loan/催收导入'); 40 $this->load->view('/loan/导入', $ret);
41 break;
42 case 4:
43 $this->load->view('/loan/数据库导入');
44 break;
45 }
46 } 41 }
47 42
48 public function edit($id = null) 43 public function edit($id = null)
...@@ -60,9 +55,12 @@ class Loan extends CI_Controller { ...@@ -60,9 +55,12 @@ class Loan extends CI_Controller {
60 $this->load->view('/loan/还款编辑', $ret); 55 $this->load->view('/loan/还款编辑', $ret);
61 } 56 }
62 57
63 public function move() 58 public function move($id)
64 { 59 {
65 $this->load->view('/loan/资料移交'); 60 $this->load->driver('order');
61 $sources = $this->order->ordersource($id);
62
63 $this->load->view('/loan/资料移交', compact('sources', 'id'));
66 } 64 }
67 65
68 public function data($format = 'days') 66 public function data($format = 'days')
......
1 <?php
2
3 class LoanAfter extends CI_Driver_Library {
4 public function __construct () {
5 $this->valid_drivers = ['enum'];
6 }
7 }
1 <?php
2
3 class LoanAfter_enum extends CI_Driver
4 {
5 public $CI;
6
7 public function __construct () {
8 $this->CI = &get_instance();
9 }
10
11 public function prosecute () {
12 $url = $this->CI->config->item('apiBaseUrl') . 'loanAfter/enum/prosecute';
13 $result = file_get_contents($url);
14 $json = json_decode($result, true);
15 $ret = $json['data'];
16
17 return $ret;
18 }
19 }
1 <?php
2
3 class Order extends CI_Driver_Library {
4 public function __construct () {
5 $this->valid_drivers = ['ordersource'];
6 }
7
8 public function ordersource($id)
9 {
10 return $this->ordersource->all($id);
11 }
12 }
1 <?php
2
3 class Order_ordersource extends CI_Driver
4 {
5 public $CI;
6
7 public function __construct () {
8 $this->CI = &get_instance();
9 }
10
11 public function all ($id) {
12 $url = $this->CI->config->item('apiBaseUrl') . 'order/ordersource/'.$id;
13 $result = file_get_contents($url);
14 $json = json_decode($result);
15 $ret = $json->data;
16
17 return $ret;
18 }
19 }
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
132 $('#table').DataTable().draw(); 132 $('#table').DataTable().draw();
133 } 133 }
134 134
135 function ajax(url, method = 'GET', data = {}) { 135 function ajax(url, method = 'GET', data = {}, msg = '操作成功', callback = function (){}) {
136 $.ajax({ 136 $.ajax({
137 type: method, 137 type: method,
138 url: apiBaseUrl + url, 138 url: apiBaseUrl + url,
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
146 } else if(data.code != 0){ 146 } else if(data.code != 0){
147 layer.alert('操作失败'); 147 layer.alert('操作失败');
148 } else { 148 } else {
149 layer.alert('操作成功'); 149 layer.alert(msg, callback);
150 } 150 }
151 }, 151 },
152 error:function(){ 152 error:function(){
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
8 <button class="btn btn-primary radius" type="button" onclick="$('#table').DataTable().draw()">搜索</button> 8 <button class="btn btn-primary radius" type="button" onclick="$('#table').DataTable().draw()">搜索</button>
9 <input class="btn btn-warning radius" type="reset" value="重置"> 9 <input class="btn btn-warning radius" type="reset" value="重置">
10 10
11 <button class="btn btn-primary radius" type="button" onclick="layer_show('导入', '<?=site_url('loan/import/3')?>')">导入</button> 11 <button class="btn btn-primary radius" type="button" onclick="layer_show('导入', '<?=site_url('loan/import/4')?>')">导入</button>
12 <button class="btn btn-success radius r" type="button" onclick="excel()">导出</button> 12 <button class="btn btn-success radius r" type="button" onclick="excel()">导出</button>
13 </div> 13 </div>
14 </form> 14 </form>
......
...@@ -79,27 +79,12 @@ ...@@ -79,27 +79,12 @@
79 ] 79 ]
80 }); 80 });
81 81
82 $('.table_search').on('change', function () {
83 search = $(this).val();
84 column = $(this).attr('column');
85
86 $('#table').DataTable().column(column).search(search).draw();
87 });
88
89 $('#min, #max').on('keyup', function () {
90 $('#table').DataTable().draw();
91 });
92
93 function resetHandler() {
94 $('#table').DataTable().columns().search("").draw();
95 }
96
97 function edit(id) { 82 function edit(id) {
98 layer_show('编辑', '<?=site_url('/loan/edit/')?>/'+id); 83 layer_show('编辑', '<?=site_url('/loan/edit/')?>/'+id);
99 } 84 }
100 85
101 function move(id) { 86 function move(id) {
102 layer_show('资料移交', '<?=site_url('/loan/move')?>'); 87 layer_show('资料移交', '<?=site_url('/loan/move')?>/'+id);
103 } 88 }
104 89
105 function reload() { 90 function reload() {
......
1 <?php $this->load->view('common/header'); ?>
2
3 <body>
4 <div class="panel panel-default mb-20">
5 <form>
6 <input type="hidden" name="source" value="1">
7 <input type="hidden" name="prosecuteStatus" value="<?=$prosecuteStatus?>">
8 <div class="panel-body cl">
9 <div class="row cl">
10 <div class="form-group col-sm-4 col-md-2">
11 <label>订单号</label>
12 <input type="text" class="form-control input-text" value=""name="orderNumber">
13 </div>
14 <div class="form-group col-sm-4 col-md-2">
15 <label>申请人</label>
16 <input type="text" class="form-control input-text" value=""name="proposerName">
17 </div>
18 <div class="form-group col-sm-4 col-md-2">
19 <label>身份证</label>
20 <input type="text" class="form-control input-text" value=""name="idNumber">
21 </div>
22 <div class="form-group col-sm-4 col-md-2">
23 <label>手机号</label>
24 <input type="text" class="form-control input-text" value=""name="phoneNumber">
25 </div>
26 <div class="form-group col-sm-4 col-md-2">
27 <label>客户经理</label>
28 <input type="text" class="form-control input-text" value=""name="clientManager">
29 </div>
30 <div class="form-group col-sm-4 col-md-2">
31 <label>网点</label>
32 <span class="form-control select-box">
33 <select class="select" size="1" name="branchName">
34 <?php foreach ($this->session->departments as $k=>$v):?>
35 <option value="<?=$v->id?>"><?=$v->name?></option>
36 <?php if($v->children && !empty($v->children)):?>
37 <?php foreach ($v->children as $kk=>$vv):?>
38 <option value="<?=$vv->id?>"><?=$vv->name?></option>
39 <?php endforeach;?>
40 <?php endif;?>
41 <?php endforeach;?>
42 </select>
43 </span>
44 </div>
45 <div class="form-group col-sm-4 col-md-2">
46 <label>产品名称</label>
47 <span class="form-control select-box">
48 <select class="select" size="1" name="productName">
49 <?php foreach ($this->session->products as $k=>$v):?>
50 <option value="<?=$v->id?>"><?=$v->productName?></option>
51 <?php endforeach;?>
52 </select>
53 </span>
54 </div>
55 <div class="form-group col-sm-4 col-md-2">
56 <label>借款金额</label>
57 <input type="text" class="form-control input-text" value=""name="applyAmount">
58 </div>
59 <div class="form-group col-sm-4 col-md-2">
60 <label>审批金额</label>
61 <input type="text" class="form-control input-text" value=""name="ratifyAmount">
62 </div>
63 <div class="form-group col-sm-4 col-md-2">
64 <label>进件时间</label>
65 <input type="text" class="form-control input-text Wdate" onfocus="WdatePicker()" value="" name="enterDate">
66 </div>
67 <div class="form-group col-sm-4 col-md-2">
68 <label>当月应还金额</label>
69 <input type="text" class="form-control input-text" value=""name="currentBalance">
70 </div>
71 <div class="form-group col-sm-4 col-md-2">
72 <label>已还金额</label>
73 <input type="text" class="form-control input-text" value="">
74 </div>
75 <div class="form-group col-sm-4 col-md-2">
76 <label>罚息</label>
77 <input type="text" class="form-control input-text" value="">
78 </div>
79 <div class="form-group col-sm-4 col-md-2">
80 <label>滞纳金</label>
81 <input type="text" class="form-control input-text" value=""name="overdueFine">
82 </div>
83 <div class="form-group col-sm-4 col-md-2">
84 <label>放款日期</label>
85 <input type="text" class="form-control input-text Wdate" onfocus="WdatePicker()" value="" name="loanDate">
86 </div>
87 <div class="form-group col-sm-4 col-md-2">
88 <label>总期数</label>
89 <input type="text" class="form-control input-text" value=""name="totalPeriods">
90 </div>
91 <div class="form-group col-sm-4 col-md-2">
92 <label>当前期数</label>
93 <input type="text" class="form-control input-text" value=""name="currentPeriods">
94 </div>
95 <!-- 需求调整先去了-->
96 <!--<div class="form-group col-sm-4 col-md-2">
97 <label>还款方式</label>
98 <span class="form-control select-box">
99 <select class="select" size="1">
100 <option>请选择</option>
101 <?php /*foreach ($this->session->repayments as $k=>$v):*/?>
102 <option <?/*=$v == $repaymentMode ? 'selected' : '' */?> value="<?/*=$k*/?>"><?/*=$v*/?></option>
103 <?php /*endforeach;*/?>
104 </select>
105 </span>
106 </div>-->
107 <div class="form-group col-sm-4 col-md-2">
108 <label>计划还款日期</label>
109 <input type="text" class="form-control input-text Wdate" onfocus="WdatePicker()" value="" name="planRepaymentDate">
110 </div>
111 <div class="form-group col-sm-4 col-md-2">
112 <label>实际还款日</label>
113 <input type="text" class="form-control input-text Wdate" onfocus="WdatePicker()" value="" name="realRepaymentDate">
114 </div>
115 <div class="form-group col-sm-4 col-md-2">
116 <label>是否逾期</label>
117 <span class="form-control select-box">
118 <select class="select" size="1" name="hasDue">
119 <option value="1"></option>
120 <option value="0"></option>
121 </select>
122 </span>
123 </div>
124 <div class="form-group col-sm-4 col-md-2">
125 <label>逾期天数</label>
126 <input type="text" class="form-control input-text" value=""name="dueDay">
127 </div>
128 <div class="form-group col-sm-4 col-md-2">
129 <label>还款状态</label>
130 <span class="form-control select-box">
131 <select class="select" size="1" name="repayStatus">
132 <?php foreach($enumRepayStatus as $k => $v) : ?>
133 <option value="<?=$k?>"><?=$v?></option>
134 <?php endforeach ?>
135 </select>
136 </span>
137 </div>
138 <div class="form-group col-sm-4 col-md-2">
139 <label>是否结清</label>
140 <span class="form-control select-box">
141 <select class="select" size="1" name="hasClean">
142 <option value="1"></option>
143 <option value="0"></option>
144 </select>
145 </span>
146 </div>
147 </div>
148 </div>
149 </form>
150 </div>
151
152 <div class="row cl col-sm-12 pb-20">
153 <div class="col-sm-2">
154 <button class="btn btn-primary btn-block" onclick="save();">保存</button>
155 </div>
156 <div class="col-sm-2">
157 <button class="btn btn-warning btn-block" onclick="layer_close();">取消</button>
158 </div>
159 </div>
160
161 <?php $this->load->view('common/footer'); ?>
162
163 <script>
164 function save() {
165 var data = $("form").serializeJson();
166
167 ajax('loanAfter/repaymentPlan', 'POST', data, '添加成功', function () {
168 window.parent.reload();
169 layer_close();
170 });
171 }
172 </script>
173 </body>
174 </html>
...@@ -24,22 +24,22 @@ ...@@ -24,22 +24,22 @@
24 <a href="">处理日志.xls</a> 24 <a href="">处理日志.xls</a>
25 </td> 25 </td>
26 </tr> 26 </tr>
27 <?php foreach($sources as $sourceTypeDesc => $source) : ?>
27 <tr data-id="2"> 28 <tr data-id="2">
28 <td class="text-c"><input type="checkbox"></td> 29 <td class="text-c"><input type="checkbox"></td>
29 <td class="text-c">身份证复印件</td> 30 <td class="text-c"><?=$sourceTypeDesc?></td>
30 <td> 31 <td>
31 <div class="filelist"> 32 <div class="filelist">
33 <?php foreach($source as $data): ?>
32 <label class="radio"> 34 <label class="radio">
33 <input type="checkbox" name="1"/> 35 <input type="checkbox" name="" value=""/>
34 <img src="holder.js/100x100"> 36 <img src="<?=$data->url?>" width="100">
35 </label>
36 <label class="radio">
37 <input type="checkbox" name="1"/>
38 <img src="holder.js/100x100">
39 </label> 37 </label>
38 <?php endforeach; ?>
40 </div> 39 </div>
41 </td> 40 </td>
42 </tr> 41 </tr>
42 <?php endforeach; ?>
43 </tbody> 43 </tbody>
44 </table> 44 </table>
45 </div> 45 </div>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
53 <button class="btn btn-warning btn-block" onclick="layer_close()">关闭</button> 53 <button class="btn btn-warning btn-block" onclick="layer_close()">关闭</button>
54 </div> 54 </div>
55 <div class="col-sm-2"> 55 <div class="col-sm-2">
56 <button class="btn btn-primary btn-block" onclick="submit()">确认移交</button> 56 <button class="btn btn-primary btn-block" onclick="submit(<?=$id?>)">确认移交</button>
57 </div> 57 </div>
58 </div> 58 </div>
59 59
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
70 $(this).parents('tr').find('input:checkbox').prop('checked', checked); 70 $(this).parents('tr').find('input:checkbox').prop('checked', checked);
71 }); 71 });
72 72
73 function submit() { 73 function submit(id) {
74 layer.alert('已进入【起诉管理】列表', function () { 74 ajax('loanAfter/chaseDebt/prosecute/'+id, 'patch', {}, '已进入【起诉管理】列表', function () {
75 window.parent.reload(); 75 window.parent.reload();
76 layer_close(); 76 layer_close();
77 }); 77 })
78 } 78 }
79 </script> 79 </script>
80 </body> 80 </body>
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
128 <span class="form-control select-box"> 128 <span class="form-control select-box">
129 <select class="select" size="1" name="hasDue"> 129 <select class="select" size="1" name="hasDue">
130 <option value="1" <?=$hasDue == 1?'selected':''?>></option> 130 <option value="1" <?=$hasDue == 1?'selected':''?>></option>
131 <option></option> 131 <option value="0"></option>
132 </select> 132 </select>
133 </span> 133 </span>
134 </div> 134 </div>
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
151 <span class="form-control select-box"> 151 <span class="form-control select-box">
152 <select class="select" size="1" name="hasClean"> 152 <select class="select" size="1" name="hasClean">
153 <option value="1" <?=$hasClean == 1?'selected':''?>></option> 153 <option value="1" <?=$hasClean == 1?'selected':''?>></option>
154 <option></option> 154 <option value="0"></option>
155 </select> 155 </select>
156 </span> 156 </span>
157 </div> 157 </div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!