商品库存记录

pull/7/head
mrsun 10 months ago
parent 6bce2b80c2
commit aedc739a3d
  1. 131
      src/api/product/productAttr.js
  2. 16
      src/router/index.js
  3. 156
      src/views/product/inventoryRecords/index.vue

@ -1,208 +1,215 @@
import request from '@/utils/request'
var service_name = 'oil-mall'
var service_name = 'oil-mall'
export default {
productAddGetSites(productId) {
productAddGetSites(productId) {
return request({
url: `/${service_name}/mallProductSiteRelation/get/${productId}`,
method: 'GET',
method: 'GET',
})
},
productAddGetEdit(productId) {
productAddGetEdit(productId) {
return request({
url: `/${service_name}/mallProductInfo/getEdit/${productId}`,
method: 'GET',
method: 'GET',
})
},
productListAuditingDetailgetByPage(productId) {
productListAuditingDetailgetByPage(productId) {
return request({
url: `/${service_name}/mallProductAuditHistory/getListByProductId/${productId}`,
method: 'GET',
method: 'GET',
})
},
productListDelete(data) {
productListDelete(data) {
return request({
url: `/${service_name}/mallProductInfo/delete`,
method: 'post',
method: 'post',
data
})
},
productListAuditProduct(data) {
productListAuditProduct(data) {
return request({
url: `/${service_name}/mallProductInfo/auditProduct`,
method: 'post',
method: 'post',
data
})
},
productListUpdateBatchList(data) {
productListUpdateBatchList(data) {
return request({
url: `/${service_name}/mallProductStock/updateBatchList`,
method: 'post',
method: 'post',
data
})
},
productListGetByPage(data) {
productListGetByPage(data) {
return request({
url: `/${service_name}/mallProductInfo/getByPage`,
method: 'post',
method: 'post',
data
})
},
addUpdate(data) {
addUpdate(data) {
return request({
url: `/${service_name}/mallProductInfo/update`,
method: 'post',
method: 'post',
data
})
},
addSave(data) {
addSave(data) {
return request({
url: `/${service_name}/mallProductInfo/save`,
method: 'post',
method: 'post',
data
})
},
getAllSites(data) {
getAllSites(data) {
return request({
url: `/${service_name}/mallProductSiteRelation/getAllSites`,
method: 'post',
method: 'post',
data
})
},
brandGetAll(data) {
brandGetAll(data) {
return request({
url: `/${service_name}/mallProductBrands/getAll`,
method: 'post',
method: 'post',
data
})
},
brandUpdate(data) {
brandUpdate(data) {
return request({
url: `/${service_name}/mallProductBrands/update`,
method: 'post',
method: 'post',
data
})
},
brandDelete(data) {
brandDelete(data) {
return request({
url: `/${service_name}/mallProductBrands/delete`,
method: 'post',
method: 'post',
data
})
},
brandSave(data) {
brandSave(data) {
return request({
url: `/${service_name}/mallProductBrands/save`,
method: 'post',
method: 'post',
data
})
},
brandGetByPage(data) {
},
brandGetByPage(data) {
return request({
url: `/${service_name}/mallProductBrands/getByPage`,
method: 'post',
method: 'post',
data
})
},
getAllAttributesType() {
},
getAllAttributesType() {
return request({
url: `/${service_name}/mallProductAttributesType/getAllAttributesType`,
method: 'get',
method: 'get',
})
},
getClassificationTree() {
},
getClassificationTree() {
return request({
url: `/${service_name}/mallProductClassification/getClassificationTree`,
method: 'get',
method: 'get',
})
},
classifySave(page) {
},
classifySave(page) {
return request({
url: `/${service_name}/mallProductClassification/save`,
method: 'post',
data: page
})
},
classifyUpdate(page) {
},
classifyUpdate(page) {
return request({
url: `/${service_name}/mallProductClassification/update`,
method: 'post',
data: page
})
},
},
classifyGetByPage(page) { // 分页查询
return request({
url: `/${service_name}/mallProductClassification/getByPage`,
method: 'post',
data: page
})
},
},
typeFindByPage(page) { // 分页查询
return request({
url: `/${service_name}/mallProductAttributesType/getByPage`,
method: 'post',
data: page
})
},
},
getByPage(page) { // 分页查询
return request({
url: `/${service_name}/mallProductAttributes/getByPage`,
method: 'post',
data: page
})
},
},
getAttrList(id) { // 分页查询
return request({
url: `/${service_name}/mallProductAttributes/get/${id}`,
method: 'GET',
method: 'GET',
})
},
delete(page) {
},
delete(page) {
return request({
url: `/${service_name}/mallProductAttributes/delete`,
method: 'post',
data: page
})
},
classifyDelete(page) {
},
classifyDelete(page) {
return request({
url: `/${service_name}/mallProductClassification/delete`,
method: 'post',
data: page
})
},
typeSave(page) {
},
typeSave(page) {
return request({
url: `/${service_name}/mallProductAttributesType/save`,
method: 'post',
data: page
})
},
save(page) {
},
save(page) {
return request({
url: `/${service_name}/mallProductAttributes/save`,
method: 'post',
data: page
})
},
typeUpdate(page) {
},
typeUpdate(page) {
return request({
url: `/${service_name}/mallProductAttributes/update`,
method: 'post',
data: page
})
},
update(page) {
},
update(page) {
return request({
url: `/${service_name}/mallProductAttributesType/update`,
method: 'post',
data: page
})
},
typeDelete(page) {
},
typeDelete(page) {
return request({
url: `/${service_name}/mallProductAttributesType/delete`,
method: 'post',
data: page
})
},
},
getInventoryRecords(page) {
return request({
url: `/oil-mongo-log/updateStock/getRecords`,
method: 'post',
data: page
})
},
}

@ -24,7 +24,7 @@ export const constantRoutes = [{
redirect: 'productList',
meta: { title: '商品', icon: 'iconkongzhitai', affix: true },
children: [
{
{
path: '/productList',
component: () => import('@/views/product/productList/index'),
name: 'productList',
@ -53,10 +53,16 @@ export const constantRoutes = [{
component: () => import('@/views/product/productAttr/index'),
name: 'productAttr',
meta: { title: '商品属性', icon: 'iconkongzhitai', affix: true }
},
},
{
path: '/inventoryRecords',
component: () => import('@/views/product/inventoryRecords/index'),
name: 'inventoryRecords',
meta: { title: '库存记录', icon: 'iconkongzhitai', affix: true }
},
]
},
{ path: '/CustomerMarket', component: CustomerMarket },
{ path: '/CustomerMarket', component: CustomerMarket },
{
path: '/profile',
component: Layout,
@ -70,7 +76,7 @@ export const constantRoutes = [{
meta: { title: '个人中心', icon: 'user', noCache: true }
}
]
},
},
{
path: '/redirect',
component: Layout,
@ -91,7 +97,7 @@ export const constantRoutes = [{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
},
{
path: '/distribution',
component: () => import('@/views/distribution/distribution'),

@ -0,0 +1,156 @@
<template>
<div>
<el-card :bordered="false" shadow="never" class="ivu-mt" :body-style="{ padding: 0 }">
<div class="padding-add">
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform"
@submit.native.prevent inline>
<el-form-item align="center" label="输入搜索">
<el-input clearable v-model="page.params.productName" placeholder="商品名称"
class="form_content_width"></el-input>
</el-form-item>
<el-form-item align="center" label="操作类型">
<el-select clearable v-model="page.params.operateType" placeholder="请选择">
<el-option label="增加库存" value="增加库存"></el-option>
<el-option label="减少库存" value="减少库存"></el-option>
<el-option label="上架库存" value="上架库存"></el-option>
<el-option label="下架库存" value="下架库存"></el-option>
<el-option label="积分兑换" value="积分兑换"></el-option>
<el-option label="商品退单" value="商品退单"></el-option>
</el-select>
</el-form-item>
<el-form-item align="center" label="操作时间">
<el-date-picker
v-model="page.params.timeRangeArr"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
align="right">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getPage">查询</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card :bordered="false" shadow="never" class="ivu-mt-16">
<el-table ref="table" :data="tableData" v-loading="loading"
highlight-current-row empty-text="暂无数据"
class="mt14">
<el-table-column align="center" label="id" width="220px" prop="id"></el-table-column>
<el-table-column align="center" label="商品图片" width="100px" prop="productImage">
<template slot-scope="scope">
<el-image style="width: 50px; height: 50px" :src="scope.row.productImage"
:preview-src-list="[scope.row.productImage]">
</el-image>
</template>
</el-table-column>
<el-table-column align="center" label="商品名称" prop="productName"></el-table-column>
<el-table-column header-align="center" align="left" label="货号/属性" width="300px">
<template slot-scope="scope">
货号<span>{{ scope.row.skuNum }}</span><br>
规格<span>{{ scope.row.attributes }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="订单号" prop="mallOrderNum" width="150px"></el-table-column>
<el-table-column align="center" label="操作类型" prop="operateType"></el-table-column>
<el-table-column align="left" label="库存" width="120px">
<template slot-scope="scope">
数量<span>{{ scope.row.operateQantity }}</span><br>
剩余<span>{{ scope.row.stockResidue }}</span>
</template>
</el-table-column>
<el-table-column header-align="center" align="left" label="操作信息">
<template slot-scope="scope">
操作人<span>{{ scope.row.operateUser }}</span><br>
操作时间<span>{{ scope.row.operateTime }}</span>
</template>
</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" />
</div>
</el-card>
</div>
</template>
<script>
import productApi from '@/api/product/productAttr.js'
export default {
data() {
return {
loading: false,
page: {
'currentPage': 1,
'pageSize': 10,
'params': {
timeRangeArr:[]
},
totalCount: 0
},
tableData: [],
total: 0,
pickerOptions: {
shortcuts: [
{
text: '最近一天',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', [start, end]);
}
},
{
text: '最近三天',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
picker.$emit('pick', [start, end]);
}
},
{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}]
},
}
},
created() {
this.getPage()
},
methods: {
//
getPage() {
productApi.getInventoryRecords(this.page).then(res => {
if (res.code === 20000) {
this.tableData = res.data.list
this.page.totalCount = parseInt(res.data.totalCount)
}
})
},
handleCurrentChange(val) {
this.page.currentPage = val
this.getPage()
},
handleSizeChange(val) {
this.page.pageSize = val
this.getPage()
}
}
}
</script>
<style scoped></style>
Loading…
Cancel
Save