|
|
@@ -6,142 +6,213 @@
|
|
|
<el-option v-for="item in storeInfos" :key="item.id" :label="item.storeName" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select> -->
|
|
|
- <el-select v-model="onShelfFlag" clearable filterable placeholder="上下架" @change="storeIdChange" size="small" style="width:120px">
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <el-radio-group v-model="onShelfFlag" @change="getData">
|
|
|
+ <el-radio-button label="">全部</el-radio-button>
|
|
|
+ <el-radio-button label="N">已下架</el-radio-button>
|
|
|
+ <el-radio-button label="Y">已上架</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div style="padding:10px 0;">
|
|
|
+ <el-radio-group v-model="itemType" @change="getData">
|
|
|
+ <el-radio-button label="" >全部</el-radio-button>
|
|
|
+ <el-radio-button :label="item.id" v-for="item in itemTypes"
|
|
|
+ :key="item.id">{{item.typeName}}</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <!-- <el-select v-model="onShelfFlag" clearable filterable
|
|
|
+ placeholder="上下架" @change="storeIdChange" size="small"
|
|
|
+ style="width:120px">
|
|
|
<el-option key="N" label="下架" value="N">
|
|
|
</el-option>
|
|
|
<el-option key="Y" label="上架" value="Y">
|
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
- <el-select v-model="itemType" clearable filterable placeholder="类目" @change="storeIdChange" size="small" style="width:120px">
|
|
|
- <el-option v-for="item in itemTypes" :key="item.id" :label="item.typeName" :value="item.id">
|
|
|
+ </el-select> -->
|
|
|
+ <!-- <el-select v-model="itemType" clearable filterable placeholder="类目"
|
|
|
+ @change="storeIdChange" size="small" style="width:120px">
|
|
|
+ <el-option v-for="item in itemTypes" :key="item.id"
|
|
|
+ :label="item.typeName" :value="item.id">
|
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
- <el-input placeholder="关键字" v-model="filter1" clearable class="filter-item" size="small" style="width:120px"></el-input>
|
|
|
- <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
|
|
|
+ </el-select> -->
|
|
|
+ <el-input placeholder="关键字" v-model="filter1" clearable
|
|
|
+ class="filter-item" size="small" style="width:120px"></el-input>
|
|
|
+ <el-button @click="searchData" type="primary" size="small"
|
|
|
+ icon="el-icon-search" class="filter-item">搜索
|
|
|
</el-button>
|
|
|
<!-- <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
|
|
|
</el-button> -->
|
|
|
- <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small" icon="el-icon-sort" class="filter-item">排序
|
|
|
+ <el-button @click="showTableSortDialog = !showTableSortDialog"
|
|
|
+ type="primary" size="small" icon="el-icon-sort"
|
|
|
+ class="filter-item">排序
|
|
|
</el-button>
|
|
|
<!-- <el-button @click="$router.push({path:'/productInfo',query:{column:$route.query.column}})" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
|
|
|
</el-button> -->
|
|
|
<!-- <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
|
|
|
</el-button> -->
|
|
|
- <el-dropdown trigger="click" size="medium" class="table-column-filter">
|
|
|
+ <el-dropdown trigger="click" size="medium"
|
|
|
+ class="table-column-filter">
|
|
|
<span>
|
|
|
筛选数据
|
|
|
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</span>
|
|
|
- <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
|
|
|
- <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
|
|
|
+ <el-dropdown-menu slot="dropdown"
|
|
|
+ class="table-column-filter-wrapper">
|
|
|
+ <el-checkbox v-for="item in tableColumns" :key="item.value"
|
|
|
+ v-model="item.show">{{item.label}}
|
|
|
</el-checkbox>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
- <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
|
|
|
- <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
|
|
|
+ <el-table :data="tableData" :height="tableHeight" row-key="id"
|
|
|
+ ref="table">
|
|
|
+ <el-table-column v-if="multipleMode" align="center" type="selection"
|
|
|
+ width="50">
|
|
|
</el-table-column>
|
|
|
<el-table-column type="index" min-width="50" align="center">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('serviceType')" align="center" :show-overflow-tooltip='true' prop="serviceType" label="大类" :formatter="ServiceTypeFormatter" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('serviceType')" align="center"
|
|
|
+ :show-overflow-tooltip='true' prop="serviceType" label="大类"
|
|
|
+ :formatter="ServiceTypeFormatter" min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
<!-- <el-table-column v-if="isColumnShow('subclass')" align="center" :show-overflow-tooltip='true' prop="subclass" label="小类" :formatter="ServiceTypeDetailFormatter" min-width="100">
|
|
|
</el-table-column> -->
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('title')" align="center" :show-overflow-tooltip='true' prop="title" label="标题" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('title')" align="center"
|
|
|
+ :show-overflow-tooltip='true' prop="title" label="标题"
|
|
|
+ min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('image')" prop="image" label="主图" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('image')" prop="image"
|
|
|
+ label="主图" min-width="150">
|
|
|
<template slot-scope="{row}" v-if="row.image">
|
|
|
- <img :src="row.image+'?x-oss-process=image/resize,m_pad,h_60,w_60,color_FFFFFF'" style="cursor:pointer" @click="showImg(row.image)" />
|
|
|
+ <img :src="row.image+'?x-oss-process=image/resize,m_pad,h_120,w_120'"
|
|
|
+ style="cursor:pointer" @click="showImg(row.image)" />
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('serviceDetail')" align="center" :show-overflow-tooltip='true' prop="serviceDetail" label="服务详情" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('serviceDetail')" align="center"
|
|
|
+ :show-overflow-tooltip='true' prop="serviceDetail" label="服务详情"
|
|
|
+ min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('inventory')" align="center" :show-overflow-tooltip='true' prop="inventory" label="库存" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('inventory')" align="center"
|
|
|
+ :show-overflow-tooltip='true' prop="inventory" label="库存"
|
|
|
+ min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('onShelf')" align="center" prop="onShelf" label="上下架" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('onShelf')" align="center"
|
|
|
+ prop="onShelf" label="上下架" min-width="100">
|
|
|
<template slot-scope="{row}">
|
|
|
{{row.onShelf=='Y'?'上架':'下架'}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('useFlag')" align="center" prop="useFlag" label="可用" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('useFlag')" align="center"
|
|
|
+ prop="useFlag" label="可用" min-width="100">
|
|
|
<template slot-scope="{row}">
|
|
|
{{row.useFlag=='Y'?'可用':'不可用'}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('hotFlag')" align="center" prop="hotFlag" label="热门" :formatter="YNFormatter" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('hotFlag')" align="center"
|
|
|
+ prop="hotFlag" label="热门" :formatter="YNFormatter"
|
|
|
+ min-width="100">
|
|
|
<template slot-scope="{row}">
|
|
|
{{row.hotFlag==1?'热门':'不热门'}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('homeFlag')" align="center" prop="homeFlag" label="首页" :formatter="YNFormatter" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('homeFlag')" align="center"
|
|
|
+ prop="homeFlag" label="首页" :formatter="YNFormatter"
|
|
|
+ min-width="100">
|
|
|
<template slot-scope="{row}">
|
|
|
{{row.homeFlag==1?'是':'否'}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('rank')" align="center" prop="rank" label="排序" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('rank')" align="center"
|
|
|
+ prop="rank" label="排序" min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('storeId')" align="center" prop="storeId" label="店铺ID" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('storeId')" align="center"
|
|
|
+ prop="storeId" label="店铺ID" min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('typeFlag')" align="center" prop="typeFlag" label="类型" :formatter="TypeFlagFormatter" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('typeFlag')" align="center"
|
|
|
+ prop="typeFlag" label="类型" :formatter="TypeFlagFormatter"
|
|
|
+ min-width="100">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-if="isColumnShow('salesVolume')" align="center" prop="salesVolume" label="销量" min-width="100">
|
|
|
+ <el-table-column v-if="isColumnShow('salesVolume')" align="center"
|
|
|
+ prop="salesVolume" label="销量" min-width="100">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" fixed="right" min-width="170">
|
|
|
+ <el-table-column label="操作" align="center" fixed="right"
|
|
|
+ min-width="170">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-button @click="detailRow(scope.row)" type="primary" size="mini" plain>详情</el-button> -->
|
|
|
|
|
|
- <el-button @click="editRow(scope.row)" size="mini" plain>编辑</el-button>
|
|
|
+ <el-button type="primary" @click="editRow(scope.row)" size="mini" plain>编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click="$router.push({path:'/productComments',query:{column:scope.row.id+',productId'}})"
|
|
|
+ type="warning" size="mini" plain>查看评论</el-button>
|
|
|
|
|
|
- <el-dropdown>
|
|
|
+ <!-- <el-dropdown>
|
|
|
<el-button type="warning" size="mini" plain>
|
|
|
更多
|
|
|
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-button @click="$router.push({path:'/productImages',query:{column:scope.row.id+',productId'}})" type="primary" size="small" plain>图片</el-button>
|
|
|
- <el-button @click="$router.push({path:'/productParameters',query:{column:scope.row.id+',productId'}})" type="primary" size="small" plain>详情</el-button>
|
|
|
- <el-button @click="$router.push({path:'/productComments',query:{column:scope.row.id+',productId'}})" type="primary" size="small" plain>评论</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="$router.push({path:'/productImages',query:{column:scope.row.id+',productId'}})"
|
|
|
+ type="primary" size="small" plain>图片</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="$router.push({path:'/productParameters',query:{column:scope.row.id+',productId'}})"
|
|
|
+ type="primary" size="small" plain>详情</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="$router.push({path:'/productComments',query:{column:scope.row.id+',productId'}})"
|
|
|
+ type="primary" size="small" plain>评论</el-button>
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
+ </el-dropdown> -->
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div class="pagination-wrapper">
|
|
|
<div class="multiple-mode-wrapper" v-if="0">
|
|
|
- <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
|
|
|
+ <el-button size="small" v-if="!multipleMode"
|
|
|
+ @click="toggleMultipleMode(true)">批量编辑</el-button>
|
|
|
<el-button-group v-else>
|
|
|
- <el-button size="small" @click="operation1">批量操作1</el-button>
|
|
|
- <el-button size="small" @click="operation2">批量操作2</el-button>
|
|
|
- <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
|
|
|
+ <el-button size="small" @click="operation1">批量操作1
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" @click="operation2">批量操作2
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" @click="toggleMultipleMode(false)">
|
|
|
+ 取消</el-button>
|
|
|
</el-button-group>
|
|
|
</div>
|
|
|
- <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
|
|
|
+ <el-pagination background @size-change="pageSizeChange"
|
|
|
+ @current-change="currentPageChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="totalNumber">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
|
|
|
- <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
|
|
|
+ <el-button @click="addField" type="text" icon="el-icon-plus">添加
|
|
|
+ </el-button>
|
|
|
<el-table :data="advancedQueryFields">
|
|
|
|
|
|
<el-table-column prop="link" label="链接符" align="center">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
|
|
|
+ <el-select placeholder="链接" size="small"
|
|
|
+ v-model="row.link" class="filter-item">
|
|
|
<el-option label="AND" value="AND">
|
|
|
</el-option>
|
|
|
<el-option label="OR" value="OR">
|
|
|
@@ -153,14 +224,19 @@
|
|
|
<template slot-scope="{row}">
|
|
|
<el-select v-model="row.name">
|
|
|
|
|
|
- <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
|
|
|
+ <el-option v-for="item in advancedQueryColumns"
|
|
|
+ :label="item.label" :value="item.value"
|
|
|
+ :key="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
|
|
|
+ <el-table-column prop="searchMethod" label="搜索方式" width="150"
|
|
|
+ align="center">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-select v-model="row.searchMethod">
|
|
|
- <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
|
|
|
+ <el-option v-for="item in searchMethods"
|
|
|
+ :label="item" :value="item" :key="item">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -171,26 +247,31 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column width="60" align="center">
|
|
|
<template slot-scope="{ row, column, $index }">
|
|
|
- <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
|
|
|
+ <el-button @click="removeField($index)" size="small"
|
|
|
+ type="text">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
|
- <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
|
|
|
+ <el-button @click="advancedQuery"
|
|
|
+ :loading="$store.state.fetchingData">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog title="排序" :visible.sync="showTableSortDialog">
|
|
|
- <el-button @click="addSortField" type="text" icon="el-icon-plus">添加</el-button>
|
|
|
+ <el-button @click="addSortField" type="text" icon="el-icon-plus">添加
|
|
|
+ </el-button>
|
|
|
<el-table :data="tableSortFields">
|
|
|
|
|
|
<el-table-column prop="name" label="字段" align="center">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-select v-model="row.name">
|
|
|
|
|
|
- <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
|
|
|
+ <el-option v-for="item in advancedQueryColumns"
|
|
|
+ :label="item.label" :value="item.value"
|
|
|
+ :key="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -206,27 +287,31 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column width="60" align="center">
|
|
|
<template slot-scope="{ row, column, $index }">
|
|
|
- <el-button @click="removeSortField($index)" size="small" type="text">删除</el-button>
|
|
|
+ <el-button @click="removeSortField($index)" size="small"
|
|
|
+ type="text">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
|
- <el-button @click="tableSortQuery" :loading="$store.state.fetchingData">确定</el-button>
|
|
|
+ <el-button @click="tableSortQuery"
|
|
|
+ :loading="$store.state.fetchingData">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="查看图片" :visible.sync="imageDialogVisible" width="440px" size="small">
|
|
|
- <img :src="imgSrc+'?x-oss-process=image/resize,m_pad,h_400,w_400,color_FFFFFF'" alt="">
|
|
|
+ <el-dialog title="查看图片" :visible.sync="imageDialogVisible" width="440px"
|
|
|
+ size="small">
|
|
|
+ <img :src="imgSrc+'?x-oss-process=image/resize,m_pad,h_400,w_400,color_FFFFFF'"
|
|
|
+ alt="">
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { mapState } from 'vuex';
|
|
|
-import { format } from 'date-fns';
|
|
|
-import zh from 'date-fns/locale/zh_cn';
|
|
|
+import { mapState } from "vuex";
|
|
|
+import { format } from "date-fns";
|
|
|
+import zh from "date-fns/locale/zh_cn";
|
|
|
|
|
|
export default {
|
|
|
created() {
|
|
|
@@ -256,7 +341,7 @@ export default {
|
|
|
|
|
|
this.$http
|
|
|
.get({
|
|
|
- url: '/itemType/all',
|
|
|
+ url: "/itemType/all"
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.success) {
|
|
|
@@ -273,166 +358,166 @@ export default {
|
|
|
currentPage: 1,
|
|
|
pageSize: 20,
|
|
|
tableData: [],
|
|
|
- filter1: '',
|
|
|
- filter2: '',
|
|
|
+ filter1: "",
|
|
|
+ filter2: "",
|
|
|
tableColumns: [
|
|
|
{
|
|
|
- label: '大类',
|
|
|
- value: 'serviceType',
|
|
|
- show: true,
|
|
|
+ label: "大类",
|
|
|
+ value: "serviceType",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '小类',
|
|
|
- value: 'subclass',
|
|
|
- show: false,
|
|
|
+ label: "小类",
|
|
|
+ value: "subclass",
|
|
|
+ show: false
|
|
|
},
|
|
|
{
|
|
|
- label: '标题',
|
|
|
- value: 'title',
|
|
|
- show: true,
|
|
|
+ label: "标题",
|
|
|
+ value: "title",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '主图',
|
|
|
- value: 'image',
|
|
|
- show: true,
|
|
|
+ label: "主图",
|
|
|
+ value: "image",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '服务详情',
|
|
|
- value: 'serviceDetail',
|
|
|
- show: true,
|
|
|
+ label: "服务详情",
|
|
|
+ value: "serviceDetail",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '库存',
|
|
|
- value: 'inventory',
|
|
|
- show: true,
|
|
|
+ label: "库存",
|
|
|
+ value: "inventory",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '上下架',
|
|
|
- value: 'onShelf',
|
|
|
- show: true,
|
|
|
+ label: "上下架",
|
|
|
+ value: "onShelf",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '可用',
|
|
|
- value: 'useFlag',
|
|
|
- show: true,
|
|
|
+ label: "可用",
|
|
|
+ value: "useFlag",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '热门',
|
|
|
- value: 'hotFlag',
|
|
|
- show: true,
|
|
|
+ label: "热门",
|
|
|
+ value: "hotFlag",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '首页',
|
|
|
- value: 'homeFlag',
|
|
|
- show: true,
|
|
|
+ label: "首页",
|
|
|
+ value: "homeFlag",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '排序',
|
|
|
- value: 'rank',
|
|
|
- show: true,
|
|
|
+ label: "排序",
|
|
|
+ value: "rank",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '店铺',
|
|
|
- value: 'storeId',
|
|
|
- show: true,
|
|
|
+ label: "店铺",
|
|
|
+ value: "storeId",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '类型',
|
|
|
- value: 'typeFlag',
|
|
|
- show: true,
|
|
|
+ label: "类型",
|
|
|
+ value: "typeFlag",
|
|
|
+ show: true
|
|
|
},
|
|
|
{
|
|
|
- label: '销量',
|
|
|
- value: 'salesVolume',
|
|
|
- show: true,
|
|
|
- },
|
|
|
+ label: "销量",
|
|
|
+ value: "salesVolume",
|
|
|
+ show: true
|
|
|
+ }
|
|
|
],
|
|
|
multipleMode: false,
|
|
|
showAdvancedQueryDialog: false,
|
|
|
advancedQueryFields: [],
|
|
|
showTableSortDialog: false,
|
|
|
tableSortFields: [],
|
|
|
- searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
|
|
|
+ searchMethods: ["=", "!=", ">", ">=", "<", "<=", "like"],
|
|
|
advancedQueryColumns: [
|
|
|
{
|
|
|
- label: '大类',
|
|
|
- value: 'service_type',
|
|
|
+ label: "大类",
|
|
|
+ value: "service_type"
|
|
|
},
|
|
|
{
|
|
|
- label: '小类',
|
|
|
- value: 'subclass',
|
|
|
+ label: "小类",
|
|
|
+ value: "subclass"
|
|
|
},
|
|
|
{
|
|
|
- label: '标题',
|
|
|
- value: 'title',
|
|
|
+ label: "标题",
|
|
|
+ value: "title"
|
|
|
},
|
|
|
{
|
|
|
- label: '主图',
|
|
|
- value: 'image',
|
|
|
+ label: "主图",
|
|
|
+ value: "image"
|
|
|
},
|
|
|
{
|
|
|
- label: '服务详情',
|
|
|
- value: 'service_detail',
|
|
|
+ label: "服务详情",
|
|
|
+ value: "service_detail"
|
|
|
},
|
|
|
{
|
|
|
- label: '库存',
|
|
|
- value: 'inventory',
|
|
|
+ label: "库存",
|
|
|
+ value: "inventory"
|
|
|
},
|
|
|
{
|
|
|
- label: '上下架',
|
|
|
- value: 'on_shelf',
|
|
|
+ label: "上下架",
|
|
|
+ value: "on_shelf"
|
|
|
},
|
|
|
{
|
|
|
- label: '可用',
|
|
|
- value: 'use_flag',
|
|
|
+ label: "可用",
|
|
|
+ value: "use_flag"
|
|
|
},
|
|
|
{
|
|
|
- label: '热门',
|
|
|
- value: 'hot_flag',
|
|
|
+ label: "热门",
|
|
|
+ value: "hot_flag"
|
|
|
},
|
|
|
{
|
|
|
- label: '首页',
|
|
|
- value: 'home_flag',
|
|
|
+ label: "首页",
|
|
|
+ value: "home_flag"
|
|
|
},
|
|
|
{
|
|
|
- label: '排序',
|
|
|
- value: 'rank',
|
|
|
+ label: "排序",
|
|
|
+ value: "rank"
|
|
|
},
|
|
|
{
|
|
|
- label: '店铺',
|
|
|
- value: 'store_id',
|
|
|
+ label: "店铺",
|
|
|
+ value: "store_id"
|
|
|
},
|
|
|
{
|
|
|
- label: '类型',
|
|
|
- value: 'type_flag',
|
|
|
+ label: "类型",
|
|
|
+ value: "type_flag"
|
|
|
},
|
|
|
{
|
|
|
- label: '销量',
|
|
|
- value: 'sales_volume',
|
|
|
- },
|
|
|
+ label: "销量",
|
|
|
+ value: "sales_volume"
|
|
|
+ }
|
|
|
],
|
|
|
- advancedQuerySearchKey: '',
|
|
|
- orderByStr: '',
|
|
|
- imgSrc: '',
|
|
|
+ advancedQuerySearchKey: "",
|
|
|
+ orderByStr: "",
|
|
|
+ imgSrc: "",
|
|
|
imageDialogVisible: false,
|
|
|
serviceTypes: [],
|
|
|
serviceTypeDetails: {},
|
|
|
storeInfos: [],
|
|
|
- onShelfFlag: '',
|
|
|
- itemType: '',
|
|
|
- itemTypes: [],
|
|
|
+ onShelfFlag: "",
|
|
|
+ itemType: "",
|
|
|
+ itemTypes: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['tableHeight', 'storeId']),
|
|
|
+ ...mapState(["tableHeight", "storeId"]),
|
|
|
selection() {
|
|
|
return this.$refs.table.selection.map(i => i.id);
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
storeId() {
|
|
|
this.searchData();
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
pageSizeChange(size) {
|
|
|
@@ -451,20 +536,20 @@ export default {
|
|
|
searchKey: this.filter1,
|
|
|
advancedQuery: this.advancedQuerySearchKey,
|
|
|
orderByStr: this.orderByStr,
|
|
|
- storeId: this.storeId || '',
|
|
|
+ storeId: this.storeId || "",
|
|
|
onShelf: this.onShelfFlag,
|
|
|
- serviceType: this.itemType,
|
|
|
+ serviceType: this.itemType
|
|
|
};
|
|
|
|
|
|
if (this.$route.query.column) {
|
|
|
var tempColumn = this.$route.query.column;
|
|
|
- data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
|
|
|
+ data[tempColumn.split(",")[1]] = tempColumn.split(",")[0];
|
|
|
}
|
|
|
|
|
|
this.$http
|
|
|
.get({
|
|
|
- url: '/productInfo/page',
|
|
|
- data: data,
|
|
|
+ url: "/productInfo/page",
|
|
|
+ data: data
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.success) {
|
|
|
@@ -485,35 +570,35 @@ export default {
|
|
|
},
|
|
|
editRow(row) {
|
|
|
this.$router.push({
|
|
|
- path: '/productInfo',
|
|
|
+ path: "/productInfo",
|
|
|
query: {
|
|
|
id: row.id,
|
|
|
- column: this.$route.query.column,
|
|
|
- },
|
|
|
+ column: this.$route.query.column
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
detailRow(row) {
|
|
|
window.open(
|
|
|
- 'https://www.tutuxiang.com/index#/product?id=' +
|
|
|
+ "https://www.tutuxiang.com/index#/product?id=" +
|
|
|
row.id +
|
|
|
- '&breHref=%E9%A6%96%E9%A1%B5',
|
|
|
+ "&breHref=%E9%A6%96%E9%A1%B5"
|
|
|
);
|
|
|
},
|
|
|
operation1() {
|
|
|
this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: this.selection,
|
|
|
+ title: "提示",
|
|
|
+ message: this.selection
|
|
|
});
|
|
|
},
|
|
|
operation2() {
|
|
|
- this.$message('操作2');
|
|
|
+ this.$message("操作2");
|
|
|
},
|
|
|
addField() {
|
|
|
this.advancedQueryFields.push({
|
|
|
- link: 'AND',
|
|
|
- name: '',
|
|
|
- searchMethod: '=',
|
|
|
- value: '',
|
|
|
+ link: "AND",
|
|
|
+ name: "",
|
|
|
+ searchMethod: "=",
|
|
|
+ value: ""
|
|
|
});
|
|
|
},
|
|
|
removeField(i) {
|
|
|
@@ -522,7 +607,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
advancedQuery() {
|
|
|
- this.advancedQuerySearchKey = '';
|
|
|
+ this.advancedQuerySearchKey = "";
|
|
|
|
|
|
if (this.advancedQueryFields.length > 0) {
|
|
|
var templist = [];
|
|
|
@@ -536,18 +621,18 @@ export default {
|
|
|
) {
|
|
|
var tempItem =
|
|
|
item.link +
|
|
|
- '_,' +
|
|
|
+ "_," +
|
|
|
item.name +
|
|
|
- '_,' +
|
|
|
+ "_," +
|
|
|
item.searchMethod +
|
|
|
- '_,' +
|
|
|
+ "_," +
|
|
|
item.value;
|
|
|
templist.push(tempItem);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (templist.length > 0) {
|
|
|
- this.advancedQuerySearchKey = templist.join('_;');
|
|
|
+ this.advancedQuerySearchKey = templist.join("_;");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -556,8 +641,8 @@ export default {
|
|
|
},
|
|
|
addSortField() {
|
|
|
this.tableSortFields.push({
|
|
|
- name: '',
|
|
|
- order: 'asc',
|
|
|
+ name: "",
|
|
|
+ order: "asc"
|
|
|
});
|
|
|
},
|
|
|
removeSortField(i) {
|
|
|
@@ -566,20 +651,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
tableSortQuery() {
|
|
|
- this.orderByStr = '';
|
|
|
+ this.orderByStr = "";
|
|
|
|
|
|
if (this.tableSortFields.length > 0) {
|
|
|
var templist = [];
|
|
|
|
|
|
this.tableSortFields.forEach(item => {
|
|
|
if (item.name && item.order) {
|
|
|
- var tempItem = item.name + '_,' + item.order;
|
|
|
+ var tempItem = item.name + "_," + item.order;
|
|
|
templist.push(tempItem);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (templist.length > 0) {
|
|
|
- this.orderByStr = templist.join('_;');
|
|
|
+ this.orderByStr = templist.join("_;");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -589,11 +674,11 @@ export default {
|
|
|
exportExcel() {
|
|
|
window.location.href =
|
|
|
this.$baseUrl +
|
|
|
- '/productInfo/exportExcel?searchKey=' +
|
|
|
+ "/productInfo/exportExcel?searchKey=" +
|
|
|
this.filter1 +
|
|
|
- '&advancedQuery=' +
|
|
|
+ "&advancedQuery=" +
|
|
|
this.advancedQuerySearchKey +
|
|
|
- '&orderByStr=' +
|
|
|
+ "&orderByStr=" +
|
|
|
this.orderByStr;
|
|
|
},
|
|
|
searchData() {
|
|
|
@@ -601,40 +686,40 @@ export default {
|
|
|
this.getData();
|
|
|
},
|
|
|
deleteRow(row) {
|
|
|
- this.$alert('删除将无法恢复,确认要删除么?', '警告', {
|
|
|
- type: 'error',
|
|
|
+ this.$alert("删除将无法恢复,确认要删除么?", "警告", {
|
|
|
+ type: "error"
|
|
|
})
|
|
|
.then(() => {
|
|
|
return this.$http.post({
|
|
|
- url: '/productInfo/del',
|
|
|
- data: { id: row.id },
|
|
|
+ url: "/productInfo/del",
|
|
|
+ data: { id: row.id }
|
|
|
});
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.$message.success('删除成功');
|
|
|
+ this.$message.success("删除成功");
|
|
|
this.getData();
|
|
|
})
|
|
|
.catch(action => {
|
|
|
- if (action === 'cancel') {
|
|
|
- this.$message.info('删除取消');
|
|
|
+ if (action === "cancel") {
|
|
|
+ this.$message.info("删除取消");
|
|
|
} else {
|
|
|
- this.$message.error('删除失败');
|
|
|
+ this.$message.error("删除失败");
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
DateTimeFormatter(row, column, cellValue) {
|
|
|
if (cellValue) {
|
|
|
- return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh });
|
|
|
+ return format(cellValue, "YYYY/MM/DD HH:mm", { locale: zh });
|
|
|
}
|
|
|
},
|
|
|
DateFormatter(row, column, cellValue) {
|
|
|
if (cellValue) {
|
|
|
- return format(cellValue, 'YYYY/MM/DD', { locale: zh });
|
|
|
+ return format(cellValue, "YYYY/MM/DD", { locale: zh });
|
|
|
}
|
|
|
},
|
|
|
ServiceTypeFormatter(row, column, cellValue) {
|
|
|
if (cellValue) {
|
|
|
- var serviceType = '';
|
|
|
+ var serviceType = "";
|
|
|
this.itemTypes.forEach(item => {
|
|
|
if (item.id == Number(cellValue)) {
|
|
|
serviceType = item.typeName;
|
|
|
@@ -647,7 +732,7 @@ export default {
|
|
|
|
|
|
ServiceTypeDetailFormatter(row, column, cellValue) {
|
|
|
if (cellValue && row.serviceType) {
|
|
|
- var serviceTypeDetail = '';
|
|
|
+ var serviceTypeDetail = "";
|
|
|
if (this.serviceTypeDetails[row.serviceType]) {
|
|
|
this.serviceTypeDetails[row.serviceType].forEach(item => {
|
|
|
if (item.id == Number(cellValue)) {
|
|
|
@@ -661,30 +746,30 @@ export default {
|
|
|
},
|
|
|
|
|
|
YNFormatter(row, column, cellValue) {
|
|
|
- return cellValue ? 'Y' : 'N';
|
|
|
+ return cellValue ? "Y" : "N";
|
|
|
},
|
|
|
TypeFlagFormatter(row, column, cellValue) {
|
|
|
- var valueStr = '';
|
|
|
+ var valueStr = "";
|
|
|
switch (cellValue) {
|
|
|
case 0:
|
|
|
- valueStr = '修图';
|
|
|
+ valueStr = "修图";
|
|
|
break;
|
|
|
case 1:
|
|
|
- valueStr = '实体商品';
|
|
|
+ valueStr = "实体商品";
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
return valueStr;
|
|
|
},
|
|
|
showImg(img) {
|
|
|
- this.imgSrc = img + '?x-oss-process=image/resize,l_500';
|
|
|
+ this.imgSrc = img ;
|
|
|
this.imageDialogVisible = true;
|
|
|
},
|
|
|
storeIdChange() {
|
|
|
this.currentPage = 1;
|
|
|
this.getData();
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|