城阳运营端pc前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
7.3 KiB

5 years ago
<template>
5 years ago
<div>
<el-card shadow="never"
class="aui-card--fill">
<div v-show="showType==='list'"
class="mod-/oper/customize__homecomponent}">
<el-form :inline="true">
<el-form-item>
<el-input v-model="ruleForm.name"
placeholder="请输入客户名称"
:clearable="true"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="submitForm(ruleForm)">查询</el-button>
</el-form-item>
</el-form>
5 years ago
5 years ago
<el-table :data="customerList"
ref="ref_customertable"
5 years ago
border
style="width: 100%;">
<el-table-column label="客户名称"
header-align="center"
align="center"
prop="customerName"></el-table-column>
<el-table-column label="logo"
header-align="center"
align="center"
prop="logo">
<template slot-scope="scope">
5 years ago
<el-image v-if="scope.row.logo"
style="width: 50px; height: 50px"
5 years ago
:src="scope.row.logo"
@click="addSrcList(scope.row.logo)"
:preview-src-list="srcList"></el-image>
5 years ago
<span v-else>--</span>
5 years ago
</template>
</el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
align="center"
5 years ago
width="400">
5 years ago
<template slot-scope="scope">
<el-button type="text"
size="small"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,0)">居民端首页</el-button>
<el-button type="text"
size="small"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,1)">工作端首页</el-button>
<el-button type="text"
size="small"
@click="showConfigItem(scope.row.customerId,scope.row.customerName)">功能配置</el-button>
5 years ago
<el-button type="text"
size="small"
@click="showFootbar(scope.row.customerId,scope.row.customerName)">FootBar配置</el-button>
5 years ago
<el-button type="text"
size="small"
@click="showLimitConfig(scope.row.customerId,scope.row.customerName)">角色权限</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination :current-page="pageNo"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"></el-pagination>
</div>
<div v-show="showType==='miniHome'">
<mini-home ref="ref_mini_home"
@cancleBack="cancleBack"></mini-home>
</div>
<div v-show="showType==='config'">
<config-item ref="ref_config_item"
@cancleBack="cancleBack"></config-item>
</div>
5 years ago
<div v-show="showType==='footbar'">
5 years ago
<footbar-list ref="ref_footbarlist"
:showFrom="'customize'"
:tableKeywork="'FootBarCustomize'"
5 years ago
@cancleBack="cancleBack"></footbar-list>
</div>
5 years ago
<el-dialog :visible.sync="funcVisible"
title="功能列表"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="90%"
top="30px">
<role-list v-if="funcVisible"
:customer-id="customerId"
:customer-name="customerName" />
</el-dialog>
</el-card>
</div>
5 years ago
</template>
<script>
import ConfigItem from './ConfigItem'
5 years ago
import FootbarList from '../../productConfig/footbar/FootbarList'
5 years ago
import MiniHome from './MiniHome'
import RoleList from './roleList'
5 years ago
export default {
data () {
return {
funcVisible: false,
5 years ago
diaName: '功能配置',
noImg: '暂无图片',
customerList: [],
input: '',
customerId: '',
customerName: '',
5 years ago
pageNo: 1,
pageSize: 10,
ruleForm: { name: '' },
total: 0,
srcList: [],
showType: 'list' // 显示的组件类型
5 years ago
}
},
components: {
ConfigItem,
MiniHome,
5 years ago
RoleList,
FootbarList
5 years ago
},
5 years ago
activated () {
if (this.showType === 'footbar') {
this.$nextTick(() => {
this.$refs['ref_footbarlist'].doLayout() // 解决表格错位
})
} else if (this.showType === 'list') {
this.$nextTick(() => {
this.$refs['ref_customertable'].doLayout() // 解决表格错位
})
5 years ago
}
5 years ago
},
mounted () {
// const userType = localStorage.getItem('userType')
// if (userType === 'work') {
// this.showMiniHome(localStorage.getItem('customerId'), localStorage.getItem('customerName'), 0)
// } else {
5 years ago
this.queryCustomerList()
5 years ago
// }
5 years ago
},
methods: {
queryCustomerList () {
let params = {
customerName: '',
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$http
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
this.total = res.data.total
}
})
5 years ago
},
submitForm (formName) {
let params = {
customerName: formName.name,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$http
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
}
})
5 years ago
},
showMiniHome (customerId, customerName, type) {
this.showType = 'miniHome'
this.$refs['ref_mini_home'].startSetWxIndex(
customerId,
customerName,
type
)
5 years ago
},
// 功能配置
5 years ago
showConfigItem (customerId, customerName) {
5 years ago
this.showType = 'config'
5 years ago
this.$refs['ref_config_item'].initData(customerId, customerName)
},
5 years ago
// footbar配置
showFootbar (customerId, customerName) {
this.showType = 'footbar'
5 years ago
this.$refs['ref_footbarlist'].initData(customerId, customerName)
5 years ago
},
5 years ago
// 显示权限配置
showLimitConfig (customerId, customerName) {
this.customerId = customerId
this.customerName = customerName
this.funcVisible = !this.funcVisible
// this.$message.warning("当前功能还未开发");
5 years ago
},
pageCurrentChangeHandle (val) {
this.pageNo = val
this.queryCustomerList()
},
pageSizeChangeHandle (val) {
this.pageSize = val
this.queryCustomerList()
},
addSrcList (url) {
this.srcList = []
this.srcList.push(url)
},
// 组件取消返回
cancleBack () {
this.showType = 'list'
}
}
}
</script>