dever 3 năm trước cách đây
mục cha
commit
19fc3ecdec

+ 1 - 1
app/cash/database/store.php

@@ -106,7 +106,7 @@ return array
             'desc'      => '对账金额',
             'match'     => 'option',
             'update'    => 'text',
-            //'list'      => true,
+            'list'      => true,
         ),
 
         'num'      => array

+ 40 - 27
app/cash/lib/Set.php

@@ -165,17 +165,17 @@ class Set
 
         </tr>';
 
+        $html .= '<tr>
+          <td width="80">对账金额</td>
+          <td>'.$this->table(false, array(array('¥' . round($info['cash'], 2)))).'</td>
+
+        </tr>';
+
         if ($type == 'store') {
             $html .= '<tr>
-              <td width="80">对账商品数量</td>
+              <td width="80">商品数量</td>
               <td>'.$this->table(false, array(array($info['num']))).'</td>
 
-            </tr>';
-        } else {
-            $html .= '<tr>
-              <td width="80">对账金额</td>
-              <td>'.$this->table(false, array(array('¥' . round($info['cash'], 2) . ''))).'</td>
-
             </tr>';
         }
 
@@ -249,25 +249,25 @@ class Set
                 $fdate = $v['fdate'] ? date('Y-m-d H:i', $v['fdate']) : '';
                 $operdate = $v['operdate'] ? date('Y-m-d H:i', $v['operdate']) : '';
                 $noprice = 2;
-                if ($type == 'store') {
-                    $cash = $v['num'];
-                    $noprice = 1;
-                } elseif ($type == 'factory') {
+                if ($type == 'factory') {
+                    $set_type = 2;
                     $cash = '¥' . round($v['p_cash'], 2);
                 } else {
                     $cash = '¥' . round($v['cash'], 2);
+                    $set_type = 1;
                 }
 
                 if ($show == 1) {
-                    $url = Dever::url('project/database/list?project=shop&table=buy_order_goods&order_id='.$v['source_order_id'].'&page_type=1&noprice=' . $noprice, 'manage');
+                    $url = Dever::url('project/database/list?project=shop&table=buy_order_goods&order_id='.$v['source_order_id'].'&page_type=1&noprice=' . $noprice . '&type=' . $set_type, 'manage');
                     $v['source_order_num'] = '<a href="'.$url.'" style="color:blue">'.$v['source_order_num'].'</a>';
 
-                    $head = array('结算单号', '订货单号', '结算类型', '下单日期', '完成日期', '结算日期', '对账金额', '结算状态');
+                    $head = array('结算单号', '订货单号', '结算类型', '下单日期', '完成日期', '结算日期', '对账金额');
                     if ($type == 'store') {
-                        $head[6] = '对账数量';
+                        $head[] = '商品数量';
                     }
+                    $head[] = '结算状态';
 
-                    $body[] = array
+                    $d = array
                     (
                         $v['order_num'],
                         $v['source_order_num'],
@@ -276,22 +276,34 @@ class Set
                         $fdate,
                         $operdate,
                         $cash,
-                        '已入账'
                     );
+
+                    if ($type == 'store') {
+                        $d[] = $v['num'];
+                    }
+                    $d[] = '已入账';
+                    $body[] = $d;
                 } else {
-                    $head = array('订货单号', '下单日期', '完成日期', '对账金额', '状态');
+                    $head = array('订货单号', '下单日期', '完成日期', '对账金额');
+
                     if ($type == 'store') {
-                        $head[3] = '对账数量';
+                        $head[] = '商品数量';
                     }
+                    $head[] = '状态';
 
-                    $body[] = array
+                    $d = array
                     (
                         $v['source_order_num'],
                         $cdate,
                         $fdate,
                         $cash,
-                        '已入账'
                     );
+
+                    if ($type == 'store') {
+                        $d[] = $v['num'];
+                    }
+                    $d[] = '已入账';
+                    $body[] = $d;
                 }
             }
 
@@ -370,7 +382,7 @@ class Set
         (
             'top' => array
             (
-                $file . ' ' . $info['status_name'] . ' 对账金额¥' . $info['cash'],
+                $file . ' ' . $info['status_name'] . ' 对账金额¥' . $info['cash']. ' 商品数量¥' . $info['num'],
             ),
             '结算单号',
             '订货单号',
@@ -379,11 +391,11 @@ class Set
             '完成日期',
             '结算日期',
             '对账金额',
-            '结算状态',
         );
         if ($type == 'store') {
-            $head[6] = '对账数量';
+            $head[] = '商品数量';
         }
