Browse Source

Merge branch 'dev-detail-adjust0919'

feature
jiangyy 3 years ago
parent
commit
21277467cc
  1. 82
      src/assets/scss/modules/management/detail-main.scss
  2. 315
      src/views/modules/base/community/buildDetail.vue
  3. 49
      src/views/modules/base/community/buildTable.vue
  4. 298
      src/views/modules/base/community/communityDetail.vue
  5. 121
      src/views/modules/base/community/communityTable.vue
  6. 261
      src/views/modules/base/community/roomDetail.vue
  7. 430
      src/views/modules/base/community/roomTable.vue
  8. 335
      src/views/modules/workPc/guidance/DetailForm.vue
  9. 590
      src/views/modules/workPc/guidance/addForm.vue
  10. 42
      src/views/modules/workPc/guidance/guidanceList.vue

82
src/assets/scss/modules/management/detail-main.scss

@ -166,6 +166,86 @@
}
}
.m-row-info{
// padding-left: 30px;
font-size: 15px;
font-family: PingFang SC;
font-weight: 400;
color: #333;
line-height: 24px;
display: flex;
justify-content: flex-start;
width:100%;
.info-title {
margin-top: 30px;
font-size: 20px;
font-family: PingFang SC;
font-weight: bold;
color: #333;
line-height: 30px;
}
.info-content {
margin: 20px 0;
}
.info-pics {
display: flex;
margin: 20px 0;
img {
display: block;
width: 32%;
height: 90px;
margin-right: 9px;
object-fit: cover;
}
}
.info-prop {
flex:0 0 300px;
position: relative;
margin: 10px 0;
display: flex;
padding-left: 15px;
padding-top:10px;
// border-bottom: 1px solid #d8d8d8;
.line{
text-decoration:underline;
color: #3e8ef7;
}
.line:hover{
cursor:pointer
}
.info-title-2 {
// flex: 0 0 100px;
// font-size: 15px;
}
> span,
> div {
display: block;
// max-width: 300px;
}
&::before {
content: "";
display: block;
position: absolute;
top: 19px;
left: 0;
width: 7px;
height: 7px;
background: #0c81fe;
border-radius: 3px;
margin-right: 10px;
}
}
.info-prop-vis{
color:#fff;
}
}
.m-case {
height: 600px;
padding: 20px 0 20px 0;
@ -174,7 +254,7 @@
.m-row {
// display: flex;
justify-content: space-between;
// justify-content: space-between;
width:100%;
padding-left:50px;
}

315
src/views/modules/base/community/buildDetail.vue

@ -0,0 +1,315 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属小区</span>
<span>{{ agencyObj.agencyName }}{{ agencyObj.gridName }}{{ agencyObj.label }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">楼栋名称</span>
<span>{{ dataForm.buildingName?dataForm.buildingName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">楼栋编码</span>
<span>{{ dataForm.coding?dataForm.coding:'--'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">楼栋类型</span>
<span>{{ dataForm.buildType?dataForm.buildType:'--'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">单元数</span>
<span>{{dataForm.totalUnitNum?dataForm.totalUnitNum:0 }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">层数</span>
<span>{{dataForm.totalFloorNum?dataForm.totalFloorNum:0 }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">总户数</span>
<span>{{dataForm.totalHouseNum?dataForm.totalHouseNum:0 }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">人口数</span>
<span>{{dataForm.realPerson?dataForm.realPerson:0 }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">楼长姓名</span>
<span>{{ dataForm.buildingLeaderName?dataForm.buildingLeaderName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">楼长电话</span>
<span>{{ dataForm.buildingLeaderMobile?dataForm.buildingLeaderMobile:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">详细地址</span>
<span>{{ dataForm.coordinatePosition?dataForm.coordinatePosition:'--' }}</span>
</div>
<div v-if="dataForm.coordinatePosition"
class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
let loading //
export default {
data () {
return {
btnDisable: false,
initLoading: false,
dataForm: {
agencyId: '', // ID
agencyName: '',
gridId: '', //ID
neighborHoodId: '',//id
buildingName: '',//
// sort: 0,//
totalUnitNum: 1,//
totalFloorNum: 0,//
totalHouseNum: 0,//
realPerson: 0,
buildingLeaderName: '',//
buildingLeaderMobile: '',//
type: '',//
coordinatePosition: '',
sysCoding: '',
coding: '',
location: '', //
longitude: '', //
latitude: '' //
},
agencyObj: {},
}
},
components: {},
mounted () {
},
methods: {
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row, agencyObj) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.agencyObj = agencyObj
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
},
// init
initMap () {
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.dataForm.latitude && this.dataForm.longitude) {
latitude = this.dataForm.latitude
longitude = this.dataForm.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng },
address
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.dataForm.coordinatePosition = address
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.setMarker(lat, lng)
},
resetData () {
this.buildType = '1'
this.dataForm = {
agencyId: '', // ID
agencyName: '',
gridId: '', //ID
neighborHoodId: '',//id
buildingName: '',//
// sort: 0,//
totalUnitNum: 1,//
totalFloorNum: 0,//
totalHouseNum: 0,//
realPerson: 0,
buildingLeaderName: '',//
buildingLeaderMobile: '',//
type: '',//
location: '', //
longitude: '', //
latitude: '', //
coding: '',
sysCoding: '',
coordinatePosition: ''
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
buildingName: [
{ required: true, message: '楼栋名称不能为空', trigger: 'blur' },
{
min: 1,
max: 10,
message: '小区名称长度在 1 到 10个字符',
trigger: 'blur'
}
],
type: [
{ required: true, message: '楼栋类型不能为空', trigger: 'blur' }
],
totalUnitNum: [
{ required: true, message: '单元数不能为空', trigger: 'blur' }
],
coding: [
{ required: true, message: '楼栋编码不能为空', trigger: 'blur' }
]
// totalFloorNum: [
// { required: true, message: '', trigger: 'blur' }
// ],
// totalHouseNum: [
// { required: true, message: '', trigger: 'blur' }
// ],
// longitude: [
// { required: true, message: '', trigger: 'blur' }
// ],
}
},
},
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/detail-main.scss";
</style>

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

@ -57,9 +57,10 @@
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button size="small" v-if="displayedBaobiaoBtn"
class="diy-button--add"
@click="reportForm">智能填报</el-button>
<el-button size="small"
v-if="displayedBaobiaoBtn"
class="diy-button--add"
@click="reportForm">智能填报</el-button>
</div>
<div class="div_table_item">
@ -196,6 +197,17 @@
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></build-form>
</el-dialog>
<!-- 详情弹出框 -->
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'楼栋详情'"
top="5vh"
width="900px"
class="dialog-h"
@closed="detailFormCancle">
<build-detail ref="ref_form_detail"></build-detail>
</el-dialog>
<baobiao ref="baobiao" />
</div>
@ -204,6 +216,7 @@
<script>
import BuildForm from './buildForm'
import BuildDetail from './buildDetail'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
@ -232,6 +245,7 @@ export default {
//form
formShow: false,
formTitle: '新增楼栋',
detailShow: false,
yihuyidangDisabled: false,
@ -240,12 +254,13 @@ export default {
},
components: {
baobiao,
BuildForm
BuildForm,
BuildDetail
},
async mounted() {
async mounted () {
this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({
elseParams: {
categoryKeys:['house_info'], categoryKey: 'house_info',
categoryKeys: ['house_info'], categoryKey: 'house_info',
}
});
},
@ -259,7 +274,7 @@ export default {
...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
reportForm(){
reportForm () {
let paramMap = {
pageSize: this.pageSize,
pageNo: this.pageNo,
@ -276,7 +291,7 @@ export default {
};
this.$refs.baobiao.init({
elseParams: {
categoryKeys:['house_info'], categoryKey: 'house_info', paramMap
categoryKeys: ['house_info'], categoryKey: 'house_info', paramMap
}
})
},
@ -394,14 +409,26 @@ export default {
},
async handleDetail (row) {
this.formTitle = '楼栋详情'
this.formShow = true
// this.formTitle = ''
// this.formShow = true
// const _data = await this.detail(row)
// this.$nextTick(() => {
// this.$refs.ref_form.initForm('detail', _data, this.agencyObj)
// })
this.detailShow = true
const _data = await this.detail(row)
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', _data, this.agencyObj)
this.$refs.ref_form_detail.initForm(_data, this.agencyObj)
})
},
detailFormCancle () {
this.$refs.ref_form_detail.diaDestroy()
this.detailShow = false
},
handleAdd () {
this.formTitle = '新增楼栋'
this.formShow = true

298
src/views/modules/base/community/communityDetail.vue

@ -0,0 +1,298 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属组织</span>
<span>{{ dataForm.agencyName }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">所属网格</span>
<span>{{ dataForm.gridName?dataForm.gridName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">小区名称</span>
<span>{{ dataForm.neighborHoodName}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">小区编码</span>
<span>{{ dataForm.coding?dataForm.coding:'--'}}</span>
</div>
<div v-if="dataForm.qrcodeUrl"
style="display: flex;flex-direction: column;">
<img style="margin-left: 70px;width: 200px;"
:src="dataForm.qrcodeUrl">
<a style="margin-left: 80px"
:href="dataForm.qrcodeUrl"
target="_blank">下载</a>
</div>
<div class="info-prop">
<span class="info-title-2">关联物业</span>
<span>{{ dataForm.propertyName?dataForm.propertyName:'--'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">实有楼栋</span>
<span>{{dataForm.realBuilding?dataForm.realBuilding:0 }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">详细地址</span>
<span>{{ dataForm.address }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
let loading //
export default {
data () {
return {
btnDisable: false,
initLoading: false,
dataForm: {
neighborHoodName: '', // 50
agencyId: '', // ID
agencyName: '',
gridId: '', //ID
propertyId: '', //
address: '', //
remark: '', //500
location: '', //
longitude: '', //
latitude: '', //
realBuilding: 0,
coding: '',
sysCoding: ''
},
}
},
components: {},
mounted () {
},
methods: {
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.dataForm.latitude && this.dataForm.longitude) {
latitude = this.dataForm.latitude
longitude = this.dataForm.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.dataForm.latitude = lat
this.dataForm.longitude = lng
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.setMarker(lat, lng)
},
resetData () {
this.dataForm = {
neighborHoodName: '', // 50
agencyId: '', // ID
agencyName: '',
gridId: '', //ID
propertyId: '', //
address: '', //
remark: '', //500
location: '', //
longitude: '', //
latitude: '', //
realBuilding: 0,
coding: '',
sysCoding: ''
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
neighborHoodName: [
{ required: true, message: '小区名称不能为空', trigger: 'blur' },
{
min: 1,
max: 50,
message: '小区名称长度在 1 到 50个字符',
trigger: 'blur'
}
],
agencyId: [
{ required: true, message: '所属组织不能为空', trigger: 'blur' }
],
gridId: [
{ required: true, message: '所属网格不能为空', trigger: 'blur' }
],
coding: [
{ required: true, message: '小区编码不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
}
},
propertyRule () {
name: [
{ required: true, message: '物业名称不能为空', trigger: 'blur' }
// { min: 1, max: 50, message: ' 1 50', trigger: 'blur' }
]
}
},
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/detail-main.scss";
</style>

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

@ -3,17 +3,17 @@
<div class="div_btn">
<el-button v-if="showYhymInfo"
style=""
class="diy-button--reset"
size="small"
:loading="yhymLoading"
@click="handleYhymInfo">补全一房一码信息</el-button>
style=""
class="diy-button--reset"
size="small"
:loading="yhymLoading"
@click="handleYhymInfo">补全一房一码信息</el-button>
<el-button v-if="showYhymInfo"
style=""
class="diy-button--export"
size="small"
:loading="xcxmLoading"
@click="createBatchNeiQrUrl">补全小程序小区码</el-button>
style=""
class="diy-button--export"
size="small"
:loading="xcxmLoading"
@click="createBatchNeiQrUrl">补全小程序小区码</el-button>
<el-button style=""
class="diy-button--add"
size="small"
@ -94,9 +94,10 @@
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button> -->
<el-button size="small" v-if="displayedBaobiaoBtn"
class="diy-button--add"
@click="reportForm">智能填报</el-button>
<el-button size="small"
v-if="displayedBaobiaoBtn"
class="diy-button--add"
@click="reportForm">智能填报</el-button>
</div>
<div class="div_table_item">
@ -183,6 +184,17 @@
</div>
</div>
<!-- 详情弹出框 -->
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'小区详情'"
width="850px"
top="5vh"
class="dialog-h"
@closed="detailFormCancle">
<community-detail ref="ref_form_detail"></community-detail>
</el-dialog>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
@ -198,29 +210,29 @@
@dialogOk="addFormOk"></community-form>
</el-dialog>
<el-dialog
title="导出"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<div>
<el-button class="diy-button--reset"
size="small"
@click="handleExport">导出小区数据</el-button>
<el-button class="diy-button--export"
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button class="diy-button--qrcode"
size="small"
:disabled="yihuyimaDisabled"
:loading="exportBtn"
@click="handleExportYihuyima()">导出一房一码</el-button>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<!-- <el-button type="primary" @click="dialogVisible = false"> </el-button> -->
</span>
<el-dialog title="导出"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<div>
<el-button class="diy-button--reset"
size="small"
@click="handleExport">导出小区数据</el-button>
<el-button class="diy-button--export"
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button class="diy-button--qrcode"
size="small"
:disabled="yihuyimaDisabled"
:loading="exportBtn"
@click="handleExportYihuyima()">导出一房一码</el-button>
</div>
<span slot="footer"
class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<!-- <el-button type="primary" @click="dialogVisible = false"> </el-button> -->
</span>
</el-dialog>
<baobiao ref="baobiao" />
@ -230,6 +242,7 @@
<script>
import CommunityForm from './communityForm'
import CommunityDetail from './communityDetail'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
@ -267,6 +280,9 @@ export default {
formShow: false,
formTitle: '新增小区',
detailShow: false,
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import',
@ -274,18 +290,19 @@ export default {
yihuyimaDisabled: false,
exportBtn: false,
dialogVisible: false, //
displayedBaobiaoBtn: false,
}
},
components: {
baobiao,
CommunityForm
CommunityForm,
CommunityDetail
},
async mounted() {
async mounted () {
this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({
elseParams: {
categoryKeys:['house_info'], categoryKey: 'house_info',
categoryKeys: ['house_info'], categoryKey: 'house_info',
}
});
},
@ -298,7 +315,7 @@ export default {
...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
reportForm(){
reportForm () {
let paramMap = {
pageSize: this.pageSize,
pageNo: this.pageNo,
@ -315,7 +332,7 @@ export default {
};
this.$refs.baobiao.init({
elseParams: {
categoryKeys:['house_info'], categoryKey: 'house_info', paramMap
categoryKeys: ['house_info'], categoryKey: 'house_info', paramMap
}
})
},
@ -396,11 +413,18 @@ export default {
},
async handleDetail (row) {
this.formTitle = '小区详情'
this.formShow = true
// this.formTitle = ''
// this.formShow = true
// const _data = await this.detail(row)
// this.$nextTick(() => {
// this.$refs.ref_form.initForm('detail', _data, this.agencyObj)
// })
this.detailShow = true
const _data = await this.detail(row)
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', _data, this.agencyObj)
this.$refs.ref_form_detail.initForm(_data)
})
},
@ -492,6 +516,11 @@ export default {
addFormCancle () {
this.formShow = false
},
detailFormCancle () {
this.$refs.ref_form_detail.diaDestroy()
this.detailShow = false
},
addFormOk () {
this.formShow = false
@ -664,7 +693,7 @@ export default {
},
handleClose(done) {
handleClose (done) {
this.dialogVisible = false
},

261
src/views/modules/base/community/roomDetail.vue

@ -0,0 +1,261 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属楼栋</span>
<span>{{ agencyObj.neighborHoodName }}-{{agencyObj.label}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">单元号</span>
<span>{{ dataForm.unitName?dataForm.unitName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">门牌号</span>
<span>{{ dataForm.doorName}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">房屋编码</span>
<span>{{ dataForm.coding?dataForm.coding:'--'}}</span>
</div>
<div v-if="dataForm.houseQrcodeUrl"
style="display: flex;flex-direction: column;">
<img style="margin-left: 70px;width: 200px;"
:src="dataForm.houseQrcodeUrl">
<a style="margin-left: 80px"
:href="dataForm.houseQrcodeUrl"
target="_blank">下载</a>
</div>
<div class="info-prop">
<span class="info-title-2">房屋类型</span>
<span>{{dataForm.houseTypeName?dataForm.houseTypeName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">房屋用途</span>
<span>{{dataForm.purposeName?dataForm.purposeName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">房屋状态</span>
<span>{{dataForm.rentName?dataForm.rentName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">房主姓名</span>
<span>{{dataForm.ownerName?dataForm.ownerName:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系方式</span>
<span>{{dataForm.ownerPhone?dataForm.ownerPhone:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">房主身份证</span>
<span>{{dataForm.ownerIdCard?dataForm.ownerIdCard:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">备注</span>
<span>{{dataForm.remark?dataForm.remark:'--' }}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
initLoading: false,
unitList: [],
houseId: '', //ID
houseType: '1',
purpose: '1',
rentFlag: 0,
dataForm: {
neighborHoodId: '', // ID
buildingId: '',//ID
buildingUnitId: '',//ID
doorName: '',//
houseType: '',//
purpose: '',//
rentFlag: 0,//10 12 0
ownerPhone: '', //
ownerName: '', //
ownerIdCard: '', //
remark: '',
// realPerson: 0,
coding: '',
sysCoding: ''
},
keyWords: '',
agencyObj: {},
}
},
components: {},
mounted () {
},
methods: {
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row, agencyObj) {
// this.dataForm = JSON.parse(JSON.stringify(row))
this.agencyObj = agencyObj
this.houseId = row.houseId
await this.loadHouseInfo()
this.initLoading = true
// this.$refs.ref_form.resetFields();
// this.agencyObj = agencyObj
// this.formType = type
// console.log('agencyObj-----', agencyObj)
// if (row) {
// this.houseId = row.houseId
// await this.loadHouseInfo()
// } else {
// this.dataForm.neighborHoodId = this.agencyObj.neighborHoodId
// this.dataForm.buildingId = this.agencyObj.id
// }
// await this.loadUnitList()
},
async loadHouseInfo () {
const url = "/gov/org/ichouse/" + this.houseId
const { data, code, msg } = await requestGet(url)
if (code === 0) {
// debugger
this.dataForm = { ...data }
this.houseType = this.dataForm.houseType
this.purpose = this.dataForm.purpose
this.rentFlag = parseInt(this.dataForm.rentFlag)
} else {
this.$message.error(msg)
}
},
resetData () {
this.houseId = '' //ID
this.houseType = '1'
this.purpose = '1'
this.rentFlag = 0
this.dataForm = {
neighborHoodId: '', // ID
buildingId: '',//ID
buildingUnitId: '',//ID
doorName: '',//
houseType: '1',//
purpose: '1',//
rentFlag: 0,//10
ownerPhone: '', //
ownerName: '', //
ownerIdCard: '', //
remark: '', //
coding: '',
sysCoding: ''
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
buildingUnitId: [
{ required: true, message: '所属单元不能为空', trigger: 'blur' },
],
doorName: [
{ required: true, message: '门牌号不能为空', trigger: 'blur' }
],
coding: [
{ required: true, message: '房屋编码不能为空', trigger: 'blur' }
],
houseType: [
{ required: true, message: '房屋类型不能为空', trigger: 'blur' }
],
purpose: [
{ required: true, message: '房屋用途不能为空', trigger: 'blur' }
],
rentFlag: [
{ required: true, message: '是否出租不能为空', trigger: 'blur' }
],
ownerPhone: [
{ required: false }
],
ownerName: [
{ required: false }
],
ownerIdCard: [
{ required: false }
],
remark: [
{ required: false }
],
}
},
},
props: {}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/detail-main.scss";
</style>

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

@ -1,215 +1,202 @@
<template>
<div>
<div class="div_btn">
<el-button
v-if="agencyObj.level === 'building' || source !== 'search'"
style="float: left"
class="diy-button--add"
size="small"
@click="handleAdd"
>新增房屋</el-button
>
<div class="btn_upload" v-if="showImportBtn">
<el-button
style="float: left"
class="diy-button--export"
size="small"
@click="handleExportModule"
>下载房屋模板</el-button
>
<el-upload
ref="upload"
:multiple="false"
:show-file-list="false"
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile"
>
<el-button
style="margin-left: 10px"
size="small"
class="diy-button--delete"
>导入房屋数据</el-button
>
<el-button v-if="agencyObj.level === 'building' || source !== 'search'"
style="float: left"
class="diy-button--add"
size="small"
@click="handleAdd">新增房屋</el-button>
<div class="btn_upload"
v-if="showImportBtn">
<el-button style="float: left"
class="diy-button--export"
size="small"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload ref="upload"
:multiple="false"
:show-file-list="false"
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left: 10px"
size="small"
class="diy-button--delete">导入房屋数据</el-button>
</el-upload>
</div>
<el-button
style="float: left; margin-left: 10px"
class="diy-button--reset"
size="small"
@click="handleExport"
>导出</el-button
>
<el-button
style="float: left; margin-left: 10px"
class="diy-button--more"
size="small"
@click="deleteBatch"
>批量删除</el-button
>
<el-button
style="margin-left: 10px"
class="diy-button--export"
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()"
>导出一户一档</el-button
>
<el-button size="small" class="diy-button--add" v-if="displayedBaobiaoBtn" @click="reportForm"
>智能填报</el-button
>
<el-button style="float: left; margin-left: 10px"
class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>
<el-button style="float: left; margin-left: 10px"
class="diy-button--more"
size="small"
@click="deleteBatch">批量删除</el-button>
<el-button style="margin-left: 10px"
class="diy-button--export"
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button size="small"
class="diy-button--add"
v-if="displayedBaobiaoBtn"
@click="reportForm">智能填报</el-button>
</div>
<div class="div_table_item">
<el-table
ref="ref_table"
:data="tableData"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
v-loading="tableLoading"
@sort-change="handleSortOrderChange"
border
:height="tableHeight"
style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange"
>
<el-table-column type="selection" :selectable="checkSelect" width="55">
<el-table ref="ref_table"
:data="tableData"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
v-loading="tableLoading"
@sort-change="handleSortOrderChange"
border
:height="tableHeight"
style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
:selectable="checkSelect"
width="55">
</el-table-column>
<el-table-column
fixed="left"
width="55"
type="index"
label="序号"
:index="indexMethod"
>
<el-table-column fixed="left"
width="55"
type="index"
label="序号"
:index="indexMethod">
</el-table-column>
<el-table-column
prop="houseNameShow"
label="房屋名称"
fixed="left"
min-width="160"
>
<el-table-column prop="houseNameShow"
label="房屋名称"
fixed="left"
min-width="160">
</el-table-column>
<el-table-column
prop="neighborHoodName"
label="所属小区"
min-width="150"
>
<el-table-column prop="neighborHoodName"
label="所属小区"
min-width="150">
</el-table-column>
<el-table-column prop="buildingName" label="所属楼栋" width="80">
<el-table-column prop="buildingName"
label="所属楼栋"
width="80">
</el-table-column>
<el-table-column prop="unitNum" label="单元号" width="70">
<el-table-column prop="unitNum"
label="单元号"
width="70">
</el-table-column>
<el-table-column prop="doorName" label="门牌号" width="70">
<el-table-column prop="doorName"
label="门牌号"
width="70">
</el-table-column>
<el-table-column prop="houseType" label="类型" width="50">
<el-table-column prop="houseType"
label="类型"
width="50">
</el-table-column>
<el-table-column prop="purpose" label="用途" width="50">
<el-table-column prop="purpose"
label="用途"
width="50">
</el-table-column>
<el-table-column prop="rentFlag" label="房屋状态" width="80">
<el-table-column prop="rentFlag"
label="房屋状态"
width="80">
</el-table-column>
<el-table-column prop="ownerName" label="房主姓名" width="90">
<el-table-column prop="ownerName"
label="房主姓名"
width="90">
</el-table-column>
<el-table-column prop="ownerPhone" label="联系方式" width="110">
<el-table-column prop="ownerPhone"
label="联系方式"
width="110">
</el-table-column>
<el-table-column prop="ownerIdCard" label="身份证" width="170">
<el-table-column prop="ownerIdCard"
label="身份证"
width="170">
</el-table-column>
<el-table-column prop="remark" label="备注" width="170">
<el-table-column prop="remark"
label="备注"
width="170">
</el-table-column>
<el-table-column
prop="sort"
sortable="custom"
min-width="140"
label="排序"
>
<el-table-column prop="sort"
sortable="custom"
min-width="140"
label="排序">
<template slot-scope="scope">
<div @click="handleEditSort(scope.row)">
<span v-if="!scope.row.isChange">{{ scope.row.sort }}</span>
<el-input-number
v-else
@change="handleChangeSort(scope.row)"
v-model="scope.row.sort"
class="item_width_4"
:precision="2"
size="small"
:min="0"
:max="9999"
label="描述文字"
></el-input-number>
<el-input-number v-else
@change="handleChangeSort(scope.row)"
v-model="scope.row.sort"
class="item_width_4"
:precision="2"
size="small"
:min="0"
:max="9999"
label="描述文字"></el-input-number>
</div>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate"
>
<el-table-column label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button
type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)"
>查看</el-button
>
<el-button
v-if="scope.row.showBtn"
type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)"
>修改</el-button
>
<el-button
v-if="scope.row.showBtn"
type="text"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)"
>删除</el-button
>
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="scope.row.showBtn"
type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button v-if="scope.row.showBtn"
type="text"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total"
>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="900px"
top="5vh"
class="dialog-h"
@closed="diaClose"
>
<room-form
ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"
></room-form>
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="900px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<room-form ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></room-form>
</el-dialog>
<!-- 详情弹出框 -->
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="900px"
top="5vh"
class="dialog-h"
@closed="detailFormCancle">
<room-detail ref="ref_form_detail"></room-detail>
</el-dialog>
<baobiao ref="baobiao" />
@ -218,6 +205,7 @@
<script>
import roomForm from "./roomForm";
import roomDetail from "./roomDetail";
import { requestPost } from "@/js/dai/request";
import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading
@ -225,7 +213,7 @@ import baobiao from "@/views/modules/cpts/baobiao";
let loading; //
export default {
data() {
data () {
return {
source: "tree", //
importRoomLoading: false,
@ -249,6 +237,7 @@ export default {
//form
formShow: false,
formTitle: "新增房屋",
detailShow: false,
rentList: [
{
@ -273,16 +262,17 @@ export default {
components: {
baobiao,
roomForm,
roomDetail
},
async mounted() {
async mounted () {
this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({
elseParams: {
categoryKeys:['house_info'], categoryKey: 'house_info',
categoryKeys: ['house_info'], categoryKey: 'house_info',
}
});
},
computed: {
tableHeight() {
tableHeight () {
return this.$store.state.inIframe
? this.clientHeight - 425 + this.iframeHeight
: this.clientHeight - 425;
@ -291,7 +281,7 @@ export default {
...mapGetters(["clientHeight", "iframeHeight"]),
},
methods: {
reportForm() {
reportForm () {
let paramMap = {
pageSize: this.pageSize,
pageNo: this.pageNo,
@ -315,25 +305,25 @@ export default {
});
},
indexMethod(index) {
indexMethod (index) {
return index + 1;
},
handleSortOrderChange(value) {
handleSortOrderChange (value) {
this.sortType = value.order === "ascending" ? "asc" : "desc";
this.loadTable();
},
handleSortChange(value) {
handleSortChange (value) {
this.sortType = value.order === "ascending" ? "asc" : "desc";
this.loadTable();
},
handleEditSort(row) {
handleEditSort (row) {
if (!row.isChange) {
row.isChange = true;
}
},
async handleChangeSort(row, index) {
async handleChangeSort (row, index) {
// row.isChange = false
let params = {
@ -356,7 +346,7 @@ export default {
}
},
checkSelect(row, index) {
checkSelect (row, index) {
let isChecked = false;
if (row.showBtn) {
//
@ -367,9 +357,9 @@ export default {
return isChecked;
},
loadTreeFromSearch() {},
loadTreeFromSearch () { },
async loadTable(source, treeObj) {
async loadTable (source, treeObj) {
this.source = source;
this.tableLoading = true;
@ -442,20 +432,32 @@ export default {
this.tableLoading = false;
},
diaClose() {
diaClose () {
this.$refs.ref_form.resetData();
this.formShow = false;
},
handleDetail(row) {
this.formTitle = "房屋详情";
this.formShow = true;
handleDetail (row) {
// this.formTitle = "";
// this.formShow = true;
// this.$nextTick(() => {
// this.$refs.ref_form.initForm("detail", row, this.agencyObj);
// });
this.detailShow = true
// const _data = await this.detail(row)
this.$nextTick(() => {
this.$refs.ref_form.initForm("detail", row, this.agencyObj);
});
this.$refs.ref_form_detail.initForm(row, this.agencyObj)
})
},
detailFormCancle () {
this.$refs.ref_form_detail.diaDestroy()
this.detailShow = false
},
handleAdd() {
handleAdd () {
this.formTitle = "新增房屋";
this.formShow = true;
this.$nextTick(() => {
@ -463,7 +465,7 @@ export default {
});
},
handleEdit(row) {
handleEdit (row) {
this.formTitle = "修改房屋";
this.formShow = true;
this.$nextTick(() => {
@ -471,15 +473,15 @@ export default {
});
},
addFormCancle() {
addFormCancle () {
this.formShow = false;
},
addFormOk() {
addFormOk () {
this.formShow = false;
this.loadTable();
},
deleteBatch() {
deleteBatch () {
if (this.selection.length > 0) {
this.$confirm("确认删除选择的房屋?", "提示", {
confirmButtonText: "确定",
@ -501,14 +503,14 @@ export default {
this.$message.warning("请先选择要删除的房屋");
}
},
selectAll(selection) {
selectAll (selection) {
this.selection = selection;
},
selectionChange(selection) {
selectionChange (selection) {
this.selection = selection;
},
async handleDelete(row) {
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -527,7 +529,7 @@ export default {
});
},
async deleteCommunityBatch() {
async deleteCommunityBatch () {
let ids = [];
this.selection.forEach((element) => {
ids.push(element.houseId);
@ -562,7 +564,7 @@ export default {
}
},
async deleteRoom(row) {
async deleteRoom (row) {
const url = "/gov/org/house/housedel";
let params = {
@ -584,7 +586,7 @@ export default {
},
//
async handleExport() {
async handleExport () {
let title = this.agencyObj.label;
title = title + "—房屋列表";
@ -635,7 +637,7 @@ export default {
},
//
download(data, fileName) {
download (data, fileName) {
if (!data) {
return;
}
@ -659,7 +661,7 @@ export default {
}
},
handleExportModule() {
handleExportModule () {
let title = "";
title = "房屋模板";
@ -679,7 +681,7 @@ export default {
},
//
handleExportYihuyidang() {
handleExportYihuyidang () {
this.yihuyidangDisabled = true;
let title = this.agencyObj.label;
title = title + "-一户一档";
@ -735,7 +737,7 @@ export default {
);
},
//
beforeUpload(file) {
beforeUpload (file) {
this.files = file;
const isText = file.type === "application/vnd.ms-excel";
@ -752,11 +754,11 @@ export default {
}
},
//
handleExceed(files, fileList) {
handleExceed (files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`);
},
async uploadFile() {
async uploadFile () {
if (this.fileName == "") {
this.$message.warning("请选择要上传的文件!");
return false;
@ -805,7 +807,7 @@ export default {
);
},
showMessage(msg) {
showMessage (msg) {
this.$alert(msg, "操作结果", {
confirmButtonText: "关闭",
callback: (action) => {
@ -815,18 +817,18 @@ export default {
});
},
handleSizeChange(val) {
handleSizeChange (val) {
this.pageSize = val;
this.pageNo = 1;
this.loadTable();
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.pageNo = val;
this.loadTable();
},
//
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -834,7 +836,7 @@ export default {
});
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();
@ -842,7 +844,7 @@ export default {
},
},
watch: {
selection(val) {
selection (val) {
if (val.length > 0) {
this.showDeletBtn = true;
} else {

335
src/views/modules/workPc/guidance/DetailForm.vue

@ -1,107 +1,96 @@
<template>
<div class="div_main">
<div class="div_btn">
<el-card>
<div v-if="isLoaded">
<div class="m-row">
<div class="m-row-info">
<div class="info-prop">
<span class="info-title-2">标题</span>
<span>{{ dataForm.title }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">分类</span>
<span>{{ dataForm.categoryName }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">发布单位</span>
<span>{{ dataForm.orgName}}</span>
</div>
</div>
</div>
<el-button type="default"
size="mini"
@click="diaCancel">取消返回</el-button>
<el-button v-if="formType!='D'"
type="primary"
size="mini"
@click="saveForm">保存发布</el-button>
<div class="div_editor">
<el-tabs v-model="activeName"
@tab-click="tabClick">
<el-tab-pane style="height:500px"
v-for="(item) in moduleArray"
:key="item.moduleId"
:label="item.moduleName"
:name="item.moduleId">
<Tinymce class="tinymce_view"
v-if="formType!='D'"
:ref="item.moduleId"
:id="item.moduleId"
v-model="item.moduleContent"
:height="450"
:customerId="customerId"
placeholder="在这里输入文字" />
<p v-else
class="text_p"
v-html="item.moduleContent"></p>
</el-tab-pane>
</el-tabs>
</div>
</div>
<div v-if="isLoaded"
class="div_content">
<div class="m-row">
<div class="m-row-info">
<div class="info-prop">
<span class="info-title-2">外链地址</span>
<span>{{ externalLink.externalLink?externalLink.externalLink:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地址说明</span>
<span>{{ externalLink.description?externalLink.description:'--' }}</span>
</div>
</div>
<div class="m-row-info">
<div class="info-prop">
<span class="info-title-2">附件</span>
<div v-for="(item,index) in fileList"
:key="index">
<iframe :src="item.url"
ref="iframes"
class="iframes"
id="iframes"
width="100%"
height="100%"
frameborder="0"
scrolling="yes"></iframe>
</div>
</div>
</div>
<el-form :inline="true"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:disabled="formType=='D'"
:label-width="'120px'">
<el-form-item label="标题"
prop="title">
<el-input class="item_width_1"
v-model="dataForm.title"
placeholder="标题"></el-input>
</el-form-item>
<el-form-item label="分类"
prop="categoryCode">
<el-select class="item_width_1"
v-model="dataForm.categoryCode"
placeholder="请选择">
<el-option v-for="item in categoryList"
:key="item.categoryCode"
:label="item.categoryName"
:value="item.categoryCode">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发布单位"
prop="orgId">
<el-select class="item_width_1"
v-model="dataForm.orgId"
placeholder="请选择">
<el-option v-for="(item,index) in orgList"
@click.native="orgChange(index)"
:key="item.orgId"
:label="item.orgName"
:value="item.orgId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="div_editor">
<el-tabs v-model="activeName"
@tab-click="tabClick">
<el-tab-pane style="height:500px"
v-for="(item) in moduleArray"
:key="item.moduleId"
:label="item.moduleName"
:name="item.moduleId">
<!-- 富文本编辑器 -->
<Tinymce class="tinymce_view"
v-if="formType!='D'"
:ref="item.moduleId"
:id="item.moduleId"
v-model="item.moduleContent"
:height="450"
:customerId="customerId"
placeholder="在这里输入文字" />
<p v-else
class="text_p"
v-html="item.moduleContent"></p>
</el-tab-pane>
</el-tabs>
</div>
</div>
<el-form :inline="true"
<!-- <el-form :inline="true"
:model="externalLink"
ref="externalLink"
:disabled="formType=='D'"
:label-width="'120px'">
<el-form-item label="外链地址"
prop="externalLink">
<el-input class="item_width_1"
v-model="externalLink.externalLink"
placeholder="外链地址"></el-input>
</el-form-item>
<el-form-item label="地址说明"
prop="description">
<el-input class="item_width_1"
v-model="externalLink.description"
placeholder="地址说明"></el-input>
</el-form-item>
<div>
<el-form-item class="block"
label="附件"
@ -123,8 +112,17 @@
</el-upload>
</el-form-item>
</div>
</el-form>
</div>
</el-form> -->
<div class="div-btn">
<el-button type="default"
size="mini"
@click="diaCancel"> </el-button>
</div>
</el-card>
</div>
</template>
@ -150,8 +148,7 @@ export default {
customerId: '',
formType: '', // A/U D()
guideId: '', // id
categoryList: [],
orgList: [],
dataForm: {
guideId: '',
@ -205,59 +202,19 @@ export default {
this.formType = formType
this.guideId = guideId
this.resetData()
await this.loadOrg()
await this.getcategory()
await this.loadModule()
if (formType === 'A') {
await this.loadModule()
} else {
this.guideId = guideId
this.dataForm.guideId = guideId
await this.loadFormData()
}
this.guideId = guideId
this.dataForm.guideId = guideId
await this.loadFormData()
this.endLoading()
this.isLoaded = true
},
async getcategory () {
const url = '/gov/voice/guidecategory/getcategory'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/voice/guidecategory/getcategory'
const params = {
queryOrigin: 'saveorupdate'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.categoryList = data
} else {
this.$message.error(msg)
}
},
async loadOrg () {
const url = '/gov/org/staff/orgList'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/staff/orgList'
const params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.orgList = data
if (data.length > 0) {
this.dataForm.orgId = data[0].orgId
this.dataForm.orgType = data[0].orgType
this.dataForm.orgName = data[0].orgName
}
} else {
this.$message.error(msg)
}
},
//tab
async loadModule () {
@ -284,12 +241,6 @@ export default {
}
},
//
orgChange (index) {
console.log(index)
this.dataForm.orgName = this.orgList[index].orgName
this.dataForm.orgType = this.orgList[index].orgType
},
tabClick (selTab) {
console.log(selTab.index)
@ -334,6 +285,7 @@ export default {
this.$message.error(msg)
}
},
dormatHtml (content) {
let c = ''
if (content.indexOf('DOCTYPE') != -1) {
@ -342,101 +294,12 @@ export default {
console.log('content', typeof content)
return c || content
},
saveForm () {
this.dataForm.moduleList = []
this.moduleArray.forEach(element => {
if (element.moduleContent) {
element.moduleContent = this.dormatHtml(element.moduleContent)
this.dataForm.moduleList.push(element)
}
});
if (this.externalLink.externalLink && this.externalLink.description) {
this.dataForm.externalLinks = []
this.dataForm.externalLinks.push(this.externalLink)
} else if (!this.externalLink.externalLink && !this.externalLink.description) {
this.dataForm.externalLinks = []
} else {
this.$message({
type: 'error',
message: '链接地址和地址说明必须同时填写'
})
}
if (this.fileList.length > 0) {
this.dataForm.attachmentList = this.fileList
}
if (this.moduleArray.length === 0 && this.dataForm.externalLinks.length === 0 && this.fileList.length === 0) {
this.$message({
type: 'error',
message: '文档内容、外链、附件至少填写一样'
})
return false
}
console.log(this.dataForm)
// return false
this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
} else {
let url = ''
if (this.formType === 'U') {
url = '/gov/voice/guide/edit'
// url = 'http://yapi.elinkservice.cn/mock/102/gov/voice/guide/edit'
} else {
url = "/gov/voice/guide/add"
// url = "http://yapi.elinkservice.cn/mock/102/gov/voice/guide/add"
}
window.app.ajax.post(url, this.dataForm,
(data, rspMsg) => {
this.$message({
type: 'success',
message: '保存成功'
})
this.$emit('refresh')
this.$emit('cancleBack')
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}
})
},
resetData () {
this.moduleArray = []
// this.moduleArray.forEach(element => {
// if (element.moduleContent) {
// element.moduleContent = ''
// }
// });
this.externalLink = {
externalLink: "",
description: ""
}
this.fileList = []
this.dataForm = {
guideId: '',
title: '',
categoryCode: '',
orgId: '',
orgType: '',
orgName: '',
moduleList: [],
externalLinks: [],
attachmentList: []
}
},
//
diaCancel () {
this.resetData()
this.$emit('cancleBack')
},
@ -540,6 +403,10 @@ export default {
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
<style lang="css" scoped>
.div_btn {
z-index: 10;

590
src/views/modules/workPc/guidance/addForm.vue

@ -0,0 +1,590 @@
<template>
<div class="div_main">
<div class="div_btn">
<el-button type="default"
size="mini"
@click="diaCancel">取消返回</el-button>
<el-button v-if="formType!='D'"
type="primary"
size="mini"
@click="saveForm">保存发布</el-button>
</div>
<div v-if="isLoaded"
class="div_content">
<el-form :inline="true"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:disabled="formType=='D'"
:label-width="'120px'">
<el-form-item label="标题"
prop="title">
<el-input class="item_width_1"
v-model="dataForm.title"
placeholder="标题"></el-input>
</el-form-item>
<el-form-item label="分类"
prop="categoryCode">
<el-select class="item_width_1"
v-model="dataForm.categoryCode"
placeholder="请选择">
<el-option v-for="item in categoryList"
:key="item.categoryCode"
:label="item.categoryName"
:value="item.categoryCode">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发布单位"
prop="orgId">
<el-select class="item_width_1"
v-model="dataForm.orgId"
placeholder="请选择">
<el-option v-for="(item,index) in orgList"
@click.native="orgChange(index)"
:key="item.orgId"
:label="item.orgName"
:value="item.orgId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="div_editor">
<el-tabs v-model="activeName"
@tab-click="tabClick">
<el-tab-pane style="height:500px"
v-for="(item) in moduleArray"
:key="item.moduleId"
:label="item.moduleName"
:name="item.moduleId">
<!-- 富文本编辑器 -->
<Tinymce class="tinymce_view"
v-if="formType!='D'"
:ref="item.moduleId"
:id="item.moduleId"
v-model="item.moduleContent"
:height="450"
:customerId="customerId"
placeholder="在这里输入文字" />
<p v-else
class="text_p"
v-html="item.moduleContent"></p>
</el-tab-pane>
</el-tabs>
</div>
<el-form :inline="true"
:model="externalLink"
ref="externalLink"
:disabled="formType=='D'"
:label-width="'120px'">
<el-form-item label="外链地址"
prop="externalLink">
<el-input class="item_width_1"
v-model="externalLink.externalLink"
placeholder="外链地址"></el-input>
</el-form-item>
<el-form-item label="地址说明"
prop="description">
<el-input class="item_width_1"
v-model="externalLink.description"
placeholder="地址说明"></el-input>
</el-form-item>
<div>
<el-form-item class="block"
label="附件"
prop="attach">
<el-upload class="upload-demo"
:action="uploadUlr"
:data="{customerId:customerId}"
accept=".doc,.pdf,.xls,.docx,.xlsx"
:on-success="handleFileSuccess"
:on-remove="handleFileRemove"
:on-preview="handleFileDownload"
:limit="3"
:before-upload="beforeUpload"
:file-list="fileList">
<el-button size="small"
type="primary">点击上传</el-button>
<div slot="tip"
class="el-upload__tip">只能上传wordexcelpdf文件</div>
</el-upload>
</el-form-item>
</div>
</el-form>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import Tinymce from '@c/tinymce2/index.vue'
// import tinymce from 'tinymce/tinymce'
// import Editor from '@tinymce/tinymce-vue'
// import 'tinymce/themes/silver'
// import 'tinymce/icons/default/icons'
let loading//
export default {
data () {
return {
defaultValue: '',
customerId: '',
formType: '', // A/U D()
guideId: '', // id
categoryList: [],
orgList: [],
dataForm: {
guideId: '',
title: '',
categoryCode: '',
orgId: '',
orgType: '',
orgName: '',
moduleList: [],
externalLinks: [],
attachmentList: []
},
externalLink: {
externalLink: "",
description: ""
},
isLoaded: false,//
editorOption: {
placeholder: '编辑文章内容'
},
activeName: "",
moduleArray: [],
selTabIndex: 0,
fileList: [
// {
// name: 'food.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
// }, {
// name: 'food2.jpeg',
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
// }
],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/upload-guide-file',
}
},
mounted () {
this.customerId = localStorage.getItem('customerId')
// tinymce.init({})
},
methods: {
saveProjectInfo () {
},
async initData (guideId, formType) {
this.startLoading()
this.formType = formType
this.guideId = guideId
this.resetData()
await this.loadOrg()
await this.getcategory()
await this.loadModule()
if (formType === 'A') {
} else {
this.guideId = guideId
this.dataForm.guideId = guideId
await this.loadFormData()
}
this.endLoading()
this.isLoaded = true
},
async getcategory () {
const url = '/gov/voice/guidecategory/getcategory'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/voice/guidecategory/getcategory'
const params = {
queryOrigin: 'saveorupdate'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.categoryList = data
} else {
this.$message.error(msg)
}
},
async loadOrg () {
const url = '/gov/org/staff/orgList'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/staff/orgList'
const params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.orgList = data
if (data.length > 0) {
this.dataForm.orgId = data[0].orgId
this.dataForm.orgType = data[0].orgType
this.dataForm.orgName = data[0].orgName
}
} else {
this.$message.error(msg)
}
},
//tab
async loadModule () {
const url = '/gov/voice/guidemodule/list'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/voice/guidemodule/list'
const params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.moduleArray = data
this.moduleArray.forEach(element => {
element.editorOption = {
placeholder: '输入' + element.moduleName
}
});
if (data.length > 0) {
this.activeName = data[0].moduleId
}
} else {
this.$message.error(msg)
}
},
//
orgChange (index) {
console.log(index)
this.dataForm.orgName = this.orgList[index].orgName
this.dataForm.orgType = this.orgList[index].orgType
},
tabClick (selTab) {
console.log(selTab.index)
this.selTabIndex = selTab.index
},
onEditorChange ({ editor, html, text }) {
if (this.isLoaded) {
this.moduleArray[this.selTabIndex].moduleContent = html
}
},
async loadFormData () {
this.isLoaded = false
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/voice/guide/detail'
const url = '/gov/voice/guide/detail'
let params = {
guideId: this.guideId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.dataForm = data
// debugger
if (data.externalLinks && data.externalLinks.length > 0) {
this.externalLink = data.externalLinks[0]
}
if (data.attachmentList) {
this.fileList = data.attachmentList
}
if (data.moduleList && data.moduleList.length > 0) {
this.moduleArray = data.moduleList
}
console.log(this.moduleArray)
} else {
this.$message.error(msg)
}
},
dormatHtml (content) {
let c = ''
if (content.indexOf('DOCTYPE') != -1) {
c = content.slice(45, -16);
}
console.log('content', typeof content)
return c || content
},
saveForm () {
this.dataForm.moduleList = []
this.moduleArray.forEach(element => {
if (element.moduleContent) {
element.moduleContent = this.dormatHtml(element.moduleContent)
this.dataForm.moduleList.push(element)
}
});
if (this.externalLink.externalLink && this.externalLink.description) {
this.dataForm.externalLinks = []
this.dataForm.externalLinks.push(this.externalLink)
} else if (!this.externalLink.externalLink && !this.externalLink.description) {
this.dataForm.externalLinks = []
} else {
this.$message({
type: 'error',
message: '链接地址和地址说明必须同时填写'
})
}
if (this.fileList.length > 0) {
this.dataForm.attachmentList = this.fileList
}
if (this.moduleArray.length === 0 && this.dataForm.externalLinks.length === 0 && this.fileList.length === 0) {
this.$message({
type: 'error',
message: '文档内容、外链、附件至少填写一样'
})
return false
}
console.log(this.dataForm)
// return false
this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
} else {
let url = ''
if (this.formType === 'U') {
url = '/gov/voice/guide/edit'
// url = 'http://yapi.elinkservice.cn/mock/102/gov/voice/guide/edit'
} else {
url = "/gov/voice/guide/add"
// url = "http://yapi.elinkservice.cn/mock/102/gov/voice/guide/add"
}
window.app.ajax.post(url, this.dataForm,
(data, rspMsg) => {
this.$message({
type: 'success',
message: '保存成功'
})
this.$emit('refresh')
this.$emit('cancleBack')
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}
})
},
resetData () {
this.moduleArray = []
// this.moduleArray.forEach(element => {
// if (element.moduleContent) {
// element.moduleContent = ''
// }
// });
this.externalLink = {
externalLink: "",
description: ""
}
this.fileList = []
this.dataForm = {
guideId: '',
title: '',
categoryCode: '',
orgId: '',
orgType: '',
orgName: '',
moduleList: [],
externalLinks: [],
attachmentList: []
}
},
//
diaCancel () {
this.resetData()
this.$emit('cancleBack')
},
beforeUpload (file) {
const array = file.name.split('.')
const extension = array[array.length - 1]
if (extension !== 'xls'
&& extension !== 'xlsx'
&& extension !== 'doc'
&& extension !== 'docx'
&& extension !== 'pdf') {
this.$message.error('只能上传word、excel、pdf文件!')
return false
}
// if (!isLt2M) {
// this.$message.warning(' 5MB!')
// return
// }
// return false // false
},
handleFileRemove (file) {
if (file && file.status === "success") {
this.fileList.splice(this.fileList.findIndex(item => item.uid === file.uid), 1)
}
},
handleFileSuccess (res, file) {
if (res.code === 0 && res.msg === 'success') {
const array = file.name.split('.')
const fileType = array[array.length - 1]
file.url = res.data.url
file.type = fileType
this.fileList.push(file)
console.log(this.fileList)
} else this.$message.error(res.msg)
},
//
handleFileDownload (file) {
var a = document.createElement('a');
var event = new MouseEvent('click');
a.download = file.name;
console.log(a)
a.href = file.url;
a.dispatchEvent(event);
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
components: {
Tinymce
},
computed: {
dataRule () {
return {
categoryCode: [
{ required: true, message: '分类不能为空', trigger: 'blur' }
],
orgId: [
{ required: true, message: '发布单位不能为空', trigger: 'blur' }
],
title: [
{ required: true, message: '标题不能为空', trigger: 'blur' }
]
}
},
...mapGetters(['clientHeight', 'resolution']),
},
}
</script>
<style lang="css" scoped>
.div_btn {
z-index: 10;
position: absolute;
right: 50px;
top: 20px;
/* margin: 0 0 20px 0; */
}
.div_editor {
margin-left: 60px;
width: 90%;
}
.div_editor >>> .el-tabs--card > .el-tabs__header .el-tabs__nav {
border: none;
}
.el-tabs__nav-wrap::after {
background-color: white;
}
.el-tabs__active-bar {
background-color: white;
}
.div_content {
margin-top: 30px;
}
.item_width_1 {
width: 300px;
}
.item_width_2 {
width: 500px;
}
.block {
display: block;
}
.text_p {
height: 400px;
overflow: auto;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
</style>

42
src/views/modules/workPc/guidance/guidanceList.vue

@ -1,6 +1,6 @@
<template>
<div class="registerList resi-container">
<div v-show="!formShow">
<div v-show="formShow==='list'">
<el-card ref="searchCard"
class="search-card">
<el-form :inline="true"
@ -77,24 +77,26 @@
@confirmDel="confirmDel">
</c-table>
<!-- <div v-show="formShow">
<detail-form ref="ref_edit_form"
@cancleBack="cancleBack"
@refresh="loadData"></detail-form>
</div> -->
</el-card>
</div>
<el-card v-show="formShow">
<detail-form ref="ref_edit_form"
@cancleBack="cancleBack"
@refresh="loadData"></detail-form>
<el-card v-show="formShow==='edit'">
<add-form ref="ref_edit_form"
@cancleBack="cancleBack"
@refresh="loadData"></add-form>
</el-card>
<!-- <el-card v-show="formShow==='detail'"> -->
<detail-form v-show="formShow==='detail'"
ref="ref_detail_form"
@cancleBack="cancleBack"></detail-form>
<!-- </el-card> -->
</div>
</template>
<script>
import CTable from '@c/CTable'
import DetailForm from './DetailForm'
import addForm from './addForm'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
@ -107,8 +109,9 @@ export default {
userId: '',
isStaff: false,
//
labelWidth: '70px',
formShow: false,
labelWidth: '80px',
formShow: 'list',
optionProps: {
checkStrictly: true,
@ -188,7 +191,8 @@ export default {
},
components: {
CTable,
DetailForm
DetailForm,
addForm
},
activated () {
this.$nextTick(() => {
@ -255,19 +259,22 @@ export default {
//
add () {
this.formShow = true
this.formShow = 'edit'
this.$refs['ref_edit_form'].initData("", "A")
},
//
detail (row) {
this.formShow = true
// this.formShow = 'detail'
// this.$refs['ref_detail_form'].initData(row.guideId, "D")
this.formShow = 'edit'
this.$refs['ref_edit_form'].initData(row.guideId, "D")
},
edit (row) {
this.formShow = true
this.formShow = 'edit'
this.$refs['ref_edit_form'].initData(row.guideId, "U")
},
@ -299,7 +306,8 @@ export default {
},
cancleBack () {
this.formShow = false
this.formShow = 'list'
},
async getAgencylist () {

Loading…
Cancel
Save