Browse Source

Merge branch 'master' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-220309

origin/bugfix_relocation
jiangyy 4 years ago
parent
commit
5a6aeb0522
  1. 4
      .env.shibei_production
  2. 1
      .gitignore
  3. 19713
      package-lock.json
  4. 1
      package.json
  5. 16
      public/index.html
  6. 66
      src/assets/scss/modules/visual/communityManage.scss
  7. 1
      src/js/dai/request.js
  8. 90
      src/js/dai/request2.js
  9. 78
      src/router/index.js
  10. 33
      src/views/main-shuju/main.vue
  11. 38
      src/views/main.vue
  12. 311
      src/views/modules/base/community/buildTable.vue
  13. 41
      src/views/modules/base/community/community.vue
  14. 2
      src/views/modules/base/community/communityForm.vue
  15. 248
      src/views/modules/base/community/communityTable.vue
  16. 3
      src/views/modules/base/community/roomForm.vue
  17. 278
      src/views/modules/base/community/roomTable.vue
  18. 140
      src/views/modules/base/resi.vue
  19. 8
      src/views/modules/communityParty/elegant/index.vue
  20. 2
      src/views/modules/communityService/ninePlaces/inspect/inspect.vue
  21. 18
      src/views/modules/communityService/ninePlaces/inspect/inspectForm.vue
  22. 65
      src/views/modules/communityService/sqzzz/index.vue
  23. 2
      src/views/modules/importRecord/index.vue
  24. 31
      src/views/modules/visual/communityParty/community.vue
  25. 2
      src/views/modules/visual/communityParty/elegant.vue
  26. 3
      src/views/modules/visual/communityParty/elegantInfo.vue
  27. 2
      src/views/modules/visual/communityParty/party.vue
  28. 4
      src/views/modules/visual/measure/volunteer.vue
  29. 286
      src/views/modules/workSys/elegantCate.vue
  30. 169
      src/views/modules/workSys/elegantEdit.vue

4
.env.shibei_production

@ -0,0 +1,4 @@
NODE_ENV=production
VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api
VUE_APP_NODE_ENV=shibei_prod
VUE_APP_PUBLIC_PATH=epmet-oper

1
.gitignore

@ -15,4 +15,5 @@ hs_err_pid*
node_modules node_modules
dist dist
epmet-oper epmet-oper
package-lock.json
.idea/ .idea/

19713
package-lock.json

File diff suppressed because it is too large

1
package.json

@ -9,6 +9,7 @@
"build:sit": "vue-cli-service build --mode production.sit", "build:sit": "vue-cli-service build --mode production.sit",
"build:uat": "vue-cli-service build --mode production.uat", "build:uat": "vue-cli-service build --mode production.uat",
"build:prod": "vue-cli-service build --mode production", "build:prod": "vue-cli-service build --mode production",
"build:shibei_prod": "vue-cli-service build --mode shibei_production",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"et": "node_modules/.bin/et", "et": "node_modules/.bin/et",
"et:init": "node_modules/.bin/et -i", "et:init": "node_modules/.bin/et -i",

16
public/index.html