+        $head[] = '结算状态';
         if ($data) {
             $body = array();
             foreach ($data as $k => $v) {
@@ -392,9 +404,7 @@ class Set
                 $fdate = $v['fdate'] ? date('Y-m-d H:i', $v['fdate']) : '';
                 $operdate = $v['operdate'] ? date('Y-m-d H:i', $v['operdate']) : '';
 
-                if ($type == 'store') {
-                    $cash = $v['num'];
-                } elseif ($type == 'factory') {
+                if ($type == 'factory') {
                     $cash = '¥' . round($v['p_cash'], 2);
                 } else {
                     $cash = '¥' . round($v['cash'], 2);
@@ -408,7 +418,10 @@ class Set
                 $body[$k][4] = $operdate;
                 $body[$k][5] = $fdate;
                 $body[$k][6] = $cash;
-                $body[$k][7] = '已入账';
+                if ($type == 'store') {
+                    $body[$k][] = $v['num'];
+                }
+                $body[$k][] = '已入账';
             }
         }
 

+ 6 - 0
app/goods/lib/Set.php

@@ -39,6 +39,9 @@ class Set
                             $result[$i]['p_price'] = $v['price'];
                         }
                     } else {
+                        if ($type == 'store_id') {
+                            $result[$i]['price'] = $v['f_price'];
+                        } 
                         if ($other) {
                             $result[$i]['total'] = $other['total_num'] - $other['sell_num'];
                             $result[$i]['select'] = $other['state'];
@@ -87,6 +90,9 @@ class Set
                                     $children['select'] = $other_sku['state'];
                                 }
                             } else {
+                                if ($type == 'store_id') {
+                                    $children['price'] = $v1['f_price'];
+                                }
                                 $children['total'] = 0;
                                 if ($other_sku) {
                                     $children['total'] = $other_sku['total_num'] - $other_sku['sell_num'];

+ 8 - 9
app/mshop/lib/Buy.php

@@ -239,7 +239,6 @@ class Buy
             $info['ps_info']['status_name'] = $status[$info['ps_info']['status']];
             
             if ($info['ps_info']['service_id'] > 0) {
-                //暂时还没有
                 $service = Dever::db('shop/service')->find($info['ps_info']['service_id']);
                 $info['ps_info']['service_name'] = $service['name'];
             }
@@ -874,7 +873,7 @@ class Buy
         $refund_body_total['price'] = 0;
         $refund_body_total['num'] = 0;
         foreach ($goods as $k => $v) {
-            if ($type == 2 || $info['type'] == 2) {
+            if ($type == 2) {
                 $v['price'] = $v['p_price'];
             }
             $goods_info = Dever::load('goods/lib/info')->getInfoBySku($v['goods_id'], $v['sku_id']);
@@ -942,7 +941,7 @@ class Buy
             if ($tk && $v['status'] == 3 && $tk['status'] != 3) {
                 $d['status'] = $tk_status[$tk['status']];
                 if ($noprice == 1) {
-                    unset($d['price']);
+                    //unset($d['price']);
                 }
                 $refund_body[] = $d;
                 $price = $v['price']*$v['num'];
@@ -950,7 +949,7 @@ class Buy
                 $refund_body_total['num'] += $v['num'];
             } else {
                 if ($noprice == 1) {
-                    unset($d['price']);
+                    //unset($d['price']);
                 }
                 $body[] = $d;
                 $price = $v['price']*$v['num'];
@@ -969,8 +968,8 @@ class Buy
             }
 
             if ($noprice == 1) {
-                unset($body_total['price']);
-                unset($body_total['set_price']);
+                //unset($body_total['price']);
+                //unset($body_total['set_price']);
             }
             
             $result['商品清单'] = array
@@ -984,7 +983,7 @@ class Buy
         if ($refund_body) {
 
             if ($noprice == 1) {
-                unset($refund_body_total['price']);
+                //unset($refund_body_total['price']);
             }
 
             $result['缺货与报损商品'] = array
@@ -1021,7 +1020,7 @@ class Buy
             $head = array('序号', '结算单号', '数量', '金额', '结算类型', '入账状态', '审核状态', '结算时间', '审核未通过原因', '管理');
 
             if ($search_option_type == 3) {
-                unset($head[3]);
+                //unset($head[3]);
             }
 
             $body = array();
@@ -1056,7 +1055,7 @@ class Buy
                 );
 
                 if ($search_option_type == 3) {
-                    unset($d[3]);
+                    //unset($d[3]);
                 }
                 $body[] = $d;
             }

+ 12 - 1
app/mshop/lib/Out.php

@@ -333,7 +333,7 @@ class Out
             );
 
             if ($type == 2) {
-                unset($d['price']);
+                //unset($d['price']);
             }
             $body[] = $d;
             $price = $v['price']*$v['num'];
@@ -474,4 +474,15 @@ class Out
 
         $pdf->out('库存清单');
     }
+
+    # 导出订单
+    public function excel($data)
+    {
+        print_r($data);die;
+        $file = '出库订单';
+
+        $header = array();
+
+        Dever::excelExport($body, $header, $file);
+    }
 }

