优化后台页面

main
home.fengxinyhyl 10 months ago
parent 7bce2bc7ba
commit d011cb5eed
  1. 14
      app/common/repositories/store/order/StoreOrderCreateRepository.php
  2. 2
      app/controller/admin/order/Order.php
  3. 33
      app/controller/api/Diy.php
  4. 6
      view/admin/src/views/accounts/transferRecord/index.vue
  5. 90
      view/admin/src/views/order/list/index.vue
  6. 65
      view/admin/src/views/order/list/orderDetails.vue
  7. 4
      view/admin/src/views/order/orderCancellate/index.vue

@ -21,13 +21,12 @@ use app\common\repositories\store\product\{
ProductRepository,
StoreDiscountRepository
};
use app\common\repositories\user\{
MemberinterestsRepository,
use app\common\repositories\user\{MemberinterestsRepository,
UserAddressRepository,
UserAssetsRepository,
UserBillRepository,
UserMerchantRepository,
UserRepository
};
UserRepository};
use app\validate\api\{
OrderVirtualFieldValidate,
UserAddressValidate
@ -39,7 +38,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
public function v2CartIdByOrderInfo($user, array $cartId, array $takes = null, array $useCoupon = null, bool $useIntegral = false, int $addressId = null, $createOrder = false)
{
$uid = $user->uid;
$userIntegral = $user->integral;
$assets = app(UserAssetsRepository::class)->assets($uid);
$userIntegral = $assets['integral_buy'];
$key = md5(json_encode(compact('cartId', 'takes', 'useCoupon', 'useIntegral', 'addressId'))) . $uid;
//去掉过期的优惠券信息
@ -1037,6 +1037,10 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$rate = bcmul($merchantCart['merchantCategory']['commission_rate'], 100, 4);
}
$user_address = isset($address) ? ($address['province'] . $address['city'] . $address['district'] . $address['street'] . $address['detail']) : '';
if($merchantCart['order']['total_integral']){
$pay_type = 7;
}
$pay_type = 7;
//整理订单数据
$_order = [
'cartInfo' => $merchantCart,

@ -75,7 +75,7 @@ class Order extends BaseController
[$page, $limit] = $this->getPage();
$where = $this->request->params(['type', 'date', 'mer_id', 'keywords', 'status', 'username', 'order_sn', 'is_trader', 'activity_type', 'group_order_sn', 'store_name', 'spread_name', 'top_spread_name', 'filter_delivery', 'filter_product']);
$pay_type = $this->request->param('pay_type', '');
if ($pay_type != '') $where['pay_type'] = $this->repository::PAY_TYPE_FILTEER[$pay_type];
if ($pay_type != '') $where['pay_type'] = $pay_type;
$where['is_spread'] = $this->request->param('is_spread', 0);
$data = $this->repository->adminGetList($where, $page, $limit);
return app('json')->success($data);

@ -22,9 +22,11 @@ use app\common\repositories\store\product\SpuRepository;
use app\common\repositories\store\StoreCategoryRepository;
use app\common\repositories\store\StoreSeckillTimeRepository;
use app\common\repositories\system\merchant\MerchantRepository;
use app\controller\admin\points\Product;
use crmeb\basic\BaseController;
use think\App;
use think\facade\Cache;
use think\facade\Log;
class Diy extends BaseController
{
@ -184,20 +186,23 @@ class Diy extends BaseController
*/
public function spu(SpuRepository $repository)
{
$data = $this->cache(function() use($repository) {
$where = $this->request->params(['cate_pid','product_ids','mer_id','mer_cate_id']);
$limit = (int)$this->request->param('limit',10);
$where['spu_status'] = 1;
$where['mer_status'] = 1;
$where['not_type'] = [20];
$where['is_gift_bag'] = 0;
$where['product_type'] = 0;
$list = $repository->search($where)->with(['merchant'=> function($query){
$query->with(['typeName','categoryName'])->field('mer_id,category_id,type_id,mer_avatar,mer_name,is_trader');
},'issetCoupon'])->limit($limit)->select();
if ($list) $data['list'] = $list->toArray();
return $data;
});
$productList = app(ProductRepository::class)->selectWhere(['is_good' => 1], 'product_id');
$productIdArr = $productList->isEmpty() ? [] : array_column($productList->toArray(), 'product_id');
Log::info('productList'.json_encode($productIdArr));
Log::info('=============================productList');
$where = $this->request->params(['cate_pid','product_ids','mer_id','mer_cate_id']);
$limit = (int)$this->request->param('limit',10);
$where['spu_status'] = 1;
$where['mer_status'] = 1;
$where['not_type'] = [20];
$where['is_gift_bag'] = 0;
$where['product_type'] = 0;
$where['product_ids'] = $productIdArr;
$list = $repository->search($where)->with(['merchant'=> function($query){
$query->with(['typeName','categoryName'])->field('mer_id,category_id,type_id,mer_avatar,mer_name,is_trader');
},'issetCoupon'])->limit($limit)->select();
if ($list) $data['list'] = $list->toArray();
return app('json')->success($data);
}

@ -100,11 +100,11 @@
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<cards-data v-if="cardLists.length>0" :card-lists="cardLists" />
<!-- <cards-data v-if="cardLists.length>0" :card-lists="cardLists" />-->
<el-card>
<div class="mb20">
<el-button size="small" type="primary" @click="exports">导出列表</el-button>
@ -452,7 +452,7 @@ export default {
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return

@ -42,23 +42,7 @@
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="活动类型:" prop="activity_type">
<el-select
v-model="tableFrom.activity_type"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1),getCardList()"
>
<el-option
v-for="item in activity"
:key="item.type"
:label="item.name"
:value="item.type"
/>
</el-select>
</el-form-item>
<el-form-item label="商户名称:" prop="mer_id">
<el-select
v-model="tableFrom.mer_id"
@ -76,18 +60,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="商户类别:" prop="is_trader">
<el-select
v-model="tableFrom.is_trader"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1),getCardList()"
>
<el-option label="自营" value="1" />
<el-option label="非自营" value="0" />
</el-select>
</el-form-item>
<el-form-item label="商品名称:" prop="store_name">
<el-input
v-model="tableFrom.store_name"
@ -105,43 +78,11 @@
class="selWidth"
@change="getList(1),getCardList()"
>
<el-option label="余额" value="0" />
<el-option label="微信" value="1" />
<el-option label="支付宝" value="2" />
<el-option label="积分" value="7" />
</el-select>
</el-form-item>
<el-form-item label="发货方式:" prop="filter_delivery">
<el-select
v-model="tableFrom.filter_delivery"
placeholder="请选择"
class="selWidth"
clearable
@change="getList(1),getCardList()"
>
<el-option
v-for="item in dliveryWayList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="商品类型:" prop="filter_product">
<el-select
v-model="tableFrom.filter_product"
placeholder="请选择"
class="selWidth"
clearable
@change="getList(1),getCardList()"
>
<el-option
v-for="item in productTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字:" prop="keywords">
<el-input
v-model="tableFrom.keywords"
@ -167,15 +108,15 @@
placeholder="请输入用户昵称/手机号"
class="selWidth"
clearable
/>
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<cards-data v-if="cardLists.length>0" :card-lists="cardLists" />
<!-- <cards-data v-if="cardLists.length>0" :card-lists="cardLists" />-->
<el-card>
<el-button size="small" type="primary" class="mb20" @click="exports">导出列表</el-button>
<el-table
@ -213,16 +154,7 @@
<span v-show="scope.row.is_del > 0" style="color: #ED4014;display: block;">用户已删除</span>
</template>
</el-table-column>
<el-table-column label="用户信息" min-width="130">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native="onUserDetails(scope.row.uid)">{{scope.row.user&&scope.row.user.nickname +'/'+ scope.row.uid}}</el-button>
</template>
</el-table-column>
<el-table-column label="订单类型" min-width="80">
<template slot-scope="scope">
<span>{{ scope.row.is_virtual == 1 ? "虚拟订单" : scope.row.order_type == 0 ? "普通订单" : "核销订单" }}</span>
</template>
</el-table-column>
<el-table-column prop="real_name" label="收货人/订购人" min-width="120" />
<el-table-column label="商户名称" min-width="100">
<template slot-scope="scope">
@ -261,10 +193,10 @@
<p v-if="scope.row.finalOrder">尾款{{ scope.row.finalOrder.pay_price }}</p>
</template>
</el-table-column>
<el-table-column prop="integral" label="支付积分" min-width="120" />
<el-table-column label="支付类型" min-width="80">
<template slot-scope="scope">
<span v-if="scope.row.paid === 1">{{ scope.row.pay_type | orderPayType }}</span>
<span v-else>--</span>
<span>{{ scope.row.pay_type == 2 ? '微信' : '积分' }}</span>
</template>
</el-table-column>
<el-table-column label="支付状态" min-width="80">
@ -636,7 +568,7 @@ export default {
<style lang="scss" scoped>
.demo-table-expand ::v-deep label {
width: 83px !important;
width: 83px !important;
}
.el-dropdown-link {
cursor: pointer;

@ -35,6 +35,10 @@
<div class="title">实际支付</div>
<div>¥ {{ orderDetailList.pay_price }}</div>
</li>
<li class="item">
<div class="title">支付积分</div>
<div>{{ orderDetailList.integral }}</div>
</li>
<li class="item">
<div class="title">支付方式</div>
<div>{{ orderDetailList.pay_type | payTypeFilter }}</div>
@ -101,22 +105,16 @@
<div>实际支付</div>
<div class="value">{{ orderDetailList.finalOrder ? (parseFloat(orderDetailList.finalOrder.pay_price) + parseFloat(orderDetailList.pay_price)) : orderDetailList.pay_price }}</div>
</li>
<li class="item">
<div>优惠券金额</div>
<div class="value">{{ orderDetailList.coupon_price ? orderDetailList.coupon_price : '-' }}</div>
</li>
<li v-if="orderDetailList.integral" class="item">
<div>积分抵扣</div>
<div class="value">使用了{{ orderDetailList.integral }}个积分抵扣了{{ orderDetailList.integral_price }}</div>
<div>支付积分</div>
<div class="value">{{ orderDetailList.integral }}</div>
</li>
<li class="item">
<div>订单总价</div>
<div class="value">{{ orderDetailList.total_price ? orderDetailList.total_price : '-' }}</div>
</li>
<li class="item" v-if="orderDetailList.svip_discount">
<div>会员商品优惠</div>
<div class="value">{{ orderDetailList.svip_discount }}</div>
</li>
<li class="item">
<div>发货方式</div>
<div v-if="orderDetailList.order_type == 1" class="value">核销</div>
@ -126,36 +124,8 @@
<div>支付运费</div>
<div class="value">{{ orderDetailList.pay_postage }}</div>
</li>
<li class="item">
<div>一级佣金</div>
<div class="value">
{{ parseFloat(orderDetailList.extension_one) + parseFloat(orderDetailList.refund_extension_one) }}
<em v-if="orderDetailList.refund_extension_one > 0" style="color: red;font-style: normal;">(-{{ orderDetailList.refund_extension_one }})</em>
</div>
</li>
<li class="item">
<div>二级佣金</div>
<div class="value">
{{ parseFloat(orderDetailList.extension_two) + parseFloat(orderDetailList.refund_extension_two) }}
<em v-if="orderDetailList.refund_extension_two > 0" style="color: red;font-style: normal;">(-{{ orderDetailList.refund_extension_two }})</em>
</div>
</li>
<li class="item">
<div>推广人</div>
<div class="value">{{ orderDetailList.spread&&orderDetailList.spread.nickname || "无" }}</div>
</li>
<li class="item">
<div>上级推广人</div>
<div class="value">{{ orderDetailList.TopSpread&&orderDetailList.TopSpread.nickname || "无" }}</div>
</li>
<li class="item">
<div>商品类型</div>
<div class="value">{{ orderDetailList.is_virtual==1 ? '虚拟商品' : orderDetailList.is_virtual==2 ? '卡密商品' : '普通商品' }}</div>
</li>
<li class="item">
<div>活动类型</div>
<div class="value">{{ orderDetailList.activity_type == 1 ? '秒杀' : orderDetailList.activity_type == 2 ? '预售' : orderDetailList.activity_type == 3 ? '助力' : orderDetailList.activity_type == 4 ? '拼团' : '普通' }}</div>
</li>
</ul>
</div>
<div class="section" v-if="orderDetailList.delivery_type === '1'">
@ -189,7 +159,7 @@
</ul>
</div>
</template>
</el-tab-pane>
<el-tab-pane label="商品信息" name="goods">
<template v-if="activeName == 'goods'">
@ -241,6 +211,15 @@
</div>
</template>
</el-table-column>
<el-table-column label="支付积分" min-width="90">
<template slot-scope="scope">
<div class="tab">
<div class="line1">
{{ scope.row.integral ? scope.row.integral : '-' }}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="购买数量" min-width="90">
<template slot-scope="scope">
<div class="tab">
@ -361,7 +340,7 @@
</span>
</div>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="实际支付" min-width="80" align="center">
<template slot-scope="scope">
<span>{{ scope.row.pay_price }}</span>
@ -395,7 +374,7 @@
</li>
</ul>
</div>
</template>
</template>
</el-tab-pane>
</el-tabs>
</div>

@ -48,11 +48,11 @@
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1),getCardList()">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<cards-data v-if="cardLists.length>0" :card-lists="cardLists" />
<!-- <cards-data v-if="cardLists.length>0" :card-lists="cardLists" />-->
<el-card class="box-card">
<el-table
v-loading="listLoading"

Loading…
Cancel
Save