Merge remote-tracking branch 'origin/develop' into develop
Showing
6 changed files
with
39 additions
and
6 deletions
| ... | @@ -155,7 +155,7 @@ class Work extends CI_Controller | ... | @@ -155,7 +155,7 @@ class Work extends CI_Controller |
| 155 | 'operatorRecord'=>$ret2, | 155 | 'operatorRecord'=>$ret2, |
| 156 | 'id'=>$id | 156 | 'id'=>$id |
| 157 | ); | 157 | ); |
| 158 | // var_dump($data);exit; | 158 | |
| 159 | $this->load->view('work/资料/资料补录', $data); | 159 | $this->load->view('work/资料/资料补录', $data); |
| 160 | } | 160 | } |
| 161 | 161 | ... | ... |
| ... | @@ -155,4 +155,37 @@ | ... | @@ -155,4 +155,37 @@ |
| 155 | } | 155 | } |
| 156 | }) | 156 | }) |
| 157 | } | 157 | } |
| 158 | |||
| 159 | function json(data) { | ||
| 160 | const n = new Object(); | ||
| 161 | $.each(data, function (index, value) { | ||
| 162 | tree(index, value, n) | ||
| 163 | }); | ||
| 164 | |||
| 165 | return n; | ||
| 166 | } | ||
| 167 | |||
| 168 | function tree(attr, value, tree) { | ||
| 169 | var nestedAttrs = attr.split('.') | ||
| 170 | for(var i = 0 ; i < nestedAttrs.length ; i++) { | ||
| 171 | if(i === (nestedAttrs.length -1)) { | ||
| 172 | if(tree[nestedAttrs[i]] !== value) { | ||
| 173 | tree[nestedAttrs[i]] = value | ||
| 174 | } | ||
| 175 | } else if(!tree.hasOwnProperty(nestedAttrs[i])) { | ||
| 176 | tree[nestedAttrs[i]] = {} | ||
| 177 | tree = tree[nestedAttrs[i]] | ||
| 178 | } else { | ||
| 179 | tree = tree[nestedAttrs[i]] | ||
| 180 | } | ||
| 181 | } | ||
| 182 | } | ||
| 183 | |||
| 184 | $('.Wdate').on('focus', function () { | ||
| 185 | WdatePicker(); | ||
| 186 | }); | ||
| 187 | |||
| 188 | function reload() { | ||
| 189 | table.fnDraw(); | ||
| 190 | } | ||
| 158 | </script> | 191 | </script> | ... | ... |
| ... | @@ -6,7 +6,7 @@ | ... | @@ -6,7 +6,7 @@ |
| 6 | <div class="form-group col-sm-3 col-md-2"> | 6 | <div class="form-group col-sm-3 col-md-2"> |
| 7 | <label>资料上传</label> | 7 | <label>资料上传</label> |
| 8 | <span class="form-control select-box"> | 8 | <span class="form-control select-box"> |
| 9 | <select class="select uploader" size="1" name="sourceType" id="upload"> | 9 | <select class="select uploader" size="1" id="upload"> |
| 10 | <?php foreach ($this->session->sourceBaseType as $k=>$v):?> | 10 | <?php foreach ($this->session->sourceBaseType as $k=>$v):?> |
| 11 | <option value="<?=$v->code?>" data-name="<?=$v->desc?>"><?=$v->desc?></option> | 11 | <option value="<?=$v->code?>" data-name="<?=$v->desc?>"><?=$v->desc?></option> |
| 12 | <?php if($v->children && !empty($v->children)):?> | 12 | <?php if($v->children && !empty($v->children)):?> | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment