settledIn/src/views/product/productExamine/index.vue

1665 lines
49 KiB
Vue
Raw Normal View History

2024-03-22 15:48:25 +08:00
<template>
<div class="divBox">
<div class="selCard">
2024-05-11 14:28:50 +08:00
<el-form
inline
size="small"
:model="tableFrom"
ref="searchForm"
label-width="103px"
>
2024-03-22 15:48:25 +08:00
<el-form-item label="商品分类:" prop="pid">
2024-05-11 14:28:50 +08:00
<el-cascader
v-model="tableFrom.pid"
class="selWidth"
:options="merCateList"
:props="{ checkStrictly: true, emitPath: false }"
clearable
@change="getList(1)"
/>
2024-03-22 15:48:25 +08:00
</el-form-item>
2024-05-14 17:43:18 +08:00
<el-form-item label="店铺名称:" prop="mer_id">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.mer_id"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option
v-for="item in merSelect"
:key="item.mer_id"
:label="item.mer_name"
:value="item.mer_id"
/>
2024-03-22 15:48:25 +08:00
</el-select>
</el-form-item>
<el-form-item label="商户类别:" prop="is_trader">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.is_trader"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
2024-03-22 15:48:25 +08:00
<el-option label="自营" value="1" />
<el-option label="非自营" value="0" />
</el-select>
</el-form-item>
<el-form-item label="商品状态:" prop="us_status">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.us_status"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
<el-option
v-for="item in productStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
2024-03-22 15:48:25 +08:00
</el-select>
</el-form-item>
<el-form-item label="推荐级别:" prop="star">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.star"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
<el-option
v-for="item in recommendedLevelStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
2024-03-22 15:48:25 +08:00
</el-form-item>
<el-form-item label="标签:" prop="sys_labels">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.sys_labels"
placeholder="请选择"
class="filter-item selWidth"
clearable
filterable
@change="getList(1)"
>
<el-option
v-for="item in labelList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
2024-03-22 15:48:25 +08:00
</el-form-item>
2024-05-06 13:59:51 +08:00
<!-- <el-form-item label="会员价:" prop="svip_price_type">
2024-03-22 15:48:25 +08:00
<el-select v-model="tableFrom.svip_price_type" placeholder="请选择" class="selWidth" clearable @change="getList(1)">
<el-option label="未设置" value="0" />
<el-option label="默认设置" value="1" />
<el-option label="自定义设置" value="2" />
</el-select>
2024-05-06 13:59:51 +08:00
</el-form-item> -->
2024-05-11 14:28:50 +08:00
<el-form-item label="商品推荐:" prop="hot_type">
<el-select
v-model="tableFrom.hot_type"
placeholder="请选择"
class="filter-item selWidth"
clearable
filterable
@change="getList(1)"
>
<el-option
v-for="item in recommendList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="商品类型:" prop="audit_type">
<el-select
v-model="tableFrom.audit_type"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
<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="keyword">
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入商品名称,关键字,产品编号"
class="selWidth"
/>
</el-form-item>
2024-05-19 11:51:43 +08:00
<el-form-item label="标记:" prop="tag_name">
2024-05-11 14:28:50 +08:00
<el-input
v-model="tableFrom.tag_name"
@keyup.enter.native="getList(1)"
placeholder="请输入标记"
class="selWidth"
/>
</el-form-item>
<el-form-item label="时间选择:" prop="create_time">
2024-04-01 18:55:52 +08:00
<el-date-picker
2024-05-11 14:28:50 +08:00
v-model="timeVal"
2024-05-24 09:53:27 +08:00
value-format="yyyy/MM/dd HH:mm:ss"
format="yyyy/MM/dd HH:mm:ss"
size="small"
type="datetimerange"
2024-05-11 14:28:50 +08:00
placement="bottom-end"
placeholder="自定义时间"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 280px"
:picker-options="pickerOptions"
@change="onchangeTime"
clearable
/>
2024-04-01 18:55:52 +08:00
</el-form-item>
2024-05-24 09:53:27 +08:00
<el-form-item label="更新时间:" prop="update_date">
2024-05-15 18:33:47 +08:00
<el-date-picker
v-model="updateTimeVal"
2024-05-24 09:53:27 +08:00
value-format="yyyy/MM/dd HH:mm:ss"
format="yyyy/MM/dd HH:mm:ss"
size="small"
type="datetimerange"
2024-05-15 18:33:47 +08:00
placement="bottom-end"
placeholder="自定义时间"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 280px"
:picker-options="pickerOptions"
@change="onchangeUpdateTime"
clearable
/>
</el-form-item>
2024-05-14 17:43:18 +08:00
<!-- <el-form-item label="是否惠美乡村:" prop="is_huimei">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.is_huimei"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
2024-04-08 17:44:44 +08:00
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
2024-05-14 17:43:18 +08:00
</el-form-item> -->
2024-04-09 20:28:36 +08:00
<el-form-item label="审核状态:" prop="is_audited">
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.is_audited"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
2024-04-09 20:28:36 +08:00
<el-option label="首次提报" value="0" />
2024-04-11 10:17:09 +08:00
<el-option label="已上架提报" value="1" />
2024-04-09 20:28:36 +08:00
<el-option label="首次修改" value="2" />
2024-04-17 11:15:49 +08:00
<el-option label="已上架修改" value="3" />
2024-04-09 20:28:36 +08:00
</el-select>
</el-form-item>
2024-08-26 10:28:19 +08:00
<el-form-item
label="待审核状态:"
prop="status"
v-if="Number(tableFrom.type) == 12"
>
2024-05-11 14:28:50 +08:00
<el-select
v-model="tableFrom.status"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
2024-06-12 17:51:06 +08:00
<el-form-item label="操作人:" prop="operator">
2024-05-19 11:51:43 +08:00
<el-input
2024-06-12 17:51:06 +08:00
v-model="tableFrom.operator"
2024-05-19 11:51:43 +08:00
@keyup.enter.native="getList(1)"
placeholder="请输入操作人"
class="selWidth"
/>
</el-form-item>
2024-08-29 17:22:11 +08:00
<el-form-item label="定制产品:" prop="is_customize">
<el-select
v-model="tableFrom.is_customize"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
2024-05-11 14:28:50 +08:00
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
2024-03-22 15:48:25 +08:00
<el-card class="mt14">
2024-05-11 14:28:50 +08:00
<el-tabs
v-model="tableFrom.type"
2024-08-26 10:28:19 +08:00
@tab-click="getList(1), getLstFilterApi(), setSort()"
2024-05-11 14:28:50 +08:00
>
<el-tab-pane
v-for="(item, index) in headeNum"
:key="index"
:name="item.type.toString()"
:label="item.name + '(' + item.count + ')'"
/>
2024-03-22 15:48:25 +08:00
</el-tabs>
<div class="mt5 mb20">
2024-08-26 10:28:19 +08:00
<el-button
v-show="tableFrom.type === '11'"
size="small"
:disabled="multipleSelection.length == 0"
@click="batch"
>批量审核</el-button
>
2024-05-11 14:28:50 +08:00
<el-button
size="small"
:disabled="multipleSelection.length == 0"
@click="batchOff"
>批量强制下架</el-button
>
<el-button
size="small"
:disabled="multipleSelection.length == 0"
@click="batchShow(0)"
>批量不显示</el-button
>
<el-button
size="small"
:disabled="multipleSelection.length == 0"
@click="batchShow(1)"
>批量显示</el-button
>
<el-button
:disabled="multipleSelection.length == 0"
size="small"
@click="batchLabel"
>批量设置标记</el-button
>
<el-button
:disabled="multipleSelection.length == 0"
size="small"
@click="batchRecommend"
>批量设置推荐</el-button
>
<el-button type="primary" size="small" @click="exports"
>导出列表</el-button
>
2024-03-22 15:48:25 +08:00
</div>
2024-05-11 14:28:50 +08:00
<el-table
v-loading="listLoading"
max-height="600"
:data="tableData.data"
size="small"
ref="table"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<el-table-column
2024-05-14 17:43:18 +08:00
v-if="Number(tableFrom.type) < 7 || Number(tableFrom.type) == 11"
2024-05-11 14:28:50 +08:00
key="2"
type="selection"
width="55"
/>
2024-03-22 15:48:25 +08:00
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="平台分类:">
2024-05-11 14:28:50 +08:00
<span>{{
props.row.storeCategory
? props.row.storeCategory.cate_name
: "-"
}}</span>
2024-03-22 15:48:25 +08:00
</el-form-item>
<el-form-item label="商品分类:">
<template v-if="props.row.merCateId.length">
2024-05-11 14:28:50 +08:00
<span
v-for="(item, index) in props.row.merCateId"
:key="index"
class="mr10"
>{{ item.category ? item.category.cate_name : "-" }}</span
>
2024-03-22 15:48:25 +08:00
</template>
<span v-else>-</span>
</el-form-item>
<el-form-item label="品牌:">
2024-05-11 14:28:50 +08:00
<span>{{
props.row.brand ? props.row.brand.brand_name : "其它"
}}</span>
2024-03-22 15:48:25 +08:00
</el-form-item>
<el-form-item label="市场价格:">
<span>{{ props.row.ot_price | filterEmpty }}</span>
</el-form-item>
<el-form-item label="成本价:">
<span>{{ props.row.cost | filterEmpty }}</span>
</el-form-item>
<el-form-item label="收藏:">
<span>{{ props.row.care_count | filterEmpty }}</span>
</el-form-item>
<el-form-item label="已售数量:">
<span>{{ props.row.ficti | filterEmpty }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
2024-05-07 14:29:28 +08:00
<el-table-column prop="product_id" label="ID" min-width="60" />
<el-table-column prop="tag_name" label="标记" min-width="60" />
<el-table-column prop="as_price" label="成长值" min-width="60" />
2024-04-08 17:44:44 +08:00
<el-table-column prop="audit_type" label="商品类型" min-width="80">
<template slot-scope="scope">
{{ productTypeList[scope.row.audit_type].label }}
</template>
</el-table-column>
2024-03-22 15:48:25 +08:00
<el-table-column label="商品图" min-width="70">
<template slot-scope="scope">
<div class="demo-image__preview">
2024-05-11 14:28:50 +08:00
<el-image
style="width: 36px; height: 36px"
:src="scope.row.image"
:preview-src-list="[scope.row.image]"
/>
2024-03-22 15:48:25 +08:00
</div>
</template>
</el-table-column>
2024-08-29 17:22:11 +08:00
<el-table-column prop="store_name" label="商品名称" min-width="120">
2024-03-22 15:48:25 +08:00
<template slot-scope="scope">
2024-05-11 14:28:50 +08:00
<div>
<span class="tags_name" :class="'name' + scope.row.spec_type">{{
scope.row.spec_type == 0 ? "[单规格]" : "[多规格]"
}}</span
>{{ scope.row.store_name || "-" }}
</div>
2024-03-22 15:48:25 +08:00
</template>
</el-table-column>
2024-08-29 17:22:11 +08:00
<el-table-column prop="is_customize" label="定制产品" min-width="80">
2024-08-26 10:28:19 +08:00
<template slot-scope="scope">
<div>
{{ scope.row.is_customize ? "是" : "否" }}
</div>
</template>
</el-table-column>
2024-05-14 17:43:18 +08:00
<el-table-column label="店铺名称" min-width="100">
2024-03-22 15:48:25 +08:00
<template slot-scope="scope">
2024-05-11 14:28:50 +08:00
<span>{{
scope.row.merchant ? scope.row.merchant.mer_name : ""
}}</span>
2024-03-22 15:48:25 +08:00
</template>
</el-table-column>
2024-05-24 19:48:16 +08:00
<el-table-column prop="is_audited" label="待审核类型" min-width="90">
<template slot-scope="scope">
{{ auditedList[scope.row.is_audited] }}
</template>
</el-table-column>
<el-table-column prop="price" label="商品售价" min-width="80" />
<el-table-column prop="refusal" label="拒绝/锁定原因" min-width="110" />
2024-06-12 17:51:06 +08:00
<el-table-column prop="operator" label="操作人" min-width="110" />
2024-08-26 10:28:19 +08:00
<el-table-column
prop="create_time"
sortable="custom"
label="创建时间"
min-width="120"
/>
<el-table-column
prop="update_time"
sortable="custom"
label="更新时间"
min-width="120"
/>
2024-05-14 17:43:18 +08:00
<!-- <el-table-column label="是否惠美乡村店铺" min-width="80">
2024-04-13 18:17:12 +08:00
<template slot-scope="scope">
2024-05-11 14:28:50 +08:00
<span>{{ scope.row.merchant.is_huimei ? "是" : "否" }}</span>
2024-04-13 18:17:12 +08:00
</template>
</el-table-column>
2024-05-07 14:29:28 +08:00
<el-table-column label="是否惠美乡村产品" min-width="80">
2024-04-05 11:50:20 +08:00
<template slot-scope="scope">
2024-05-11 14:28:50 +08:00
<span>{{ scope.row.is_huimei ? "是" : "否" }}</span>
2024-04-05 11:50:20 +08:00
</template>
2024-05-14 17:43:18 +08:00
</el-table-column> -->
2024-05-11 14:28:50 +08:00
<el-table-column
prop="storeCategory.cate_name"
label="平台分类"
min-width="80"
/>
2024-05-24 19:48:16 +08:00
<el-table-column prop="remark" label="商家备注" min-width="100" />
2024-03-22 15:48:25 +08:00
<el-table-column prop="status" label="是否显示" min-width="80">
<template slot-scope="scope">
2024-05-11 14:28:50 +08:00
<el-switch
v-model="scope.row.is_used"
:active-value="1"
:inactive-value="0"
active-text="显示"
inactive-text="隐藏"
@change="onchangeIsShow(scope.row)"
/>
2024-03-22 15:48:25 +08:00
</template>
</el-table-column>
<el-table-column prop="stock" label="商品状态" min-width="90">
<template slot-scope="scope">
<span>{{ scope.row.us_status | productStatusFilter }}</span>
</template>
</el-table-column>
2024-05-24 19:48:16 +08:00
<el-table-column label="推荐级别" min-width="150">
<template slot-scope="scope">
<el-rate disabled v-model="scope.row.star" :colors="colors">
</el-rate>
</template>
</el-table-column>
<el-table-column prop="rank" label="排序" min-width="60" />
<el-table-column prop="sales" label="销量" min-width="70" />
2024-07-09 18:20:29 +08:00
<el-table-column prop="browse" label="浏览量" min-width="70" />
2024-05-24 19:48:16 +08:00
<el-table-column prop="stock" label="库存" min-width="70" />
2024-05-11 14:28:50 +08:00
<el-table-column key="8" label="操作" min-width="260" fixed="right">
2024-03-22 15:48:25 +08:00
<template slot-scope="scope">
2024-05-11 14:28:50 +08:00
<el-button
type="text"
size="small"
@click="onDetails(scope.row.product_id)"
>详情</el-button
>
<el-button
v-if="audit"
type="text"
size="small"
@click.native="toExamine(scope.row.product_id)"
>审核</el-button
>
<el-button
v-if="audit"
type="text"
size="small"
@click="openLock(scope.row.product_id)"
>锁定</el-button
>
<el-button
v-if="scope.row.lock == 1"
type="text"
size="small"
@click.native="openUnlock(scope.row.product_id)"
>解锁</el-button
>
<el-button
type="text"
size="small"
@click="getBack(scope.row.product_id)"
2024-08-26 10:28:19 +08:00
v-if="[7, 9, 10, 11].includes(Number(tableFrom.type))"
>{{ tableFrom.type == 7 ? "撤回" : "返回" }}</el-button
2024-05-11 14:28:50 +08:00
>
<el-button
type="text"
size="small"
class="mr10"
@click="handlePreview(scope.row.product_id)"
>预览</el-button
>
2024-03-22 15:48:25 +08:00
<el-dropdown>
<span class="el-dropdown-link">
2024-05-11 14:28:50 +08:00
更多<i class="el-icon-arrow-down el-icon--right" />
2024-03-22 15:48:25 +08:00
</span>
<el-dropdown-menu slot="dropdown">
2024-05-11 14:28:50 +08:00
<el-dropdown-item
2024-05-16 16:38:39 +08:00
v-if="Number(tableFrom.type) < 7 || tableFrom.type === '9'"
2024-05-11 14:28:50 +08:00
@click.native="onEdit(scope.row.product_id)"
>编辑商品</el-dropdown-item
>
<el-dropdown-item
2024-05-16 16:38:39 +08:00
v-if="Number(tableFrom.type) < 7 || tableFrom.type === '9'"
2024-05-11 14:28:50 +08:00
@click.native="onAuditFree(scope.row)"
>价格编辑</el-dropdown-item
>
2024-03-22 15:48:25 +08:00
<el-dropdown-item v-if="tableFrom.type != 5">
2024-05-11 14:28:50 +08:00
<router-link
:to="{
path:
roterPre +
'/product/comment/?product_id=' +
scope.row.product_id,
}"
style="font-size: 14px"
>
2024-03-22 15:48:25 +08:00
查看评价
</router-link>
</el-dropdown-item>
2024-04-29 09:15:14 +08:00
<!-- <el-dropdown-item v-if="tableFrom.type !== '5'" @click.native="onEditLabel(scope.row)">编辑标签</el-dropdown-item> -->
2024-05-11 14:28:50 +08:00
<el-dropdown-item
@click.native="setTagName(scope.row.product_id)"
>编辑标记</el-dropdown-item
>
<el-dropdown-item
2024-08-26 10:28:19 +08:00
v-if="
tableFrom.type === '6' ||
tableFrom.type === '1' ||
tableFrom.type === '9'
"
2024-05-11 14:28:50 +08:00
@click.native="toVirtualSales(scope.row.product_id)"
>已售数量</el-dropdown-item
>
<el-dropdown-item
v-if="Number(tableFrom.type) < 3"
@click.native="toOff(scope.row.product_id)"
>强制下架</el-dropdown-item
>
2024-03-22 15:48:25 +08:00
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<div class="block">
2024-05-11 14:28:50 +08:00
<el-pagination
background
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
2024-03-22 15:48:25 +08:00
</div>
</el-card>
2024-05-11 14:28:50 +08:00
<info-from
ref="infoFrom"
:is-show="isShow"
:ids="OffId"
@subSuccess="subSuccess"
/>
<el-dialog
title="商品编辑"
:visible.sync="dialogVisible"
width="960px"
:before-close="handleClose"
:append-to-body="append"
>
<el-form
ref="formValidate"
v-loading="fullscreenLoading"
class="formValidate mt20"
:rules="ruleValidate"
:model="formValidate"
size="small"
label-width="100px"
@submit.native.prevent
>
2024-05-11 17:15:54 +08:00
<el-form-item label="商品类型:" prop="audit_type">
<el-radio-group v-model="formValidate.audit_type">
<el-radio :label="0">食品及保健品</el-radio>
<el-radio :label="1">化妆品及日化品</el-radio>
<el-radio :label="2">其他品类</el-radio>
</el-radio-group>
</el-form-item>
2024-04-13 18:17:12 +08:00
<el-form-item label="品牌名称:" prop="store_name">
2024-05-11 14:28:50 +08:00
<el-input
:disabled="true"
:value="
formValidate.qualification &&
formValidate.qualification.brands_name
"
size="small"
placeholder="请输入商品名称"
/>
2024-04-13 18:17:12 +08:00
</el-form-item>
2024-03-22 15:48:25 +08:00
<el-form-item label="商品名称:" prop="store_name">
2024-05-11 14:28:50 +08:00
<el-input
v-model="formValidate.store_name"
size="small"
placeholder="请输入商品名称"
/>
2024-03-22 15:48:25 +08:00
</el-form-item>
2024-04-07 20:06:17 +08:00
<el-form-item label="商品关键字:" prop="keyword">
2024-05-11 14:28:50 +08:00
<el-input
v-model="formValidate.keyword"
placeholder="请输入商品关键字"
size="small"
/>
2024-04-07 20:06:17 +08:00
</el-form-item>
2024-08-26 10:28:19 +08:00
<div style="display: flex">
2024-10-28 17:47:18 +08:00
<!-- <el-form-item label="商品封面图:" prop="image">
2024-08-26 10:28:19 +08:00
<div class="demo-image__preview">
<el-image
style="width: 60px; height: 60px"
:src="formValidate.image"
:preview-src-list="[formValidate.image]"
/>
</div>
2024-10-28 17:47:18 +08:00
</el-form-item> -->
<el-form-item label="商品封面图:" prop="image">
<div
class="upLoadPicBox"
title="750*750px"
@click="modalPicTap('1')"
>
<div v-if="formValidate.image" class="pictrue">
<img :src="formValidate.image" />
</div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
2024-08-26 10:28:19 +08:00
</el-form-item>
<el-form-item
style="margin-left: 100px"
label="定制产品:"
prop="audit_type"
>
<el-radio-group v-model="formValidate.is_customize">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</div>
2024-03-22 15:48:25 +08:00
<el-form-item label="星级推荐:">
2024-05-11 14:28:50 +08:00
<el-rate
class="rate_star"
v-model="formValidate.star"
:colors="colors"
style="margin-top: 4px"
></el-rate>
<span style="margin-top: 4px; font-size: 12px"
>备注5星为最高推荐级别1星为最低推荐级别设置后会在商城商品列表搜索商品列表中体现</span
>
2024-03-22 15:48:25 +08:00
</el-form-item>
<el-form-item label="商品推荐:">
2024-05-11 14:28:50 +08:00
<el-checkbox-group
v-model="checkboxGroup"
size="small"
@change="onChangeGroup"
>
<el-checkbox
v-for="(item, index) in recommend"
:key="index"
:label="item.value"
>{{ item.name }}</el-checkbox
>
2024-03-22 15:48:25 +08:00
</el-checkbox-group>
</el-form-item>
<el-form-item label="排序:">
2024-05-11 14:28:50 +08:00
<el-input-number
v-model="formValidate.rank"
size="small"
placeholder="请输入排序序号"
style="width: 200px"
/>
2024-03-22 15:48:25 +08:00
</el-form-item>
2024-05-11 17:15:54 +08:00
<el-form-item label="平台商品分类:" prop="cate_id" label-width="110px">
2024-05-11 14:28:50 +08:00
<el-cascader
v-model="formValidate.cate_id"
size="small"
:options="merCateList"
:props="props"
filterable
clearable
/>
2024-04-07 20:06:17 +08:00
</el-form-item>
<el-form-item label="商品轮播图:" prop="slider_image">
2024-05-11 14:28:50 +08:00
<div class="acea-row">
<div
v-for="(item, index) in formValidate.slider_image"
:key="index"
class="pictrue"
draggable="false"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
<!-- <img :src="item"> -->
<el-image
style="width: 60px; height: 60px"
:src="item"
:preview-src-list="[item]"
/>
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div
v-if="formValidate.slider_image.length < 10"
class="uploadCont"
title="750*750px"
>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
2024-04-07 20:06:17 +08:00
</div>
</div>
2024-05-11 14:28:50 +08:00
</div>
</div>
</el-form-item>
2024-03-22 15:48:25 +08:00
<el-col :span="24">
<el-form-item label="商品详情:">
2024-05-11 14:28:50 +08:00
<ueditor-from
v-model="formValidate.content"
:content="formValidate.content"
/>
2024-03-22 15:48:25 +08:00
</el-form-item>
</el-col>
2024-05-11 14:28:50 +08:00
<el-form-item style="margin-top: 30px">
<el-button
type="primary"
class="submission"
size="small"
@click="handleSubmit('formValidate')"
>提交</el-button
>
2024-03-22 15:48:25 +08:00
</el-form-item>
</el-form>
</el-dialog>
2024-05-11 14:28:50 +08:00
<!--预览商品-->
2024-03-22 15:48:25 +08:00
<div v-if="previewVisible">
<div class="bg" @click.stop="previewVisible = false" />
2024-05-11 14:28:50 +08:00
<preview-box
v-if="previewVisible"
ref="previewBox"
:goods-id="goodsId"
:product-type="0"
:preview-key="previewKey"
/>
2024-03-22 15:48:25 +08:00
</div>
<!--编辑标签-->
<el-dialog
v-if="dialogLabel"
2024-05-11 14:28:50 +08:00
title="编辑标记"
2024-03-22 15:48:25 +08:00
:visible.sync="dialogLabel"
width="470px"
:before-close="handleClose"
>
2024-05-11 14:28:50 +08:00
<el-form
ref="labelForm"
:model="labelForm"
inline
:rules="rules"
@submit.native.prevent
size="small"
>
<el-form-item label="标记" prop="tag_name">
<el-input
v-model="labelForm.tag_name"
placeholder="请输入商品关键字"
size="small"
class="selWidth"
/>
2024-03-22 15:48:25 +08:00
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
2024-05-11 14:28:50 +08:00
<el-button size="small" @click="dialogLabel = false">取消</el-button>
<el-button type="primary" size="small" @click="submitForm('labelForm')"
>提交</el-button
>
2024-03-22 15:48:25 +08:00
</span>
</el-dialog>
<!--编辑推荐-->
<el-dialog
v-if="dialogRecommend"
title="推荐设置"
:visible.sync="dialogRecommend"
width="800px"
:before-close="handleClose"
>
<el-form @submit.native.prevent size="small">
<el-form-item label="商品推荐:">
2024-05-11 14:28:50 +08:00
<el-checkbox-group
v-model="recommendGroup"
@change="onChangeRecommend"
size="small"
>
<el-checkbox
v-for="(item, index) in recommend"
:key="index"
:label="item.value"
>{{ item.name }}</el-checkbox
>
2024-03-22 15:48:25 +08:00
</el-checkbox-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitRecommendForm">提交</el-button>
</span>
</el-dialog>
<!--商品详情-->
<pro-detail
ref="proDetail"
:productId="product_id"
@closeDrawer="closeDrawer"
@changeDrawer="changeDrawer"
:drawer="drawer"
></pro-detail>
2024-04-11 20:03:00 +08:00
<edit-attr ref="editAttr" />
2024-03-22 15:48:25 +08:00
</div>
</template>
<script>
import {
changeApi,
productLstApi,
productDetailApi,
categoryListApi,
productUpdateApi,
lstFilterApi,
merSelectApi,
productOffApi,
toVirtualSalesApi,
getProductLabelApi,
updatetProductLabel,
batchesLabelsApi,
2024-05-11 14:28:50 +08:00
batchesTagNameApi,
2024-03-22 15:48:25 +08:00
batchesRecommendApi,
2024-04-11 20:03:00 +08:00
batchesOnOffApi,
2024-04-29 09:15:14 +08:00
exportProductApi,
2024-05-11 14:28:50 +08:00
setTagNameApi,
productLockApi,
productBackApi,
} from "@/api/product";
import { roterPre } from "@/settings";
import infoFrom from "./info";
import editAttr from "./editAttr";
import ueditorFrom from "@/components/ueditorFrom";
import previewBox from "@/components/previewBox/index";
import proDetail from "./proDetails.vue";
import timeOptions from "@/utils/timeOptions";
import createWorkBook from "@/utils/newToExcel.js";
const proOptions = [
{
name: "热门榜单",
value: "is_hot",
},
{
2024-05-23 18:31:45 +08:00
name: "特惠专区",
2024-05-11 14:28:50 +08:00
value: "is_benefit",
},
{
name: "精品推荐",
value: "is_best",
},
{
name: "首发新品",
value: "is_new",
},
];
2024-03-22 15:48:25 +08:00
export default {
2024-05-11 14:28:50 +08:00
name: "ProductExamine1",
2024-03-22 15:48:25 +08:00
components: {
infoFrom,
ueditorFrom,
previewBox,
2024-04-11 20:03:00 +08:00
proDetail,
2024-05-11 14:28:50 +08:00
editAttr,
2024-03-22 15:48:25 +08:00
},
data() {
return {
2024-04-07 20:06:17 +08:00
props: { emitPath: false },
2024-04-01 18:55:52 +08:00
pickerOptions: timeOptions,
timeVal: [],
2024-05-15 18:33:47 +08:00
updateTimeVal: [],
2024-03-22 15:48:25 +08:00
ruleValidate: {
2024-05-11 14:28:50 +08:00
store_name: [
{
required: true,
message: "请输入商品名称",
trigger: "blur",
},
],
2024-03-22 15:48:25 +08:00
},
2024-05-11 14:28:50 +08:00
2024-03-22 15:48:25 +08:00
dialogVisible: false,
dialogRecommend: false,
append: true,
checkboxGroup: [],
recommendGroup: [],
2024-05-11 14:28:50 +08:00
colors: ["#99A9BF", "#F7BA2A", "#FF9900"],
2024-03-22 15:48:25 +08:00
recommendedLevelStatus: [
{ label: "全部", value: "" },
{ label: "5星", value: 5 },
{ label: "4星", value: 4 },
{ label: "3星", value: 3 },
{ label: "2星", value: 2 },
2024-05-11 14:28:50 +08:00
{ label: "1星", value: 1 },
],
2024-05-11 17:15:54 +08:00
// 0 产品部审核 9 产品部复审 10 运维专员审核 11 最终审核
2024-05-11 14:28:50 +08:00
statusList: [
2024-05-11 17:15:54 +08:00
{ label: "产品部审核", value: 0 },
2024-05-11 14:28:50 +08:00
{ label: "产品部复审", value: 9 },
{ label: "运维专员审核", value: 10 },
2024-08-26 10:28:19 +08:00
{ label: "最终审核", value: 11 },
2024-03-22 15:48:25 +08:00
],
2024-05-11 14:28:50 +08:00
auditedList: ["首次提报", "已上架提报", "首次修改", "已上架修改"],
2024-03-22 15:48:25 +08:00
recommend: proOptions,
2024-05-11 14:28:50 +08:00
recommendList: [
{
name: "热门榜单",
value: "hot",
},
{
2024-05-23 18:31:45 +08:00
name: "特惠专区",
2024-05-11 14:28:50 +08:00
value: "good",
},
{
name: "精品推荐",
value: "best",
},
{
name: "首发新品",
value: "new",
},
],
2024-03-22 15:48:25 +08:00
formValidate: {
is_hot: 0,
2024-08-26 10:28:19 +08:00
is_customize: 0,
2024-03-22 15:48:25 +08:00
is_best: 0,
is_new: 0,
is_benefit: 0,
ficti: 0,
is_ficti: "",
2024-05-11 14:28:50 +08:00
content: "",
store_name: "",
2024-04-15 15:30:22 +08:00
rank: 0,
2024-05-11 14:28:50 +08:00
us_status: "",
2024-04-15 15:30:22 +08:00
star: 0,
2024-05-11 14:28:50 +08:00
keyword: "",
cate_id: 0,
2024-04-07 20:06:17 +08:00
slider_image: [],
2024-05-11 14:28:50 +08:00
qualification: {},
image: "",
2024-08-26 10:28:19 +08:00
audit_type: 0,
2024-03-22 15:48:25 +08:00
},
productStatusList: [
{ label: "上架显示", value: 1 },
// { label: "下架", value: 0 },
{ label: "平台关闭", value: -1 },
],
productTypeList: [
2024-05-11 14:28:50 +08:00
{ label: "食品及保健品", value: 0 },
{ label: "化妆品及日化品", value: 1 },
{ label: "其他品类", value: 2 },
2024-03-22 15:48:25 +08:00
],
fullscreenLoading: false,
isShow: false,
roterPre: roterPre,
listLoading: true,
tableData: {
data: [],
2024-05-11 14:28:50 +08:00
total: 0,
2024-03-22 15:48:25 +08:00
},
tableFrom: {
page: 1,
limit: 20,
2024-05-11 14:28:50 +08:00
date: "",
2024-08-29 17:22:11 +08:00
is_customize: "",
2024-05-11 14:28:50 +08:00
cate_id: "",
sys_labels: "",
pid: "",
2024-08-26 10:28:19 +08:00
operator: "",
2024-05-11 14:28:50 +08:00
tag_name: "",
store_name: "",
audit_type: "",
type: "6",
mer_id: "",
keyword: "",
is_trader: "",
hot_type: "",
star: "",
svip_price_type: "",
is_audited: "",
is_huimei: "",
2024-08-26 10:28:19 +08:00
order: "",
2024-05-11 14:28:50 +08:00
product_id: this.$route.query.id ? this.$route.query.id : "",
2024-03-22 15:48:25 +08:00
},
categoryList: [],
merCateList: [],
multipleSelection: [],
headeNum: [],
merSelect: [],
OffId: [],
productId: 0,
2024-05-11 14:28:50 +08:00
tabClickIndex: "",
2024-03-22 15:48:25 +08:00
previewVisible: false,
2024-05-11 14:28:50 +08:00
goodsId: "",
previewKey: "",
product_id: "",
2024-03-22 15:48:25 +08:00
labelList: [],
dialogLabel: false,
isBatch: false,
2024-05-11 14:28:50 +08:00
labelForm: {
2024-08-26 10:28:19 +08:00
ids: [],
tag_name: "",
2024-05-11 14:28:50 +08:00
},
rules: {
2024-08-26 10:28:19 +08:00
tag_name: [{ required: true, message: "请输入标记", trigger: "blur" }],
2024-05-11 14:28:50 +08:00
},
2024-03-22 15:48:25 +08:00
recommendForm: {},
2024-05-11 14:28:50 +08:00
drawer: false,
};
2024-03-22 15:48:25 +08:00
},
mounted() {
2024-05-11 14:28:50 +08:00
this.getMerSelect();
this.getList("");
this.getCategorySelect();
this.getLstFilterApi();
this.getLabelLst();
},
computed: {
audit() {
return (
this.tableFrom.type === "6" ||
this.tableFrom.type === "10" ||
this.tableFrom.type === "11" ||
this.tableFrom.type === "9"
);
},
2024-03-22 15:48:25 +08:00
},
methods: {
2024-08-26 10:28:19 +08:00
handleSortChange(row) {
2024-05-11 14:28:50 +08:00
switch (row.prop) {
2024-08-26 10:28:19 +08:00
case "create_time":
this.tableFrom.order =
row.order == "ascending" ? "create_asc" : "create_desc";
2024-05-11 14:28:50 +08:00
break;
2024-08-26 10:28:19 +08:00
case "update_time":
this.tableFrom.order =
row.order == "ascending" ? "update_asc" : "update_desc";
2024-05-11 14:28:50 +08:00
break;
default:
break;
}
2024-08-26 10:28:19 +08:00
this.getList("");
2024-05-11 14:28:50 +08:00
},
2024-08-26 10:28:19 +08:00
setSort() {
this.$refs.table.clearSort();
this.tableFrom.order = "";
this.tableFrom.status = "";
2024-05-11 14:28:50 +08:00
},
getBack(id) {
this.$modalForm(productBackApi(id)).then(() => this.getList(""));
2024-05-11 17:15:54 +08:00
this.getLstFilterApi();
2024-05-11 14:28:50 +08:00
},
// 解锁
openUnlock(id) {
this.$modalForm(productLockApi(id)).then(() => this.getList(""));
2024-05-11 17:15:54 +08:00
this.getLstFilterApi();
2024-05-11 14:28:50 +08:00
},
// 锁定
openLock(id) {
this.$modalForm(productLockApi(id)).then(() => this.getList(""));
2024-05-11 17:15:54 +08:00
this.getLstFilterApi();
2024-05-11 14:28:50 +08:00
},
2024-04-11 20:03:00 +08:00
// 价格编辑
onAuditFree(row) {
2024-05-11 14:28:50 +08:00
this.$refs.editAttr.getAttrDetail(row.product_id);
2024-04-11 20:03:00 +08:00
},
async exports() {
2024-05-11 14:28:50 +08:00
let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
data = [];
excelData.page = 1;
2024-05-16 18:45:20 +08:00
excelData.limit = 200;
2024-05-11 14:28:50 +08:00
let pageCount = 1;
2024-04-11 20:03:00 +08:00
let lebData = {};
for (let i = 0; i < pageCount; i++) {
2024-05-11 14:28:50 +08:00
lebData = await this.downData(excelData);
pageCount = Math.ceil(lebData.count / excelData.limit);
2024-04-11 20:03:00 +08:00
if (lebData.export.length) {
2024-05-11 14:28:50 +08:00
data = data.concat(lebData.export);
excelData.page++;
2024-04-11 20:03:00 +08:00
}
}
2024-05-11 14:28:50 +08:00
createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
2024-04-11 20:03:00 +08:00
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
exportProductApi(excelData).then((res) => {
2024-05-11 14:28:50 +08:00
return resolve(res.data);
});
});
2024-04-11 20:03:00 +08:00
},
2024-05-11 14:28:50 +08:00
// 具体日期
2024-04-01 18:55:52 +08:00
onchangeTime(e) {
2024-05-11 14:28:50 +08:00
this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.getList(1);
2024-04-01 18:55:52 +08:00
},
2024-05-15 18:33:47 +08:00
// 具体日期
onchangeUpdateTime(e) {
this.updateTimeVal = e;
this.tableFrom.update_date = e ? this.updateTimeVal.join("-") : "";
this.getList(1);
},
2024-03-22 15:48:25 +08:00
/**重置 */
2024-05-11 14:28:50 +08:00
searchReset() {
this.timeVal = [];
2024-05-15 18:33:47 +08:00
this.updateTimeVal = [];
2024-05-11 14:28:50 +08:00
this.tableFrom.date = "";
2024-05-15 18:33:47 +08:00
this.tableFrom.update_date = "";
2024-08-26 10:28:19 +08:00
this.setSort();
2024-05-11 14:28:50 +08:00
this.$refs.searchForm.resetFields();
this.getList(1);
2024-03-22 15:48:25 +08:00
},
subSuccess() {
2024-05-11 14:28:50 +08:00
this.getList("");
this.getLstFilterApi();
2024-03-22 15:48:25 +08:00
},
2024-04-07 20:06:17 +08:00
// 点击商品图
modalPicTap(tit, num, i) {
const _this = this;
const attr = [];
2024-05-11 14:28:50 +08:00
this.$modalUpload(function (img) {
2024-04-07 20:06:17 +08:00
if (tit === "1" && !num) {
_this.formValidate.image = img[0];
2024-10-28 17:47:18 +08:00
// _this.OneattrValue[0].image = img[0];
2024-04-07 20:06:17 +08:00
}
if (tit === "2" && !num) {
2024-05-11 14:28:50 +08:00
img.map((item) => {
2024-04-07 20:06:17 +08:00
attr.push(item.attachment_src);
_this.formValidate.slider_image.push(item);
if (_this.formValidate.slider_image.length > 10) {
_this.formValidate.slider_image.length = 10;
}
});
}
if (tit === "1" && num === "dan") {
_this.OneattrValue[0].image = img[0];
}
if (tit === "1" && num === "duo") {
_this.ManyAttrValue[i].image = img[0];
}
if (tit === "1" && num === "pi") {
_this.oneFormBatch[0].image = img[0];
}
}, tit);
},
2024-03-22 15:48:25 +08:00
onchangeIsShow(row) {
2024-05-11 14:28:50 +08:00
changeApi(row.product_id, row.is_used)
.then(({ message }) => {
this.$message.success(message);
this.getList("");
this.getLstFilterApi();
})
.catch(({ message }) => {
this.$message.error(message);
});
2024-03-22 15:48:25 +08:00
},
// 预览
handlePreview(id) {
2024-05-11 14:28:50 +08:00
this.previewVisible = true;
this.goodsId = id;
this.previewKey = "";
2024-03-22 15:48:25 +08:00
},
// 获取标签项
getLabelLst() {
2024-05-11 14:28:50 +08:00
getProductLabelApi()
.then((res) => {
this.labelList = res.data;
2024-03-22 15:48:25 +08:00
})
2024-05-11 14:28:50 +08:00
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
// 编辑标签
onEditLabel(row) {
2024-05-11 14:28:50 +08:00
this.dialogLabel = true;
this.product_id = row.product_id;
2024-03-22 15:48:25 +08:00
this.labelForm = {
2024-05-11 14:28:50 +08:00
sys_labels: row.sys_labels,
};
2024-03-22 15:48:25 +08:00
},
2024-04-07 20:06:17 +08:00
handleRemove(i) {
this.formValidate.slider_image.splice(i, 1);
},
2024-03-22 15:48:25 +08:00
// 查看详情
onDetails(id) {
this.product_id = id;
this.drawer = true;
2024-05-11 14:28:50 +08:00
this.$refs.proDetail.getInfo(id);
2024-03-22 15:48:25 +08:00
},
2024-04-07 20:06:17 +08:00
// 移动
handleDragStart(e, item) {
this.dragging = item;
},
handleDragEnd(e, item) {
this.dragging = null;
},
handleDragOver(e) {
e.dataTransfer.dropEffect = "move";
},
handleDragEnter(e, item) {
e.dataTransfer.effectAllowed = "move";
if (item === this.dragging) {
return;
}
const newItems = [...this.formValidate.slider_image];
const src = newItems.indexOf(this.dragging);
const dst = newItems.indexOf(item);
newItems.splice(dst, 0, ...newItems.splice(src, 1));
this.formValidate.slider_image = newItems;
},
2024-03-22 15:48:25 +08:00
changeDrawer(v) {
this.drawer = v;
},
closeDrawer() {
this.drawer = false;
},
submitForm(name) {
2024-05-11 14:28:50 +08:00
this.$refs[name].validate((valid) => {
2024-03-22 15:48:25 +08:00
if (valid) {
2024-05-11 14:28:50 +08:00
this.isBatch
? batchesTagNameApi(this.labelForm)
.then(({ message }) => {
this.$message.success(message);
this.getList("");
this.dialogLabel = false;
this.isBatch = false;
})
.catch((res) => {
this.$message.error(res.message);
})
: updatetProductLabel(this.product_id, this.labelForm)
.then(({ message }) => {
this.$message.success(message);
this.getList("");
this.dialogLabel = false;
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
} else {
2024-05-11 14:28:50 +08:00
return;
2024-03-22 15:48:25 +08:00
}
2024-05-11 14:28:50 +08:00
});
2024-03-22 15:48:25 +08:00
},
batchRecommend() {
2024-05-11 14:28:50 +08:00
this.dialogRecommend = true;
this.recommendGroup = [];
2024-03-22 15:48:25 +08:00
},
submitRecommendForm() {
2024-05-11 14:28:50 +08:00
this.recommendForm.ids = this.OffId;
batchesRecommendApi(this.recommendForm)
.then(({ message }) => {
this.$message.success(message);
this.getList("");
this.dialogRecommend = false;
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
getInfo(id) {
2024-05-11 14:28:50 +08:00
this.fullscreenLoading = true;
2024-03-22 15:48:25 +08:00
this.checkboxGroup = [];
2024-05-11 14:28:50 +08:00
productDetailApi(id)
.then((res) => {
const info = res.data;
this.formValidate = {
is_hot: info.is_hot,
is_best: info.is_best,
is_new: info.is_new,
is_benefit: info.is_benefit,
ficti: info.ficti,
content: info.content,
store_name: info.store_name,
rank: info.rank,
star: info.star,
keyword: info.keyword,
cate_id: info.cate_id,
slider_image: info.slider_image,
qualification: info.qualification,
image: info.image,
2024-08-26 10:28:19 +08:00
audit_type: info.audit_type,
is_customize: info.is_customize || 0,
2024-05-11 14:28:50 +08:00
};
if (info.is_benefit === 1) this.checkboxGroup.push("is_benefit");
if (info.is_hot === 1) this.checkboxGroup.push("is_hot");
if (info.is_best === 1) this.checkboxGroup.push("is_best");
if (info.is_new === 1) this.checkboxGroup.push("is_new");
this.fullscreenLoading = false;
})
.catch((res) => {
this.$message.error(res.message);
this.fullscreenLoading = false;
});
2024-03-22 15:48:25 +08:00
},
onEdit(id) {
2024-05-11 14:28:50 +08:00
this.productId = id;
this.getInfo(id);
this.dialogVisible = true;
2024-03-22 15:48:25 +08:00
},
// 编辑虚拟销量
toVirtualSales(id) {
2024-05-11 14:28:50 +08:00
this.$modalForm(toVirtualSalesApi(id)).then(() => this.getList(""));
2024-03-22 15:48:25 +08:00
},
2024-04-29 09:15:14 +08:00
// 编辑标签
setTagName(id) {
2024-05-11 14:28:50 +08:00
this.$modalForm(setTagNameApi(id)).then(() => this.getList(""));
2024-04-29 09:15:14 +08:00
},
2024-03-22 15:48:25 +08:00
// 提交
handleSubmit(name) {
2024-05-11 14:28:50 +08:00
console.log(this.formValidate);
2024-03-22 15:48:25 +08:00
this.$refs[name].validate((valid) => {
2024-05-11 14:28:50 +08:00
if (valid) {
productUpdateApi(this.productId, this.formValidate)
.then(async (res) => {
this.fullscreenLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList("");
})
.catch((res) => {
this.fullscreenLoading = false;
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
} else {
2024-05-11 14:28:50 +08:00
return false;
2024-03-22 15:48:25 +08:00
}
2024-05-11 14:28:50 +08:00
});
2024-03-22 15:48:25 +08:00
},
onChangeGroup() {
2024-05-11 14:28:50 +08:00
this.checkboxGroup.includes("is_benefit")
? (this.formValidate.is_benefit = 1)
: (this.formValidate.is_benefit =
0 && this.checkboxGroup.remove("is_benefit"));
this.checkboxGroup.includes("is_best")
? (this.formValidate.is_best = 1)
: (this.formValidate.is_best =
0 && this.checkboxGroup.remove("is_best"));
this.checkboxGroup.includes("is_new")
? (this.formValidate.is_new = 1)
: (this.formValidate.is_new = 0 && this.checkboxGroup.remove("is_new"));
this.checkboxGroup.includes("is_hot")
? (this.formValidate.is_hot = 1)
: (this.formValidate.is_hot = 0 && this.checkboxGroup.remove("is_hot"));
2024-03-22 15:48:25 +08:00
},
onChangeRecommend() {
2024-05-11 14:28:50 +08:00
this.recommendForm.is_benefit = Number(
this.recommendGroup.includes("is_benefit")
);
this.recommendForm.is_best = Number(
this.recommendGroup.includes("is_best")
);
this.recommendForm.is_new = Number(
this.recommendGroup.includes("is_new")
);
this.recommendForm.is_hot = Number(
this.recommendGroup.includes("is_hot")
);
2024-03-22 15:48:25 +08:00
},
handleClose() {
2024-05-11 14:28:50 +08:00
this.dialogVisible = false;
this.dialogLabel = false;
this.dialogRecommend = false;
2024-03-22 15:48:25 +08:00
},
// 批量下架
batchOff() {
2024-05-11 14:28:50 +08:00
if (this.multipleSelection.length === 0)
return this.$message.warning("请先选择商品");
this.toOff(this.OffId);
2024-03-22 15:48:25 +08:00
},
// 批量设置标签
batchLabel() {
this.labelForm = {
2024-08-26 10:28:19 +08:00
tag_name: "",
2024-05-11 14:28:50 +08:00
ids: this.OffId,
};
console.log(this.labelForm);
this.isBatch = true;
this.dialogLabel = true;
2024-03-22 15:48:25 +08:00
},
// 批量显示不显示
batchShow(status) {
2024-05-11 14:28:50 +08:00
if (this.multipleSelection.length === 0)
return this.$message.warning("请先选择商品");
let data = { status: status, ids: this.OffId };
batchesOnOffApi(data)
.then((res) => {
this.$message.success(res.message);
this.getList("");
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
// 下架
toOff(id) {
2024-05-11 14:28:50 +08:00
this.$prompt("强制下架", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputErrorMessage: "请输入强制下架原因",
inputType: "textarea",
inputPlaceholder: "请输入强制下架原因",
2024-03-22 15:48:25 +08:00
inputValidator: (value) => {
2024-05-11 14:28:50 +08:00
if (!value) {
return "请输入强制下架原因";
2024-03-22 15:48:25 +08:00
}
2024-05-11 14:28:50 +08:00
},
})
.then(({ value }) => {
productOffApi({
id: id,
status: -2,
refusal: value,
2024-03-22 15:48:25 +08:00
})
2024-05-11 14:28:50 +08:00
.then((res) => {
this.$message({
type: "success",
message: "提交成功",
});
this.getLstFilterApi();
this.getList("");
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
})
2024-05-11 14:28:50 +08:00
.catch(() => {
this.$message({
type: "info",
message: "取消输入",
});
});
2024-03-22 15:48:25 +08:00
},
// 列表表头;
getLstFilterApi() {
2024-05-11 14:28:50 +08:00
lstFilterApi()
.then((res) => {
this.headeNum = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
// 商户列表;
getMerSelect() {
2024-05-11 14:28:50 +08:00
merSelectApi()
.then((res) => {
this.merSelect = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
batch() {
2024-05-11 14:28:50 +08:00
if (this.multipleSelection.length === 0)
return this.$message.warning("请先选择商品");
this.isShow = false;
this.$refs.infoFrom.dialogVisible = true;
2024-03-22 15:48:25 +08:00
},
handleSelectionChange(val) {
2024-05-11 14:28:50 +08:00
this.multipleSelection = val;
const data = [];
2024-03-22 15:48:25 +08:00
this.multipleSelection.map((item) => {
2024-05-11 14:28:50 +08:00
data.push(item.product_id);
});
this.OffId = data;
2024-03-22 15:48:25 +08:00
},
toExamine(id) {
2024-05-11 14:28:50 +08:00
this.$refs.infoFrom.dialogVisible = true;
this.isShow = true;
this.$refs.infoFrom.getInfo(id);
2024-03-22 15:48:25 +08:00
},
// 商户分类;
getCategorySelect() {
2024-05-11 14:28:50 +08:00
categoryListApi()
.then((res) => {
this.merCateList = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
// 列表
getList(num) {
2024-05-11 14:28:50 +08:00
this.listLoading = true;
2024-03-22 15:48:25 +08:00
this.tableFrom.page = num ? num : this.tableFrom.page;
2024-05-11 14:28:50 +08:00
productLstApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
2024-03-22 15:48:25 +08:00
},
pageChange(page) {
2024-05-11 14:28:50 +08:00
this.tableFrom.page = page;
this.getList("");
2024-03-22 15:48:25 +08:00
},
handleSizeChange(val) {
2024-05-11 14:28:50 +08:00
this.tableFrom.limit = val;
this.getList("");
},
},
};
2024-03-22 15:48:25 +08:00
</script>
<style lang="scss" scoped>
2024-05-11 14:28:50 +08:00
::v-deep .el-select-dropdown__item {
max-width: 350px !important;
2024-03-22 15:48:25 +08:00
}
2024-07-11 14:44:03 +08:00
// ::v-deep.el-table .el-table__fixed-right .el-table__fixed-body-wrapper .el-table__body {
// padding-bottom: 18px!important;
// }
/deep/.el-table__fixed,
/deep/.el-table__fixed-left,
/deep/.el-table__fixed-right {
height: calc(100% - 16px) !important;
}
/deep/.el-table__fixed-body-wrapper {
height: 100% !important;
}
/deep/.el-table__fixed-body-wrapper .el-table__body {
/*滚动条高度*/
padding-bottom: 16px !important;
}
2024-05-11 14:28:50 +08:00
.template {
2024-03-22 15:48:25 +08:00
overflow: hidden;
}
2024-05-11 14:28:50 +08:00
.label-list {
2024-03-22 15:48:25 +08:00
height: 100%;
}
.bg {
z-index: 100;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.1);
}
2024-04-07 20:06:17 +08:00
.pictrue {
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.btndel {
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
2024-05-11 14:28:50 +08:00
.tags_name {
2024-03-22 15:48:25 +08:00
font-size: 10px;
height: 16px;
line-height: 16px;
padding: 0 2px;
margin-right: 2px;
2024-05-11 14:28:50 +08:00
&.name0 {
2024-03-22 15:48:25 +08:00
color: var(--prev-color-primary);
}
2024-05-11 14:28:50 +08:00
&.name1 {
color: #ff8a4d;
2024-03-22 15:48:25 +08:00
}
}
.rate_star {
position: relative;
top: 5px;
}
table .el-image {
display: inline-block;
}
.demo-table-expand {
font-size: 0;
}
.demo-table-expand ::v-deep label {
width: 105px;
2024-05-11 14:28:50 +08:00
color: #99a9bf;
2024-03-22 15:48:25 +08:00
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 33.33%;
}
.seachTiele {
line-height: 35px;
}
.el-dropdown-link {
cursor: pointer;
color: var(--prev-color-primary);
font-size: 12px;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>