+ 38 - 3
app/shop/database/buy_order.php

@@ -13,6 +13,13 @@ $status = array
     11 => '已过期',
 );
 
+$audit = array
+(
+    //1 => '待审核',
+    2 => '审核通过',
+    3 => '审核未通过',
+);
+
 $refund_status = array
 (
     1 => '未申请',
@@ -62,6 +69,11 @@ return array
     'lang' => '采购订单',
     'order' => 99,
     'status' => $status,
+    'end' => array
+    (
+        'insert' => 'shop/lib/manage.buyOrderUpdate',
+        'update' => 'shop/lib/manage.buyOrderUpdate',
+    ),
     # 数据结构
     'struct' => array
     (
@@ -153,7 +165,7 @@ return array
         'price'      => array
         (
             'type'      => 'varchar-50',
-            'name'      => '购买价格-销售价',
+            'name'      => '购买价格-采购价',
             'default'   => '0',
             'desc'      => '购买价格',
             'match'     => 'option',
@@ -236,6 +248,28 @@ return array
             'list'      => 'Dever::load("mshop/lib/buy.orderStatus", "{id}")',
         ),
 
+        'audit'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '审核状态',
+            'default'   => '2',
+            'desc'      => '审核状态',
+            'match'     => 'is_numeric',
+            'option'    => $audit,
+            'search'    => 'select',
+            'update'    => 'radio',
+        ),
+
+        'audit_desc'        => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '未通过原因',
+            'default'   => '',
+            'desc'      => '未通过原因',
+            'match'     => 'option',
+            'update'    => 'textarea',
+        ),
+
         'state'     => array
         (
             'type'      => 'tinyint-1',
@@ -292,9 +326,10 @@ return array
             //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
             //'delete' => array('删除', '', '{status} == 1'),
 
-            'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1"'),
+            'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1&type='.$search_option_type.'"'),
 
-            'oper'  => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'),
+            //'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'),
 
             //'oper1'  => array('发货', '"mshop/lib/manage.send?order_id={id}"', '{status} == 3'),
 

+ 4 - 2
app/shop/database/out_order.php

@@ -128,7 +128,8 @@ return array
             'desc'      => '价格',
             'match'     => 'option',
             'update'    => 'text',
-            'list'      => $search == 1 ? true : false,
+            'list_name'      => $search == 1 ? '销售价' : '采购价',
+            'list'      => true,
         ),
 
         'num'        => array
@@ -214,10 +215,11 @@ return array
         'delete' => false,
         'edit' => false,
         'insert' => false,