@ -14,7 +14,7 @@
window.SITE_CONFIG = {} window.SITE_CONFIG = {}
window.SITE_CONFIG['version'] = 'v2.0.0' window.SITE_CONFIG['version'] = 'v2.0.0'
window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>' window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>'
window.SITE_CONFIG['apiURL'] = '' // api请求地址 window.SITE_CONFIG['apiURL'] = '<%= process.env.VUE_APP_API_SERVER %>' // api请求地址
window.SITE_CONFIG['storeState'] = {} // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态) window.SITE_CONFIG['storeState'] = {} // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window.SITE_CONFIG['contentTabDefault'] = { window.SITE_CONFIG['contentTabDefault'] = {
// 内容标签页默认属性对象 // 内容标签页默认属性对象
@ -36,7 +36,7 @@
<!-- npm run build:sit --> <!-- npm run build:sit -->
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %> <!-- <% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api' window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api'
// window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api' // window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api'
@ -44,7 +44,7 @@
// window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api' // window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
<!-- 集成测试环境 dev --> &lt;!&ndash; 集成测试环境 dev &ndash;&gt;
<% if (process.env.VUE_APP_NODE_ENV==='prod:sit' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='prod:sit' ) { %>
<script> <script>
// window.SITE_CONFIG['apiURL'] = // window.SITE_CONFIG['apiURL'] =
@ -54,19 +54,23 @@
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api' window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api'
</script> </script>
<% } %> <% } %>
<!-- 验收测试环境 aliyun --> &lt;!&ndash; 验收测试环境 aliyun &ndash;&gt;
<% if (process.env.VUE_APP_NODE_ENV==='prod:uat' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='prod:uat' ) { %>
<script> <script>
// window.SITE_CONFIG['apiURL'] = 'http://120.27.18.76/api' // window.SITE_CONFIG['apiURL'] = 'http://120.27.18.76/api'
window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
<!-- 生产环境 --> &lt;!&ndash; 生产环境 &ndash;&gt;
<% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>-->
<script>
//window.SITE_CONFIG['apiURL'] = '<%= process.env.VUE_APP_API_SERVER %>'
</script>
</head> </head>
<body> <body>

66
src/assets/scss/modules/visual/communityManage.scss

@ -0,0 +1,66 @@
.div_search {
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_table {
margin-top: 20px;
position: relative;
}
.div_del {
position: absolute;
left: 10px;
bottom: 0;
}
.div_search {
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_btn {
display: flex;
margin-top: 20px;
.btn_upload {
margin-left: 10px;
display: flex;
}
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}

1
src/js/dai/request.js

@ -2,7 +2,6 @@
| 请求接口封装 | | 请求接口封装 |
---------------------------------------------------------------*/ ---------------------------------------------------------------*/
import axios from "axios"; import axios from "axios";
import curry from "dai-js/tools/curry"; import curry from "dai-js/tools/curry";
import { Message } from "element-ui"; import { Message } from "element-ui";

90
src/js/dai/request2.js

@ -0,0 +1,90 @@
/*---------------------------------------------------------------
| 请求接口封装 |
---------------------------------------------------------------*/
import axios from "axios";
import curry from "dai-js/tools/curry";
import { Message } from "element-ui";
const request = curry(
(method, url, data = {}, headers = {}, progress = () => {}) => {
return new Promise((reslove) => {
let returnIniData = {
httpCode: "",
data: {},
msg: "",
code: "",
};
// 添加服务器端URL
function processUrl(url) {
if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) {
return url;
}
return process.env.VUE_APP_API_SERVER + url;
}
url = processUrl(url);
const succFn = (res) => {
// log(`[request成功] ${url}`, data, res);
let retData = {
...returnIniData,
...res.data,
httpCode: res.statusCode,
};
// if(typeof Vue.$afterRequestHook == 'function'){
// retData = Vue.$afterRequestHook(retData);
// }
if (res.data.code > 8000 && res.data.code < 10000) {
Message.error(res.data.msg);
}
reslove(retData);
};
const failFn = (err) => {
// log(`[request失败] ${url}`, data, err);
reslove(
Object.assign({}, returnIniData, {
httpCode: "9999", //访问出现意外
msg: "网络错误",
})
);
};
if (method.toUpperCase() == "POST") {
axios
.post(url, data, {
headers,
responseType: "json",
// progress,
// credentials: false,
})
.then(succFn)
.catch(failFn);
} else {
axios
.get(url, {
params: data,
headers,
responseType: "json",
// credentials: true,
})
.then(succFn)
.catch(failFn);
}
});
}
);
export const requestGet = request("get");
export const requestPost = request("post");
export default {
install(Vue) {
Vue.prototype.$requestGet = requestGet;
Vue.prototype.$requestPost = requestPost;
},
};

78
src/router/index.js

@ -282,44 +282,44 @@ router.beforeEach((to, from, next) => {
url: "visual/heart/index", url: "visual/heart/index",
children: [], children: [],
}, },
// { {
// icon: "icon-setting", icon: "icon-setting",
// id: "44rq22222q2222", id: "44rq22222q2222",
// name: "AI安防", name: "AI安防",
// // url: "visual/basicinfo/basicInfoMain", // url: "visual/basicinfo/basicInfoMain",
// children: [ children: [
// { {
// url: "/visual/ai/index", url: "/visual/ai/index",
// name: "AI安防", name: "AI安防",
// id: "5feawfwa111111efwa57", id: "5feawfwa111111efwa57",
// }, },
// { {
// url: "/visual/ai/renliu", url: "/visual/ai/renliu",
// name: "人流数据", name: "人流数据",
// id: "5fwaefwae222112fawef58", id: "5fwaefwae222112fawef58",
// }, },
// { {
// url: "/visual/ai/cheliu", url: "/visual/ai/cheliu",
// name: "车流数据", name: "车流数据",
// id: "erawerwecsxefwaw", id: "erawerwecsxefwaw",
// }, },
// { {
// url: "/visual/ai/shebei", url: "/visual/ai/shebei",
// name: "设备数据", name: "设备数据",
// id: "zfzffewaf", id: "zfzffewaf",
// }, },
// { {
// url: "/visual/ai/gongdan", url: "/visual/ai/gongdan",
// name: "工单数据", name: "工单数据",
// id: "fewafwafewaefddd", id: "fewafwafewaefddd",
// }, },
// { {
// url: "/visual/ai/yujing", url: "/visual/ai/yujing",
// name: "预警事件", name: "预警事件",
// id: "545345fdsfs", id: "545345fdsfs",
// }, },
// ], ],
// }, },
]; ];
fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]); fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
@ -375,7 +375,7 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
for (var i = 0; i < menuList.length; i++) { for (var i = 0; i < menuList.length; i++) {
if (menuList[i].children && menuList[i].children.length >= 1) { if (menuList[i].children && menuList[i].children.length >= 1) {
temp = temp.concat(menuList[i].children); temp = temp.concat(menuList[i].children);
continue; // continue;
} }
// 组装路由 // 组装路由
var route = { var route = {

33
src/views/main-shuju/main.vue

@ -1,22 +1,18 @@
<template> <template>
<div <div v-loading.fullscreen.lock="loading"
v-loading.fullscreen.lock="loading" :element-loading-text="$t('loading')"
:element-loading-text="$t('loading')" :class="[
:class="[
'g-bd', 'g-bd',
{ 'z-sidebar--fold': $store.state.sidebarFold }, { 'z-sidebar--fold': $store.state.sidebarFold },
{ {
'z-sidebar--noside': true, 'z-sidebar--noside': true,
}, },
]" ]">
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar ref="ref_navbar" /> <main-navbar ref="ref_navbar" />
<div class="g-cnt"> <div class="g-cnt">
<main-content <main-content v-if="!$store.state.contentIsNeedRefresh"
v-if="!$store.state.contentIsNeedRefresh" @changeCustomerName="changeCustomerName" />
@changeCustomerName="changeCustomerName"
/>
</div> </div>
</template> </template>
</div> </div>
@ -31,10 +27,10 @@ import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
export default { export default {
provide() { provide () {
return { return {
// //
refresh() { refresh () {
this.$store.state.contentIsNeedRefresh = true; this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false; this.$store.state.contentIsNeedRefresh = false;
@ -42,7 +38,7 @@ export default {
}, },
}; };
}, },
data() { data () {
return { return {
loading: true, loading: true,
userType: localStorage.getItem("userType"), userType: localStorage.getItem("userType"),
@ -56,7 +52,7 @@ export default {
watch: { watch: {
$route: "routeHandle", $route: "routeHandle",
}, },
async created() { async created () {
this.windowResizeHandle(); this.windowResizeHandle();
this.routeHandle(this.$route); this.routeHandle(this.$route);
Promise.all([this.getWorkUserInfo()]).then(() => { Promise.all([this.getWorkUserInfo()]).then(() => {
@ -65,11 +61,11 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
changeCustomerName(customerName) { changeCustomerName (customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName); this.$refs["ref_navbar"].changeCustomerName(customerName);
}, },
// //
windowResizeHandle() { windowResizeHandle () {
this.$store.state.sidebarFold = this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false; document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener( window.addEventListener(
@ -81,7 +77,7 @@ export default {
); );
}, },
// , // ,
routeHandle(route) { routeHandle (route) {
if (!route.meta.isTab) { if (!route.meta.isTab) {
return false; return false;
} }
@ -105,7 +101,7 @@ export default {
}, },
// //
async getWorkUserInfo() { async getWorkUserInfo () {
const url = "/epmetuser/customerstaff/staffbasicinfo"; const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {}; let params = {};
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
@ -115,6 +111,7 @@ export default {
localStorage.setItem("roleList", data.roleList); localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId); localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id); localStorage.setItem("staffId", data.id);
localStorage.setItem("agencyId", data.agencyId);
if (!localStorage.getItem("customerName")) { if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }

38
src/views/main.vue

@ -1,8 +1,7 @@
<template> <template>
<div <div v-loading.fullscreen.lock="loading"
v-loading.fullscreen.lock="loading" :element-loading-text="$t('loading')"
:element-loading-text="$t('loading')" :class="[
:class="[
'aui-wrapper', 'aui-wrapper',
{ 'aui-sidebar--fold': $store.state.sidebarFold }, { 'aui-sidebar--fold': $store.state.sidebarFold },
{ {
@ -10,16 +9,14 @@
$store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe, $store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe,
}, },
{ 'z-iframe': $store.state.inIframe }, { 'z-iframe': $store.state.inIframe },
]" ]">
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" /> <main-navbar ref="ref_navbar"
v-if="!$store.state.inIframe" />
<main-sidebar v-if="!$store.state.inIframe" /> <main-sidebar v-if="!$store.state.inIframe" />
<div class="aui-content__wrapper"> <div class="aui-content__wrapper">
<main-content <main-content v-if="!$store.state.contentIsNeedRefresh"
v-if="!$store.state.contentIsNeedRefresh" @changeCustomerName="changeCustomerName" />
@changeCustomerName="changeCustomerName"
/>
</div> </div>
<main-theme-tools v-if="!$store.state.inIframe" /> <main-theme-tools v-if="!$store.state.inIframe" />
</template> </template>
@ -37,10 +34,10 @@ import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
export default { export default {
provide() { provide () {
return { return {
// //
refresh() { refresh () {
this.$store.state.contentIsNeedRefresh = true; this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false; this.$store.state.contentIsNeedRefresh = false;
@ -48,7 +45,7 @@ export default {
}, },
}; };
}, },
data() { data () {
return { return {
loading: true, loading: true,
userType: localStorage.getItem("userType"), userType: localStorage.getItem("userType"),
@ -64,7 +61,7 @@ export default {
watch: { watch: {
$route: "routeHandle", $route: "routeHandle",
}, },
async created() { async created () {
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"]; this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
console.log(this.$store.state.sidebarMenuList); console.log(this.$store.state.sidebarMenuList);
@ -76,11 +73,11 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
changeCustomerName(customerName) { changeCustomerName (customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName); this.$refs["ref_navbar"].changeCustomerName(customerName);
}, },
// //
windowResizeHandle() { windowResizeHandle () {
this.$store.state.sidebarFold = this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false; document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener( window.addEventListener(
@ -92,7 +89,7 @@ export default {
); );
}, },
// , // ,
routeHandle(route) { routeHandle (route) {
if (!route.meta.isTab) { if (!route.meta.isTab) {
return false; return false;
} }
@ -115,7 +112,7 @@ export default {
this.$store.state.contentTabsActiveName = tab.name; this.$store.state.contentTabsActiveName = tab.name;
this.syncLevelOneMenuActive(tab.menuId); this.syncLevelOneMenuActive(tab.menuId);
}, },
async syncLevelOneMenuActive(menuId) { async syncLevelOneMenuActive (menuId) {
await nextTick(); await nextTick();
console.log( console.log(
"*******************************", "*******************************",
@ -138,7 +135,7 @@ export default {
idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : []; idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : [];
}, },
// //
async getWorkUserInfo() { async getWorkUserInfo () {
const url = "/epmetuser/customerstaff/staffbasicinfo"; const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {}; let params = {};
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
@ -148,6 +145,7 @@ export default {
localStorage.setItem("roleList", data.roleList); localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId); localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id); localStorage.setItem("staffId", data.id);
localStorage.setItem("agencyId", data.agencyId);
if (!localStorage.getItem("customerName")) { if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }

311
src/views/modules/base/community/buildTable.vue

@ -41,56 +41,65 @@
size="small" size="small"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd">新增楼宇</el-button> @click="handleAdd">新增楼宇</el-button>
<div class="btn_upload"
<el-button style=";margin-left:10px" v-if="showImportBtn">
type="blue" <el-button style=";margin-left:10px"
size="small" type="blue"
icon="el-icon-download"
@click="handleExportModule('building')">下载楼宇模板</el-button>
<el-upload style=""
ref="upload_building"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'building')})">
<el-button style="margin-left:10px"
size="small" size="small"
icon="el-icon-upload2" icon="el-icon-download"
:loading="importBuildingLoading" @click="handleExportModule('building')">下载楼宇模板</el-button>
type="red">导入楼宇数据</el-button>
</el-upload> <el-upload style=""
<el-button style=";margin-left:10px" ref="upload_building"
type="blue" :multiple='false'
size="small" :show-file-list='false'
icon="el-icon-download" :before-upload="((file)=>{beforeUpload(file, 'building')})"
@click="handleExportModule('room')">下载房屋模板</el-button> action=""
accept=".xls,.xlsx"
<el-upload style="" :http-request="(()=>{uploadFile( 'building')})">
ref="upload_room" <el-button style="margin-left:10px"
:multiple='false' size="small"
:show-file-list='false' icon="el-icon-upload2"
:before-upload="((file)=>{beforeUpload(file, 'room')})" :loading="importBuildingLoading"
action="" type="red">导入楼宇数据</el-button>
accept=".xls,.xlsx" </el-upload>
:http-request="(()=>{uploadFile( 'room')})"> <el-button style=";margin-left:10px"
<el-button style="margin-left:10px" type="blue"
size="small" size="small"
icon="el-icon-upload2" icon="el-icon-download"
:loading="importRoomLoading" @click="handleExportModule('room')">下载房屋模板</el-button>
type="red">导入房屋数据</el-button>
</el-upload> <el-upload style=""
ref="upload_room"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'room')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'room')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
</div> </div>
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table ref="ref_table"
:data="tableData"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" :header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
border border
:height="tableHeight" :height="tableHeight"
v-loading="tableLoading" v-loading="tableLoading"
style="width: 100%"> style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
:selectable="checkSelect"
width="55">
</el-table-column>
<el-table-column prop="buildingName" <el-table-column prop="buildingName"
label="楼栋名称" label="楼栋名称"
min-width="180"> min-width="180">
@ -128,12 +137,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -150,6 +161,20 @@
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
<div v-if="tableData.length>0"
class="div_del">
<el-checkbox style="height:32px"
:indeterminate="isIndeterminate"
v-model="selAllFlag"
@change="handleSelectAll">全选</el-checkbox>
<el-button v-show="showDeletBtn"
style="margin-left:15px"
type="red"
size="small"
@click="deleteBatch">批量删除</el-button>
</div>
</div> </div>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
@ -186,11 +211,16 @@ export default {
pageSize: 20, pageSize: 20,
pageNo: 0, pageNo: 0,
tableLoading: true, tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//
// showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
tableData: [], validTableDataNum: 0,//
selection: [],
showDeletBtn: false,
//form //form
formShow: false, formShow: false,
@ -219,11 +249,30 @@ export default {
this.loadTable() this.loadTable()
}, },
checkSelect (row, index) {
let isChecked = false;
if (row.showBtn) { //
isChecked = true
} else {
isChecked = false
}
return isChecked
},
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
// if (this.agencyObj.pid === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
} }
console.log(this.agencyObj) console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist" const url = "/gov/org/building/buildinglist"
let params = { let params = {
@ -237,7 +286,17 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.validTableDataNum = 0
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
this.validTableDataNum++
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -287,6 +346,60 @@ export default {
this.$emit('refreshTree') this.$emit('refreshTree')
}, },
handleSelectAll (selectAllFlag) {
this.$refs.ref_table.clearSelection();
if (selectAllFlag) {
this.tableData.forEach(row => {
if (row.showBtn) {
this.$refs.ref_table.toggleRowSelection(row);
}
});
}
},
deleteBatch () {
if (this.selection.length > 0) {
this.$confirm("确认删除选择的楼宇?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteCommunityBatch()
})
.catch(err => {
if (err == "cancel") {
// this.$message({
// type: "info",
// message: ""
// });
}
});
} else {
this.$message.warning('请先选择要删除的楼宇')
}
},
selectAll (selection) {
this.selection = selection
if (selection.length === this.validTableDataNum) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
selectionChange (selection) {
this.selection = selection
this.isIndeterminate = false
if (selection.length === this.validTableDataNum) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
async handleDelete (row) { async handleDelete (row) {
this.$confirm("确认删除?", "提示", { this.$confirm("确认删除?", "提示", {
@ -310,6 +423,42 @@ export default {
}, },
async deleteCommunityBatch () {
let ids = []
this.selection.forEach(element => {
ids.push(element.buildingId)
});
const url = "/gov/org/house/delete"
let params = {
type: 'building',
ids: ids
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.$emit('refreshTree')
this.loadTable()
} else if (code > 8000) {
this.$message({
showClose: true,
message: msg,
duration: 0
})
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(msg)
}
},
async deleteBuild (row) { async deleteBuild (row) {
const url = "/gov/org/building/buildingdel" const url = "/gov/org/building/buildingdel"
@ -544,70 +693,28 @@ export default {
} }
}, },
watch: { watch: {
filterText (val) { selection (val) {
this.$refs.tree.filter(val);
if (val.length > 0) {
this.showDeletBtn = true
} else {
this.showDeletBtn = false
}
} }
}, },
props: { props: {
staffAgencyId: {
type: String,
default: '',
},
showImportBtn: {
type: Boolean,
default: false,
},
} }
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss"; @import "@/assets/scss/buttonstyle.scss";
.div_search { @import "@/assets/scss/modules/visual/communityManage.scss";
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_table {
margin-top: 20px;
}
.div_search {
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_btn {
display: flex;
margin-top: 20px;
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style> </style>

41
src/views/modules/base/community/community.vue

@ -29,13 +29,18 @@
<build-table v-if="selTreeObj.level==='neighborHood'" <build-table v-if="selTreeObj.level==='neighborHood'"
ref="ref_neighTable" ref="ref_neighTable"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
@toNextLevel="toNextLevel" @toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table> @refreshTree="refreshTree"></build-table>
<room-table v-else-if="selTreeObj.level==='building'" <room-table v-else-if="selTreeObj.level==='building'"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
ref="ref_buildingTable" ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table> @refreshTree="refreshTree"></room-table>
<community-table v-else <community-table v-else
@toNextLevel="toNextLevel" @toNextLevel="toNextLevel"
:staffAgencyId="staffAgencyId"
ref="ref_communityTable" ref="ref_communityTable"
@refreshTree="refreshTree"></community-table> @refreshTree="refreshTree"></community-table>
@ -67,7 +72,9 @@ export default {
selTreeObj: {}, selTreeObj: {},
centerPoint: [] centerPoint: [],
staffAgencyId: localStorage.getItem("agencyId"),
showImportBtn: false
} }
}, },
@ -78,6 +85,7 @@ export default {
this.treeLoading = true this.treeLoading = true
await this.loadOrgData() await this.loadOrgData()
await this.loadTree() await this.loadTree()
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
if (this.treeData.length > 0) { if (this.treeData.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
@ -147,7 +155,12 @@ export default {
handleNodeClick (obj) { handleNodeClick (obj) {
this.getTreeObj(obj) this.getTreeObj(obj)
this.$nextTick(() => { this.$nextTick(() => {
if (obj.level === 'building') {// if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj) this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj)
@ -196,18 +209,35 @@ export default {
// idtypeidid // idtypeidid
// idtypeid // idtypeid
if (obj.level === 'building') {// if (obj.level === 'building') {//
let communityNode = this.$refs.ref_tree.getNode(obj.pid) let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid)//
obj.communityId = communityNode.data.id
obj.communityName = communityNode.data.label
} else if (obj.level === 'neighborHood') {// let gridNode = this.$refs.ref_tree.getNode(neighborHoodNode.data.pid)//
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.neighborHoodId = neighborHoodNode.data.id
obj.neighborHoodName = neighborHoodNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(obj.pid) let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid) let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)
obj.gridId = gridNode.data.id obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label obj.gridName = gridNode.data.label
obj.agencyId = agencyNode.data.id obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else { } else {
} }
@ -276,6 +306,7 @@ export default {
.div_table { .div_table {
margin-left: 15px; margin-left: 15px;
// flex: 1;
width: calc(100vw - 550px); width: calc(100vw - 550px);
background-color: #ffffff; background-color: #ffffff;
border-radius: 5px; border-radius: 5px;

2
src/views/modules/base/community/communityForm.vue

@ -385,7 +385,7 @@ export default {
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加小区成功' message: '操作成功'
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')

248
src/views/modules/base/community/communityTable.vue

@ -42,7 +42,7 @@
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd">新增小区</el-button> @click="handleAdd">新增小区</el-button>
<div class="btn_upload" <div class="btn_upload"
v-if="agencyObj.level==='community'||agencyObj.level==='grid'"> v-if="showImportBtn">
<el-button style="" <el-button style=""
type="blue" type="blue"
size="small" size="small"
@ -109,12 +109,19 @@
</div> </div>
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table ref="ref_table"
:data="tableData"
border border
:height="tableHeight" :height="tableHeight"
v-loading="tableLoading" v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" :header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"> style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
:selectable="checkSelect"
width="55">
</el-table-column>
<el-table-column prop="neighborHoodName" <el-table-column prop="neighborHoodName"
label="小区名称" label="小区名称"
min-width="100"> min-width="100">
@ -151,12 +158,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -173,6 +182,19 @@
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
<div v-if="tableData.length>0"
class="div_del">
<el-checkbox style="height:32px"
:indeterminate="isIndeterminate"
v-model="selAllFlag"
@change="handleSelectAll">全选</el-checkbox>
<el-button v-show="showDeletBtn"
style="margin-left:15px"
type="red"
size="small"
@click="deleteBatch">批量删除</el-button>
</div>
</div> </div>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
@ -210,11 +232,18 @@ export default {
pageSize: 20, pageSize: 20,
pageNo: 0, pageNo: 0,
tableLoading: true, tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//
showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
tableData: [], tableData: [],
validTableDataNum: 0,//
selection: [],
showDeletBtn: false,
//form //form
formShow: false, formShow: false,
@ -234,7 +263,6 @@ export default {
}, },
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 300) return (this.clientHeight - 300)
}, },
@ -249,11 +277,28 @@ export default {
this.loadTable() this.loadTable()
}, },
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
console.log(111, this.staffAgencyId)
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
if (this.agencyObj.level === 'community') {//
if (this.agencyObj.id === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (this.agencyObj.level === 'grid') {//
if (this.agencyObj.pid === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
this.showImportBtn = false
}
} }
console.log(this.agencyObj)
const url = "/gov/org/neighborhood/neighborhoodlist" const url = "/gov/org/neighborhood/neighborhoodlist"
let params = { let params = {
@ -268,7 +313,17 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.validTableDataNum = 0
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
this.validTableDataNum++
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -276,6 +331,17 @@ export default {
this.tableLoading = false this.tableLoading = false
}, },
checkSelect (row, index) {
let isChecked = false;
if (row.showBtn) { //
isChecked = true
} else {
isChecked = false
}
return isChecked
},
diaClose () { diaClose () {
this.$refs.ref_form.resetData() this.$refs.ref_form.resetData()
this.formShow = false this.formShow = false
@ -318,6 +384,62 @@ export default {
this.$emit('refreshTree') this.$emit('refreshTree')
}, },
handleSelectAll (selectAllFlag) {
this.$refs.ref_table.clearSelection();
if (selectAllFlag) {
this.tableData.forEach(row => {
if (row.showBtn) {
this.$refs.ref_table.toggleRowSelection(row);
}
});
}
},
deleteBatch () {
if (this.selection.length > 0) {
this.$confirm("确认删除选择的小区?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteCommunityBatch()
})
.catch(err => {
if (err == "cancel") {
// this.$message({
// type: "info",
// message: ""
// });
}
});
} else {
this.$message.warning('请先选择要删除的小区')
}
},
selectAll (selection) {
this.selection = selection
if (selection.length === this.validTableDataNum) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
selectionChange (selection) {
this.selection = selection
this.isIndeterminate = false
if (selection.length === this.validTableDataNum) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
async handleDelete (row) { async handleDelete (row) {
this.$confirm("确认删除?", "提示", { this.$confirm("确认删除?", "提示", {
@ -339,6 +461,42 @@ export default {
}); });
}, },
async deleteCommunityBatch () {
let ids = []
console.log(this.selection)
this.selection.forEach(element => {
ids.push(element.neighborHoodId)
});
const url = "/gov/org/house/delete"
let params = {
type: 'neighborHood',
ids: ids
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.$emit('refreshTree')
this.loadTable()
} else if (code > 8000) {
this.$message({
showClose: true,
message: msg,
duration: 0
})
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(msg)
}
},
async deleteCommunity (row) { async deleteCommunity (row) {
const url = "/gov/org/neighborhood/neighborhooddel" const url = "/gov/org/neighborhood/neighborhooddel"
@ -585,75 +743,31 @@ export default {
} }
}, },
watch: { watch: {
filterText (val) { selection (val) {
this.$refs.tree.filter(val);
if (val.length > 0) {
this.showDeletBtn = true
} else {
this.showDeletBtn = false
}
} }
}, },
props: { props: {
staffAgencyId: {
type: String,
default: '',
},
} }
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss"; @import "@/assets/scss/buttonstyle.scss";
.div_search { @import "@/assets/scss/modules/visual/communityManage.scss";
display: flex; </style>
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_table {
margin-top: 20px;
}
.div_search {
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_btn {
display: flex;
margin-top: 20px;
.btn_upload {
margin-left: 10px;
display: flex;
}
}
.el-row { <style>
/* margin-bottom: 20px; */ .el-message.is-closable .el-message__content {
display: flex; line-height: 20px;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
} }
</style> </style>

3
src/views/modules/base/community/roomForm.vue

@ -163,9 +163,10 @@ export default {
methods: { methods: {
async initForm (type, row, agencyObj) { async initForm (type, row, agencyObj) {
debugger
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj this.agencyObj = agencyObj
this.dataForm.neighborHoodId = agencyObj.communityId this.dataForm.neighborHoodId = agencyObj.neighborHoodId
this.dataForm.buildingId = agencyObj.id this.dataForm.buildingId = agencyObj.id
this.formType = type this.formType = type

278
src/views/modules/base/community/roomTable.vue

@ -41,35 +41,45 @@
icon="el-icon-plus" icon="el-icon-plus"
size="small" size="small"
@click="handleAdd">新增房屋</el-button> @click="handleAdd">新增房屋</el-button>
<el-button style="float:left" <div class="btn_upload"
type="blue" v-if="showImportBtn">
size="small" <el-button style="float:left"
icon="el-icon-download" type="blue"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small" size="small"
icon="el-icon-upload2" icon="el-icon-download"
:loading="importRoomLoading" @click="handleExportModule">下载房屋模板</el-button>
type="red">导入房屋数据</el-button> <el-upload ref="upload"
</el-upload> :multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
</div> </div>
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table ref="ref_table"
:data="tableData"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" :header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
v-loading="tableLoading" v-loading="tableLoading"
border border
:height="tableHeight" :height="tableHeight"
style="width: 100%"> style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
:selectable="checkSelect"
width="55">
</el-table-column>
<el-table-column prop="houseName" <el-table-column prop="houseName"
label="房屋名称" label="房屋名称"
width="120"> width="120">
@ -119,12 +129,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -141,6 +153,20 @@
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
<div v-if="tableData.length>0"
class="div_del">
<el-checkbox style="height:32px"
:indeterminate="isIndeterminate"
v-model="selAllFlag"
@change="handleSelectAll">全选</el-checkbox>
<el-button v-show="showDeletBtn"
style="margin-left:15px"
type="red"
size="small"
@click="deleteBatch">批量删除</el-button>
</div>
</div> </div>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
@ -175,11 +201,16 @@ export default {
pageSize: 20, pageSize: 20,
pageNo: 0, pageNo: 0,
tableLoading: true, tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//
// showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
tableData: [], validTableDataNum: 0,//
selection: [],
showDeletBtn: false,
//form //form
formShow: false, formShow: false,
@ -210,10 +241,35 @@ export default {
this.loadTable() this.loadTable()
}, },
checkSelect (row, index) {
let isChecked = false;
if (row.showBtn) { //
isChecked = true
} else {
isChecked = false
}
return isChecked
},
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
// if (this.agencyObj.level === 'community') {//
// if (this.agencyObj.id === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
// } else if (this.agencyObj.level === 'grid') {//
// if (this.agencyObj.pid === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
// } else {
// this.showImportBtn = false
// }
} }
const url = "/gov/org/house/houselist" const url = "/gov/org/house/houselist"
@ -230,6 +286,16 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
this.validTableDataNum = 0
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
this.validTableDataNum++
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -274,6 +340,61 @@ export default {
this.loadTable() this.loadTable()
}, },
handleSelectAll (selectAllFlag) {
this.$refs.ref_table.clearSelection();
if (selectAllFlag) {
this.tableData.forEach(row => {
if (row.showBtn) {
this.$refs.ref_table.toggleRowSelection(row);
}
});
}
},
deleteBatch () {
if (this.selection.length > 0) {
this.$confirm("确认删除选择的房屋?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteCommunityBatch()
})
.catch(err => {
if (err == "cancel") {
// this.$message({
// type: "info",
// message: ""
// });
}
});
} else {
this.$message.warning('请先选择要删除的房屋')
}
},
selectAll (selection) {
this.selection = selection
if (selection.length === this.validTableDataNum) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
selectionChange (selection) {
this.selection = selection
this.isIndeterminate = false
if (selection.length === this.validTableDataNum) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
async handleDelete (row) { async handleDelete (row) {
this.$confirm("确认删除?", "提示", { this.$confirm("确认删除?", "提示", {
@ -297,6 +418,42 @@ export default {
}, },
async deleteCommunityBatch () {
let ids = []
this.selection.forEach(element => {
ids.push(element.houseId)
});
const url = "/gov/org/house/delete"
let params = {
type: 'house',
ids: ids
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.$emit('refreshTree')
this.loadTable()
} else if (code > 8000) {
this.$message({
showClose: true,
message: msg,
duration: 0
})
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(msg)
}
},
async deleteRoom (row) { async deleteRoom (row) {
const url = "/gov/org/house/housedel" const url = "/gov/org/house/housedel"
@ -499,69 +656,28 @@ export default {
} }
}, },
watch: { watch: {
filterText (val) { selection (val) {
this.$refs.tree.filter(val);
if (val.length > 0) {
this.showDeletBtn = true
} else {
this.showDeletBtn = false
}
} }
}, },
props: { props: {
staffAgencyId: {
type: String,
default: '',
},
showImportBtn: {
type: Boolean,
default: false,
},
} }
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss"; @import "@/assets/scss/buttonstyle.scss";
.div_search { @import "@/assets/scss/modules/visual/communityManage.scss";
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_table {
margin-top: 20px;
}
.div_search {
display: flex;
.resi-cell {
display: flex;
align-items: center;
.resi-cell-label {
width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-input {
width: 180px;
}
}
}
.div_btn {
margin-top: 20px;
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style> </style>

140
src/views/modules/base/resi.vue

@ -32,11 +32,15 @@
</el-upload> </el-upload>
</div> </div>
<el-table :data="tableData" <el-table ref="ref_table" :data="tableData"
v-loading="tableLoading" v-loading="tableLoading"
border border
style="width: 100%" style="width: 100%"
class="resi-table"> class="resi-table"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号" <el-table-column label="序号"
type="index" type="index"
align="center" align="center"
@ -86,15 +90,28 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div> <div class="div-flex">
<el-pagination @size-change="handleSizeChange" <div class="div_del">
@current-change="handleCurrentChange" <el-checkbox :indeterminate="isIndeterminate"
:current-page.sync="currentPage" v-model="selAllFlag"
:page-sizes="[20, 50, 100, 200]" :disabled="tableData.length==0"
:page-size="pageSize" @change="handleSelectAll">全选</el-checkbox>
layout="sizes, prev, pager, next" <el-button v-if="selection.length > 0" style="margin-left:15px"
:total="total"> type="danger"
</el-pagination> size="small"
@click="deleteBatch">删除</el-button>
</div>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div> </div>
</el-card> </el-card>
@ -240,6 +257,8 @@ export default {
btnLoading: false, btnLoading: false,
disabled: false, disabled: false,
pageLoading: false, pageLoading: false,
selAllFlag: false,
isIndeterminate: false,
dialogEditVisible: false, dialogEditVisible: false,
dialogVisible: false, dialogVisible: false,
uploadUlr: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel', uploadUlr: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
@ -262,6 +281,7 @@ export default {
formList: [], formList: [],
tableHeader: [], tableHeader: [],
tabsList: [], tabsList: [],
selection: [],
defaultCategotyKey: '', defaultCategotyKey: '',
@ -336,6 +356,65 @@ export default {
const { user } = this.$store.state const { user } = this.$store.state
return id === user.agencyId return id === user.agencyId
}, },
selectionChange (selection) {
this.selection = selection
if (selection.length === this.tableData.length) {
this.selAllFlag = true
this.isIndeterminate = false
} else if (selection.length > 0) {
this.selAllFlag = false
this.isIndeterminate = true
} else {
this.selAllFlag = false
this.isIndeterminate = false
}
},
handleSelectAll (selectAllFlag) {
// if (this.tableData.length == 0) {
// this.selAllFlag = false
// return
// }
this.$refs.ref_table.clearSelection();
if (selectAllFlag) {
this.tableData.forEach(row => {
this.$refs.ref_table.toggleRowSelection(row);
});
}
},
selectAll (selection) {
this.selection = selection
if (selection.length > 0) {
this.selAllFlag = true
} else {
this.selAllFlag = false
}
},
deleteBatch () {
if (this.selection.length > 0) {
this.$confirm("删除之后无法恢复,确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteresiBatch()
})
.catch(err => {
if (err == "cancel") {
// this.$message({
// type: "info",
// message: ""
// });
}
});
} else {
this.$message.warning('请先选择要删除的居民')
}
},
handleSizeChange (val) { handleSizeChange (val) {
console.log(`每页 ${val}`) console.log(`每页 ${val}`)
this.pageSize = val this.pageSize = val
@ -468,13 +547,13 @@ export default {
.post('/epmetuser/icresiuser/importExcel', formData).then(res => { .post('/epmetuser/icresiuser/importExcel', formData).then(res => {
console.log('res-up', res) console.log('res-up', res)
if (res.data.code == 0 && res.data.msg == 'success') { if (res.data.code == 0 && res.data.msg == 'success') {
this.$message.success('导入成功') // this.$message.success('')
this.getTableData() this.getTableData()
} else this.$message.error(res.data.msg) } else this.$message.error(res.data.msg)
}).catch(err => { }).catch(err => {
console.log('失败', err) console.log('失败', err)
file.onError() // file.onError() //
this.$message.error('导入失败') // this.$message.error('')
}) })
// await axios({ // await axios({
// url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel', // url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
@ -627,7 +706,7 @@ export default {
handleDel (row) { handleDel (row) {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
icResiUserId: row.icResiUserId userIds: [row.icResiUserId]
} }
console.log('row1', row) console.log('row1', row)
this.$http this.$http
@ -926,7 +1005,29 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
} },
async deleteresiBatch () {
if (this.selection.length === 0) return this.$message.error('请选择之后进行操作')
let userIds = this.selection.map(item => item.icResiUserId)
let params = {
formCode: 'resi_base_info',
userIds
}
this.$http
.post('/epmetuser/icresiuser/delete', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success('删除成功')
this.getTableData()
}
})
.catch((err) => {
console.log('row4', err)
return this.$message.error('网络错误')
})
},
} }
} }
</script> </script>
@ -1033,4 +1134,13 @@ export default {
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
} }
.div-flex {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.div_del {
margin-top: 15px;
}
}
</style> </style>

8
src/views/modules/communityParty/elegant/index.vue

@ -226,7 +226,7 @@ export default {
data() { data() {
return { return {
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
importBtnTitle: '导入人员数据', importBtnTitle: '导入数据',
importLoading: false, importLoading: false,
exportBtn: false, exportBtn: false,
exportBtnTitle: '导出', exportBtnTitle: '导出',
@ -385,7 +385,7 @@ export default {
.post('/resi/partymember/icpartymemberstyle/import', formData).then(res => { .post('/resi/partymember/icpartymemberstyle/import', formData).then(res => {
console.log('res-up', res) console.log('res-up', res)
if (res.data.code == 0 && res.data.msg == 'success') { if (res.data.code == 0 && res.data.msg == 'success') {
this.$message.success('导入成功') // this.$message.success('')
this.getTableData() this.getTableData()
} else { } else {
this.$message.error(res.data.msg) this.$message.error(res.data.msg)
@ -393,7 +393,7 @@ export default {
}).catch(err => { }).catch(err => {
console.log('失败', err) console.log('失败', err)
file.onError() // file.onError() //
this.$message.error('导入失败') // this.$message.error('')
}) })
// await axios({ // await axios({
// url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/import', // url: window.SITE_CONFIG['apiURL'] + '/resi/partymember/icpartymemberstyle/import',
@ -424,7 +424,7 @@ export default {
// this.$message.error('') // this.$message.error('')
// }) // })
this.importLoading = false this.importLoading = false
this.importBtnTitle = '导入人员数据' this.importBtnTitle = '导入数据'
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
}, },
async handleExport() { async handleExport() {

2
src/views/modules/communityService/ninePlaces/inspect/inspect.vue

@ -132,7 +132,7 @@
<el-table-column prop="inspectorsNames" <el-table-column prop="inspectorsNames"
header-align="center" header-align="center"
align="center" align="center"
label="检人员" label="检人员"
min-width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="firstTime" <el-table-column prop="firstTime"

18
src/views/modules/communityService/ninePlaces/inspect/inspectForm.vue

@ -18,6 +18,7 @@
placeholder="全部" placeholder="全部"
clearable> clearable>
<el-option v-for="item in gridList" <el-option v-for="item in gridList"
@click.native="handleChangeGrid"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
@ -33,6 +34,7 @@
placeholder="请选择" placeholder="请选择"
clearable> clearable>
<el-option v-for="item in placeTypeList" <el-option v-for="item in placeTypeList"
@click.native="handleChangeType"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
@ -205,11 +207,26 @@ export default {
this.endLoading() this.endLoading()
}, },
//
handleChangeGrid () {
this.formData.placeOrgId = ''
this.loadPlaces()
},
//
handleChangeType () {
this.formData.placeOrgId = ''
this.loadPlaces()
},
// //
async loadPlaces () { async loadPlaces () {
const url = '/gov/org/placeorg/getlist' const url = '/gov/org/placeorg/getlist'
let params = { let params = {
gridId: this.formData.gridId,//Id
ninePlaceVal: this.formData.ninePlaceVal,//Value
isPage: false isPage: false
} }
@ -223,6 +240,7 @@ export default {
} }
}, },
// //
async loadTeams () { async loadTeams () {
const url = '/gov/org/placepatrolteam/getlist' const url = '/gov/org/placepatrolteam/getlist'

65
src/views/modules/communityService/sqzzz/index.vue

@ -270,34 +270,53 @@ export default {
} }
return fileType && isLt1M; return fileType && isLt1M;
}, },
uploadHttpRequest(file) { async uploadHttpRequest(file) {
this.importLoading = true; this.importLoading = true;
this.importBtnTitle = "正在上传中..."; this.importBtnTitle = "正在上传中...";
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
})
const formData = new FormData(); //FormDataappend('key', value) const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); // formData.append("file", file.file); //
axios({ await this.$http
url: .post('/heart/iccommunityselforganization/importcommunityselforganization', formData).then(res => {
window.SITE_CONFIG["apiURL"] + console.log('res-up', res)
"/heart/iccommunityselforganization/importcommunityselforganization", if (res.data.code == 0 && res.data.msg == 'success') {
method: "post", // this.$message.success('')
data: formData, this.getTableData()
// responseType: "blob", } else this.$message.error(res.data.msg)
}) }).catch(err => {
.then((res) => { console.log('失败', err)
this.importLoading = false; file.onError() //
this.importBtnTitle = "excel导入"; // this.$message.error('')
console.log("resresresresresresres", res);
this.getTableData();
if (res.data.code == 0) {
return this.$message.success(res.data.data || "导入成功");
} else {
return this.$message.error(res.data.msg);
}
}) })
.catch((err) => { // axios({
console.log("失败", err); // url:
}); // window.SITE_CONFIG["apiURL"] +
// "/heart/iccommunityselforganization/importcommunityselforganization",
// method: "post",
// data: formData,
// // responseType: "blob",
// })
// .then((res) => {
// this.importLoading = false;
// this.importBtnTitle = "excel";
// console.log("resresresresresresres", res);
// this.getTableData();
// if (res.data.code == 0) {
// return this.$message.success(res.data.data || "");
// } else {
// return this.$message.error(res.data.msg);
// }
// })
// .catch((err) => {
// console.log("", err);
// });
this.importLoading = false
this.importBtnTitle = 'excel导入'
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
}, },

2
src/views/modules/importRecord/index.vue

@ -55,7 +55,7 @@
</template> </template>
<script> <script>
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request2";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import axios from "axios"; import axios from "axios";

31
src/views/modules/visual/communityParty/community.vue

@ -36,7 +36,8 @@
prefix-icon="el-icon-caret-bottom" prefix-icon="el-icon-caret-bottom"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:clearable="false" :clearable="false"
:default-time="['00:00:00', '23:59:59']"> :default-time="['00:00:00', '23:59:59']"
@change="handleTimeChange">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
@ -121,6 +122,7 @@
<script> <script>
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import util from '@js/util.js';
import screenTable from "../components/screen-table/index"; import screenTable from "../components/screen-table/index";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
@ -232,12 +234,27 @@ export default {
watch: { watch: {
timeRange (val) { timeRange (val) {
console.log('val-www', val) console.log('val-www', val)
this.getList(this.agencyId); // this.getList(this.agencyId);
this.getCateCount(this.agencyId) // this.getCateCount(this.agencyId)
} }
}, },
methods: { methods: {
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
const startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00'
const endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59'
this.timeRange = [startTime, endTime]
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.initTime()
}
this.getList(this.agencyId);
this.getCateCount(this.agencyId)
},
// //
async getList (agencyId) { async getList (agencyId) {
this.visibleLoading = true this.visibleLoading = true
@ -419,9 +436,9 @@ export default {
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
console.log('time-rtt', this.timeFormat(start), this.timeFormat(end)) console.log('time-rtt', this.timeFormat(start), this.timeFormat(end))
this.timeRange = [this.timeFormat(start), this.timeFormat(end)] this.timeRange = [this.timeFormat(start, '00:00:00'), this.timeFormat(end, '23:59:59')]
}, },
timeFormat (date) { timeFormat (date, h) {
if (!date || typeof date === 'string') { if (!date || typeof date === 'string') {
return false return false
} }
@ -431,7 +448,7 @@ export default {
var d = date.getDate() // var d = date.getDate() //
if (d < 10) d = '0' + d if (d < 10) d = '0' + d
return y + '-' + m + '-' + d + ' 00:00:00' return y + '-' + m + '-' + d + ' ' + h
}, },
async loadUnit () { async loadUnit () {
const url = "/heart/serviceitem/dict-list" const url = "/heart/serviceitem/dict-list"

2
src/views/modules/visual/communityParty/elegant.vue

@ -555,7 +555,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
padding: 30px 0 20px; padding: 30px 0 20px;
.elegant-item { .elegant-item {
width: 19%; width: calc((100% - 80px) / 5);
margin-right: 20px; margin-right: 20px;
margin-bottom: 36px; margin-bottom: 36px;
box-sizing: border-box; box-sizing: border-box;

3
src/views/modules/visual/communityParty/elegantInfo.vue

@ -41,7 +41,8 @@
v-for="(item, index) in info.imageList" :key="index" v-for="(item, index) in info.imageList" :key="index"
style="width: 200px; height: 200px;margin-right: 10px;" style="width: 200px; height: 200px;margin-right: 10px;"
:src="item" :src="item"
:preview-src-list="info.imageList"> :preview-src-list="info.imageList"
:z-index="99999">
</el-image> </el-image>
</div> </div>
<!-- <span>{{ info.peopleCount }}</span> --> <!-- <span>{{ info.peopleCount }}</span> -->

2
src/views/modules/visual/communityParty/party.vue

@ -760,7 +760,7 @@ export default {
this.getAgeList(this.agencyId, this.orgType) this.getAgeList(this.agencyId, this.orgType)
}, },
pageCurrentChangeHandleAge (val) { pageCurrentChangeHandleAge (val) {
this.agePageSize = val this.agePageNo = val
this.getAgeList(this.agencyId, this.orgType) this.getAgeList(this.agencyId, this.orgType)
}, },
pageSizeChangeHandleNew(val) { pageSizeChangeHandleNew(val) {

4
src/views/modules/visual/measure/volunteer.vue

@ -57,13 +57,13 @@
<div class="card-count-item"> <div class="card-count-item">
<div class="card-count-content"> <div class="card-count-content">
<div class="card-count-num">{{ vInfo.partyServiceTotal || 0 }}</div> <div class="card-count-num">{{ vInfo.partyServiceTotal || 0 }}</div>
<div class="card-count-label">党员数</div> <div class="card-count-label">党员服务次</div>
</div> </div>
</div> </div>
<div class="card-count-item"> <div class="card-count-item">
<div class="card-count-content"> <div class="card-count-content">
<div class="card-count-num">{{ vInfo.resiServiceTotal || 0 }}</div> <div class="card-count-num">{{ vInfo.resiServiceTotal || 0 }}</div>
<div class="card-count-label">居民数</div> <div class="card-count-label">居民服务次</div>
</div> </div>
</div> </div>
</div> </div>

286
src/views/modules/workSys/elegantCate.vue

@ -0,0 +1,286 @@
<template>
<div class="resi-container">
<el-card class="resi-card-table">
<div class="mod-sys__menu">
<div class="resi-row-btn">
<el-button class=""
type="success"
@click="addShow()">新增</el-button>
</div>
<el-table v-loading="dataListLoading"
:data="dataList"
:default-expand-all="false"
row-key="categoryId"
:cell-style="cellStyle"
border
style="width: 100%;" class="resi-table">
<el-table-column prop="categoryName"
label="分类名称"
header-align="center"
min-width="150"></el-table-column>
<el-table-column prop="stateShow"
label="状态"
header-align="center"
min-width="150"></el-table-column>
<!-- <el-table-column prop="sort"
:label="$t('menu.sort')"
header-align="center"
align="center"></el-table-column> -->
<el-table-column label="操作"
fixed="right"
header-align="center"
align="left"
width="350">
<template slot-scope="scope">
<el-button type="text"
size="small"
class="btn-color-look"
@click="disableCategory(scope.row)">{{ scope.row.btnShow}}</el-button>
<el-button type="text"
size="small"
class="btn-color-edit"
@click="editShow(scope.row)">修改</el-button>
<el-button type="text"
size="small"
class="btn-color-del"
@click="deleteCategory(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<elegant-edit ref="ref_edit"
@editDiaOK="editDiaOK">
</elegant-edit>
</div>
</template>
<script>
import { requestPost } from '@/js/dai/request'
import elegantEdit from './elegantEdit.vue'
export default {
data () {
return {
customerId: '', // id
customerName: '', //
tableParams: {
customerId: ''
},
search: '',
dataList: [],
dataListLoading: false
}
},
computed: {
tables () {
const search = this.search
if (search) {
console.log('this.dataList', this.dataList)
return this.dataList.filter(dataNews => {
return Object.keys(dataNews).some(key => {
return String(dataNews[key]).toLowerCase().indexOf(search) > -1
})
})
}
console.log('this.dataList', this.dataList)
return this.dataList
}
},
components: {
elegantEdit
},
created() {
const { user } = this.$store.state
console.log('user----', user)
this.initData(user.customerId, user.customerName)
},
methods: {
cellStyle ({ row, column, rowIndex, columnIndex }) {
//
if (row.state === 'enable' && columnIndex === 1) {
return 'color: #EA1B29'
} else if (row.state === 'disable' && columnIndex === 1) {
return 'color: #0CB618'
} else {
return 'color: #1a1a1b'
}
},
initData (customerId, customerName) {
this.customerId = customerId
this.customerName = customerName
this.loadData()
},
//
async loadData () {
this.dataListLoading = true
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/customercategorylist'
const url = '/resi/partymember/stylecategorydict/list'
this.tableParams.customerId = this.customerId
const { data, code, msg } = await requestPost(url, this.tableParams)
this.dataListLoading = false
if (code === 0) {
this.dataList = data
this.dataList.forEach(element => {
element.state = element.beDisabled ? 'enable' : 'disable'
element.btnShow = element.beDisabled ? '启用' : '禁用'
element.stateShow = element.beDisabled ? '禁用' : '启用'
element.level = 'l1'
// if (element.children.length > 0) {
// element.children.forEach(child => {
// child.state = child.isDisable === 'enable' ? 'disable' : 'enable'
// child.btnShow = child.isDisable === 'enable' ? '' : ''
// child.stateShow = child.isDisable === 'enable' ? '' : ''
// child.level = 'l2'
// child.parentCategoryId = element.categoryId
// })
// }
})
} else {
// this.$message.error(msg )
}
},
// /
disableCategory (row) {
this.$confirm('确认' + row.btnShow + '当前分类?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const url = '/resi/partymember/stylecategorydict/updatestatus'
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/isdisablecategory'
const param = {
customerId: this.customerId,
categoryId: row.categoryId,
beDisabled: row.state !== 'enable'
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('操作成功')
this.loadData()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}).catch(() => {
})
},
//
deleteCategory (row) {
this.$confirm('确认删除当前分类?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const url = '/resi/partymember/stylecategorydict/delete'
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/delcategory'
const param = {
customerId: this.customerId,
categoryId: row.categoryId
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('操作成功')
this.loadData()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}).catch(() => {
})
},
// customerId,parentCategoryId,categoryId,type,level,num
addShow () {
const sort = this.dataList.length + 1
this.$refs['ref_edit'].initAdd(this.customerId, '', 'l1', sort)
},
// customerId,parentCategoryId,categoryId,type,levelnum
showAddLevel2 (row) {
const sort = row.children.length + 1
this.$refs['ref_edit'].initAdd(this.customerId, row.categoryId, 'l2', sort)
},
// customerId,parentCategoryId,dateform
editShow (row) {
this.$refs['ref_edit'].initEdit(this.customerId, row.categoryId, row)
},
//
diaCancel () {
this.$emit('cancleBack')
},
editDiaOK () {
this.loadData()
}
}
}
</script>
<style lang="scss" scoped>
.resi-container .resi-card-table {
::v-deep .el-table {
th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
}
.cell {
span:nth-of-type(3) {
display: inline-block;
width: 90%;
word-break: break-all;
}
}
}
}
.resi-row-btn {
display: flex;
margin-bottom: 13px;
::v-deep .el-button {
// margin-left: 10px;
border: 0;
}
::v-deep .el-select {
margin-right: 10px;
}
.el-button--success {
background: rgba(34, 193, 195, 1);
}
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
::v-deep .btn-color-del {
margin-left: 10px;
color: rgba(213, 16, 16, 1);
}
::v-deep .btn-color-edit {
color: rgba(0, 167, 169, 1);
}
}
</style>

169
src/views/modules/workSys/elegantEdit.vue

@ -0,0 +1,169 @@
<template>
<el-dialog :visible.sync="visible"
:title="title"
:width="diaWidth+'%'"
:close-on-click-modal="false"
:before-close="handleClose"
:close-on-press-escape="false">
<el-form :inline="false"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:label-width="'120px'">
<div style="margin-top:20px">
<el-form-item label="分类名称"
prop="categoryName">
<el-tooltip class="item"
effect="dark"
content="请输入1-10个字"
placement="bottom-start">
<el-input class="item_width_1"
:maxlength="10"
:minlength="1"
v-model="dataForm.categoryName"
placeholder="分类名称"></el-input>
</el-tooltip>
</el-form-item>
<!-- <el-form-item label="排序"
prop="sort">
<el-input-number v-model="dataForm.sort"
:min="1"
label="描述文字"></el-input-number>
</el-form-item> -->
</div>
</el-form>
<template slot="footer">
<el-button @click="visible = false;resetData()">{{ $t('cancel') }}</el-button>
<el-button type="primary"
@click="saveForm()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex'
import { requestPost } from '@/js/dai/request'
export default {
data () {
return {
visible: false,
title: '分类信息',
customerId: '',
parentCategoryId: '', // Id
categoryId: '', // Id
type: '', // (add: edit:)
dataForm: {
categoryName: '', //
sort: 0,
type: '', // (add: edit:)
level: ''
},
url: ''
}
},
created () {
// this.queryFunctionList()
},
computed: {
dataRule () {
return {
categoryName: [
{ required: true, message: '分类名称不能为空', trigger: 'blur' },
{ min: 2, max: 20, message: '分类名称长度在 2 到 20 个字符', trigger: 'blur' }
]
}
},
diaWidth () {
console.log(this.resolution)
return this.resolution === 'small' ? 70 : 50
},
...mapGetters(['clientHeight', 'resolution'])
},
methods: {
// customerId,parentCategoryId ,level,
initAdd (customerId, parentCategoryId, level, sort) {
this.visible = true
this.customerId = customerId
this.parentCategoryId = parentCategoryId
this.type = 'add'
this.dataForm.level = level
this.dataForm.sort = sort
this.url = '/resi/partymember/stylecategorydict/addorupdate'
},
// customerId,parentCategoryId,dateform,level
initEdit (customerId, parentCategoryId, dataForm) {
this.visible = true
this.customerId = customerId
this.parentCategoryId = parentCategoryId
this.type = 'edit'
this.dataForm = dataForm
this.url = '/resi/partymember/stylecategorydict/addorupdate'
},
async saveForm () {
await this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
window.app.util.validateRule(messageObj)
return false
}
})
let params = {
customerId: this.customerId,
categoryId: this.dataForm.categoryId,
categoryName: this.dataForm.categoryName
}
const { data, code, msg } = await requestPost(this.url, params)
if (code === 0) {
this.$message({
type: 'success',
message: '保存成功'
})
this.resetData()
this.visible = false
this.$emit('editDiaOK')
} else {
// this.$message.error(msg)
}
},
handleClose () {
this.visible = false
},
resetData () {
this.dataForm = {
categoryName: '', //
sort: 0,
type: ''// (add: edit:)
}
}
}
}
</script>
<style scoped>
.item_width_1 {
width: 400px;
}
.item_width_2 {
width: 700px;
}
.block {
display: block;
}
.btn_reset {
vertical-align: bottom;
margin-left: 10px;
}
</style>
Loading…
Cancel
Save