Browse Source

设置财务备注

master
nizongfeng 1 year ago
parent
commit
bac53d430b
5 changed files with 138 additions and 5 deletions
  1. +13
    -1
      application/admin/controller/OrderMain.php
  2. +4
    -4
      application/admin/dao/PaymentOrderDao.php
  3. +31
    -0
      application/admin/service/OrderMainService.php
  4. +45
    -0
      application/admin/view/payment_order/index.html
  5. +45
    -0
      application/admin/view/receipt_order/index.html

+ 13
- 1
application/admin/controller/OrderMain.php View File

@@ -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);
}

}

+ 4
- 4
application/admin/dao/PaymentOrderDao.php View File

@@ -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


+ 31
- 0
application/admin/service/OrderMainService.php View File

@@ -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());
}

}
}

+ 45
- 0
application/admin/view/payment_order/index.html View File

@@ -265,6 +265,33 @@
<div v-html="scope.row.payment_order_name"></div>
</template>
</el-table-column>
<el-table-column label="财务备注" min-width="40" >
<template slot-scope="scope">
<el-popover
placement="left"
placement="top-start"
title="备注:"
width="500"
trigger="hover">
<div>
<div>
<el-input
style="margin: 5px"
type="textarea"
:rows="2"
placeholder="无"
v-model="scope.row.finance_memo">
</el-input>
</div>
<div>
<el-button type="primary" slot="reference" @click="setFinanceMemo(scope.row)" size="small" style="margin: 5px">变更提交</el-button>
</div>
</div>
<el-button slot="reference" size="small" >查看</el-button>
</el-popover>

</template>
</el-table-column>
<el-table-column label="操作" >
<template slot-scope="scope">
<el-button-group>
@@ -476,6 +503,24 @@
}
},
methods: {
setFinanceMemo(info){
let param = {
"type": info["prod_type"],
"finance_memo":info["finance_memo"],
"order_id":info["id"]
}
axios.post("/hotel.php/order_main/setFinanceMemo", param).then((response) => {
let data = response.data;
if (data.flag) {
this.$message.success("备注成功");
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
console.log(error);
});

},
handleChange(file, fileList) {
this.fileList = fileList.slice(-3);
},


+ 45
- 0
application/admin/view/receipt_order/index.html View File

@@ -235,6 +235,33 @@
<el-table-column prop="create_time" label="下单时间" min-width="80" ></el-table-column>
<el-table-column prop="receipt_order_id" label="收款单ID" min-width="40" ></el-table-column>
<el-table-column prop="receipt_order_name" label="收款单名称" min-width="80" ></el-table-column>
<el-table-column label="财务备注" min-width="40" >
<template slot-scope="scope">
<el-popover
placement="left"
placement="top-start"
title="备注:"
width="500"
trigger="hover">
<div>
<div>
<el-input
style="margin: 5px"
type="textarea"
:rows="2"
placeholder="无"
v-model="scope.row.finance_memo">
</el-input>
</div>
<div>
<el-button type="primary" slot="reference" @click="setFinanceMemo(scope.row)" size="small" style="margin: 5px">变更提交</el-button>
</div>
</div>
<el-button slot="reference" size="small" >查看</el-button>
</el-popover>

</template>
</el-table-column>
<el-table-column label="操作" >
<template slot-scope="scope">
<el-button-group>
@@ -430,6 +457,24 @@

},
methods: {
setFinanceMemo(info){
let param = {
"type": "order",
"finance_memo":info["finance_memo"],
"order_id":info["id"]
}
axios.post("/hotel.php/order_main/setFinanceMemo", param).then((response) => {
let data = response.data;
if (data.flag) {
this.$message.success("备注成功");
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
console.log(error);
});

},
handleChange(file, fileList) {
this.fileList = fileList.slice(-3);
},


Loading…
Cancel
Save