|
|
@ -25,38 +25,6 @@ |
|
|
@keyup.enter.native="handleQuery" |
|
|
@keyup.enter.native="handleQuery" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- <el-form-item label="关联用户ID" prop="userId">--> |
|
|
|
|
|
<!-- <el-input--> |
|
|
|
|
|
<!-- v-model="queryParams.userId"--> |
|
|
|
|
|
<!-- placeholder="请输入关联用户ID"--> |
|
|
|
|
|
<!-- clearable--> |
|
|
|
|
|
<!-- @keyup.enter.native="handleQuery"--> |
|
|
|
|
|
<!-- />--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- <el-form-item label="创建时间" prop="createdAt">--> |
|
|
|
|
|
<!-- <el-date-picker clearable--> |
|
|
|
|
|
<!-- v-model="queryParams.createdAt"--> |
|
|
|
|
|
<!-- type="date"--> |
|
|
|
|
|
<!-- value-format="yyyy-MM-dd"--> |
|
|
|
|
|
<!-- placeholder="请选择创建时间">--> |
|
|
|
|
|
<!-- </el-date-picker>--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- <el-form-item label="更新时间" prop="updatedAt">--> |
|
|
|
|
|
<!-- <el-date-picker clearable--> |
|
|
|
|
|
<!-- v-model="queryParams.updatedAt"--> |
|
|
|
|
|
<!-- type="date"--> |
|
|
|
|
|
<!-- value-format="yyyy-MM-dd"--> |
|
|
|
|
|
<!-- placeholder="请选择更新时间">--> |
|
|
|
|
|
<!-- </el-date-picker>--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- <el-form-item label="是否启用" prop="isActive">--> |
|
|
|
|
|
<!-- <el-input--> |
|
|
|
|
|
<!-- v-model="queryParams.isActive"--> |
|
|
|
|
|
<!-- placeholder="请输入是否启用"--> |
|
|
|
|
|
<!-- clearable--> |
|
|
|
|
|
<!-- @keyup.enter.native="handleQuery"--> |
|
|
|
|
|
<!-- />--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
@ -74,6 +42,18 @@ |
|
|
v-hasPermi="['vet:merchant:add']" |
|
|
v-hasPermi="['vet:merchant:add']" |
|
|
>店铺资质</el-button> |
|
|
>店铺资质</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<!-- 审核按钮 --> |
|
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
plain |
|
|
|
|
|
icon="el-icon-finished" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
:disabled="single" |
|
|
|
|
|
@click="handleAuditDialog" |
|
|
|
|
|
v-hasPermi="['vet:merchant:audit']" |
|
|
|
|
|
>审核</el-button> |
|
|
|
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="success" |
|
|
type="success" |
|
|
@ -111,50 +91,47 @@ |
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="merchantList" @selection-change="handleSelectionChange"> |
|
|
<el-table v-loading="loading" :data="merchantList" @selection-change="handleSelectionChange"> |
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
<!-- <el-table-column label="店铺ID,主键" align="center" prop="shopId" />--> |
|
|
|
|
|
<el-table-column label="店铺logo" align="center" prop="shopLogo" width="100"> |
|
|
<el-table-column label="店铺logo" align="center" prop="shopLogo" width="100"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<image-preview :src="scope.row.shopLogo" :width="50" :height="50"/> |
|
|
<image-preview :src="scope.row.shopLogo" :width="50" :height="50"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="店铺名称" align="center" prop="shopName"/> |
|
|
|
|
|
|
|
|
<el-table-column label="店铺名称" align="center" prop="shopName" min-width="120" show-overflow-tooltip/> |
|
|
<el-table-column label="店铺地址" align="center" prop="shopAddress" width="150" :show-overflow-tooltip="true"/> |
|
|
<el-table-column label="店铺地址" align="center" prop="shopAddress" width="150" :show-overflow-tooltip="true"/> |
|
|
<el-table-column label="联系电话" align="center" prop="phone" width="200"/> |
|
|
|
|
|
|
|
|
<el-table-column label="联系电话" align="center" prop="phone" width="120"/> |
|
|
<el-table-column label="营业执照" align="center" prop="businessLicenseImage" width="100"> |
|
|
<el-table-column label="营业执照" align="center" prop="businessLicenseImage" width="100"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<image-preview :src="scope.row.businessLicenseImage" :width="50" :height="50"/> |
|
|
<image-preview :src="scope.row.businessLicenseImage" :width="50" :height="50"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="审核状态" prop="auditStatus" width="120" align="center"> |
|
|
|
|
|
|
|
|
<!-- 产品数量列 --> |
|
|
|
|
|
<el-table-column label="产品数量" align="center" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag size="small" :type="scope.row.productCount > 0 ? 'success' : 'info'"> |
|
|
|
|
|
{{ scope.row.productCount || 0 }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="审核状态" prop="auditStatus" width="100" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-tag :type="getAuditStatusTagType(scope.row.auditStatus)" size="small"> |
|
|
<el-tag :type="getAuditStatusTagType(scope.row.auditStatus)" size="small"> |
|
|
{{ getAuditStatusText(scope.row.auditStatus) }} |
|
|
{{ getAuditStatusText(scope.row.auditStatus) }} |
|
|
</el-tag> |
|
|
</el-tag> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<!-- <el-table-column label="关联用户ID" align="center" prop="userId" />--> |
|
|
|
|
|
<!-- <el-table-column label="创建时间" align="center" prop="createdAt" width="180">--> |
|
|
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
|
|
<!-- <span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>--> |
|
|
|
|
|
<!-- </template>--> |
|
|
|
|
|
<!-- </el-table-column>--> |
|
|
|
|
|
<!-- <el-table-column label="更新时间" align="center" prop="updatedAt" width="180">--> |
|
|
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
|
|
<!-- <span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>--> |
|
|
|
|
|
<!-- </template>--> |
|
|
|
|
|
<!-- </el-table-column>--> |
|
|
|
|
|
<!-- <el-table-column label="是否启用" align="center" prop="isActive"/>--> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="300"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="350"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<!-- 查看产品按钮 - 审核通过后才显示 --> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="text" |
|
|
type="text" |
|
|
icon="el-icon-view" |
|
|
icon="el-icon-view" |
|
|
@click="handleView(scope.row)" |
|
|
|
|
|
|
|
|
@click="handleViewProducts(scope.row)" |
|
|
class="info-btn view-btn" |
|
|
class="info-btn view-btn" |
|
|
v-if="scope.row.auditStatus === '2'" |
|
|
v-if="scope.row.auditStatus === '2'" |
|
|
>详情</el-button> |
|
|
|
|
|
|
|
|
>查看产品</el-button> |
|
|
|
|
|
<!-- 修改按钮 --> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="text" |
|
|
type="text" |
|
|
@ -165,6 +142,7 @@ |
|
|
v-if="scope.row.auditStatus === '0' || scope.row.auditStatus === '3'" |
|
|
v-if="scope.row.auditStatus === '0' || scope.row.auditStatus === '3'" |
|
|
class="info-btn alter-btn" |
|
|
class="info-btn alter-btn" |
|
|
>修改</el-button> |
|
|
>修改</el-button> |
|
|
|
|
|
<!-- 删除按钮 --> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="text" |
|
|
type="text" |
|
|
@ -174,6 +152,18 @@ |
|
|
v-hasPermi="['vet:merchant:remove']" |
|
|
v-hasPermi="['vet:merchant:remove']" |
|
|
class="info-btn delete-btn" |
|
|
class="info-btn delete-btn" |
|
|
>删除</el-button> |
|
|
>删除</el-button> |
|
|
|
|
|
<!-- 审核按钮(管理员可见,审核中状态) --> |
|
|
|
|
|
<el-button |
|
|
|
|
|
size="mini" |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="el-icon-finished" |
|
|
|
|
|
style="color: #072eed" |
|
|
|
|
|
@click="handleSingleAudit(scope.row)" |
|
|
|
|
|
v-hasPermi="['vet:merchant:audit']" |
|
|
|
|
|
v-if="scope.row.auditStatus === '1' && isAdmin" |
|
|
|
|
|
class="info-btn audit-btn" |
|
|
|
|
|
>审核</el-button> |
|
|
|
|
|
<!-- 提交审核按钮(待审核状态) --> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="text" |
|
|
type="text" |
|
|
@ -183,9 +173,8 @@ |
|
|
v-hasPermi="['vet:product:submit']" |
|
|
v-hasPermi="['vet:product:submit']" |
|
|
v-if="scope.row.auditStatus === '0'" |
|
|
v-if="scope.row.auditStatus === '0'" |
|
|
class="info-btn submit-btn" |
|
|
class="info-btn submit-btn" |
|
|
> |
|
|
|
|
|
提交审核 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
|
>提交审核</el-button> |
|
|
|
|
|
<!-- 取消审核按钮(审核中状态,非管理员可见) --> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="text" |
|
|
type="text" |
|
|
@ -193,11 +182,10 @@ |
|
|
style="color: #5607b3" |
|
|
style="color: #5607b3" |
|
|
@click="handleCancelAudit(scope.row)" |
|
|
@click="handleCancelAudit(scope.row)" |
|
|
v-hasPermi="['vet:product:edit']" |
|
|
v-hasPermi="['vet:product:edit']" |
|
|
v-if="scope.row.auditStatus === '1'" |
|
|
|
|
|
|
|
|
v-if="scope.row.auditStatus === '1' && !isAdmin" |
|
|
class="info-btn cancel-btn" |
|
|
class="info-btn cancel-btn" |
|
|
> |
|
|
|
|
|
取消审核 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
|
>取消审核</el-button> |
|
|
|
|
|
<!-- 重新提交按钮(审核拒绝状态) --> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="text" |
|
|
type="text" |
|
|
@ -207,9 +195,7 @@ |
|
|
v-hasPermi="['vet:product:submit']" |
|
|
v-hasPermi="['vet:product:submit']" |
|
|
v-if="scope.row.auditStatus === '3'" |
|
|
v-if="scope.row.auditStatus === '3'" |
|
|
class="info-btn resubmit-btn" |
|
|
class="info-btn resubmit-btn" |
|
|
> |
|
|
|
|
|
重新提交 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
|
>重新提交</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
@ -240,28 +226,6 @@ |
|
|
<el-form-item label="营业执照" prop="businessLicenseImage"> |
|
|
<el-form-item label="营业执照" prop="businessLicenseImage"> |
|
|
<image-upload :limit=1 v-model="form.businessLicenseImage"/> |
|
|
<image-upload :limit=1 v-model="form.businessLicenseImage"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- <el-form-item label="关联用户ID" prop="userId">--> |
|
|
|
|
|
<!-- <el-input v-model="form.userId" placeholder="请输入关联用户ID" />--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- <el-form-item label="创建时间" prop="createdAt">--> |
|
|
|
|
|
<!-- <el-date-picker clearable--> |
|
|
|
|
|
<!-- v-model="form.createdAt"--> |
|
|
|
|
|
<!-- type="date"--> |
|
|
|
|
|
<!-- value-format="yyyy-MM-dd"--> |
|
|
|
|
|
<!-- placeholder="请选择创建时间">--> |
|
|
|
|
|
<!-- </el-date-picker>--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- <el-form-item label="更新时间" prop="updatedAt">--> |
|
|
|
|
|
<!-- <el-date-picker clearable--> |
|
|
|
|
|
<!-- v-model="form.updatedAt"--> |
|
|
|
|
|
<!-- type="date"--> |
|
|
|
|
|
<!-- value-format="yyyy-MM-dd"--> |
|
|
|
|
|
<!-- placeholder="请选择更新时间">--> |
|
|
|
|
|
<!-- </el-date-picker>--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
<!-- <el-form-item label="是否启用" prop="isActive">--> |
|
|
|
|
|
<!-- <el-input v-model="form.isActive" placeholder="请输入是否启用" />--> |
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
@ -269,26 +233,129 @@ |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 详情弹窗 --> |
|
|
|
|
|
|
|
|
<!-- 店铺产品列表弹窗 --> |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="产品信息" |
|
|
|
|
|
:visible.sync="replyOpen" |
|
|
|
|
|
width="80%" |
|
|
|
|
|
|
|
|
:title="'【' + currentShopName + '】的产品列表'" |
|
|
|
|
|
:visible.sync="productDialogVisible" |
|
|
|
|
|
width="95%" |
|
|
append-to-body |
|
|
append-to-body |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
|
|
|
@closed="handleProductDialogClose" |
|
|
|
|
|
destroy-on-close |
|
|
> |
|
|
> |
|
|
|
|
|
<!-- 传递 shopId 给产品组件 --> |
|
|
<product-list |
|
|
<product-list |
|
|
:shop-id="shopId" |
|
|
|
|
|
v-if="replyOpen" |
|
|
|
|
|
|
|
|
v-if="productDialogVisible" |
|
|
|
|
|
:shop-id="currentShopId" |
|
|
|
|
|
:shop-name="currentShopName" |
|
|
|
|
|
:key="'product_' + currentShopId + '_' + new Date().getTime()" |
|
|
/> |
|
|
/> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 单个审核对话框 --> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="商家审核" |
|
|
|
|
|
:visible.sync="auditDialogVisible" |
|
|
|
|
|
width="500px" |
|
|
|
|
|
append-to-body |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
@closed="resetAuditForm" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form ref="auditFormRef" :model="auditForm" :rules="auditRules" label-width="80px"> |
|
|
|
|
|
<el-form-item label="审核结果" prop="auditStatus"> |
|
|
|
|
|
<el-radio-group v-model="auditForm.auditStatus"> |
|
|
|
|
|
<el-radio |
|
|
|
|
|
v-for="item in auditStatusOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.value" |
|
|
|
|
|
> |
|
|
|
|
|
{{ item.label }} |
|
|
|
|
|
</el-radio> |
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="审核意见" prop="auditOpinion"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="auditForm.auditOpinion" |
|
|
|
|
|
type="textarea" |
|
|
|
|
|
:rows="4" |
|
|
|
|
|
placeholder="请输入审核意见(审核拒绝时必须填写)" |
|
|
|
|
|
maxlength="500" |
|
|
|
|
|
show-word-limit |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="submitAudit" :loading="auditLoading">确 定</el-button> |
|
|
|
|
|
<el-button @click="cancelAudit">取 消</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 批量审核对话框 --> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="批量审核商家" |
|
|
|
|
|
:visible.sync="batchAuditDialogVisible" |
|
|
|
|
|
width="500px" |
|
|
|
|
|
append-to-body |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
@closed="resetBatchAuditForm" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form ref="batchAuditFormRef" :model="batchAuditForm" :rules="batchAuditRules" label-width="80px"> |
|
|
|
|
|
<el-form-item label="审核结果" prop="auditStatus"> |
|
|
|
|
|
<el-radio-group v-model="batchAuditForm.auditStatus"> |
|
|
|
|
|
<el-radio |
|
|
|
|
|
v-for="item in auditStatusOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.value" |
|
|
|
|
|
> |
|
|
|
|
|
{{ item.label }} |
|
|
|
|
|
</el-radio> |
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="审核意见" prop="auditOpinion"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="batchAuditForm.auditOpinion" |
|
|
|
|
|
type="textarea" |
|
|
|
|
|
:rows="4" |
|
|
|
|
|
placeholder="请输入审核意见(审核拒绝时必须填写)" |
|
|
|
|
|
maxlength="500" |
|
|
|
|
|
show-word-limit |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-alert |
|
|
|
|
|
v-if="batchAuditForm.shopIds.length > 0" |
|
|
|
|
|
type="info" |
|
|
|
|
|
:closable="false" |
|
|
|
|
|
style="margin-top: 10px;" |
|
|
|
|
|
> |
|
|
|
|
|
已选择 {{ batchAuditForm.shopIds.length }} 个商家进行批量审核 |
|
|
|
|
|
</el-alert> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="submitBatchAudit" :loading="batchAuditLoading">确 定</el-button> |
|
|
|
|
|
<el-button @click="cancelBatchAudit">取 消</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { listMerchant, getMerchant, delMerchant, addMerchant, updateMerchant, submitAudit, resubmitAudit, cancelAudit } from "@/api/vet/merchant" |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
listMerchant, |
|
|
|
|
|
getMerchant, |
|
|
|
|
|
delMerchant, |
|
|
|
|
|
addMerchant, |
|
|
|
|
|
updateMerchant, |
|
|
|
|
|
submitAudit, |
|
|
|
|
|
resubmitAudit, |
|
|
|
|
|
cancelAudit, |
|
|
|
|
|
auditMerchant, |
|
|
|
|
|
batchAuditMerchant |
|
|
|
|
|
} from "@/api/vet/merchant" |
|
|
import ProductList from '@/views/vet/product/index.vue' |
|
|
import ProductList from '@/views/vet/product/index.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -300,7 +367,9 @@ export default { |
|
|
return { |
|
|
return { |
|
|
// 遮罩层 |
|
|
// 遮罩层 |
|
|
loading: true, |
|
|
loading: true, |
|
|
shopId:null, |
|
|
|
|
|
|
|
|
// 当前店铺信息 |
|
|
|
|
|
currentShopId: null, |
|
|
|
|
|
currentShopName: '', |
|
|
// 选中数组 |
|
|
// 选中数组 |
|
|
ids: [], |
|
|
ids: [], |
|
|
// 非单个禁用 |
|
|
// 非单个禁用 |
|
|
@ -317,8 +386,11 @@ export default { |
|
|
title: "", |
|
|
title: "", |
|
|
// 是否显示弹出层 |
|
|
// 是否显示弹出层 |
|
|
open: false, |
|
|
open: false, |
|
|
// 是否显示详情对话框 |
|
|
|
|
|
replyOpen: false, |
|
|
|
|
|
|
|
|
// 是否显示产品列表对话框 |
|
|
|
|
|
productDialogVisible: false, |
|
|
|
|
|
// 是否为管理员 |
|
|
|
|
|
isAdmin: false, |
|
|
|
|
|
|
|
|
// 查询参数 |
|
|
// 查询参数 |
|
|
queryParams: { |
|
|
queryParams: { |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
@ -331,8 +403,10 @@ export default { |
|
|
updatedAt: null, |
|
|
updatedAt: null, |
|
|
isActive: null |
|
|
isActive: null |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 表单参数 |
|
|
// 表单参数 |
|
|
form: {}, |
|
|
form: {}, |
|
|
|
|
|
|
|
|
// 表单校验 |
|
|
// 表单校验 |
|
|
rules: { |
|
|
rules: { |
|
|
shopName: [ |
|
|
shopName: [ |
|
|
@ -340,23 +414,73 @@ export default { |
|
|
], |
|
|
], |
|
|
shopAddress: [ |
|
|
shopAddress: [ |
|
|
{ required: true, message: "店铺地址不能为空", trigger: "blur" } |
|
|
{ required: true, message: "店铺地址不能为空", trigger: "blur" } |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 审核对话框相关 |
|
|
|
|
|
auditDialogVisible: false, |
|
|
|
|
|
auditForm: { |
|
|
|
|
|
shopId: null, |
|
|
|
|
|
auditStatus: '2', |
|
|
|
|
|
auditOpinion: '' |
|
|
|
|
|
}, |
|
|
|
|
|
auditStatusOptions: [ |
|
|
|
|
|
{ value: '2', label: '审核通过', type: 'success' }, |
|
|
|
|
|
{ value: '3', label: '审核拒绝', type: 'danger' } |
|
|
], |
|
|
], |
|
|
userId: [ |
|
|
|
|
|
{ required: true, message: "关联用户ID不能为空", trigger: "blur" } |
|
|
|
|
|
], |
|
|
|
|
|
createdAt: [ |
|
|
|
|
|
{ required: true, message: "创建时间不能为空", trigger: "blur" } |
|
|
|
|
|
], |
|
|
|
|
|
updatedAt: [ |
|
|
|
|
|
{ required: true, message: "更新时间不能为空", trigger: "blur" } |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
auditRules: { |
|
|
|
|
|
auditOpinion: [ |
|
|
|
|
|
{ |
|
|
|
|
|
validator: (rule, value, callback) => { |
|
|
|
|
|
if (this.auditForm.auditStatus === '3' && (!value || value.trim() === '')) { |
|
|
|
|
|
callback(new Error('审核拒绝时必须填写审核意见')) |
|
|
|
|
|
} else { |
|
|
|
|
|
callback() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
trigger: 'blur' |
|
|
} |
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
auditLoading: false, |
|
|
|
|
|
|
|
|
|
|
|
// 批量审核相关 |
|
|
|
|
|
batchAuditDialogVisible: false, |
|
|
|
|
|
batchAuditForm: { |
|
|
|
|
|
shopIds: [], |
|
|
|
|
|
auditStatus: '2', |
|
|
|
|
|
auditOpinion: '' |
|
|
|
|
|
}, |
|
|
|
|
|
batchAuditRules: { |
|
|
|
|
|
auditOpinion: [ |
|
|
|
|
|
{ |
|
|
|
|
|
validator: (rule, value, callback) => { |
|
|
|
|
|
if (this.batchAuditForm.auditStatus === '3' && (!value || value.trim() === '')) { |
|
|
|
|
|
callback(new Error('审核拒绝时必须填写审核意见')) |
|
|
|
|
|
} else { |
|
|
|
|
|
callback() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
trigger: 'blur' |
|
|
} |
|
|
} |
|
|
|
|
|
] |
|
|
}, |
|
|
}, |
|
|
|
|
|
batchAuditLoading: false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
created() { |
|
|
created() { |
|
|
this.getList() |
|
|
this.getList() |
|
|
|
|
|
this.checkAdminRole() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
/** 检查是否是管理员 */ |
|
|
|
|
|
checkAdminRole() { |
|
|
|
|
|
const userInfo = this.$store.getters.userInfo || {} |
|
|
|
|
|
this.isAdmin = userInfo.roles && userInfo.roles.includes('admin') |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** 查询商家信息列表 */ |
|
|
/** 查询商家信息列表 */ |
|
|
getList() { |
|
|
getList() { |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
@ -366,11 +490,13 @@ export default { |
|
|
this.loading = false |
|
|
this.loading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 取消按钮 |
|
|
// 取消按钮 |
|
|
cancel() { |
|
|
cancel() { |
|
|
this.open = false |
|
|
this.open = false |
|
|
this.reset() |
|
|
this.reset() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 表单重置 |
|
|
// 表单重置 |
|
|
reset() { |
|
|
reset() { |
|
|
this.form = { |
|
|
this.form = { |
|
|
@ -385,30 +511,42 @@ export default { |
|
|
} |
|
|
} |
|
|
this.resetForm("form") |
|
|
this.resetForm("form") |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */ |
|
|
/** 搜索按钮操作 */ |
|
|
handleQuery() { |
|
|
handleQuery() { |
|
|
this.queryParams.pageNum = 1 |
|
|
this.queryParams.pageNum = 1 |
|
|
this.getList() |
|
|
this.getList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 重置按钮操作 */ |
|
|
/** 重置按钮操作 */ |
|
|
resetQuery() { |
|
|
resetQuery() { |
|
|
this.resetForm("queryForm") |
|
|
this.resetForm("queryForm") |
|
|
this.handleQuery() |
|
|
this.handleQuery() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 多选框选中数据 |
|
|
// 多选框选中数据 |
|
|
handleSelectionChange(selection) { |
|
|
handleSelectionChange(selection) { |
|
|
this.ids = selection.map(item => item.shopId) |
|
|
this.ids = selection.map(item => item.shopId) |
|
|
this.single = selection.length!==1 |
|
|
|
|
|
|
|
|
this.single = selection.length !== 1 |
|
|
this.multiple = !selection.length |
|
|
this.multiple = !selection.length |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 详情按钮操作 |
|
|
|
|
|
handleView(row) { |
|
|
|
|
|
console.log('查看的店铺信息:', row) |
|
|
|
|
|
console.log('shopId:', row.shopId) |
|
|
|
|
|
this.shopRow = row |
|
|
|
|
|
this.shopId = row.shopId |
|
|
|
|
|
this.replyOpen = true |
|
|
|
|
|
|
|
|
/** 查看店铺产品 */ |
|
|
|
|
|
handleViewProducts(row) { |
|
|
|
|
|
|
|
|
|
|
|
// 确保shopId是数字类型 |
|
|
|
|
|
this.currentShopId = Number(row.shopId); |
|
|
|
|
|
this.currentShopName = row.shopName; |
|
|
|
|
|
|
|
|
|
|
|
this.productDialogVisible = true; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 关闭产品对话框 */ |
|
|
|
|
|
handleProductDialogClose() { |
|
|
|
|
|
console.log('关闭产品对话框'); |
|
|
|
|
|
this.productDialogVisible = false; |
|
|
|
|
|
this.currentShopId = null; |
|
|
|
|
|
this.currentShopName = ''; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 新增按钮操作 */ |
|
|
/** 新增按钮操作 */ |
|
|
@ -417,6 +555,7 @@ export default { |
|
|
this.open = true |
|
|
this.open = true |
|
|
this.title = "添加商家信息" |
|
|
this.title = "添加商家信息" |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 修改按钮操作 */ |
|
|
/** 修改按钮操作 */ |
|
|
handleUpdate(row) { |
|
|
handleUpdate(row) { |
|
|
this.reset() |
|
|
this.reset() |
|
|
@ -427,6 +566,7 @@ export default { |
|
|
this.title = "修改商家信息" |
|
|
this.title = "修改商家信息" |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 提交按钮 */ |
|
|
/** 提交按钮 */ |
|
|
submitForm() { |
|
|
submitForm() { |
|
|
this.$refs["form"].validate(valid => { |
|
|
this.$refs["form"].validate(valid => { |
|
|
@ -447,16 +587,18 @@ export default { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
handleDelete(row) { |
|
|
handleDelete(row) { |
|
|
const shopIds = row.shopId || this.ids |
|
|
const shopIds = row.shopId || this.ids |
|
|
this.$modal.confirm('是否确认删除商家信息编号为"' + shopIds + '"的数据项?').then(function() { |
|
|
|
|
|
|
|
|
this.$modal.confirm('是否确认删除商家信息编号为"' + shopIds + '"的数据项?').then(() => { |
|
|
return delMerchant(shopIds) |
|
|
return delMerchant(shopIds) |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
this.getList() |
|
|
this.getList() |
|
|
this.$modal.msgSuccess("删除成功") |
|
|
this.$modal.msgSuccess("删除成功") |
|
|
}).catch(() => {}) |
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
handleExport() { |
|
|
handleExport() { |
|
|
this.download('vet/merchant/export', { |
|
|
this.download('vet/merchant/export', { |
|
|
@ -488,26 +630,226 @@ export default { |
|
|
|
|
|
|
|
|
// 提交审核 |
|
|
// 提交审核 |
|
|
handleSubmitAudit(row) { |
|
|
handleSubmitAudit(row) { |
|
|
submitAudit(row.shopId).then(response => { |
|
|
|
|
|
|
|
|
this.$confirm('是否确认提交审核?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
return submitAudit(row.shopId) |
|
|
|
|
|
}).then(response => { |
|
|
this.$modal.msgSuccess("提交成功") |
|
|
this.$modal.msgSuccess("提交成功") |
|
|
this.getList() |
|
|
this.getList() |
|
|
}) |
|
|
|
|
|
|
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 取消审核 |
|
|
// 取消审核 |
|
|
handleCancelAudit(row) { |
|
|
handleCancelAudit(row) { |
|
|
cancelAudit(row.shopId).then(response => { |
|
|
|
|
|
|
|
|
this.$confirm('确定要取消审核吗?取消后可以重新提交审核', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
return cancelAudit(row.shopId) |
|
|
|
|
|
}).then(response => { |
|
|
this.$modal.msgSuccess("取消成功") |
|
|
this.$modal.msgSuccess("取消成功") |
|
|
this.getList() |
|
|
this.getList() |
|
|
}) |
|
|
|
|
|
|
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 重新提交审核 |
|
|
// 重新提交审核 |
|
|
handleResubmitAudit(row) { |
|
|
handleResubmitAudit(row) { |
|
|
resubmitAudit(row.shopId).then(response => { |
|
|
|
|
|
|
|
|
this.$confirm('是否确认重新提交审核?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
return resubmitAudit(row.shopId) |
|
|
|
|
|
}).then(response => { |
|
|
this.$modal.msgSuccess("重新提交成功") |
|
|
this.$modal.msgSuccess("重新提交成功") |
|
|
this.getList() |
|
|
this.getList() |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 打开审核对话框(顶部按钮点击) */ |
|
|
|
|
|
handleAuditDialog() { |
|
|
|
|
|
if (this.ids.length === 0) { |
|
|
|
|
|
this.$message.warning('请至少选择一个需要审核的商家') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.ids.length === 1) { |
|
|
|
|
|
// 单个审核 |
|
|
|
|
|
const shopId = this.ids[0] |
|
|
|
|
|
const shop = this.merchantList.find(item => item.shopId === shopId) |
|
|
|
|
|
if (shop && shop.auditStatus !== '1') { |
|
|
|
|
|
this.$message.warning('只有审核中的商家才能进行审核操作') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.handleSingleAudit({ shopId }) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 批量审核 |
|
|
|
|
|
this.handleBatchAudit() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 单个审核 */ |
|
|
|
|
|
handleSingleAudit(row) { |
|
|
|
|
|
const shopId = row.shopId || row |
|
|
|
|
|
|
|
|
|
|
|
// 检查审核状态 |
|
|
|
|
|
if (row.auditStatus && row.auditStatus !== '1') { |
|
|
|
|
|
this.$message.warning('只有审核中的商家才能进行审核操作') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.auditForm = { |
|
|
|
|
|
shopId: shopId, |
|
|
|
|
|
auditStatus: '2', |
|
|
|
|
|
auditOpinion: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.auditDialogVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 批量审核 */ |
|
|
|
|
|
handleBatchAudit() { |
|
|
|
|
|
// 过滤出审核中的商家 |
|
|
|
|
|
const auditShops = this.merchantList.filter(item => |
|
|
|
|
|
this.ids.includes(item.shopId) && item.auditStatus === '1' |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
if (auditShops.length === 0) { |
|
|
|
|
|
this.$message.warning('选中的商家中没有审核中的商家') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (auditShops.length < this.ids.length) { |
|
|
|
|
|
this.$message.warning('部分选中的商家不是审核中状态,将只对审核中的商家进行审核') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.batchAuditForm = { |
|
|
|
|
|
shopIds: auditShops.map(item => item.shopId), |
|
|
|
|
|
auditStatus: '2', |
|
|
|
|
|
auditOpinion: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.batchAuditDialogVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 提交单个审核 */ |
|
|
|
|
|
async submitAudit() { |
|
|
|
|
|
try { |
|
|
|
|
|
await this.$refs.auditFormRef.validate() |
|
|
|
|
|
|
|
|
|
|
|
const message = this.auditForm.auditStatus === '2' |
|
|
|
|
|
? '是否确认审核通过该商家?' |
|
|
|
|
|
: '是否确认审核拒绝该商家?' |
|
|
|
|
|
|
|
|
|
|
|
await this.$confirm(message, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.auditLoading = true |
|
|
|
|
|
|
|
|
|
|
|
const response = await auditMerchant({ |
|
|
|
|
|
shopId: this.auditForm.shopId, |
|
|
|
|
|
auditStatus: this.auditForm.auditStatus, |
|
|
|
|
|
auditOpinion: this.auditForm.auditOpinion || '' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (response.code === 200) { |
|
|
|
|
|
this.$message.success('审核成功') |
|
|
|
|
|
this.auditDialogVisible = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(response.msg || '审核失败') |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
if (error === 'cancel') return |
|
|
|
|
|
console.error('审核错误:', error) |
|
|
|
|
|
this.$message.error('审核失败:' + (error.message || '未知错误')) |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.auditLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 提交批量审核 */ |
|
|
|
|
|
async submitBatchAudit() { |
|
|
|
|
|
try { |
|
|
|
|
|
await this.$refs.batchAuditFormRef.validate() |
|
|
|
|
|
|
|
|
|
|
|
const message = this.batchAuditForm.auditStatus === '2' |
|
|
|
|
|
? `是否确认审核通过选中的 ${this.batchAuditForm.shopIds.length} 个商家?` |
|
|
|
|
|
: `是否确认审核拒绝选中的 ${this.batchAuditForm.shopIds.length} 个商家?` |
|
|
|
|
|
|
|
|
|
|
|
await this.$confirm(message, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.batchAuditLoading = true |
|
|
|
|
|
|
|
|
|
|
|
const response = await batchAuditMerchant({ |
|
|
|
|
|
shopIds: this.batchAuditForm.shopIds, |
|
|
|
|
|
auditStatus: this.batchAuditForm.auditStatus, |
|
|
|
|
|
auditOpinion: this.batchAuditForm.auditOpinion || '' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (response.code === 200) { |
|
|
|
|
|
this.$message.success(`批量审核成功,${response.msg || ''}`) |
|
|
|
|
|
this.batchAuditDialogVisible = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(response.msg || '批量审核失败') |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
if (error === 'cancel') return |
|
|
|
|
|
console.error('批量审核错误:', error) |
|
|
|
|
|
this.$message.error('批量审核失败:' + (error.message || '未知错误')) |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.batchAuditLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 关闭审核对话框 */ |
|
|
|
|
|
cancelAudit() { |
|
|
|
|
|
this.auditDialogVisible = false |
|
|
|
|
|
this.resetAuditForm() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 关闭批量审核对话框 */ |
|
|
|
|
|
cancelBatchAudit() { |
|
|
|
|
|
this.batchAuditDialogVisible = false |
|
|
|
|
|
this.resetBatchAuditForm() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 重置审核表单 */ |
|
|
|
|
|
resetAuditForm() { |
|
|
|
|
|
this.auditForm = { |
|
|
|
|
|
shopId: null, |
|
|
|
|
|
auditStatus: '2', |
|
|
|
|
|
auditOpinion: '' |
|
|
|
|
|
} |
|
|
|
|
|
if (this.$refs.auditFormRef) { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.$refs.auditFormRef.clearValidate() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** 重置批量审核表单 */ |
|
|
|
|
|
resetBatchAuditForm() { |
|
|
|
|
|
this.batchAuditForm = { |
|
|
|
|
|
shopIds: [], |
|
|
|
|
|
auditStatus: '2', |
|
|
|
|
|
auditOpinion: '' |
|
|
|
|
|
} |
|
|
|
|
|
if (this.$refs.batchAuditFormRef) { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.$refs.batchAuditFormRef.clearValidate() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|