wangxianzhang 3 years ago
parent
commit
4efc256ca9
  1. 19719
      epmet-oper-web/package-lock.json
  2. 75
      epmet-oper-web/src/components/table-tree-column/index.vue
  3. 11
      epmet-oper-web/src/components/wx-index/score.vue
  4. 6
      epmet-oper-web/src/js/columns/customer/manage/customer.js
  5. 179
      epmet-oper-web/src/mixins/view-module-post.js
  6. 57
      epmet-oper-web/src/views/main-navbar-update-password.vue
  7. 54
      epmet-oper-web/src/views/main-navbar.vue
  8. 32
      epmet-oper-web/src/views/modules/customer/manage/CustomerList.vue
  9. 186
      epmet-oper-web/src/views/modules/customer/union/customerrelation-add-or-update.vue
  10. 139
      epmet-oper-web/src/views/modules/customer/union/customerrelation.vue
  11. 239
      epmet-oper-web/src/views/modules/workPc/baobiao/customer-set.vue
  12. 73
      epmet-oper-web/src/views/modules/workPc/baobiao/index.vue
  13. 125
      epmet-oper-web/src/views/modules/workPc/dataMenu.vue
  14. 14
      epmet-oper-web/src/views/modules/workPc/menu-add-or-update.vue
  15. 4
      epmet-oper-web/src/views/modules/workPc/menu.vue

19719
epmet-oper-web/package-lock.json

File diff suppressed because it is too large

75
epmet-oper-web/src/components/table-tree-column/index.vue

@ -0,0 +1,75 @@
<template>
<el-table-column :prop="prop" v-bind="$attrs">
<template slot-scope="scope">
<span @click.prevent="toggleHandle(scope.$index, scope.row)" :style="{ 'padding-left': ((scope.row._level || 0) * 10) + 'px' }">
<i :class="[ scope.row._expanded ? 'el-icon-caret-bottom' : 'el-icon-caret-right' ]" :style="{ 'visibility': hasChild(scope.row) ? 'visible' : 'hidden' }"></i>
{{ scope.row[prop] }}
</span>
</template>
</el-table-column>
</template>
<script>
import isArray from 'lodash/isArray'
export default {
name: 'table-tree-column',
props: {
prop: {
type: String
},
treeKey: {
type: String,
default: 'id'
},
parentKey: {
type: String,
default: 'pid'
},
childKey: {
type: String,
default: 'children'
}
},
methods: {
hasChild (row) {
return (isArray(row[this.childKey]) && row[this.childKey].length >= 1) || false
},
//
toggleHandle (index, row) {
if (!this.hasChild(row)) {
return false
}
var data = this.$parent.store.states.data.slice(0)
data[index]._expanded = !data[index]._expanded
if (data[index]._expanded) {
row[this.childKey].forEach(item => {
item._level = (row._level || 0) + 1
item._expanded = false
})
data = data.splice(0, index + 1).concat(row[this.childKey]).concat(data)
} else {
data = this.removeChildNode(data, row[this.treeKey])
}
this.$parent.store.commit('setData', data)
this.$nextTick(() => {
this.$parent.doLayout()
})
},
//
removeChildNode (data, pid) {
var pids = isArray(pid) ? pid : [pid]
if (pid.length <= 0) {
return data
}
var ids = []
for (var i = 0; i < data.length; i++) {
if (pids.indexOf(data[i][this.parentKey]) !== -1 && pids.indexOf(data[i][this.treeKey]) === -1) {
ids.push(data.splice(i, 1)[0][this.treeKey])
i--
}
}
return this.removeChildNode(data, ids)
}
}
}
</script>

11
epmet-oper-web/src/components/wx-index/score.vue

