商户信息优化

main
fengxinyhyl 7 months ago
parent 139b7261a3
commit ad8905312f
  1. 28
      app/common/repositories/system/merchant/FinancialRecordRepository.php
  2. 2
      app/common/repositories/system/merchant/MerchantCategoryRepository.php
  3. 2
      app/controller/admin/system/merchant/Merchant.php
  4. 2
      app/controller/api/Auth.php
  5. 5
      view/admin/src/views/merchant/classify/index.vue
  6. 130
      view/admin/src/views/merchant/list/handle/merEditForm.vue
  7. 197
      view/admin/src/views/merchant/list/handle/merInfo.vue
  8. 18
      view/admin/src/views/merchant/list/index.vue

@ -17,8 +17,10 @@ namespace app\common\repositories\system\merchant;
use app\common\dao\system\merchant\FinancialRecordDao;
use app\common\repositories\BaseRepository;
use app\common\repositories\store\order\StoreOrderRepository;
use app\common\repositories\user\UserAssetsRepository;
use app\common\repositories\user\UserBillRepository;
use app\common\repositories\user\UserRechargeRepository;
use app\common\repositories\user\UserRepository;
use think\facade\Cache;
use think\facade\Db;
@ -39,6 +41,32 @@ class FinancialRecordRepository extends BaseRepository
$this->dao = $dao;
}
public function getMerchantStatistics($where){
//商户收入
$count = $this->dao->search($where)->where('financial_type','in',['order','mer_presell'])->sum('number');
//商户余额
$mer_money = app()->make(MerchantRepository::class)->search(['mer_id' => $where['mer_id']])->value('mer_money');
//最低提现额度
$extract_minimum_line = systemConfig('extract_minimum_line');
//商户可提现金额
$_line = bcsub($mer_money,$extract_minimum_line,2);
$_line = max($_line, 0);
//退款支出金额
$refund_order = $this->dao->search($where)->where('financial_type','refund_order')->sum('number');
//商户冻结金额
$merLockMoney = app()->make(UserBillRepository::class)->merchantLickMoney($where['mer_id']);
return array(
'total' => $count,
'mer_money' => $mer_money,
'frozen_money' => $merLockMoney,
'refund_money' => $refund_order,
'available_money' => $_line,
);
}
/**
* TODO 列表
* @param array $where

@ -83,7 +83,7 @@ class MerchantCategoryRepository extends BaseRepository
$form = Elm::createForm($action, [
Elm::input('category_name', '分类名称:')->placeholder('请输入分类名称')->required(),
Elm::number('commission_rate', '手续费(%):', 0)->required()->max(100)->precision(2)
// Elm::number('commission_rate', '手续费(%):', 0)->required()->max(100)->precision(2)
]);
return $form->formData($formData)->setTitle(is_null($id) ? '添加商户分类' : '编辑商户分类');

@ -16,6 +16,7 @@ namespace app\controller\admin\system\merchant;
use app\common\repositories\store\product\ProductCopyRepository;
use app\common\repositories\store\service\StoreServiceRepository;
use app\common\repositories\system\merchant\FinancialRecordRepository;
use app\common\repositories\system\merchant\MerchantTypeRepository;
use app\common\repositories\system\operate\OperateLogRepository;
use app\common\repositories\user\UserBillRepository;
@ -355,6 +356,7 @@ class Merchant extends BaseController
public function detail($id)
{
$data = $this->repository->adminDetail($id);
$data['assets'] = \app(FinancialRecordRepository::class)->getMerchantStatistics(array('mer_id' => $id));
return app('json')->success($data);
}

@ -190,6 +190,8 @@ class Auth extends BaseController
// 用户资产
$assets = app(UserAssetsRepository::class)->assets($data['uid']);
$data['assets'] = $assets;
$data['service'] = null;
$data['topService'] = null;
return app('json')->success($data);
}

@ -20,11 +20,6 @@
label="分类名称"
min-width="150"
/>
<el-table-column
prop="commission_rate"
label="手续费"
min-width="130"
/>
<el-table-column
prop="create_time"
label="创建时间"

@ -133,48 +133,48 @@
</div>
</el-tab-pane>
<el-tab-pane label="经营信息" name="operate">
<div class="section">
<div class="title">费用信息</div>
<el-row :gutter="24" class="mt20">
<el-col v-if="!isAdd" :span="24">
<el-form-item label="店铺保证金:" prop="ot_margin">
<span>{{merData.is_margin == 0 ? '无' : merData.ot_margin+'元'}}</span>
</el-form-item>
</el-col>
<el-col v-if="!isAdd && merData.is_margin != 0" :span="24">
<el-form-item label="保证金支付状态:">
<span>{{merData.is_margin == 1 ? '待缴' : merData.is_margin == 0 ? '无' : '已缴' }}</span>
</el-form-item>
</el-col>
<el-col v-if="!isAdd && merData.is_margin != 0" :span="24">
<el-form-item label="保证金余额:">
<span>{{merData.margin}}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="手续费设置:" prop="commission_rate">
<el-switch
v-model="merData.commission_switch"
:active-value="1"
:inactive-value="0"
:width="55"
active-text="开启"
inactive-text="关闭"
/>
<span v-if="merData.commission_switch">
<el-input-number
:min="0"
v-model="merData.commission_rate"
size="small"
controls-position="right"
placeholder="请输入手续费"
/>%
</span>
<div class="info info-red">(此处如未设置手续费系统会自动读取商户分类下对应手续费此处已设置则优先以此处设置为准)</div>
</el-form-item>
</el-col>
</el-row>
</div>
<!-- <div class="section">-->
<!-- <div class="title">费用信息</div>-->
<!-- <el-row :gutter="24" class="mt20">-->
<!-- <el-col v-if="!isAdd" :span="24">-->
<!-- <el-form-item label="店铺保证金:" prop="ot_margin">-->
<!-- <span>{{merData.is_margin == 0 ? '无' : merData.ot_margin+'元'}}</span>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col v-if="!isAdd && merData.is_margin != 0" :span="24">-->
<!-- <el-form-item label="保证金支付状态:">-->
<!-- <span>{{merData.is_margin == 1 ? '待缴' : merData.is_margin == 0 ? '无' : '已缴' }}</span>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col v-if="!isAdd && merData.is_margin != 0" :span="24">-->
<!-- <el-form-item label="保证金余额:">-->
<!-- <span>{{merData.margin}}</span>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="手续费设置:" prop="commission_rate">-->
<!-- <el-switch-->
<!-- v-model="merData.commission_switch"-->
<!-- :active-value="1"-->
<!-- :inactive-value="0"-->
<!-- :width="55"-->
<!-- active-text="开启"-->
<!-- inactive-text="关闭"-->
<!-- />-->
<!-- <span v-if="merData.commission_switch">-->
<!-- <el-input-number-->
<!-- :min="0"-->
<!-- v-model="merData.commission_rate"-->
<!-- size="small"-->
<!-- controls-position="right"-->
<!-- placeholder="请输入手续费"-->
<!-- />%-->
<!-- </span> -->
<!-- <div class="info info-red">(此处如未设置手续费系统会自动读取商户分类下对应手续费此处已设置则优先以此处设置为准)</div>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<div class="section">
<div class="title">审核信息</div>
<el-row :gutter="24" class="mt20">
@ -190,30 +190,6 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="直播间审核:" prop="is_bro_room">
<el-switch
v-model="merData.is_bro_room"
:active-value="1"
:inactive-value="0"
:width="50"
active-text="是"
inactive-text="否"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="直播商品:" prop="is_bro_goods">
<el-switch
v-model="merData.is_bro_goods"
:active-value="1"
:inactive-value="0"
:width="50"
active-text="是"
inactive-text="否"
/>
</el-form-item>
</el-col>
</el-row>
</div>
<div class="section">
@ -231,15 +207,8 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="!isAdd" :gutter="24">
<el-col :span="12" style="position: relative;">
<el-form-item label="商品采集数:">
<el-input v-model="merData.copy_product_num" size="small" disabled ></el-input>
<el-button type="text" @click="modifyCopy" style="margin-left: 10px;position:absolute;right: -30px;">修改</el-button>
</el-form-item>
</el-col>
</el-row>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="账号信息" name="account">
@ -310,9 +279,9 @@
</el-row>
</div>
</el-tab-pane>
</el-tabs>
</el-tabs>
</el-form>
</template>
<script>
// +----------------------------------------------------------------------
@ -343,7 +312,7 @@ export default {
type: Array,
default: [],
}
},
},
data() {
const validatePhone = (rule, value, callback) => {
if (!value) {
@ -378,7 +347,7 @@ export default {
},
filters: {
},
mounted() {
mounted() {
},
methods: {
@ -406,7 +375,7 @@ export default {
this.loading = false;
this.$message.error(res.message);
});
}
}
});
},
/**创建商户 */
@ -508,4 +477,3 @@ export default {
}
</style>

