2022-08-02 10:16:07 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 商品管理页面 -->
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<el-card class="box-card">
|
|
|
|
|
|
<div class="goods"
|
|
|
|
|
|
style="margin:20px">
|
|
|
|
|
|
<el-form ref="form"
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
:model="form">
|
|
|
|
|
|
<el-form-item label="商品名称:">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-input v-model="form.goods_title"
|
|
|
|
|
|
placeholder="商品名称">
|
|
|
|
|
|
</el-input>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="商品种类:">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-select v-model="form.type_id"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
placeholder="商品种类">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-option v-for="item in cate"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.name"
|
|
|
|
|
|
:value="item.id">
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="商品规格:">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-input v-model="form.sku_title"
|
|
|
|
|
|
placeholder="商品规格">
|
|
|
|
|
|
|
|
|
|
|
|
</el-input>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="商品品牌:">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-select v-model="form.brand_id"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
placeholder="商品品牌">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-option v-for="item in brand"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.name"
|
|
|
|
|
|
:value="item.id">
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-form-item label="商品库存:">
|
|
|
|
|
|
<el-input v-model="form.keyword_type"
|
|
|
|
|
|
placeholder="商品库存">
|
|
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</el-form-item>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
<el-form-item label="商品状态:">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-select v-model="form.status"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
placeholder="商品状态">
|
|
|
|
|
|
<el-option v-for="item in options"
|
2022-08-04 18:59:32 +08:00
|
|
|
|
:key="item.id"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
:label="item.label"
|
2022-08-04 18:59:32 +08:00
|
|
|
|
:value="item.id">
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="创建时间:">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-date-picker v-model="timer"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
type="datetimerange"
|
|
|
|
|
|
range-separator="至"
|
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
|
end-placeholder="结束日期"
|
2022-08-04 18:59:32 +08:00
|
|
|
|
align="right"
|
|
|
|
|
|
value-format="yyyy-MM-DD hh:mm:ss">
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-date-picker>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-button type="primary"
|
|
|
|
|
|
@click="handleChoose">筛选</el-button>
|
|
|
|
|
|
<el-button plain
|
|
|
|
|
|
@click="handleReChoose">重置筛选</el-button>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
<el-card class="box-card1"
|
|
|
|
|
|
style="margin-top:30px">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<!-- 表格头部操作 -->
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<span>
|
|
|
|
|
|
全部商品(共800条)
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<div class="btn">
|
|
|
|
|
|
<el-button type="primary"
|
|
|
|
|
|
plain
|
|
|
|
|
|
@click="addNewgoods">新建商品</el-button>
|
|
|
|
|
|
<el-button type="primary"
|
|
|
|
|
|
@click="update()"
|
|
|
|
|
|
plain>上新</el-button>
|
|
|
|
|
|
<el-button type="primary"
|
|
|
|
|
|
plain>库存盘点</el-button>
|
|
|
|
|
|
<el-button type="primary"
|
2022-08-04 18:59:32 +08:00
|
|
|
|
plain
|
|
|
|
|
|
@click="handleImport">导入商品</el-button>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
<el-button type="primary"
|
2022-08-04 18:59:32 +08:00
|
|
|
|
plain
|
|
|
|
|
|
@click="handleExport">表格导出</el-button>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 表格 -->
|
|
|
|
|
|
<el-table ref="multipleTable"
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
border
|
|
|
|
|
|
class="table"
|
|
|
|
|
|
tooltip-effect="dark"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
|
<el-table-column type="selection"
|
|
|
|
|
|
width="55">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="商品信息">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div>{{ scope.row.goods.img_url}}</div>
|
|
|
|
|
|
<div>{{ scope.row.goods.title}}</div>
|
|
|
|
|
|
</template>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column label="品类">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div>{{ scope.row.goods.type?scope.row.goods.type.name:''}}</div>
|
|
|
|
|
|
</template>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column label="规格"
|
|
|
|
|
|
prop="title">
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column label="品牌">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div>{{ scope.row.goods.brand?scope.row.goods.brand.name:''}}</div>
|
|
|
|
|
|
</template>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="two_days_ago_num"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="2天前库存">
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="yesterday_num"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="1天前库存">
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column sortable
|
2022-08-02 10:16:07 +08:00
|
|
|
|
label="今日到货">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div v-if="true">
|
|
|
|
|
|
<el-input v-model="input"></el-input>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>{{ scope.row.daily!=null?scope.row.daily.arrived_today_num:0}}</div>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="cost"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="成本">
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<div v-if="isShow">
|
|
|
|
|
|
<el-input v-model="input"></el-input>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="reference_price"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="参考售价">
|
|
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="num"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="总量">
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="reserve"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="预留量">
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<!-- <el-table-column prop="name"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="店铺订单">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
</el-table-column> -->
|
|
|
|
|
|
<el-table-column sortable
|
2022-08-02 10:16:07 +08:00
|
|
|
|
label="损耗">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
|
|
|
|
<el-popover width="200"
|
|
|
|
|
|
placement="right"
|
|
|
|
|
|
trigger="hover">
|
|
|
|
|
|
<div class="detail">
|
|
|
|
|
|
<span>损耗:</span>
|
|
|
|
|
|
<el-input></el-input>
|
|
|
|
|
|
</div>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
<el-radio-group v-model="radio">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-radio :label="3">48h以上</el-radio>
|
|
|
|
|
|
<el-radio :label="6">到货错误</el-radio>
|
|
|
|
|
|
<el-radio :label="9">灰霉</el-radio>
|
|
|
|
|
|
<el-radio :label="2">长度</el-radio>
|
|
|
|
|
|
<el-radio :label="4">花朵</el-radio>
|
|
|
|
|
|
<el-radio :label="5">其他</el-radio>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<div class="list_btn">
|
|
|
|
|
|
<el-button type="primary">保存</el-button>
|
|
|
|
|
|
<el-button>取消</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="loss"
|
|
|
|
|
|
slot="reference">{{ scope.row.daily?scope.row.daily.arrived_loss_num:0}}</div>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="stock"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
sortable
|
|
|
|
|
|
label="库存">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="address"
|
|
|
|
|
|
sortable
|
|
|
|
|
|
label="库存盘点">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div>{{ scope.row.daily?scope.row.daily.inventory:0}}</div>
|
|
|
|
|
|
</template>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</el-table-column>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-table-column prop="status"
|
2022-08-02 10:16:07 +08:00
|
|
|
|
label="状态">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="操作">
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<template slot-scope="scope">
|
2022-08-02 10:16:07 +08:00
|
|
|
|
<div>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-button type="text">库存</el-button>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<el-button type="text"
|
|
|
|
|
|
@click="handleEdit(scope.row.id)">编辑</el-button>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<el-button type="text">记录</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-button type="primary">确定</el-button>
|
|
|
|
|
|
</el-card>
|
2022-08-04 18:59:32 +08:00
|
|
|
|
<div class="page-pagination">
|
|
|
|
|
|
<el-pagination :total="total"
|
|
|
|
|
|
class="mt-4"
|
|
|
|
|
|
:current-page="form.page"
|
|
|
|
|
|
:page-size="form.per_page"
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
layout="total, prev, pager, next, jumper">
|
|
|
|
|
|
</el-pagination>
|
|
|
|
|
|
</div>
|
2022-08-02 10:16:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { goods } from '../../api/goods'
|
2022-08-04 18:59:32 +08:00
|
|
|
|
import { goods_types, Brand_goods_types } from '../../api/rankingData.js'
|
2022-08-02 10:16:07 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2022-08-04 18:59:32 +08:00
|
|
|
|
total: 0, // 总条数
|
|
|
|
|
|
timer: '', // 筛选的时间
|
|
|
|
|
|
radio: '', // 损耗选择的原因
|
|
|
|
|
|
brand: [], // 品牌列表
|
|
|
|
|
|
cate: [], // 种类列表
|
2022-08-02 10:16:07 +08:00
|
|
|
|
isShow: false, // 点击上新显示输入框
|
2022-08-04 18:59:32 +08:00
|
|
|
|
tableData: [], // 商品列表
|
|
|
|
|
|
// 商品状态
|
2022-08-02 10:16:07 +08:00
|
|
|
|
options: [
|
|
|
|
|
|
{
|
2022-08-04 18:59:32 +08:00
|
|
|
|
id: '1',
|
|
|
|
|
|
label: '在售',
|
2022-08-02 10:16:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2022-08-04 18:59:32 +08:00
|
|
|
|
id: '2',
|
|
|
|
|
|
label: '预警',
|
2022-08-02 10:16:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2022-08-04 18:59:32 +08:00
|
|
|
|
id: '0',
|
|
|
|
|
|
label: '下架',
|
2022-08-02 10:16:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
],
|
2022-08-04 18:59:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 请求商品列表的参数
|
2022-08-02 10:16:07 +08:00
|
|
|
|
form: {
|
2022-08-04 18:59:32 +08:00
|
|
|
|
goods_title: '', // 商品名称
|
|
|
|
|
|
type_id: '', // 商品种类id
|
|
|
|
|
|
brand_id: '', // 商品品牌id
|
|
|
|
|
|
sku_title: '', // 商品规格
|
|
|
|
|
|
status: '', // 商品状态
|
|
|
|
|
|
keyword_type: '', // 库存
|
|
|
|
|
|
keyword_value: '',
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
per_page: 5,
|
2022-08-02 10:16:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
input: '',
|
|
|
|
|
|
value1: '',
|
|
|
|
|
|
currentPage4: 4,
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2022-08-04 18:59:32 +08:00
|
|
|
|
// 列表编辑
|
|
|
|
|
|
handleEdit(id) {
|
|
|
|
|
|
this.$router.push('/addgoods?id=' + id)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取商品列表
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
this.form.keyword_value = this.timer[0] + '-' + this.timer[1]
|
|
|
|
|
|
const forms = { ...this.form }
|
|
|
|
|
|
console.log(forms, 'opopo')
|
|
|
|
|
|
goods(forms).then((res) => {
|
|
|
|
|
|
this.tableData = res.data.data
|
|
|
|
|
|
console.log(res, 111)
|
|
|
|
|
|
// console.log(this.tableData, 'ppp')
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 筛选
|
|
|
|
|
|
handleChoose() {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 分页-当前页改变
|
|
|
|
|
|
handleCurrentChange(e) {
|
|
|
|
|
|
this.form.page = e
|
|
|
|
|
|
this.handleChoose()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
handleSizeChange(e) {
|
|
|
|
|
|
this.form.per_page = e
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 重置筛选
|
|
|
|
|
|
handleReChoose() {
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
goods_title: '', // 商品名称
|
|
|
|
|
|
type_id: '', // 商品种类id
|
|
|
|
|
|
brand_id: '', // 商品品牌id
|
|
|
|
|
|
sku_title: '', // 商品规格
|
|
|
|
|
|
status: '', // 商品状态
|
|
|
|
|
|
keyword_type: '',
|
|
|
|
|
|
}
|
|
|
|
|
|
this.timer = ''
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 导入商品
|
|
|
|
|
|
handleImport() {},
|
|
|
|
|
|
// 导出商品
|
|
|
|
|
|
handleExport() {},
|
2022-08-02 10:16:07 +08:00
|
|
|
|
// 点击上新
|
|
|
|
|
|
update() {
|
|
|
|
|
|
this.isShow = true
|
|
|
|
|
|
console.log(this.isShow, 8888)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 复选框按钮
|
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
|
console.log(val)
|
|
|
|
|
|
this.multipleSelection = val
|
|
|
|
|
|
},
|
|
|
|
|
|
// 新增商品
|
|
|
|
|
|
addNewgoods() {
|
2022-08-04 18:59:32 +08:00
|
|
|
|
this.$router.push({ path: '/addgoods' })
|
2022-08-02 10:16:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2022-08-04 18:59:32 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
|
// 获取商品种类
|
|
|
|
|
|
goods_types().then((res) => {
|
|
|
|
|
|
this.cate = res.data.data
|
|
|
|
|
|
})
|
|
|
|
|
|
// 获取商品品牌
|
|
|
|
|
|
Brand_goods_types().then((res) => {
|
|
|
|
|
|
this.brand = res.data.data
|
|
|
|
|
|
})
|
|
|
|
|
|
// 获取商品列表
|
|
|
|
|
|
this.getList()
|
2022-08-02 10:16:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="css" scoped>
|
|
|
|
|
|
.loss {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
2022-08-04 18:59:32 +08:00
|
|
|
|
|
|
|
|
|
|
/deep/ .detail .el-button,
|
|
|
|
|
|
/deep/ .detail .el-button--primary {
|
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
height: 20px;
|
|
|
|
|
|
line-height: 5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .detail .el-input,
|
|
|
|
|
|
/deep/ .detail .el-input__inner {
|
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
height: 20px;
|
2022-08-02 10:16:07 +08:00
|
|
|
|
}
|
2022-08-04 18:59:32 +08:00
|
|
|
|
|
2022-08-02 10:16:07 +08:00
|
|
|
|
.goods {
|
|
|
|
|
|
}
|
|
|
|
|
|
.table {
|
|
|
|
|
|
margin-top: 40px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.btn {
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|