@ -13,11 +13,11 @@
<div v-if="item.configuration.title" <div v-if="item.configuration.title"
class="cpt-title-t">{{item.configuration.title}}</div> class="cpt-title-t">{{item.configuration.title}}</div>
<div v-else <div v-else
class="cpt-title-t">积分排行</div> class="cpt-title-t">积分排行1111111</div>
</div> </div>
<div class="info"> <!-- <div class="info">
<div class="card"> <div class="card">
<div class="title"> <div class="title">
<img class="avatar" <img class="avatar"
@ -61,9 +61,9 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
<div class="score_list"> <!-- <div class="score_list">
<div class="item" <div class="item"
:key="subindex" :key="subindex"
@ -88,7 +88,7 @@
<div class="name">{{ subitem.name }}</div> <div class="name">{{ subitem.name }}</div>
<div class="score">{{ subitem.score }}</div> <div class="score">{{ subitem.score }}</div>
</div> </div>
</div> </div> -->
</div> </div>
<!-- <div class="score_rank_content"> <!-- <div class="score_rank_content">
@ -419,6 +419,7 @@ export default {
item: Object item: Object
}, },
mounted () { mounted () {
console.log('score', this.item)
}, },
methods: { methods: {

6
epmet-oper-web/src/js/columns/customer/manage/customer.js

@ -59,14 +59,14 @@ export default {
cityKey: 'city', cityKey: 'city',
countyKey: 'county', countyKey: 'county',
format: 'address', format: 'address',
width: 150 width: 120
}, },
{ {
key: 'gridNumber', key: 'gridNumber',
title: '网格数', title: '网格数',
display: ['table', 'model'], display: ['table', 'model'],
block: true, block: true,
width: 60 width: 40
}, },
{ {
key: 'validityTime', key: 'validityTime',
@ -88,7 +88,7 @@ export default {
} }
], ],
block: true, block: true,
width: 60 width: 40
}, },
{ {
key: 'rootManagePhone', key: 'rootManagePhone',

179
epmet-oper-web/src/mixins/view-module-post.js

@ -0,0 +1,179 @@
import Cookies from 'js-cookie'
import qs from 'qs'
export default {
data() {
/* eslint-disable */
return {
// 设置属性
mixinViewModuleOptions: {
createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口?
activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口?
getDataListURL: '', // 数据列表接口,API地址
getDataListIsPage: false, // 数据列表接口,是否需要分页?
deleteURL: '', // 删除接口,API地址
deleteIsBatch: false, // 删除接口,是否需要批量?
deleteIsBatchKey: 'id', // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...
exportURL: '' // 导出接口,API地址
},
// 默认属性
dataForm: {}, // 查询条件
dataList: [], // 数据列表
order: '', // 排序,asc/desc
orderField: '', // 排序,字段
page: 1, // 当前页码
limit: 10, // 每页数
total: 0, // 总条数
dataListLoading: false, // 数据列表,loading状态
dataListSelections: [], // 数据列表,多选项
addOrUpdateVisible: false // 新增/更新,弹窗visible状态
}
/* eslint-enable */
},
created() {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.query()
}
},
activated() {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.query()
}
},
methods: {
// 获取数据列表
query() {
this.dataListLoading = true
this.$http
.post(this.mixinViewModuleOptions.getDataListURL, {
order: this.order,
orderField: this.orderField,
page: this.mixinViewModuleOptions.getDataListIsPage
? this.page
: null,
limit: this.mixinViewModuleOptions.getDataListIsPage
? this.limit
: null,
...this.dataForm
})
.then(({ data: res }) => {
this.dataListLoading = false
if (res.code !== 0) {
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
? res.data.list
: res.data
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total
: 0
})
.catch(() => {
this.dataListLoading = false
})
},
// 多选
dataListSelectionChangeHandle(val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle(data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
return false
}
this.order = data.order.replace(/ending$/, '')
this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
this.query()
},
// 分页, 每页条数
pageSizeChangeHandle(val) {
this.page = 1
this.limit = val
this.query()
},
// 分页, 当前页
pageCurrentChangeHandle(val) {
this.page = val
this.query()
},
getDataList: function () {
this.page = 1
this.query()
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
})
},
// 删除
deleteHandle(id) {
if (
this.mixinViewModuleOptions.deleteIsBatch &&
!id &&
this.dataListSelections.length <= 0
) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(
this.$t('prompt.info', { handle: this.$t('delete') }),
this.$t('prompt.title'),
{
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}
)
.then(() => {
this.$http
.delete(
`${this.mixinViewModuleOptions.deleteURL}${
this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id
}`,
this.mixinViewModuleOptions.deleteIsBatch
? {
data: id
? [id]
: this.dataListSelections.map(
(item) =>
item[this.mixinViewModuleOptions.deleteIsBatchKey]
)
}
: {}
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.query()
}
})
})
.catch(() => {})
})
.catch(() => {})
},
// 导出
exportHandle() {
var params = qs.stringify({
token: Cookies.get('token'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`
}
}
}

57
epmet-oper-web/src/views/main-navbar-update-password.vue

@ -1,6 +1,7 @@
<template> <template>
<el-dialog :visible.sync="visible" <el-dialog :visible.sync="visible"
:title="$t('updatePassword.title')" :title="$t('updatePassword.title')"
width="500px"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:append-to-body="true"> :append-to-body="true">
@ -8,16 +9,16 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()" @keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"> label-width="100px">
<el-form-item :label="$t('updatePassword.username')"> <el-form-item :label="$t('updatePassword.username')">
<span>{{ $store.state.user.realName }}</span> <span>{{ $store.state.user.realName }}</span>
</el-form-item> </el-form-item>
<el-form-item prop="password" <!-- <el-form-item prop="password"
:label="$t('updatePassword.password')"> :label="$t('updatePassword.password')">
<el-input v-model="dataForm.password" <el-input v-model="dataForm.password"
type="password" type="password"
:placeholder="$t('updatePassword.password')"></el-input> :placeholder="$t('updatePassword.password')"></el-input>
</el-form-item> </el-form-item> -->
<el-form-item prop="newPassword" <el-form-item prop="newPassword"
:label="$t('updatePassword.newPassword')"> :label="$t('updatePassword.newPassword')">
<el-input v-model="dataForm.newPassword" <el-input v-model="dataForm.newPassword"
@ -42,12 +43,13 @@
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { clearLoginInfo } from '@/utils' import { clearLoginInfo } from '@/utils'
import { requestPost } from '@/js/dai/request'
export default { export default {
data () { data () {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
password: '', // password: '',
newPassword: '', newPassword: '',
confirmPassword: '' confirmPassword: ''
} }
@ -62,9 +64,9 @@ export default {
callback() callback()
} }
return { return {
password: [ // password: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } // { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], // ],
newPassword: [ newPassword: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
@ -83,28 +85,39 @@ export default {
}) })
}, },
// //
dataFormSubmitHandle: debounce(function() { dataFormSubmitHandle () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} }
this.$http.put('/sys/user/password', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { this.submitForm()
return this.$message.error(res.msg) })
},
async submitForm () {
if (this.dataForm.newPassword !== this.dataForm.confirmPassword) {
this.$message.info('请输入相同密码')
return false
}
const url = '/epmetuser/operuser/updatePwd'
const params = {
// workAuth: 1,
// resiAuth: 1,
newPassword: this.dataForm.newPassword,
} }
this.$message({
message: this.$t('prompt.success'), const { data, code, msg } = await requestPost(url, params)
type: 'success', if (code === 0) {
duration: 500, this.$message.success('操作成功')
onClose: () => {
this.visible = false this.visible = false
clearLoginInfo()
this.$router.replace({ name: 'login' }) } else {
this.$message.error(msg)
}
} }
})
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false })
} }
} }
</script> </script>

54
epmet-oper-web/src/views/main-navbar.vue

@ -74,7 +74,9 @@
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item> --> <el-dropdown-item v-if=" userType!=='work'"
@click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item>
<!-- <el-dropdown-item @click.native="changePasswordHandle()">修改密码</el-dropdown-item> -->
<el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item> <el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -87,6 +89,36 @@
</nav> </nav>
<nav v-else <nav v-else
class="aui-navbar main-line"></nav> class="aui-navbar main-line"></nav>
<!-- <el-dialog :visible.sync="showChangePassword"
width="30%"
:modal="false"
:title="'修改密码'"
:close-on-click-modal="false"
:close-on-press-escape="false">
<el-form size="mini"
:inline="true">
<el-form-item label="新密码">
<el-input v-model="filterText"></el-input>
</el-form-item>
<el-form-item label="确认密码">
<el-input v-model="filterText"></el-input>
</el-form-item>
<el-form-item>
<el-button type="default">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<template slot="footer">
<el-button type="default"
@click="cancelHandle()"
size="mini">取消</el-button>
<el-button type="primary"
@click="commitHandle()"
size="mini">确认</el-button>
</template>
</el-dialog> -->
</div> </div>
</template> </template>
@ -104,7 +136,9 @@ export default {
showHeader: true, showHeader: true,
i18nMessages: messages, i18nMessages: messages,
updatePassowrdVisible: false, updatePassowrdVisible: false,
customerName: localStorage.getItem('customerName') customerName: localStorage.getItem('customerName'),
showChangePassword: false,
} }
@ -123,6 +157,14 @@ export default {
return localStorage.getItem('userType') return localStorage.getItem('userType')
}, },
dataRule () {
return {
pass: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
}, },
methods: { methods: {
@ -148,6 +190,12 @@ export default {
this.$refs.updatePassowrd.init() this.$refs.updatePassowrd.init()
}) })
}, },
//
changePasswordHandle () {
},
// 退 // 退
logoutHandle () { logoutHandle () {
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), {
@ -163,7 +211,7 @@ export default {
this.$http.post('/auth/login/logout').then(({ data: res }) => { this.$http.post('/auth/login/logout').then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
// 退 // 退
if (res.code !== 10007){ if (res.code !== 10007) {
this.$message.error(res.msg) this.$message.error(res.msg)
} }
} }

32
epmet-oper-web/src/views/modules/customer/manage/CustomerList.vue

@ -26,7 +26,8 @@
:tableHeight="tableHeight" :tableHeight="tableHeight"
:operationWidth="80" :operationWidth="80"
@config="config" @config="config"
@edit="edit"> @edit="edit"
@init="init">
</c-table> </c-table>
</div> </div>
</el-card> </el-card>
@ -79,6 +80,18 @@ export default {
isShow: (row) => { isShow: (row) => {
return true return true
} }
},
{
lable: '数字社区初始化', //
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'init', //
isShow: (row) => {
return true
}
} }
], ],
@ -118,6 +131,23 @@ export default {
this.$refs['ref_edit_form'].initData(row) this.$refs['ref_edit_form'].initData(row)
}, },
//
init (row) {
let params = {
customerId: row.customerId,
areaCode: row.rootAgencyAreaCode,
}
this.$http.get(`/oper/customize/icform/initCustomerForm/resi_base_info/`, {params: params}).then(({ data: res }) => {
if (res.code === 0) {
return this.$message.info(res.data)
} else {
return this.$message.error(res.internalMsg)
}
})
},
// //
config (row) { config (row) {
this.$refs['ref_config_form'].initData(row) this.$refs['ref_config_form'].initData(row)

186
epmet-oper-web/src/views/modules/customer/union/customerrelation-add-or-update.vue

@ -0,0 +1,186 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="父级客户" prop="parentCustomerId">
<el-select clearable v-model="dataForm.parentCustomerId" placeholder="请选择" @change="changeRootCustomer($event)">
<el-option v-for="item in rootCustomer" :key="item.customerId" :label="item.customerName" :value="item.customerId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="子级客户" prop="customerId">
<el-select clearable v-model="dataForm.customerId" placeholder="请选择" @change="changeSubCustomer($event)">
<el-option v-for="item in subCustomer" :key="item.customerId" :label="item.customerName" :value="item.customerId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否启用" prop="status">
<el-select clearable v-model="dataForm.status" placeholder="请选择">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.name" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
areaCode: '0',
rootCustomer: [],
subCustomer: [],
statusOptions: [
{ value: 'open', name: '启用' },
{ value: 'closed', name: '禁用' }
],
dataForm: {
id: '',
customerId: '',
parentCustomerId: '',
pids: '0',
customerType: '',
parentCustomerType: '',
status: '',
level: '',
areaCode: '',
parentAreaCode: ''
}
}
},
computed: {
dataRule () {
return {
customerId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
parentCustomerId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
pids: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
status: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
level: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
areaCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
parentAreaCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
this.getRootCustomer()
},
getRootCustomer () {
this.$http.get(`/gov/org/agency/areasubagency/0`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.rootCustomer = res.data
if (this.rootCustomer.length === 0) {
this.$message({
type: 'warning',
message: '当前客户区划下没有下级客户'
})
}
}).catch(() => {})
},
getSubCustomer () {
if (this.areaCode) {
this.$http.get(`/gov/org/agency/areasubagency/` + this.areaCode).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
res.data.forEach(element => {
if (element.customerId !== this.dataForm.parentCustomerId ){
this.subCustomer.push(element)
}
});
if (this.subCustomer.length === 0) {
this.$message({
type: 'warning',
message: '该客户区划下没有下级客户'
})
}
}).catch(() => {})
}
},
changeRootCustomer (e) {
this.subCustomer = []
if (this.dataForm.parentCustomerId) {
let root = this.rootCustomer.filter(item => item.customerId === this.dataForm.parentCustomerId)[0]
if (root) {
this.dataForm.parentAreaCode = root.areaCode
this.areaCode = root.areaCode
this.getSubCustomer()
}
}
},
changeSubCustomer (e) {
if (this.dataForm.customerId) {
let root = this.subCustomer.filter(item => item.customerId === this.dataForm.customerId)[0]
if (root) {
this.dataForm.level = root.level
this.dataForm.areaCode = root.areaCode
}
}
},
//
getInfo () {
this.$http.get(`/oper/crm/customerRelation/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/oper/crm/customerRelation/save', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

139
epmet-oper-web/src/views/modules/customer/union/customerrelation.vue

@ -0,0 +1,139 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__customerRelation}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<!-- <el-form-item>-->
<!-- <el-input v-model="dataForm.id" placeholder="id" clearable></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button @click="getDataList()">{{ $t('query') }}</el-button>-->
<!-- </el-form-item>-->
<!--<el-form-item>-->
<!--<el-button class="diy-button&#45;&#45;add" size="small" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>-->
<!--</el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>-->
<!-- </el-form-item>-->
</el-form>
<!-- <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%">-->
<!-- <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>-->
<!-- <el-table-column prop="id" label="主键" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="customerId" label="客户id" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="parentCustomerId" label="父级客户id;如果是顶级客户,此列=0" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="pids" label="当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="customerType" label="当前客户类型取值: external:外部客户,internal:内部客户" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="parentCustomerType" label="父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="status" label="open,closed是否启用" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="level" label="当前客户级别社区级community-->
<!--街道:street,-->
<!--区县级: district,-->
<!--市级: city-->
<!--省级:province" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="areaCode" label="当前客户的地区编码,实际就是根组织的area_code" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="parentAreaCode" label="07.01:当前客户的的上级组织对应的area_code" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="delFlag" label="删除标识0未删除1已删除" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id, $t('update'))">{{ $t('update') }}</el-button>-->
<!-- <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <el-pagination-->
<!-- :current-page="page"-->
<!-- :page-sizes="[10, 20, 50, 100]"-->
<!-- :page-size="limit"-->
<!-- :total="total"-->
<!-- layout="total, sizes, prev, pager, next, jumper"-->
<!-- @size-change="pageSizeChangeHandle"-->
<!-- @current-change="pageCurrentChangeHandle">-->
<!-- </el-pagination>-->
<el-table
class="resi-table"
v-loading="tableLoading"
:data="tableData"
:default-expand-all="true"
row-key="areaCode"
border
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
:height="tableHeight">
<el-table-column prop="areaName" label="区域名称"></el-table-column>
<el-table-column prop="customerName" label="客户名称" header-align="center" align="center"></el-table-column>
<!--<el-table-column prop="status" label="是否启用" header-align="center" align="center">-->
<!--<template slot-scope="scope">-->
<!--<el-tag v-if="scope.row.status === 'open' && scope.row.parentCustomerId !== '0'" size="small" type="success">{{ '启用' }}</el-tag>-->
<!--<el-tag v-if="scope.row.status === 'close' && scope.row.parentCustomerId !== '0'" size="small" type="danger">{{ '禁用' }}</el-tag>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="操作" align="center" width="300">-->
<!--<template slot-scope="scope">-->
<!--<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id, $t('update'))">{{ $t('update') }}</el-button>-->
<!--<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './customerrelation-add-or-update'
import TableTreeColumn from '@/components/table-tree-column'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
createdIsNeed: false,
getDataListURL: '/gov/org/agency/customertree',
getDataListIsPage: true,
deleteURL: '/oper/crm/customerRelation',
deleteIsBatch: true
},
tableLoading: false,
tableData: [],
dataForm: {
id: ''
}
}
},
components: {
TableTreeColumn,
AddOrUpdate
},
created() {
this.getTableData()
},
methods: {
//
async getTableData () {
this.tableLoading = true
await this.$http.get('/gov/org/agency/customertree').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败')
} else {
this.tableData = res.data
}
}).catch(() => {})
this.tableLoading = false
},
addOrUpdateHandle(id, title) {
this.dialogTitle = title;
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id;
this.$refs.addOrUpdate.init();
});
this.addOrUpdateVisible = true;
},
}
}
</script>