@ -19,7 +19,7 @@
<div>商户分类</div>
<div v-if="merData.merchantCategory" class="value">
{{merData.merchantCategory.category_name}}
<span class="info info-red">(该分类下的商户手续费是{{merData.merchantCategory.commission_rate*100}}%)</span>
<!-- <span class="info info-red">(该分类下的商户手续费是{{merData.merchantCategory.commission_rate*100}}%)</span>-->
</div>
</li>
<li class="item">
@ -50,40 +50,40 @@
</div>
</el-tab-pane>
<el-tab-pane label="经营信息" name="business">
<div class="section">
<div class="title">费用信息</div>
<ul class="list">
<li class="item item100">
<div>手续费单独设置</div>
<div class="value">
{{merData.commission_switch ? "开启" : "关闭"}}
</div>
</li>
<li v-if="merData.commission_switch" class="item item100">
<div>手续费</div>
<div class="value">
{{ merData.commission_rate}}%
<span class="info info-red">(此处如未设置手续费系统会自动读取商户分类下对应手续费此处已设置则优先以此处设置为准)</span>
</div>
</li>
<li class="item">
<div>店铺保证金</div>
<div class="value">
{{merData.is_margin == 0 ? '无' : merData.ot_margin}}
</div>
</li>
<li v-if="merData.is_margin != 0" class="item">
<div>保证金支付状态</div>
<div class="value">{{merData.is_margin == 1 ? '待缴' : merData.is_margin == 0 ? '无' : '已缴' }}
<span v-if="(merData.is_margin==10 && merData.margin-merData.ot_margin<0)" class="info-red">(需补缴)</span>
</div>
</li>
<li v-if="merData.is_margin != 0" class="item">
<div>保证金余额</div>
<div class="value">{{merData.margin}}</div>
</li>
</ul>
</div>
<!-- <div class="section">-->
<!-- <div class="title">费用信息</div>-->
<!-- <ul class="list">-->
<!-- <li class="item item100">-->
<!-- <div>手续费单独设置</div>-->
<!-- <div class="value">-->
<!-- {{merData.commission_switch ? "开启" : "关闭"}}-->
<!-- </div>-->
<!-- </li> -->
<!-- <li v-if="merData.commission_switch" class="item item100">-->
<!-- <div>手续费</div>-->
<!-- <div class="value">-->
<!-- {{ merData.commission_rate}}%-->
<!-- <span class="info info-red">(此处如未设置手续费系统会自动读取商户分类下对应手续费此处已设置则优先以此处设置为准)</span>-->
<!-- </div>-->
<!-- </li>-->
<!-- <li class="item">-->
<!-- <div>店铺保证金</div>-->
<!-- <div class="value">-->
<!-- {{merData.is_margin == 0 ? '无' : merData.ot_margin}}-->
<!-- </div>-->
<!-- </li>-->
<!-- <li v-if="merData.is_margin != 0" class="item">-->
<!-- <div>保证金支付状态</div>-->
<!-- <div class="value">{{merData.is_margin == 1 ? '待缴' : merData.is_margin == 0 ? '无' : '已缴' }}-->
<!-- <span v-if="(merData.is_margin==10 && merData.margin-merData.ot_margin<0)" class="info-red">(需补缴)</span>-->
<!-- </div>-->
<!-- </li>-->
<!-- <li v-if="merData.is_margin != 0" class="item">-->
<!-- <div>保证金余额</div>-->
<!-- <div class="value">{{merData.margin}}</div>-->
<!-- </li> -->
<!-- </ul>-->
<!-- </div>-->
<div class="section">
<div class="title">审核信息</div>
<ul class="list">
@ -91,14 +91,6 @@
<div>商品审核</div>
<div class="value">{{merData.is_audit == 1 ? '需审核' : '免审核'}}</div>
</li>
<li class="item">
<div>直播间审核</div>
<div class="value">{{merData.is_bro_room == 1 ? '需审核' : '免审核'}}</div>
</li>
<li class="item">
<div>直播商品</div>
<div class="value">{{merData.is_bro_goods == 1 ? '需审核' : '免审核'}}</div>
</li>
</ul>
</div>
<div class="section">
@ -108,22 +100,38 @@
<div>搜索商户关键字</div>
<div class="value">{{merData.mer_keyword}}</div>
</li>
<li class="item item100">
<div>剩余商品采集数</div>
<div class="value">{{merData.copy_product_num}}</div>
</li>
<li class="item item100">
<div>商户资质</div>
<div class="value">
<el-image
v-for="(item, index) in merData.mer_certificate"
:key="index"
:src="item"
v-for="(item, index) in merData.mer_certificate"
:key="index"
:src="item"
@click="lookImg(item)"
style="width: 36px;height: 36px;margin-right: 5px;"
/>
</div>
</li>
<li class="item item100">
<div>商户收入</div>
<div class="value">{{merData.assets.total}}</div>
</li>
<li class="item item100">
<div>商户余额</div>
<div class="value">{{merData.assets.mer_money}}</div>
</li>
<li class="item item100">
<div>商户冻结金额</div>
<div class="value">{{merData.assets.frozen_money}}</div>
</li>
<li class="item item100">
<div>商户可提现总金额</div>
<div class="value">{{merData.assets.available_money}}</div>
</li>
<li class="item item100">
<div>商户退款金额</div>
<div class="value">{{merData.assets.refund_money}}</div>
</li>
</ul>
</div>
</el-tab-pane>
@ -140,7 +148,7 @@
<li class="item">
<div>登录密码</div>
<div class="value">{{merData.mer_password}}</div>
</li>
<li class="item">
<div>联系人</div>
@ -149,7 +157,7 @@
<li class="item">
<div>联系电话</div>
<div class="value">{{merData.mer_phone}}</div>
</li>
</li>
<!-- <li class="item">
<div>绑定手机号</div>
<div class="value">{{merData.real_name}}</div>
@ -157,7 +165,7 @@
<li class="item">
<div>绑定微信用户昵称/ID</div>
<div class="value">{{merData.real_name}}</div>
</li> -->
</li> -->
</ul>
</div>
<div v-if="merData.sub_mchid" class="section">
@ -170,90 +178,11 @@
</ul>
</div>
</el-tab-pane>
<el-tab-pane label="操作记录" name="operate">
<div class="section">
<el-form size="small" label-width="80px">
<div class="acea-row">
<el-form-item label="操作端:">
<el-select
v-model="tableFromLog.type"
placeholder="请选择"
style="width: 140px; margin-right: 20px"
clearable
filterable
@change="onOperateLog(merId)"
>
<el-option label="平台端" value="1" />
<el-option label="商户端" value="2" />
</el-select>
</el-form-item>
<el-form-item label="操作时间:">
<el-date-picker
style="width: 380px; margin-right: 20px"
v-model="timeVal"
type="datetimerange"
placeholder="选择日期"
value-format="yyyy/MM/dd HH:mm:ss"
clearable
@change="onchangeTime"
>
</el-date-picker>
</el-form-item>
<!-- <div>
<el-button type="primary" size="small" @click="onOrderLog(orderId)">查询</el-button>
</div> -->
</div>
</el-form>
<el-table :data="tableDataLog.data" size="small">
<el-table-column prop="order_id" label="序号" min-width="80">
<template scope="scope">
<span>{{ scope.$index+(tableFromLog.page - 1) * tableFromLog.limit + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="操作记录" min-width="200">
<template slot-scope="scope">
<span>{{ scope.row.category_name }}</span>
</template>
</el-table-column>
<el-table-column label="操作端" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div>{{ scope.row.type }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作角色" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div>{{ scope.row.operator_role_nickname }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作人" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div>{{ scope.row.operator_nickname }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作时间" min-width="150">
<template slot-scope="scope">
<div class="tab">
<div class="line1">{{ scope.row.create_time }}</div>
</div>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination background :page-size="tableFromLog.limit" :current-page="tableFromLog.page" layout="total, prev, pager, next, jumper" :total="tableDataLog.total" @size-change="handleSizeChangeLog" @current-change="pageChangeLog" />
</div>
</div>
</el-tab-pane>
</el-tabs>
<div class="images" v-show="false" v-viewer="{ movable: false }">
<img v-for="(src,index) in merData.mer_certificate" :src="src" :key="index" />
</div>
</div>
</div>
</div>
</template>
<script>
// +----------------------------------------------------------------------

@ -82,7 +82,7 @@
</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>
@ -134,15 +134,15 @@
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="150" />
<el-table-column prop="margin" label="保证金" min-width="150">
<template slot-scope="scope">
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="margin" label="保证金" min-width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>-->
<!-- -->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="sort" label="排序" min-width="100" />
<el-table-column prop="mark" label="备注" min-width="200" />
<el-table-column label="操作" min-width="150" fixed="right">
<template slot-scope="scope">
<el-button
@ -395,7 +395,7 @@ export default {
this.drawer = false;
},
//
handleDelete(id) {
handleDelete(id) {
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
},
//

Loading…
Cancel
Save