|
|
|
@ -2,8 +2,7 @@ |
|
|
|
|
<div class="article-manager"> |
|
|
|
|
<el-card :bordered="false" shadow="never" class="ivu-mt mt16" :body-style="{ padding: '0 20px 20px' }"> |
|
|
|
|
<el-tabs v-model="page.params.type" @tab-click="onClickTab"> |
|
|
|
|
<el-tab-pane :label="item.name + '(' + item.count + ')'" :name="item.type.toString()" |
|
|
|
|
v-for="(item, index) in headeNum" :key="index" /> |
|
|
|
|
<el-tab-pane :label="item.name + '(' + item.count + ')'" :name="item.type.toString()" v-for="(item, index) in headeNum" :key="index" /> |
|
|
|
|
</el-tabs> |
|
|
|
|
<div> |
|
|
|
|
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" inline @submit.native.prevent> |
|
|
|
@ -11,11 +10,21 @@ |
|
|
|
|
<el-input clearable placeholder="请输入商品名称" v-model="page.params.productName" class="form_content_width" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="商品分类:" label-for="pid"> |
|
|
|
|
<el-cascader v-model="page.params.categorys" size="small" :options="treeSelect" :props="{ |
|
|
|
|
multiple: false, emitPath: false, checkStrictly: true, children: 'children', |
|
|
|
|
<el-cascader |
|
|
|
|
v-model="page.params.categorys" |
|
|
|
|
size="small" |
|
|
|
|
:options="treeSelect" |
|
|
|
|
:props="{ |
|
|
|
|
multiple: false, |
|
|
|
|
emitPath: false, |
|
|
|
|
checkStrictly: true, |
|
|
|
|
children: 'children', |
|
|
|
|
label: 'categoryName', |
|
|
|
|
value: 'id' |
|
|
|
|
}" clearable class="form_content_width"></el-cascader> |
|
|
|
|
}" |
|
|
|
|
clearable |
|
|
|
|
class="form_content_width" |
|
|
|
|
></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="商品类型:" prop="productType"> |
|
|
|
|
<el-select style="width: 100%;" v-model="page.params.productType" placeholder="请选择商品类型"> |
|
|
|
@ -24,7 +33,7 @@ |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="油站名称:" label-for="siteName"> |
|
|
|
|
<el-input clearable placeholder="请输入油站名称:" v-model="page.siteName" class="form_content_width" /> |
|
|
|
|
<el-input clearable placeholder="请输入油站名称:" v-model="page.params.siteName" class="form_content_width" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" @click="userSearchs">查询</el-button> |
|
|
|
@ -49,8 +58,16 @@ |
|
|
|
|
<el-button @click="onShelves" v-show="artFrom.type === '2'">批量上架</el-button> |
|
|
|
|
<el-button class="export" @click="exports">导出</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-table ref="table" :data="tableList" class="ivu-mt mt14" v-loading="loading" highlight-current-row |
|
|
|
|
:row-key="getRowKey" @selection-change="handleSelectRow" empty-text="暂无数据"> |
|
|
|
|
<el-table |
|
|
|
|
ref="table" |
|
|
|
|
:data="tableList" |
|
|
|
|
class="ivu-mt mt14" |
|
|
|
|
v-loading="loading" |
|
|
|
|
highlight-current-row |
|
|
|
|
:row-key="getRowKey" |
|
|
|
|
@selection-change="handleSelectRow" |
|
|
|
|
empty-text="暂无数据" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="60" :reserve-selection="true"> </el-table-column> |
|
|
|
|
<el-table-column label="编号"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -69,45 +86,67 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column label="商品名称" min-width="250"> |
|
|
|
|
<el-table-column label="商品名称" min-width="200" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ scope.row.productName }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="价格/货号" min-width="100"> |
|
|
|
|
<el-table-column label="价格/货号" min-width="200"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>价格:¥{{ scope.row.price }}</span> <br /> |
|
|
|
|
<span>货号:{{ scope.row.productNum }}</span> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="标签" min-width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div> |
|
|
|
|
上架: |
|
|
|
|
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.productStatus" |
|
|
|
|
active-color="#13ce66" inactive-color="#ff4949"> </el-switch> |
|
|
|
|
<el-switch |
|
|
|
|
disabled |
|
|
|
|
active-value="1" |
|
|
|
|
inactive-value="2" |
|
|
|
|
v-model="scope.row.productStatus" |
|
|
|
|
active-color="#13ce66" |
|
|
|
|
inactive-color="#ff4949" |
|
|
|
|
> |
|
|
|
|
</el-switch> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
新品: |
|
|
|
|
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.newMark" active-color="#13ce66" |
|
|
|
|
inactive-color="#ff4949"> </el-switch> |
|
|
|
|
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.newMark" active-color="#13ce66" inactive-color="#ff4949"> |
|
|
|
|
</el-switch> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
推荐: |
|
|
|
|
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.recommend" active-color="#13ce66" |
|
|
|
|
inactive-color="#ff4949"> </el-switch> |
|
|
|
|
<el-switch disabled active-value="1" inactive-value="2" v-model="scope.row.recommend" active-color="#13ce66" inactive-color="#ff4949"> |
|
|
|
|
</el-switch> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="库存" min-width="100"> |
|
|
|
|
<el-table-column label="油站" min-width="150" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ scope.row.stockList.length }}</span> <br /> |
|
|
|
|
<span> |
|
|
|
|
{{ scope.row.siteName }} |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="库存" min-width="80"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!-- <span>{{ scope.row.stockList.length }}</span> <br /> --> |
|
|
|
|
<!-- <el-button type="text"> {{ scope.row.stockList.length }}</el-button> <br/> --> |
|
|
|
|
<el-button @click="stockList=scope.row;isEditorStock=true" type="text"> 编辑库存</el-button> <br /> |
|
|
|
|
<el-button |
|
|
|
|
@click=" |
|
|
|
|
stockList = scope.row |
|
|
|
|
isEditorStock = true |
|
|
|
|
" |
|
|
|
|
type="text" |
|
|
|
|
> |
|
|
|
|
编辑库存</el-button |
|
|
|
|
> |
|
|
|
|
<br /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="更新时间" min-width="100"> |
|
|
|
|
<el-table-column label="更新时间" min-width="150"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span> |
|
|
|
|
{{ scope.row.updateTime }} |
|
|
|
@ -118,7 +157,6 @@ |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ scope.row.auditStatus | auditStatusFilter }}</span> <br /> |
|
|
|
|
<el-button @click="openAuditingDetail(scope.row.id)" type="text">审核详情</el-button> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" fixed="right" minWidth="100"> |
|
|
|
@ -126,16 +164,17 @@ |
|
|
|
|
<el-button @click="edit(scope.row)" type="text">编辑</el-button> |
|
|
|
|
|
|
|
|
|
<el-button @click="del(scope.row)" type="text">删除</el-button> |
|
|
|
|
<el-dropdown v-if="scope.row.auditStatus==1" size="small"> |
|
|
|
|
<el-dropdown v-if="scope.row.auditStatus == 1" size="small"> |
|
|
|
|
<span class="el-dropdown-link"> |
|
|
|
|
<el-button type="text">审核</el-button> |
|
|
|
|
<i class="el-icon-arrow-down el-icon--right"></i> </span> |
|
|
|
|
<i class="el-icon-arrow-down el-icon--right"></i> |
|
|
|
|
</span> |
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
<el-dropdown-item> |
|
|
|
|
<el-button @click="auditing(scope.row,2)" type="text">审核通过</el-button> |
|
|
|
|
<el-button @click="auditing(scope.row, 2)" type="text">审核通过</el-button> |
|
|
|
|
</el-dropdown-item> |
|
|
|
|
<el-dropdown-item> |
|
|
|
|
<el-button @click="auditing(scope.row,3)" type="text">审核驳回</el-button> |
|
|
|
|
<el-button @click="auditing(scope.row, 3)" type="text">审核驳回</el-button> |
|
|
|
|
</el-dropdown-item> |
|
|
|
|
</el-dropdown-menu> |
|
|
|
|
</el-dropdown> |
|
|
|
@ -156,9 +195,15 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="acea-row row-right page"> |
|
|
|
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" |
|
|
|
|
:current-page="page.currentPage" :page-sizes="[10, 15, 20, 30]" :page-size="page.pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="page.totalCount" /> |
|
|
|
|
<el-pagination |
|
|
|
|
@size-change="handleSizeChange" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:current-page="page.currentPage" |
|
|
|
|
:page-sizes="[10, 15, 20, 30]" |
|
|
|
|
:page-size="page.pageSize" |
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
:total="page.totalCount" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<attribute :attrTemplate="attrTemplate" v-on:changeTemplate="changeTemplate"></attribute> |
|
|
|
|
</el-card> |
|
|
|
@ -172,16 +217,27 @@ |
|
|
|
|
> |
|
|
|
|
<tao-bao ref="taobaos" v-if="modals" @on-close="onClose"></tao-bao> |
|
|
|
|
</el-dialog> --> |
|
|
|
|
<el-dialog :visible.sync="batchModal" class="batch-box" title="批量设置" :show-close="true" :close-on-click-modal="false" |
|
|
|
|
width="540px"> |
|
|
|
|
<el-form class="batchFormData" ref="batchFormData" :rules="ruleBatch" :model="batchFormData" label-width="90px" |
|
|
|
|
label-position="right" @submit.native.prevent> |
|
|
|
|
<el-dialog :visible.sync="batchModal" class="batch-box" title="批量设置" :show-close="true" :close-on-click-modal="false" width="540px"> |
|
|
|
|
<el-form |
|
|
|
|
class="batchFormData" |
|
|
|
|
ref="batchFormData" |
|
|
|
|
:rules="ruleBatch" |
|
|
|
|
:model="batchFormData" |
|
|
|
|
label-width="90px" |
|
|
|
|
label-position="right" |
|
|
|
|
@submit.native.prevent |
|
|
|
|
> |
|
|
|
|
<el-row :gutter="24"> |
|
|
|
|
<el-col :span="24" v-if="batchType == 1"> |
|
|
|
|
<el-form-item label="商品分类:" prop="cate_id"> |
|
|
|
|
<el-cascader v-model="batchFormData.cate_id" size="small" :options="treeSelect" |
|
|
|
|
:props="{ multiple: true, emitPath: false, checkStrictly: true }" clearable |
|
|
|
|
style="width: 400px"></el-cascader> |
|
|
|
|
<el-cascader |
|
|
|
|
v-model="batchFormData.cate_id" |
|
|
|
|
size="small" |
|
|
|
|
:options="treeSelect" |
|
|
|
|
:props="{ multiple: true, emitPath: false, checkStrictly: true }" |
|
|
|
|
clearable |
|
|
|
|
style="width: 400px" |
|
|
|
|
></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24" v-if="batchType == 2"> |
|
|
|
@ -200,29 +256,31 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="" v-if="batchFormData.freight == 2"> |
|
|
|
|
<div class="acea-row"> |
|
|
|
|
<el-input-number :controls="false" :min="0" v-model="batchFormData.postage" placeholder="请输入金额" |
|
|
|
|
class="perW20 maxW" /> |
|
|
|
|
<el-input-number :controls="false" :min="0" v-model="batchFormData.postage" placeholder="请输入金额" class="perW20 maxW" /> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="" v-if="batchFormData.freight == 3" prop="temp_id"> |
|
|
|
|
<div class="acea-row"> |
|
|
|
|
<el-select v-model="batchFormData.temp_id" clearable placeholder="请选择运费模板" style="width: 414px"> |
|
|
|
|
<el-option v-for="(item, index) in templateList" :value="item.id" :key="index" |
|
|
|
|
:label="item.name"></el-option> |
|
|
|
|
<el-option v-for="(item, index) in templateList" :value="item.id" :key="index" :label="item.name"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24" v-if="[3, 4, 5, 6].includes(batchType)"> |
|
|
|
|
<el-form-item label="赠送积分:" prop="give_integral" v-if="batchType == 3"> |
|
|
|
|
<el-input-number :controls="false" v-model="batchFormData.give_integral" :min="0" :max="9999999999" |
|
|
|
|
placeholder="请输入积分" style="width: 100%" /> |
|
|
|
|
<el-input-number |
|
|
|
|
:controls="false" |
|
|
|
|
v-model="batchFormData.give_integral" |
|
|
|
|
:min="0" |
|
|
|
|
:max="9999999999" |
|
|
|
|
placeholder="请输入积分" |
|
|
|
|
style="width: 100%" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="赠送优惠券:" v-if="batchType == 4"> |
|
|
|
|
<div v-if="couponName.length" class="mb20"> |
|
|
|
|
<el-tag closable v-for="(item, index) in couponName" :key="index" @close="handleClose(item)">{{ |
|
|
|
|
item.title |
|
|
|
|
}}</el-tag> |
|
|
|
|
<el-tag closable v-for="(item, index) in couponName" :key="index" @close="handleClose(item)">{{ item.title }}</el-tag> |
|
|
|
|
</div> |
|
|
|
|
<el-button type="primary" @click="addCoupon">添加优惠券</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
@ -231,9 +289,7 @@ |
|
|
|
|
<div class="labelInput acea-row row-between-wrapper" @click="openLabel"> |
|
|
|
|
<div style="width: 90%"> |
|
|
|
|
<div v-if="dataLabel.length"> |
|
|
|
|
<el-tag closable v-for="(item, index) in dataLabel" @close="closeLabel(item)" :key="index">{{ |
|
|
|
|
item.label_name |
|
|
|
|
}}</el-tag> |
|
|
|
|
<el-tag closable v-for="(item, index) in dataLabel" @close="closeLabel(item)" :key="index">{{ item.label_name }}</el-tag> |
|
|
|
|
</div> |
|
|
|
|
<span class="span" v-else>选择用户关联标签</span> |
|
|
|
|
</div> |
|
|
|
@ -278,14 +334,14 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import expandRow from './tableExpand.vue'; |
|
|
|
|
import attribute from './attribute'; |
|
|
|
|
import taoBao from './taoBao'; |
|
|
|
|
import goodsDetail from './components/goodsDetail.vue'; |
|
|
|
|
import couponList from '@/components/couponList'; |
|
|
|
|
import userLabel from '@/components/labelList'; |
|
|
|
|
import productApi from '@/api/product/productAttr.js'; |
|
|
|
|
import { loadingFn } from "@/utils/validate"; |
|
|
|
|
import expandRow from './tableExpand.vue' |
|
|
|
|
import attribute from './attribute' |
|
|
|
|
import taoBao from './taoBao' |
|
|
|
|
import goodsDetail from './components/goodsDetail.vue' |
|
|
|
|
import couponList from '@/components/couponList' |
|
|
|
|
import userLabel from '@/components/labelList' |
|
|
|
|
import productApi from '@/api/product/productAttr.js' |
|
|
|
|
import { loadingFn } from '@/utils/validate' |
|
|
|
|
import EditorStock from './components/EditorStock.vue' |
|
|
|
|
import AuditingDetail from './components/AuditingDetail.vue' |
|
|
|
|
|
|
|
|
@ -294,23 +350,23 @@ export default { |
|
|
|
|
auditStatusFilter(e) { |
|
|
|
|
switch (e) { |
|
|
|
|
case '1': |
|
|
|
|
return "待审核" |
|
|
|
|
return '待审核' |
|
|
|
|
case '2': |
|
|
|
|
return "通过" |
|
|
|
|
return '通过' |
|
|
|
|
case '3': |
|
|
|
|
return "不通过" |
|
|
|
|
return '不通过' |
|
|
|
|
default: |
|
|
|
|
return "暂无数据" |
|
|
|
|
return '暂无数据' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
name: 'product_productList', |
|
|
|
|
components: { expandRow, attribute, taoBao, goodsDetail, userLabel, couponList,EditorStock,AuditingDetail }, |
|
|
|
|
components: { expandRow, attribute, taoBao, goodsDetail, userLabel, couponList, EditorStock, AuditingDetail }, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
isAuditingDetail:false, |
|
|
|
|
stockList:{}, |
|
|
|
|
isEditorStock:false, |
|
|
|
|
isAuditingDetail: false, |
|
|
|
|
stockList: {}, |
|
|
|
|
isEditorStock: false, |
|
|
|
|
template: false, |
|
|
|
|
modals: false, |
|
|
|
|
batchModal: false, |
|
|
|
@ -325,7 +381,7 @@ export default { |
|
|
|
|
give_integral: 0, |
|
|
|
|
label_id: [], |
|
|
|
|
coupon_ids: [], |
|
|
|
|
recommend: [], |
|
|
|
|
recommend: [] |
|
|
|
|
}, |
|
|
|
|
ruleBatch: {}, |
|
|
|
|
couponName: [], // 优惠券 |
|
|
|
@ -336,14 +392,14 @@ export default { |
|
|
|
|
lg: 8, |
|
|
|
|
md: 12, |
|
|
|
|
sm: 24, |
|
|
|
|
xs: 24, |
|
|
|
|
xs: 24 |
|
|
|
|
}, |
|
|
|
|
page: { |
|
|
|
|
"currentPage": 1, |
|
|
|
|
"pageSize": 10, |
|
|
|
|
"params": { |
|
|
|
|
brandName: "", |
|
|
|
|
type:"0" |
|
|
|
|
currentPage: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
params: { |
|
|
|
|
brandName: '', |
|
|
|
|
type: '0' |
|
|
|
|
}, |
|
|
|
|
totalCount: 0 |
|
|
|
|
}, |
|
|
|
@ -352,41 +408,41 @@ export default { |
|
|
|
|
limit: 15, |
|
|
|
|
cate_id: '', |
|
|
|
|
type: '1', |
|
|
|
|
store_name: '', |
|
|
|
|
store_name: '' |
|
|
|
|
}, |
|
|
|
|
list: [], |
|
|
|
|
tableList: [], |
|
|
|
|
headeNum: [ |
|
|
|
|
{ |
|
|
|
|
"count": 2, |
|
|
|
|
"name": "全部商品", |
|
|
|
|
"type":0, |
|
|
|
|
"params": {} |
|
|
|
|
count: '', |
|
|
|
|
name: '全部商品', |
|
|
|
|
type: 0, |
|
|
|
|
params: {} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"count": 40, |
|
|
|
|
"name": "已上架", |
|
|
|
|
"type": 1, |
|
|
|
|
"params": { |
|
|
|
|
"productStatus": "1" |
|
|
|
|
count: '', |
|
|
|
|
name: '已上架', |
|
|
|
|
type: 1, |
|
|
|
|
params: { |
|
|
|
|
productStatus: '1' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"count": 5, |
|
|
|
|
"name": "未上架", |
|
|
|
|
"type": 2, |
|
|
|
|
"params": { |
|
|
|
|
"productStatus": "2" |
|
|
|
|
count: '', |
|
|
|
|
name: '未上架', |
|
|
|
|
type: 2, |
|
|
|
|
params: { |
|
|
|
|
productStatus: '2' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"count": 10, |
|
|
|
|
"name": "待审核", |
|
|
|
|
"type": 3, |
|
|
|
|
"params": { |
|
|
|
|
"auditStatus": "1" |
|
|
|
|
count: '', |
|
|
|
|
name: '待审核', |
|
|
|
|
type: 3, |
|
|
|
|
params: { |
|
|
|
|
auditStatus: '1' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
loading: false, |
|
|
|
|
data: [], |
|
|
|
@ -396,57 +452,66 @@ export default { |
|
|
|
|
goodsId: '', |
|
|
|
|
isProductBox: false, |
|
|
|
|
treeSelect: [], |
|
|
|
|
multipleSelection: [], |
|
|
|
|
}; |
|
|
|
|
multipleSelection: [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.init() |
|
|
|
|
}, |
|
|
|
|
activated() { }, |
|
|
|
|
activated() {}, |
|
|
|
|
methods: { |
|
|
|
|
auditing(row,auditStatus){ |
|
|
|
|
auditing(row, auditStatus) { |
|
|
|
|
this.$prompt('审核', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
inputPlaceholder:"请输入审核说明", |
|
|
|
|
inputPlaceholder: '请输入审核说明', |
|
|
|
|
inputPattern: /^.+$/, |
|
|
|
|
inputErrorMessage: '审核说明不能为空' |
|
|
|
|
}).then(({ value }) => { |
|
|
|
|
productApi.productListAuditProduct(Object.assign(row,{auditRemark:value,auditStatus})).then(res=>{ |
|
|
|
|
if(res.code==20000){ |
|
|
|
|
this.$message.success("操作成功!"); |
|
|
|
|
this.handleCurrentChange(); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
.then(({ value }) => { |
|
|
|
|
productApi.productListAuditProduct(Object.assign(row, { auditRemark: value, auditStatus })).then(res => { |
|
|
|
|
if (res.code == 20000) { |
|
|
|
|
this.$message.success('操作成功!') |
|
|
|
|
this.handleCurrentChange() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}).catch((e) => { |
|
|
|
|
}) |
|
|
|
|
.catch(e => { |
|
|
|
|
console.log(e) |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
openAuditingDetail(id){ |
|
|
|
|
this.isAuditingDetail=true; |
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
this.$refs.AuditingDetail.getByPage(id); |
|
|
|
|
openAuditingDetail(id) { |
|
|
|
|
this.isAuditingDetail = true |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.AuditingDetail.getByPage(id) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
editorStockSubmit(stockList){ |
|
|
|
|
let { id:productId} = this.stockList; |
|
|
|
|
productApi.productListUpdateBatchList({ |
|
|
|
|
editorStockSubmit(stockList) { |
|
|
|
|
let { id: productId } = this.stockList |
|
|
|
|
productApi |
|
|
|
|
.productListUpdateBatchList({ |
|
|
|
|
productId, |
|
|
|
|
stockList:stockList.map(item=>{ return { |
|
|
|
|
stockList: stockList.map(item => { |
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
attributeJson:JSON.stringify( item.attributeJson) |
|
|
|
|
} }) |
|
|
|
|
}).then(res=>{ |
|
|
|
|
attributeJson: JSON.stringify(item.attributeJson) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.code == 20000) { |
|
|
|
|
this.isEditorStock = false |
|
|
|
|
this.$message.success('操作成功!') |
|
|
|
|
this.handleCurrentChange() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
init() { |
|
|
|
|
this.getCategorySelect(); |
|
|
|
|
this.getDataList(); |
|
|
|
|
this.getCategorySelect() |
|
|
|
|
this.getDataList() |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
this.page.currentPage = val; |
|
|
|
|
this.page.currentPage = val |
|
|
|
|
this.getDataList() |
|
|
|
|
}, |
|
|
|
|
handleSizeChange(val) { |
|
|
|
@ -457,96 +522,96 @@ export default { |
|
|
|
|
getCategorySelect() { |
|
|
|
|
productApi.getClassificationTree().then(res => { |
|
|
|
|
if (res.code == 20000) { |
|
|
|
|
this.treeSelect = res.data; |
|
|
|
|
this.treeSelect = res.data |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getList() { }, |
|
|
|
|
getList() {}, |
|
|
|
|
|
|
|
|
|
batchSub() { }, |
|
|
|
|
clearBatchData(status) { }, |
|
|
|
|
batchSub() {}, |
|
|
|
|
clearBatchData(status) {}, |
|
|
|
|
// 批量设置商品 |
|
|
|
|
batchSelect(type) { }, |
|
|
|
|
activeData(dataLabel) { }, |
|
|
|
|
nameId(id, names) { }, |
|
|
|
|
handleClose(name) { }, |
|
|
|
|
batchSelect(type) {}, |
|
|
|
|
activeData(dataLabel) {}, |
|
|
|
|
nameId(id, names) {}, |
|
|
|
|
handleClose(name) {}, |
|
|
|
|
//对象数组去重; |
|
|
|
|
unique(arr) { |
|
|
|
|
const res = new Map(); |
|
|
|
|
return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1)); |
|
|
|
|
const res = new Map() |
|
|
|
|
return arr.filter(arr => !res.has(arr.id) && res.set(arr.id, 1)) |
|
|
|
|
}, |
|
|
|
|
// 获取运费模板; |
|
|
|
|
productGetTemplate() { }, |
|
|
|
|
productGetTemplate() {}, |
|
|
|
|
// 标签弹窗关闭 |
|
|
|
|
labelClose() { }, |
|
|
|
|
labelClose() {}, |
|
|
|
|
look(row) { |
|
|
|
|
this.goodsId = row.id; |
|
|
|
|
this.isProductBox = true; |
|
|
|
|
this.goodsId = row.id |
|
|
|
|
this.isProductBox = true |
|
|
|
|
}, |
|
|
|
|
// 物流方式 |
|
|
|
|
logisticsBtn(e) { |
|
|
|
|
this.batchFormData.logistics = e; |
|
|
|
|
this.batchFormData.logistics = e |
|
|
|
|
}, |
|
|
|
|
// 关联用户标签 |
|
|
|
|
openLabel() { |
|
|
|
|
this.labelShow = true; |
|
|
|
|
this.labelShow = true |
|
|
|
|
}, |
|
|
|
|
closeLabel(label) { |
|
|
|
|
let index = this.dataLabel.indexOf(this.dataLabel.filter((d) => d.id == label.id)[0]); |
|
|
|
|
this.dataLabel.splice(index, 1); |
|
|
|
|
let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]) |
|
|
|
|
this.dataLabel.splice(index, 1) |
|
|
|
|
}, |
|
|
|
|
// 添加优惠券 |
|
|
|
|
addCoupon() { }, |
|
|
|
|
getPath() { }, |
|
|
|
|
addCoupon() {}, |
|
|
|
|
getPath() {}, |
|
|
|
|
// 导出 |
|
|
|
|
async exports() { |
|
|
|
|
let [th, filekey, data, fileName] = [[], [], [], '']; |
|
|
|
|
let excelData = JSON.parse(JSON.stringify(this.artFrom)); |
|
|
|
|
excelData.page = 1; |
|
|
|
|
excelData.limit = 50; |
|
|
|
|
excelData.ids = this.ids; |
|
|
|
|
let [th, filekey, data, fileName] = [[], [], [], ''] |
|
|
|
|
let excelData = JSON.parse(JSON.stringify(this.artFrom)) |
|
|
|
|
excelData.page = 1 |
|
|
|
|
excelData.limit = 50 |
|
|
|
|
excelData.ids = this.ids |
|
|
|
|
for (let i = 0; i < excelData.page + 1; i++) { |
|
|
|
|
let lebData = await this.getExcelData(excelData); |
|
|
|
|
if (!fileName) fileName = lebData.filename; |
|
|
|
|
let lebData = await this.getExcelData(excelData) |
|
|
|
|
if (!fileName) fileName = lebData.filename |
|
|
|
|
if (!filekey.length) { |
|
|
|
|
filekey = lebData.fileKey; |
|
|
|
|
filekey = lebData.fileKey |
|
|
|
|
} |
|
|
|
|
if (!th.length) th = lebData.header; |
|
|
|
|
if (!th.length) th = lebData.header |
|
|
|
|
if (lebData.export.length) { |
|
|
|
|
data = data.concat(lebData.export); |
|
|
|
|
excelData.page++; |
|
|
|
|
data = data.concat(lebData.export) |
|
|
|
|
excelData.page++ |
|
|
|
|
} else { |
|
|
|
|
this.$exportExcel(th, filekey, fileName, data); |
|
|
|
|
return; |
|
|
|
|
this.$exportExcel(th, filekey, fileName, data) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getExcelData(excelData) { }, |
|
|
|
|
freight() { }, |
|
|
|
|
getExcelData(excelData) {}, |
|
|
|
|
freight() {}, |
|
|
|
|
// 批量上架 |
|
|
|
|
onShelves() { }, |
|
|
|
|
onShelves() {}, |
|
|
|
|
// 批量下架 |
|
|
|
|
onDismount() { }, |
|
|
|
|
onDismount() {}, |
|
|
|
|
getRowKey(row) { |
|
|
|
|
return row.id; |
|
|
|
|
return row.id |
|
|
|
|
}, |
|
|
|
|
// 选中某一行 |
|
|
|
|
handleSelectRow(selection) { |
|
|
|
|
const uniqueArr = []; |
|
|
|
|
const ids = []; |
|
|
|
|
const uniqueArr = [] |
|
|
|
|
const ids = [] |
|
|
|
|
for (let i = 0; i < selection.length; i++) { |
|
|
|
|
const item = selection[i]; |
|
|
|
|
const item = selection[i] |
|
|
|
|
if (!ids.includes(item.id)) { |
|
|
|
|
uniqueArr.push(item); |
|
|
|
|
ids.push(item.id); |
|
|
|
|
uniqueArr.push(item) |
|
|
|
|
ids.push(item.id) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.ids = ids; |
|
|
|
|
this.multipleSelection = uniqueArr; |
|
|
|
|
this.ids = ids |
|
|
|
|
this.multipleSelection = uniqueArr |
|
|
|
|
}, |
|
|
|
|
// 添加淘宝商品成功 |
|
|
|
|
onClose() { |
|
|
|
|
this.modals = false; |
|
|
|
|
this.modals = false |
|
|
|
|
}, |
|
|
|
|
// 复制淘宝 |
|
|
|
|
onCopy() { |
|
|
|
@ -557,54 +622,60 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// tab选择 |
|
|
|
|
onClickTab() { |
|
|
|
|
console.log(this.page.params.type,"params"); |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
this.page.params = {type:this.page.params.type}; |
|
|
|
|
this.getDataList( Object.assign({},this.page,{params:this.headeNum[this.page.params.type].params})); |
|
|
|
|
console.log(this.page.params.type, 'params') |
|
|
|
|
this.page.currentPage = 1 |
|
|
|
|
this.multipleSelection = [] |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.page.params = { type: this.page.params.type } |
|
|
|
|
this.getDataList(Object.assign({}, this.page, { params: this.headeNum[this.page.params.type].params })) |
|
|
|
|
}, |
|
|
|
|
// 下拉树 |
|
|
|
|
handleCheckChange(data) { |
|
|
|
|
let value = ''; |
|
|
|
|
let title = ''; |
|
|
|
|
this.list = []; |
|
|
|
|
this.artFrom.cate_id = 0; |
|
|
|
|
let value = '' |
|
|
|
|
let title = '' |
|
|
|
|
this.list = [] |
|
|
|
|
this.artFrom.cate_id = 0 |
|
|
|
|
data.forEach((item, index) => { |
|
|
|
|
value += `${item.id},`; |
|
|
|
|
title += `${item.title},`; |
|
|
|
|
}); |
|
|
|
|
value = value.substring(0, value.length - 1); |
|
|
|
|
title = title.substring(0, title.length - 1); |
|
|
|
|
value += `${item.id},` |
|
|
|
|
title += `${item.title},` |
|
|
|
|
}) |
|
|
|
|
value = value.substring(0, value.length - 1) |
|
|
|
|
title = title.substring(0, title.length - 1) |
|
|
|
|
this.list.push({ |
|
|
|
|
value, |
|
|
|
|
title, |
|
|
|
|
}); |
|
|
|
|
this.artFrom.cate_id = value; |
|
|
|
|
this.getDataList(); |
|
|
|
|
title |
|
|
|
|
}) |
|
|
|
|
this.artFrom.cate_id = value |
|
|
|
|
this.getDataList() |
|
|
|
|
}, |
|
|
|
|
// 获取商品表单头数量 |
|
|
|
|
goodHeade() { }, |
|
|
|
|
goodHeade() {}, |
|
|
|
|
// 商品分类; |
|
|
|
|
goodsCategory() { |
|
|
|
|
}, |
|
|
|
|
goodsCategory() {}, |
|
|
|
|
// 商品列表; |
|
|
|
|
getDataList(page) { |
|
|
|
|
loadingFn.call(this, "loading", productApi.productListGetByPage(page?page:this.page).then(res => { |
|
|
|
|
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.page.totalCount = 0 } = res.data); |
|
|
|
|
})); |
|
|
|
|
}, |
|
|
|
|
showSelectData() { |
|
|
|
|
loadingFn.call( |
|
|
|
|
this, |
|
|
|
|
'loading', |
|
|
|
|
productApi.productListGetByPage(page ? page : this.page).then(res => { |
|
|
|
|
if ((res.code = 20000)) ({ list: this.tableList = [], totalCount: this.page.totalCount = 0 } = res.data) |
|
|
|
|
this.headeNum[0].count = res.data.allCount |
|
|
|
|
this.headeNum[1].count = res.data.upCount |
|
|
|
|
this.headeNum[2].count = res.data.downCount |
|
|
|
|
this.headeNum[3].count = res.data.auditCount |
|
|
|
|
}) |
|
|
|
|
) |
|
|
|
|
}, |
|
|
|
|
showSelectData() {}, |
|
|
|
|
// 表格搜索 |
|
|
|
|
userSearchs() { |
|
|
|
|
this.handleCurrentChange(); |
|
|
|
|
this.handleCurrentChange() |
|
|
|
|
// this.artFrom.page = 1; |
|
|
|
|
}, |
|
|
|
|
// 上下架 |
|
|
|
|
changeSwitch(row) { }, |
|
|
|
|
changeSwitch(row) {}, |
|
|
|
|
// 数据导出; |
|
|
|
|
exportData: function () { |
|
|
|
|
exportData: function() { |
|
|
|
|
// let th = ['商品名称', '商品简介', '商品分类', '价格', '库存', '销量', '收藏人数']; |
|
|
|
|
// let filterVal = ['store_name', 'store_info', 'cate_name', 'price', 'stock', 'sales', 'collect']; |
|
|
|
|
// this.where.page = 'nopage'; |
|
|
|
@ -617,18 +688,18 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 属性弹出; |
|
|
|
|
attrTap() { |
|
|
|
|
this.attrTemplate = true; |
|
|
|
|
this.attrTemplate = true |
|
|
|
|
}, |
|
|
|
|
changeTemplate(msg) { |
|
|
|
|
this.attrTemplate = msg; |
|
|
|
|
this.attrTemplate = msg |
|
|
|
|
}, |
|
|
|
|
// 编辑 |
|
|
|
|
edit(row) { |
|
|
|
|
console.log(row) |
|
|
|
|
this.$router.push({ |
|
|
|
|
name:"productAdd", |
|
|
|
|
params:{ |
|
|
|
|
id:row.id |
|
|
|
|
name: 'productAdd', |
|
|
|
|
params: { |
|
|
|
|
id: row.id |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// this.$router.push({ path: this.$routeProStr + '/product/add_product/' + row.id }); |
|
|
|
@ -638,17 +709,16 @@ export default { |
|
|
|
|
this.$alert('请确定删除!', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
callback: action => { |
|
|
|
|
if (action == "confirm") { |
|
|
|
|
if (action == 'confirm') { |
|
|
|
|
productApi.productListDelete(row).then(res => { |
|
|
|
|
if (res.code == 20000) { |
|
|
|
|
this.$message.success("操作成功!") |
|
|
|
|
this.$message.success('操作成功!') |
|
|
|
|
this.handleCurrentChange() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
// let delfromData = { |
|
|
|
|
// title: tit, |
|
|
|
|
// num: num, |
|
|
|
@ -667,9 +737,9 @@ export default { |
|
|
|
|
// .catch((res) => { |
|
|
|
|
// this.$message.error(res.msg); |
|
|
|
|
// }); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
::v-deep .el-tabs__item { |
|
|
|
|