commit
a65df7e75f
10 changed files with 669 additions and 58 deletions
@ -0,0 +1,159 @@ |
||||
<template> |
||||
<div class="article-manager"> |
||||
<el-card :bordered="false" shadow="never" class="ivu-mt-16"> |
||||
<div> |
||||
<el-form :model="page" label-width="80px" label-position="right" inline @submit.native.prevent> |
||||
<el-form-item label="商品名称:"> |
||||
<el-input clearable placeholder="商品名称" v-model="page.params.productName" class="form_content_width" /> |
||||
</el-form-item> |
||||
|
||||
<el-form-item> |
||||
<el-button type="primary" @click="userSearchs">查询</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</div> |
||||
|
||||
<el-table row-key="id" class="mt14" v-loading="loading" :data="tableData" empty-text="暂无数据" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55"> </el-table-column> |
||||
<el-table-column prop="id" label="编号" min-width="120"></el-table-column> |
||||
<el-table-column prop="productName" label="商品名称" min-width="100"></el-table-column> |
||||
<el-table-column prop="productNum" label="货号" min-width="120" align="center"></el-table-column> |
||||
<el-table-column prop="price" label="价格" align="right"></el-table-column> |
||||
</el-table> |
||||
</el-card> |
||||
|
||||
<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" |
||||
/> |
||||
<el-col :span="24" style="text-align: right;padding-top:20px"> |
||||
<el-button @click="close">取消</el-button> |
||||
<el-button type="primary" @click="submit">提交</el-button> |
||||
</el-col> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import marketingApi from '@/api/finance/marketing.js' |
||||
import { loadingFn } from '@/utils/validate' |
||||
export default { |
||||
name: 'product_productClassify', |
||||
props: { |
||||
type: { |
||||
type: String, |
||||
default: () => undefined |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
addDialog: false, // 添加弹窗 |
||||
updateDialog: false, // 修改弹窗 |
||||
multipleSelection: [], |
||||
FromData: null, |
||||
advertisement: { productList: [{ id: '', productName: '' }] }, |
||||
grid: { |
||||
xl: 7, |
||||
lg: 7, |
||||
md: 12, |
||||
sm: 24, |
||||
xs: 24 |
||||
}, |
||||
loading: false, |
||||
|
||||
page: { |
||||
currentPage: 1, |
||||
pageSize: 10, |
||||
params: {}, |
||||
totalCount: 0 |
||||
}, |
||||
total: 0, |
||||
tableData: [] |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getList() |
||||
}, |
||||
created() { |
||||
this.advertisement.type = this.type |
||||
}, |
||||
methods: { |
||||
// 批量设置商品 |
||||
batchSelect(type) {}, |
||||
handleSizeChange(val) { |
||||
this.page.pageSize = val |
||||
this.getList() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page.currentPage = val |
||||
this.getList() |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
// 列表 |
||||
getList() { |
||||
loadingFn.call( |
||||
this, |
||||
'loading', |
||||
marketingApi.getProductByPage(this.page).then(res => { |
||||
if ((res.code = 20000)) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data) |
||||
}) |
||||
) |
||||
}, |
||||
pageChange(index) { |
||||
this.page.currentPage = index |
||||
this.getList() |
||||
}, |
||||
submit() { |
||||
// 保存 |
||||
if (!this.multipleSelection || this.multipleSelection.length < 1) { |
||||
this.$message.error('请选择需要操作的数据') |
||||
return |
||||
} |
||||
|
||||
this.advertisement = Object.assign(this.advertisement, { productList: this.multipleSelection }) |
||||
console.log('---------------', this.advertisement) |
||||
marketingApi.chooseProducts(this.advertisement).then(res => { |
||||
this.$message.success(res.msg) |
||||
this.$emit('closeDialog') |
||||
this.$emit('getList') |
||||
}) |
||||
}, |
||||
close() { |
||||
this.$emit('closeDialog') |
||||
}, |
||||
// 表格搜索 |
||||
userSearchs() { |
||||
this.page.currentPage = 1 |
||||
this.getList() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped lang="stylus"> |
||||
.treeSel ::v-deep .ivu-select-dropdown-list { |
||||
padding: 0 10px !important; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
.tabBox_img { |
||||
width: 36px; |
||||
height: 36px; |
||||
border-radius: 4px; |
||||
cursor: pointer; |
||||
|
||||
img { |
||||
width: 100%; |
||||
height: 100%; |
||||
|
||||
|
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,198 @@ |
||||
<template> |
||||
<div class="article-manager"> |
||||
<div :bordered="false" shadow="never" class="ivu-mt-16"> |
||||
<div class="module"> |
||||
<div class="text mt50">模块设置</div> |
||||
<div class="text-left mt50"></div> |
||||
<el-table row-key="id" class="tab mt14" v-loading="loading" :data="tableData" empty-text="暂无数据"> |
||||
<el-table-column prop="moduleName" label="名称" align="center"></el-table-column> |
||||
|
||||
<el-table-column prop="isReveal" label="显示隐藏" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-switch |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="onchangeIsShow(scope.row)" |
||||
v-model="scope.row.isReveal" |
||||
active-color="#13ce66" |
||||
inactive-color="#ff4949" |
||||
> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="date" label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button plain type="info" @click="toUp(scope.row)" icon="el-icon-upload2">上移</el-button> |
||||
|
||||
<el-button plain @click="toDown(scope.row, scope)" type="info" icon="el-icon-download">下移</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
<el-row slot="button-group" style="margin-top:5px" v-if="false"> |
||||
<el-col :offset="22"> |
||||
<el-button type="primary" :size="$store.getters.size" @click="submit">提交</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import marketingApi from '@/api/finance/marketing.js' |
||||
import { loadingFn } from '@/utils/validate' |
||||
export default { |
||||
name: 'product_productClassify', |
||||
components: {}, |
||||
data() { |
||||
return { |
||||
editDialogConfig: { |
||||
visible: false |
||||
}, |
||||
treeSelect: [], |
||||
FromData: null, |
||||
grid: { |
||||
xl: 7, |
||||
lg: 7, |
||||
md: 12, |
||||
sm: 24, |
||||
xs: 24 |
||||
}, |
||||
loading: false, |
||||
|
||||
page: { |
||||
currentPage: 1, |
||||
pageSize: 10, |
||||
params: { |
||||
type: '1' |
||||
}, |
||||
totalCount: 0 |
||||
}, |
||||
total: 0, |
||||
tableData: [] |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getList() |
||||
}, |
||||
methods: { |
||||
handleCommand(e) {}, |
||||
handleSizeChange(val) { |
||||
this.page.pageSize = val |
||||
this.getList() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page.currentPage = val |
||||
this.getList() |
||||
}, |
||||
// 商品分类; |
||||
goodsCategory() {}, |
||||
// 列表 |
||||
getList() { |
||||
loadingFn.call( |
||||
this, |
||||
'loading', |
||||
marketingApi.getModuleByPage(this.page).then(res => { |
||||
if ((res.code = 20000)) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data) |
||||
}) |
||||
) |
||||
}, |
||||
pageChange(index) { |
||||
this.page.currentPage = index |
||||
this.getList() |
||||
}, |
||||
|
||||
// 修改状态 |
||||
onchangeIsShow(row) { |
||||
console.log(row) |
||||
let data = { |
||||
id: row.id, |
||||
isReveal: row.isReveal |
||||
} |
||||
marketingApi |
||||
.updateModule(data) |
||||
.then(async res => { |
||||
this.$message.success(res.msg) |
||||
this.getList() |
||||
}) |
||||
.catch(res => { |
||||
this.$message.error(res.msg) |
||||
this.getList() |
||||
}) |
||||
}, |
||||
|
||||
// 上移 |
||||
toUp(row, scope) { |
||||
console.log(row) |
||||
this.$alert('请确定将改模块上移!', '提示', { |
||||
confirmButtonText: '确定', |
||||
callback: action => { |
||||
if (action == 'confirm') { |
||||
loadingFn.call( |
||||
this, |
||||
'loading', |
||||
marketingApi.fluctuation(row.id, '1').then(res => { |
||||
if ((res.code = 20000)) { |
||||
this.$message.success('操作成功!') |
||||
this.handleCurrentChange() |
||||
} |
||||
}) |
||||
) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
// 下移 |
||||
toDown(row, scope) { |
||||
this.$alert('请确定将改模块下移!', '提示', { |
||||
confirmButtonText: '确定', |
||||
callback: action => { |
||||
if (action == 'confirm') { |
||||
loadingFn.call( |
||||
this, |
||||
'loading', |
||||
marketingApi.fluctuation(row.id, '0').then(res => { |
||||
if ((res.code = 20000)) { |
||||
this.$message.success('操作成功!') |
||||
this.handleCurrentChange() |
||||
} |
||||
}) |
||||
) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
// 表格搜索 |
||||
userSearchs() { |
||||
this.page.currentPage = 1 |
||||
this.getList() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style> |
||||
.module { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.text { |
||||
font-size: 18px; |
||||
background: #9ea7b4; |
||||
height: 50px; |
||||
text-align: left; |
||||
line-height: 50px; |
||||
padding-left: 50px; |
||||
color: white; |
||||
width: 200px; |
||||
} |
||||
.text-left { |
||||
width: 0; |
||||
height: 0; |
||||
border: 25px solid; |
||||
border-color: transparent transparent transparent #9ea7b4; |
||||
} |
||||
.tab { |
||||
width: 200px; |
||||
background: transparent; |
||||
} |
||||
</style> |
Loading…
Reference in new issue