Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev

shibei_master
jiangyy 4 years ago
parent
commit
529a164458
  1. 45
      src/views/components/editResi.vue
  2. 40
      src/views/components/resiForm.vue
  3. 42
      src/views/components/resiSearch.vue
  4. 53
      src/views/modules/base/resi.vue

45
src/views/components/editResi.vue

@ -18,7 +18,7 @@
<!-- <div class="resi-cell"> -->
<!-- <div class="resi-cell-label">{{n.label}}</div> -->
<div class="resi-cell-value">
<el-select v-model="form.GRID_ID" :disabled="disabled" placeholder="请选择网格" size="small"
<el-select v-model.trim="form.GRID_ID" :disabled="disabled" placeholder="请选择网格" size="small"
clearable class="resi-cell-select"
>
<el-option
@ -35,7 +35,7 @@
<el-col :span="18">
<el-form-item :prop="form.VILLAGE_ID" label="所属小区">
<div class="resi-cell-value">
<el-select v-model="form.VILLAGE_ID" :disabled="disabled" placeholder="请选择小区" size="small"
<el-select v-model.trim="form.VILLAGE_ID" :disabled="disabled" placeholder="请选择小区" size="small"
clearable class="resi-cell-select"
>
<el-option
@ -45,7 +45,7 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
<el-select v-model.trim="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select" @change="handleChangeB"
>
<el-option
@ -55,7 +55,7 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.UNIT_ID" :disabled="disabled" placeholder="请选择单元" size="small"
<el-select v-model.trim="form.UNIT_ID" :disabled="disabled" placeholder="请选择单元" size="small"
clearable class="resi-cell-select" @change="handleChangeD"
>
<el-option
@ -65,7 +65,7 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.HOME_ID" :disabled="disabled" placeholder="请选择房号" size="small"
<el-select v-model.trim="form.HOME_ID" :disabled="disabled" placeholder="请选择房号" size="small"
clearable class="resi-cell-select"
>
<el-option
@ -81,7 +81,7 @@
<!-- <el-col :span="6">
<el-form-item :prop="form.BUILD_ID" label="所属楼宇">
<div class="resi-cell-value">
<el-select v-model="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
<el-select v-model.trim="form.BUILD_ID" :disabled="disabled" placeholder="请选择楼号" size="small"
clearable class="resi-cell-select"
>
<el-option
@ -97,7 +97,7 @@
<el-col :span="6">
<el-form-item :prop="form.HOME_ID" label="所属家庭">
<div class="resi-cell-value">
<el-select v-model="form.HOME_ID" :disabled="disabled" placeholder="请选择" size="small"
<el-select v-model.trim="form.HOME_ID" :disabled="disabled" placeholder="请选择" size="small"
clearable class="resi-cell-select"
>
<el-option
@ -122,7 +122,7 @@
<template v-if="n.itemType === 'input' || n.itemType === 'textarea'">
<el-input
v-if="n.validType"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:disabled="disabled"
class="resi-cell-input"
size="small"
@ -132,7 +132,7 @@
</el-input>
<el-input
v-else
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:disabled="disabled"
class="resi-cell-input"
size="small"
@ -143,7 +143,7 @@
</template>
<!-- <template v-if="n.itemType === 'textarea'">
<el-input
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
class="resi-cell-textarea"
size="small"
type="textarea"
@ -154,7 +154,7 @@
</template> -->
<el-date-picker
v-else-if="n.itemType === 'datepicker'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:disabled="disabled"
class="resi-cell-input"
type="date"
@ -166,7 +166,7 @@
</el-date-picker>
<el-date-picker
v-else-if="n.itemType === 'daterange'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:disabled="disabled"
type="daterange"
align="right"
@ -179,13 +179,13 @@
</el-date-picker>
<el-time-picker
v-else-if="n.itemType === 'timepicker'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:disabled="disabled"
placeholder="任意时间点">
</el-time-picker>
<el-time-picker
v-else-if="n.itemType === 'timerange'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:disabled="disabled"
is-range
range-separator="至"
@ -193,7 +193,7 @@
end-placeholder="结束时间"
placeholder="选择时间范围">
</el-time-picker>
<el-select v-else-if="n.itemType === 'select'" v-model="form[n.columnName]"
<el-select v-else-if="n.itemType === 'select'" v-model.trim="form[n.columnName]"
:multiple="n.multiSelect"
:disabled="disabled"
placeholder="请选择" size="small" clearable class="resi-cell-select">
@ -210,7 +210,7 @@
clearable></el-cascader> -->
<el-cascader
v-else-if="n.itemType === 'cascader'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:options="n.options"
:props="{ checkStrictly: true }"
:disabled="disabled"
@ -219,14 +219,14 @@
class="resi-cell-select">
</el-cascader>
<template v-else-if="n.itemType === 'radio'">
<el-radio v-for="ns in n.options" :key="ns.value" v-model="form[n.columnName]" :disabled="disabled"
<el-radio v-for="ns in n.options" :key="ns.value" v-model.trim="form[n.columnName]" :disabled="disabled"
:label="ns.value">
{{ ns.label }}
</el-radio>
<!-- <el-radio v-model="form[n.columnName]" label="1">备选项</el-radio> -->
<!-- <el-radio v-model.trim="form[n.columnName]" label="1">备选项</el-radio> -->
</template>
<template v-else-if="n.itemType === 'checkbox'">
<el-checkbox-group v-model="form[n.columnName]">
<el-checkbox-group v-model.trim="form[n.columnName]">
<el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value" :disabled="disabled">{{ns.label}}</el-checkbox>
<!-- <el-checkbox label="n.la"></el-checkbox> -->
</el-checkbox-group>
@ -472,7 +472,6 @@ export default {
this.addList = [...this.mutiList]
// console.log('addList----111', this.addList)
}
// } this.addList.push(this.addCount++)
if (this.fixed) {
this.getGridList()
this.getValiheList()
@ -483,11 +482,6 @@ export default {
},
methods: {
initForm () {
// console.log('formInfo', this.formInfo)
// if (Object.keys(this.formInfo).length > 0) {
// this.form = { ...this.formInfo }
// return
// }
this.formList.forEach(async item => {
if (item.optionSourceType === 'remote') {
await this.getOptionsLists(item.optionSourceValue).then(res => {
@ -575,6 +569,7 @@ export default {
// console.log('handlerMuscForm----000', this.$refs['baseForms' + item.row || item][0].handleForm())
arr.push([ ...this.$refs['baseForms' + item.row][0].handleForm() ])
})
if (arr.length === 0) return arr
let arr2 = arr.reduce(function (a, b) { return a.concat(b) })
let hash = {}
let i = 0

40
src/views/components/resiForm.vue

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

42
src/views/components/resiSearch.vue

@ -7,7 +7,7 @@
<div class="resi-cell">
<div class="resi-cell-label">所属网格</div>
<div class="resi-cell-value">
<el-select v-model="form.GRID_ID" placeholder="请选择" size="small" clearable class="resi-cell-select"
<el-select v-model.trim="form.GRID_ID" placeholder="请选择" size="small" clearable class="resi-cell-select"
@change="handleChangeGrid">
<el-option
v-for="item in optionsG"
@ -23,7 +23,7 @@
<div class="resi-cell">
<div class="resi-cell-label">所属小区</div>
<div class="resi-cell-value">
<el-select v-model="form.VILLAGE_ID" placeholder="请选择小区" size="small"
<el-select v-model.trim="form.VILLAGE_ID" placeholder="请选择小区" size="small"
clearable class="resi-cell-select"
@clear="handleClearVillage" @change="handleChangeV">
<el-option
@ -33,7 +33,7 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.BUILD_ID" placeholder="楼号" size="small" clearable
<el-select v-model.trim="form.BUILD_ID" placeholder="楼号" size="small" clearable
class="resi-cell-select" :disabled="changeVDisabled" @clear="handleClearBuild" @change="handleChangeB">
<el-option
v-for="item in optionsB"
@ -42,7 +42,7 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.UNIT_ID" :disabled="changeBDisabled" placeholder="单元" size="small" clearable class="resi-cell-select" @click="handleClearDan" @change="handleChangeD">
<el-select v-model.trim="form.UNIT_ID" :disabled="changeBDisabled" placeholder="单元" size="small" clearable class="resi-cell-select" @click="handleClearDan" @change="handleChangeD">
<el-option
v-for="item in optionsD"
:key="item.value"
@ -50,7 +50,7 @@
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.HOME_ID" :disabled="changeDDisabled" placeholder="楼号" size="small" clearable class="resi-cell-select">
<el-select v-model.trim="form.HOME_ID" :disabled="changeDDisabled" placeholder="楼号" size="small" clearable class="resi-cell-select">
<el-option
v-for="item in optionsH"
:key="item.value"
@ -69,7 +69,7 @@
<div class="resi-cell-value" :class="n.itemType === 'radio' && 'resi-cell-value-radio'">
<el-input
v-if="n.itemType === 'input' || n.itemType === 'textarea'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
class="resi-cell-input"
size="small"
clearable
@ -79,7 +79,7 @@
<template v-else-if="n.itemType === 'datepicker'">
<el-date-picker
v-if="n.queryType === 'daterange'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
type="daterange"
align="right"
unlink-panels
@ -94,7 +94,7 @@
</el-date-picker>
<el-date-picker
v-else
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
class="resi-cell-input"
type="date"
size="small"
@ -104,7 +104,7 @@
placeholder="选择日期">
</el-date-picker>
</template>
<el-select v-else-if="n.itemType === 'select' || n.itemType === 'radio'" v-model="form[n.columnName]" placeholder="请选择" size="small" clearable class="resi-cell-select">
<el-select v-else-if="n.itemType === 'select' || n.itemType === 'radio'" v-model.trim="form[n.columnName]" placeholder="请选择" size="small" clearable class="resi-cell-select">
<el-option
v-for="item in n.options"
:key="item.value"
@ -114,7 +114,7 @@
</el-select>
<el-cascader
v-else-if="n.itemType === 'cascader'"
v-model="form[n.columnName]"
v-model.trim="form[n.columnName]"
:options="n.options"
:props="{ checkStrictly: true }"
clearable
@ -183,22 +183,6 @@ export default {
optionsH: [],
optionsD: [],
optionsG: [],
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
value: '',
fixedList: [],
fixedForm: {
@ -218,7 +202,6 @@ export default {
HOME_ID: ''
},
tempFormList,
checkList: ['选中且禁用', '复选框 A'],
pickerOptions: {
shortcuts: [{
text: '最近一周',
@ -317,14 +300,14 @@ export default {
},
handleSearch () {
// console.log('formmmmm---', this.form)
const itemTypes = ['cascader', 'daterange', 'timerange']
const itemTypes = ['daterange', 'timerange']
let arr = this.tempFormList.filter(n => n.isChange).map(item => {
return {
queryType: item.queryType,
tableName: item.tableName,
columnName: item.columnName,
// columnValue: []
columnValue: (itemTypes.includes(item.queryType) || itemTypes.includes(item.itemType)) ? this.form[item.columnName] : [this.form[item.columnName]]
columnValue: (itemTypes.includes(item.queryType) || itemTypes.includes(item.itemType)) ? this.form[item.columnName] : [this.form[item.columnName].toString()]
}
})
let arr1 = this.fixedList.filter(n => n.columnValue.length > 0).map(item => {
@ -516,6 +499,7 @@ export default {
margin-bottom: 20px;
}
.resi-search {
padding-right: 140px;
.el-col {
text-align: right;
}

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

@ -11,6 +11,7 @@
</div>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="width: 100%"
class="resi-table">
@ -25,7 +26,7 @@
:prop="item.columnName"
:label="item.label"
align="center"
width="180">
:width="item.itemType === 'radio' ? 80 : 180">
<template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item)}}</span>
</template>
@ -85,7 +86,7 @@
</div>
<div class="resi-btns">
<el-button size="small" @click="handlerCancle">取消</el-button>
<el-button type="primary" size="small" @click="handleSUbmit">提交</el-button>
<el-button type="primary" size="small" :loading="btnLoading" @click="handleSUbmit">提交</el-button>
</div>
</el-dialog>
@ -111,7 +112,7 @@
</div>
<div class="resi-btns">
<el-button size="small" @click="handlerEditCancle">取消</el-button>
<el-button v-if="!disabled" type="primary" size="small" @click="handleEditSUbmit">提交</el-button>
<el-button v-if="!disabled" type="primary" size="small" :loading="btnLoading" @click="handleEditSUbmit">提交</el-button>
</div>
</el-dialog>
@ -130,6 +131,8 @@ export default {
},
data () {
return {
tableLoading: false,
btnLoading: false,
disabled: false,
pageLoading: false,
dialogEditVisible: false,
@ -266,8 +269,8 @@ export default {
},
async handleEdit (row) {
this.disabled = false
await this.getFormList()
this.getrowInfo(row.icResiUserId)
await this.getFormList('edit')
await this.getrowInfo(row.icResiUserId)
},
async handleAdd () {
await this.getFormList()
@ -400,8 +403,9 @@ export default {
})
this.dialogVisible = false
},
submitAdd (arr) {
this.$http
async submitAdd (arr) {
this.btnLoading = true
await this.$http
.post('/epmetuser/icresiuser/add', arr)
.then(({ data: res }) => {
if (res.code !== 0) {
@ -420,12 +424,15 @@ export default {
.catch(() => {
return this.$message.error('网络错误')
})
this.btnLoading = false
},
submitEdit (arr) {
this.$http
async submitEdit (arr) {
this.btnLoading = true
await this.$http
.post('/epmetuser/icresiuser/edit', arr)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success('提交成功')
@ -441,6 +448,7 @@ export default {
.catch(() => {
return this.$message.error('网络错误')
})
this.btnLoading = false
},
getTableHeader () {
this.$http
@ -456,14 +464,15 @@ export default {
return this.$message.error('网络错误')
})
},
getTableData () {
async getTableData () {
this.tableLoading = true
let params = {
formCode: 'resi_base_info',
pageNo: this.currentPage,
pageSize: this.pageSize,
conditions: this.conditions
}
this.$http
await this.$http
.post('/epmetuser/icresiuser/listresi', params)
.then(({ data: res }) => {
if (res.code !== 0) {
@ -476,6 +485,7 @@ export default {
.catch(() => {
return this.$message.error('网络错误')
})
this.tableLoading = false
},
getrowInfo (id) {
let params = {
@ -588,7 +598,7 @@ export default {
return this.$message.error('网络错误')
})
},
async getFormList () {
async getFormList (type) {
await this.$http
.post('/oper/customize/icform/getcustomerform', { formCode: 'resi_base_info', dynamic: true })
.then(({ data: res }) => {
@ -598,23 +608,26 @@ export default {
console.log('获取详情成功getFormList')
let { itemList, groupList } = res.data
this.activeName = 'group' + res.data.groupList[0].groupId
itemList.forEach(async item => {
if (item.optionSourceType === 'remote') {
await this.getOptionsList(item.optionSourceValue).then(res => {
item.options = res
})
}
})
if (type !== 'edit') {
itemList.forEach(async item => {
if (item.optionSourceType === 'remote') {
await this.getOptionsList(item.optionSourceValue).then(res => {
item.options = res
})
}
})
}
groupList.forEach(item => {
item.itemList.forEach(async n => {
n.tableName = item.tableName
if (n.optionSourceType === 'remote') {
if (n.optionSourceType === 'remote' && type !== 'edit') {
await this.getOptionsList(n.optionSourceValue).then(res => {
n.options = res
})
}
})
})
// }
this.formList = itemList
this.tabsList = groupList
}

Loading…
Cancel
Save