From bac53d430bc866113c1dafe480f718e0b486c69d Mon Sep 17 00:00:00 2001 From: nizongfeng Date: Tue, 7 Feb 2023 17:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=B4=A2=E5=8A=A1=E5=A4=87?= =?UTF-8?q?=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/OrderMain.php | 14 +++++++- application/admin/dao/PaymentOrderDao.php | 8 ++--- application/admin/service/OrderMainService.php | 31 +++++++++++++++++ application/admin/view/payment_order/index.html | 45 +++++++++++++++++++++++++ application/admin/view/receipt_order/index.html | 45 +++++++++++++++++++++++++ 5 files changed, 138 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/OrderMain.php b/application/admin/controller/OrderMain.php index 1c9cdb8..f577f35 100755 --- a/application/admin/controller/OrderMain.php +++ b/application/admin/controller/OrderMain.php @@ -21,7 +21,7 @@ use think\Loader; */ class OrderMain extends Backend { - protected $noNeedRight = ['getOrderList',"save","delSubOrder","subOrderSave","getShowInfo","newAdd","insertOrderMain","addMemo","getMemoList","setHotFlag","addFileInfo","getFileList"]; + protected $noNeedRight = ['getOrderList',"save","delSubOrder","subOrderSave","getShowInfo","newAdd","insertOrderMain","addMemo","getMemoList","setHotFlag","addFileInfo","getFileList","setFinanceMemo"]; /** * OrderMain模型对象 * @var \app\admin\model\OrderMain @@ -192,4 +192,16 @@ class OrderMain extends Backend $result = $model->getList($params["type"],$params['id']); return json($result); } + + /** + * 设置财务备注 + * @return \think\response\Json + */ + public function setFinanceMemo(){ + $params=$this->request->post(); + $orderMainService = new OrderMainService(); + $result = $orderMainService->setFinanceMemo($params); + return json($result); + } + } diff --git a/application/admin/dao/PaymentOrderDao.php b/application/admin/dao/PaymentOrderDao.php index 6bc6dbe..ab00ab9 100644 --- a/application/admin/dao/PaymentOrderDao.php +++ b/application/admin/dao/PaymentOrderDao.php @@ -238,7 +238,7 @@ class PaymentOrderDao SELECT a.order_id,a.id,d.supplier_name,a.trade_order_number,a.item_type 'hotel_name',a.item_name 'room_name', a.item_unit 'plan_name', a.check_in_date,a.check_in_date 'check_out_date',d.count,a.create_time,'item' as 'prod_type' - ,a.payment_order_name,a.payment_order_status,a.payment_order_id,a.customer_name,a.total_cost,a.total_price,a.confirm_status + ,a.payment_order_name,a.payment_order_status,a.payment_order_id,a.customer_name,a.total_cost,a.total_price,a.confirm_status,a.finance_memo from hbp_order_item a INNER JOIN hbp_purchase d on a.id = d.order_detail_id and d.prod_type='item' where @@ -249,7 +249,7 @@ class PaymentOrderDao ( SELECT b.order_id,b.id,c.supplier_name,b.trade_order_number,b.hotel_name ,b.room_name ,b.plan_name, b.check_in_date,b.check_out_date,c.count,b.create_time,'hotel' as 'prod_type' - ,b.payment_order_name,b.payment_order_status,b.payment_order_id,b.customer_name,b.total_cost,b.total_price,b.confirm_status + ,b.payment_order_name,b.payment_order_status,b.payment_order_id,b.customer_name,b.total_cost,b.total_price,b.confirm_status,b.finance_memo from hbp_order_hotel b INNER JOIN hbp_purchase c on b.id=c.order_detail_id and c.prod_type='hotel' where @@ -266,7 +266,7 @@ class PaymentOrderDao SELECT a.order_id,a.id,d.supplier_name,a.trade_order_number,a.item_type 'hotel_name',a.item_name 'room_name', a.item_unit 'plan_name', a.check_in_date,a.check_in_date 'check_out_date',d.count,a.create_time,'item' as 'prod_type' - ,a.payment_order_name,a.payment_order_status,a.payment_order_id,a.customer_name,a.total_cost,a.total_price,a.confirm_status + ,a.payment_order_name,a.payment_order_status,a.payment_order_id,a.customer_name,a.total_cost,a.total_price,a.confirm_status,a.finance_memo from hbp_order_item a INNER JOIN hbp_purchase d on a.id = d.order_detail_id and d.prod_type='item' where @@ -277,7 +277,7 @@ class PaymentOrderDao ( SELECT b.order_id,b.id,c.supplier_name,b.trade_order_number,b.hotel_name ,b.room_name ,b.plan_name, b.check_in_date,b.check_out_date,c.count,b.create_time,'hotel' as 'prod_type' - ,b.payment_order_name,b.payment_order_status,b.payment_order_id,b.customer_name,b.total_cost,b.total_price,b.confirm_status + ,b.payment_order_name,b.payment_order_status,b.payment_order_id,b.customer_name,b.total_cost,b.total_price,b.confirm_status,b.finance_memo from hbp_order_hotel b INNER JOIN hbp_purchase c on b.id=c.order_detail_id and c.prod_type='hotel' where diff --git a/application/admin/service/OrderMainService.php b/application/admin/service/OrderMainService.php index 6643e6d..69f2d1d 100644 --- a/application/admin/service/OrderMainService.php +++ b/application/admin/service/OrderMainService.php @@ -10,6 +10,10 @@ use app\admin\dao\OrderItemDao; use app\admin\dao\OrderMainDao; use app\admin\dao\PurchaseDao; use app\admin\dao\PurchasePriceDao; +use app\admin\model\OrderHotel; +use app\admin\model\OrderItem; +use app\admin\model\OrderMain; +use think\Exception; /** * Created by PhpStorm. @@ -434,4 +438,31 @@ class OrderMainService $result['data']['list'] = $orderMainList; return $result; } + + /** + * 添加财务备注 + * @param $params + * @return array + */ + public function setFinanceMemo($params){ + try{ + $data = [ + "finance_memo"=>$params['finance_memo'] + ]; + if ($params['type']=="order") { + $model = new OrderMain(); + $model->save($data,["id"=>$params['order_id']]); + }else if ($params['type']=="hotel") { + $model = new OrderHotel(); + $model->save($data,["id"=>$params['order_id']]); + }else{ + $model = new OrderItem(); + $model->save($data,["id"=>$params['order_id']]); + } + return Util::returnArrSu(); + }catch (Exception $e){ + return Util::returnArrEr("失败".$e->getMessage()); + } + + } } \ No newline at end of file diff --git a/application/admin/view/payment_order/index.html b/application/admin/view/payment_order/index.html index 8858775..9820c7b 100755 --- a/application/admin/view/payment_order/index.html +++ b/application/admin/view/payment_order/index.html @@ -265,6 +265,33 @@
+ + +