Browse Source

修复了合并dev分支冲突

shibei_master
dai 4 years ago
parent
commit
81d4175b47
  1. BIN
      src/assets/img/shuju/people/close.png
  2. BIN
      src/assets/img/shuju/people/huzhu-home.png
  3. BIN
      src/assets/img/shuju/people/huzhu-kuang-you.png
  4. BIN
      src/assets/img/shuju/people/huzhu-kuang-zuo.png
  5. BIN
      src/assets/img/shuju/people/huzhu-line/you1.png
  6. BIN
      src/assets/img/shuju/people/huzhu-line/you2.png
  7. BIN
      src/assets/img/shuju/people/huzhu-line/you3.png
  8. BIN
      src/assets/img/shuju/people/huzhu-line/zuo1.png
  9. BIN
      src/assets/img/shuju/people/huzhu-line/zuo2.png
  10. BIN
      src/assets/img/shuju/people/huzhu-line/zuo3.png
  11. BIN
      src/assets/img/shuju/people/huzhu.png
  12. 61
      src/assets/scss/buttonstyle.scss
  13. 104
      src/assets/scss/common.scss
  14. 241
      src/assets/scss/people.scss
  15. 22
      src/assets/scss/shuju-card.scss
  16. 1
      src/utils/request.js
  17. 57
      src/views/components/editResi.vue
  18. 44
      src/views/components/resiForm.vue
  19. 313
      src/views/components/resiSearch.vue
  20. 88
      src/views/modules/base/community/buildForm.vue
  21. 62
      src/views/modules/base/community/buildTable.vue
  22. 150
      src/views/modules/base/community/community.vue
  23. 55
      src/views/modules/base/community/communityForm.vue
  24. 58
      src/views/modules/base/community/communityTable.vue
  25. 81
      src/views/modules/base/community/roomForm.vue
  26. 50
      src/views/modules/base/community/roomTable.vue
  27. 535
      src/views/modules/base/resi.vue
  28. 145
      src/views/modules/visual/basicinfo/people.vue
  29. 20
      src/views/modules/visual/cpts/card.vue
  30. 60
      src/views/modules/workSys/mapConfig.vue

BIN
src/assets/img/shuju/people/close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

BIN
src/assets/img/shuju/people/huzhu-home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/img/shuju/people/huzhu-kuang-you.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
src/assets/img/shuju/people/huzhu-kuang-zuo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/assets/img/shuju/people/huzhu-line/you1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
src/assets/img/shuju/people/huzhu-line/you2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
src/assets/img/shuju/people/huzhu-line/you3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
src/assets/img/shuju/people/huzhu-line/zuo1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/img/shuju/people/huzhu-line/zuo2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
src/assets/img/shuju/people/huzhu-line/zuo3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
src/assets/img/shuju/people/huzhu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

61
src/assets/scss/buttonstyle.scss