239
epmet-oper-web/src/views/modules/workPc/baobiao/customer-set.vue

@ -0,0 +1,239 @@
<template>
<el-dialog
:visible.sync="visible"
:title="'选择客户'"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="700px"
:top="diaTop"
>
<div class="customerDiv" :style="{ height: diaHeight + 'px' }">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
>全选</el-checkbox
>
<div
class="customerItem"
:key="item.customerId"
v-for="(item, index) in customerList"
>
<el-checkbox
:key="index"
class="customerItem"
v-model="item.selected"
:label="item.customerId"
>{{ item.customerName }}</el-checkbox
>
<el-select
v-show="item.selected"
v-model="item.categoryKeyArr"
size="small"
multiple
collapse-tags
placeholder="请选择功能类别"
>
<el-option
v-for="item in categoryOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-button
class="item-btn"
v-if="item.selected"
style="margin-left: 20px"
type="text"
size="small"
@click="copyToAll(item)"
>应用到所有客户</el-button
>
</div>
</div>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="save()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request'
import { mapGetters } from 'vuex'
let loading //
export default {
data() {
return {
visible: false,
elseParams: {}, //id
categoryOptions: [],
customerList: [], //
isIndeterminate: true,
checkAll: false
}
},
computed: {
diaWidth() {
return this.resolution === 'small' ? 60 : 50
},
diaHeight() {
return this.resolution === 'small' ? 350 : 600
},
diaTop() {
return this.resolution === 'small' ? '30px' : '100px'
},
...mapGetters(['clientHeight', 'resolution'])
},
mounted() {
this.getOptions()
},
methods: {
handleCheckAllChange(val) {
this.customerList.forEach((item) => {
item.selected = val
})
this.isIndeterminate = false
},
copyToAll(val) {
this.customerList.forEach((item) => {
item.categoryKeyArr = [...val.categoryKeyArr]
})
},
async init(row) {
console.log('1111111111', row)
const { reportId, customerList } = row
this.visible = true
this.elseParams = { reportId }
this.startLoading()
this.customerList = []
await this.getCustomerList()
customerList.forEach((item) => {
let same = this.customerList.find(
(item2) => item2.customerId == item.customerId
)
if (same) {
same.selected = true
same.categoryKeyArr.push(item.categoryKey)
}
})
this.endLoading()
},
//
async getCustomerList() {
const { data, code, msg } = await requestGet(
'/oper/crm/customer/getvalidcustomerlist',
{}
)
if (code === 0) {
this.customerList = data.map((item) => {
item.categoryKeyArr = []
item.selected = false
return item
})
} else {
this.$message.error(msg)
}
},
//
async getOptions() {
const { data, code, msg } = await requestPost('/sys/dict/data/dictlist', {
dictType: 'jmreport_category'
})
if (code === 0) {
this.categoryOptions = data
} else {
this.$message.error(msg)
}
},
async save() {
this.checkCustomerList = []
const url = '/oper/customize/icCustomerReport/edit'
const parmas = {
...this.elseParams,
type: 'add',
customerList: this.customerList
.filter((item) => item.selected)
.map((item) => ({
customerId: item.customerId,
categoryKeys: item.categoryKeyArr
}))
}
const { data, code, msg } = await requestPost(url, parmas)
if (code === 0) {
this.$message.success('保存成功')
this.visible = false
this.$emit('refreshDataList')
} else {
this.$message.error(msg)
}
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
}
}
</script>
<style lang="scss" scoped>
.customerDiv {
margin-left: 100px;
overflow-y: scroll;
}
.customerItem {
margin: 20px;
font-size: 15px;
display: flex;
align-items: center;
.item-btn {
visibility: hidden;
}
&:hover {
.item-btn {
visibility: visible;
}
}
}
.item_span {
margin-left: 20px;
}
</style>

73
epmet-oper-web/src/views/modules/workPc/baobiao/index.vue

@ -0,0 +1,73 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu">
<el-table
v-loading="dataListLoading"
:data="dataList"
row-key="id"
border
:height="tableHeight"
style="width: 100%"
>
<el-table-column
prop="reportName"
label="模板名称"
header-align="center"
min-width="150"
></el-table-column>
<el-table-column
label="客户配置"
fixed="right"
header-align="center"
align="center"
width="150"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="showCustomerMenu(scope.row)"
>{{ '客户配置' }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 客户菜单配置 -->
<customer-set ref="customerForm" @refreshDataList="getDataList" />
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module-post'
import { mapGetters } from 'vuex'
import CustomerSet from './customer-set'
export default {
mixins: [mixinViewModule],
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/oper/customize/icCustomerReport/list'
},
customerFormVisible: false,
dataForm: {}
}
},
components: {
CustomerSet
},
computed: {
tableHeight() {
// return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220
return this.clientHeight - 210
},
...mapGetters(['clientHeight', 'resolution'])
},
methods: {
showCustomerMenu(row) {
this.$refs['customerForm'].init(row)
}
}
}
</script>

