pull/9/head
xk_chenlianjie 12 months ago
commit f35a48591a
  1. 7
      src/api/product/productAttr.js
  2. 6
      src/router/index.js
  3. 156
      src/views/product/inventoryRecords/index.vue
  4. 7
      src/views/product/productAdd/newIndex.vue

@ -205,4 +205,11 @@ delete(page) {
data: page
})
},
getInventoryRecords(page) {
return request({
url: `/oil-mongo-log/updateStock/getRecords`,
method: 'post',
data: page
})
},
}

@ -54,6 +54,12 @@ export const constantRoutes = [{
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 },

@ -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="操作信息" width="300px">
<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>

@ -195,14 +195,14 @@
<el-row v-show="currentTab === 1 && !isDisabled">
<el-col :span="24">
<el-form-item label="商品详情:">
<Tinymce v-model="formValidate.content"></Tinymce>
<Tinymce v-model="formValidate.productDetail"></Tinymce>
</el-form-item>
</el-col>
</el-row>
<el-row v-show="currentTab === 1 && isDisabled">
<el-col :span="24">
<el-form-item label="商品详情:">
<span v-html="formValidate.content || '无'"></span>
<span v-html="formValidate.productDetail || '无'"></span>
</el-form-item>
</el-col>
</el-row>
@ -375,7 +375,8 @@ export default {
formValidate: {
recommendOrNewMark: "1",
productStatus: "1",
attr: []
attr: [],
productDetail:""
},
formDynamics: {
ruleName: '',

Loading…
Cancel
Save