提交 e5f16ac2 authored 作者: 宋雄's avatar 宋雄

接口对接

上级 8121d106
NODE_ENV=development NODE_ENV=development
VUE_APP_API_BASE_URL='http://192.168.0.118:9999' VUE_APP_API_BASE_URL='http://192.168.0.118:9999'
# VUE_APP_API_BASE_URL='http://220.203.25.212:9999/property-company' # VUE_APP_API_BASE_URL='http://220.203.25.212:9999'
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ", "pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve --open",
"build:test": "vue-cli-service build --mode test", "build:test": "vue-cli-service build --mode test",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
......
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage' import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue' import Vue from 'vue'
import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types" import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
// 首页统计
const homeDataStatistics = (params)=>getAction("/company/homepage/dataStatistics",params);
//角色管理 //角色管理
const addRole = (params)=>postAction("/sys/role/add",params); const addRole = (params)=>postAction("/sys/role/add",params);
const editRole = (params)=>putAction("/sys/role/edit",params); const editRole = (params)=>putAction("/sys/role/edit",params);
...@@ -28,6 +29,7 @@ const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu", ...@@ -28,6 +29,7 @@ const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",
const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params) const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params)
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params); const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params); const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params);
const queryTreeListByTypeForRole = (params)=>getAction("/sys/role/queryTreeListByType",{...params, platformType: 'community'});
const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params); const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params);
const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params); const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params);
const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params); const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params);
...@@ -60,6 +62,15 @@ const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params); ...@@ -60,6 +62,15 @@ const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);
const getChargeListApi = (params)=>getAction("/property-company/system/chargeType/chargeTypelist",params); const getChargeListApi = (params)=>getAction("/property-company/system/chargeType/chargeTypelist",params);
const addReceiptTemplate = (params)=>postAction("/property-company/system/receiptTemplate/add",params); const addReceiptTemplate = (params)=>postAction("/property-company/system/receiptTemplate/add",params);
// 小区列表
const getCommunityListApi = (params)=>getAction("/property-company/community/companyCommunity/list",params);
// 资产管理小区列表
const getCapitalCommunityListApi = (params)=>getAction("/property-company/community/companyCommunity/communityList",params);
const callAssetSubmitApi = (params)=>postAction("/property-community/asset/propertyAsset/callAsset",params);
// 公告详情
const queryNoticeCommunityApi = (params)=>getAction("/property-company/notice/companyNotice/queryNoticeCommunityRefByMainId",params);
//数据字典 //数据字典
const addDict = (params)=>postAction("/sys/dict/add",params); const addDict = (params)=>postAction("/sys/dict/add",params);
const editDict = (params)=>putAction("/sys/dict/edit",params); const editDict = (params)=>putAction("/sys/dict/edit",params);
...@@ -104,6 +115,7 @@ export const transitRESTful = { ...@@ -104,6 +115,7 @@ export const transitRESTful = {
} }
export { export {
homeDataStatistics,
addRole, addRole,
editRole, editRole,
checkRoleCode, checkRoleCode,
...@@ -146,6 +158,7 @@ export { ...@@ -146,6 +158,7 @@ export {
queryUserByDepId, queryUserByDepId,
duplicateCheck, duplicateCheck,
queryTreeListForRole, queryTreeListForRole,
queryTreeListByTypeForRole,
getSystemMenuList, getSystemMenuList,
getSystemSubmenu, getSystemSubmenu,
getSystemSubmenuBatch, getSystemSubmenuBatch,
...@@ -160,7 +173,11 @@ export { ...@@ -160,7 +173,11 @@ export {
getUserNoticeInfo, getUserNoticeInfo,
getDictItemsFromCache, getDictItemsFromCache,
getChargeListApi, getChargeListApi,
addReceiptTemplate addReceiptTemplate,
getCommunityListApi,
getCapitalCommunityListApi,
callAssetSubmitApi,
queryNoticeCommunityApi
} }
......
// 紧急程度
export const URGENT_DEGREE = [
{label: '一般', value: 'usual'},
{label: '紧急', value: 'urgent'}
]
// 是否定时发布
export const SCHEDULED_RELEASE = [
{label: '是', value: 1},
{label: '否', value: 0}
]
// 公告状态
export const NOTICE_STATUS = [
{label: '已发布', value: 'published'},
{label: '待发布', value: 'waitPublish'}
]
/**
* 翻译字段值对应的文本
* @param children
* @returns string
*/
export function filterDictTextByStatic(dictList, value) {
if(!dictList || dictList.length === 0){
return;
}
return dictList.find(item=>item.value === value).label
}
\ No newline at end of file
<template> <template>
<v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :onClick="handleClick"> <div>
<v-tooltip :showTitle="false" dataKey="item*percent"/> <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
<v-axis/> <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :onClick="handleClick">
<v-legend dataKey="item"/> <v-tooltip :showTitle="false" dataKey="item*percent"/>
<v-pie position="percent" color="item" :v-style="pieStyle" :label="labelConfig"/> <v-axis/>
<v-coord type="theta"/> <v-legend dataKey="item"/>
</v-chart> <v-pie position="percent" color="item" :v-style="pieStyle" :label="labelConfig"/>
<v-coord type="theta" :radius="0.75" :innerRadius="0.6" />
</v-chart>
</div>
</template> </template>
<script> <script>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
import { getFileAccessHttpUrl } from '@/api/manage' import { getFileAccessHttpUrl } from '@/api/manage'
const uidGenerator=()=>{ const uidGenerator=()=>{
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
accept:{ accept:{
type:[String,null], type:[String,null],
required:false, required:false,
default:null default: 'image/*'
} }
//update-end-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性,用于判断上传数量 //update-end-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性,用于判断上传数量
}, },
...@@ -115,7 +115,8 @@ ...@@ -115,7 +115,8 @@
}, },
created(){ created(){
const token = Vue.ls.get(ACCESS_TOKEN); const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token} const tenantId = Vue.ls.get(TENANT_ID);
this.headers = {"X-Access-Token":token,'tenant-id': tenantId}
}, },
methods:{ methods:{
initFileList(paths){ initFileList(paths){
...@@ -238,7 +239,7 @@ ...@@ -238,7 +239,7 @@
* https://github.com/zhangdaiscott/jeecg-boot/issues/1779 * https://github.com/zhangdaiscott/jeecg-boot/issues/1779
*/ */
/deep/ .imgupload .iconp{padding:20px;} /* /deep/ .imgupload .iconp{padding:20px;} */
/* update--end--autor:lvdandan-----date:20201016------for:j-image-upload图片组件单张图片详情回显空白*/ /* update--end--autor:lvdandan-----date:20201016------for:j-image-upload图片组件单张图片详情回显空白*/
/deep/ .image-upload-single-over .ant-upload-select{display: none} /deep/ .image-upload-single-over .ant-upload-select{display: none}
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
import { getFileAccessHttpUrl } from '@/api/manage'; import { getFileAccessHttpUrl } from '@/api/manage';
const FILE_TYPE_ALL = "all" const FILE_TYPE_ALL = "all"
...@@ -170,8 +170,9 @@ ...@@ -170,8 +170,9 @@
}, },
created(){ created(){
const token = Vue.ls.get(ACCESS_TOKEN); const token = Vue.ls.get(ACCESS_TOKEN);
const tenantId = Vue.ls.get(TENANT_ID);
//---------------------------- begin 图片左右换位置 ------------------------------------- //---------------------------- begin 图片左右换位置 -------------------------------------
this.headers = {"X-Access-Token":token}; this.headers = {"X-Access-Token":token,'tenant-id': tenantId};
this.containerId = 'container-ty-'+new Date().getTime(); this.containerId = 'container-ty-'+new Date().getTime();
//---------------------------- end 图片左右换位置 ------------------------------------- //---------------------------- end 图片左右换位置 -------------------------------------
}, },
......
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
* @param title 要修改的新标题 * @param title 要修改的新标题
*/ */
changeTitle(title) { changeTitle(title) {
let projectTitle = "Jeecg-Boot 企业级低代码平台" let projectTitle = "湖北汉江之星科技有限公司"
// 首页特殊处理 // 首页特殊处理
if (this.$route.path === indexKey) { if (this.$route.path === indexKey) {
document.title = projectTitle document.title = projectTitle
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
min-height: 100%; min-height: 100%;
background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%; background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
background-size: 100%; background-size: 100%;
padding: 110px 0 144px; padding-top: 110px;
position: relative; position: relative;
a { a {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
:type="collapsed ? 'menu-unfold' : 'menu-fold'" :type="collapsed ? 'menu-unfold' : 'menu-fold'"
@click="toggle"/> @click="toggle"/>
<span v-if="device === 'desktop'">欢迎进入 湖北汉江之星科技有限公司 企业平台</span> <span v-if="device === 'desktop'">欢迎进入 {{companyName}} 物业公司</span>
<!-- <span v-else>Jeecg-Boot</span> --> <!-- <span v-else>Jeecg-Boot</span> -->
<user-menu :theme="theme"/> <user-menu :theme="theme"/>
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
</template> </template>
<script> <script>
import Vue from 'vue'
import { USER_INFO } from "@/store/mutation-types"
import UserMenu from '../tools/UserMenu' import UserMenu from '../tools/UserMenu'
import SMenu from '../menu/' import SMenu from '../menu/'
import Logo from '../tools/Logo' import Logo from '../tools/Logo'
...@@ -98,6 +100,7 @@ ...@@ -98,6 +100,7 @@
headerIndexRight: {}, headerIndexRight: {},
topSmenuStyle: {} topSmenuStyle: {}
}, },
companyName: '',
chatStatus: '', chatStatus: '',
} }
}, },
...@@ -122,6 +125,7 @@ ...@@ -122,6 +125,7 @@
if (this.mode === 'topmenu') { if (this.mode === 'topmenu') {
this.buildTopMenuStyle() this.buildTopMenuStyle()
} }
this.companyName = Vue.ls.get(USER_INFO).platformName || ''
//update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮----- //update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
}, },
methods: { methods: {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
props: { props: {
title: { title: {
type: String, type: String,
default: '汉江之星', default: '汉星科技',
required: false required: false
}, },
showTitle: { showTitle: {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<span v-if="isDesktop()">欢迎您,{{ nickname() }}</span> <span v-if="isDesktop()">欢迎您,{{ nickname() }}</span>
</span> </span>
<a-menu slot="overlay" class="user-dropdown-menu-wrapper"> <a-menu slot="overlay" class="user-dropdown-menu-wrapper">
<a-menu-item key="0"> <!-- <a-menu-item key="0">
<router-link :to="{ name: 'account-center' }"> <router-link :to="{ name: 'account-center' }">
<a-icon type="user"/> <a-icon type="user"/>
<span>个人中心</span> <span>个人中心</span>
...@@ -53,15 +53,15 @@ ...@@ -53,15 +53,15 @@
<a-menu-item key="3" @click="systemSetting"> <a-menu-item key="3" @click="systemSetting">
<a-icon type="tool"/> <a-icon type="tool"/>
<span>系统设置</span> <span>系统设置</span>
</a-menu-item> </a-menu-item> -->
<a-menu-item key="4" @click="updatePassword"> <a-menu-item key="4" @click="updatePassword">
<a-icon type="setting"/> <a-icon type="setting"/>
<span>密码修改</span> <span>密码修改</span>
</a-menu-item> </a-menu-item>
<a-menu-item key="5" @click="updateCurrentDepart"> <!-- <a-menu-item key="5" @click="updateCurrentDepart">
<a-icon type="cluster"/> <a-icon type="cluster"/>
<span>切换部门</span> <span>切换部门</span>
</a-menu-item> </a-menu-item> -->
<a-menu-item key="6" @click="clearCache"> <a-menu-item key="6" @click="clearCache">
<a-icon type="sync"/> <a-icon type="sync"/>
<span>清理缓存</span> <span>清理缓存</span>
...@@ -184,8 +184,8 @@ ...@@ -184,8 +184,8 @@
onOk() { onOk() {
return that.Logout({}).then(() => { return that.Logout({}).then(() => {
// update-begin author:scott date:20211223 for:【JTC-198】退出登录体验不好 // update-begin author:scott date:20211223 for:【JTC-198】退出登录体验不好
//that.$router.push({ path: '/user/login' }); that.$router.push({ path: '/user/login' });
window.location.reload() // window.location.reload()
// update-end author:scott date:20211223 for:【JTC-198】退出登录体验不好 // update-end author:scott date:20211223 for:【JTC-198】退出登录体验不好
}).catch(err => { }).catch(err => {
that.$message.error({ that.$message.error({
......
...@@ -26,8 +26,6 @@ import 'vue-photo-preview/dist/skin.css' ...@@ -26,8 +26,6 @@ import 'vue-photo-preview/dist/skin.css'
import SSO from '@/cas/sso.js' import SSO from '@/cas/sso.js'
import { import {
ACCESS_TOKEN, ACCESS_TOKEN,
PLATFORM_CODE,
PLATFORM_TYPE,
DEFAULT_COLOR, DEFAULT_COLOR,
DEFAULT_THEME, DEFAULT_THEME,
DEFAULT_LAYOUT_MODE, DEFAULT_LAYOUT_MODE,
...@@ -83,8 +81,6 @@ function main() { ...@@ -83,8 +81,6 @@ function main() {
store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak)) store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor)) store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
store.commit('SET_TYPE', Vue.ls.get(PLATFORM_CODE))
store.commit('SET_CODE', Vue.ls.get(PLATFORM_TYPE))
store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage)) store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage))
}, },
render: h => h(App) render: h => h(App)
......
import Vue from 'vue' import Vue from 'vue'
import { login, logout, phoneLogin, thirdLogin } from "@/api/login" import { login, logout, phoneLogin, thirdLogin } from "@/api/login"
import { ACCESS_TOKEN,PLATFORM_CODE,PLATFORM_TYPE, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA,TENANT_ID,CACHE_INCLUDED_ROUTES } from "@/store/mutation-types" import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA,TENANT_ID,CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
import { welcome } from "@/utils/util" import { welcome } from "@/utils/util"
import { queryPermissionsByUser } from '@/api/api' import { queryPermissionsByUser } from '@/api/api'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
...@@ -93,8 +93,6 @@ const user = { ...@@ -93,8 +93,6 @@ const user = {
Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000) Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000) Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(UI_CACHE_DB_DICT_DATA, result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000) Vue.ls.set(UI_CACHE_DB_DICT_DATA, result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(PLATFORM_CODE, result.userInfo.platformCode, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(PLATFORM_TYPE, result.userInfo.platformType, 7 * 24 * 60 * 60 * 1000)
commit('SET_TOKEN', result.token) commit('SET_TOKEN', result.token)
commit('SET_INFO', userInfo) commit('SET_INFO', userInfo)
commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname, welcome: welcome() }) commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname, welcome: welcome() })
...@@ -186,25 +184,30 @@ const user = { ...@@ -186,25 +184,30 @@ const user = {
Logout({ commit, state }) { Logout({ commit, state }) {
return new Promise((resolve) => { return new Promise((resolve) => {
let logoutToken = state.token; let logoutToken = state.token;
commit('SET_TOKEN', '')
commit('SET_PERMISSIONLIST', [])
Vue.ls.remove(ACCESS_TOKEN)
Vue.ls.remove(PLATFORM_CODE)
Vue.ls.remove(PLATFORM_TYPE)
Vue.ls.remove(USER_INFO)
Vue.ls.remove(USER_NAME)
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
Vue.ls.remove(CACHE_INCLUDED_ROUTES)
Vue.ls.remove(TENANT_ID)
//console.log('logoutToken: '+ logoutToken)
logout(logoutToken).then(() => { logout(logoutToken).then(() => {
// commit('SET_TOKEN', '')
// commit('SET_PERMISSIONLIST', [])
// Vue.ls.remove(ACCESS_TOKEN)
// Vue.ls.remove(USER_INFO)
// Vue.ls.remove(USER_NAME)
// Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
// Vue.ls.remove(CACHE_INCLUDED_ROUTES)
// Vue.ls.remove(TENANT_ID)
if (process.env.VUE_APP_SSO == 'true') { if (process.env.VUE_APP_SSO == 'true') {
let sevice = 'http://' + window.location.host + '/' let sevice = 'http://' + window.location.host + '/'
let serviceUrl = encodeURIComponent(sevice) let serviceUrl = encodeURIComponent(sevice)
window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl
} }
resolve() resolve()
}).catch(() => { }).finally(() => {
commit('SET_TOKEN', '')
commit('SET_PERMISSIONLIST', [])
Vue.ls.remove(ACCESS_TOKEN)
Vue.ls.remove(USER_INFO)
Vue.ls.remove(USER_NAME)
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
Vue.ls.remove(CACHE_INCLUDED_ROUTES)
Vue.ls.remove(TENANT_ID)
resolve() resolve()
}) })
}) })
......
export const ACCESS_TOKEN = 'Access-Token' export const ACCESS_TOKEN = 'Access-Token'
export const PLATFORM_CODE = 'platformCode'
export const PLATFORM_TYPE = 'platformType'
export const SIDEBAR_TYPE = 'SIDEBAR_TYPE' export const SIDEBAR_TYPE = 'SIDEBAR_TYPE'
export const DEFAULT_THEME = 'DEFAULT_THEME' export const DEFAULT_THEME = 'DEFAULT_THEME'
export const DEFAULT_LAYOUT_MODE = 'DEFAULT_LAYOUT_MODE' export const DEFAULT_LAYOUT_MODE = 'DEFAULT_LAYOUT_MODE'
......
...@@ -3,7 +3,7 @@ import axios from 'axios' ...@@ -3,7 +3,7 @@ import axios from 'axios'
import store from '@/store' import store from '@/store'
import { VueAxios } from './axios' import { VueAxios } from './axios'
import router from '@/router/index' import router from '@/router/index'
import { ACCESS_TOKEN, PLATFORM_CODE, PLATFORM_TYPE, TENANT_ID } from "@/store/mutation-types" import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
/** /**
* 【指定 axios的 baseURL】 * 【指定 axios的 baseURL】
...@@ -105,17 +105,9 @@ const err = (error) => { ...@@ -105,17 +105,9 @@ const err = (error) => {
// request interceptor // request interceptor
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
const token = Vue.ls.get(ACCESS_TOKEN) const token = Vue.ls.get(ACCESS_TOKEN)
const platformCode = Vue.ls.get(PLATFORM_CODE)
const platformType = Vue.ls.get(PLATFORM_TYPE)
if (token) { if (token) {
config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改 config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
} }
if (platformCode) {
config.headers[ 'platform_code' ] = platformCode // 让每个请求携带platformCode
}
if (platformType) {
config.headers[ 'platform_type' ] = platformType // 让每个请求携带platformType
}
// update-begin--author:sunjianlei---date:20200723---for 如果当前在low-app环境,并且携带了appId,就向Header里传递appId // update-begin--author:sunjianlei---date:20200723---for 如果当前在low-app环境,并且携带了appId,就向Header里传递appId
const $route = router.currentRoute const $route = router.currentRoute
...@@ -131,9 +123,6 @@ service.interceptors.request.use(config => { ...@@ -131,9 +123,6 @@ service.interceptors.request.use(config => {
//update-begin-author:taoyan date:2020707 for:多租户 //update-begin-author:taoyan date:2020707 for:多租户
let tenantid = Vue.ls.get(TENANT_ID) let tenantid = Vue.ls.get(TENANT_ID)
if (!tenantid) {
tenantid = 0;
}
config.headers[ 'tenant-id' ] = tenantid config.headers[ 'tenant-id' ] = tenantid
//update-end-author:taoyan date:2020707 for:多租户 //update-end-author:taoyan date:2020707 for:多租户
if(config.method=='get'){ if(config.method=='get'){
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="广告名称">
<a-input placeholder="请输入广告名称" v-model="queryParam.advName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('t_property_adv')">导出</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" v-if="selectedRowKeys.length > 0" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<property-adv-modal ref="modalForm" @ok="modalFormOk"></property-adv-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PropertyAdvModal from './modules/PropertyAdvModal'
import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil'
export default {
name: 'PropertyAdvList',
mixins:[JeecgListMixin, mixinDevice],
components: {
PropertyAdvModal
},
data () {
return {
description: 't_property_adv管理页面',
// 表头
columns: [
// {
// title: '#',
// dataIndex: '',
// key:'rowIndex',
// width:60,
// align:"center",
// customRender:function (t,r,index) {
// return parseInt(index)+1;
// }
// },
{
title:'广告编号',
align:"center",
dataIndex: 'id'
},
{
title:'广告名称',
align:"center",
dataIndex: 'advName'
},
{
title:'广告位置',
align:"center",
dataIndex: 'advPosition',
customRender: function(text) {
return filterDictTextByCache('advPosition', text);
}
},
{
title:'有效时间',
align:"center",
dataIndex: 'advStartDate',
customRender:function (text, rocord) {
return text ? (text + '至' + rocord.advEndDate) : ''
}
},
{
title:'广告链接',
align:"center",
dataIndex: 'advUrl'
},
{
title:'发布日期',
align:"center",
dataIndex: 'createTime',
// customRender:function (text) {
// return !text?"":(text.length>10?text.substr(0,10):text)
// }
},
{
title:'状态',
align:"center",
dataIndex: 'status',
customRender: function(text) {
return filterDictTextByCache('advStatus', text);
}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/property-company/notice/companyNotice/list",
delete: "/property-company/property/propertyAdv/delete",
deleteBatch: "/property-company/property/propertyAdv/deleteBatch",
exportXlsUrl: "/property-company/property/propertyAdv/exportXls"
},
dictOptions:{}
}
},
methods: {
initDictConfig(){
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="广告名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advName">
<a-input v-model="model.advName" placeholder="请输入广告名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="广告位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advPosition">
<j-dict-select-tag v-model="model.advPosition" dictCode="advPosition" placeholder="请选择广告位置" disabled />
<!-- <a-select v-model="model.advPosition" style="width: 100%" placeholder="请选择广告位置" disabled>
<a-select-option value="home">业主小程序banner图</a-select-option>
</a-select> -->
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="广告有效时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advDate">
<a-range-picker valueFormat="YYYY-MM-DD" :placeholder="['广告有效开始时间', '请选择广告有效结束时间']" v-model="model.advDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="广告有效结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advEndDate">
<j-date placeholder="请选择广告有效结束时间" v-model="model.advEndDate" style="width: 100%" />
</a-form-model-item>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="广告链接" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advUrl">
<a-input v-model="model.advUrl" placeholder="请输入广告链接"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<!-- <a-form-model-item label="banner图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advImageUrl">
<j-upload v-model="model.advImageUrl"></j-upload>
</a-form-model-item> -->
<a-form-model-item label="banner图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="advImageUrl">
<j-image-upload bizPath="scott/pic" accept="image/png, image/jpeg" v-model="model.advImageUrl"></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="是否定时发布" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isScheduledRelease">
<!-- <j-dict-select-tag type="radio" v-model="model.isScheduledRelease" dictCode="release" placeholder="请选择是否定时发布" /> -->
<a-radio-group name="radioGroup" v-model="model.isScheduledRelease">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="model.isScheduledRelease === 1">
<a-form-model-item label="发布日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="releaseTime">
<j-date placeholder="请选择发布日期" v-model="model.releaseTime" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'PropertyAdvForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
advName: '',
advPosition: 'home',
advDate: [],
advUrl: '',
advImageUrl: '',
isScheduledRelease: 0,
releaseTime: ''
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
advName: [{ required: true, message: '请输入广告名称', trigger: 'blur' }],
advImageUrl: [{ required: true, message: '请上传banner图', trigger: 'change' }],
releaseTime: [{ required: true, message: '请选择发布日期', trigger: 'change' }]
},
url: {
add: "/property-company/property/propertyAdv/add",
edit: "/property-company/property/propertyAdv/edit",
queryById: "/property-company/property/propertyAdv/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record, {advDate: [record.advStartDate, record.advEndDate]});
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
this.model['advStartDate'] = this.model['advDate'][0]
this.model['advEndDate'] = this.model['advDate'][1]
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>
\ No newline at end of file
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<property-adv-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></property-adv-form>
</j-modal>
</template>
<script>
import PropertyAdvForm from './PropertyAdvForm'
export default {
name: 'PropertyAdvModal',
components: {
PropertyAdvForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
\ No newline at end of file
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="物业公司名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyName">
<a-input v-model="model.propertyName" placeholder="请输入物业公司名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="统一信用代码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="creditCode">
<a-input v-model="model.creditCode" placeholder="请输入统一信用代码" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="法人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="legalName">
<a-input v-model="model.legalName" placeholder="请输入法人姓名" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="注册资本" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="registCapital">
<a-input-number v-model="model.registCapital" placeholder="请输入注册资本" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contactName">
<a-input v-model="model.contactName" placeholder="请输入联系人" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contactPhone">
<a-input v-model="model.contactPhone" placeholder="请输入联系电话" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="注册地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="registAdress">
<j-area-linkage type="cascader" v-model="model.registAdress" placeholder="请输入省市区" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="详细地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adressInfo">
<a-input v-model="model.adressInfo" placeholder="请输入详细地址" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="集团logo" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logoUrl">
<a-input v-model="model.logoUrl" placeholder="请输入集团logo" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="集团介绍" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="groupInfo">
<a-textarea v-model="model.groupInfo" rows="4" placeholder="请输入集团介绍" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="授权开始日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="empowerBeginDate">
<j-date placeholder="请选择授权开始日期" v-model="model.empowerBeginDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="授权结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="empowerEndDate">
<j-date placeholder="请选择授权结束日期" v-model="model.empowerEndDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="收费标准id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargingStandardId">
<j-dict-select-tag type="list" v-model="model.chargingStandardId" dictCode="" placeholder="请选择收费标准id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="合同附件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contractUrl">
<j-upload v-model="model.contractUrl" ></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="删除状态(0-正常,1-已删除)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
<a-input-number v-model="model.delFlag" placeholder="请输入删除状态(0-正常,1-已删除)" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="试用小区数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ontrialCommunityNum">
<a-input-number v-model="model.ontrialCommunityNum" placeholder="请输入试用小区数量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="试用开始日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ontrialBeginDate">
<j-date placeholder="请选择试用开始日期" v-model="model.ontrialBeginDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="试用结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ontrialEndDate">
<j-date placeholder="请选择试用结束日期" v-model="model.ontrialEndDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="管理员登录账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminLoginName">
<a-input v-model="model.adminLoginName" placeholder="请输入管理员登录账号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="管理员登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminPassword">
<a-input-password v-model="model.adminPassword" placeholder="请输入管理员登录密码" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'PropertySettledForm',
components: {
},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
adminLoginName: [
{ required: false},
{ validator: (rule, value, callback) => validateDuplicateValue('property_settled', 'admin_login_name', value, this.model.id, callback)},
],
},
url: {
add: "/property/propertySettled/add",
edit: "/property/propertySettled/edit",
queryById: "/property/propertySettled/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>
\ No newline at end of file
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<property-settled-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></property-settled-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import PropertySettledForm from './PropertySettledForm'
export default {
name: 'PropertySettledModal',
components: {
PropertySettledForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<property-settled-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></property-settled-form>
</j-modal>
</template>
<script>
import PropertySettledForm from './PropertySettledForm'
export default {
name: 'PropertySettledModal',
components: {
PropertySettledForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
<a-button type="primary" icon="download" @click="handleExportXls('t_property_settled')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('t_property_settled')">导出</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="pagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap" class="j-table-force-nowrap"
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
<span :style="{'color': record.employeeStatus === '1' ? 'green' : 'red'}">{{record.employeeStatus === '1' ? '在职' : '离职'}}</span> <span :style="{'color': record.employeeStatus === '1' ? 'green' : 'red'}">{{record.employeeStatus === '1' ? '在职' : '离职'}}</span>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <!-- <a @click="handleEdit(record)">编辑</a> -->
<a @click="onChangeHouse(record)">调用</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-dropdown> <a-dropdown>
...@@ -84,6 +85,62 @@ ...@@ -84,6 +85,62 @@
<!-- table区域-end --> <!-- table区域-end -->
<notice-modal ref="modalForm" @ok="modalFormOk"></notice-modal> <notice-modal ref="modalForm" @ok="modalFormOk"></notice-modal>
<a-modal
title="资产调用"
width="60%"
:visible="capitalVisible"
:closable="false"
:maskClosable="false"
>
<template slot="footer">
<a-button @click="capitalVisible = false">关闭</a-button>
<a-button type="primary" @click="onCapitalSubmit" :disabled="!capitalForm.newCommunity.key">确认</a-button>
</template>
<a-form-model
ref="capitalForm"
:model="capitalForm"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-row>
<a-col :span="24">
<a-form-model-item label="设备名称" prop="assetName">
<a-input
disabled
v-model="capitalForm.assetName"
placeholder="请输入"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="设备编码" prop="assetCode">
<a-input
disabled
v-model="capitalForm.assetCode"
placeholder="请输入"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="所属小区" prop="platformName">
<a-input
disabled
v-model="capitalForm.platformName"
placeholder="请输入"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="调用至" prop="newCommunity">
<a-select style="width: 100%" v-model="capitalForm.newCommunity" placeholder="请选择所属小区" labelInValue>
<a-select-option v-for="item in communityList" :disabled="item.communityCode === capitalForm.platformCode" :key="item.communityCode" :value="item.communityCode">{{item.communityName}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</a-card> </a-card>
</template> </template>
...@@ -91,6 +148,7 @@ ...@@ -91,6 +148,7 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import NoticeModal from './modules/NoticeModal' import NoticeModal from './modules/NoticeModal'
import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil' import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil'
import {getCapitalCommunityListApi, callAssetSubmitApi} from '@/api/api'
const columns = [ const columns = [
{ {
...@@ -146,8 +204,8 @@ ...@@ -146,8 +204,8 @@
}, },
{ {
title: '所属小区', title: '所属小区',
dataIndex: 'communityCode', dataIndex: 'platformName',
key: 'communityCode', key: 'platformName',
align: 'center' align: 'center'
}, },
{ {
...@@ -167,20 +225,56 @@ ...@@ -167,20 +225,56 @@
return { return {
// 表头 // 表头
columns: columns, columns: columns,
pagination: {
total: 0,
current: 1,
pageSize: 10,
showSizeChanger: true
},
url: { url: {
list: "/property-company/asset/propertyAsset/list", // list: "/property-company/asset/propertyAsset/list",
delete: '/property-company/asset/propertyAsset/list', list: "/property-community/asset/propertyAsset/companyList",
deleteBatch: '/property-company/asset/propertyAsset/list' delete: '/property-community/asset/propertyAsset/delete',
} deleteBatch: '/property-community/asset/propertyAsset/delete'
},
capitalVisible: false,
labelCol: { span: 6 },
wrapperCol: { span: 14 },
capitalForm: {
id: '',
assetName: '',
assetCode: '',
platformCode: '',
platformName: '',
newCommunity: {}
},
communityList: []
} }
}, },
methods: {} created () {
// this.getCommunityList()
},
methods: {
onChangeHouse(row) {
let {id, assetName, assetCode, platformCode, platformName} = row
this.capitalForm.id = id
this.capitalForm.assetName = assetName
this.capitalForm.assetCode = assetCode
this.capitalForm.platformCode = platformCode
this.capitalForm.platformName = platformName
this.capitalForm.newCommunity = {}
this.capitalVisible = true
this.onCapitalCommunityList()
},
async onCapitalSubmit() {
let res = await callAssetSubmitApi({
id: this.capitalForm.id,
platformCode: this.capitalForm.newCommunity.key,
platformName: this.capitalForm.newCommunity.label
})
this.$message.success(res.message);
this.capitalVisible = false
this.searchQuery()
},
async onCapitalCommunityList() {
let {result} = await getCapitalCommunityListApi()
this.communityList = result
}
}
} }
</script> </script>
<style scoped> <style scoped>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
useLife: '', useLife: '',
purchasePrice: '', purchasePrice: '',
assetPosition: '', assetPosition: '',
communityCode: '1242342342', communityCode: 'P00039',
headName: '', headName: '',
headPhone: '' headPhone: ''
}, },
......
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="小区管理员姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminName"> <a-form-model-item label="小区管理员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminName">
<a-input v-model="model.adminName" placeholder="请输入小区管理员姓名"></a-input> <a-input v-model="model.adminName" placeholder="请输入小区管理员"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
...@@ -87,6 +87,13 @@ ...@@ -87,6 +87,13 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="24">
<a-form-model-item label="管理员头像" :labelCol="{ xs:{ span: 24 }, sm:{ span: 3 } }" :wrapperCol="wrapperCol" prop="adminAvatar">
<j-image-upload :isMultiple="false" text="点击上传" bizPath="scott/pic" v-model="model.adminAvatar"></j-image-upload>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model> </a-form-model>
</j-form-container> </j-form-container>
</a-spin> </a-spin>
...@@ -97,6 +104,7 @@ ...@@ -97,6 +104,7 @@
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import { validateDuplicateValue } from '@/utils/util'
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api'
import { isMobile } from '@/utils/validate'
export default { export default {
name: 'PropertyChargruleForm', name: 'PropertyChargruleForm',
...@@ -111,13 +119,31 @@ ...@@ -111,13 +119,31 @@
} }
}, },
data () { data () {
const validateToNextPhone = (rule, value, callback)=> {
if (value && isMobile(value)) {
callback();
} else {
callback('请输入正确的联系人电话!');
}
}
return { return {
model:{ model:{
chargingName: '', communityName: '',
chargingMoney: '', useTo: '',
chargingCycle: '', communityArea: '',
empowerNum: '', addressInfo: '',
empowerDays: '' completedDate: '',
coverArea: '',
buildingNum: '',
houseNum: '',
parkingSpace: '',
chargingStation: '',
communityImage: '',
communityIntro: '',
adminName: '',
adminPhone: '',
adminPassword: '',
adminAvatar: '',
}, },
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
...@@ -132,12 +158,17 @@ ...@@ -132,12 +158,17 @@
communityName: [{ required: true, message: '请输入小区名称', trigger: 'blur' }], communityName: [{ required: true, message: '请输入小区名称', trigger: 'blur' }],
useTo: [{ required: true, message: '请选择用途', trigger: 'change' }], useTo: [{ required: true, message: '请选择用途', trigger: 'change' }],
communityArea: [{ required: true, message: '请输入所属地区', trigger: 'blur' }], communityArea: [{ required: true, message: '请输入所属地区', trigger: 'blur' }],
chargingMoney: [{ required: true, message: '请输入收费金额', trigger: 'blur' }],
coverArea: [{ required: true, message: '请输入占地面积', trigger: 'blur' }], coverArea: [{ required: true, message: '请输入占地面积', trigger: 'blur' }],
buildingNum: [{ required: true, message: '请输入楼栋数量', trigger: 'blur' }], buildingNum: [{ required: true, message: '请输入楼栋数量', trigger: 'blur' }],
houseNum: [{ required: true, message: '请输入房屋数量', trigger: 'blur' }], houseNum: [{ required: true, message: '请输入房屋数量', trigger: 'blur' }],
parkingSpace: [{ required: true, message: '请输入停车位', trigger: 'blur' }], communityImage: [{ required: true, message: '请至少上传一张小区图片', trigger: 'change' }],
chargingStation: [{ required: true, message: '请输入充电桩', trigger: 'blur' }] adminName: [{ required: true, message: '请输入小区管理员', trigger: 'blur' }],
adminPhone: [
{ required: true, message: '请输入管理员联系电话', trigger: 'blur' },
{ validator: validateToNextPhone }
],
adminPassword: [{ required: true, message: '请输入管理员登录密码', trigger: 'blur' }],
adminAvatar: [{ required: true, message: '请上传管理员头像', trigger: 'blur' }]
}, },
url: { url: {
add: "/property-company/community/companyCommunity/add", add: "/property-company/community/companyCommunity/add",
...@@ -151,27 +182,6 @@ ...@@ -151,27 +182,6 @@
] ]
} }
}, },
watch: {
'model.chargingCycle': {
handler(newV, oldV) {
switch(newV) {
case '1':
this.model.empowerDays = '30'
break
case '2':
this.model.empowerDays = '90'
break
case '3':
this.model.empowerDays = '365'
break
default:
if(oldV) {
this.model.empowerDays = ''
}
}
}
}
},
computed: { computed: {
formDisabled(){ formDisabled(){
return this.disabled return this.disabled
...@@ -180,22 +190,8 @@ ...@@ -180,22 +190,8 @@
created () { created () {
//备份model原始值 //备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
// this.initDictData()
}, },
methods: { methods: {
initDictData() {
//优先从缓存中读取字典配置
if(getDictItemsFromCache('chargingCycle')){
this.dictOptions = getDictItemsFromCache('chargingCycle');
return
}
// //根据字典Code, 初始化字典数组
ajaxGetDictItems('chargingCycle', null).then((res) => {
if (res.success) {
this.dictOptions = res.result;
}
})
},
ruleNumberInput(event) { ruleNumberInput(event) {
let rateValue = event.target.value.replace(/[^\d]/g,"");//清除"数字"和"."和"-"以外的字符 let rateValue = event.target.value.replace(/[^\d]/g,"");//清除"数字"和"."和"-"以外的字符
this.model['empowerDays'] = rateValue this.model['empowerDays'] = rateValue
...@@ -221,7 +217,7 @@ ...@@ -221,7 +217,7 @@
method = 'post'; method = 'post';
}else{ }else{
httpurl+=this.url.edit; httpurl+=this.url.edit;
method = 'put'; method = 'put';
} }
httpAction(httpurl,this.model,method).then((res)=>{ httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){ if(res.success){
......
<template>
<a-drawer
title="数据规则/按钮权限配置"
width="365"
:closable="false"
@close="onClose"
:visible="visible"
>
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="数据规则" key="1">
<a-checkbox-group v-model="dataruleChecked" v-if="dataruleList.length>0">
<a-row>
<a-col :span="24" v-for="(item,index) in dataruleList" :key=" 'dr'+index ">
<a-checkbox :value="item.id">{{ item.ruleName }}</a-checkbox>
</a-col>
<a-col :span="24">
<div style="width: 100%;margin-top: 15px">
<a-button @click="saveDataruleForRole" type="primary" size="small" icon="save">点击保存</a-button>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div v-else><h3>无配置信息!</h3></div>
</a-tab-pane>
<!--<a-tab-pane tab="按钮权限" key="2">敬请期待!!!</a-tab-pane>-->
</a-tabs>
</a-drawer>
</template>
<script>
import ARow from 'ant-design-vue/es/grid/Row'
import ACol from 'ant-design-vue/es/grid/Col'
import { getAction,postAction } from '@/api/manage'
export default {
name: 'RoleDataruleModal',
components: { ACol, ARow },
data(){
return {
functionId:'',
roleId:'',
visible:false,
tabList: [{
key: '1',
tab: '数据规则',
}, {
key: '2',
tab: '按钮权限',
}],
activeTabKey: '1',
url:{
datarule:"/sys/role/datarule",
},
dataruleList:[],
dataruleChecked:[]
}
},
methods:{
loadData(){
getAction(`${this.url.datarule}/${this.functionId}/${this.roleId}`).then(res=>{
console.log(res)
if(res.success){
this.dataruleList = res.result.datarule
let drChecked = res.result.drChecked
if(drChecked){
this.dataruleChecked = drChecked.split(",")
}
}
})
},
saveDataruleForRole(){
if(!this.dataruleChecked || this.dataruleChecked.length==0){
this.$message.warning("请注意,现未勾选任何数据权限!")
}
let params = {
permissionId:this.functionId,
roleId:this.roleId,
dataRuleIds:this.dataruleChecked.join(",")
}
console.log("保存数据权限",params)
postAction(this.url.datarule,params).then(res=>{
if(res.success){
this.$message.success(res.message)
}else{
this.$message.error(res.message)
}
})
},
show(functionId,roleId){
this.onReset()
this.functionId = functionId
this.roleId = roleId
this.visible=true
this.loadData()
},
onClose(){
this.visible=false
this.onReset()
},
onTabChange (key) {
this.activeTabKey = key
},
onReset(){
this.functionId=''
this.roleId=''
this.dataruleList=[]
this.dataruleChecked=[]
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<a-drawer
:title="title"
:maskClosable="true"
width=650
placement="right"
:closable="true"
@close="close"
:visible="visible"
style="overflow: auto;padding-bottom: 53px;">
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
@check="onCheck"
:checkedKeys="checkedKeys"
:treeData="treeData"
@expand="onExpand"
@select="onTreeNodeSelect"
:selectedKeys="selectedKeys"
:expandedKeys="expandedKeysss"
:checkStrictly="checkStrictly">
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
{{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
</span>
</a-tree>
</a-form-item>
</a-form>
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
<a-popconfirm title="确定放弃编辑?" @confirm="close" okText="确定" cancelText="取消">
<a-button style="margin-right: .8rem">取消</a-button>
</a-popconfirm>
<a-button @click="handleSubmit(false)" type="primary" :loading="loading" ghost style="margin-right: 0.8rem">仅保存</a-button>
<a-button @click="handleSubmit(true)" type="primary" :loading="loading">保存并关闭</a-button>
</div>
<role-datarule-modal ref="datarule"></role-datarule-modal>
</a-drawer>
</template>
<script>
import {queryTreeListByTypeForRole,queryRolePermission,saveRolePermission} from '@/api/api'
import RoleDataruleModal from './RoleDataruleModal.vue'
export default {
name: "RoleModal",
components:{
RoleDataruleModal
},
data(){
return {
roleId:"",
treeData: [],
defaultCheckedKeys:[],
checkedKeys:[],
expandedKeysss:[],
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: true,
title:"物业权限配置",
visible: false,
loading: false,
selectedKeys:[]
}
},
methods: {
onTreeNodeSelect(id){
if(id && id.length>0){
this.selectedKeys = id
}
this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
},
onCheck (o) {
if(this.checkStrictly){
this.checkedKeys = o.checked;
}else{
this.checkedKeys = o
}
},
show(roleId){
this.roleId=roleId
this.visible = true;
},
close () {
this.reset()
this.$emit('close');
this.visible = false;
},
onExpand(expandedKeys){
this.expandedKeysss = expandedKeys;
this.autoExpandParent = false
},
reset () {
this.expandedKeysss = []
this.checkedKeys = []
this.defaultCheckedKeys = []
this.loading = false
},
expandAll () {
this.expandedKeysss = this.allTreeKeys
},
closeAll () {
this.expandedKeysss = []
},
checkALL () {
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
handleCancel () {
this.close()
},
handleSubmit(exit) {
let that = this;
let params = {
roleId:that.roleId,
permissionIds:that.checkedKeys.join(","),
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
console.log("请求参数:",params);
saveRolePermission(params).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loading = false;
if (exit) {
that.close()
}
}else {
that.$message.error(res.message);
that.loading = false;
if (exit) {
that.close()
}
}
this.loadData();
})
},
loadData(){
queryTreeListByTypeForRole().then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
queryRolePermission({roleId:this.roleId}).then((res)=>{
this.checkedKeys = [...res.result];
this.defaultCheckedKeys = [...res.result];
this.expandedKeysss = this.allTreeKeys;
console.log(this.defaultCheckedKeys)
})
})
}
},
watch: {
visible () {
if (this.visible) {
this.loadData();
}
}
}
}
</script>
<style lang="less" scoped>
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
...@@ -21,8 +21,11 @@ ...@@ -21,8 +21,11 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="所属小区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="communityCode"> <a-form-model-item label="所属小区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="community">
<j-popup v-model="model.communityCode" placeholder="请选择所属小区" icon="home" code="demo" field="name" orgFields="name" destFields="name" :multi="false"/> <!-- <j-popup v-model="model.communityCode" placeholder="请选择所属小区" icon="home" code="demo" field="name" orgFields="name" destFields="name" :multi="false"/> -->
<a-select style="width: 100%" v-model="model.community" placeholder="请选择所属小区" labelInValue>
<a-select-option v-for="item in communityList" :key="item.communityCode" :value="item.communityCode">{{item.communityName}}</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
...@@ -49,10 +52,9 @@ ...@@ -49,10 +52,9 @@
</template> </template>
<script> <script>
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import {ajaxGetDictItems,getDictItemsFromCache, getCapitalCommunityListApi} from '@/api/api'
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import { isMobile } from '@/utils/validate'
export default { export default {
name: 'PropertyChargruleForm', name: 'PropertyChargruleForm',
...@@ -67,14 +69,20 @@ ...@@ -67,14 +69,20 @@
} }
}, },
data () { data () {
const validateToNextPhone = (rule, value, callback)=> {
if (value && isMobile(value)) {
callback();
} else {
callback('请输入正确的联系电话!');
}
}
return { return {
dictOptions: [], dictOptions: [],
model:{ model:{
employeeName: '', employeeName: '',
employeePhone: '', employeePhone: '',
employeeDuties: '', employeeDuties: '',
communityCode: '', community: {},
communityId: '',
employeeStatus: '1', employeeStatus: '1',
employeeAvatar: '' employeeAvatar: ''
}, },
...@@ -89,14 +97,20 @@ ...@@ -89,14 +97,20 @@
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
employeeName: [{ required: true, message: '请输入员工姓名', trigger: 'blur' }], employeeName: [{ required: true, message: '请输入员工姓名', trigger: 'blur' }],
employeePhone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }], employeePhone: [
employeeDuties: [{ required: true, message: '请选择员工职务', trigger: 'change' }] { required: true, message: '请输入联系电话', trigger: 'blur' },
{ validator: validateToNextPhone }
],
employeeDuties: [{ required: true, message: '请选择员工职务', trigger: 'change' }],
community: [{ required: true, message: '请选择所属小区', trigger: 'change' }],
employeeAvatar: [{ required: true, message: '请上传员工头像', trigger: 'change' }]
}, },
url: { url: {
add: "/property-company/employee/companyEmployee/add", add: "/property-company/employee/companyEmployee/add",
edit: "/property-company/property/propertyChargrule/edit", edit: "/property-company/employee/companyEmployee/edit",
queryById: "/property-company/property/propertyChargrule/queryById" queryById: "/property-company/employee/companyEmployee/queryById"
} },
communityList: []
} }
}, },
computed: { computed: {
...@@ -108,6 +122,7 @@ ...@@ -108,6 +122,7 @@
//备份model原始值 //备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.initDictData() this.initDictData()
this.getCommunityList()
}, },
methods: { methods: {
initDictData() { initDictData() {
...@@ -123,6 +138,10 @@ ...@@ -123,6 +138,10 @@
} }
}) })
}, },
async getCommunityList() {
let {result} = await getCapitalCommunityListApi()
this.communityList = result
},
ruleNumberInput(event) { ruleNumberInput(event) {
let rateValue = event.target.value.replace(/[^\d]/g,"");//清除"数字"和"."和"-"以外的字符 let rateValue = event.target.value.replace(/[^\d]/g,"");//清除"数字"和"."和"-"以外的字符
this.model['empowerDays'] = rateValue this.model['empowerDays'] = rateValue
...@@ -131,7 +150,6 @@ ...@@ -131,7 +150,6 @@
this.edit(this.modelDefault); this.edit(this.modelDefault);
}, },
edit (record) { edit (record) {
console.log(record)
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
this.visible = true; this.visible = true;
}, },
...@@ -150,7 +168,7 @@ ...@@ -150,7 +168,7 @@
httpurl+=this.url.edit; httpurl+=this.url.edit;
method = 'put'; method = 'put';
} }
httpAction(httpurl,this.model,method).then((res)=>{ httpAction(httpurl,{...this.model, communityCode: this.model.community.key, communityName: this.model.community.label},method).then((res)=>{
if(res.success){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.$emit('ok'); that.$emit('ok');
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<span :style="{'color': record.employeeStatus === '1' ? 'green' : 'red'}">{{record.employeeStatus === '1' ? '在职' : '离职'}}</span> <span :style="{'color': record.employeeStatus === '1' ? 'green' : 'red'}">{{record.employeeStatus === '1' ? '在职' : '离职'}}</span>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit({...record, community: {key: record.communityCode, label: record.communityName}})">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-dropdown> <a-dropdown>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a> <a href="javascript:;" @click="handleDetail({...record, community: {key: record.communityCode, label: record.communityName}})">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
}, },
{ {
title: '所属小区', title: '所属小区',
dataIndex: 'communityCode', dataIndex: 'communityName',
key: 'communityCode', key: 'communityName',
align: 'center' align: 'center'
}, },
{ {
......
...@@ -28,15 +28,33 @@ ...@@ -28,15 +28,33 @@
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="计算公式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="designFormulas"> <a-form-model-item label="计算公式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="designFormulas">
<a-select style="width: 100%" v-model="model.designFormulas" placeholder="请选择计算公式"> <a-select style="width: 100%" v-model="model.designFormulas" placeholder="请选择计算公式">
<a-select-option value="1">固定金额</a-select-option> <a-select-option :value="1">固定金额</a-select-option>
<a-select-option value="2">建筑面积 × 单价</a-select-option> <a-select-option :value="2">建筑面积 × 单价</a-select-option>
<a-select-option value="3">(本期度数 - 上期度数) × 单价</a-select-option> <a-select-option :value="3">(本期度数 - 上期度数) × 单价</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item :label="model.designFormulas === '1' ? '固定金额' : '单价'" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount"> <a-form-model-item :label="model.designFormulas === 1 ? '固定金额' : '单价'" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input type="number" v-model="model.amount" :placeholder="`请输入${model.designFormulas === '1' ? '固定金额' : '单价'}`"></a-input> <a-input type="number" v-model="model.amount" :placeholder="`请输入${model.designFormulas === 1 ? '固定金额' : '单价'}`"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="适用小区类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-radio-group v-model="model.type">
<a-radio value="ALL">全部小区</a-radio>
<a-radio value="POINT">指定小区</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="model.type === 'POINT'">
<a-form-model-item label="适用小区" :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }" :wrapperCol="wrapperCol" prop="communityList">
<a-select style="width: 100%" mode="multiple" v-model="model.communityList" placeholder="请选择所属小区">
<a-select-option v-for="item in communityList" :key="item.communityCode" :value="item.communityCode">{{item.communityName}}</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -61,7 +79,7 @@ ...@@ -61,7 +79,7 @@
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import { validateDuplicateValue } from '@/utils/util'
import {ajaxGetDictItems,getDictItemsFromCache, getChargeListApi} from '@/api/api' import {ajaxGetDictItems,getDictItemsFromCache, getChargeListApi, getCapitalCommunityListApi} from '@/api/api'
export default { export default {
name: 'PropertyChargruleForm', name: 'PropertyChargruleForm',
...@@ -82,10 +100,12 @@ ...@@ -82,10 +100,12 @@
model:{ model:{
chargeTypeId: '', chargeTypeId: '',
chargeItem: '', chargeItem: '',
chargeCycle: '1', chargeCycle: '',
designFormulas: '1', designFormulas: 1,
amount: '', amount: '',
remark: '' remark: '',
communityList: [],
type: 'ALL' // ("ALL","所有")("POINT","指定")
}, },
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
...@@ -99,13 +119,17 @@ ...@@ -99,13 +119,17 @@
validatorRules: { validatorRules: {
chargeTypeId: [{ required: true, message: '请选择收费类型', trigger: 'change' }], chargeTypeId: [{ required: true, message: '请选择收费类型', trigger: 'change' }],
chargeItem: [{ required: true, message: '请输入收费项目', trigger: 'blur' }], chargeItem: [{ required: true, message: '请输入收费项目', trigger: 'blur' }],
amount: [{ required: true, message: '请输入金额', trigger: 'blur' }] amount: [{ required: true, message: '请输入金额', trigger: 'blur' }],
chargeCycle: [{ required: true, message: '请选择付费周期', trigger: 'change' }],
designFormulas: [{ required: true, message: '请选择计算公式', trigger: 'change' }],
communityList: [{ required: true, message: '请选择小区', trigger: 'change' }]
}, },
url: { url: {
add: "/property-company/system/companyChargerule/add", add: "/property-company/system/companyChargerule/add",
edit: "/property-company/system/companyChargerule/edit", edit: "/property-company/system/companyChargerule/edit",
queryById: "/property-company/system/companyChargerule/queryById" queryById: "/property-company/system/companyChargerule/queryById"
} },
communityList: []
} }
}, },
computed: { computed: {
...@@ -118,6 +142,7 @@ ...@@ -118,6 +142,7 @@
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.initDictData() this.initDictData()
this.getChargeList() this.getChargeList()
this.onCapitalCommunityList()
}, },
methods: { methods: {
initDictData() { initDictData() {
...@@ -133,6 +158,10 @@ ...@@ -133,6 +158,10 @@
} }
}) })
}, },
async onCapitalCommunityList() {
let {result} = await getCapitalCommunityListApi()
this.communityList = result
},
async getChargeList() { async getChargeList() {
let {result} = await getChargeListApi() let {result} = await getChargeListApi()
this.chargeList = result this.chargeList = result
...@@ -160,7 +189,8 @@ ...@@ -160,7 +189,8 @@
httpurl+=this.url.edit; httpurl+=this.url.edit;
method = 'put'; method = 'put';
} }
httpAction(httpurl,this.model,method).then((res)=>{ let chargeTypeInfo = this.chargeList.find(item=>item.id === this.model.chargeTypeId)
httpAction(httpurl,{...this.model,chargeTypeCode: chargeTypeInfo.typeCode,chargeTypeName: chargeTypeInfo.typeName,communityCodes: this.model.type === 'POINT' ? this.model.communityList.join(',') : 'ALL'},method).then((res)=>{
if(res.success){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.$emit('ok'); that.$emit('ok');
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="pagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap" class="j-table-force-nowrap"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<span :style="{'color': record.chargeItem === '1' ? 'green' : 'red'}">{{record.chargeItem === '1' ? '在职' : '离职'}}</span> <span :style="{'color': record.chargeItem === '1' ? 'green' : 'red'}">{{record.chargeItem === '1' ? '在职' : '离职'}}</span>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="onHandle(record, 'edit')">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-dropdown> <a-dropdown>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a> <a href="javascript:;" @click="onHandle(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
...@@ -101,18 +101,15 @@ ...@@ -101,18 +101,15 @@
}, },
{ {
title: '所属小区', title: '所属小区',
dataIndex: 'xiaoqu', dataIndex: 'communityNames',
key: 'xiaoqu', key: 'communityNames',
align: 'center' align: 'center'
}, },
{ {
title: '收费类型', title: '收费类型',
dataIndex: 'chargeTypeId', dataIndex: 'chargeTypeName',
key: 'chargeTypeId', key: 'chargeTypeName',
align: 'center', align: 'center'
// customRender: function(text) {
// return filterDictTextByCache('duties', text);
// }
}, },
{ {
title: '收费项目', title: '收费项目',
...@@ -124,7 +121,10 @@ ...@@ -124,7 +121,10 @@
title: '付费周期 (月)', title: '付费周期 (月)',
dataIndex: 'chargeCycle', dataIndex: 'chargeCycle',
key: 'chargeCycle', key: 'chargeCycle',
align: 'center' align: 'center',
customRender: function(text) {
return filterDictTextByCache('chargingCycle', text);
}
}, },
{ {
title: '计费方式', title: '计费方式',
...@@ -155,12 +155,6 @@ ...@@ -155,12 +155,6 @@
return { return {
// 表头 // 表头
columns: columns, columns: columns,
pagination: {
total: 0,
current: 1,
pageSize: 10,
showSizeChanger: true
},
url: { url: {
list: "/property-company/system/companyChargerule/list", list: "/property-company/system/companyChargerule/list",
delete: '/property-company/system/companyChargerule/delete', delete: '/property-company/system/companyChargerule/delete',
...@@ -168,7 +162,22 @@ ...@@ -168,7 +162,22 @@
} }
} }
}, },
methods: {} methods: {
onHandle(record, flag) {
if(record.communityCodes === 'ALL') {
record['type'] = 'ALL'
record['communityList'] = []
} else {
record['type'] = 'POINT'
record['communityList'] = record.communityCodes.split(',')
}
if(flag === 'edit') {
this.handleEdit(record)
} else {
this.handleDetail(record)
}
}
}
} }
</script> </script>
<style scoped> <style scoped>
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
model: { model: {
templateName: '', templateName: '',
// templateType: {key: "1660940550578327554",label: "水费"}, // templateType: {key: "1660940550578327554",label: "水费"},
templateType: '' templateType: 'SFLX00004'
}, },
validatorRules: { validatorRules: {
templateName: [{ required: true, message: '请输入收费名称', trigger: 'blur' }], templateName: [{ required: true, message: '请输入收费名称', trigger: 'blur' }],
......
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
data() { data() {
return { return {
editor: null, editor: null,
curHtml: '<p style="text-align: center;"><strong>收据名称</strong></p><p style="text-align: center;">单号:@单号</p><p style="text-align: left;">业主:@业主 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;缴费时间:@缴费时间</p><hr/><p>今收到 <u style="text-decoration: underline;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </u> 金额(大写)<u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u></p><p>收款单位(盖章) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;¥:<u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u></p><hr/><p>开票人:@审核人 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;收款人:@审核人 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;客户:@业主</p>', curHtml: '<p style="text-align: center;"><strong>收据名称</strong></p><p style="text-align: center;">单号:@单号</p><p style="text-align: left;">业主:@业主 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;缴费时间:@缴费时间</p><hr/><p>今收到 <u style="padding-bottom:10px;border-bottom:1px solid red;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </u> 金额(大写)<u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u></p><p>收款单位(盖章) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;¥:<u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u></p><hr/><p>开票人:@审核人 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;收款人:@审核人 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;客户:@业主</p>',
toolbarConfig: { toolbarConfig: {
excludeKeys: [ excludeKeys: [
"italic", "italic",
......
<template> <template>
<div> <div class="hone-content-box">
<index-chart v-if="indexStyle==1"></index-chart> <a-row :gutter="24">
<index-bdc v-if="indexStyle==2"></index-bdc> <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<index-task v-if="indexStyle==3"></index-task> <div class="statistics">
<div style="width: 100%;text-align: right;margin-top: 20px"> <img class="icon" src="~@/assets/guaz.png" alt="">
请选择首页样式: <div>
<a-radio-group v-model="indexStyle"> <p style="color:#666;margin-bottom:5px;">小区总数</p>
<a-radio :value="1">统计图表</a-radio> <p style="margin-bottom:0;color:#333;font-size:28px;line-height:1;">{{pageForm.communityNum}}</p>
<a-radio :value="2">统计图表2</a-radio> </div>
<a-radio :value="3">任务表格</a-radio> </div>
</a-radio-group> </a-col>
</div> <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<div class="statistics">
<img class="icon" src="~@/assets/guaz.png" alt="">
<div>
<p style="color:#666;margin-bottom:5px;">房屋总数量</p>
<p style="margin-bottom:0;color:#333;font-size:28px;line-height:1;">{{pageForm.roomNum}}</p>
</div>
</div>
</a-col>
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<div class="statistics">
<img class="icon" src="~@/assets/guaz.png" alt="">
<div>
<p style="color:#666;margin-bottom:5px;">住户总数量</p>
<p style="margin-bottom:0;color:#333;font-size:28px;line-height:1;">{{pageForm.ownerNum}}</p>
</div>
</div>
</a-col>
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<div class="statistics">
<img class="icon" src="~@/assets/guaz.png" alt="">
<div>
<p style="color:#666;margin-bottom:5px;">年度累计已缴物业费</p>
<p style="margin-bottom:0;color:#333;font-size:28px;line-height:1;">{{pageForm.propertyYearFee}}</p>
</div>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '24px' }">
<pie title="缴费率" :dataSource="pieData" />
</a-col>
<a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '24px' }">
<div>
<h5>园区公告</h5>
<ul>
<li>清明节放假通知,213231312313</li>
<li>5月1日停电通知,因1233233 园区公告 清明节放假通知,21323131231323233</li>
</ul>
</div>
</a-col>
</a-row>
<a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
<div class="salesCard">
<div class="extra-type">
<a>物业</a>
<a>水费</a>
<a>电费</a>
<a>燃气费</a>
</div>
<div>
<bar :dataSource="barData"/>
</div>
</div>
</a-card>
<a-row :gutter="24">
<a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '24px' }">
<pie title="报修统计" :dataSource="pieData" />
</a-col>
<a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '24px' }">
<pie title="投诉统计" :dataSource="pieData" />
</a-col>
</a-row>
</div> </div>
</template> </template>
<script> <script>
import IndexChart from './IndexChart' import Bar from '@/components/chart/Bar'
import IndexTask from "./IndexTask" import Pie from '@/components/chart/Pie'
import IndexBdc from './IndexBdc' import { homeDataStatistics } from "@/api/api"
const barData = []
for (let i = 0; i < 12; i += 1) {
barData.push({
x: `${i + 1}月`,
y: Math.floor(Math.random() * 1000) + 200
})
}
export default { export default {
name: "Analysis", name: "Analysis",
components: { components: {
IndexChart, Bar,
IndexTask, Pie
IndexBdc
}, },
data() { data() {
return { return {
indexStyle:1 pageForm: {},
loading: true,
barData,
pieData: [
{ item: '物业费', count: 40 },
{ item: '水费', count: 21 },
{ item: '电费', count: 17 },
{ item: '燃气费', count: 13 },
{ item: '停车费', count: 9 }
]
} }
}, },
created() { created() {
this.onDetail()
}, },
methods: { methods: {
async onDetail() {
let {result} = await homeDataStatistics()
this.pageForm = {...result}
this.loading = !this.loading
// //当前物业公司小区数量
// private Integer communityNum;
// //当前物业公司房屋数量
// private Integer roomNum;
// //当前物业公司业主数量
// private Integer ownerNum;
// //当前物业公司累积缴纳物业费
// private BigDecimal propertyYearFee;
// //物业费占比
// private BigDecimal propertyFeeRate;
// //水费占比
// private BigDecimal waterRate;
// //电费占比
// private BigDecimal electricRate;
// //暖气费占比
// private BigDecimal gasFeeRate;
// //按月统计费用
// private List<MonthlyStatisticsVo> monthlyStatistics;
// //报修总数
// private Integer repairTotal;
// //报修待派单数量
// private Integer waitDispatch;
// //报修维修中数量
// private Integer inRepair;
// //报修完成数量
// private Integer repairOver;
// //全部投诉数量
// private Integer complaintTotal;
// //投诉待处理数量
// private Integer waitHandle;
// //投诉已处理数量
// private Integer complaintOver;
}
}
}
</script>
<style lang="less" scoped>
.hone-content-box {
background-color: #fff;
padding: 16px;
.statistics {
// flex: none;
width: 100%;
height: 90px;
box-sizing: border-box;
border: 1px solid #e0dfdf;
display: flex;
align-items: center;
padding-left: 20px;
.icon {
width: 64px;
height: 64px;
margin-right: 12px;
}
}
.pay-box {
display: flex;
.left-box {
flex: none;
width: 50%;
} }
} }
</script> }
\ No newline at end of file </style>
\ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> <a-button style="margin-left: 8px">批量操作 <a-icon type="down" /></a-button>
</a-dropdown> </a-dropdown>
</div> </div>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="pagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap" class="j-table-force-nowrap"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<span :style="{'color': record.employeeStatus === '1' ? 'green' : 'red'}">{{record.employeeStatus === '1' ? '在职' : '离职'}}</span> <span :style="{'color': record.employeeStatus === '1' ? 'green' : 'red'}">{{record.employeeStatus === '1' ? '在职' : '离职'}}</span>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="onHandle(record, 'edit')">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-dropdown> <a-dropdown>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a> <a href="javascript:;" @click="onHandle(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
...@@ -90,42 +90,55 @@ ...@@ -90,42 +90,55 @@
<script> <script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import NoticeModal from './modules/NoticeModal' import NoticeModal from './modules/NoticeModal'
import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil' import {queryNoticeCommunityApi} from '@/api/api'
import {URGENT_DEGREE, SCHEDULED_RELEASE, NOTICE_STATUS, filterDictTextByStatic} from '@/assets/static.js'
const columns = [ const columns = [
{ {
title: '公告标题', title: '公告标题',
dataIndex: 'employeeName', dataIndex: 'noticeTitle',
key: 'employeeName', key: 'noticeTitle',
align: 'center' align: 'center'
}, },
{ {
title: '紧急程度', title: '紧急程度',
dataIndex: 'employeePhone', dataIndex: 'urgentDegree',
key: 'employeePhone', key: 'urgentDegree',
align: 'center' align: 'center',
customRender: function(text) {
return filterDictTextByStatic(URGENT_DEGREE, text);
}
}, },
{ {
title: '是否定时发布', title: '是否定时发布',
dataIndex: 'communityCode', dataIndex: 'isScheduledRelease',
key: 'communityCode', key: 'isScheduledRelease',
align: 'center'
},
{
title: '发布人',
dataIndex: 'employeeDuties',
key: 'employeeDuties',
align: 'center', align: 'center',
customRender: function(text) { customRender: function(text) {
return filterDictTextByCache('duties', text); return filterDictTextByStatic(SCHEDULED_RELEASE, text);
} }
}, },
{
title: '发布人',
dataIndex: 'createBy',
key: 'createBy',
align: 'center'
},
{ {
title: '发布时间', title: '发布时间',
dataIndex: 'createTime', dataIndex: 'releaseTime',
key: 'createTime', key: 'releaseTime',
align: 'center' align: 'center'
}, },
{
title: '公告状态',
dataIndex: 'noticeStatus',
key: 'noticeStatus',
align: 'center',
customRender: function(text) {
return filterDictTextByStatic(NOTICE_STATUS, text);
}
},
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
...@@ -143,20 +156,31 @@ ...@@ -143,20 +156,31 @@
return { return {
// 表头 // 表头
columns: columns, columns: columns,
pagination: {
total: 0,
current: 1,
pageSize: 10,
showSizeChanger: true
},
url: { url: {
list: "/property-company/employee/companyEmployee/list", list: "/property-company/notice/companyNotice/list",
delete: '/property-company/employee/companyEmployee/delete', delete: '/property-company/notice/companyNotice/delete',
deleteBatch: '/property-company/employee/companyEmployee/deleteBatch' deleteBatch: '/property-company/notice/companyNotice/deleteBatch'
} }
} }
}, },
methods: {} methods: {
async onHandle(record, flag) {
if(record.noticeRange === 'POINT') {
let {result} = await queryNoticeCommunityApi({id: record.id})
record['communityCodes'] = result.map(item=> {
return {
key: item.communityCode,
label: item.communityName
}
})
}
if(flag === 'edit') {
this.handleEdit(record)
} else {
this.handleDetail(record)
}
}
}
} }
</script> </script>
<style scoped> <style scoped>
......
...@@ -5,18 +5,28 @@ ...@@ -5,18 +5,28 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticeTitle"> <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticeTitle">
<a-input v-model="model.noticeTitle" placeholder="请输入标题" style="max-width:350px"></a-input> <a-input v-model="model.noticeTitle" placeholder="请输入标题" style="width:70%"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="公告范围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticeRange"> <a-form-model-item label="紧急程度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="urgentDegree">
<a-input v-model="model.noticeRange" placeholder="请输入公告范围"></a-input> <a-select style="width: 50%" v-model="model.urgentDegree" placeholder="请选择紧急程度">
<a-select-option v-for="item in urgentDegreeList" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="紧急程度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticeEmergent"> <a-form-model-item label="公告范围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticeRange">
<a-select style="width: 100%" v-model="model.noticeEmergent" placeholder="请选择紧急程度"> <a-radio-group v-model="model.noticeRange" style="width: 50%">
<a-select-option v-for="item in dictOptions" :key="item.value" :value="item.value">{{item.label}}</a-select-option> <a-radio value="ALL">全部小区</a-radio>
<a-radio value="POINT">指定小区</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="model.noticeRange === 'POINT'">
<a-form-model-item label="指定小区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="communityCodes">
<a-select style="width: 100%" mode="multiple" v-model="model.communityCodes" placeholder="请选择指定小区" labelInValue>
<a-select-option v-for="item in communityList" :key="item.communityCode" :value="item.communityCode">{{item.communityName}}</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -26,16 +36,15 @@ ...@@ -26,16 +36,15 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="是否定时发布" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isRegular"> <a-form-model-item label="是否定时发布" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isScheduledRelease">
<a-radio-group name="radioGroup" v-model="model.isRegular" style="max-width:350px"> <a-radio-group name="radioGroup" v-model="model.isScheduledRelease" style="max-width:350px">
<a-radio value="1"></a-radio> <a-radio v-for="item in scheduledReleaseList" :key="item.value" :value="item.value">{{item.label}}</a-radio>
<a-radio value="0"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24" v-if="model.isScheduledRelease === 1">
<a-form-model-item label="发布时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="regularDate"> <a-form-model-item label="发布时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="releaseTime">
<j-date placeholder="请选择发布日期" v-model="model.regularDate" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%;max-width:350px" /> <j-date placeholder="请选择发布日期" v-model="model.releaseTime" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%;max-width:350px" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -47,8 +56,9 @@ ...@@ -47,8 +56,9 @@
<script> <script>
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import { formatDate } from '@/utils/util'
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import {getCapitalCommunityListApi} from '@/api/api'
import {URGENT_DEGREE, SCHEDULED_RELEASE} from '@/assets/static.js'
export default { export default {
name: 'PropertyChargruleForm', name: 'PropertyChargruleForm',
...@@ -64,15 +74,17 @@ ...@@ -64,15 +74,17 @@
}, },
data () { data () {
return { return {
dictOptions: [], urgentDegreeList: URGENT_DEGREE,
scheduledReleaseList: SCHEDULED_RELEASE,
communityList: [],
model:{ model:{
employeeName: '', noticeTitle: '',
employeePhone: '', urgentDegree: 'usual',
employeeDuties: '', noticeRange: 'ALL',
communityCode: '', communityCodes: [],
communityId: '', noticeContent: '',
isRegular: '1', isScheduledRelease: 0,
employeeAvatar: '' releaseTime: ''
}, },
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
...@@ -84,14 +96,15 @@ ...@@ -84,14 +96,15 @@
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
employeeName: [{ required: true, message: '请输入员工姓名', trigger: 'blur' }], noticeTitle: [{ required: true, message: '请输入标题', trigger: 'blur' }],
employeePhone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }], noticeContent: [{ required: true, message: '请输入内容', trigger: 'blur' }],
employeeDuties: [{ required: true, message: '请选择员工职务', trigger: 'change' }] releaseTime: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
communityCodes: [{ required: true, message: '请选择小区', trigger: 'change' }]
}, },
url: { url: {
add: "/property-company/employee/companyEmployee/add", add: "/property-company/notice/companyNotice/add",
edit: "/property-company/property/propertyChargrule/edit", edit: "/property-company/notice/companyNotice/edit",
queryById: "/property-company/property/propertyChargrule/queryById" queryById: "/property-company/notice/companyNotice/queryById"
} }
} }
}, },
...@@ -103,25 +116,12 @@ ...@@ -103,25 +116,12 @@
created () { created () {
//备份model原始值 //备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.initDictData() this.onCapitalCommunityList()
}, },
methods: { methods: {
initDictData() { async onCapitalCommunityList() {
//优先从缓存中读取字典配置 let {result} = await getCapitalCommunityListApi()
if(getDictItemsFromCache('duties')){ this.communityList = result
this.dictOptions = getDictItemsFromCache('duties');
return
}
// //根据字典Code, 初始化字典数组
ajaxGetDictItems('duties', null).then((res) => {
if (res.success) {
this.dictOptions = res.result;
}
})
},
ruleNumberInput(event) {
let rateValue = event.target.value.replace(/[^\d]/g,"");//清除"数字"和"."和"-"以外的字符
this.model['empowerDays'] = rateValue
}, },
add () { add () {
this.edit(this.modelDefault); this.edit(this.modelDefault);
...@@ -132,6 +132,16 @@ ...@@ -132,6 +132,16 @@
this.visible = true; this.visible = true;
}, },
submitForm () { submitForm () {
if(this.model.noticeRange === 'ALL') {
this.model['noticeCommunityRefList'] = []
} else {
this.model['noticeCommunityRefList'] = this.model.communityCodes.map(item=> {
return {
communityCode: item.key,
communityName: item.label
}
})
}
const that = this; const that = this;
// 触发表单验证 // 触发表单验证
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
...@@ -142,9 +152,12 @@ ...@@ -142,9 +152,12 @@
if(!this.model.id){ if(!this.model.id){
httpurl+=this.url.add; httpurl+=this.url.add;
method = 'post'; method = 'post';
if(this.model.isScheduledRelease === 0) {
this.model.releaseTime = formatDate(new Date().getTime(), 'yyyy-MM-dd hh:mm:ss')
}
}else{ }else{
httpurl+=this.url.edit; httpurl+=this.url.edit;
method = 'put'; method = 'put';
} }
httpAction(httpurl,this.model,method).then((res)=>{ httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){ if(res.success){
......
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
this.bizTenantList(loginResult); this.bizTenantList(loginResult);
if(this.visible===false){ if(this.visible===false){
this.$store.dispatch('saveTenant', this.tenant_id); this.$store.dispatch('saveTenant', loginResult.userInfo.platformCode);
this.$emit('success') this.$emit('success')
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论