125
epmet-oper-web/src/views/modules/workPc/dataMenu.vue

@ -0,0 +1,125 @@
<template>
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-sys__menu">
<el-form :inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()">
<el-form-item>
<el-button type="primary"
@click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading"
:data="dataList"
row-key="id"
border
:height="tableHeight"
style="width: 100%;">
<el-table-column prop="name"
:label="$t('menu.name')"
header-align="center"
min-width="150"></el-table-column>
<el-table-column prop="icon"
:label="$t('menu.icon')"
header-align="center"
align="center">
<template slot-scope="scope">
<svg class="icon-svg"
aria-hidden="true">
<use :xlink:href="`#${scope.row.icon}`"></use>
</svg>
</template>
</el-table-column>
<el-table-column prop="type"
:label="$t('menu.type')"
header-align="center"
align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.type === 0"
size="small">{{ $t('menu.type0') }}</el-tag>
<el-tag v-else
size="small"
type="info">{{ $t('menu.type1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="sort"
:label="$t('menu.sort')"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="url"
:label="$t('menu.url')"
header-align="center"
align="center"
width="150"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="permissions"
:label="$t('menu.permissions')"
header-align="center"
align="center"
width="150"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150">
<template slot-scope="scope">
<el-button type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text"
size="small"
@click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text"
size="small"
@click="showCustomerMenu(scope.row.id)">{{ '客户配置' }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible"
ref="addOrUpdate"
:tableName="'data_menu'"
@refreshDataList="getDataList"></add-or-update>
<!-- 客户菜单配置 -->
<customer-add-or-update ref="customerForm"
@refreshDataList="getDataList"></customer-add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './menu-add-or-update'
import { mapGetters } from 'vuex'
import CustomerAddOrUpdate from './customer-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/list',
deleteURL: '/gov/access/menu'
},
customerFormVisible: false,
dataForm: {"tableName":'data_menu'}
}
},
components: {
AddOrUpdate, CustomerAddOrUpdate
},
computed: {
tableHeight () {
// return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220
return this.clientHeight - 210
},
...mapGetters(['clientHeight', 'resolution']),
},
methods: {
showCustomerMenu (tableId) {
this.$refs['customerForm'].init(tableId)
}
}
}
</script>