+        'excel' => 'mshop/lib/out.excel',
 
         'button' => array
         (
-            //'导出订单' => array('location', 'user/lib/manage.out'),
+            //'导出订单' => array('excel', 'mshop/lib/out.excel'),
         ),
 
         'list_button' => array(

+ 10 - 1
app/shop/lib/Info.php

@@ -223,7 +223,16 @@ class Info
         
         if ($lng && $lat) {
             $col = Dever::db('shop/info')->config['config_col'];
-            $sql = 'select '.$col.',round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
+            $km = Dever::input('km');
+            $distance = 'round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2)';
+            if ($km && $km == 1 && $type < 10) {
+                # 验证公里数
+                $config = Dever::db('main/manage_config')->find();
+                if ($config && $config['km'] > 0) {
+                    $where .= ' and '.$distance.' <= ' . $config['km'];
+                }
+            }
+            $sql = 'select '.$col.','.$distance.' as distance from {table} where '.$where.' order by distance asc';
 
             $data = Dever::db('shop/info')->$method($sql, array(), $page);
         } else {

+ 19 - 0
app/shop/lib/Manage.php

@@ -136,6 +136,25 @@ class Manage
         return $status >= 10 ? '绑定失败' : Dever::load('mshop/lib/feieyun')->status($sn);
     }
 
+    public function buyOrderUpdate($id, $name, $data)
+    {
+        Dever::config('base')->hook = true;
+        $update = array();
+        $audit = Dever::param('audit', $data);
+        $info = Dever::db('shop/buy_order')->one($id);
+        if ($audit > 1 && $info && $info['status'] == 2) {
+            if ($audit == 2) {
+                # 成功
+                Dever::setInput('order_id', $id);
+                Dever::load('mshop/lib/buy.audit_commit');
+            } else {
+                # 退款
+                $shop = Dever::db('shop/info')->find($info['type_id']);
+                Dever::load('shop/lib/refund')->set('buy')->apply(1, $shop['id'], $id, false, 3, 0, '未通过审核');
+            }
+        }
+    }
+
     /**
      * 更新信息
      *

+ 2 - 1
app/shop/lib/Sell.php

@@ -211,7 +211,8 @@ class Sell
                 $info['ps_info']['status_name'] = $status[$info['ps_info']['status']];
                 
                 if ($info['ps_info']['service_id'] > 0) {
-                    //暂时还没有
+                    $service = Dever::db('shop/service')->find($info['ps_info']['service_id']);
+                    $info['ps_info']['service_name'] = $service['name'];
                 }
             }
         }

+ 1 - 1
app/store/admin/Factory_order.php

@@ -37,7 +37,7 @@ class Factory_order extends Core
                     $v['status_name'] .= '[缺货报损中]';
                 }
 
-        		$html .= '<tr><td>'.$v['order_num'].'</td><td>'.$ps_date.'</td><td>'.$v['source_info']['name'].'</td><td>'.$ydate.'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$button.'</td></tr>';
+        		$html .= '<tr><td>'.$v['order_num'].'</td><td>'.$ps_date.'</td><td>'.$v['source_info']['name'].'</td><td>'.$ydate.'</td><td>'.$v['price'].'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$button.'</td></tr>';
         	}
         }
         return $html;

+ 1 - 1
app/store/admin/Order.php

@@ -70,7 +70,7 @@ class Order extends Core
                     $v['status_name'] .= '[缺货报损中]';
                 }
 
-        		$html .= '<tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="'.$v['id'].'"/></td><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$button.'</td></tr>';
+        		$html .= '<tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="'.$v['id'].'"/></td><td>'.$v['order_num'].'</td><td>'.$v['operdate'].'</td><td>'.$v['type_info']['name'].'</td><td>'.$ps_date.'</td><td>'.$v['price'].'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$button.'</td></tr>';
         	}
         }
         return $html;

+ 2 - 2
app/store/admin/Out.php

@@ -22,7 +22,7 @@ class Out extends Core
                     $button .= '&nbsp;&nbsp;<a href="javascript:;" onclick="load(\''.$url.'\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">取消</button></a>';
                 }
 
-                $html .= '<tr><td>'.$v['order_num'].'</td><td>'.$v['cdate'].'</td><td>'.$v['type_name'].'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$button.'</td></tr>';
+                $html .= '<tr><td>'.$v['order_num'].'</td><td>'.$v['cdate'].'</td><td>'.$v['type_name'].'</td><td>'.$v['price'].'</td><td>'.$v['num'].'</td><td>'.$v['status_name'].'</td><td>'.$button.'</td></tr>';
             }
         }
         return $html;
@@ -157,7 +157,7 @@ class Out extends Core
             }
             $n = $v['num'];
 
-            $this->data['list'][$k] = Dever::load('goods/lib/info')->getPayInfo($v['id'], $s);
+            $this->data['list'][$k] = Dever::load('goods/lib/info')->getPayInfo($v['id'], $s, 2);
             $this->data['list'][$k]['num'] = $n;
 
             # 2是库存不足

+ 1 - 1
app/store/admin/Stat.php

@@ -39,7 +39,7 @@ class Stat extends Core
         		}
 
 
-        		$html .= '<tr><td>'.Dever::load("cash/lib/set.statDate", $v['type'], $v['day']).'</td><td>'.Dever::load("cash/lib/set.statTime", $v['start'], $v['end']).'</td><td>'.$v['num'].'</td><td>'.$config['config_status'][$v['store_status']].'</td><td>'.$button.'</td></tr>';
+        		$html .= '<tr><td>'.Dever::load("cash/lib/set.statDate", $v['type'], $v['day']).'</td><td>'.Dever::load("cash/lib/set.statTime", $v['start'], $v['end']).'</td><td>'.$v['cash'].'</td><td>'.$v['num'].'</td><td>'.$config['config_status'][$v['store_status']].'</td><td>'.$button.'</td></tr>';
         	}
         }
         return $html;

+ 1 - 1
app/store/assets/pc/html/factory_order.html

@@ -39,7 +39,7 @@
         <div id="table_2" style="display:"> 
           <table class="table layui-table layui-table-body" id="table">
           <thead id="list-thead">
-              <tr><th data-priority="1">订单号</th><th data-priority="1">发货日期</th><th data-priority="1">商品来源</th><th data-priority="1">到货日期</th><th data-priority="1">数量</th><th data-priority="1">订单状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
+              <tr><th data-priority="1">订单号</th><th data-priority="1">发货日期</th><th data-priority="1">商品来源</th><th data-priority="1">到货日期</th><th data-priority="1">采购价</th><th data-priority="1">数量</th><th data-priority="1">订单状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
           </thead>
           <tbody id="list-tbody"><tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="1"/></td><td>河北仓库1(18710001234)</td><td>测试仓库(15810090845)</td><td>F202111095151925058966182</td><td>38</td><td>2</td><td>待收货确认</td><td><a href="javascript:;" onclick="fastEdit($(this), 'http://zsmatest.nongxiaohe.com/package/manage/?l=project/database/list&amp;project=shop&amp;search_option_type=2&amp;page_type=2&amp;table=buy_order_goods&amp;project=shop&amp;order_id=1&amp;page_type=1&amp;menu=shop&amp;menu_id=99&amp;search_option_state=1', '查看详情', '', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">查看详情</button></a>&nbsp;&nbsp;</td></tr></tbody>
       </table>

+ 1 - 1
app/store/assets/pc/html/order.html

@@ -39,7 +39,7 @@
         <div id="table_2" style="display:"> 
           <table class="table layui-table layui-table-body" id="table">
           <thead id="list-thead">
-              <tr><th data-priority="1"><input type="checkbox" class="checkbox-checkall" name="checkall" id="checkall" value="list" lay-ignore/></th><th data-priority="1">订单号</th><th data-priority="1">订货日期</th><th data-priority="1">订单收件人</th><th data-priority="1">发货日期</th><th data-priority="1">数量</th><th data-priority="1">订单状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
+              <tr><th data-priority="1"><input type="checkbox" class="checkbox-checkall" name="checkall" id="checkall" value="list" lay-ignore/></th><th data-priority="1">订单号</th><th data-priority="1">订货日期</th><th data-priority="1">订单收件人</th><th data-priority="1">发货日期</th><th data-priority="1">采购价</th><th data-priority="1">数量</th><th data-priority="1">订单状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
           </thead>
           <tbody id="list-tbody"><tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="1"/></td><td>河北仓库1(18710001234)</td><td>测试仓库(15810090845)</td><td>F202111095151925058966182</td><td>38</td><td>2</td><td>待收货确认</td><td><a href="javascript:;" onclick="fastEdit($(this), 'http://zsmatest.nongxiaohe.com/package/manage/?l=project/database/list&amp;project=shop&amp;search_option_type=2&amp;page_type=2&amp;table=buy_order_goods&amp;project=shop&amp;order_id=1&amp;page_type=1&amp;menu=shop&amp;menu_id=99&amp;search_option_state=1', '查看详情', '', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">查看详情</button></a>&nbsp;&nbsp;</td></tr></tbody>
       </table>

+ 1 - 1
app/store/assets/pc/html/out.html

@@ -39,7 +39,7 @@
         <div id="table_2" style="display:"> 
           <table class="table layui-table layui-table-body" id="table">
           <thead id="list-thead">
-              <tr><th data-priority="1">出库单号</th><th data-priority="1">添加日期</th><th data-priority="1">出库单类别</th><th data-priority="1">数量</th><th data-priority="1">状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
+              <tr><th data-priority="1">出库单号</th><th data-priority="1">添加日期</th><th data-priority="1">出库单类别</th><th data-priority="1">采购价</th><th data-priority="1">数量</th><th data-priority="1">状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
           </thead>
           <tbody id="list-tbody"><tr><td><input type="checkbox" name="mul_where_id[]" class="checkbox-checkall-list" lay-ignore value="1"/></td><td>河北仓库1(18710001234)</td><td>测试仓库(15810090845)</td><td>F202111095151925058966182</td><td>38</td><td>2</td><td>待收货确认</td><td><a href="javascript:;" onclick="fastEdit($(this), 'http://zsmatest.nongxiaohe.com/package/manage/?l=project/database/list&amp;project=shop&amp;search_option_type=2&amp;page_type=2&amp;table=buy_order_goods&amp;project=shop&amp;order_id=1&amp;page_type=1&amp;menu=shop&amp;menu_id=99&amp;search_option_state=1', '查看详情', '', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">查看详情</button></a>&nbsp;&nbsp;</td></tr></tbody>
       </table>

+ 4 - 1
app/store/assets/pc/html/setGoods.html

@@ -40,6 +40,7 @@
                             <tr>
                                 <th lay-data="{field:'id'}">商品编码</th>
                                 <th lay-data="{field:'name'}">商品名称</th>
+                                <th lay-data="{field:'price', edit: 'text'}">采购价(元)</th>
                                 <th lay-data="{field:'number', edit: 'text'}">数量</th>
                                 <th lay-data="{field:'operation'}">操作</th>
                             </tr>
@@ -220,6 +221,7 @@
             var key = node.id;
             if (!goods[key]) {
                 goods[key] = node;
+                goods[key].price = parseFloat(goods[key].price);
                 goods[key].num = 1;
                 create(node);
                 setTotal();
@@ -239,7 +241,8 @@
         if (!get(node.id).length) {
             var addtr = '<tr class="mytr" id="goods_'+node.id+'">';
             addtr += '<td class="goods_id">'+node.id+'</td>';
-            addtr += '<td class="goods_name">'+node.name+'</td>';     
+            addtr += '<td class="goods_name">'+node.name+'</td>'; 
+            addtr += '<td class="goods_price">'+node.price+'</td>';    
             addtr += '<td><div class="jiajian" value='+node.id+'><span class="jian" onclick="dec(\''+node.id+'\')">-</span><input type="text" value="'+node.num+'" class="goods_num"><span class="jia" onclick="add(\''+node.id+'\')">+</span></div></td>';                 
             addtr += '<td><button class="delete_btn" onclick="del(\''+node.id+'\')">删除</button></td>';                      
             addtr += '</tr>';

+ 1 - 1
app/store/assets/pc/html/setGoodsNum.html

@@ -51,7 +51,7 @@
                             <tr>
                                 <th lay-data="{field:'id'}">商品编码</th>
                                 <th lay-data="{field:'name'}">商品名称</th>
-                                <th lay-data="{field:'price', edit: 'text'}">销售价(元)</th>
+                                <th lay-data="{field:'price', edit: 'text'}">采购价(元)</th>
                                 <th lay-data="{field:'total', edit: 'text'}">当前库存</th>
                                 <th lay-data="{field:'number', edit: 'text'}">新增库存</th>
                                 <th lay-data="{field:'operation'}">操作</th>

+ 1 - 1
app/store/assets/pc/html/stat.html

@@ -51,7 +51,7 @@
           <div id="chart" class="chart" style="display:none"></div>
           <table class="table layui-table layui-table-body" id="table">
           <thead id="list-thead">
-              <tr><th data-priority="1">对账单时间</th><th data-priority="1">对账周期</th><th data-priority="1">对账数量</th><th data-priority="1">对账状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
+              <tr><th data-priority="1">对账单时间</th><th data-priority="1">对账周期</th><th data-priority="1">对账金额</th><th data-priority="1">对账数量</th><th data-priority="1">对账状态</th><th data-priority="1" class="dever-manage">管理</th></tr>
           </thead>
           <tbody id="list-tbody"><tr><td>2021年11月</td><td>第二个仓库</td><td>2021-11-01 ~ 2021-11-30</td><td>40</td><td>未对账</td><td>未对账</td><td><a href="http://192.168.33.10/churen/package/manage/?l=project/database/list&project=cash&&page_type=2&table=order&project=cash&id=2&page_type=1&type=store&menu=cash&menu_id=88&search_option_state=1" class="oper_list"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs"><span class="am-icon-pencil-square-o"></span>查看详情</button></a>&nbsp;&nbsp;<a href="javascript:;" onclick="load('http://192.168.33.10/churen/app/cash/?l=lib/manage.audit&id=2&type=store', '2021年11月与第二个仓库对账单款项是否正确<br />对账金额¥40元', '请确认')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">确认对账金额</button></a>&nbsp;&nbsp;</td></tr><tr><td>2021年11月</td><td>第二个仓库</td><td>2021-11-01 ~ 2021-11-30</td><td>0</td><td>未对账</td><td>未对账</td><td><a href="http://192.168.33.10/churen/package/manage/?l=project/database/list&project=cash&&page_type=2&table=order&project=cash&id=1&page_type=1&type=store&menu=cash&menu_id=88&search_option_state=1" class="oper_list"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs"><span class="am-icon-pencil-square-o"></span>查看详情</button></a>&nbsp;&nbsp;<a href="javascript:;" onclick="load('http://192.168.33.10/churen/app/cash/?l=lib/manage.audit&id=1&type=store', '2021年11月与第二个仓库对账单款项是否正确<br />对账金额¥0元', '请确认')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">确认对账金额</button></a>&nbsp;&nbsp;</td></tr></tbody>
       </table>

+ 5 - 2
app/store/lib/Goods.php

@@ -77,7 +77,8 @@ class Goods
         $result = array();
         if ($data) {
             foreach ($data as $k => $v) {
-                $data[$k] = Dever::load('goods/lib/info')->getPayInfo($v, $v['sku_id']);
+                $data[$k] = Dever::load('goods/lib/info')->getPayInfo($v['goods_id'], $v['sku_id'], 2);
+                $data[$k]['total'] = $v['total'];
             }
         }
 
@@ -103,7 +104,7 @@ class Goods
         $result = array();
         if ($data) {
             foreach ($data as $k => $v) {
-                $data[$k] = Dever::load('goods/lib/info')->getPayInfo($v['goods_id'], $v['sku_id']);
+                $data[$k] = Dever::load('goods/lib/info')->getPayInfo($v['goods_id'], $v['sku_id'], 2);
                 if ($data[$k]['price_type'] == 4) {
                     continue;
                 }
@@ -114,6 +115,7 @@ class Goods
                 if (!isset($result[$v['id']])) {
                     $result[$v['id']]['id'] = $v['id'];
                     $result[$v['id']]['name'] = $v['name'];
+                    $result[$v['id']]['price'] = $data[$k]['price'];
                     $result[$v['id']]['total'] = $data[$k]['total'];
                     $result[$v['id']]['children'] = array();
                 }
@@ -122,6 +124,7 @@ class Goods
                     (
                         'id' => $v['id'] . '-' . $data[$k]['sku_id'],
                         'name' => $v['name'] . '-' . $data[$k]['sku_name'] . '[剩余'.$data[$k]['total'].'个]',
+                        'price' => $data[$k]['price'],
                         'total' => $data[$k]['total'],
                         'end' => true,
                     );

+ 1 - 0
app/store/lib/Sku.php

@@ -15,6 +15,7 @@ class Sku
     		'add_num' => '新增库存数^-输入小于0的数字,则为减少库存',
 	        'total' => '当前库存|',
 	        'total_num' => '总库存|',
+            'f_price' => '采购价|',
     	),
 
     	# 设置哪个商品类型无法设置上述字段