Browse Source

服务事项分类

shibei_prod
jiangyy 4 years ago
parent
commit
a352fbe5fb
  1. 26
      src/router/index.js
  2. 343
      src/views/components/scoreRecord.vue
  3. 2
      src/views/modules/base/community/roomForm.vue
  4. 567
      src/views/modules/communityParty/regionalParty/finishList.vue
  5. 111
      src/views/modules/communityParty/regionalParty/units.vue
  6. 321
      src/views/modules/systemManagement/serviceMatter/service.vue
  7. 232
      src/views/modules/systemManagement/serviceMatter/serviceForm.vue
  8. 10
      src/views/modules/visual/basicinfo/personCategory/Base.js
  9. 68
      src/views/modules/visual/basicinfo/personCategory/components/screen-loading/index.vue
  10. 307
      src/views/modules/visual/basicinfo/personCategory/components/screen-table/index.vue
  11. 164
      src/views/modules/visual/basicinfo/personCategory/index.vue

26
src/router/index.js

@ -226,19 +226,19 @@ router.beforeEach((to, from, next) => {
icon: "icon-setting",
id: "22213213",
name: "基础信息",
url: "visual/basicinfo/basicInfoMain",
// children: [
// // {
// // url: "/visual/basicinfo/basicInfoMain",
// // name: "基础信息",
// // id: "5feawfwaefwa5",
// // },
// // {
// // url: "/visual/basicinfo/basicInfoMain",
// // name: "人员类别分析",
// // id: "5fwaefwaefawef5",
// // },
// ],
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/basicinfo/basicInfoMain",
name: "基础信息",
id: "5feawfwaefwa5",
},
{
url: "/visual/basicinfo/personCategory/index",
name: "人员类别分析",
id: "5fwaefwaefawef5",
},
],
},
{
icon: "icon-setting",

343
src/views/components/scoreRecord.vue

@ -0,0 +1,343 @@
<template>
<div class="div_main">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<el-form-item label="查询时间"
prop="startTime">
<el-date-picker v-model="timeRange"
type="daterange"
:clearable="false"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
prefix-icon="el-icon-caret-bottom"
value-format="yyyy-MM-dd"
@change="handleTimeChange">
</el-date-picker>
</el-form-item>
<div>
<el-form-item label="总计:"
prop="startTime">
<span>{{totalScore}}</span>
</el-form-item>
</div>
</el-form>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="unitName"
header-align="center"
align="center"
label="需求类型"
width="180">
</el-table-column>
<el-table-column prop="title"
header-align="center"
align="center"
label="需求人"
width="100">
</el-table-column>
<el-table-column prop="address"
header-align="center"
align="center"
label="需求内容"
min-width="230">
</el-table-column>
<el-table-column prop="activityTime"
header-align="center"
align="center"
label="时间"
width="150">
</el-table-column>
<el-table-column prop="activityTime"
header-align="center"
align="center"
label="评价"
width="80">
</el-table-column>
<el-table-column prop="activityTime"
header-align="center"
align="center"
label="积分"
width="80">
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import util from '@js/util.js';
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
totalScore: 100,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
pickerOptions: { //
disabledDate (time) {
return time.getTime() > (Date.now() - (24 * 60 * 60 * 1000))
}
},
timeRange: [],
unitId: '',
formData: {
startTime: '',
endTime: ''
},
tableData: [],
}
},
components: {
},
async created () {
},
async mounted () {
},
methods: {
async initForm (row) {
this.initDate()
const { user } = this.$store.state
this.agencyId = user.agencyId
//
await this.loadTable()
},
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = true
const url = "/heart/icpartyactivity/search"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list"
let params = {
agencyId: this.agencyId,
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
//
initDate () {
let yesterday = new Date((new Date).getTime() - 24 * 60 * 60 * 1000)
let year = yesterday.getFullYear()
let month = yesterday.getMonth() + 1 //
let day = yesterday.getDate() //
let days = new Date(year, month, 0);
days = days.getDate(); //
let year2 = year;
let month2 = parseInt(month) - 1;
if (month2 == 0) {
year2 = parseInt(year2) - 1;
month2 = 12;
}
let day2 = day;
let days2 = new Date(year2, month2, 0);
days2 = days2.getDate();
if (day2 > days2) {
day2 = days2;
}
if (month2 < 10) {
month2 = '0' + month2;
}
if (month < 10) {
month = '0' + month;
}
if (day < 10) {
day = '0' + day;
}
if (day2 < 10) {
day2 = '0' + day2;
}
let t2 = year2 + '-' + month2 + '-' + day2;
let t1 = year + '-' + month + '-' + day;
// let t3 = formate(t2, style);
this.timeRange = [t2, t1]
},
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00'
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59'
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = ''
this.formData.endTime = ''
// this.startTimeShow = ''
// this.endTimeShow = ''
}
this.loadTable()
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 460)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss";
.div_main {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 495px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

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

@ -137,7 +137,7 @@ export default {
houseId: '', //ID
houseType: '1',
purpose: '1',
rentFlag: 1,
rentFlag: 0,
dataForm: {
neighborHoodId: '', // ID
buildingId: '',//ID

567
src/views/modules/communityParty/regionalParty/finishList.vue

@ -0,0 +1,567 @@
<template>
<div>
<div class="div_table">
<el-button type="green"
size="small"
@click="handleAdd">新增</el-button>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50">
</el-table-column>
<el-table-column prop="year"
header-align="center"
align="center"
label="年份"
min-width="90">
<template slot-scope="scope">
<div v-if="scope.row.isEdit">
<el-select class="item_width_2"
v-model="scope.row.year"
placeholder="请选择">
<el-option v-for="(item,index) in yearList"
@click.native="hancleChangeYear(scope.row,index,scope.$index)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<span v-else>{{scope.row.year}}</span>
</template>
</el-table-column>
<el-table-column prop="timeType"
header-align="center"
align="center"
label="类型"
min-width="90">
<template slot-scope="scope">
<div v-if="scope.row.isEdit">
<el-select class="item_width_2"
v-model="scope.row.timeType"
placeholder="请选择">
<el-option v-for="(item,index) in typeList"
@click.native="hancleChangeType(scope.row,index,scope.$index)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<span v-else>{{scope.row.typeShow}}</span>
</template>
</el-table-column>
<el-table-column prop="time"
header-align="center"
align="center"
label="时间"
min-width="100">
<template slot-scope="scope">
<div v-if="scope.row.isEdit">
<el-select class="item_width_3"
v-model="scope.row.time"
placeholder="请选择">
<el-option v-for="item in scope.row.timeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<span v-else>{{scope.row.timeShow}}</span>
</template>
</el-table-column>
<el-table-column prop="state"
header-align="center"
align="center"
label="完成情况"
min-width="90">
<template slot-scope="scope">
<div v-if="scope.row.isEdit">
<el-select class="item_width_2"
v-model="scope.row.state"
placeholder="全部">
<el-option v-for="item in stateList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<span v-else>{{scope.row.state==='1'?'完成':'未完成'}}</span>
</template>
</el-table-column>
<el-table-column prop="score"
header-align="center"
align="center"
label="评分(百分制)"
min-width="150">
<template slot-scope="scope">
<div v-if="scope.row.isEdit">
<el-input-number class="item_width_1"
v-model="scope.row.score"
:precision="1"
:step="0.1"
:max="100"></el-input-number>
</div>
<span v-else>{{scope.row.score}}</span>
</template>
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="120"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button v-if="scope.row.isEdit"
type="text"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleComfirm(scope.row,scope.$index)">保存</el-button>
<el-button v-if="!scope.row.isEdit"
type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row,scope.$index)">修改</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDelete(scope.row,scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- <div class="div_btn">
<el-button @click="handleCancle"> </el-button>
</div> -->
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
let loading //
export default {
data () {
return {
tableLoading: false,
typeList: [
{
value: 'quarter',
label: '季度'
},
{
value: 'month',
label: '月度'
}
],
yearList: [
{
value: '2019',
label: '2019'
},
{
value: '2020',
label: '2020'
},
{
value: '2021',
label: '2021'
},
],
quarterList: [
{
value: '1',
label: '第一季度'
},
{
value: '2',
label: '第一季度'
},
{
value: '3',
label: '第二季度'
},
{
value: '4',
label: '第三季度'
},
],
monthlist: [],
timeList: [],
stateList: [
{
value: '1',
label: '完成'
},
{
value: '2',
label: '未完成'
},
],
tableData: [
{
timeType: 'month',
typeShow: '月度',
year: '2019',
time: '12',
timeShow: '12月',
state: '1',
stateShow: '完成',
score: 90
},
{
timeType: 'quarter',
typeShow: '季度',
year: '2019',
time: '3',
timeShow: '第三季度',
state: '2',
stateShow: '未完成',
score: 90
}
],
}
},
components: {},
mounted () {
},
methods: {
async initTable () {
//
this.initData()
await this.loadTable()
},
//
initData () {
let today = new Date((new Date).getTime())
let year = today.getFullYear()
this.yearList = []
for (let i = 0; i < 20; i++) {
let obj = {
label: (year - i) + '',
value: (year - i) + '',
}
this.yearList.push(obj)
}
this.monthlist = []
for (let i = 1; i < 13; i++) {
let obj = {
label: i + '月',
value: i + '',
}
this.monthlist.push(obj)
}
},
//
async hancleChangeType (row, index, tableIndex) {
let empetArray = []
this.tableData[tableIndex].timeList = [...empetArray]
let rowData = JSON.parse(JSON.stringify(row))
rowData.time = ''
this.$set(this.tableData, tableIndex, rowData)
if (row.timeType === 'month') {
this.tableData[tableIndex].timeList = [...this.monthlist]
} else if (row.timeType === 'quarter') {
this.tableData[tableIndex].timeList = [...this.quarterList]
}
},
// row index timeList tableIndex
hancleChangeYear (row, index, tableIndex) {
},
//form
async loadTable () {
this.tableData.forEach(item => {
item.isEdit = false
item.timeList = []
});
return false
this.tableLoading = true
const url = '/gov/org/placepatrolreviewrecord/getlist'
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolreviewrecord/getlist'
let params = {
placePatrolRecordId: this.placePatrolRecordId
}
const { data, code, msg } = await requestPost(url, params)
this.tableLoading = false
if (code === 0) {
if (data.list && data.list.length > 0) {
data.list.forEach(item => {
item.isEdit = false
item.isNew = false
let arrayInspectors = item.inspectors.split(',')
item.inspectorArray = [...arrayInspectors]
let arrayReviewTime = item.reviewTime.split(' ')
item.reviewTime = arrayReviewTime[0]
});
this.tableData = [...data.list]
} else {
this.tableData = []
}
} else {
this.$message.error(msg)
}
},
handleAdd () {
let obj = {
isEdit: true,//
timeType: '',
typeShow: '',
year: '',
time: '',
timeShow: '',
state: '',
stateShow: '',
score: 0.0
}
this.tableData.push(obj)
},
async handleEdit (row, tableIndex) {
let rowData = JSON.parse(JSON.stringify(row))
rowData.isEdit = true
this.$set(this.tableData, tableIndex, rowData)
if (row.timeType === 'month') {
this.tableData[tableIndex].timeList = [...this.monthlist]
} else if (row.timeType === 'quarter') {
this.tableData[tableIndex].timeList = [...this.quarterList]
}
},
async handleComfirm (row, tableIndex) {
let valiMsg = this.validata(row)
if (valiMsg) {
this.$message({
type: 'warning',
message: valiMsg
})
return false
}
this.addReview(row, tableIndex)
},
async addReview (row, tableIndex) {
console.log(row)
return false
let url = "/gov/org/placepatrolreviewrecord/add"
if (row.placePatrolReviewRecordId) {
url = "/gov/org/placepatrolreviewrecord/edit"
}
let params = JSON.parse(JSON.stringify(row))
params.inspectors = params.inspectorArray.join(',')
params.reviewTime = params.reviewTime + ' 00:00:00'
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
let array = data.reviewTime.split(' ')
data.reviewTime = array[0]
data.isEdit = false
data.isNew = false
this.$set(this.tableData, tableIndex, data)
} else {
this.$message.error(msg)
}
},
validata (row) {
let message = ''
if (!row.year) {
message = message + '年份不能为空;'
}
if (!row.timeType) {
message = message + '类型不能为空;'
}
if (!row.time) {
message = message + '时间不能为空;'
}
if (!row.state) {
message = message + '完成情况不能为空;'
}
if (row.score !== 0 && !row.score) {
message = message + '评分不能为空;'
}
return message
},
async handleDelete (row, tableIndex) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (row.placePatrolReviewRecordId) {//id
this.deleteRecord(row, tableIndex)
} else {//id
this.tableData.splice(tableIndex, 1);
}
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteRecord (row, tableIndex) {
const url = "/gov/org/placepatrolreviewrecord/del"
let params = {
placePatrolReviewRecordId: row.placePatrolReviewRecordId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.$message({
// type: "success",
// message: ""
// });
this.tableData.splice(tableIndex, 1);
} else {
this.$message.error(msg)
}
},
handleCancle () {
this.$emit('dialogCancle')
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 360)
},
...mapGetters(['clientHeight'])
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss";
.item_width_1 {
width: 150px;
}
.item_width_2 {
width: 100px;
}
.item_width_3 {
width: 120px;
}
.div_table {
margin-top: 10px;
// background: #ffffff;
// box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
// border-radius: 4px;
.table {
margin-top: 20px;
}
}
.div_btn {
margin-top: 10px;
display: flex;
justify-content: flex-end;
}
</style>

111
src/views/modules/communityParty/regionalParty/units.vue

@ -126,19 +126,19 @@
header-align="center"
align="center"
label="单位名称"
width="180">
min-width="100">
</el-table-column>
<el-table-column prop="type"
header-align="center"
align="center"
label="分类"
width="80">
min-width="80">
</el-table-column>
<el-table-column prop="serviceMatterList"
header-align="center"
align="center"
label="服务事项"
min-width="180">
min-width="250">
<template slot-scope="scope">
<p style="text-align:center;margin:2px 0;"
@ -157,7 +157,7 @@
header-align="center"
align="center"
label="联系电话"
width="110">
width="120">
</el-table-column>
<el-table-column prop="memberCount"
header-align="center"
@ -180,25 +180,36 @@
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="140"
width="190"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
<div>
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleFinish(scope.row)">完成情况</el-button>
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleScore(scope.row)">积分记录</el-button>
</div>
<div>
<el-button type="text"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
@ -221,23 +232,46 @@
:title="formTitle"
width="950px"
top="5vh"
@closed="diaClose">
@closed="editDiaClose">
<units-form ref="ref_form"
:serviceList="serviceList"
:typeList="typeList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></units-form>
</el-dialog>
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'单位详情'"
width="950px"
top="5vh"
@closed="detailClosed">
@closed="diaClose">
<units-detail ref="ref_detail"></units-detail>
</el-dialog>
<!-- 完成情况 -->
<el-dialog :visible.sync="finishDiaShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="finishDiaTitle"
width="950px"
top="5vh"
@closed="diaClose">
<finish-list ref="ref_finish"></finish-list>
</el-dialog>
<!-- 积分记录 -->
<el-dialog :visible.sync="scoreDiaShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="scoreDiaTitle"
width="1050px"
top="5vh"
@closed="diaClose">
<score-record ref="ref_score"></score-record>
</el-dialog>
</div>
</template>
@ -245,6 +279,8 @@
import unitsForm from './unitsForm'
import unitsDetail from './unitsDetail'
import finishList from './finishList'
import scoreRecord from '../../../components/scoreRecord.vue'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
@ -298,6 +334,13 @@ export default {
formTitle: '新增单位',
detailShow: false,
//
finishDiaTitle: '区域化党建单位完成情况',
finishDiaShow: false,
//
scoreDiaTitle: '积分记录',
scoreDiaShow: false,
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
@ -305,7 +348,7 @@ export default {
}
},
components: {
unitsForm, unitsDetail
unitsForm, unitsDetail, finishList, scoreRecord
},
async created () {
@ -390,14 +433,14 @@ export default {
this.tableLoading = false
},
diaClose () {
editDiaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
detailClosed () {
diaClose () {
this.detailShow = false
this.finishDiaShow = false
this.scoreDiaShow = false
},
handleDetail (row) {
@ -407,6 +450,22 @@ export default {
})
},
//
handleFinish (row) {
this.finishDiaTitle = row.unitName + '完成情况'
this.finishDiaShow = true
this.$nextTick(() => {
this.$refs.ref_finish.initTable(row)
})
},
//
handleScore (row) {
this.scoreDiaShow = true
this.$nextTick(() => {
this.$refs.ref_score.initForm(row)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = 'edit'

321
src/views/modules/systemManagement/serviceMatter/service.vue

@ -0,0 +1,321 @@
<template>
<div class="div_main">
<div class="div_table">
<div class="div_btn">
<el-button style=""
type="green"
size="small"
@click="handleAdd">新增</el-button>
</div>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column prop="categoryName"
header-align="center"
align="center"
label="分类名称"
min-width="280">
</el-table-column>
<el-table-column prop="awardPoint"
header-align="center"
align="center"
label="积分"
min-width="80">
</el-table-column>
<el-table-column prop="usableFlagShow"
header-align="center"
align="center"
label="状态"
min-width="100">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="190"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button v-if="scope.row.usableFlag"
type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDisable(scope.row,'disable')">禁用</el-button>
<el-button v-if="!scope.row.usableFlag"
type="text"
style="color:#D51010;text-decoration: underline;"
size="small"
@click="handleDisable(scope.row,'able')">启用</el-button>
<el-button type="text"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="950px"
top="5vh"
@closed="diaClose">
<service-form ref="ref_form"
:customerId="customerId"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></service-form>
</el-dialog>
</div>
</template>
<script>
import serviceForm from './serviceForm'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
customerId: '',
tableData: [],
//form
formShow: false,
formTitle: '新增二级分类',
}
},
components: {
serviceForm
},
async created () {
},
async mounted () {
this.initData()
},
methods: {
initData () {
let { user } = this.$store.state
if (!user.customerId) {
setTimeout(() => {
this.initData()
}, 500)
} else {
this.customerId = user.customerId
this.loadTable()
}
},
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = true
// const url = "/heart/serviceitem/list"
const url = "http://yapi.elinkservice.cn/mock/245/heart/serviceitem/list"
let params = {
customerId: this.customerId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
this.tableData.forEach(item => {
item.usableFlagShow = item.usableFlag ? '启用' : '禁用'
});
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
handleAdd () {
this.formTitle = '新增二级分类'
this.formShow = 'edit'
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDisable (row, type) {
let title = type === 'able' ? '启用' : '禁用'
this.$confirm("确认" + title + "?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.disableService(row, type)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async disableService (row, type) {
// const url = "/heart/serviceitem/updatestatus"
const url = "http://yapi.elinkservice.cn/mock/245/heart/serviceitem/updatestatus"
let params = {
id: row.categoryId,
usableFlag: type === 'able'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "操作成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 210)
},
rowHeight () {
return (this.clientHeight - 200) + 'px'
},
...mapGetters(['clientHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/buttonstyle.scss";
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 620px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

232
src/views/modules/systemManagement/serviceMatter/serviceForm.vue

@ -0,0 +1,232 @@
<template>
<div>
<div>
<div>
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="分类名称"
prop="categoryName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="20"
show-word-limit
placeholder="请输入分类名称"
v-model="formData.categoryName">
</el-input>
</el-form-item>
<el-form-item label="奖励积分"
style="display: block"
prop="awardPoint"
label-width="150px">
<el-input-number class="item_width_1"
v-model="formData.awardPoint"
:min="0"
label="奖励积分"></el-input-number>
</el-form-item>
</el-form>
</div>
</div>
<div class="div_btn">
<el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
keyWords: '',
formData: {
customerId: '',
categoryName: '',
categoryId: '',
awardPoint: null
},
}
},
components: {},
mounted () {
},
methods: {
async initForm (type, row) {
this.startLoading()
this.$refs.ref_form.resetFields();
this.formType = type
if (row) {
this.formData = JSON.parse(JSON.stringify(row))
} else {
this.resetData()
}
this.formData.customerId = this.customerId
this.endLoading()
},
async handleComfirm () {
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.addService()
}
})
},
async addService () {
// let url = '/heart/serviceitem/saveorupdate'
let url = "http://yapi.elinkservice.cn/mock/245/heart/serviceitem/saveorupdate"
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
this.btnDisable = false
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.formData = {
customerId: '',
categoryName: '',
categoryId: '',
awardPoint: null
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
categoryName: [
{ required: true, message: '分类名称不能为空', trigger: 'blur' },
],
awardPoint: [
{ required: true, message: '奖励积分不能为空', trigger: 'blur' }
],
}
},
},
props: {
customerId: {
type: String,
default: ""
}
}
}
</script>
<style scoped>
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
width: 200px;
}
.item_width_4 {
width: 200px;
}
.div_btn {
display: flex;
justify-content: flex-end;
}
.el-tabs {
margin: 0 20px;
}
.el-upload__tip {
color: rgb(155, 155, 155);
margin: 0;
}
.form {
margin-top: 30px;
}
</style>
<style lang=scss>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>

10
src/views/modules/visual/basicinfo/personCategory/Base.js

@ -0,0 +1,10 @@
class Base {
constructor() {
this.a = '3'
this.init()
}
init() {
console.log('1')
}
}
export default Base

68
src/views/modules/visual/basicinfo/personCategory/components/screen-loading/index.vue

@ -0,0 +1,68 @@
<template>
<div class="screen-loading">
<svg width="50px"
height="50px">
<circle cx="25"
cy="25"
r="20"
fill="transparent"
stroke-width="3"
stroke-dasharray="31.415, 31.415"
stroke="#29cdff"
stroke-linecap="round">
<animateTransform attributeName="transform"
type="rotate"
values="0, 25 25;360, 25 25"
dur="1.5s"
repeatCount="indefinite" />
<animate attributeName="stroke"
values="#02bcfe;#3be6cb;#02bcfe"
dur="3s"
repeatCount="indefinite" />
</circle>
<circle cx="25"
cy="25"
r="10"
fill="transparent"
stroke-width="3"
stroke-dasharray="15.7, 15.7"
stroke="#29cdff"
stroke-linecap="round">
<animateTransform attributeName="transform"
type="rotate"
values="360, 25 25;0, 25 25"
dur="1.5s"
repeatCount="indefinite" />
<animate attributeName="stroke"
values="#3be6cb;#02bcfe;#3be6cb"
dur="3s"
repeatCount="indefinite" />
</circle>
</svg>
<div class="loading-tip">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: 'DvLoading'
}
</script>
<style lang="scss" scoped>
.screen-loading {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.loading-tip {
font-size: 14px;
color: #fff;
}
}
</style>

307
src/views/modules/visual/basicinfo/personCategory/components/screen-table/index.vue

@ -0,0 +1,307 @@
<template>
<div class="warning-table">
<div class="table">
<div class="table-header">
<div class="table-header-th"
v-for="(item, index) in headerList"
:key="item.title"
:style="headerStyle[index]">
{{ item.title }}
</div>
</div>
<div class="table-body">
<div class="table-body-tr"
v-for="(value, index) in tableData"
:key="index">
<div class="td"
v-for="(item, indexs) in value"
:key="indexs"
:style="tableContentStyle[indexs]">
<span @click="toUserInfo(item)">{{ item }}</span>
<span v-if="indexs + 1 == value.length && item.length > 8"
class="more"
@click.stop="onClickMorePop(index)"
ref="morePop">
更多>
<span class="more-pop"
@click="toUserInfo(item)"
v-if="visiblePopList[index]">
<!-- 李佳琪刘阳赵欣丁一嘉敏李岩何嘉慧
李易峰赵敏何军曲树惠 -->
{{ item }}
</span>
</span>
</div>
</div>
<screen-loading v-if="visibleLoading">加载中</screen-loading>
<div class="no-data"
v-if="tableData.length == 0 && !visibleLoading">
<img src="../../../../../../../assets/img/modules/visual/noData.png"
alt=""
srcset=""
class="no-data-img" />
</div>
</div>
</div>
</div>
</template>
<script>
import ScreenLoading from "../screen-loading/index";
import Vue from "vue";
export default {
name: "warning-table",
components: {
ScreenLoading,
},
props: {
headerList: {
type: Array,
required: false,
default: () => {
return [
{ title: "序号" },
{ title: "所属网格" },
{ title: "所属小区" },
{ title: "楼号" },
{ title: "姓名" },
];
},
},
tableData: {
type: Array,
required: false,
default: () => {
return [
// [
// 1,
// "",
// "",
// "2",
// "",
// ],
// [
// 2,
// "",
// "",
// "2",
// "",
// ],
];
},
},
//
headerStyle: {
type: Array,
default: () => {
return [
// {
// width:'200px',
// border:'1px solid red'
// },
// {
// width:'200px'
// }
];
},
},
//
tableContentStyle: {
type: Array,
default: () => {
return [
// {
// width:'200px',
// border:'1px solid red'
// },
// {
// width:'200px'
// }
];
},
},
visibleLoading: {
type: Boolean,
default: true,
},
// //
// ava: {
// type: Number,
// default: 8
// },
// // --10%
// headerHeightAva: {
// type: String,
// default: '10%'
// },
// //
// tableContentAva: {
// type: Number,
// default: 5
// },
},
data () {
return {
visiblePopList: [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
],
};
},
watch: {
tableData (arr) {
if (Array.isArray(arr)) {
this.visiblePopList = new Array(arr.length).fill(false);
}
},
},
mounted () {
window.addEventListener("click", (e) => {
this.visiblePopList = new Array(this.visiblePopList.length).fill(false);
});
},
created () { },
methods: {
toUserInfo (uid) {
// this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
},
onClickMorePop (index) {
this.visiblePopList.forEach((item, indexs) => {
if (index == indexs) {
Vue.set(this.visiblePopList, index, true);
} else {
Vue.set(this.visiblePopList, indexs, false);
}
});
},
},
};
</script>
<style lang="scss" scoped>
.warning-table {
box-sizing: border-box;
width: 100%;
height: 100%;
.table {
width: 100%;
height: 100%;
&-header {
width: 100%;
height: 50px;
display: flex;
justify-content: space-around;
align-items: center;
background: rgba(8, 37, 134, 0.85);
font-size: 16px;
font-weight: 400;
color: #ffffff;
&-th {
text-align: center;
width: calc(100% / 5);
}
}
&-body {
box-sizing: border-box;
width: 100%;
height: calc(100% - 50px);
font-size: 18px;
font-weight: 400;
color: #ffffff;
&-tr {
width: 100%;
height: 50px;
// height: calc(100% / 10);
display: flex;
justify-content: space-around;
align-items: center;
.td {
text-align: center;
width: calc(100% / 5);
.more {
font-size: 18px;
font-weight: 400;
color: #e4dc00;
position: relative;
cursor: pointer;
&-pop {
box-sizing: border-box;
display: block;
box-sizing: border-box;
width: 215px;
height: auto;
line-height: 20px;
border: 1px solid red;
position: absolute;
right: -100%;
top: 150%;
background: #06186d;
border: 1px solid #1a64cc;
border-radius: 5px;
font-size: 9px;
font-weight: 400;
color: #ffffff;
padding: 16px 8px 10px 9px;
z-index: 1;
cursor: default;
// &::after{
// position: absolute;
// left: 30%;
// top: -30%;
// display: flex;
// content:'';
// width: 0;
// height: 0;
// border-width: 13px;
// border-style: solid;
// border-color: transparent transparent rgba(26, 100, 204,0.5) transparent;
// // border-color: transparent transparent red transparent;
// transform: translate(-50%,0);
// }
}
}
}
}
&-tr:nth-child(2n) {
background: rgba(16, 75, 164, 0.24);
}
&-tr:hover {
background: url("../../../../../../../assets/img/modules/visual/hover-bac.png")
no-repeat center;
background-size: 100% 100%;
}
//
.no-data {
width: 100%;
height: calc(100% - 50px);
display: flex;
align-items: center;
justify-content: center;
&-img {
width: 249px;
height: 172px;
}
}
}
}
}
</style>

164
src/views/modules/visual/basicinfo/personCategory/index.vue

@ -0,0 +1,164 @@
<template>
<div class="warning-box">
<cpt-card>
<div class="warning-box-top">
<div class="top-item"
v-for="(item, index) in warningList"
:key="index">
<div class="top-item-img">
<img :src="item.dataIcon" />
<div class="top-item-left">
<span>{{ item.label }}</span>
<span>{{ item.count }}</span>
</div>
</div>
<div class="top-item-num">
<div class="num-item"
:class="{
'num-item-active': activeIndex == index && activeLevel == '1',
}"
@click="onClickList(index, '1')">
<div>{{ item.level1 }}-{{ item.level2 }}</div>
<div>
<div>{{ item.levelCount1 }}</div>
<img src="../../../../../assets/img/modules/visual/right-icon.png"
class="right-icon" />
</div>
</div>
<div class="num-item"
:class="{
'num-item-active': activeIndex == index && activeLevel == '2',
}"
@click="onClickList(index, '2')">
<div>{{ item.level2 }}人以上</div>
<div>
<div>{{ item.levelCount2 }}</div>
<img src="../../../../../assets/img/modules/visual/right-icon.png"
class="right-icon" />
</div>
</div>
</div>
</div>
</div>
<div class="warning-box-bottom">
<screen-table :headerList="headerList"
:tableData="tableData"
:visibleLoading="visibleLoading"></screen-table>
<div class="pagination">
<el-pagination :current-page="pageNo"
:page-size="pageSize"
background
layout="prev, pager, next"
@size-change="pageSizeChangeHandleNew"
@current-change="pageCurrentChangeHandleNew"
:total="total">
</el-pagination>
</div>
</div>
</cpt-card>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import screenTable from "./components/screen-table/index";
import cptCard from "@/views/modules/visual/cpts/card";
import nextTick from "dai-js/tools/nextTick";
export default {
name: "warning-box",
components: {
cptCard,
screenTable,
},
data () {
return {
warningList: [],
headerList: [
{ title: "序号" },
{ title: "所属网格" },
{ title: "所属小区" },
{ title: "楼号" },
{ title: "姓名" },
],
tableData: [
// [1,'','','2',''],
],
visibleLoading: true,
pageNo: 1,
pageSize: 10,
total: 0,
activeIndex: 0,
activeLevel: "1",
};
},
async mounted () {
await nextTick(100);
this.getBuildingwarnlist();
},
methods: {
onClickList (index, level) {
this.activeIndex = index;
this.activeLevel = level;
this.pageNo = 1;
this.getUserwarnlist();
},
//
async getUserwarnlist () {
const { activeIndex, activeLevel, warningList } = this;
const reqItem = warningList[activeIndex];
let tableData = [];
const url = "/epmetuser/statsresiwarn/userwarnlist";
let params = {
configId: reqItem.configId,
buildingIdList: reqItem["buildingIdList" + activeLevel],
pageNo: this.pageNo,
pageSize: this.pageSize,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
data.list.forEach((item, index) => {
tableData.push([
index + 1,
item.gridName,
item.neighborhoodName,
item.buildingName,
item.residentNames ? item.residentNames : "暂无",
]);
});
this.tableData = tableData;
this.total = data.total;
} else {
}
},
//
async getBuildingwarnlist () {
const url = "/epmetuser/statsresiwarn/buildingwarnlist";
let params = {
agencyId: this.$store.state.user.agencyId,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.warningList = data;
this.visibleLoading = false;
this.getUserwarnlist();
} else {
}
},
pageSizeChangeHandleNew (val) {
this.pageNo = 1;
this.pageSize = val;
},
pageCurrentChangeHandleNew (val) {
this.pageNo = val;
this.getUserwarnlist();
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/visual/warning.scss"
scoped
></style>
Loading…
Cancel
Save