Browse Source

优化

dev
nizongfeng 3 years ago
parent
commit
c4daf75747
5 changed files with 30 additions and 25 deletions
  1. +2
    -0
      application/admin/dao/OrderHotelDao.php
  2. +2
    -0
      application/admin/dao/OrderItemDao.php
  3. +3
    -22
      application/admin/dao/PurchaseDao.php
  4. +17
    -2
      application/admin/service/OrderMainService.php
  5. +6
    -1
      application/admin/view/order_main/index.html

+ 2
- 0
application/admin/dao/OrderHotelDao.php View File

@@ -68,6 +68,8 @@ class OrderHotelDao
"trade_order_number" => $param['trade_order_number'],
"purchase_user_id" => $param['purchase_user_id'],
"purchase_user" => $param['purchase_user'],
"supplier_id" => $param['supplier_id'],
"supplier_name" => $param['supplier_name'],
"del_flag"=>0
];
$orderHotelModel = new OrderHotel();


+ 2
- 0
application/admin/dao/OrderItemDao.php View File

@@ -54,6 +54,8 @@ class OrderItemDao
"trade_order_number" => $param['trade_order_number'],
"purchase_user_id" => $param['purchase_user_id'],
"purchase_user" => $param['purchase_user'],
"supplier_id" => $param['supplier_id'],
"supplier_name" => $param['supplier_name'],
"del_flag"=>0
];
$model = new OrderItem();


+ 3
- 22
application/admin/dao/PurchaseDao.php View File

@@ -24,13 +24,6 @@ class PurchaseDao
*/
public function saveHotelPurchase($param,$hotelOrder):array {
try {
//1.获取供应商名称
$suplierDao = new CfSuplierInfoDao();
$suplierRe = $suplierDao->getInfoById($param['supplier_id']);
if (!$suplierRe['flag']) {
return $suplierRe;
}

$data = [
"order_id" => $hotelOrder['order_id'],
"prod_type" => 'hotel',
@@ -42,7 +35,7 @@ class PurchaseDao
"check_in_date" => $param['check_in_date'],
"check_out_date" => $param['check_out_date'],
"supplier_id" => $param['supplier_id'],
"supplier_name" => $suplierRe['data']['supplier_name'],
"supplier_name" => $param['supplier_name'],
"purchase_user_id" => $param['purchase_user_id'],
"purchase_user" => $param['purchase_user'],
"del_flag"=>0
@@ -69,18 +62,6 @@ class PurchaseDao
*/
public function saveItemPurchase($param, $itemOrder):array {
try {
//1.获取供应商名称
$suplierDao = new CfSuplierInfoDao();
$suplierRe = $suplierDao->getInfoById($param['supplier_id']);
if (!$suplierRe['flag']) {
return $suplierRe;
}
//2.获取负责人昵称
$adminDao = new AdminDao();
$adminRe = $adminDao->getInfoById($param['purchase_user_id']);
if (!$adminRe['flag']) {
return $adminRe;
}
$data = [
"order_id" => $itemOrder['order_id'],
"prod_type" => 'item',
@@ -90,9 +71,9 @@ class PurchaseDao
"item_unit" => $itemOrder['item_unit'],
"check_in_date" => $param['check_in_date'],
"supplier_id" => $param['supplier_id'],
"supplier_name" => $suplierRe['data']['supplier_name'],
"supplier_name" => $param['supplier_name'],
"purchase_user_id" => $param['purchase_user_id'],
"purchase_user" => $adminRe['data']['nickname'],
"purchase_user" => $param['purchase_user'],
"del_flag"=>0
];
$model = new Purchase();


+ 17
- 2
application/admin/service/OrderMainService.php View File

@@ -4,6 +4,7 @@ namespace app\admin\service;

use app\admin\command\Util;
use app\admin\dao\AdminDao;
use app\admin\dao\CfSuplierInfoDao;
use app\admin\dao\OrderHotelDao;
use app\admin\dao\OrderItemDao;
use app\admin\dao\OrderMainDao;
@@ -48,13 +49,20 @@ class OrderMainService
//循环子订单
foreach ($param['subOrderList'] as $subOrderParam) {
$subOrderParam['group_id'] = $param['group_id'];
//2.获取负责人昵称
//1.获取负责人昵称
$adminDao = new AdminDao();
$adminRe = $adminDao->getInfoById($subOrderParam['purchase_user_id']);
if (!$adminRe['flag']) {
return $adminRe;
}
$subOrderParam['purchase_user'] = $adminRe['data']['nickname'];
//2.获取供应商名称
$suplierDao = new CfSuplierInfoDao();
$suplierRe = $suplierDao->getInfoById($subOrderParam['supplier_id']);
if (!$suplierRe['flag']) {
return $suplierRe;
}
$subOrderParam['supplier_name'] = $suplierRe['data']['supplier_name'];
/**
* 2.添加子订单 有则激活更新、无则添加
*/
@@ -130,13 +138,20 @@ class OrderMainService
{
$orderId = $subOrderParam['order_id'];
$orderMainDao = new OrderMainDao();
//2.获取负责人昵称
//1.获取负责人昵称
$adminDao = new AdminDao();
$adminRe = $adminDao->getInfoById($subOrderParam['purchase_user_id']);
if (!$adminRe['flag']) {
return $adminRe;
}
$subOrderParam['purchase_user'] = $adminRe['data']['nickname'];
//2.获取供应商名称
$suplierDao = new CfSuplierInfoDao();
$suplierRe = $suplierDao->getInfoById($subOrderParam['supplier_id']);
if (!$suplierRe['flag']) {
return $suplierRe;
}
$subOrderParam['supplier_name'] = $suplierRe['data']['supplier_name'];
/**
* 2.添加子订单
*/


+ 6
- 1
application/admin/view/order_main/index.html View File

@@ -174,7 +174,12 @@
<el-table-column prop="customer_name" label="出游人姓名" min-width="40" ></el-table-column>
<el-table-column prop="total_price" label="金额" min-width="30" ></el-table-column>
<el-table-column prop="total_cost" label="成本" min-width="30" ></el-table-column>
<el-table-column prop="profit" label="利润" min-width="30" ></el-table-column>
<el-table-column prop="profit" label="利润" min-width="30" >
<template slot-scope="scope">
<div v-if="scope.row.profit>0" v-html="scope.row.profit"></div>
<div v-if="scope.row.profit<=0" v-html="scope.row.profit" style="color: red"></div>
</template>
</el-table-column>
<el-table-column label="发单状态" min-width="30" :formatter="confirmStatusName"></el-table-column>
<el-table-column prop="payment_order_name" label="付款单" min-width="40" >
<template slot-scope="scope">


Loading…
Cancel
Save