Browse Source

调动

shibei_master
jiangyy 4 years ago
parent
commit
caec4f034f
  1. 359
      src/views/components/resiTransfer.vue
  2. 49
      src/views/modules/base/resi.vue

359
src/views/components/resiTransfer.vue

@ -0,0 +1,359 @@
<template>
<div>
<div>
<el-form ref="ref_form"
:inline="false"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="当前组织"
label-width="150px"
style="display: block">
<span>{{ agencyObj.communityName }}{{agencyObj.label}}</span>
</el-form-item>
<el-form-item label="迁出类型"
prop="houseType"
label-width="150px"
style="display: block">
<el-radio-group v-model="houseType">
<el-radio :label="'1'">楼房</el-radio>
<el-radio :label="'2'">平房</el-radio>
<el-radio :label="'3'">别墅</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所属家庭"
required>
<div class="resi-cell-value">
<div class="resi-cell-col">
<el-form-item prop="VILLAGE_ID">
<el-select v-model.trim="form.VILLAGE_ID"
placeholder="请选择小区"
size="small"
clearable
class="resi-cell-select"
@change="handleChangeV">
<el-option v-for="item in optionsV"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="BUILD_ID">
<el-select v-model.trim="form.BUILD_ID"
placeholder="请选择楼号"
size="small"
clearable
class="resi-cell-select resi-cell-select-middle"
@change="handleChangeB">
<el-option v-for="item in optionsB"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="UNIT_ID">
<el-select v-model.trim="form.UNIT_ID"
placeholder="请选择单元"
size="small"
clearable
class="resi-cell-select resi-cell-select-middle"
@change="handleChangeD">
<el-option v-for="item in optionsD"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="HOME_ID">
<el-select v-model.trim="form.HOME_ID"
placeholder="请选择房号"
size="small"
clearable
class="resi-cell-select resi-cell-select-middle">
<el-option v-for="item in optionsH"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
</div>
</el-form-item>
</el-form>
</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 {
btnDisable: false,
dataForm: {
icUserId: '', // ID
type: '',//out,in
newAgencyId: '',//Id
newGridId: '',//Id
newNeighborHoodId: '',//ID
newBuildingId: '',//Id
newBuildingUnitId: 1,//Id
newHouseId: '', //Id
transferTime: '', //
remark: '' //
},
staffId: '',//id
rootAgency: {}
}
},
components: {},
mounted () {
},
methods: {
async initForm (row, agencyObj) {
this.$refs.ref_form.resetFields();
this.staffId = row.staffId
await this.loadRootAgency()
},
//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 handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.dataForm.houseType = this.houseType
this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
this.btnDisable = false
app.util.validateRule(messageObj)
} else {
this.addRoom()
}
})
},
getValiheList () {
this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', { gridId: this.form.GRID_ID, agencyId: this.agencyId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsV = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getBuildList () {
this.$http
.post('/gov/org/icbuilding/buildingoption', { neighborHoodId: this.form.VILLAGE_ID })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsB = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getUniList () {
this.$http
.post('/gov/org/icbuildingunit/unitoption', { buildingId: this.form.BUILD_ID })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsD = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
getHouseList () {
this.$http
.post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsH = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
}
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.houseId = '' //ID
this.houseType = '1'
this.purpose = '1'
this.rentFlag = 1
this.dataForm = {
neighborHoodId: '', // ID
buildingId: '',//ID
buildingUnitId: '',//ID
doorName: '',//
houseType: '1',//
purpose: '1',//
rentFlag: 1,//10
ownerPhone: '', //
ownerName: '', //
ownerIdCard: '' //
}
},
//
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' }
],
houseType: [
{ required: true, message: '房屋类型不能为空', trigger: 'blur' }
],
purpose: [
{ required: true, message: '房屋用途不能为空', trigger: 'blur' }
],
rentFlag: [
{ required: true, message: '是否出租不能为空', trigger: 'blur' }
],
ownerPhone: [
{ required: true, message: '房主电话不能为空', trigger: 'blur' }
],
ownerName: [
{ required: true, message: '房主姓名不能为空', trigger: 'blur' }
],
ownerIdCard: [
{ required: true, message: '房主身份证号不能为空', trigger: 'blur' }
],
}
},
},
props: {}
}
</script>
<style lang="scss" scoped>
.item_width_1 {
width: 500px;
}
.item_width_2 {
width: 400px;
}
.item_width_3 {
margin-left: 10px;
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>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>

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

@ -1,6 +1,5 @@
<template>
<div
class="resi-container">
<div class="resi-container">
<resi-search v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList"
@ -63,6 +62,14 @@
type="text"
size="small"
class="btn-color-look">查看</el-button>
<el-button @click="handleTransfer(scope.row)"
type="text"
size="small"
class="btn-color-look">调动</el-button>
<el-button @click="handleChangeRecord(scope.row)"
type="text"
size="small"
class="btn-color-look">调动记录</el-button>
<template v-if="filterEdit(scope.row.ORG_ID)">
<el-button @click="handleEdit(scope.row)"
type="text"
@ -178,6 +185,18 @@
@click="handleEditSUbmit">提交</el-button>
</div>
</el-dialog>
<!-- 调动 -->
<el-dialog :visible.sync="tranferShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'人员调动'"
width="950px"
top="5vh"
@closed="diaClose">
<resi-transfer ref="ref_transfer"></resi-transfer>
</el-dialog>
</div>
</template>
@ -186,11 +205,14 @@ import resiSearch from '../../components/resiSearch.vue'
import resiForm from '../../components/resiForm.vue'
import editResi from '../../components/editResi.vue'
import axios from 'axios'
import resiTransfer from '../../components/resiTransfer.vue'
export default {
components: {
resiSearch,
resiForm,
editResi
editResi,
resiTransfer
},
data () {
return {
@ -226,7 +248,10 @@ export default {
tableHeader: [],
tabsList: [],
defaultCategotyKey: ''
defaultCategotyKey: '',
tranferShow: false,
changeRecordShow: false,
}
},
props: {
@ -236,6 +261,7 @@ export default {
if (this.$route.query) {
let query = this.$route.query
this.defaultCategotyKey = query.columnName
console.log(this.defaultCategotyKey)
await this.getSearchList()
this.$refs.resiSearch.handleSearch()
}
@ -259,6 +285,21 @@ export default {
console.log('storeoooo----0000', this.$store)
},
methods: {
//
handleTransfer (row) {
this.tranferShow = true
},
//
handleChangeRecord (row) {
this.changeRecordShow = true
},
diaClose () {
this.tranferShow = false
this.changeRecordShow = false
},
computedWidth (label) {
const wd = 20 * label.length
return wd > 80 ? wd : 80

Loading…
Cancel
Save