|
@@ -4,154 +4,117 @@
|
|
|
<div class="squrt"></div>商品列表
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
- <el-button class="btn-primary"
|
|
|
- @click="onShopOperation('create')"
|
|
|
- v-permission="'/shopOperation'">添加</el-button>
|
|
|
- <el-upload v-permission="'import/goods'"
|
|
|
- style="display: inline-block;"
|
|
|
- action="/api-web/import/goods"
|
|
|
- :show-file-list="false"
|
|
|
- :before-upload="beforeUpload"
|
|
|
- accept=".xlsx,.xls"
|
|
|
- :headers="headers"
|
|
|
- :on-error="handleError"
|
|
|
- :on-success="handleSuccess">
|
|
|
+ <el-button class="btn-primary" @click="onShopOperation('create')" v-permission="'/shopOperation'">添加</el-button>
|
|
|
+ <el-upload v-permission="'import/goods'" style="display: inline-block;" action="/api-web/import/goods"
|
|
|
+ :show-file-list="false" :before-upload="beforeUpload" accept=".xlsx,.xls" :headers="headers" :on-error="handleError"
|
|
|
+ :on-success="handleSuccess">
|
|
|
<el-button class="btn-primary">商品导入</el-button>
|
|
|
</el-upload>
|
|
|
- <el-button class="btn-primary"
|
|
|
- @click="onDownload"
|
|
|
- v-permission="'import/downloadTemplate'">下载模板</el-button>
|
|
|
+ <el-button class="btn-primary" @click="onDownload" v-permission="'import/downloadTemplate'">下载模板</el-button>
|
|
|
+ <el-button class="btn-primary">添加组合商品</el-button>
|
|
|
<!-- 搜索类型 -->
|
|
|
- <!-- <el-form :inline="true"
|
|
|
- class="searchForm"
|
|
|
- v-model.trim="searchForm">
|
|
|
+ <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
|
|
|
<el-form-item>
|
|
|
- <el-select v-model.trim="searchForm.status"
|
|
|
- placeholder="工作类型">
|
|
|
- <el-option label="哈哈哈"
|
|
|
- value="1"></el-option>
|
|
|
+ <el-input v-model.trim="searchForm.search" placeholder="货号,商品名称,别称,备查货号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model.trim="searchForm.type" placeholder="商品类型">
|
|
|
+ <el-option v-for="(item, index) in goodsType" :key="index" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model.trim="searchForm.goodsCategoryId" placeholder="商品分类">
|
|
|
+ <el-option v-for="(item, index) in categoryList" :key="index" :label="item.label" :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- </el-form> -->
|
|
|
- <!-- 查询列表 -->
|
|
|
- <!-- <div class="searchWrap">
|
|
|
- <p>查询条件:</p>
|
|
|
- <div class="searchItem"
|
|
|
- @click="closeSearch(item)"
|
|
|
- v-for="(item,index) in searchLsit">
|
|
|
- {{ item.key }}
|
|
|
- <i class="el-icon-close"></i>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model.trim="searchForm.status" placeholder="是否是组合商品">
|
|
|
+ <el-option label="是" value="1"></el-option>
|
|
|
+ <el-option label="否" value="0"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-date-picker v-model.trim="orderDate" style="width:410px;" type="daterange" value-format="yyyy-MM-dd"
|
|
|
+ @change="searchOrderDate" range-separator="至" :picker-options="{ firstDayOfWeek: 1 }"
|
|
|
+ start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="danger" @click="getList">搜索</el-button>
|
|
|
+ <el-button type="primary" @click="onReset">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<!-- 列表 -->
|
|
|
<div class="tableWrap">
|
|
|
- <el-table :data='tableList'
|
|
|
- :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
- <el-table-column align='center'
|
|
|
- prop="id"
|
|
|
- label="商品编号">
|
|
|
+ <el-table :data='tableList' :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column align='center' prop="id" label="商品编号">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="sn"
|
|
|
- label="货号">
|
|
|
+ <el-table-column align='center' prop="sn" label="货号">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="brand"
|
|
|
- label="品牌">
|
|
|
+ <el-table-column align='center' prop="brand" label="品牌">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="name"
|
|
|
- label="商品名称">
|
|
|
+ <el-table-column align='center' prop="name" label="商品名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center' label="是否组合商品">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.complementGoodsIdList ? '是' : '否' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center' label="是否APP展示">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.clientShow ? '是' : '否' }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- label="商品类型">
|
|
|
+ <el-table-column align='center' label="商品类型">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.type | shopType }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="goodsCategoryName"
|
|
|
- label="商品分类">
|
|
|
+ <el-table-column align='center' prop="goodsCategoryName" label="商品分类">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="specification"
|
|
|
- label="具体型号">
|
|
|
+ <el-table-column align='center' prop="specification" label="具体型号">
|
|
|
<template slot-scope="scope">
|
|
|
<span style="max-height: 64px; display: block;">{{ scope.row.specification }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="marketPrice"
|
|
|
- label="商品价格(元)">
|
|
|
+ <el-table-column align='center' prop="stockCount" label="内部库存">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center' prop="taxStockCount" label="税务库存">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center' prop="stockType" label="库存类型">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center' prop="marketPrice" label="商品价格(元)">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
{{scope.row.marketPrice|moneyFormat}}
|
|
|
- </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="groupPurchasePrice"
|
|
|
- label="商品团购价(元)">
|
|
|
+ <el-table-column align='center' prop="groupPurchasePrice" label="商品团购价(元)">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
{{scope.row.groupPurchasePrice|moneyFormat}}
|
|
|
- </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column align='center'
|
|
|
- prop="discountPrice"
|
|
|
- label="商品采购价1(元)">
|
|
|
+ <el-table-column align='center' cell-style="padding: 0" label="商品缩略图">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.row.discountPrice|moneyFormat}}
|
|
|
- </div>
|
|
|
+ <img class="shopImage" :src="scope.row.image" alt="" srcset="">
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- prop="agreeCostPrice"
|
|
|
- label="商品采购价2(元)">
|
|
|
+ <el-table-column align='center' label="商品描述">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.row.agreeCostPrice|moneyFormat}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column align='center'
|
|
|
- cell-style="padding: 0"
|
|
|
- label="商品缩略图片">
|
|
|
- <template slot-scope="scope">
|
|
|
- <img class="shopImage"
|
|
|
- :src="scope.row.image"
|
|
|
- alt=""
|
|
|
- srcset="">
|
|
|
+ <Tooltip :content="scope.row.brief" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- label="商品描述">
|
|
|
+ <el-table-column align='center' label="商品详情">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <div class="shopDesc">
|
|
|
- {{ scope.row.desc }}
|
|
|
- </div> -->
|
|
|
- <Tooltip :content="scope.row.brief" />
|
|
|
+ <Tooltip :content="scope.row.desc" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- width="140px"
|
|
|
- label="操作">
|
|
|
+ <el-table-column align='center' width="180px" label="操作" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="scope.row.status == 0"
|
|
|
- v-permission="'goods/update'"
|
|
|
- @click="onUpdate(scope.row)"
|
|
|
- type="text">上架</el-button>
|
|
|
- <el-button v-if="scope.row.status == 0"
|
|
|
- v-permission="'/shopOperation'"
|
|
|
- @click="onShopOperation('update', scope.row)"
|
|
|
- type="text">修改</el-button>
|
|
|
- <el-button v-if="scope.row.status == 1"
|
|
|
- v-permission="'goods/update'"
|
|
|
- @click="onUpdate(scope.row)"
|
|
|
- type="text">下架</el-button>
|
|
|
+ <!-- 组合商品没有进货清单按钮 -->
|
|
|
+ <el-button v-if="!scope.row.complementGoodsIdList" type="text">进货清单</el-button>
|
|
|
+ <el-button v-if="scope.row.status == 0" v-permission="'goods/update'" @click="onUpdate(scope.row)" type="text">上架</el-button>
|
|
|
+ <el-button v-if="scope.row.status == 0" v-permission="'/shopOperation'" @click="onShopOperation('update', scope.row)"
|
|
|
+ type="text">修改</el-button>
|
|
|
+ <el-button v-if="scope.row.status == 1" v-permission="'goods/update'" @click="onUpdate(scope.row)" type="text">下架</el-button>
|
|
|
<!-- <el-button v-if="scope.row.status == 0"
|
|
|
v-permission="'goods/del'"
|
|
|
@click="onDelete(scope.row)"
|
|
@@ -159,165 +122,231 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination :total="pageInfo.total"
|
|
|
- :page.sync="pageInfo.page"
|
|
|
- :limit.sync="pageInfo.limit"
|
|
|
- :page-sizes="pageInfo.page_size"
|
|
|
- @pagination="getList" />
|
|
|
+ <pagination :total="pageInfo.total" :page.sync="pageInfo.page" :limit.sync="pageInfo.limit" :page-sizes="pageInfo.page_size"
|
|
|
+ @pagination="getList" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import pagination from '@/components/Pagination/index'
|
|
|
-import { goodsQuery, goodsUpdate, goodsDelete } from '@/api/businessManager'
|
|
|
-import store from '@/store'
|
|
|
-import Tooltip from '@/components/Tooltip/index'
|
|
|
-import { Export } from '@/utils/downLoadFile'
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-import load from '@/utils/loading'
|
|
|
-export default {
|
|
|
- components: { pagination, Tooltip },
|
|
|
- name: 'shopList',
|
|
|
- data () {
|
|
|
- return {
|
|
|
- goodsLoading: false,
|
|
|
- organId: null,
|
|
|
- searchForm: {
|
|
|
- status: ''
|
|
|
- },
|
|
|
- headers: {
|
|
|
- Authorization: getToken()
|
|
|
- },
|
|
|
- searchLsit: [],
|
|
|
- tableList: [],
|
|
|
- pageInfo: {
|
|
|
- // 分页规则
|
|
|
- limit: 10, // 限制显示条数
|
|
|
- page: 1, // 当前页
|
|
|
- total: 0, // 总条数
|
|
|
- page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
- activated () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
- mounted () {
|
|
|
-
|
|
|
- },
|
|
|
- methods: {
|
|
|
- init () {
|
|
|
- if (this.$route.query.searchForm) {
|
|
|
- this.$route.query.searchForm instanceof Object ? this.searchForm = this.$route.query.searchForm : this.searchForm = JSON.parse(this.$route.query.searchForm);
|
|
|
- }
|
|
|
- if (this.$route.query.pageInfo) {
|
|
|
- this.$route.query.pageInfo instanceof Object ? this.pageInfo = this.$route.query.pageInfo : this.pageInfo = JSON.parse(this.$route.query.pageInfo);
|
|
|
- }
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- onUpdate (row) {
|
|
|
- goodsUpdate({
|
|
|
- id: row.id,
|
|
|
- status: row.status ? 0 : 1
|
|
|
- }).then(res => {
|
|
|
- this.messageTips(row.status ? '下架' : '上架', res)
|
|
|
- })
|
|
|
- },
|
|
|
- onDelete (row) {
|
|
|
- this.$confirm('您确定删除该商品吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- goodsDelete(row.id).then(res => {
|
|
|
- this.messageTips('删除', res)
|
|
|
- })
|
|
|
- }).catch(() => { })
|
|
|
-
|
|
|
+ import pagination from '@/components/Pagination/index'
|
|
|
+ import {
|
|
|
+ categoryListTree,
|
|
|
+ goodsQuery,
|
|
|
+ goodsUpdate,
|
|
|
+ goodsDelete
|
|
|
+ } from '@/api/businessManager'
|
|
|
+ import store from '@/store'
|
|
|
+ import Tooltip from '@/components/Tooltip/index'
|
|
|
+ import {
|
|
|
+ Export
|
|
|
+ } from '@/utils/downLoadFile'
|
|
|
+ import {
|
|
|
+ getToken
|
|
|
+ } from "@/utils/auth";
|
|
|
+ import {
|
|
|
+ goodsType
|
|
|
+ } from '@/utils/searchArray'
|
|
|
+ import load from '@/utils/loading'
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ pagination,
|
|
|
+ Tooltip
|
|
|
},
|
|
|
- messageTips (title, res) {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.success(title + '成功')
|
|
|
- this.typeStatus = false
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
+ name: 'shopList',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ goodsType: goodsType,
|
|
|
+ categoryList: [],
|
|
|
+ goodsLoading: false,
|
|
|
+ organId: null,
|
|
|
+ orderDate: null,
|
|
|
+ searchForm: {
|
|
|
+ search: null,
|
|
|
+ status: null,
|
|
|
+ type: null,
|
|
|
+ goodsCategoryId: null,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken()
|
|
|
+ },
|
|
|
+ searchLsit: [],
|
|
|
+ tableList: [],
|
|
|
+ pageInfo: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 10, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
- getList () {
|
|
|
- goodsQuery({
|
|
|
- organId: this.organId,
|
|
|
- rows: this.pageInfo.limit,
|
|
|
- page: this.pageInfo.page
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200 && res.data) {
|
|
|
- this.tableList = res.data.rows
|
|
|
- this.pageInfo.total = res.data.total
|
|
|
- }
|
|
|
- })
|
|
|
+ created() {
|
|
|
+ this.init()
|
|
|
},
|
|
|
- onShopOperation (type, row) { // 添加或修改
|
|
|
- let params = {
|
|
|
- type: type
|
|
|
- }
|
|
|
- if (row) {
|
|
|
- params.id = row.id
|
|
|
- }
|
|
|
- let pageInfo = JSON.stringify(this.pageInfo)
|
|
|
- let paramInfo = JSON.stringify(params)
|
|
|
- this.$router.push({
|
|
|
- path: '/shopManager/shopOperation',
|
|
|
- query: { paramInfo, pageInfo }
|
|
|
- })
|
|
|
+ activated() {
|
|
|
+ this.init()
|
|
|
},
|
|
|
- beforeUpload (file) {
|
|
|
- // console.log(file.type)
|
|
|
- // const isJPG = file.type === '.xlsx' || file.type === '.xls';
|
|
|
- // // const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
- // if (!isJPG) {
|
|
|
- // this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
- // }
|
|
|
- // return isJPG;
|
|
|
- // this.goodsLoading = true
|
|
|
- load.startLoading()
|
|
|
+ mounted() {
|
|
|
+
|
|
|
},
|
|
|
- handleSuccess (response, file, fileList) { // 导入商品
|
|
|
- // 报表导出
|
|
|
- load.endLoading()
|
|
|
- console.log(response, file, fileList)
|
|
|
- if (response.code == 200) {
|
|
|
- this.$message.success('导入成功')
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ if (this.$route.query.searchForm) {
|
|
|
+ this.$route.query.searchForm instanceof Object ? this.searchForm = this.$route.query.searchForm : this.searchForm =
|
|
|
+ JSON.parse(this.$route.query.searchForm);
|
|
|
+ }
|
|
|
+ if (this.$route.query.pageInfo) {
|
|
|
+ this.$route.query.pageInfo instanceof Object ? this.pageInfo = this.$route.query.pageInfo : this.pageInfo =
|
|
|
+ JSON.parse(this.$route.query.pageInfo);
|
|
|
+ }
|
|
|
this.getList()
|
|
|
- } else {
|
|
|
- this.$message.error(response.msg)
|
|
|
+ this.getCatagory()
|
|
|
+ },
|
|
|
+ getCatagory() {
|
|
|
+ categoryListTree({
|
|
|
+ delFlag: 0,
|
|
|
+ rows: 9999
|
|
|
+ }).then(res => {
|
|
|
+ let result = res.data
|
|
|
+ if (res.code == 200) {
|
|
|
+ let tempArray = []
|
|
|
+ result.rows.forEach(row => {
|
|
|
+ tempArray.push({
|
|
|
+ label: row.name,
|
|
|
+ value: row.id
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.categoryList = tempArray
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onUpdate(row) {
|
|
|
+ goodsUpdate({
|
|
|
+ id: row.id,
|
|
|
+ status: row.status ? 0 : 1
|
|
|
+ }).then(res => {
|
|
|
+ this.messageTips(row.status ? '下架' : '上架', res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onDelete(row) {
|
|
|
+ this.$confirm('您确定删除该商品吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ goodsDelete(row.id).then(res => {
|
|
|
+ this.messageTips('删除', res)
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+
|
|
|
+ },
|
|
|
+ searchOrderDate (value) {
|
|
|
+ if (value) {
|
|
|
+ this.searchForm.startTime = value[0];
|
|
|
+ this.searchForm.endTime = value[1];
|
|
|
+ } else {
|
|
|
+ this.searchForm.startTime = null;
|
|
|
+ this.searchForm.endTime = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ messageTips(title, res) {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success(title + '成功')
|
|
|
+ this.typeStatus = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ let params = Object.assign({}, this.searchForm)
|
|
|
+ params.organId = this.organId
|
|
|
+ params.rows = this.pageInfo.limit
|
|
|
+ params.page = this.pageInfo.page
|
|
|
+ goodsQuery(params).then(res => {
|
|
|
+ if (res.code == 200 && res.data) {
|
|
|
+ this.tableList = res.data.rows
|
|
|
+ this.pageInfo.total = res.data.total
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onReset() { // 重置
|
|
|
+ this.searchForm = {
|
|
|
+ search: null,
|
|
|
+ status: null,
|
|
|
+ type: null,
|
|
|
+ goodsCategoryId: null,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ onShopOperation(type, row) { // 添加或修改
|
|
|
+ let params = {
|
|
|
+ type: type
|
|
|
+ }
|
|
|
+ if (row) {
|
|
|
+ params.id = row.id
|
|
|
+ }
|
|
|
+ let pageInfo = JSON.stringify(this.pageInfo)
|
|
|
+ let paramInfo = JSON.stringify(params)
|
|
|
+ this.$router.push({
|
|
|
+ path: '/shopManager/shopOperation',
|
|
|
+ query: {
|
|
|
+ paramInfo,
|
|
|
+ pageInfo
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ beforeUpload(file) {
|
|
|
+ // console.log(file.type)
|
|
|
+ // const isJPG = file.type === '.xlsx' || file.type === '.xls';
|
|
|
+ // // const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
+ // if (!isJPG) {
|
|
|
+ // this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
+ // }
|
|
|
+ // return isJPG;
|
|
|
+ // this.goodsLoading = true
|
|
|
+ load.startLoading()
|
|
|
+ },
|
|
|
+ handleSuccess(response, file, fileList) { // 导入商品
|
|
|
+ // 报表导出
|
|
|
+ load.endLoading()
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleError(err, file, fileList) {
|
|
|
+ load.endLoading()
|
|
|
+ console.log(err, file, fileList)
|
|
|
+ },
|
|
|
+ onDownload() { // 下载模板
|
|
|
+ // // 报表导出
|
|
|
+ Export(this, {
|
|
|
+ url: "/api-web/import/downloadTemplate",
|
|
|
+ params: {
|
|
|
+ templateType: 'GOODS'
|
|
|
+ },
|
|
|
+ fileName: '商品导入模板.xlsx'
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- handleError (err, file, fileList) {
|
|
|
- load.endLoading()
|
|
|
- console.log(err, file, fileList)
|
|
|
- },
|
|
|
- onDownload () { // 下载模板
|
|
|
- // // 报表导出
|
|
|
- Export(this, {
|
|
|
- url: "/api-web/import/downloadTemplate",
|
|
|
- params: { templateType: 'GOODS' },
|
|
|
- fileName: '商品导入模板.xlsx'
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-.shopImage {
|
|
|
- width: 60px;
|
|
|
- height: 60px;
|
|
|
-}
|
|
|
-.shopDesc {
|
|
|
- max-height: 70px;
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
+ .shopImage {
|
|
|
+ width: 60px;
|
|
|
+ height: 60px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .shopDesc {
|
|
|
+ max-height: 70px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
</style>
|