Commit 96ae513d authored by yaya's avatar yaya

添加分销商品管理页面

parent 9edf0ce5
import request from '@/utils/request'
export function createSale(data) {
return request({
url: '/supplierItem/create',
method: 'post',
data
})
}
export function getSaleList(data) {
return request({
url: '/supplierItem/findList',
method: 'post',
data
})
}
......@@ -428,6 +428,44 @@ export const asyncRouterMap = [
}
]
},
{
path: '/sale',
component: Layout,
redirect: 'noredirect',
alwaysShow: true,
name: 'sale',
meta: {
title: '分销管理',
icon: 'table'
},
children: [
{
path: 'saleList',
component: () => import('@/views/sale/saleList'),
name: 'saleList',
meta: {
perms: [],
title: '分销商品管理',
icon: 'user',
noCache: true,
keepAlive: true
}
},
{
path: 'saleAdd',
component: () => import('@/views/sale/saleAdd'),
name: 'saleAdd',
meta: {
perms: [],
title: '添加/编辑商品',
icon: 'user',
noCache: true,
keepAlive: true
},
hidden: true
}
]
},
{
path: '/service',
component: Layout,
......
This diff is collapsed.
<template>
<div class="page_consignList">
<div class="filter-container">
<el-button size="mini" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">添加</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
highlight-current-row>
<!-- <el-table-column align="center" label="排行" width="100px" type="index" />-->
<el-table-column align="center" min-width="100px" prop="saleId" label="寄售单号" />
<el-table-column align="center" label="图片" prop="itemImg">
<template slot-scope="scope">
<img v-if="scope.row.itemImg" :src="scope.row.itemImg" width="60px" height="60px">
</template>
</el-table-column>
<el-table-column align="center" label="名称" prop="itemName" >
<template slot-scope="scope" >
<Line2Hidden :text="scope.row.itemName" />
</template>
</el-table-column>
<el-table-column align="center" label="状态" prop="systemStateName" />
<el-table-column align="center" label="下单时间" prop="saleTime" />
<el-table-column align="center" label="操作" width="300">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleToDetail(scope.row)">编辑
</el-button>
<el-button
:disabled="scope.row.isHasPrice"
type="primary"
size="mini"
@click="handleImageValueDialogShow(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.size"
@pagination="getList" />
</div>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { getSaleList } from '@/api/business/sale'
export default {
name: 'SaleList',
components: {
Pagination,
Line2Hidden
},
data() {
return {
itemKey: 0,
listLoading: true,
listQuery: {
page: 1,
size: 20
},
list: [],
total: 0,
// 图文估价
imageValueDialogShow: false,
// 建议寄售价
identifyValueDialogShow: false,
// 货品售出
finishDialogShow: false,
// 寄售凭证
finishSettlementDialogShow: false,
// 取消
cancelConsignDialogShow: false,
currentSaleId: ''
}
},
created() {
this.getList()
},
destroyed() {
this.clearAll()
},
methods: {
handleCreate() {
this.$router.push({ path: '/sale/saleAdd' })
},
// 清除所有定时器
clearAll() {
if (this.list) {
this.list.forEach((el) => {
clearInterval(el.countDown)
})
}
},
handlerGetList() {
this.listQuery.page = 1
this.getList()
},
handleClick(tab, event) {
this.listQuery.page = 1
this.getList()
},
getList() {
localStorage.setItem('systemState', '')
this.listLoading = true
getSaleList(this.listQuery).then(response => {
this.clearAll()
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
},
/**
* 详情
*/
handleToDetail(item) {
this.$router.push({ path: '/consign/consignDetail', query: { saleId: item.saleId, timeStr: item.timeStr }})
},
/**
* 图文评估
*/
handleImageValueDialogShow(item) {
this.imageValueDialogShow = true
this.currentSaleId = item.saleId
},
/**
* 货品签收
*/
handleConfirmReceive(item) {
/*
const params = { saleId: item.saleId }
confirmReceive(params)
.then(response => {
this.$notify.success({
message: '货品签收成功'
})
this.getList()
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})*/
},
/**
* 实物评估
*/
handleIdentifyValueDialogShow(item) {
this.identifyValueDialogShow = true
this.currentSaleId = item.saleId
},
/**
* 货品售出
*/
handleFinishDialogShow(item) {
this.finishDialogShow = true
this.currentSaleId = item.saleId
},
/**
* 待用户结款
*/
handleFinishSettlementDialogShow(item) {
this.finishSettlementDialogShow = true
this.currentSaleId = item.saleId
},
/**
* 取消寄售
*/
handleCancelDialogShow(item) {
this.cancelConsignDialogShow = true
this.currentSaleId = item.saleId
}
}
}
</script>
<style scoped>
/deep/ .cell {
display: flex;
justify-content: center;
}
.page_consignList {
padding: 20px;
}
</style>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment