Commit 88e2b569 by cwq0219
2 parents a35b518c e3b454b9
<template>
<div>
<el-card shadow="never" slot="header">
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
<el-form-item label="商品搜索:">
<el-input v-model="formInline.userName" placeholder="请输入商品名称" clearable/>
<el-input v-model="searchForm.proName" placeholder="请输入商品名称" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
......@@ -15,49 +15,29 @@
</el-card>
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
<el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" />
<el-table-column prop="pic" label="基本信息" >
<template slot-scope="scope">
<img :src="scope.row.pic" style="width: 50px;height:50px;"/>{{scope.row.title}}
</template>
</el-table-column>
<el-table-column prop="price" label="价格(元)" />
<el-table-column prop="merchant" label="来源门店" />
<el-table-column prop="" label="操作" width="120">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="updatePrice(scope.row)">修改价格</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination
background
layout="sizes, total,prev, pager, next, jumper"
:total="pageTotal"
:page-size="pageSize"
:page-sizes="pageSizes"
@current-change="getList"
@size-change="changePageSize"
/>
</div>
</div>
<glsx-table ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope">
<img style="width: 50px; height: 50px;" :src="scope.scope.pic" />{{scope.scope.title}}
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="updatePrice(scope.scope)">修改价格</el-button>
</span>
</glsx-table>
<!-- 表格区域 end -->
<!-- 重置密码弹框 开始 -->
<el-dialog title="修改价格" width="30%" v-show="showPriceDialog" @close="closePriceDialog">
<el-form ref="passForm" :rules="formRules_pass" :model="form_pass" label-width="120px">
<el-form-item label="商品价格:" prop="password">
<el-input v-model="form_pass.password" maxlength="8" style="width:400px" />
<!-- 修改价格弹框 开始 -->
<glsx-dialog title="修改价格" width="620px" :isVisible="showPriceDialog" @closeDialog="closePriceDialog" @confirmDialog="closePriceDialog">
<el-form ref="priceForm" :rules="formRules" :model="form" label-width="120px">
<el-form-item label="商品价格:" prop="price">
<el-input v-model="form.price" maxlength="8" style="width:400px" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="resetPassword()">提交</el-button>
<el-button type="primary" @click="resetPrice()">提交</el-button>
<el-button @click="showPriceDialog = false">取消</el-button>
</div>
</el-dialog>
<!-- 重置密码弹框 end -->
</glsx-dialog>
<!-- 修改价格弹框 end -->
</div>
</template>
......@@ -67,15 +47,44 @@
// GETLISTUSERINFO,
// UPDATEPASSWORD
// } from '@/http/interface'
import glsxDialog from '@/components/glsx-dialog'
export default {
components: {
// 'glsx-dialog': GlsxDialog,
// 'add-cus': AddCus,
glsxDialog
},
data() {
return {
formInline: {},
tableData: [],
searchForm: {
proName: ''
},
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '基本信息',
prop: 'pic',
line: 1,
addHtml: 'showImg'
},
{
label: '价格(元)',
prop: 'price'
},
{
label: '来源门店',
prop: 'merchant'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [{
id :1,
pic : 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
title : '商品标题',
price : 999,
merchant : 'xxx'
}],
tableLoading: false,
pageTotal: 0,
userInfo: {},
......@@ -85,10 +94,10 @@ export default {
tdWidth: 170,
DATEFORMATE: (str, type) => { return this.$Util.dateFormate(str, type) },
showPriceDialog: false,
form_pass : {},
formRules_pass: {
password: [
{ required: true, message: "请输入密码", trigger: "blur" }
form : {},
formRules: {
price: [
{ required: true, message: "请输入价格", trigger: "blur" }
]
},
}
......@@ -98,10 +107,16 @@ export default {
},
mounted: function() {
this.getList()
// this.getList()
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
/**
* 查询列表
*/
......@@ -133,7 +148,7 @@ export default {
* 获取查询参数
*/
getParams: function() {
const oParams = this.formInline
const oParams = this.searchForm
oParams.pageSize = this.pageSize
return oParams
},
......@@ -146,6 +161,10 @@ export default {
this.pageSize = e
this.getList()
},
reset() {
this.$refs.wareRef.refreshTable()
},
updatePrice: function(){
this.showPriceDialog = true
......
<template>
<div>
<el-card shadow="never" slot="header">
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
<el-form-item label="成员搜索:">
<el-input v-model="formInline.userName" placeholder="请输入微信号或者昵称" clearable/>
<el-input v-model="searchForm.userName" placeholder="请输入微信号或者昵称" clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
......@@ -15,30 +15,11 @@
</el-card>
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
<el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" />
<el-table-column prop="pic" label="头像" >
<template slot-scope="scope">
<img :src="scope.row.pic" style="width: 50px;height:50px;"/>
</template>
</el-table-column>
<el-table-column prop="userName" label="昵称" />
<el-table-column prop="userCode" label="微信号" />
<el-table-column prop="roleName" label="所属角色" />
</el-table>
<div class="pagination_list">
<el-pagination
background
layout="sizes, total,prev, pager, next, jumper"
:total="pageTotal"
:page-size="pageSize"
:page-sizes="pageSizes"
@current-change="getList"
@size-change="changePageSize"
/>
</div>
</div>
<glsx-table ref="memberRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope">
<img style="width: 50px; height: 50px;" :src="scope.scope.pic" />
</span>
</glsx-table>
<!-- 表格区域 end -->
</div>
......@@ -58,19 +39,42 @@ export default {
},
data() {
return {
formInline: {},
tableData: [],
tableLoading: false,
pageTotal: 0,
userInfo: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
tdWidth: 170,
DATEFORMATE: (str, type) => { return this.$Util.dateFormate(str, type) },
showAddDialog: false,
showPassDialog: false,
form_pass : {},
searchForm: {
userName: ''
},
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '头像',
prop: 'pic',
line: 1,
addHtml: 'showImg'
},
{
label: '昵称',
prop: 'userName'
},
{
label: '微信号',
prop: 'userCode'
},
{
label: '所属角色',
prop: 'roleName'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [{
id :1,
pic : 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName : '昵称',
userCode : '微信号',
roleName : '所属角色'
}],
tableLoading: false
}
},
created() {
......@@ -78,10 +82,16 @@ export default {
},
mounted: function() {
this.getList()
// this.getList()
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
/**
* 查询列表
*/
......@@ -93,9 +103,9 @@ export default {
let list = [{
id :1,
pic : 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName : 'userName',
userCode : 'userCode',
roleName : 'roleName'
userName : '昵称',
userCode : '微信号',
roleName : '所属角色'
}]
// GETLISTUSERINFO(oParams).then(res => {
// console.log(res)
......@@ -127,7 +137,12 @@ export default {
this.getList()
},
/**
* 重置
*/
reset() {
this.$refs.memberRef.refreshTable()
},
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!