@ -0,0 +1,61 @@
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--green:hover {
color: #fff;
background-color: #05b1b4;
border-color: #05b1b4;
}
.el-button--green:focus {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow:hover {
color: #fff;
background-color: #fa9200;
border-color: #fa9200;
}
.el-button--yellow:focus {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue:focus {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--blue:hover {
color: #fff;
background-color: #0083fd;
border-color: #0083fd;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red:focus {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.el-button--red:hover {
color: #fff;
background-color: #fd341e;
border-color: #fd341e;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}

104
src/assets/scss/common.scss

@ -4,8 +4,8 @@
box-sizing: border-box; box-sizing: border-box;
} }
body { body {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
sans-serif; 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
font-size: $--font-size-base; font-size: $--font-size-base;
line-height: $base--line-height; line-height: $base--line-height;
color: $--color-text-primary; color: $--color-text-primary;
@ -35,7 +35,7 @@ img {
} }
.clearfix:before, .clearfix:before,
.clearfix:after { .clearfix:after {
content: " "; content: ' ';
display: table; display: table;
} }
.clearfix:after { .clearfix:after {
@ -144,8 +144,8 @@ img {
background-color: transparent; background-color: transparent;
} }
&-add { &-add {
> span > *[class*="el-icon-"], > span > *[class*='el-icon-'],
> span > *[class*="icon"] { > span > *[class*='icon'] {
vertical-align: middle; vertical-align: middle;
font-size: 18px; font-size: 18px;
margin-right: 5px; margin-right: 5px;
@ -383,7 +383,7 @@ img {
&::after { &::after {
position: absolute; position: absolute;
content: ""; content: '';
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -448,8 +448,8 @@ img {
} }
} }
&__search { &__search {
> *[class*="el-icon-"], > *[class*='el-icon-'],
> *[class*="icon"] { > *[class*='icon'] {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
@ -572,7 +572,9 @@ img {
min-height: calc(#{$content--fill-height} - 2px); min-height: calc(#{$content--fill-height} - 2px);
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height} - #{$content--card-header-height} - 2px); min-height: calc(
#{$content--fill-height} - #{$content--card-header-height} - 2px
);
} }
&--tabs { &--tabs {
padding: $content--tabs-header-height 0 0; padding: $content--tabs-header-height 0 0;
@ -644,7 +646,7 @@ img {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
content: ""; content: '';
width: 100%; width: 100%;
height: 2px; height: 2px;
background-color: $--color-primary; background-color: $--color-primary;
@ -677,10 +679,15 @@ img {
min-height: calc(#{$content--fill-height-tabs} - 2px); min-height: calc(#{$content--fill-height-tabs} - 2px);
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px); min-height: calc(
#{$content--fill-height-tabs} - #{$content--card-header-height} -
2px
);
} }
&.is-iframe { &.is-iframe {
height: calc(#{$content--fill-height-tabs} + #{$content--padding * 2}); height: calc(
#{$content--fill-height-tabs} + #{$content--padding * 2}
);
margin: -$content--padding; margin: -$content--padding;
min-height: auto; min-height: auto;
> .aui-card--fill { > .aui-card--fill {
@ -699,7 +706,10 @@ img {
background-color: #fff; background-color: #fff;
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px); height: calc(
#{$content--fill-height-tabs} - #{$content--card-header-height} -
2px
);
} }
} }
} }
@ -729,7 +739,7 @@ img {
/* Page /* Page
------------------------------ */ ------------------------------ */
*[class*="aui-page__"] { *[class*='aui-page__'] {
padding-top: 0; padding-top: 0;
.aui-content { .aui-content {
min-height: auto; min-height: auto;
@ -741,7 +751,71 @@ img {
min-height: calc(100vh - #{$content--padding * 2} - 2px); min-height: calc(100vh - #{$content--padding * 2} - 2px);
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px); min-height: calc(
100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px
);
} }
} }
} }
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--green:hover {
color: #fff;
background-color: #05b1b4;
border-color: #05b1b4;
}
.el-button--green:focus {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow:hover {
color: #fff;
background-color: #fa9200;
border-color: #fa9200;
}
.el-button--yellow:focus {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue:focus {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--blue:hover {
color: #fff;
background-color: #0083fd;
border-color: #0083fd;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red:focus {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.el-button--red:hover {
color: #fff;
background-color: #fd341e;
border-color: #fd341e;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}

241
src/assets/scss/people.scss

@ -1,6 +1,19 @@
@import "c/config"; @import "c/config";
@import "c/function"; @import "c/function";
.g-cpt {
display: flex;
flex-wrap: wrap;
justify-content: center;
// justify-content: space-around;
// .g-l {
// margin-right: auto;
// }
// .g-r {
// margin-left: auto;
// }
}
.m-people { .m-people {
position: relative; position: relative;
width: 850px; width: 850px;
@ -37,6 +50,7 @@
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
cursor: pointer;
} }
.ren { .ren {
@ -130,3 +144,230 @@
} }
} }
} }
.m-pop {
@include shield;
background-color: rgba(#000, 0.9);
overflow-y: scroll;
.wrap {
position: relative;
margin: 120px auto;
width: 1000px;
.title {
padding: 10px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
display: flex;
align-items: center;
img {
display: block;
margin-right: 5px;
}
span {
display: block;
}
}
.btn-close {
position: absolute;
top: -15px;
right: -15px;
cursor: pointer;
}
.list {
display: flex;
flex-wrap: wrap;
padding: 10px 30px;
.item {
position: relative;
box-sizing: border-box;
padding-left: 15px;
width: 33%;
color: #fff;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 24px;
margin: 20px 0;
&::before {
position: absolute;
left: 0;
top: 0;
bottom: 0;
margin: auto 0;
content: "";
display: block;
width: 7px;
height: 7px;
background: #0c81fe;
border-radius: 3px;
}
}
}
.line {
margin: 20px auto;
width: 900px;
height: 1px;
border: 1px dashed #1257c9;
}
}
}
.m-relation {
position: relative;
margin-top: 20px;
width: 850px;
.title {
padding: 10px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
display: flex;
align-items: center;
img {
display: block;
margin-right: 5px;
}
span {
display: block;
}
}
.info {
position: relative;
width: 410px;
height: 312px;
margin: 0 auto;
.huzhu {
position: relative;
.huzhu-bg {
display: block;
}
.huzhu-ico {
position: absolute;
display: block;
top: 90px;
left: 0;
right: 0;
margin: 0 auto;
}
.huzhu-name {
position: absolute;
display: block;
top: 170px;
width: 100%;
font-size: 24px;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 30px;
text-align: center;
}
> p {
position: absolute;
top: 200px;
font-size: 16px;
width: 100%;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
text-align: center;
}
}
.rel {
position: absolute;
width: 128px;
height: 38px;
.rel-line {
position: absolute;
z-index: 1;
}
.rel-text {
@include toe;
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
line-height: 38px;
text-align: center;
color: #fff;
font-size: 18px;
font-family: PingFang SC;
font-weight: 500;
.rel-name {
font-size: 14px;
}
}
&.z-zuo-2 {
top: 138px;
left: -33px - 128px;
.rel-line {
left: 127px;
top: -28px;
}
}
&.z-you-2 {
top: 138px;
right: -33px - 128px;
.rel-line {
right: 127px;
top: -28px;
}
}
&.z-zuo-1 {
top: 43px;
left: -33px - 128px;
.rel-line {
left: 131px;
}
}
&.z-you-1 {
top: 43px;
right: -33px - 128px;
.rel-line {
right: 131px;
}
}
&.z-zuo-3 {
bottom: 41px;
left: -33px - 128px;
.rel-line {
left: 131px;
bottom: -2px;
}
}
&.z-you-3 {
bottom: 41px;
right: -33px - 128px;
.rel-line {
right: 131px;
bottom: -2px;
}
}
}
}
}

22
src/assets/scss/shuju-card.scss

@ -9,54 +9,54 @@
height: 100%; height: 100%;
padding: 22px; padding: 22px;
.corner { .card-corner {
position: absolute; position: absolute;
display: block; display: block;
&.corner-1 { &.card-corner-1 {
top: 0; top: 0;
left: 0; left: 0;
} }
&.corner-2 { &.card-corner-2 {
top: 0; top: 0;
right: 0; right: 0;
} }
&.corner-3 { &.card-corner-3 {
bottom: 0; bottom: 0;
right: 0; right: 0;
} }
&.corner-4 { &.card-corner-4 {
bottom: 0; bottom: 0;
left: 0; left: 0;
} }
} }
.line { .card-line {
position: absolute; position: absolute;
display: block; display: block;
background-repeat: repeat; background-repeat: repeat;
&.line-t { &.card-line-t {
background-image: url(../img/shuju/card/line-t.png); background-image: url(../img/shuju/card/line-t.png);
left: 22px; left: 22px;
right: 240px; right: 240px;
top: 0; top: 0;
height: 22px; height: 22px;
} }
&.line-r { &.card-line-r {
background-image: url(../img/shuju/card/line-r.png); background-image: url(../img/shuju/card/line-r.png);
top: 22px; top: 22px;
bottom: 22px; bottom: 22px;
right: 0; right: 0;
width: 22px; width: 22px;
} }
&.line-b { &.card-line-b {
background-image: url(../img/shuju/card/line-b.png); background-image: url(../img/shuju/card/line-b.png);
left: 22px; left: 22px;
right: 240px; right: 240px;
bottom: 0; bottom: 0;
height: 22px; height: 22px;
} }
&.line-l { &.card-line-l {
background-image: url(../img/shuju/card/line-l.png); background-image: url(../img/shuju/card/line-l.png);
top: 22px; top: 22px;
bottom: 22px; bottom: 22px;
@ -65,7 +65,7 @@
} }
} }
.cnt { .card-cnt {
min-height: 200px; min-height: 200px;
background-image: url(../img/shuju/card/bg.png); background-image: url(../img/shuju/card/bg.png);
background-repeat: repeat; background-repeat: repeat;

1
src/utils/request.js

@ -60,6 +60,7 @@ http.interceptors.response.use(response => {
}else { }else {
router.replace({ name: 'login' }) router.replace({ name: 'login' })
} }
return Promise.reject(response.data.msg) return Promise.reject(response.data.msg)
} }
return response return response

57
src/views/components/editResi.vue

@ -18,7 +18,7 @@
<!-- <div class="resi-cell"> --> <!-- <div class="resi-cell"> -->
<!-- <div class="resi-cell-label">{{n.label}}</div> --> <!-- <div class="resi-cell-label">{{n.label}}</div> -->
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.GRID_ID" :disabled="disabled" placeholder="请选择网格" size="small" <el-select v-model.trim="form.GRID_ID" :disabled="disabled" placeholder="请选择网格" size="small"
clearable class="resi-cell-select" clearable class="resi-cell-select"
> >
<el-option <el-option
@ -35,7 +35,7 @@
<el-col :span="18"> <el-col :span="18">
<el-form-item :prop="form.VILLAGE_ID" label="所属小区"> <el-form-item :prop="form.VILLAGE_ID" label="所属小区">
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.VILLAGE_ID" :disabled="disabled" placeholder="请选择小区" size="small" <el-select v-model.trim="form.VILLAGE_ID" :disabled="disabled" placeholder="请选择小区" size="small"
clearable class="resi-cell-select" clearable class="resi-cell-select"
> >
<el-option <el-option
@ -45,7 +45,7 @@
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small" <el-select v-model.trim="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select" @change="handleChangeB" clearable class="resi-cell-select" @change="handleChangeB"
> >
<el-option <el-option
@ -55,7 +55,7 @@
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.UNIT_ID" :disabled="disabled" placeholder="请选择单元" size="small" <el-select v-model.trim="form.UNIT_ID" :disabled="disabled" placeholder="请选择单元" size="small"
clearable class="resi-cell-select" @change="handleChangeD" clearable class="resi-cell-select" @change="handleChangeD"
> >
<el-option <el-option
@ -65,7 +65,7 @@
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.HOME_ID" :disabled="disabled" placeholder="请选择房号" size="small" <el-select v-model.trim="form.HOME_ID" :disabled="disabled" placeholder="请选择房号" size="small"
clearable class="resi-cell-select" clearable class="resi-cell-select"
> >
<el-option <el-option
@ -81,7 +81,7 @@
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<el-form-item :prop="form.BUILD_ID" label="所属楼宇"> <el-form-item :prop="form.BUILD_ID" label="所属楼宇">
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small" <el-select v-model.trim="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select" clearable class="resi-cell-select"
> >
<el-option <el-option
@ -97,7 +97,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item :prop="form.HOME_ID" label="所属家庭"> <el-form-item :prop="form.HOME_ID" label="所属家庭">
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.HOME_ID" :disabled="disabled" placeholder="请选择" size="small" <el-select v-model.trim="form.HOME_ID" :disabled="disabled" placeholder="请选择" size="small"
clearable class="resi-cell-select" clearable class="resi-cell-select"
> >
<el-option <el-option
@ -122,7 +122,7 @@
<template v-if="n.itemType === 'input' || n.itemType === 'textarea'"> <template v-if="n.itemType === 'input' || n.itemType === 'textarea'">
<el-input <el-input
v-if="n.validType" v-if="n.validType"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:disabled="disabled" :disabled="disabled"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
@ -132,7 +132,7 @@
</el-input> </el-input>
<el-input <el-input
v-else v-else
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:disabled="disabled" :disabled="disabled"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
@ -143,7 +143,7 @@
</template> </template>
<!-- <template v-if="n.itemType === 'textarea'"> <!-- <template v-if="n.itemType === 'textarea'">
<el-input <el-input
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-textarea" class="resi-cell-textarea"
size="small" size="small"
type="textarea" type="textarea"
@ -154,7 +154,7 @@
</template> --> </template> -->
<el-date-picker <el-date-picker
v-else-if="n.itemType === 'datepicker'" v-else-if="n.itemType === 'datepicker'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:disabled="disabled" :disabled="disabled"
class="resi-cell-input" class="resi-cell-input"
type="date" type="date"
@ -166,7 +166,7 @@
</el-date-picker> </el-date-picker>
<el-date-picker <el-date-picker
v-else-if="n.itemType === 'daterange'" v-else-if="n.itemType === 'daterange'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:disabled="disabled" :disabled="disabled"
type="daterange" type="daterange"
align="right" align="right"
@ -175,17 +175,18 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="pickerOptions"> :picker-options="pickerOptions"
>
</el-date-picker> </el-date-picker>
<el-time-picker <el-time-picker
v-else-if="n.itemType === 'timepicker'" v-else-if="n.itemType === 'timepicker'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:disabled="disabled" :disabled="disabled"
placeholder="任意时间点"> placeholder="任意时间点">
</el-time-picker> </el-time-picker>
<el-time-picker <el-time-picker
v-else-if="n.itemType === 'timerange'" v-else-if="n.itemType === 'timerange'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:disabled="disabled" :disabled="disabled"
is-range is-range
range-separator="至" range-separator="至"
@ -193,7 +194,7 @@
end-placeholder="结束时间" end-placeholder="结束时间"
placeholder="选择时间范围"> placeholder="选择时间范围">
</el-time-picker> </el-time-picker>
<el-select v-else-if="n.itemType === 'select'" v-model="form[n.columnName]" <el-select v-else-if="n.itemType === 'select'" v-model.trim="form[n.columnName]"
:multiple="n.multiSelect" :multiple="n.multiSelect"
:disabled="disabled" :disabled="disabled"
placeholder="请选择" size="small" clearable class="resi-cell-select"> placeholder="请选择" size="small" clearable class="resi-cell-select">
@ -210,7 +211,7 @@
clearable></el-cascader> --> clearable></el-cascader> -->
<el-cascader <el-cascader
v-else-if="n.itemType === 'cascader'" v-else-if="n.itemType === 'cascader'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:options="n.options" :options="n.options"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
:disabled="disabled" :disabled="disabled"
@ -219,14 +220,14 @@
class="resi-cell-select"> class="resi-cell-select">
</el-cascader> </el-cascader>
<template v-else-if="n.itemType === 'radio'"> <template v-else-if="n.itemType === 'radio'">
<el-radio v-for="ns in n.options" :key="ns.value" v-model="form[n.columnName]" :disabled="disabled" <el-radio v-for="ns in n.options" :key="ns.value" v-model.trim="form[n.columnName]" :disabled="disabled"
:label="ns.value"> :label="ns.value">
{{ ns.label }} {{ ns.label }}
</el-radio> </el-radio>
<!-- <el-radio v-model="form[n.columnName]" label="1">备选项</el-radio> --> <!-- <el-radio v-model.trim="form[n.columnName]" label="1">备选项</el-radio> -->
</template> </template>
<template v-else-if="n.itemType === 'checkbox'"> <template v-else-if="n.itemType === 'checkbox'">
<el-checkbox-group v-model="form[n.columnName]"> <el-checkbox-group v-model.trim="form[n.columnName]">
<el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value" :disabled="disabled">{{ns.label}}</el-checkbox> <el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value" :disabled="disabled">{{ns.label}}</el-checkbox>
<!-- <el-checkbox label="n.la"></el-checkbox> --> <!-- <el-checkbox label="n.la"></el-checkbox> -->
</el-checkbox-group> </el-checkbox-group>
@ -485,11 +486,25 @@ export default {
this.formList.forEach(async item => { this.formList.forEach(async item => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
await this.getOptionsLists(item.optionSourceValue).then(res => { await this.getOptionsLists(item.optionSourceValue).then(res => {
item.options = res item.options = this.getTreeData(res)
}) })
} }
}) })
}, },
getTreeData(data){
if (!Array.isArray(data)) return []
let arr = data.map(item => {
let _item = {}
if (item.children) {
if (item.children.length === 0) _item = { ...item, children: undefined }
else _item = { ...item, children: this.getTreeData(item.children)}
} else {
_item = { ...item }
}
return _item
})
return arr
},
handleOpenSearch () { handleOpenSearch () {
this.openSearch = !this.openSearch this.openSearch = !this.openSearch
}, },

44
src/views/components/resiForm.vue

@ -17,7 +17,7 @@
<!-- <div class="resi-cell"> --> <!-- <div class="resi-cell"> -->
<!-- <div class="resi-cell-label">{{n.label}}</div> --> <!-- <div class="resi-cell-label">{{n.label}}</div> -->
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.GRID_ID" placeholder="请选择网格" size="small" <el-select v-model.trim="form.GRID_ID" placeholder="请选择网格" size="small"
clearable class="resi-cell-select" @change="handleChangeGrid" clearable class="resi-cell-select" @change="handleChangeGrid"
> >
<el-option <el-option
@ -36,7 +36,7 @@
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-col :span="4"> <el-col :span="4">
<el-form-item prop="VILLAGE_ID"> <el-form-item prop="VILLAGE_ID">
<el-select v-model="form.VILLAGE_ID" placeholder="请选择小区" size="small" <el-select v-model.trim="form.VILLAGE_ID" placeholder="请选择小区" size="small"
clearable class="resi-cell-select" @change="handleChangeV" clearable class="resi-cell-select" @change="handleChangeV"
> >
<el-option <el-option
@ -50,7 +50,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item prop="BUILD_ID"> <el-form-item prop="BUILD_ID">
<el-select v-model="form.BUILD_ID" placeholder="请选择楼号" size="small" <el-select v-model.trim="form.BUILD_ID" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select" @change="handleChangeB" clearable class="resi-cell-select" @change="handleChangeB"
> >
<el-option <el-option
@ -64,7 +64,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item prop="UNIT_ID"> <el-form-item prop="UNIT_ID">
<el-select v-model="form.UNIT_ID" placeholder="请选择单元" size="small" <el-select v-model.trim="form.UNIT_ID" placeholder="请选择单元" size="small"
clearable class="resi-cell-select" @change="handleChangeD" clearable class="resi-cell-select" @change="handleChangeD"
> >
<el-option <el-option
@ -78,7 +78,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item prop="HOME_ID"> <el-form-item prop="HOME_ID">
<el-select v-model="form.HOME_ID" placeholder="请选择房号" size="small" <el-select v-model.trim="form.HOME_ID" placeholder="请选择房号" size="small"
clearable class="resi-cell-select" clearable class="resi-cell-select"
> >
<el-option <el-option
@ -96,7 +96,7 @@
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<el-form-item :prop="form.BUILD_ID" label="所属楼宇"> <el-form-item :prop="form.BUILD_ID" label="所属楼宇">
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.BUILD_ID" placeholder="请选择楼号" size="small" <el-select v-model.trim="form.BUILD_ID" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select" @change="handleChangeB" clearable class="resi-cell-select" @change="handleChangeB"
> >
<el-option <el-option
@ -112,7 +112,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item :prop="form.HOME_ID" label="所属家庭"> <el-form-item :prop="form.HOME_ID" label="所属家庭">
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.HOME_ID" placeholder="请选择" size="small" <el-select v-model.trim="form.HOME_ID" placeholder="请选择" size="small"
clearable class="resi-cell-select resi-cell-select-small" clearable class="resi-cell-select resi-cell-select-small"
> >
<el-option <el-option
@ -122,7 +122,7 @@
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.HOME_ID" placeholder="请选择" size="small" <el-select v-model.trim="form.HOME_ID" placeholder="请选择" size="small"
clearable class="resi-cell-select-small" clearable class="resi-cell-select-small"
> >
<el-option <el-option
@ -147,7 +147,7 @@
<template v-if="n.itemType === 'input' || n.itemType === 'textarea'"> <template v-if="n.itemType === 'input' || n.itemType === 'textarea'">
<el-input <el-input
v-if="n.validType" v-if="n.validType"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
clearable clearable
@ -156,7 +156,7 @@
</el-input> </el-input>
<el-input <el-input
v-else v-else
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
clearable clearable
@ -166,7 +166,7 @@
</template> </template>
<!-- <template v-if="n.itemType === 'textarea'"> <!-- <template v-if="n.itemType === 'textarea'">
<el-input <el-input
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-textarea" class="resi-cell-textarea"
size="small" size="small"
type="textarea" type="textarea"
@ -177,7 +177,7 @@
</template> --> </template> -->
<el-date-picker <el-date-picker
v-else-if="n.itemType === 'datepicker'" v-else-if="n.itemType === 'datepicker'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-input" class="resi-cell-input"
type="date" type="date"
size="small" size="small"
@ -188,23 +188,25 @@
</el-date-picker> </el-date-picker>
<el-date-picker <el-date-picker
v-else-if="n.itemType === 'daterange'" v-else-if="n.itemType === 'daterange'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
type="daterange" type="daterange"
align="right" align="right"
unlink-panels unlink-panels
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="pickerOptions"> value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
>
</el-date-picker> </el-date-picker>
<el-time-picker <el-time-picker
v-else-if="n.itemType === 'timepicker'" v-else-if="n.itemType === 'timepicker'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
placeholder="任意时间点"> placeholder="任意时间点">
</el-time-picker> </el-time-picker>
<el-time-picker <el-time-picker
v-else-if="n.itemType === 'timerange'" v-else-if="n.itemType === 'timerange'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
is-range is-range
class="resi-cell-range" class="resi-cell-range"
range-separator="至" range-separator="至"
@ -212,7 +214,7 @@
end-placeholder="结束时间" end-placeholder="结束时间"
placeholder="选择时间范围"> placeholder="选择时间范围">
</el-time-picker> </el-time-picker>
<el-select v-else-if="n.itemType === 'select'" v-model="form[n.columnName]" <el-select v-else-if="n.itemType === 'select'" v-model.trim="form[n.columnName]"
:multiple="n.multiSelect" :multiple="n.multiSelect"
placeholder="请选择" size="small" clearable class="resi-cell-select"> placeholder="请选择" size="small" clearable class="resi-cell-select">
<el-option <el-option
@ -228,7 +230,7 @@
clearable></el-cascader> --> clearable></el-cascader> -->
<el-cascader <el-cascader
v-else-if="n.itemType === 'cascader'" v-else-if="n.itemType === 'cascader'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:options="n.options" :options="n.options"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
clearable clearable
@ -236,14 +238,14 @@
class="resi-cell-select"> class="resi-cell-select">
</el-cascader> </el-cascader>
<template v-else-if="n.itemType === 'radio'"> <template v-else-if="n.itemType === 'radio'">
<el-radio v-for="ns in n.options" :key="ns.value" v-model="form[n.columnName]" <el-radio v-for="ns in n.options" :key="ns.value" v-model.trim="form[n.columnName]"
:label="ns.value"> :label="ns.value">
{{ ns.label }} {{ ns.label }}
</el-radio> </el-radio>
<!-- <el-radio v-model="form[n.columnName]" label="1">备选项</el-radio> --> <!-- <el-radio v-model.trim="form[n.columnName]" label="1">备选项</el-radio> -->
</template> </template>
<template v-else-if="n.itemType === 'checkbox'"> <template v-else-if="n.itemType === 'checkbox'">
<el-checkbox-group v-model="form[n.columnName]"> <el-checkbox-group v-model.trim="form[n.columnName]">
<el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value">{{ns.label}}</el-checkbox> <el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value">{{ns.label}}</el-checkbox>
<!-- <el-checkbox label="n.la"></el-checkbox> --> <!-- <el-checkbox label="n.la"></el-checkbox> -->
</el-checkbox-group> </el-checkbox-group>

313
src/views/components/resiSearch.vue

@ -7,13 +7,20 @@
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-label">所属网格</div> <div class="resi-cell-label">所属网格</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.GRID_ID" placeholder="请选择" size="small" clearable class="resi-cell-select" <el-select
@change="handleChangeGrid"> v-model.trim="form.GRID_ID"
placeholder="请选择"
size="small"
clearable
class="resi-cell-select"
@change="handleChangeGrid"
>
<el-option <el-option
v-for="item in optionsG" v-for="item in optionsG"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -23,116 +30,169 @@
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-label">所属小区</div> <div class="resi-cell-label">所属小区</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-select v-model="form.VILLAGE_ID" placeholder="请选择小区" size="small" <el-select
clearable class="resi-cell-select" v-model.trim="form.VILLAGE_ID"
@clear="handleClearVillage" @change="handleChangeV"> placeholder="请选择小区"
size="small"
clearable
class="resi-cell-select"
@clear="handleClearVillage"
@change="handleChangeV"
>
<el-option <el-option
v-for="item in optionsV" v-for="item in optionsV"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.BUILD_ID" placeholder="楼号" size="small" clearable <el-select
class="resi-cell-select" :disabled="changeVDisabled" @clear="handleClearBuild" @change="handleChangeB"> v-model.trim="form.BUILD_ID"
placeholder="楼号"
size="small"
clearable
class="resi-cell-select"
:disabled="changeVDisabled"
@clear="handleClearBuild"
@change="handleChangeB"
>
<el-option <el-option
v-for="item in optionsB" v-for="item in optionsB"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.UNIT_ID" :disabled="changeBDisabled" placeholder="单元" size="small" clearable class="resi-cell-select" @click="handleClearDan" @change="handleChangeD"> <!-- <el-select
v-model.trim="form.UNIT_ID"
:disabled="changeBDisabled"
placeholder="单元"
size="small"
clearable
class="resi-cell-select"
@click="handleClearDan"
@change="handleChangeD"
>
<el-option <el-option
v-for="item in optionsD" v-for="item in optionsD"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="form.HOME_ID" :disabled="changeDDisabled" placeholder="楼号" size="small" clearable class="resi-cell-select"> <el-select
v-model.trim="form.HOME_ID"
:disabled="changeDDisabled"
placeholder="楼号"
size="small"
clearable
class="resi-cell-select"
>
<el-option <el-option
v-for="item in optionsH" v-for="item in optionsH"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select> -->
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-for="(item, index) in sliceList(formList, 4)" :key="index" class="resi-row"> <el-row
v-for="(item, index) in sliceList(formList, 4)"
:key="index"
class="resi-row"
>
<el-col v-for="n in item" :key="n.id" :span="6"> <el-col v-for="n in item" :key="n.id" :span="6">
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-label">{{n.label}}</div> <div class="resi-cell-label">{{ n.label }}</div>
<div class="resi-cell-value" :class="n.itemType === 'radio' && 'resi-cell-value-radio'"> <div
class="resi-cell-value"
:class="n.itemType === 'radio' && 'resi-cell-value-radio'"
>
<el-input <el-input
v-if="n.itemType === 'input' || n.itemType === 'textarea'" v-if="n.itemType === 'input' || n.itemType === 'textarea'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
clearable clearable
placeholder="请输入内容" placeholder="请输入内容"
> >
</el-input> </el-input>
<template v-else-if="n.itemType === 'datepicker'"> <template v-else-if="n.itemType === 'datepicker'">
<el-date-picker <el-date-picker
v-if="n.queryType === 'daterange'" v-if="n.queryType === 'daterange'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
type="daterange" type="daterange"
align="right" align="right"
unlink-panels unlink-panels
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
class="resi-cell-input" class="resi-cell--daterange"
size="small" size="small"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions"> :picker-options="pickerOptions"
>
</el-date-picker> </el-date-picker>
<el-date-picker <el-date-picker
v-else v-else
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-input" class="resi-cell-input"
type="date" type="date"
size="small" size="small"
clearable clearable
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期"> placeholder="选择日期"
>
</el-date-picker> </el-date-picker>
</template> </template>
<el-select v-else-if="n.itemType === 'select' || n.itemType === 'radio'" v-model="form[n.columnName]" placeholder="请选择" size="small" clearable class="resi-cell-select"> <el-select
v-else-if="n.itemType === 'select' || n.itemType === 'radio'"
v-model.trim="form[n.columnName]"
placeholder="请选择"
size="small"
clearable
class="resi-cell-select"
>
<el-option <el-option
v-for="item in n.options" v-for="item in n.options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-cascader <el-cascader
v-else-if="n.itemType === 'cascader'" v-else-if="n.itemType === 'cascader'"
v-model="form[n.columnName]" v-model.trim="form[n.columnName]"
:options="n.options" :options="n.options"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
clearable clearable
size="small" size="small"
class="resi-cell-select"> class="resi-cell-select"
>
</el-cascader> </el-cascader>
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-row> </el-row>
<el-row class="resi-search"> <el-row class="resi-search">
<!-- <el-col :span="20"> <!-- <el-col :span="20">
<el-button type="primary" size="mini">查询</el-button> <el-button type="primary" size="mini">查询</el-button>
</el-col> --> </el-col> -->
<el-col :span="24"> <el-col :span="24">
<el-button type="primary" size="mini" @click="handleSearch">查询</el-button> <el-button type="primary" size="mini" @click="handleSearch"
>查询</el-button
>
</el-col> </el-col>
</el-row> </el-row>
<div class="resi-down" @click="handleOpenSearch"> <div class="resi-down" @click="handleOpenSearch">
@ -152,7 +212,7 @@ export default {
default: () => [] default: () => []
} }
}, },
data () { data() {
let initForm = (arr) => { let initForm = (arr) => {
let _form = {} let _form = {}
// console.log('formInfo', obj) // console.log('formInfo', obj)
@ -160,13 +220,13 @@ export default {
// _form = { ...obj } // _form = { ...obj }
// return _form // return _form
// } // }
arr.forEach(item => { arr.forEach((item) => {
_form[item.columnName] = '' _form[item.columnName] = ''
}) })
return _form return _form
} }
let form = initForm(this.formList) let form = initForm(this.formList)
let tempFormList = [ ...this.formList ] let tempFormList = [...this.formList]
let constForm = { let constForm = {
...form, ...form,
GRID_ID: '', GRID_ID: '',
@ -183,22 +243,6 @@ export default {
optionsH: [], optionsH: [],
optionsD: [], optionsD: [],
optionsG: [], optionsG: [],
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
value: '', value: '',
fixedList: [], fixedList: [],
fixedForm: { fixedForm: {
@ -218,38 +262,41 @@ export default {
HOME_ID: '' HOME_ID: ''
}, },
tempFormList, tempFormList,
checkList: ['选中且禁用', '复选框 A'],
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [
text: '最近一周', {
onClick (picker) { text: '最近一周',
const end = new Date() onClick(picker) {
const start = new Date() const end = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const start = new Date()
picker.$emit('pick', [start, end]) start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
} picker.$emit('pick', [start, end])
}, { }
text: '最近一个月', },
onClick (picker) { {
const end = new Date() text: '最近一个月',
const start = new Date() onClick(picker) {
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) const end = new Date()
picker.$emit('pick', [start, end]) const start = new Date()
} start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
}, { picker.$emit('pick', [start, end])
text: '最近三个月', }
onClick (picker) { },
const end = new Date() {
const start = new Date() text: '最近三个月',
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) onClick(picker) {
picker.$emit('pick', [start, end]) const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
}
} }
}] ]
} }
} }
}, },
computed: { computed: {
sliceList () { sliceList() {
return function (data, count) { return function (data, count) {
if (data !== undefined) { if (data !== undefined) {
let index = 0 let index = 0
@ -265,19 +312,19 @@ export default {
} }
} }
}, },
changeVDisabled () { changeVDisabled() {
return !this.form.VILLAGE_ID return !this.form.VILLAGE_ID
}, },
changeBDisabled () { changeBDisabled() {
return !this.form.BUILD_ID return !this.form.BUILD_ID
}, },
changeDDisabled () { changeDDisabled() {
return !this.form.UNIT_ID return !this.form.UNIT_ID
} }
}, },
watch: { watch: {
form: { form: {
handler (val, val2) { handler(val, val2) {
// console.log('valpppp----', val, val2) // console.log('valpppp----', val, val2)
for (let n in val) { for (let n in val) {
if (this.constForm[n] !== val[n]) { if (this.constForm[n] !== val[n]) {
@ -290,55 +337,64 @@ export default {
deep: true deep: true
} }
}, },
created () { created() {
// this.initForm() // this.initForm()
// console.log('formcccc---', this.form) // console.log('formcccc---', this.form)
this.getGridList() this.getGridList()
this.getValiheList()
}, },
methods: { methods: {
initForm () { initForm() {
this.formList.forEach(item => { this.formList.forEach((item) => {
this.$set(this.form, item.columnName, '') this.$set(this.form, item.columnName, '')
}) })
console.log('formcccc---', this.form) console.log('formcccc---', this.form)
}, },
handleClearVillage () { handleClearVillage() {
this.form.BUILD_ID = '' this.form.BUILD_ID = ''
this.form.HOME_ID = '' this.form.HOME_ID = ''
}, },
handleClearBuild () { handleClearBuild() {
this.form.BUILD_ID = '' this.form.BUILD_ID = ''
this.form.UNIT_ID = '' this.form.UNIT_ID = ''
this.form.HOME_ID = '' this.form.HOME_ID = ''
}, },
handleClearDan () { handleClearDan() {
this.form.UNIT_ID = '' this.form.UNIT_ID = ''
this.form.HOME_ID = '' this.form.HOME_ID = ''
}, },
handleSearch () { handleSearch() {
// console.log('formmmmm---', this.form) // console.log('formmmmm---', this.form)
const itemTypes = ['cascader', 'daterange', 'timerange'] const itemTypes = ['daterange', 'timerange']
let arr = this.tempFormList.filter(n => n.isChange).map(item => { let arr = this.tempFormList
return { .filter((n) => n.isChange)
queryType: item.queryType, .map((item) => {
tableName: item.tableName, return {
columnName: item.columnName, queryType: item.queryType,
// columnValue: [] tableName: item.tableName,
columnValue: (itemTypes.includes(item.queryType) || itemTypes.includes(item.itemType)) ? this.form[item.columnName] : [this.form[item.columnName]] columnName: item.columnName,
} // columnValue: []
}) columnValue:
let arr1 = this.fixedList.filter(n => n.columnValue.length > 0).map(item => { itemTypes.includes(item.queryType) ||
return { itemTypes.includes(item.itemType)
...item ? this.form[item.columnName]
} : [this.form[item.columnName].toString()]
}) }
let arr3 = [ ...arr1, ...arr ] })
let arr1 = this.fixedList
.filter((n) => n.columnValue.length > 0)
.map((item) => {
return {
...item
}
})
let arr3 = [...arr1, ...arr]
this.$emit('search', arr3) this.$emit('search', arr3)
}, },
handleOpenSearch () { handleOpenSearch() {
this.openSearch = !this.openSearch this.openSearch = !this.openSearch
}, },
handleChangeGrid (val) { handleChangeGrid(val) {
console.log('val', val) console.log('val', val)
this.form.VILLAGE_ID = '' this.form.VILLAGE_ID = ''
this.form.BUILD_ID = '' this.form.BUILD_ID = ''
@ -346,26 +402,26 @@ export default {
this.form.HOME_ID = '' this.form.HOME_ID = ''
this.getValiheList() this.getValiheList()
}, },
handleChangeV (val) { handleChangeV(val) {
console.log('val', val) console.log('val', val)
this.form.BUILD_ID = '' this.form.BUILD_ID = ''
this.form.UNIT_ID = '' this.form.UNIT_ID = ''
this.form.HOME_ID = '' this.form.HOME_ID = ''
this.getBuildList() this.getBuildList()
}, },
handleChangeB (val) { handleChangeB(val) {
console.log('val', val) console.log('val', val)
this.form.UNIT_ID = '' this.form.UNIT_ID = ''
this.form.HOME_ID = '' this.form.HOME_ID = ''
this.getUniList() this.getUniList()
}, },
handleChangeD (val) { handleChangeD(val) {
console.log('val', val) console.log('val', val)
this.form.HOME_ID = '' this.form.HOME_ID = ''
this.getHouseList() this.getHouseList()
}, },
// form // form
handleChangeForm (val) { handleChangeForm(val) {
for (let n in this.fixedForm) { for (let n in this.fixedForm) {
if (n === val) { if (n === val) {
if (this.fixedList.length > 0) { if (this.fixedList.length > 0) {
@ -395,11 +451,11 @@ export default {
} }
} }
console.log('fixedList----999', this.fixedList) console.log('fixedList----999', this.fixedList)
this.tempFormList.forEach(item => { this.tempFormList.forEach((item) => {
if (item.columnName === val) item.isChange = true if (item.columnName === val) item.isChange = true
}) })
}, },
getGridList () { getGridList() {
const { user } = this.$store.state const { user } = this.$store.state
this.$http this.$http
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId }) .post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId })
@ -415,10 +471,13 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getValiheList () { getValiheList() {
const { user } = this.$store.state const { user } = this.$store.state
this.$http this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', { gridId: this.form.GRID_ID, agencyId: user.agencyId }) .post('/gov/org/icneighborhood/neighborhoodoption', {
gridId: this.form.GRID_ID,
agencyId: user.agencyId
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -431,9 +490,11 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getBuildList () { getBuildList() {
this.$http this.$http
.post('/gov/org/icbuilding/buildingoption', { neighborHoodId: this.form.VILLAGE_ID }) .post('/gov/org/icbuilding/buildingoption', {
neighborHoodId: this.form.VILLAGE_ID
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -446,9 +507,11 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getUniList () { getUniList() {
this.$http this.$http
.post('/gov/org/icbuildingunit/unitoption', { buildingId: this.form.BUILD_ID }) .post('/gov/org/icbuildingunit/unitoption', {
buildingId: this.form.BUILD_ID
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -461,7 +524,7 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getHouseList () { getHouseList() {
this.$http this.$http
.post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID }) .post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID })
.then(({ data: res }) => { .then(({ data: res }) => {
@ -475,7 +538,7 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, }
} }
} }
</script> </script>
@ -497,7 +560,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
margin-left: -23rpx; margin-left: -23rpx;
cursor: pointer; cursor: pointer;
background: #FFFFFF; background: #ffffff;
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;
img { img {
display: block; display: block;
@ -506,11 +569,11 @@ export default {
.resi-row-box { .resi-row-box {
height: 104px; height: 104px;
overflow: hidden; overflow: hidden;
transition: height .5s; transition: height 0.5s;
} }
.resi-row-more { .resi-row-more {
height: max-content; height: max-content;
transition: height .5s; transition: height 0.5s;
} }
.resi-row { .resi-row {
margin-bottom: 20px; margin-bottom: 20px;
@ -525,6 +588,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
.resi-cell-label { .resi-cell-label {
flex-shrink: 0;
width: 70px; width: 70px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 15px; margin-right: 15px;
@ -539,6 +603,9 @@ export default {
.resi-cell-input { .resi-cell-input {
width: 180px; width: 180px;
} }
.resi-cell--daterange {
width: 100%;
}
.resi-cell-select { .resi-cell-select {
width: 180px; width: 180px;
box-sizing: border-box; box-sizing: border-box;

88
src/views/modules/base/community/buildForm.vue

@ -2,7 +2,8 @@
<div> <div>
<div> <div>
<el-form :inline="true" <el-form ref="ref_form"
:inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
@ -18,8 +19,7 @@
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_1" <el-input class="item_width_1"
maxlength="50" maxlength="10"
show-word-limit
placeholder="请输入楼栋名称" placeholder="请输入楼栋名称"
v-model="dataForm.buildingName"> v-model="dataForm.buildingName">
</el-input> </el-input>
@ -35,30 +35,38 @@
<el-radio :label="'3'">别墅</el-radio> <el-radio :label="'3'">别墅</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="排序" <!-- <el-form-item label="排序"
prop="sort" prop="sort"
style="display: block"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.sort" <el-input-number class="item_width_1"
v-model="dataForm.sort"
label="排序"></el-input-number> label="排序"></el-input-number>
</el-form-item> </el-form-item> -->
<el-form-item label="单元数" <el-form-item label="单元数"
style="display: block"
prop="totalUnitNum" prop="totalUnitNum"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.totalUnitNum" <el-input-number class="item_width_1"
v-model="dataForm.totalUnitNum"
:min="1" :min="1"
label="单元数"></el-input-number> label="单元数"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="层数" <el-form-item label="层数"
style="display: block"
prop="totalFloorNum" prop="totalFloorNum"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.totalFloorNum" <el-input-number class="item_width_1"
v-model="dataForm.totalFloorNum"
:min="1" :min="1"
label="层数"></el-input-number> label="层数"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="户数" <el-form-item label="户数"
style="display: block"
prop="totalHouseNum" prop="totalHouseNum"
label-width="150px"> label-width="150px">
<el-input-number v-model="dataForm.totalHouseNum" <el-input-number class="item_width_1"
v-model="dataForm.totalHouseNum"
:min="1" :min="1"
label="户数"></el-input-number> label="户数"></el-input-number>
</el-form-item> </el-form-item>
@ -67,7 +75,7 @@
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_3" <el-input class="item_width_4"
maxlength="50" maxlength="50"
placeholder="请输入关键字" placeholder="请输入关键字"
v-model="keyWords"> v-model="keyWords">
@ -100,6 +108,7 @@
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
</div> </div>
</div> </div>
@ -118,7 +127,7 @@ export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false,
buildingId: '', //ID buildingId: '', //ID
buildType: "1", buildType: "1",
dataForm: { dataForm: {
@ -127,7 +136,7 @@ export default {
gridId: '', //ID gridId: '', //ID
neighborHoodId: '',//id neighborHoodId: '',//id
buildingName: '',// buildingName: '',//
sort: 0,// // sort: 0,//
totalUnitNum: 0,// totalUnitNum: 0,//
totalFloorNum: 0,// totalFloorNum: 0,//
totalHouseNum: 0,// totalHouseNum: 0,//
@ -159,15 +168,32 @@ export default {
this.formType = type this.formType = type
if (row) { if (row) {
this.buildingId = row.buildingId this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm = row this.buildingId = this.dataForm.buildingId
this.buildType = row.buildingTypeKey this.buildType = this.dataForm.buildingTypeKey
} }
console.log(row)
}, },
async handleComfirm () { async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.dataForm.type = this.buildType
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
this.btnDisable = false
app.util.validateRule(messageObj)
} else {
this.addBuild()
}
})
},
async addBuild () {
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
url = '/gov/org/building/buildingadd' url = '/gov/org/building/buildingadd'
@ -176,7 +202,6 @@ export default {
this.dataForm.buildingId = this.buildingId this.dataForm.buildingId = this.buildingId
} }
this.dataForm.type = this.buildType
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm)
@ -186,8 +211,11 @@ export default {
message: '操作成功' message: '操作成功'
}) })
this.resetData() this.resetData()
this.btnDisable = false
this.$emit('dialogOk') this.$emit('dialogOk')
} else { } else {
this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)
} }
@ -277,18 +305,20 @@ export default {
this.setMarker(lat, lng) this.setMarker(lat, lng)
}, },
resetData () { resetData () {
this.keyWords = ''
this.buildingId = '' //ID this.buildingId = '' //ID
this.buildType = '1'
this.dataForm = { this.dataForm = {
agencyId: '', // ID agencyId: '', // ID
agencyName: '', agencyName: '',
gridId: '', //ID gridId: '', //ID
neighborHoodId: '',//id neighborHoodId: '',//id
buildingName: '',// buildingName: '',//
sort: 0,// // sort: 0,//
totalUnitNum: 0,// totalUnitNum: 0,//
totalFloorNum: 0,// totalFloorNum: 0,//
totalHouseNum: 0,// totalHouseNum: 0,//
type: '1',// type: '',//
location: '', // location: '', //
longitude: '', // longitude: '', //
latitude: '' // latitude: '' //
@ -322,16 +352,21 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
agencyId: [ type: [
{ required: true, message: '所属组织不能为空', trigger: 'blur' } { required: true, message: '楼栋类型不能为空', trigger: 'blur' }
], ],
gridId: [ totalUnitNum: [
{ required: true, message: '所属网格不能为空', trigger: 'blur' } { required: true, message: '单元数不能为空', trigger: 'blur' }
],
totalFloorNum: [
{ required: true, message: '层数不能为空', trigger: 'blur' }
],
totalHouseNum: [
{ required: true, message: '户数不能为空', trigger: 'blur' }
], ],
longitude: [ longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' } { required: true, message: '坐标不能为空', trigger: 'blur' }
] ],
} }
}, },
@ -350,6 +385,9 @@ export default {
margin-left: 10px; margin-left: 10px;
width: 200px; width: 200px;
} }
.item_width_4 {
width: 200px;
}
.div_map { .div_map {
margin-top: 10px; margin-top: 10px;

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

@ -54,25 +54,27 @@
:http-request="uploadFile"> :http-request="uploadFile">
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
size="small" size="small"
type="red">导入小区数据</el-button> type="red">导入楼宇数据</el-button>
</el-upload> </el-upload>
</div> </div>
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table :data="tableData"
border border
:height="tableHeight"
v-loading="tableLoading"
style="width: 100%"> style="width: 100%">
<el-table-column prop="buildingName" <el-table-column prop="buildingName"
label="楼栋名称" label="楼栋名称"
width="180"> min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="neighborHoodName" <el-table-column prop="neighborHoodName"
label="所属小区" label="所属小区"
width="160"> min-width="160">
</el-table-column> </el-table-column>
<el-table-column prop="buildingType" <el-table-column prop="buildingType"
label="楼栋类型" label="楼栋类型"
width="140"> min-width="140">
</el-table-column> </el-table-column>
<el-table-column prop="totalUnitNum" <el-table-column prop="totalUnitNum"
label="单元数"> label="单元数">
@ -86,12 +88,15 @@
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="140" width="170"
header-align="center" header-align="center"
align="center" align="center"
class="operate"> class="operate">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text"
style="color:#feb349;text-decoration: underline;"
size="small"
@click="handleToNextLevel(scope.row)">进入</el-button>
<el-button type="text" <el-button type="text"
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@ -112,9 +117,9 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 30, 50]" :page-sizes="[10, 20, 50]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
@ -150,8 +155,9 @@ export default {
return { return {
loading: false, loading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: true,
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -171,9 +177,12 @@ export default {
console.log('building11111111111111111111111111') console.log('building11111111111111111111111111')
}, },
computed: { computed: {
rowHeight () { tableHeight () {
return (this.clientHeight - 200) + 'px'
return (this.clientHeight - 220)
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight'])
}, },
methods: { methods: {
@ -183,6 +192,7 @@ export default {
}, },
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
} }
@ -204,9 +214,11 @@ export default {
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
this.tableLoading = false
}, },
diaClose () { diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false this.formShow = false
}, },
@ -233,6 +245,9 @@ export default {
this.$refs.ref_form.initForm('edit', row, this.agencyObj) this.$refs.ref_form.initForm('edit', row, this.agencyObj)
}) })
}, },
handleToNextLevel (row) {
this.$emit('toNextLevel', row, 'building')
},
addFormCancle () { addFormCancle () {
this.formShow = false this.formShow = false
@ -398,6 +413,10 @@ export default {
const { data, code, msg } = await requestPost(url, fileFormData) const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) { if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -445,26 +464,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.el-button--green { @import "@/assets/scss/buttonstyle.scss";
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search { .div_search {
display: flex; display: flex;

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

@ -1,53 +1,45 @@
<template> <template>
<div> <div class="div_main">
<el-row class="row" <div :style="{height:rowHeight}"
:gutter="10"> class="div_tree">
<el-col :span="5"> <el-input placeholder="输入关键字进行过滤"
<el-card> v-model="filterText">
</el-input>
<div :style="{height:rowHeight}" <el-scrollbar :style="{height:treeHeight}"
class="div_tree"> class="scrollar">
<el-input placeholder="输入关键字进行过滤" <el-tree ref="ref_tree"
v-model="filterText"> v-loading="treeLoading"
</el-input> class="filter_tree"
:data="treeData"
<el-tree ref="ref_tree" :props="defaultProps"
class="filter-tree" :highlight-current="true"
:data="treeData" node-key="id"
:props="defaultProps" :expand-on-click-node="false"
:highlight-current="true" default-expand-all
node-key="id" :filter-node-method="filterNode"
:expand-on-click-node="false" @node-click="handleNodeClick">
default-expand-all </el-tree>
:filter-node-method="filterNode" </el-scrollbar>
@node-click="handleNodeClick">
</el-tree> </div>
</div> <div :style="{height:rowHeight}"
class="div_table">
</el-card>
</el-col> <build-table v-if="selTreeObj.level==='neighbourHood'"
ref="ref_neighTable"
<el-col :span="19"> @toNextLevel="toNextLevel"
<el-card> @refreshTree="refreshTree"></build-table>
<div :style="{height:rowHeight}"> <room-table v-else-if="selTreeObj.level==='building'"
ref="ref_buildingTable"
<build-table v-if="selTreeObj.level==='neighbourHood'" @refreshTree="refreshTree"></room-table>
ref="ref_neighTable" <community-table v-else
@refreshTree="refreshTree"></build-table> @toNextLevel="toNextLevel"
<room-table v-else-if="selTreeObj.level==='building'" ref="ref_communityTable"
ref="ref_buildingTable" @refreshTree="refreshTree"></community-table>
@refreshTree="refreshTree"></room-table>
<community-table v-else </div>
ref="ref_communityTable"
@refreshTree="refreshTree"></community-table>
</div>
</el-card>
</el-col>
</el-row>
</div> </div>
</template> </template>
@ -66,6 +58,7 @@ export default {
data () { data () {
return { return {
filterText: '', filterText: '',
treeLoading: true,
treeData: [], treeData: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -82,6 +75,7 @@ export default {
CDialog CDialog
}, },
async mounted () { async mounted () {
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)
@ -91,11 +85,15 @@ export default {
this.$refs.ref_tree.setCurrentKey(this.treeData[0].id); this.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
}); });
} }
this.treeLoading = false
}, },
computed: { computed: {
rowHeight () { rowHeight () {
return (this.clientHeight - 180) + 'px' return (this.clientHeight - 140) + 'px'
},
treeHeight () {
return (this.clientHeight - 200) + 'px'
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight'])
}, },
@ -147,7 +145,6 @@ export default {
}, },
handleNodeClick (obj) { handleNodeClick (obj) {
this.getTreeObj(obj) this.getTreeObj(obj)
this.$nextTick(() => { this.$nextTick(() => {
@ -166,12 +163,30 @@ export default {
// //
async refreshTree () { async refreshTree () {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id) await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => { this.$nextTick(() => {
// ref_tree ref value node-key // ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id); this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
}); });
this.treeLoading = false
},
//
toNextLevel (row, level) {
if (level === 'community') {
this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId).data
} else {
this.selTreeObj = this.$refs.ref_tree.getNode(row.buildingId).data
}
this.handleNodeClick(this.selTreeObj)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
}, },
// //
@ -241,8 +256,30 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.div_main {
display: flex;
}
.scrollar {
margin-top: 10px;
}
.div_tree { .div_tree {
overflow-y: auto; flex: 0 0 400px;
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
overflow-y: hidden;
}
.filter_tree {
overflow-x: auto;
}
.div_table {
margin-left: 15px;
width: calc(100vw - 680px);
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
} }
.div_btn { .div_btn {
@ -258,4 +295,11 @@ export default {
.aui-content > .el-tabs > .el-tabs__content { .aui-content > .el-tabs > .el-tabs__content {
padding: 0px; padding: 0px;
} }
.el-scrollbar__wrap {
overflow-x: hidden !important;
}
.el-tree-node:focus > .el-tree-node__content {
/* background-color: #ccc !important; */
color: #2195fe;
}
</style> </style>

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

@ -2,7 +2,8 @@
<div> <div>
<div> <div>
<div v-show="!propertyFormShow"> <div v-show="!propertyFormShow">
<el-form :inline="true" <el-form ref="ref_form"
:inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
@ -47,6 +48,7 @@
<el-select class="item_width_2" <el-select class="item_width_2"
v-model="dataForm.propertyId" v-model="dataForm.propertyId"
placeholder="请选择" placeholder="请选择"
filterable
clearable> clearable>
<el-option v-for="item in propertyList" <el-option v-for="item in propertyList"
:key="item.propertyId" :key="item.propertyId"
@ -87,7 +89,7 @@
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_3" <el-input class="item_width_4"
maxlength="50" maxlength="50"
placeholder="请输入关键字" placeholder="请输入关键字"
v-model="keyWords"> v-model="keyWords">
@ -126,8 +128,7 @@
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_1" <el-input class="item_width_1"
maxlength="50" maxlength="10"
show-word-limit
placeholder="请输入小区名称" placeholder="请输入小区名称"
v-model="propertyForm.name"> v-model="propertyForm.name">
</el-input> </el-input>
@ -139,6 +140,7 @@
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
</div> </div>
</div> </div>
@ -160,6 +162,7 @@ export default {
gridList: [], gridList: [],
propertyList: [], propertyList: [],
btnDisable: false,
neighborHoodId: '', //ID neighborHoodId: '', //ID
dataForm: { dataForm: {
@ -277,10 +280,11 @@ export default {
this.formType = type this.formType = type
if (row) { if (row) {
this.neighborHoodId = row.neighborHoodId
this.dataForm = row this.dataForm = JSON.parse(JSON.stringify(row))
this.neighborHoodId = this.dataForm.neighborHoodId
} }
console.log(row)
await this.loadAgency() await this.loadAgency()
await this.loadGrid() await this.loadGrid()
@ -333,19 +337,35 @@ export default {
}, },
handleAddProperty () { handleAddProperty () {
this.propertyForm.name = '' this.propertyForm.name = ''
this.propertyFormShow = true this.propertyFormShow = true
}, },
async handleComfirm () { async handleComfirm () {
if (this.propertyFormShow) { if (this.propertyFormShow) {
this.addProperty() this.addProperty()
} else { } else {
this.addCommunity() this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addCommunity()
}
})
} }
}, },
async addCommunity () { async addCommunity () {
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
url = '/gov/org/neighborhood/neighborhoodadd' url = '/gov/org/neighborhood/neighborhoodadd'
@ -365,11 +385,21 @@ export default {
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
this.btnDisable = false
} else { } else {
this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)
} }
}, },
async addProperty () { async addProperty () {
if (!this.propertyForm.name || this.propertyForm.name === '') {
this.$message({
type: 'error',
message: '物业名称不能为空'
})
return false
}
const url = '/gov/org/propertymanagement/add' const url = '/gov/org/propertymanagement/add'
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add" // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add"
let params = { let params = {
@ -381,8 +411,9 @@ export default {
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加物业成功' message: '操作成功'
}) })
this.dataForm.propertyId = data.propertyId
this.propertyForm.name = '' this.propertyForm.name = ''
this.propertyFormShow = false this.propertyFormShow = false
this.loadProperty() this.loadProperty()
@ -400,6 +431,7 @@ export default {
} }
}, },
resetData () { resetData () {
this.keyWords = ''
this.neighborHoodId = '' //ID this.neighborHoodId = '' //ID
this.dataForm = { this.dataForm = {
neighborHoodName: '', // 50 neighborHoodName: '', // 50
@ -477,6 +509,9 @@ export default {
margin-left: 10px; margin-left: 10px;
width: 200px; width: 200px;
} }
.item_width_4 {
width: 200px;
}
.div_map { .div_map {
margin-top: 10px; margin-top: 10px;

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

@ -63,6 +63,8 @@
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table :data="tableData"
border border
:height="tableHeight"
v-loading="tableLoading"
style="width: 100%"> style="width: 100%">
<el-table-column prop="neighborHoodName" <el-table-column prop="neighborHoodName"
label="小区名称" label="小区名称"
@ -84,16 +86,16 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="140" width="170"
header-align="center" header-align="center"
align="center" align="center"
class="operate"> class="operate">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text" <el-button type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#feb349;text-decoration: underline;"
size="small" size="small"
@click="handleToBuild(scope.row)">进入</el-button> --> @click="handleToNextLevel(scope.row)">进入</el-button>
<el-button type="text" <el-button type="text"
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@ -114,9 +116,9 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 30, 50]" :page-sizes="[10, 20, 50]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
@ -152,8 +154,9 @@ export default {
return { return {
loading: false, loading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: true,
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -177,6 +180,11 @@ export default {
}, },
computed: { computed: {
tableHeight () {
return (this.clientHeight - 320)
},
rowHeight () { rowHeight () {
return (this.clientHeight - 200) + 'px' return (this.clientHeight - 200) + 'px'
}, },
@ -188,6 +196,7 @@ export default {
this.loadTable() this.loadTable()
}, },
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
} }
@ -211,9 +220,11 @@ export default {
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
this.tableLoading = false
}, },
diaClose () { diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false this.formShow = false
}, },
@ -241,6 +252,10 @@ export default {
}) })
}, },
handleToNextLevel (row) {
this.$emit('toNextLevel', row, 'community')
},
addFormCancle () { addFormCancle () {
this.formShow = false this.formShow = false
}, },
@ -400,13 +415,13 @@ export default {
var url = '/gov/org/neighborhood/import' var url = '/gov/org/neighborhood/import'
let fileFormData = new FormData(); let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip fileFormData.append('file', this.files);//filenamefiletest.zip
// let params = {
// file: this.files
// }
const { data, code, msg } = await requestPost(url, fileFormData) const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) { if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -453,26 +468,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.el-button--green { @import "@/assets/scss/buttonstyle.scss";
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search { .div_search {
display: flex; display: flex;

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

@ -1,7 +1,8 @@
<template> <template>
<div> <div>
<div> <div>
<el-form :inline="false" <el-form ref="ref_form"
:inline="false"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
@ -103,7 +104,6 @@
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_1" <el-input class="item_width_1"
type='number'
placeholder="请输入房主身份证" placeholder="请输入房主身份证"
v-model="dataForm.ownerIdCard"> v-model="dataForm.ownerIdCard">
</el-input> </el-input>
@ -115,6 +115,7 @@
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
</div> </div>
</div> </div>
@ -130,13 +131,13 @@ export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false,
unitList: [], unitList: [],
houseId: '', //ID houseId: '', //ID
houseType: '1', houseType: '1',
purpose: '1', purpose: '1',
rentFlag: false, rentFlag: 0,
dataForm: { dataForm: {
neighborHoodId: '', // ID neighborHoodId: '', // ID
buildingId: '',//ID buildingId: '',//ID
@ -169,20 +170,20 @@ export default {
this.formType = type this.formType = type
if (row) { if (row) {
this.houseId = row.houseId this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm = row this.houseId = this.dataForm.houseId
this.dataForm.buildingUnitId = row.unitNumKey this.dataForm.buildingUnitId = this.dataForm.unitNumKey
this.houseType = row.houseTypeKey this.houseType = this.dataForm.houseTypeKey
this.purpose = row.purposeKey this.purpose = this.dataForm.purposeKey
if (row.rentFlagKey) { if (this.dataForm.rentFlagKey) {
this.rentFlag = 1 this.rentFlag = 1
} else { } else {
this.rentFlag = 0 this.rentFlag = 0
} }
} }
console.log(row)
await this.loadUnitList() await this.loadUnitList()
@ -206,6 +207,45 @@ export default {
}, },
async handleComfirm () { async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.dataForm.houseType = this.houseType
this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
this.btnDisable = false
app.util.validateRule(messageObj)
} else {
this.addRoom()
}
})
},
async addRoom () {
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X
if (regCard.test(this.dataForm.ownerIdCard) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的身份证号码'
})
return false;
}
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (regPhone.test(this.dataForm.ownerPhone) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的手机号码'
})
return false;
}
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
@ -215,12 +255,8 @@ export default {
this.dataForm.houseId = this.houseId this.dataForm.houseId = this.houseId
} }
this.dataForm.houseType = this.houseType
this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm)
this.btnDisable = false
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
@ -228,7 +264,9 @@ export default {
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -242,14 +280,17 @@ export default {
resetData () { resetData () {
this.houseId = '' //ID this.houseId = '' //ID
this.houseType = '1'
this.purpose = '1'
this.rentFlag = 0
this.dataForm = { this.dataForm = {
neighborHoodId: '', // ID neighborHoodId: '', // ID
buildingId: '',//ID buildingId: '',//ID
buildingUnitId: 0,//ID buildingUnitId: '',//ID
doorName: 0,// doorName: '',//
houseType: '1',// houseType: '1',//
purpose: '1',// purpose: '1',//
rentFlag: '1',//10 rentFlag: 0,//10
ownerPhone: '', // ownerPhone: '', //
ownerName: '', // ownerName: '', //
ownerIdCard: '' // ownerIdCard: '' //
@ -277,14 +318,12 @@ export default {
buildingUnitId: [ buildingUnitId: [
{ required: true, message: '所属单元不能为空', trigger: 'blur' }, { required: true, message: '所属单元不能为空', trigger: 'blur' },
], ],
doorName: [ doorName: [
{ required: true, message: '门牌号不能为空', trigger: 'blur' } { required: true, message: '门牌号不能为空', trigger: 'blur' }
], ],
houseType: [ houseType: [
{ required: true, message: '房屋类型不能为空', trigger: 'blur' } { required: true, message: '房屋类型不能为空', trigger: 'blur' }
], ],
purpose: [ purpose: [
{ required: true, message: '房屋用途不能为空', trigger: 'blur' } { required: true, message: '房屋用途不能为空', trigger: 'blur' }
], ],

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

@ -54,12 +54,13 @@
:http-request="uploadFile"> :http-request="uploadFile">
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
size="small" size="small"
type="red">导入小区数据</el-button> type="red">导入房屋数据</el-button>
</el-upload> </el-upload>
</div> </div>
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table :data="tableData"
v-loading="tableLoading"
border border
style="width: 100%"> style="width: 100%">
<el-table-column prop="houseName" <el-table-column prop="houseName"
@ -80,10 +81,10 @@
label="门牌号"> label="门牌号">
</el-table-column> </el-table-column>
<el-table-column prop="houseType" <el-table-column prop="houseType"
label="房屋类型"> label="类型">
</el-table-column> </el-table-column>
<el-table-column prop="purpose" <el-table-column prop="purpose"
label="房屋用途"> label="用途">
</el-table-column> </el-table-column>
<el-table-column prop="rentFlag" <el-table-column prop="rentFlag"
label="是否出租"> label="是否出租">
@ -92,10 +93,12 @@
label="房主姓名"> label="房主姓名">
</el-table-column> </el-table-column>
<el-table-column prop="ownerPhone" <el-table-column prop="ownerPhone"
label="房主电话"> label="房主电话"
width="110">
</el-table-column> </el-table-column>
<el-table-column prop="ownerIdCard" <el-table-column prop="ownerIdCard"
label="身份证"> label="身份证"
width="160">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
@ -125,9 +128,9 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 30, 50]" :page-sizes="[10, 20, 50]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
@ -162,9 +165,9 @@ export default {
return { return {
loading: false, loading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: true,
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -198,6 +201,7 @@ export default {
}, },
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
} }
@ -219,9 +223,11 @@ export default {
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
this.tableLoading = false
}, },
diaClose () { diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false this.formShow = false
}, },
@ -411,7 +417,10 @@ export default {
const { data, code, msg } = await requestPost(url, fileFormData) const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) { if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -458,26 +467,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.el-button--green { @import "@/assets/scss/buttonstyle.scss";
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search { .div_search {
display: flex; display: flex;

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

@ -1,24 +1,41 @@
<template> <template>
<div v-if="pageLoading"> <div v-if="pageLoading">
<resi-search v-if="searchList.length > 0" ref="resiSearch" :form-list="searchList" @search="handleSearch" /> <resi-search
v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList"
@search="handleSearch"
/>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button type="success" size="small" @click="handleAdd">新增</el-button> <el-button type="success" size="small" @click="handleAdd">新增</el-button>
<el-button type="warning" size="small" @click="handleExport">导出</el-button> <el-button type="warning" size="small" @click="handleExport">导出</el-button>
<!-- <el-button type="primary" size="small">下载人口模板</el-button> --> <!-- <el-button type="primary" size="small">下载人口模板</el-button> -->
<!-- <el-button type="danger" size="small">导入人口数据</el-button> --> <el-upload
ref="upload"
class="upload-demo"
action="uploadUlr"
:limit="1"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
:on-progress="handleProgress"
:on-success="handleExcelSuccess"
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest"
>
<el-button type="danger" size="small" :loading="importLoading">{{importBtnTitle}}</el-button>
</el-upload>
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
v-loading="tableLoading" v-loading="tableLoading"
border border
style="width: 100%" style="width: 100%"
class="resi-table"> class="resi-table"
<el-table-column >
type="index" <el-table-column type="index" align="center" width="50">
align="center"
width="50">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-for="item in tableHeader" v-for="item in tableHeader"
@ -26,28 +43,64 @@
:prop="item.columnName" :prop="item.columnName"
:label="item.label" :label="item.label"
align="center" align="center"
:width="item.itemType === 'radio' ? 80 : 180"> :width="item.itemType === 'radio' ? 80 : 180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item)}}</span> <span>{{ handleFilterSpan(scope.row, item) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column fixed="right" label="操作" align="center" width="120">
fixed="right"
label="操作"
align="center"
width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleLook(scope.row)" type="text" size="small" class="btn-color-look">查看</el-button> <el-button
@click="handleLook(scope.row)"
type="text"
size="small"
class="btn-color-look"
>查看</el-button
>
<template v-if="filterEdit(scope.row.ORG_ID)"> <template v-if="filterEdit(scope.row.ORG_ID)">
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">编辑</el-button> <el-button
@click="handleEdit(scope.row)"
type="text"
size="small"
class="btn-color-edit"
>编辑</el-button
>
<!-- <el-popover placement="top" width="160" trigger="manual">
<p>删除之后无法回复确认删除</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="rowVisible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="handleDel(scope.row)"
>确定</el-button
>
</div>
<el-button
slot="reference"
type="text"
size="small"
class="btn-color-del"
@click="rowVisible = true"
>删除</el-button
>
</el-popover> -->
<el-popconfirm <el-popconfirm
title="删除之后无法回复,确认删除?" title="删除之后无法回复,确认删除?"
@onConfirm="handleDel(scope.row)" @confirm="handleDel(scope.row)"
> >
<el-button slot="reference" type="text" size="small" class="btn-color-del">删除</el-button> <el-button
slot="reference"
type="text"
size="small"
class="btn-color-del"
>删除</el-button
>
</el-popconfirm> </el-popconfirm>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -59,63 +112,112 @@
:page-sizes="[20, 50, 100, 200]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next"
:total="total"> :total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<el-dialog <el-dialog
title="新增" :title="formName"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="80%" width="80%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handlerCancle"> :before-close="handlerCancle"
<resi-form v-if="dialogVisible" ref="baseForm" :fixed="true" :form-list="formList" @changegroup="handleChangeGroup" /> >
<div v-if="dialogVisible" class="resi-other"> <resi-form
v-if="dialogVisible"
ref="baseForm"
:fixed="true"
:form-list="formList"
@changegroup="handleChangeGroup"
/>
<div v-if="dialogVisible" class="resi-other">
<div class="resi-other-title">其他</div> <div class="resi-other-title">其他</div>
<div class="tabs-other-info"> <div class="tabs-other-info">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabsList" :key="item.columnName" <el-tab-pane
:label="item.label" :name="'group' + item.groupId"> v-for="item in tabsList"
<resi-form :ref="'group' + item.groupId" :columns="3" :support-add="item.supportAdd" :key="item.columnName"
:form-id="item.columnName" :form-list=" item.itemList" /> :label="item.label"
:name="'group' + item.groupId"
>
<resi-form
:ref="'group' + item.groupId"
:columns="3"
:support-add="item.supportAdd"
:form-id="item.columnName"
:form-list="item.itemList"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
<div class="resi-btns"> <div class="resi-btns">
<el-button size="small" @click="handlerCancle">取消</el-button> <el-button size="small" @click="handlerCancle">取消</el-button>
<el-button type="primary" size="small" :loading="btnLoading" @click="handleSUbmit">提交</el-button> <el-button
type="primary"
size="small"
:loading="btnLoading"
@click="handleSUbmit"
>提交</el-button
>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="编辑" :title="formName"
:visible.sync="dialogEditVisible" :visible.sync="dialogEditVisible"
width="80%" width="80%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handlerEditCancle"> :before-close="handlerEditCancle"
<edit-resi v-if="dialogEditVisible" ref="baseForm" :disabled="disabled" :form-info="editForm" :fixed="true" :form-list="formList" @changegroup="handleChangeGroup" /> >
<div v-if="dialogEditVisible" class="resi-other"> <edit-resi
v-if="dialogEditVisible"
ref="baseForm"
:disabled="disabled"
:form-info="editForm"
:fixed="true"
:form-list="formList"
@changegroup="handleChangeGroup"
/>
<div v-if="dialogEditVisible" class="resi-other">
<div class="resi-other-title">其他</div> <div class="resi-other-title">其他</div>
<div class="tabs-other-info"> <div class="tabs-other-info">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabsList" :key="item.columnName" <el-tab-pane
:label="item.label" :name="'group' + item.groupId"> v-for="item in tabsList"
<edit-resi :ref="'group' + item.groupId" :columns="3" :support-add="item.supportAdd" :key="item.columnName"
:form-id="item.columnName" :muti-list="item.mutiList" :form-list=" item.itemList" :disabled="disabled" /> :label="item.label"
:name="'group' + item.groupId"
>
<edit-resi
:ref="'group' + item.groupId"
:columns="3"
:support-add="item.supportAdd"
:form-id="item.columnName"
:muti-list="item.mutiList"
:form-list="item.itemList"
:disabled="disabled"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
<div class="resi-btns"> <div class="resi-btns">
<el-button size="small" @click="handlerEditCancle">取消</el-button> <el-button size="small" @click="handlerEditCancle">取消</el-button>
<el-button v-if="!disabled" type="primary" size="small" :loading="btnLoading" @click="handleEditSUbmit">提交</el-button> <el-button
v-if="!disabled"
type="primary"
size="small"
:loading="btnLoading"
@click="handleEditSUbmit"
>提交</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -123,20 +225,25 @@
import resiSearch from '../../components/resiSearch.vue' import resiSearch from '../../components/resiSearch.vue'
import resiForm from '../../components/resiForm.vue' import resiForm from '../../components/resiForm.vue'
import editResi from '../../components/editResi.vue' import editResi from '../../components/editResi.vue'
import axios from 'axios'
export default { export default {
components: { components: {
resiSearch, resiSearch,
resiForm, resiForm,
editResi editResi
}, },
data () { data() {
return { return {
importBtnTitle: '导入人员数据',
importLoading: false,
rowVisible: false,
tableLoading: false, tableLoading: false,
btnLoading: false, btnLoading: false,
disabled: false, disabled: false,
pageLoading: false, pageLoading: false,
dialogEditVisible: false, dialogEditVisible: false,
dialogVisible: false, dialogVisible: false,
uploadUlr: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
total: null, total: null,
@ -150,15 +257,14 @@ export default {
BUILD_ID: '', BUILD_ID: '',
HOME_ID: '' HOME_ID: ''
}, },
editTableName: { editTableName: {},
formName: '',
},
formList: [], formList: [],
tableHeader: [], tableHeader: [],
tabsList: [] tabsList: []
} }
}, },
async created () { async created() {
await this.getSearchList() await this.getSearchList()
// await this.getFormList() // await this.getFormList()
await this.getTableHeader() await this.getTableHeader()
@ -167,38 +273,38 @@ export default {
console.log('storeoooo----0000', this.$store) console.log('storeoooo----0000', this.$store)
}, },
methods: { methods: {
filterEdit (id) { filterEdit(id) {
const { user } = this.$store.state const { user } = this.$store.state
return id === user.agencyId return id === user.agencyId
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val}`) console.log(`每页 ${val}`)
this.pageSize = val this.pageSize = val
this.getTableData() this.getTableData()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.currentPage = val this.currentPage = val
this.getTableData() this.getTableData()
}, },
handleFilterSpan (row, item) { handleFilterSpan(row, item) {
let _val = '' let _val = ''
if (item.itemType === 'radio' && item.options.length > 0) { if (item.itemType === 'radio' && item.options.length > 0) {
item.options.forEach(n => { item.options.forEach((n) => {
if (n.value === row[item.columnName]) _val = n.label if (n.value === row[item.columnName]) _val = n.label
}) })
} }
return _val || row[item.columnName] return _val || row[item.columnName]
}, },
handleSearch (val) { handleSearch(val) {
console.log('searchhh--', val) console.log('searchhh--', val)
this.currentPage = 1 this.currentPage = 1
this.conditions = val this.conditions = val
this.getTableData() this.getTableData()
}, },
// //
download (data, fileName) { download(data, fileName) {
console.log('data',data) console.log('data', data)
if (!data) { if (!data) {
return return
} }
@ -206,77 +312,134 @@ export default {
var csvData = new Blob([data]) var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) { if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName); window.navigator.msSaveOrOpenBlob(csvData, fileName)
} }
// for Non-IE (chrome, firefox etc.) // for Non-IE (chrome, firefox etc.)
else { else {
var a = document.createElement('a'); var a = document.createElement('a')
document.body.appendChild(a); document.body.appendChild(a)
a.style = 'display: none'; a.style = 'display: none'
var url = window.URL.createObjectURL(csvData); var url = window.URL.createObjectURL(csvData)
a.href = url; a.href = url
a.download = fileName; a.download = fileName
a.click(); a.click()
a.remove(); a.remove()
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url)
} }
}, },
handleExport () { handleExport() {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
conditions: this.conditions conditions: this.conditions
} }
// .post('epmetuser/icresiuser/exportExcel', params) // .post('epmetuser/icresiuser/exportExcel', params)
this.$http({ axios({
url: 'epmetuser/icresiuser/exportExcel', url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/exportExcel',
// url: 'epmetuser/icresiuser/exportExcel',
method: 'post', method: 'post',
data: params, data: params,
header: {
headers: { 'Content-Type': 'application/x-download' }
},
responseType: 'blob' responseType: 'blob'
}).then(({ data: res }) => { })
// var headerData = res.headers .then(res => {
// this.download(res, '.xlsx') console.log('resllll', res)
console.log('res',res) let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
const fileName = '人员数据.xlsx' console.log('filename', fileName)
let blob = new Blob([res], {type: 'application/vnd.ms-excel'}) let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob); var url = window.URL.createObjectURL(blob)
var aLink = document.createElement("a"); var aLink = document.createElement('a')
aLink.style.display = "none"; aLink.style.display = 'none'
aLink.href = url; aLink.href = url
aLink.setAttribute("download", fileName); aLink.setAttribute('download', fileName)
document.body.appendChild(aLink); document.body.appendChild(aLink)
aLink.click(); aLink.click()
document.body.removeChild(aLink); // document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url); //blob window.URL.revokeObjectURL(url) //blob
// window.location.href = res.data
}) })
.catch(err => { .catch((err) => {
console.log('获取导出情失败', err) console.log('获取导出情失败', err)
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
handleClick (tab, event) { //
handleExcelSuccess (res, file) {
if (res.code === 0 && res.msg === 'success') {
console.log('resss---ppp', res)
} else {
this.$message.error(res.msg)
}
},
handleProgress(event, file, fileList) {
console.log('percentage', file.percentage)
},
beforeExcelUpload (file) {
console.log('file', file)
const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer
const isLt1M = (file.size / 1024 / 1024) < 10
if(!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式!')
}
if (!isLt1M) {
this.$message.error('上传图片大小不能超过 10MB!')
}
return fileType && isLt1M
},
uploadHttpRequest(file) {
this.importLoading = true
this.importBtnTitle = '正在上传中...'
const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) //
axios({
url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
method: 'post',
data: formData,
responseType: 'blob'
})
.then((res) => {
this.importLoading = false
this.importBtnTitle = '导入人员数据'
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob)
var aLink = document.createElement('a')
aLink.style.display = 'none'
aLink.href = url
aLink.setAttribute('download', fileName)
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url) //blob
})
.catch( err => {
console.log('失败', err)
param.onError() //
})
},
handleClick(tab, event) {
console.log(tab, event) console.log(tab, event)
}, },
async handleLook (row) { async handleLook(row) {
this.disabled = true this.disabled = true
await this.getFormList() await this.getFormList()
this.getrowInfo(row.icResiUserId) this.getrowInfo(row.icResiUserId)
}, },
async handleEdit (row) { async handleEdit(row) {
this.disabled = false this.disabled = false
await this.getFormList('edit') await this.getFormList('edit')
await this.getrowInfo(row.icResiUserId) await this.getrowInfo(row.icResiUserId)
}, },
async handleAdd () { async handleAdd() {
await this.getFormList() await this.getFormList()
this.dialogVisible = true this.dialogVisible = true
}, },
async handleChangeGroup (val) { async handleChangeGroup(val) {
console.log('changeguoprrrrr----', val) console.log('changeguoprrrrr----', val)
let { childGroup, value } = val let { childGroup, value } = val
let hasT = false let hasT = false
@ -291,9 +454,9 @@ export default {
if (value === 1 || value === '1') { if (value === 1 || value === '1') {
// console.log('changegroup----999', value) // console.log('changegroup----999', value)
if (!hasT) { if (!hasT) {
childGroup.itemList.forEach(async item => { childGroup.itemList.forEach(async (item) => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
await this.getOptionsList(item.optionSourceValue).then(res => { await this.getOptionsList(item.optionSourceValue).then((res) => {
item.options = res item.options = res
}) })
// console.log('') // console.log('')
@ -306,17 +469,19 @@ export default {
if (hasT) this.tabsList.splice(i, 1) if (hasT) this.tabsList.splice(i, 1)
} }
}, },
formetForm () { formetForm() {
const _baseForm = this.$refs.baseForm.handleForm() const _baseForm = this.$refs.baseForm.handleForm()
let arr = [] let arr = []
if (_baseForm.length === 0) return false if (_baseForm.length === 0) return false
arr.push([ ..._baseForm ]) arr.push([..._baseForm])
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
arr.push([ ...this.$refs['group' + item.groupId][0].handleForm() ]) arr.push([...this.$refs['group' + item.groupId][0].handleForm()])
})
let arr2 = arr.reduce(function (a, b) {
return a.concat(b)
}) })
let arr2 = arr.reduce(function (a, b) { return a.concat(b) })
let noChange = true let noChange = true
arr2.forEach(item => { arr2.forEach((item) => {
if (item.list.length !== 0) noChange = false if (item.list.length !== 0) noChange = false
}) })
console.log('arr2', arr2) console.log('arr2', arr2)
@ -344,11 +509,12 @@ export default {
}) })
console.log('res', res) console.log('res', res)
// listlist // listlist
res.forEach(item => { res.forEach((item) => {
let _form = {} let _form = {}
item.list.length > 0 && item.list.forEach(n => { item.list.length > 0 &&
_form = { ..._form, ...n } item.list.forEach((n) => {
}) _form = { ..._form, ...n }
})
if (item.list.length > 0) { if (item.list.length > 0) {
finalArr.push({ finalArr.push({
tableName: item.tableName, tableName: item.tableName,
@ -359,51 +525,55 @@ export default {
console.log('finalArr', finalArr) console.log('finalArr', finalArr)
return finalArr return finalArr
}, },
async handleEditSUbmit () { async handleEditSUbmit() {
const arr = await this.formetForm() const arr = await this.formetForm()
if (arr) this.submitEdit(arr) if (arr) this.submitEdit(arr)
}, },
async handleSUbmit () { async handleSUbmit() {
const arr = await this.formetForm() const arr = await this.formetForm()
if (arr) this.submitAdd(arr) if (arr) this.submitAdd(arr)
}, },
handleDel (row) { handleDel(row) {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
icResiUserId: row.icResiUserId icResiUserId: row.icResiUserId
} }
console.log('row1', row)
this.$http this.$http
.post('/epmetuser/icresiuser/delete', params) .post('/epmetuser/icresiuser/delete', params)
.then(({ data: res }) => { .then(({ data: res }) => {
console.log('row2', row)
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
console.log('row3', row)
this.$message.success('删除成功') this.$message.success('删除成功')
this.getTableData() this.getTableData()
} }
}) })
.catch(() => { .catch((err) => {
console.log('row4', err)
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
handleFormatUrl (url) { handleFormatUrl(url) {
return url.includes('?') return url.includes('?')
}, },
handlerEditCancle () { handlerEditCancle() {
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.dialogEditVisible = false this.dialogEditVisible = false
}, },
handlerCancle () { handlerCancle() {
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.dialogVisible = false this.dialogVisible = false
}, },
async submitAdd (arr) { async submitAdd(arr) {
this.btnLoading = true this.btnLoading = true
await this.$http await this.$http
.post('/epmetuser/icresiuser/add', arr) .post('/epmetuser/icresiuser/add', arr)
@ -414,7 +584,7 @@ export default {
this.$message.success('提交成功') this.$message.success('提交成功')
// this.$refs[formName].resetFields(); // this.$refs[formName].resetFields();
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.getTableData() this.getTableData()
@ -424,9 +594,9 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
this.btnLoading = false this.btnLoading = false
}, },
async submitEdit (arr) { async submitEdit(arr) {
this.btnLoading = true this.btnLoading = true
await this.$http await this.$http
.post('/epmetuser/icresiuser/edit', arr) .post('/epmetuser/icresiuser/edit', arr)
@ -438,7 +608,7 @@ export default {
this.$message.success('提交成功') this.$message.success('提交成功')
// this.$refs[formName].resetFields(); // this.$refs[formName].resetFields();
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.getTableData() this.getTableData()
@ -448,11 +618,13 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
this.btnLoading = false this.btnLoading = false
}, },
getTableHeader () { getTableHeader() {
this.$http this.$http
.post('/oper/customize/icform/tableheaders', { formCode: 'resi_base_info' }) .post('/oper/customize/icform/tableheaders', {
formCode: 'resi_base_info'
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -464,7 +636,7 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
async getTableData () { async getTableData() {
this.tableLoading = true this.tableLoading = true
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
@ -485,9 +657,9 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
this.tableLoading = false this.tableLoading = false
}, },
getrowInfo (id) { getrowInfo(id) {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
icResiUserId: id icResiUserId: id
@ -505,18 +677,23 @@ export default {
for (let n in list) { for (let n in list) {
this.editForm[n] = list[n] this.editForm[n] = list[n]
} }
this.formList.forEach(item => { this.formList.forEach((item) => {
if (item.childGroup && info[item.childGroup.tableName]) {
// let _info = info[item.childGroup.tableName]
// item.childGroup.itemList.forEach(n => {
// n.columnValue = _info[0][n.columnName]
// })
this.tabsList.push(item.childGroup)
}
item.columnValue = list[item.columnName] item.columnValue = list[item.columnName]
item.ID = list.ID item.ID = list.ID
if (
item.columnValue == '1' &&
item.itemType === 'radio' &&
item.childGroup
) {
this.tabsList.push(item.childGroup)
}
// if (item.childGroup && info[item.childGroup.tableName]) {
// }
}) })
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
let _info = info[item.tableName] let _info = info[item.tableName]
if (item.supportAdd) { if (item.supportAdd) {
// console.log('tabsList---333', item.label) // console.log('tabsList---333', item.label)
@ -527,7 +704,7 @@ export default {
// console.log('mutiList----555' + index, mutiList, _list) // console.log('mutiList----555' + index, mutiList, _list)
mutiList.splice(index, 0, { mutiList.splice(index, 0, {
row: index, row: index,
itemList: _list.map(m => { itemList: _list.map((m) => {
// console.log('itemList---item' + index, m) // console.log('itemList---item' + index, m)
return { return {
...m, ...m,
@ -542,7 +719,7 @@ export default {
item.mutiList = mutiList item.mutiList = mutiList
} else { } else {
if (_info) { if (_info) {
item.itemList.forEach(n => { item.itemList.forEach((n) => {
n.ID = _info[0].ID n.ID = _info[0].ID
n.columnValue = _info[0][n.columnName] n.columnValue = _info[0][n.columnName]
}) })
@ -558,7 +735,7 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
async getOptionsList (url) { async getOptionsList(url) {
let options = [] let options = []
// console.log('getOptionsList----', url) // console.log('getOptionsList----', url)
await this.$http await this.$http
@ -575,18 +752,21 @@ export default {
}) })
return options return options
}, },
getSearchList () { getSearchList() {
this.$http this.$http
.post('/oper/customize/icform/conditionlist', { formCode: 'resi_base_info', dynamic: true }) .post('/oper/customize/icform/conditionlist', {
formCode: 'resi_base_info',
dynamic: true
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
// console.log('', res.data) // console.log('', res.data)
this.searchList = res.data this.searchList = res.data
res.data.forEach(item => { res.data.forEach((item) => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
this.getOptionsList(item.optionSourceValue).then(res => { this.getOptionsList(item.optionSourceValue).then((res) => {
item.options = res item.options = res
}) })
// console.log('') // console.log('')
@ -598,35 +778,56 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
async getFormList (type) { getTreeData(data){
if (!Array.isArray(data)) return []
let arr = data.map(item => {
let _item = {}
if (item.children) {
if (item.children.length === 0) _item = { ...item, children: undefined }
else _item = { ...item, children: this.getTreeData(item.children)}
} else {
_item = { ...item }
}
return _item
})
return arr
},
async getFormList(type) {
await this.$http await this.$http
.post('/oper/customize/icform/getcustomerform', { formCode: 'resi_base_info', dynamic: true }) .post('/oper/customize/icform/getcustomerform', {
formCode: 'resi_base_info',
dynamic: true
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
console.log('获取详情成功getFormList') console.log('获取详情成功getFormList')
let { itemList, groupList } = res.data let { itemList, groupList, formName } = res.data
this.formName = formName
this.activeName = 'group' + res.data.groupList[0].groupId this.activeName = 'group' + res.data.groupList[0].groupId
if (type !== 'edit') { if (type !== 'edit') {
itemList.forEach(async item => { itemList.forEach(async (item) => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
await this.getOptionsList(item.optionSourceValue).then(res => { await this.getOptionsList(item.optionSourceValue).then(
item.options = res (res) => {
}) item.options = this.getTreeData(res)
}
)
} }
}) })
groupList.forEach(item => {
item.itemList.forEach(async n => {
n.tableName = item.tableName
if (n.optionSourceType === 'remote') {
await this.getOptionsList(n.optionSourceValue).then(res => {
n.options = res
})
}
})
})
} }
groupList.forEach((item) => {
item.itemList.forEach(async (n) => {
n.tableName = item.tableName
if (n.optionSourceType === 'remote' && type !== 'edit') {
await this.getOptionsList(n.optionSourceValue).then((res) => {
n.options = this.getTreeData(res)
})
}
})
})
// }
this.formList = itemList this.formList = itemList
this.tabsList = groupList this.tabsList = groupList
} }
@ -651,20 +852,21 @@ export default {
font-weight: 500; font-weight: 500;
color: #666666; color: #666666;
line-height: 20px; line-height: 20px;
background: #EBECF1; background: #ebecf1;
border-radius: 2px; border-radius: 2px;
} }
.el-tabs__nav-wrap::after, .el-tabs__active-bar { .el-tabs__nav-wrap::after,
.el-tabs__active-bar {
display: none; display: none;
} }
.el-tabs__nav-next, .el-tabs__nav-prev { .el-tabs__nav-next,
.el-tabs__nav-prev {
line-height: 20px; line-height: 20px;
} }
} }
.resi-table { .resi-table {
.el-button--text { .el-button--text {
text-decoration: underline; text-decoration: underline;
} }
.btn-color-del { .btn-color-del {
margin-left: 10px; margin-left: 10px;
@ -681,7 +883,11 @@ export default {
margin-top: 20px; margin-top: 20px;
} }
.resi-row-btn { .resi-row-btn {
display: flex;
margin-bottom: 13px; margin-bottom: 13px;
.el-button {
margin-left: 10px;
}
} }
.resi-other { .resi-other {
width: 100%; width: 100%;
@ -710,5 +916,4 @@ export default {
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
} }
</style> </style>

145
src/views/modules/visual/basicinfo/people.vue

@ -7,7 +7,7 @@
<img src="@/assets/img/shuju/title-tip.png" /> <img src="@/assets/img/shuju/title-tip.png" />
<span>人员情况</span> <span>人员情况</span>
</div> </div>
<div class="more">查看更多</div> <div class="more" @click="showedMoreInfo=true">查看更多</div>
<div class="ren"> <div class="ren">
<img class="pic-ren" src="@/assets/img/shuju/people/ren.png" /> <img class="pic-ren" src="@/assets/img/shuju/people/ren.png" />
<div class="ren-prop z-1"> <div class="ren-prop z-1">
@ -72,6 +72,128 @@
</div> </div>
</cpt-card> </cpt-card>
</div> </div>
<div class="m-pop" v-if="showedMoreInfo">
<div class="wrap">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>更多信息</span>
</div>
<div class="btn-close" @click="showedMoreInfo=false">
<img src="@/assets/img/shuju/people/close.png" />
</div>
<div class="list">
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
</div>
<div class="line"></div>
<div class="list">
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
</div>
<div class="line"></div>
<div class="list">
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
</div>
<div class="line"></div>
<div class="list">
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
<div class="item">所属网格商区社区第一网格</div>
</div>
</cpt-card>
</div>
</div>
<div class="m-relation">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>家庭关系</span>
</div>
<div class="info">
<div class="huzhu">
<img class="huzhu-bg" src="@/assets/img/shuju/people/huzhu.png" />
<img class="huzhu-ico" src="@/assets/img/shuju/people/huzhu-home.png" />
<div class="huzhu-name">爱新觉罗玄烨</div>
<p>户主</p>
</div>
<div class="rel z-zuo-2">
<img class="rel-bg" src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line" src="@/assets/img/shuju/people/huzhu-line/zuo2.png" />
<div class="rel-text">
<span class="rel-call">妻子</span>
<span class="rel-name">西门吹雪</span>
</div>
</div>
<div class="rel z-you-2">
<img class="rel-bg" src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line" src="@/assets/img/shuju/people/huzhu-line/you2.png" />
<div class="rel-text">
<span class="rel-call">妻子</span>
<span class="rel-name">西门吹雪</span>
</div>
</div>
<div class="rel z-zuo-1">
<img class="rel-bg" src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line" src="@/assets/img/shuju/people/huzhu-line/zuo1.png" />
<div class="rel-text">
<span class="rel-call">妻子</span>
<span class="rel-name">西门吹雪</span>
</div>
</div>
<div class="rel z-you-1">
<img class="rel-bg" src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line" src="@/assets/img/shuju/people/huzhu-line/you1.png" />
<div class="rel-text">
<span class="rel-call">妻子</span>
<span class="rel-name">西门吹雪</span>
</div>
</div>
<div class="rel z-zuo-3">
<img class="rel-bg" src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line" src="@/assets/img/shuju/people/huzhu-line/zuo3.png" />
<div class="rel-text">
<span class="rel-call">妻子</span>
<span class="rel-name">西门吹雪</span>
</div>
</div>
<div class="rel z-you-3">
<img class="rel-bg" src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line" src="@/assets/img/shuju/people/huzhu-line/you3.png" />
<div class="rel-text">
<span class="rel-call">妻子</span>
<span class="rel-name">西门吹雪</span>
</div>
</div>
</div>
</cpt-card>
</div>
</div> </div>
<div class="g-r"></div> <div class="g-r"></div>
</div> </div>
@ -86,26 +208,7 @@ export default {
name: 'HomeMap', name: 'HomeMap',
data () { data () {
return { return {
centerPoint: [],// showedMoreInfo: false
zoom: 14,//14
minZoom: 1,//
orgData: {},//
orgId: '',
orgLevel: '',
subAgencyArray: [],//
selPolygonId: '',//id
selPolygon: {},
//
name: "",
//
runNum: 0,
runAgency: [],
} }
}, },

20
src/views/modules/visual/cpts/card.vue

@ -1,15 +1,15 @@
<template> <template>
<div class="m-card"> <div class="m-card">
<div class="wrap"> <div class="card-wrap">
<img src="@/assets/img/shuju/card/l-t.png" class="corner corner-1" /> <img src="@/assets/img/shuju/card/l-t.png" class="card-corner card-corner-1" />
<img src="@/assets/img/shuju/card/r-t.png" class="corner corner-2" /> <img src="@/assets/img/shuju/card/r-t.png" class="card-corner card-corner-2" />
<img src="@/assets/img/shuju/card/r-b.png" class="corner corner-3" /> <img src="@/assets/img/shuju/card/r-b.png" class="card-corner card-corner-3" />
<img src="@/assets/img/shuju/card/l-b.png" class="corner corner-4" /> <img src="@/assets/img/shuju/card/l-b.png" class="card-corner card-corner-4" />
<div class="line line-t"></div> <div class="card-line card-line-t"></div>
<div class="line line-l"></div> <div class="card-line card-line-l"></div>
<div class="line line-r"></div> <div class="card-line card-line-r"></div>
<div class="line line-b"></div> <div class="card-line card-line-b"></div>
<div class="cnt"> <div class="card-cnt">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>

60
src/views/modules/workSys/mapConfig.vue

@ -22,11 +22,11 @@
type="primary" type="primary"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleEditPolygon">{{method==='mEditPolygon'?'取消绘制':'重新绘制'}}</el-button> @click="handleEditPolygon">{{method==='mEditPolygon'?'取消绘制':'重新绘制'}}</el-button>
<el-button v-if="showBtn&&hasPolygon" <!-- <el-button v-if="showBtn&&hasPolygon"
style="margin-left:10px" style="margin-left:10px"
type="primary" type="primary"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelPolygon">删除区域</el-button> @click="handleDelPolygon">删除区域</el-button> -->
</div> </div>
<div class="div_back"> <div class="div_back">
@ -47,9 +47,6 @@
<script> <script>
import 'ol/ol.css' import 'ol/ol.css'
import { Map, View } from 'ol' import { Map, View } from 'ol'
import { ZoomSlider, Zoom } from 'ol/control.js';
import ImageLayer from 'ol/layer/Image.js';
import Static from 'ol/source/ImageStatic.js';
import TileLayer from 'ol/layer/Tile.js'; import TileLayer from 'ol/layer/Tile.js';
import XYZ from 'ol/source/XYZ.js'; import XYZ from 'ol/source/XYZ.js';
import VectorLayer from 'ol/layer/Vector.js'; import VectorLayer from 'ol/layer/Vector.js';
@ -64,7 +61,6 @@ import Draw from 'ol/interaction/Draw.js';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading import { Loading } from 'element-ui'; //Loading
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { transform } from 'ol/proj'
import { altKeyOnly, click, pointerMove } from 'ol/events/condition'; import { altKeyOnly, click, pointerMove } from 'ol/events/condition';
@ -192,7 +188,7 @@ const vueGis = {
}, },
// // isRefreshView:
async refreshMap (isRefreshView) { async refreshMap (isRefreshView) {
// //
await this.loadOrgData() await this.loadOrgData()
@ -326,20 +322,24 @@ const vueGis = {
//feature //feature
selectFeature (e) { selectFeature (e) {
console.log(e) // console.log(e)
this.selAgencyId = e.selected[0].id_
this.subAgencyArray.forEach((element, index) => { if (this.method === undefined || this.method === '') {
if (element.id === e.selected[0].id_) { this.selAgencyId = e.selected[0].id_
this.selAgencyIndex = index this.subAgencyArray.forEach((element, index) => {
this.orgChange(index) if (element.id === e.selected[0].id_) {
} this.selAgencyIndex = index
this.orgChange(index)
}
});
}
});
}, },
// //
toSubAgency (e) { toSubAgency (e) {
console.log(e)
if (this.method != 'mAddPolygon' && this.level != 'neighborHood') { if (this.method != 'mAddPolygon' && this.level != 'neighborHood') {
// //
this.subAgencyArray.forEach(item => { this.subAgencyArray.forEach(item => {
@ -580,6 +580,7 @@ const vueGis = {
type: "Polygon" type: "Polygon"
}); });
map.addInteraction(draw); map.addInteraction(draw);
draw.on('drawend', feature => { draw.on('drawend', feature => {
this.polygonCoor = feature.feature.values_.geometry.flatCoordinates this.polygonCoor = feature.feature.values_.geometry.flatCoordinates
@ -590,10 +591,28 @@ const vueGis = {
if (this.polygonCoor.length > 0) { if (this.polygonCoor.length > 0) {
coorString = coorString.substring(0, coorString.length - 1) coorString = coorString.substring(0, coorString.length - 1)
} }
console.log(coorString)
if (this.method === 'mEditPolygon') {
this.$confirm("是否确认覆盖原有区域?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.addPolygon(coorString)
})
.catch(err => {
this.loadPolygon(this.subAgencyArray)
});
} else {
this.addPolygon(coorString)
}
this.method = "" this.method = ""
map.removeInteraction(draw); map.removeInteraction(draw);
this.addPolygon(coorString)
}); });
}, },
@ -625,6 +644,7 @@ const vueGis = {
}, },
// //
async delPolygon () { async delPolygon () {
const url = "/gov/org/agency/mapdelarea" const url = "/gov/org/agency/mapdelarea"
@ -735,9 +755,9 @@ export default vueGis;
.div_map { .div_map {
width: 100%; width: 100%;
} }
</style> </style>
<style> <style>
.ol-overlaycontainer-stopevent { .ol-overlaycontainer-stopevent {
display: none; display: none;
} }
</style> </style>

Loading…
Cancel
Save