14
epmet-oper-web/src/views/modules/workPc/menu-add-or-update.vue

@ -114,7 +114,8 @@ export default {
resourceList: [], resourceList: [],
permissions: '', permissions: '',
sort: 0, sort: 0,
icon: '' icon: '',
tableName: ''
} }
} }
}, },
@ -130,6 +131,12 @@ export default {
} }
} }
}, },
props: {
tableName:{
type:String,
default:'gov_menu'
}
},
watch: { watch: {
'dataForm.type' (val) { 'dataForm.type' (val) {
this.$refs['dataForm'].clearValidate() this.$refs['dataForm'].clearValidate()
@ -152,7 +159,7 @@ export default {
}, },
// //
getMenuList () { getMenuList () {
return this.$http.get('/gov/access/menu/list?type=0').then(({ data: res }) => { return this.$http.get('/gov/access/menu/list?type=0&tableName='+this.tableName).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -161,7 +168,7 @@ export default {
}, },
// //
getInfo () { getInfo () {
this.$http.get(`/gov/access/menu/${this.dataForm.id}`).then(({ data: res }) => { this.$http.get(`/gov/access/menu/${this.dataForm.id}?tableName=`+this.tableName).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -209,6 +216,7 @@ export default {
if (!valid) { if (!valid) {
return false return false
} }
this.dataForm.tableName = this.tableName;
this.$http[!this.dataForm.id ? 'post' : 'put']('/gov/access/menu', this.dataForm).then(({ data: res }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/gov/access/menu', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)

4
epmet-oper-web/src/views/modules/workPc/menu.vue

@ -80,6 +80,7 @@
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" <add-or-update v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:tableName="'gov_menu'"
@refreshDataList="getDataList"></add-or-update> @refreshDataList="getDataList"></add-or-update>
<!-- 客户菜单配置 --> <!-- 客户菜单配置 -->
<customer-add-or-update ref="customerForm" <customer-add-or-update ref="customerForm"
@ -101,7 +102,8 @@ export default {
getDataListURL: '/gov/access/menu/list', getDataListURL: '/gov/access/menu/list',
deleteURL: '/gov/access/menu' deleteURL: '/gov/access/menu'
}, },
customerFormVisible: false customerFormVisible: false,
dataForm: {"tableName":'gov_menu'}
} }
}, },
components: { components: {

Loading…
Cancel
Save