dever пре 3 година
родитељ
комит
0fab571dd6
2 измењених фајлова са 321 додато и 301 уклоњено
  1. 319 301
      app/mshop/lib/Buy.php
  2. 2 0
      app/shop/database/buy_order.php

+ 319 - 301
app/mshop/lib/Buy.php

@@ -907,380 +907,393 @@ class Buy
             );
         }
 
-        $url = Dever::url('lib/buy.refund_commit?json=1', 'mshop');
-        if (!$info['refund_cash']) {
-            $info['refund_cash'] = 0;
-        }
+        $audit = Dever::input('audit');
+        if ($audit == 1) {
+            $order['type'] = 1;
 
-        if ($info['refund_cash'] > 0 && $tk) {
-            
-            if ($type == 2) {
-                $info['refund_cash'] = $info['refund_p_cash'];
-            }
-            if ($tk['process'] == 1) {
-                $process = '<a href="javascript:;" onclick="audit('.$tk['id'].', 2, \''.$url.'\')" class="layui-btn layui-btn-primary">通过</a><a href="javascript:;" onclick="audit('.$tk['id'].', 3, \''.$url.'\')" class="layui-btn layui-btn-danger">驳回</a>';
-            } else {
-                $process = $tk_process[$tk['process']];
-            }
-            $desc = array();
-            $desc['退款原因'] = $tk['desc'];
-            $desc['退款图片'] = '暂无';
-            if ($tk['pic']) {
-                $pic = explode(',', $tk['pic']);
-                $tk['pic'] = '';
-                foreach ($pic as $k => $v) {
-                    $tk['pic'] .= '<a href="'.$v.'" target="_blank"><img src="'.$v.'" width="100"/></a>';
-                }
-            }
-;
-            $tk['cdate'] = date('Y-m-d H:i', $tk['cdate']);
-            $result['退款信息'] = array
-            (
-                'type' => 'info',
-                'content' => array
-                (
-                    array
-                    (
-                        array('退款金额', $info['refund_cash']),
-                        array('数量', $info['num']),
-                        array('退款进度', $process),
-                    ),
+            $goods = Dever::db('shop/buy_order_goods')->select(array('order_id' => $info['id']));
 
-                    array
-                    (
-                        array('申请时间', $tk['cdate']),
-                        array('申请原因', $tk['desc']),
-                        array('图片', $tk['pic']),
-                    ),
-                ),
-            );
-        }
+            $shop = Dever::db('shop/info')->find($info['type_id']);
 
-        $info['ps_info'] = Dever::db('shop/buy_order_ps')->find(array('order_id' => $info['id']));
-        if ($info['ps_info']) {
-            $info['ps_info']['service'] = Dever::array_decode($info['ps_info']['service']);
-            $info['ps_info']['cdate'] = date('Y-m-d H:i', $info['ps_info']['cdate']);
-            if ($info['ps_info']['ydate']) {
-                $info['ps_info']['ydate'] = date('Y-m-d H:i', $info['ps_info']['ydate']);
-            } else {
-                $info['ps_info']['ydate'] = '无';
-            }
+            $data = $this->assign($goods, $info, $shop);
 
-            $status = Dever::db('shop/buy_order_ps')->config['status'];
-            $info['ps_info']['status_name'] = $status[$info['ps_info']['status']];
-            
-            $service = array();
-            if ($info['ps_info']['service']) {
-                foreach ($info['ps_info']['service'] as $k => $v) {
-                    if (isset($v['order_num']) && $v['order_num']) {
-                        $info['ps_info']['service'][$k]['service_name'] = '供应商自送';
-                        if ($v['service_id'] > 0) {
-                            $service_info = Dever::db('shop/service')->find($v['service_id']);
-                            $info['ps_info']['service'][$k]['service_name'] = $service_info['name'];
-                        }
+            print_r($data);die;
+        } else {
+            $url = Dever::url('lib/buy.refund_commit?json=1', 'mshop');
+            if (!$info['refund_cash']) {
+                $info['refund_cash'] = 0;
+            }
 
-                        $service[] = array
-                        (
-                            array('名称', $info['ps_info']['service'][$k]['service_name']),
-                            array('单号', isset($v['order_num']) ? $v['order_num'] : ''),
-                        );
+            if ($info['refund_cash'] > 0 && $tk) {
+                
+                if ($type == 2) {
+                    $info['refund_cash'] = $info['refund_p_cash'];
+                }
+                if ($tk['process'] == 1) {
+                    $process = '<a href="javascript:;" onclick="audit('.$tk['id'].', 2, \''.$url.'\')" class="layui-btn layui-btn-primary">通过</a><a href="javascript:;" onclick="audit('.$tk['id'].', 3, \''.$url.'\')" class="layui-btn layui-btn-danger">驳回</a>';
+                } else {
+                    $process = $tk_process[$tk['process']];
+                }
+                $desc = array();
+                $desc['退款原因'] = $tk['desc'];
+                $desc['退款图片'] = '暂无';
+                if ($tk['pic']) {
+                    $pic = explode(',', $tk['pic']);
+                    $tk['pic'] = '';
+                    foreach ($pic as $k => $v) {
+                        $tk['pic'] .= '<a href="'.$v.'" target="_blank"><img src="'.$v.'" width="100"/></a>';
                     }
                 }
-            }
-
-            $result['物流信息'] = array
-            (
-                'type' => 'info',
-                'content' => array
-                (
-                    array
-                    (
-                        array('发货时间', $info['ps_info']['cdate']),
-                        array('收货时间', $info['ps_info']['ydate']),
-                        array('查单', '<a href="https://www.kuaidi100.com/?from=openv" target="_blank">点此手动查单</a>'),
-                    ),
-                ),
-            );
-            $result['物流信息']['content'] = array_merge($result['物流信息']['content'], $service);
-            /*
-            if ($noprice == 1) {
-                $result['物流信息'] = array
+    ;
+                $tk['cdate'] = date('Y-m-d H:i', $tk['cdate']);
+                $result['退款信息'] = array
                 (
                     'type' => 'info',
                     'content' => array
                     (
                         array
                         (
-                            array('名称', $info['ps_info']['service_name']),
-                            array('单号', $info['ps_info']['order_num']),
+                            array('退款金额', $info['refund_cash']),
+                            array('数量', $info['num']),
+                            array('退款进度', $process),
                         ),
 
                         array
                         (
-                            array('数量', $info['ps_info']['num']),
-                            array('重量', $info['ps_info']['zl']),
-                            array('体积', $info['ps_info']['tj']),
-                        ),
-
-                        array
-                        (
-                            array('发货时间', $info['ps_info']['cdate']),
-                            array('收货时间', $info['ps_info']['ydate']),
+                            array('申请时间', $tk['cdate']),
+                            array('申请原因', $tk['desc']),
+                            array('图片', $tk['pic']),
                         ),
                     ),
                 );
-            } else {
+            }
+
+            $info['ps_info'] = Dever::db('shop/buy_order_ps')->find(array('order_id' => $info['id']));
+            if ($info['ps_info']) {
+                $info['ps_info']['service'] = Dever::array_decode($info['ps_info']['service']);
+                $info['ps_info']['cdate'] = date('Y-m-d H:i', $info['ps_info']['cdate']);
+                if ($info['ps_info']['ydate']) {
+                    $info['ps_info']['ydate'] = date('Y-m-d H:i', $info['ps_info']['ydate']);
+                } else {
+                    $info['ps_info']['ydate'] = '无';
+                }
+
+                $status = Dever::db('shop/buy_order_ps')->config['status'];
+                $info['ps_info']['status_name'] = $status[$info['ps_info']['status']];
+                
+                $service = array();
+                if ($info['ps_info']['service']) {
+                    foreach ($info['ps_info']['service'] as $k => $v) {
+                        if (isset($v['order_num']) && $v['order_num']) {
+                            $info['ps_info']['service'][$k]['service_name'] = '供应商自送';
+                            if ($v['service_id'] > 0) {
+                                $service_info = Dever::db('shop/service')->find($v['service_id']);
+                                $info['ps_info']['service'][$k]['service_name'] = $service_info['name'];
+                            }
+
+                            $service[] = array
+                            (
+                                array('名称', $info['ps_info']['service'][$k]['service_name']),
+                                array('单号', isset($v['order_num']) ? $v['order_num'] : ''),
+                            );
+                        }
+                    }
+                }
 
                 $result['物流信息'] = array
                 (
                     'type' => 'info',
                     'content' => array
                     (
-                        array
-                        (
-                            array('名称', $info['ps_info']['service_name']),
-                            array('单号', $info['ps_info']['order_num']),
-                            array('费用', $info['ps_info']['price']),
-                        ),
-
-                        array
-                        (
-                            array('配货员', $info['ps_info']['phy']),
-                            array('打包员', $info['ps_info']['dby']),
-                        ),
-
-                        array
-                        (
-                            array('数量', $info['ps_info']['num']),
-                            array('重量', $info['ps_info']['zl']),
-                            array('体积', $info['ps_info']['tj']),
-                        ),
-
                         array
                         (
                             array('发货时间', $info['ps_info']['cdate']),
                             array('收货时间', $info['ps_info']['ydate']),
+                            array('查单', '<a href="https://www.kuaidi100.com/?from=openv" target="_blank">点此手动查单</a>'),
                         ),
                     ),
                 );
-            }
-            */
-        }
-
-        
-        $body = array();
-        $body_total = array();
-        $body_total['price'] = 0;
-        $body_total['num'] = 0;
-        $goods = Dever::db('shop/buy_order_goods')->select(array('order_id' => $info['id']));
-        $goods_status = Dever::db('shop/buy_order_goods')->config['status'];
+                $result['物流信息']['content'] = array_merge($result['物流信息']['content'], $service);
+                /*
+                if ($noprice == 1) {
+                    $result['物流信息'] = array
+                    (
+                        'type' => 'info',
+                        'content' => array
+                        (
+                            array
+                            (
+                                array('名称', $info['ps_info']['service_name']),
+                                array('单号', $info['ps_info']['order_num']),
+                            ),
+
+                            array
+                            (
+                                array('数量', $info['ps_info']['num']),
+                                array('重量', $info['ps_info']['zl']),
+                                array('体积', $info['ps_info']['tj']),
+                            ),
+
+                            array
+                            (
+                                array('发货时间', $info['ps_info']['cdate']),
+                                array('收货时间', $info['ps_info']['ydate']),
+                            ),
+                        ),
+                    );
+                } else {
 
-        $refund_body = array();
-        $refund_body_total = array();
-        $refund_body_total['price'] = 0;
-        $refund_body_total['num'] = 0;
-        foreach ($goods as $k => $v) {
-            if ($type == 2) {
-                $v['price'] = $v['p_price'];
+                    $result['物流信息'] = array
+                    (
+                        'type' => 'info',
+                        'content' => array
+                        (
+                            array
+                            (
+                                array('名称', $info['ps_info']['service_name']),
+                                array('单号', $info['ps_info']['order_num']),
+                                array('费用', $info['ps_info']['price']),
+                            ),
+
+                            array
+                            (
+                                array('配货员', $info['ps_info']['phy']),
+                                array('打包员', $info['ps_info']['dby']),
+                            ),
+
+                            array
+                            (
+                                array('数量', $info['ps_info']['num']),
+                                array('重量', $info['ps_info']['zl']),
+                                array('体积', $info['ps_info']['tj']),
+                            ),
+
+                            array
+                            (
+                                array('发货时间', $info['ps_info']['cdate']),
+                                array('收货时间', $info['ps_info']['ydate']),
+                            ),
+                        ),
+                    );
+                }
+                */
             }
-            $goods_info = Dever::load('goods/lib/info')->getInfoBySku($v['goods_id'], $v['sku_id']);
-            $status = $goods_status[$v['status']];
 
-            $tk = Dever::db('shop/buy_order_refund')->find(array('order_id' => $info['id'], 'order_goods_id' => $v['id'], 'type' => 2));
-            if ($tk && $tk['process'] == 1) {
-                if ($type == 1) {
-                    $status = '申请' . $tk_status[$tk['status']];
-                } else {
-                    $status = '已上报';
+            
+            $body = array();
+            $body_total = array();
+            $body_total['price'] = 0;
+            $body_total['num'] = 0;
+            $goods = Dever::db('shop/buy_order_goods')->select(array('order_id' => $info['id']));
+            $goods_status = Dever::db('shop/buy_order_goods')->config['status'];
+
+            $refund_body = array();
+            $refund_body_total = array();
+            $refund_body_total['price'] = 0;
+            $refund_body_total['num'] = 0;
+            foreach ($goods as $k => $v) {
+                if ($type == 2) {
+                    $v['price'] = $v['p_price'];
                 }
+                $goods_info = Dever::load('goods/lib/info')->getInfoBySku($v['goods_id'], $v['sku_id']);
+                $status = $goods_status[$v['status']];
 
-                if ($type == 1) {
-                    $desc = array();
-                    $desc['退款原因'] = $tk['desc'];
-                    $desc['退款图片'] = '暂无';
-                    if ($tk['pic']) {
-                        $desc['退款图片'] = '';
-                        $pic = explode(',', $tk['pic']);
-                        foreach ($pic as $k1 => $v1) {
-                            $desc['退款图片'] .= '<a href="'.$v1.'" target="_blank"><img src="'.$v1.'" width="100"/></a>';
-                        }
+                $tk = Dever::db('shop/buy_order_refund')->find(array('order_id' => $info['id'], 'order_goods_id' => $v['id'], 'type' => 2));
+                if ($tk && $tk['process'] == 1) {
+                    if ($type == 1) {
+                        $status = '申请' . $tk_status[$tk['status']];
+                    } else {
+                        $status = '已上报';
                     }
-                    $status .= '<div style="width:300px"><table><tr><td><a href="javascript:showAlert($(\'#desc_content\').html());">点此查看原因</a><span id="desc_content" style="display:none">'.Dever::table($desc).'</span><td>';
 
-                    $status .= '<td><button href="javascript:;" style="width:80px" onclick="audit('.$tk['id'].', 2, \''.$url.'\')" class="layui-btn layui-btn-primary">通过</button></td><td><button href="javascript:;" onclick="audit('.$tk['id'].', 3, \''.$url.'\')"  style="width:80px" class="layui-btn layui-btn-danger">驳回</button></td></tr></table></div>';
-                }
-            } elseif ($type > 1 && (!$tk || ($tk && $tk['process'] == 3))) {
+                    if ($type == 1) {
+                        $desc = array();
+                        $desc['退款原因'] = $tk['desc'];
+                        $desc['退款图片'] = '暂无';
+                        if ($tk['pic']) {
+                            $desc['退款图片'] = '';
+                            $pic = explode(',', $tk['pic']);
+                            foreach ($pic as $k1 => $v1) {
+                                $desc['退款图片'] .= '<a href="'.$v1.'" target="_blank"><img src="'.$v1.'" width="100"/></a>';
+                            }
+                        }
+                        $status .= '<div style="width:300px"><table><tr><td><a href="javascript:showAlert($(\'#desc_content\').html());">点此查看原因</a><span id="desc_content" style="display:none">'.Dever::table($desc).'</span><td>';
 
-                //$tui = Dever::url('lib/buy.refund_apply_info_one_commit?json=1', 'mshop');
-                if ($type == 2) {
-                    $tui = Dever::url('order_tui?order_goods_id=' . $v['id'] . '&order_id=' . $info['id'] . '&type=13&type_id=' . $info['source_id'], 'factory');
-                } else {
-                    if ($info['source_type'] == 3) {
-                        $tui = Dever::url('order_tui?order_goods_id=' . $v['id'] . '&order_id=' . $info['id'] . '&type=13&type_id=' . $info['source_id'], 'store');
+                        $status .= '<td><button href="javascript:;" style="width:80px" onclick="audit('.$tk['id'].', 2, \''.$url.'\')" class="layui-btn layui-btn-primary">通过</button></td><td><button href="javascript:;" onclick="audit('.$tk['id'].', 3, \''.$url.'\')"  style="width:80px" class="layui-btn layui-btn-danger">驳回</button></td></tr></table></div>';
+                    }
+                } elseif ($type > 1 && (!$tk || ($tk && $tk['process'] == 3))) {
+
+                    //$tui = Dever::url('lib/buy.refund_apply_info_one_commit?json=1', 'mshop');
+                    if ($type == 2) {
+                        $tui = Dever::url('order_tui?order_goods_id=' . $v['id'] . '&order_id=' . $info['id'] . '&type=13&type_id=' . $info['source_id'], 'factory');
                     } else {
-                        $tui = Dever::url('order_tui?order_goods_id=' . $v['id'] . '&order_id=' . $info['id'] . '&type=12&type_id=' . $info['source_id'], 'store');
+                        if ($info['source_type'] == 3) {
+                            $tui = Dever::url('order_tui?order_goods_id=' . $v['id'] . '&order_id=' . $info['id'] . '&type=13&type_id=' . $info['source_id'], 'store');
+                        } else {
+                            $tui = Dever::url('order_tui?order_goods_id=' . $v['id'] . '&order_id=' . $info['id'] . '&type=12&type_id=' . $info['source_id'], 'store');
+                        }
+                        
+                    }
+                    if ($info['status'] == 3) {
+                        $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'缺货退款\', \'\', 1)" class="layui-btn">缺货退款</a>';
+                    } elseif ($info['status'] == 4) {
+                        $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'报损退款\', \'\', 1)" class="layui-btn">报损退款</a>';
                     }
-                    
                 }
-                if ($info['status'] == 3) {
-                    $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'缺货退款\', \'\', 1)" class="layui-btn">缺货退款</a>';
-                } elseif ($info['status'] == 4) {
-                    $status = '<a href="javascript:;" onclick="fastEdit($(this), \''.$tui.'\', \'报损退款\', \'\', 1)" class="layui-btn">报损退款</a>';
+
+                if (isset($goods_info['sku'])) {
+                    $sku = '[' . $goods_info['sku']['string'] . ']';
+                } else {
+                    $sku = '';
                 }
-            }
 
-            if (isset($goods_info['sku'])) {
-                $sku = '[' . $goods_info['sku']['string'] . ']';
-            } else {
-                $sku = '';
-            }
+                $d = array
+                (
+                    'pic' => $goods_info['cover'],
+                    'name' => $goods_info['name'],
+                    'sku' => $sku,
+                    'price' => $v['price'],
+                    'num' => $v['num'],
+                    'status' => $status,
+                );
 
-            $d = array
-            (
-                'pic' => $goods_info['cover'],
-                'name' => $goods_info['name'],
-                'sku' => $sku,
-                'price' => $v['price'],
-                'num' => $v['num'],
-                'status' => $status,
-            );
+                if ($goods_info['price_type'] > 2) {
+                    $d['goods'] = $goods_info['goods'];
+                }
 
-            if ($goods_info['price_type'] > 2) {
-                $d['goods'] = $goods_info['goods'];
+                if ($tk && $v['status'] == 3 && $tk['status'] != 3) {
+                    $d['status'] = $tk_status[$tk['status']];
+                    if ($noprice == 1) {
+                        unset($d['price']);
+                    }
+                    $refund_body[] = $d;
+                    $price = $v['price']*$v['num'];
+                    $refund_body_total['price'] += $price;
+                    $refund_body_total['num'] += $v['num'];
+                } else {
+                    if ($noprice == 1) {
+                        unset($d['price']);
+                    }
+                    $body[] = $d;
+                    $price = $v['price']*$v['num'];
+                    $body_total['price'] += $price;
+                    $body_total['num'] += $v['num'];
+                }
             }
 
-            if ($tk && $v['status'] == 3 && $tk['status'] != 3) {
-                $d['status'] = $tk_status[$tk['status']];
-                if ($noprice == 1) {
-                    unset($d['price']);
+            if ($body) {
+
+                if ($refund_body_total['price']) {
+                    $body_total['set_price'] = $body_total['price'] - $refund_body_total['price'];
                 }
-                $refund_body[] = $d;
-                $price = $v['price']*$v['num'];
-                $refund_body_total['price'] += $price;
-                $refund_body_total['num'] += $v['num'];
-            } else {
+                if ($refund_body_total['num']) {
+                    $body_total['set_num'] = $body_total['num'] - $refund_body_total['num'];
+                }
+
                 if ($noprice == 1) {
-                    unset($d['price']);
+                    unset($body_total['price']);
+                    unset($body_total['set_price']);
                 }
-                $body[] = $d;
-                $price = $v['price']*$v['num'];
-                $body_total['price'] += $price;
-                $body_total['num'] += $v['num'];
+                
+                $result['商品清单'] = array
+                (
+                    'type' => 'list',
+                    'content' => $body,
+                    'total' => $body_total,
+                );
             }
-        }
 
-        if ($body) {
+            if ($refund_body) {
 
-            if ($refund_body_total['price']) {
-                $body_total['set_price'] = $body_total['price'] - $refund_body_total['price'];
-            }
-            if ($refund_body_total['num']) {
-                $body_total['set_num'] = $body_total['num'] - $refund_body_total['num'];
-            }
+                if ($noprice == 1) {
+                    unset($refund_body_total['price']);
+                }
 
-            if ($noprice == 1) {
-                unset($body_total['price']);
-                unset($body_total['set_price']);
+                $result['缺货与报损商品'] = array
+                (
+                    'type' => 'list',
+                    'content' => $refund_body,
+                    'total' => $refund_body_total,
+                );
             }
-            
-            $result['商品清单'] = array
-            (
-                'type' => 'list',
-                'content' => $body,
-                'total' => $body_total,
-            );
-        }
 
-        if ($refund_body) {
-
-            if ($noprice == 1) {
-                unset($refund_body_total['price']);
-            }
+            $search_option_type = Dever::input('search_option_type');
+            if ($cash_type == 1) {
+                if ($search_option_type == 1) {
+                    # 门店结算单
+                    $cash_order = Dever::db('cash/order')->select(array('type' => $info['type'], 'type_id' => $info['type_id'], 'source_order_id' => $info['id']));
 
-            $result['缺货与报损商品'] = array
-            (
-                'type' => 'list',
-                'content' => $refund_body,
-                'total' => $refund_body_total,
-            );
-        }
+                    $col = 'cash';
 
-        $search_option_type = Dever::input('search_option_type');
-        if ($cash_type == 1) {
-            if ($search_option_type == 1) {
-                # 门店结算单
-                $cash_order = Dever::db('cash/order')->select(array('type' => $info['type'], 'type_id' => $info['type_id'], 'source_order_id' => $info['id']));
+                } elseif ($search_option_type == 2) {
+                    # 工厂结算单
+                    $cash_order = Dever::db('cash/order')->select(array('source_type' => $info['source_type'], 'source_id' => $info['source_id'], 'source_order_id' => $info['id']));
 
-                $col = 'cash';
+                    $col = 'p_cash';
+                } elseif ($search_option_type == 3) {
+                    # 仓库结算单
+                    $cash_order = Dever::db('cash/order')->select(array('source_type' => $info['source_type'], 'source_id' => $info['source_id'], 'source_order_id' => $info['id']));
 
-            } elseif ($search_option_type == 2) {
-                # 工厂结算单
-                $cash_order = Dever::db('cash/order')->select(array('source_type' => $info['source_type'], 'source_id' => $info['source_id'], 'source_order_id' => $info['id']));
+                    $col = 'num';
+                }
+            }
+            
 
-                $col = 'p_cash';
-            } elseif ($search_option_type == 3) {
-                # 仓库结算单
-                $cash_order = Dever::db('cash/order')->select(array('source_type' => $info['source_type'], 'source_id' => $info['source_id'], 'source_order_id' => $info['id']));
+            if (isset($cash_order) && $cash_order) {
+                $head = array('序号', '结算单号', '数量', '金额', '结算类型', '入账状态', '审核状态', '结算时间', '审核备注', '管理');
 
-                $col = 'num';
-            }
-        }
-        
+                if ($search_option_type == 3 || $noprice == 1) {
+                    unset($head[3]);
+                }
 
-        if (isset($cash_order) && $cash_order) {
-            $head = array('序号', '结算单号', '数量', '金额', '结算类型', '入账状态', '审核状态', '结算时间', '审核备注', '管理');
+                $body = array();
+                $config = Dever::db('cash/order')->config;
+                foreach ($cash_order as $k => $v) {
+                    $cdate = date('Y-m-d H:i', $v['cdate']);
+                    $fdate = $v['fdate'] ? date('Y-m-d H:i', $v['fdate']) : '';
+                    $operdate = $v['operdate'] ? date('Y-m-d H:i', $v['operdate']) : '';
+                    $cash = $v[$col];
+
+                    $url = Dever::url('project/database/list?project=shop&table=buy_order_goods&order_id='.$v['source_order_id'].'&page_type=1', 'manage');
+                    $v['source_order_num'] = '<a href="'.$url.'" style="color:blue">'.$v['source_order_num'].'</a>';
+
+                    $m = '';
+                    if ($v['audit'] == 1 && $v['audit_type'] == 2) {
+                        $url = Dever::url('project/database/update?project=cash&table=order&where_id='.$v['id'].'&col=audit,desc', 'manage');
+                        $m = '<a href="javascript:;" onclick="fastEdit($(this), \''.$url.'\', \'审核\', \'\', 1)" class="layui-btn">审核</a>';
+                    }
 
-            if ($search_option_type == 3 || $noprice == 1) {
-                unset($head[3]);
-            }
+                    $d = array
+                    (
+                        $k+1,
+                        $v['order_num'],
+                        $v['num'],
+                        $cash,
+                        $config['config_jstype'][$v['jstype']],
+                        $config['config_status'][$v['status']],
+                        $config['config_audit'][$v['audit']],
+                        $operdate,
+                        $v['desc'],
+                        $m,
+                    );
 
-            $body = array();
-            $config = Dever::db('cash/order')->config;
-            foreach ($cash_order as $k => $v) {
-                $cdate = date('Y-m-d H:i', $v['cdate']);
-                $fdate = $v['fdate'] ? date('Y-m-d H:i', $v['fdate']) : '';
-                $operdate = $v['operdate'] ? date('Y-m-d H:i', $v['operdate']) : '';
-                $cash = $v[$col];
-
-                $url = Dever::url('project/database/list?project=shop&table=buy_order_goods&order_id='.$v['source_order_id'].'&page_type=1', 'manage');
-                $v['source_order_num'] = '<a href="'.$url.'" style="color:blue">'.$v['source_order_num'].'</a>';
-
-                $m = '';
-                if ($v['audit'] == 1 && $v['audit_type'] == 2) {
-                    $url = Dever::url('project/database/update?project=cash&table=order&where_id='.$v['id'].'&col=audit,desc', 'manage');
-                    $m = '<a href="javascript:;" onclick="fastEdit($(this), \''.$url.'\', \'审核\', \'\', 1)" class="layui-btn">审核</a>';
+                    if ($search_option_type == 3 || $noprice == 1) {
+                        unset($d[3]);
+                    }
+                    $body[] = $d;
                 }
 
-                $d = array
+                $result['对账清单'] = array
                 (
-                    $k+1,
-                    $v['order_num'],
-                    $v['num'],
-                    $cash,
-                    $config['config_jstype'][$v['jstype']],
-                    $config['config_status'][$v['status']],
-                    $config['config_audit'][$v['audit']],
-                    $operdate,
-                    $v['desc'],
-                    $m,
+                    'type' => 'table',
+                    'content' => array
+                    (
+                        'head' => $head,
+                        'body' => $body,
+                    )
                 );
-
-                if ($search_option_type == 3 || $noprice == 1) {
-                    unset($d[3]);
-                }
-                $body[] = $d;
+                    
             }
-
-            $result['对账清单'] = array
-            (
-                'type' => 'table',
-                'content' => array
-                (
-                    'head' => $head,
-                    'body' => $body,
-                )
-            );
-                
         }
 
         $head = array
@@ -1464,6 +1477,11 @@ class Buy
         return 'ok';
     }
     */
+    # 采购订单审核 手动拆单
+    public function audit_set_commit()
+    {
+
+    }
 
     # 采购订单审核 拆单
     public function audit_commit()

+ 2 - 0
app/shop/database/buy_order.php

@@ -679,6 +679,8 @@ $config = array
             //'oper'  => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'),
             'fast' => array('审核', '"buy_order&where_id={id}&col=audit,audit_desc&oper_save_jump=buy_order&oper_table=buy_order&oper_parent=buy_order"', '{status} == 2'),
 
+            'list1' => array('手动审核', '"buy_order_goods&project=shop&order_id={id}&audit=1&page_type=1&type='.$stype.'&noprice='.$noprice.'"', '{status} == 2'),
+
             //'oper1'  => array('发货', '"mshop/lib/manage.send?order_id={id}"', '{status} == 3'),
 
             //'fast1' => array('发货', '"buy_order_ps&where_id={id}&search_option_order_id={id}&oper_save_jump=buy_order&oper_table=buy_order&oper_parent=buy_order"', '{status} == 3'),