Commit fc4fd33b by cwq0219

商品-未入库

1 parent 88e2b569
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Container } from 'element-ui'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container } from 'element-ui'
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
......@@ -24,5 +24,7 @@ Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Tooltip)
Vue.use(Tabs)
Vue.use(TabPane)
export const message = Message
export const messageBox = MessageBox
......@@ -6,11 +6,17 @@ const staticRoutes = Object.freeze([
meta: {}
},
{
name: 'WarehousingList',
path: '/cmmodityLibrary/warehousingList',
component: resolve => require([`@/views/cmmodityLibrary/warehousingList.vue`], resolve),
name: 'commodityList',
path: '/cmmodityLibrary/commodityList',
component: resolve => require([`@/views/cmmodityLibrary/commodityList.vue`], resolve),
meta: {}
},
// {
// name: 'WarehousingList',
// path: '/cmmodityLibrary/warehousingList',
// component: resolve => require([`@/views/cmmodityLibrary/warehousingList.vue`], resolve),
// meta: {}
// },
{
name: 'editProduct',
path: '/cmmodityLibrary/editProduct',
......
<!-- 商品库 -->
<template>
<div>
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="未入库" name="noWarehous">
<warehous-list></warehous-list>
</el-tab-pane>
<el-tab-pane label="已入库" name="warehousing">
<warehousing-list></warehousing-list>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import warehousingList from './warehousingList'
import warehousList from './warehousList'
export default {
name: 'commodityList',
data() {
return {
activeName: 'noWarehous'
}
},
components: {
warehousingList,
warehousList
},
computed: {},
mounted() {},
methods: {
handleTabClick() {}
}
}
</script>
<style scoped></style>
<!-- 未入库 -->
<template>
<div class="warehous-list">
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">添加商品</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEditGroup(1)">添加商品组</el-button>
</div>
<glsx-table ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope">
<img style="width: 100px; height: 100px;" :src="scope.scope.img" />
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</glsx-table>
</div>
</template>
<script>
export default {
name: 'warehousList',
data() {
return {
size: 'mini',
searchForm: {
name: ''
},
tableData: [
{
title: '直播间名称',
price: '1001',
img: 'https://img2.baidu.com/it/u=4276914015,335466661&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
origin: '1'
}
],
// 表格组件
getListApi: '',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品标题',
prop: 'title'
},
{
label: '直播间图片',
prop: 'img',
line: 1,
addHtml: 'showImg'
},
{
label: '价格(元)',
prop: 'price'
},
{
label: '来源门店',
prop: 'origin'
}
]
}
}
},
components: {},
computed: {},
mounted() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
this.$router.push({
name: 'editProduct',
params: {
addOrEdit: addOrEdit,
row: row || {}
}
})
},
// 1-新增;2-编辑
handleEditGroup(addOrEdit, row) {
this.$router.push({
name: 'editProductGroup',
params: {
addOrEdit: addOrEdit,
row: row || {}
}
})
},
handleExamine(row) {
this.$messageBox.alert('审核大概需要1-7天', '提交审核', {
confirmButtonText: '确定',
type: 'warning',
callback: action => {
this.$message({
type: 'success',
message: '操作成功'
})
}
})
},
handleDelete(row) {
this.$messageBox.alert('是否删除该商品?', '删除', {
confirmButtonText: '确定',
type: 'error',
callback: action => {
this.$message({
type: 'success',
message: '操作成功'
})
}
})
},
handleReset() {
this.searchForm = {
name: ''
}
},
handleSearch() {
// this.$refs.liveRoomRef.refreshTable()
}
}
}
</script>
<style scoped></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!