Commit 99e5812c authored by yaya's avatar yaya

feat:优化

parent 63781579
...@@ -45,4 +45,11 @@ export function findSaleDetail(data) { ...@@ -45,4 +45,11 @@ export function findSaleDetail(data) {
data data
}) })
} }
export function irregularOff(data) {
return request({
url: '/supplierItem/irregularOff',
method: 'post',
data
})
}
...@@ -141,7 +141,8 @@ export const asyncRouterMap = [ ...@@ -141,7 +141,8 @@ export const asyncRouterMap = [
title: '会员详情', title: '会员详情',
icon: 'message', icon: 'message',
noCache: true noCache: true
} },
hidden: true
}, },
{ {
path: 'feedback', path: 'feedback',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="page_consignList"> <div class="page_consignList">
<div class="filter-container"> <div class="filter-container">
<div class="button_left"> <div class="button_left">
<el-input v-model="listQuery.name" clearable class="filter-item" style="width: 200px;" placeholder="请输入标题"/> <el-input v-model="listQuery.name" clearable class="filter-item" style="width: 200px;" placeholder="请输入商品标题"/>
<el-select v-model="listQuery.isOnSale" placeholder="请选择是否出售" class="filter-item" style="width: 200px;"> <el-select v-model="listQuery.isOnSale" placeholder="请选择是否出售" class="filter-item" style="width: 200px;">
<el-option <el-option
v-for="item in options" v-for="item in options"
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
size="mini"/> size="mini"/>
</el-select> </el-select>
<el-button class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 12px" @click="handleFilter">查找</el-button> <el-button class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 12px" @click="handleFilter">查找</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 12px" @click="handleReset">重置</el-button>
</div> </div>
</div> </div>
<el-table <el-table
...@@ -65,13 +66,19 @@ ...@@ -65,13 +66,19 @@
<span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span> <span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="100"> <el-table-column align="center" label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="handleToDetail(scope.row)">详情 @click="handleToDetail(scope.row)">详情
</el-button> </el-button>
<el-button
v-if="scope.row.status === 0"
type="danger"
size="mini"
@click="handleSetItemOff(scope.row)">违规下架
</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -90,7 +97,7 @@ ...@@ -90,7 +97,7 @@
<script> <script>
import Line2Hidden from '@/components/line2Hidden' import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { getSaleList, updateOnSale, deleteSaleItem } from '@/api/business/sale' import { getSaleList, updateOnSale, deleteSaleItem, irregularOff } from '@/api/business/sale'
import { MessageBox } from 'element-ui' import { MessageBox } from 'element-ui'
export default { export default {
...@@ -164,6 +171,13 @@ export default { ...@@ -164,6 +171,13 @@ export default {
handleCreate() { handleCreate() {
this.$router.push({ path: '/sale/saleAdd' }) this.$router.push({ path: '/sale/saleAdd' })
}, },
handleReset() {
this.listQuery = {
page: 1,
limit: 20,
type: 3
}
},
handlerGetList() { handlerGetList() {
this.listQuery.page = 1 this.listQuery.page = 1
this.getList() this.getList()
...@@ -210,10 +224,40 @@ export default { ...@@ -210,10 +224,40 @@ export default {
}) })
this.getList() this.getList()
}).catch(err => { }).catch(err => {
this.$notify.error({ this.$message.error(err.data && err.data.errmsg || '请求失败, 请重试')
title: '失败', })
message: err.data.errmsg })
},
/**
* 违规下架
* @param this.userDetail
*/
handleSetItemOff(row) {
this.$confirm('是否将该商品违规下架?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = {
id: row.id,
state: 1
}
irregularOff(params).then(response => {
this.list = this.list.filter((item) => {
if (item.id === row.id) {
item.statusName = '违规下架'
item.status = 1
item.isAbleSale = false
return item
}
return item
}) })
this.$notify.success({
message: '下架成功'
})
}).catch((e) => {
console.log('===报错=', e)
this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
}) })
}) })
} }
......
...@@ -205,11 +205,7 @@ export default { ...@@ -205,11 +205,7 @@ export default {
message: successTip message: successTip
}) })
}).catch((e) => { }).catch((e) => {
this.$notify({ this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
title: '提示',
message: e.message || '请求失败, 请重试',
type: 'warning'
})
}) })
}) })
}, },
...@@ -242,11 +238,7 @@ export default { ...@@ -242,11 +238,7 @@ export default {
}) })
}).catch((e) => { }).catch((e) => {
console.log('===报错=', e) console.log('===报错=', e)
this.$notify({ this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
title: '提示',
message: e.message || '请求失败, 请重试',
type: 'warning'
})
}) })
}) })
}, },
......
...@@ -247,11 +247,7 @@ export default { ...@@ -247,11 +247,7 @@ export default {
message: successTip message: successTip
}) })
}).catch((e) => { }).catch((e) => {
this.$notify({ this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
title: '提示',
message: e.message || '请求失败, 请重试',
type: 'warning'
})
}) })
}) })
}, },
...@@ -278,11 +274,7 @@ export default { ...@@ -278,11 +274,7 @@ export default {
}) })
}).catch((e) => { }).catch((e) => {
console.log('===报错=', e) console.log('===报错=', e)
this.$notify({ this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
title: '提示',
message: e.message || '请求失败, 请重试',
type: 'warning'
})
}) })
}) })
} }
......
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