diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index 77071cca..255319c4 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -1563,7 +1563,7 @@ class Common extends CI_Controller $count = $this->items_model->count($fhwhere); if ($count) { - $rows = $this->items_model->select($fhwhere, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin'); + $rows = $this->items_model->select($fhwhere, "id desc", $page, $size, 'id,brand_id,s_id,v_id,cor_id,incor_id,vin,buy_price,estimated_rebate'); //品牌车型 $brand_arr = array_unique(array_column($rows, 'brand_id')); @@ -1580,7 +1580,9 @@ class Common extends CI_Controller foreach ($rows as $key => $val) { $setval = [ 'id' => $val['id'], - 'vin' => $val['vin'] + 'vin' => $val['vin'], + 'buy_price' => $val['buy_price'], + 'estimated_rebate' => $val['estimated_rebate'], ]; $setval['brand_name'] = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : ''; $setval['series_name'] = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : ''; diff --git a/admin/controllers/items/goods/Goods.php b/admin/controllers/items/goods/Goods.php index 652d9c0e..afad0beb 100644 --- a/admin/controllers/items/goods/Goods.php +++ b/admin/controllers/items/goods/Goods.php @@ -527,6 +527,7 @@ class Goods extends HD_Controller $info['dis_price'] = $re['dis_price'] . '元'; $info['bill_price'] = $re['bill_price'] . '元'; $info['buy_price'] = $re['buy_price'] . '元'; + $info['estimated_rebate'] = $re['estimated_rebate'] . '元'; $info['discount'] = $re['discount'] ? $re['discount'] . '%' : '100%'; $info['pro_time'] = $re['pro_time'] != '0000-00-00 00:00:00' ? $re['pro_time'] : ''; $info['in_time'] = $re['in_time'] != '0000-00-00 00:00:00' ? $re['in_time'] : ''; @@ -579,8 +580,8 @@ class Goods extends HD_Controller $msg = '请选择入库时间'; } else if (!$info['company_id']) { $msg = '请选择公司归属'; - } else if (!$info['buy_price'] || $info['buy_price'] <= 0.0) { - $msg = '请输入采购成本'; + //} else if (!$info['buy_price'] || $info['buy_price'] <= 0.0) { + // $msg = '请输入采购成本'; // 23.06.01 采购成本再改成 非必填 } else { $code = SYS_CODE_SUCCESS; } @@ -624,6 +625,7 @@ class Goods extends HD_Controller $addData['bill_num'] = $info['bill_num'] ? $info['bill_num'] : ''; $addData['bill_price'] = $info['bill_price'] ? $info['bill_price'] : 0.00; $addData['buy_price'] = $info['buy_price'] ? $info['buy_price'] : 0.00; + $addData['estimated_rebate'] = $info['estimated_rebate'] ? $info['estimated_rebate'] : 0.00; $addData['pro_time'] = $info['pro_time'] ? $info['pro_time'] : '0000-00-00 00:00:00'; $addData['in_time'] = $info['in_time'] ? $info['in_time'] : date('Y-m-d H:i:s'); @@ -795,7 +797,8 @@ class Goods extends HD_Controller $editData['dis_price'] = $info['dis_price']; $editData['bill_num'] = $info['bill_num']; $editData['bill_price'] = $info['bill_price']; - $editData['buy_price'] = $info['buy_price']; + $editData['buy_price'] = $info['buy_price'] ? $info['buy_price'] : 0; + $editData['estimated_rebate'] = $info['estimated_rebate'] ? $info['estimated_rebate'] : 0; $editData['pro_time'] = $info['pro_time']; $editData['in_time'] = $info['in_time']; @@ -1104,6 +1107,7 @@ class Goods extends HD_Controller 'sale_price' => '售价', 'bill_price' => '开票金额', 'buy_price' => '采购成本', + 'estimated_rebate' => '预估返利', 'dis_price' => '折扣价', 'discount' => '折扣百分比', 'city_name' => '城市名', @@ -1264,6 +1268,7 @@ class Goods extends HD_Controller 'sale_price' => $v['sale_price'], 'bill_price' => $v['bill_price'], 'buy_price' => $v['buy_price'], + 'estimated_rebate' => $v['estimated_rebate'], 'dis_price' => $v['dis_price'], 'discount' => $v['discount'], 'city_name' => $addr ? $addr['city_name'] : '', diff --git a/admin/controllers/receiver/orderv2/Orders.php b/admin/controllers/receiver/orderv2/Orders.php index cd3e5dd1..d153022c 100644 --- a/admin/controllers/receiver/orderv2/Orders.php +++ b/admin/controllers/receiver/orderv2/Orders.php @@ -1077,6 +1077,12 @@ class Orders extends HD_Controller if($row['bill_time']!='0000-00-00 00:00:00'){ $update['bill_time'] = $row['bill_time']; } + $buy_price = $this->input->post('buy_price'); + $buy_price_origin = $this->input->post('buy_price_origin'); + $estimated_rebate = $this->input->post('estimated_rebate'); + $estimated_rebate_origin = $this->input->post('estimated_rebate_origin'); + $buy_price != $buy_price_origin && $update['buy_price'] = $buy_price; + $estimated_rebate != $estimated_rebate_origin && $update['estimated_rebate'] = $estimated_rebate; $result = $this->items_model->update($update, ['id' => $item_id]); if ($result) { diff --git a/admin/views/items/goods/edit.php b/admin/views/items/goods/edit.php index 84630d20..4d93c712 100644 --- a/admin/views/items/goods/edit.php +++ b/admin/views/items/goods/edit.php @@ -215,6 +215,20 @@ + + + + + + + + +
+
预估返利
+ +
+ + diff --git a/admin/views/receiver/orderv2/get/index.php b/admin/views/receiver/orderv2/get/index.php index e1cde934..e1f14826 100644 --- a/admin/views/receiver/orderv2/get/index.php +++ b/admin/views/receiver/orderv2/get/index.php @@ -468,7 +468,11 @@ yes: function (index) { $.post("/receiver/orderv2/orders/edit_item", { 'id': that.info.id, - 'item_id': that.info.item_id + 'item_id': that.info.item_id, + 'buy_price': that.info.buy_price, + 'buy_price_origin': that.info.buy_price_origin, + 'estimated_rebate': that.info.estimated_rebate, + 'estimated_rebate_origin': that.info.estimated_rebate_origin, }, function (data) { if (data.code) { layer.msg(data.msg, {time: 2000, icon: 1}, function () { @@ -481,6 +485,22 @@ } }); }, + carModalInfo: function () { + var that = this + layer.open({ + type: 1, + // area: ['40%', '50%'], //宽高 + area: ['400', '300'], //宽高 + content: $('#car-modal-info'), + title: '确认采购成本与预估返利', + shade: false, + btn: ['确定'], + yes: function (index) { + // alert(that.info.vin); + layer.close(index); + } + }); + }, getCars: function (page) { var vm = this; $.ajax({ @@ -521,8 +541,19 @@ if (checked) { vm.info.item_id = cars.id; cars.selected = 1; + vm.info.vin = cars.vin; + vm.info.buy_price = cars.buy_price; + vm.info.buy_price_origin = cars.buy_price; + vm.info.estimated_rebate = cars.estimated_rebate; + vm.info.estimated_rebate_origin = cars.estimated_rebate; + this.carModalInfo(); } else { vm.info.item_id = 0; + vm.info.vin = ''; + vm.info.buy_price = 0; + vm.info.buy_price_origin = 0; + vm.info.estimated_rebate = 0; + vm.info.estimated_rebate_origin = 0; } }, beforeUsersPage: function () { diff --git a/admin/views/receiver/orderv2/get/oinfo.php b/admin/views/receiver/orderv2/get/oinfo.php index a5c884f0..e205ded6 100644 --- a/admin/views/receiver/orderv2/get/oinfo.php +++ b/admin/views/receiver/orderv2/get/oinfo.php @@ -245,3 +245,31 @@ +