7 changed files with 879 additions and 32 deletions
@ -0,0 +1,297 @@ |
|||
<template> |
|||
<div class="div_main"> |
|||
|
|||
<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="typeName" |
|||
header-align="center" |
|||
align="center" |
|||
label="变更类型" |
|||
width="80"> |
|||
</el-table-column> |
|||
<el-table-column prop="beforeChangeName" |
|||
header-align="center" |
|||
align="center" |
|||
label="变更前" |
|||
width="230"> |
|||
</el-table-column> |
|||
<el-table-column prop="afterChanegName" |
|||
header-align="center" |
|||
align="center" |
|||
label="变更后" |
|||
min-width="230"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column prop="changeTime" |
|||
header-align="center" |
|||
align="center" |
|||
label="调整时间" |
|||
width="160"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column prop="operatorName" |
|||
header-align="center" |
|||
align="center" |
|||
label="操作人" |
|||
width="80"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column prop="remark" |
|||
header-align="center" |
|||
align="center" |
|||
label="备注" |
|||
width="120"> |
|||
</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, |
|||
total: 0, |
|||
pageSize: 10, |
|||
pageNo: 0, |
|||
tableLoading: false, |
|||
|
|||
tableData: [], |
|||
icUserId: '', |
|||
|
|||
|
|||
} |
|||
}, |
|||
|
|||
|
|||
async mounted () { |
|||
|
|||
|
|||
}, |
|||
|
|||
methods: { |
|||
async initForm (row) { |
|||
this.icUserId = row.icResiUserId |
|||
|
|||
//获取数据 |
|||
await this.loadTable() |
|||
}, |
|||
|
|||
handleSearch () { |
|||
this.loadTable() |
|||
}, |
|||
|
|||
|
|||
async loadTable () { |
|||
this.tableLoading = true |
|||
|
|||
const url = "/epmetuser/icuserchangerecord/list" |
|||
|
|||
let params = { |
|||
icUserId: this.icUserId, |
|||
pageSize: this.pageSize, |
|||
pageNo: this.pageNo, |
|||
|
|||
} |
|||
|
|||
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.formData.startTime = t2 + ' 00:00:00' |
|||
this.formData.endTime = t1 + ' 23:59:59' |
|||
|
|||
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: { |
|||
serviceType: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
} |
|||
} |
|||
</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> |
@ -0,0 +1,479 @@ |
|||
<template> |
|||
<div> |
|||
<div> |
|||
<el-form ref="ref_form" |
|||
:inline="false" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
class="form"> |
|||
|
|||
<el-form-item label="当前组织" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<span>{{ gridName }}</span> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="迁出类型" |
|||
prop="type" |
|||
label-width="150px" |
|||
style="display: block"> |
|||
<el-radio-group v-model="dataForm.type"> |
|||
|
|||
<el-radio :label="'in'">{{'迁往'+rootAgency.rootAgencyName+'内其他区域'}}</el-radio> |
|||
<el-radio :label="'out'">其他</el-radio> |
|||
|
|||
</el-radio-group> |
|||
</el-form-item> |
|||
|
|||
<div v-if="dataForm.type==='in'"> |
|||
<el-form-item label="迁出至" |
|||
prop='newAgencyId' |
|||
label-width="150px"> |
|||
<el-cascader ref="myCascader" |
|||
v-model="agencyIdArray" |
|||
style="width:480px" |
|||
:key="iscascaderShow" |
|||
:options="casOptions" |
|||
:props="optionProps" |
|||
@change="handleChangeAgency" |
|||
clearable></el-cascader> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="所属家庭" |
|||
label-width="150px" |
|||
prop="newNeighborHoodId" |
|||
required> |
|||
|
|||
<div class="resi-cell-col"> |
|||
|
|||
<el-select v-model.trim="dataForm.newNeighborHoodId" |
|||
placeholder="请选择小区" |
|||
clearable |
|||
class="item_width_1" |
|||
@change="handleChangeCommunity"> |
|||
<el-option v-for="item in communityList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
<el-select v-model.trim="dataForm.newBuildingId" |
|||
placeholder="请选择楼号" |
|||
clearable |
|||
class="item_width_1 margin_left10" |
|||
@change="handleChangeBuilding"> |
|||
<el-option v-for="item in buildingList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
<el-select v-model.trim="dataForm.newBuildingUnitId" |
|||
placeholder="请选择单元" |
|||
clearable |
|||
class="item_width_1 margin_left10" |
|||
@change="handleChangeUnit"> |
|||
<el-option v-for="item in unitList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
<el-select v-model.trim="dataForm.newHouseId" |
|||
placeholder="请选择房号" |
|||
clearable |
|||
class="item_width_1 margin_left10"> |
|||
<el-option v-for="item in roomList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</div> |
|||
|
|||
</el-form-item> |
|||
|
|||
</div> |
|||
<el-form-item label="备注" |
|||
prop="remark" |
|||
label-width="150px"> |
|||
<el-input type="textarea" |
|||
:autosize="{ minRows: 4, maxRows: 7}" |
|||
:rows="5" |
|||
resize="none" |
|||
style="width:600px" |
|||
placeholder='请输入备注' |
|||
v-model="dataForm.remark"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button @click="handleCancle">取 消</el-button> |
|||
<el-button type="primary" |
|||
:disabled="btnDisable" |
|||
@click="handleComfirm">确 定</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@js/util.js'; |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from '@/js/dai/request' |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
|
|||
btnDisable: false, |
|||
communityList: [], |
|||
buildingList: [], |
|||
unitList: [], |
|||
roomList: [], |
|||
|
|||
dataForm: { |
|||
icUserId: '', // 被调动人ID |
|||
type: 'in',//操作类型【客户外out,客户内in】 |
|||
newAgencyId: '',//调动到的组织Id |
|||
newGridId: '',//调动到的网格Id |
|||
newNeighborHoodId: '',//调动到的小区ID |
|||
newBuildingId: '',//调动到的楼宇Id |
|||
newBuildingUnitId: '',//调动到的单元Id |
|||
newHouseId: '', //调动到的房屋Id |
|||
transferTime: '', //调动时间【日期类型】 |
|||
remark: '' //备注 |
|||
}, |
|||
|
|||
staffId: '',//工作人员id |
|||
userId: '',//操作人员id |
|||
gridName: '', |
|||
rootAgency: {}, |
|||
|
|||
casOptions: [], |
|||
agencyIdArray: [], |
|||
customerList: [], |
|||
iscascaderShow: 0, |
|||
|
|||
optionProps: { |
|||
multiple: false, |
|||
value: 'agencyId', |
|||
label: 'agencyName', |
|||
children: 'subAgencyList', |
|||
checkStrictly: true |
|||
}, |
|||
|
|||
selGrid: {}, |
|||
|
|||
} |
|||
}, |
|||
components: {}, |
|||
mounted () { |
|||
|
|||
}, |
|||
|
|||
methods: { |
|||
async initForm (row) { |
|||
this.staffId = localStorage.getItem("staffId"); |
|||
|
|||
this.$refs.ref_form.resetFields(); |
|||
|
|||
// this.icUserId = row.icResiUserId |
|||
this.gridName = row.GRID_ID |
|||
this.dataForm.icUserId = row.icResiUserId |
|||
|
|||
await this.loadRootAgency() |
|||
await this.getAgencylist() |
|||
|
|||
}, |
|||
|
|||
//根据人员id获取根组织信息 |
|||
async loadRootAgency () { |
|||
|
|||
const url = '/gov/org/customeragency/root-orglist-by-staffid' |
|||
|
|||
let params = { |
|||
staffId: this.staffId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
if (data && data.length > 0) { |
|||
this.rootAgency = data[0] |
|||
} |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
async getAgencylist () { |
|||
|
|||
const url = '/gov/org/customeragency/rootagencygridtree' |
|||
|
|||
|
|||
const params = { |
|||
agencyId: this.rootAgency.rootAgencyId |
|||
} |
|||
const { data, code, msg } = await requestPost(url, params) |
|||
if (code === 0) { |
|||
++this.iscascaderShow |
|||
this.casOptions = [] |
|||
this.agencyIdArray.length = [] |
|||
// this.tableParams.agencyId = '' |
|||
if (data) { |
|||
this.casOptions.push(data) |
|||
} |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleChangeAgency () { |
|||
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) |
|||
this.selGrid = this.$refs["myCascader"].getCheckedNodes()[0].data |
|||
this.dataForm.newAgencyId = this.selGrid.pid |
|||
this.dataForm.newGridId = this.selGrid.agencyId |
|||
this.loadCommunityList() |
|||
this.dataForm.newNeighborHoodId = ''//调动到的小区ID |
|||
this.dataForm.newBuildingId = ''//调动到的楼宇Id |
|||
this.dataForm.newBuildingUnitId = ''//调动到的单元Id |
|||
this.dataForm.newHouseId = '' //调动到的房屋Id |
|||
|
|||
}, |
|||
|
|||
async loadCommunityList () { |
|||
const url = '/gov/org/icneighborhood/neighborhoodoption' |
|||
|
|||
let params = { |
|||
gridId: this.dataForm.newGridId, |
|||
agencyId: this.dataForm.newAgencyId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.communityList = [] |
|||
this.communityList = [...data] |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
async handleChangeCommunity () { |
|||
|
|||
const url = '/gov/org/icbuilding/buildingoption' |
|||
|
|||
let params = { |
|||
neighborHoodId: this.dataForm.newNeighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.buildingList = [] |
|||
this.buildingList = [...data] |
|||
this.dataForm.newBuildingId = ''//调动到的楼宇Id |
|||
this.dataForm.newBuildingUnitId = ''//调动到的单元Id |
|||
this.dataForm.newHouseId = '' //调动到的房屋Id |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
async handleChangeBuilding () { |
|||
|
|||
const url = '/gov/org/icbuildingunit/unitoption' |
|||
|
|||
let params = { |
|||
buildingId: this.dataForm.newBuildingId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.unitList = [] |
|||
this.unitList = [...data] |
|||
this.dataForm.newBuildingUnitId = ''//调动到的单元Id |
|||
this.dataForm.newHouseId = '' //调动到的房屋Id |
|||
|
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
async handleChangeUnit () { |
|||
|
|||
const url = '/gov/org/ichouse/houseoption' |
|||
|
|||
let params = { |
|||
unitId: this.dataForm.newBuildingUnitId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.roomList = [] |
|||
this.roomList = [...data] |
|||
this.dataForm.newHouseId = '' //调动到的房屋Id |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
async handleComfirm () { |
|||
this.btnDisable = true |
|||
setTimeout(() => { |
|||
this.btnDisable = false |
|||
}, 2000) |
|||
|
|||
|
|||
this.$refs['ref_form'].validate((valid, messageObj) => { |
|||
if (!valid) { |
|||
app.util.validateRule(messageObj) |
|||
|
|||
} else { |
|||
if (this.dataForm.type === 'in') { |
|||
|
|||
|
|||
if (!this.dataForm.newBuildingId) { |
|||
this.$message.warning('请选择楼宇') |
|||
return false |
|||
} |
|||
if (!this.dataForm.newBuildingUnitId) { |
|||
this.$message.warning('请选择单元') |
|||
return false |
|||
} |
|||
if (!this.dataForm.newHouseId) { |
|||
this.$message.warning('请选择房间') |
|||
return false |
|||
} |
|||
} |
|||
this.saveForm() |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
|
|||
async saveForm () { |
|||
const url = '/epmetuser/icusertransferrecord/add' |
|||
let noData = new Date() |
|||
noData = util.dateFormatter(noData, 'time') |
|||
this.dataForm.transferTime = noData |
|||
|
|||
const { data, code, msg } = await requestPost(url, this.dataForm) |
|||
|
|||
if (code === 0) { |
|||
this.$message.success('调动成功') |
|||
this.handleCancle() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleCancle () { |
|||
this.resetData() |
|||
this.$emit('dialogCancle') |
|||
|
|||
}, |
|||
|
|||
resetData () { |
|||
this.dataForm = { |
|||
icUserId: '', // 被调动人ID |
|||
type: 'in',//操作类型【客户外out,客户内in】 |
|||
newAgencyId: '',//调动到的组织Id |
|||
newGridId: '',//调动到的网格Id |
|||
newNeighborHoodId: '',//调动到的小区ID |
|||
newBuildingId: '',//调动到的楼宇Id |
|||
newBuildingUnitId: '',//调动到的单元Id |
|||
newHouseId: '', //调动到的房屋Id |
|||
transferTime: '', //调动时间【日期类型】 |
|||
remark: '' //备注 |
|||
} |
|||
|
|||
this.staffId = ''//工作人员id |
|||
this.userId = ''//操作人员id |
|||
this.gridName = '' |
|||
this.rootAgency = {} |
|||
|
|||
this.selGrid = {} |
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
type: [ |
|||
{ required: true, message: '操作类型不能为空', trigger: 'blur' }, |
|||
], |
|||
newAgencyId: [ |
|||
{ required: true, message: '所选组织不能为空', trigger: 'blur' } |
|||
], |
|||
newNeighborHoodId: [ |
|||
{ required: true, message: '所属家庭不能为空', trigger: 'blur' } |
|||
], |
|||
|
|||
} |
|||
}, |
|||
|
|||
}, |
|||
props: {} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.item_width_1 { |
|||
width: 150px; |
|||
} |
|||
.item_width_2 { |
|||
width: 400px; |
|||
} |
|||
.item_width_3 { |
|||
margin-left: 10px; |
|||
width: 200px; |
|||
} |
|||
|
|||
.div_btn { |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
} |
|||
.resi-cell-col { |
|||
width: 750px; |
|||
display: flex; |
|||
justify-content: start; |
|||
} |
|||
|
|||
.margin_left10 { |
|||
margin-left: 10px; |
|||
} |
|||
</style> |
|||
<style> |
|||
.el-dialog__body { |
|||
padding: 0 10px 20px !important; |
|||
} |
|||
</style> |
Loading…
Reference in new issue