Browse Source

111

shibei_master
13176889840 4 years ago
parent
commit
1915fd7d08
  1. 6
      src/views/components/resiSearch.vue
  2. 365
      src/views/modules/base/resi.vue

6
src/views/components/resiSearch.vue

@ -134,7 +134,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
class="resi-cell-input" class="resi-cell--daterange"
size="small" size="small"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -588,6 +588,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
.resi-cell-label { .resi-cell-label {
flex-shrink: 0;
width: 70px; width: 70px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 15px; margin-right: 15px;
@ -602,6 +603,9 @@ export default {
.resi-cell-input { .resi-cell-input {
width: 180px; width: 180px;
} }
.resi-cell--daterange {
width: 100%;
}
.resi-cell-select { .resi-cell-select {
width: 180px; width: 180px;
box-sizing: border-box; box-sizing: border-box;

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

@ -1,11 +1,19 @@
<template> <template>
<div v-if="pageLoading"> <div v-if="pageLoading">
<resi-search v-if="searchList.length > 0" ref="resiSearch" :form-list="searchList" @search="handleSearch" /> <resi-search
v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList"
@search="handleSearch"
/>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button type="success" size="small" @click="handleAdd"
<el-button type="success" size="small" @click="handleAdd">新增</el-button> >新增</el-button
<el-button type="warning" size="small" @click="handleExport">导出</el-button> >
<el-button type="warning" size="small" @click="handleExport"
>导出</el-button
>
<!-- <el-button type="primary" size="small">下载人口模板</el-button> --> <!-- <el-button type="primary" size="small">下载人口模板</el-button> -->
<!-- <el-button type="danger" size="small">导入人口数据</el-button> --> <!-- <el-button type="danger" size="small">导入人口数据</el-button> -->
</div> </div>
@ -14,11 +22,9 @@
v-loading="tableLoading" v-loading="tableLoading"
border border
style="width: 100%" style="width: 100%"
class="resi-table"> class="resi-table"
<el-table-column >
type="index" <el-table-column type="index" align="center" width="50">
align="center"
width="50">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-for="item in tableHeader" v-for="item in tableHeader"
@ -26,28 +32,42 @@
:prop="item.columnName" :prop="item.columnName"
:label="item.label" :label="item.label"
align="center" align="center"
:width="item.itemType === 'radio' ? 80 : 180"> :width="item.itemType === 'radio' ? 80 : 180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item)}}</span> <span>{{ handleFilterSpan(scope.row, item) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column fixed="right" label="操作" align="center" width="120">
fixed="right"
label="操作"
align="center"
width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleLook(scope.row)" type="text" size="small" class="btn-color-look">查看</el-button> <el-button
@click="handleLook(scope.row)"
type="text"
size="small"
class="btn-color-look"
>查看</el-button
>
<template v-if="filterEdit(scope.row.ORG_ID)"> <template v-if="filterEdit(scope.row.ORG_ID)">
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">编辑</el-button> <el-button
@click="handleEdit(scope.row)"
type="text"
size="small"
class="btn-color-edit"
>编辑</el-button
>
<el-popconfirm <el-popconfirm
title="删除之后无法回复,确认删除?" title="删除之后无法回复,确认删除?"
@onConfirm="handleDel(scope.row)" @onConfirm="handleDel(scope.row)"
> >
<el-button slot="reference" type="text" size="small" class="btn-color-del">删除</el-button> <el-button
slot="reference"
type="text"
size="small"
class="btn-color-del"
>删除</el-button
>
</el-popconfirm> </el-popconfirm>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -59,63 +79,112 @@
:page-sizes="[20, 50, 100, 200]" :page-sizes="[20, 50, 100, 200]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next"
:total="total"> :total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<el-dialog <el-dialog
title="新增" :title="formName"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="80%" width="80%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handlerCancle"> :before-close="handlerCancle"
<resi-form v-if="dialogVisible" ref="baseForm" :fixed="true" :form-list="formList" @changegroup="handleChangeGroup" /> >
<div v-if="dialogVisible" class="resi-other"> <resi-form
v-if="dialogVisible"
ref="baseForm"
:fixed="true"
:form-list="formList"
@changegroup="handleChangeGroup"
/>
<div v-if="dialogVisible" class="resi-other">
<div class="resi-other-title">其他</div> <div class="resi-other-title">其他</div>
<div class="tabs-other-info"> <div class="tabs-other-info">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabsList" :key="item.columnName" <el-tab-pane
:label="item.label" :name="'group' + item.groupId"> v-for="item in tabsList"
<resi-form :ref="'group' + item.groupId" :columns="3" :support-add="item.supportAdd" :key="item.columnName"
:form-id="item.columnName" :form-list=" item.itemList" /> :label="item.label"
:name="'group' + item.groupId"
>
<resi-form
:ref="'group' + item.groupId"
:columns="3"
:support-add="item.supportAdd"
:form-id="item.columnName"
:form-list="item.itemList"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
<div class="resi-btns"> <div class="resi-btns">
<el-button size="small" @click="handlerCancle">取消</el-button> <el-button size="small" @click="handlerCancle">取消</el-button>
<el-button type="primary" size="small" :loading="btnLoading" @click="handleSUbmit">提交</el-button> <el-button
type="primary"
size="small"
:loading="btnLoading"
@click="handleSUbmit"
>提交</el-button
>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="编辑" :title="formName"
:visible.sync="dialogEditVisible" :visible.sync="dialogEditVisible"
width="80%" width="80%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handlerEditCancle"> :before-close="handlerEditCancle"
<edit-resi v-if="dialogEditVisible" ref="baseForm" :disabled="disabled" :form-info="editForm" :fixed="true" :form-list="formList" @changegroup="handleChangeGroup" /> >
<div v-if="dialogEditVisible" class="resi-other"> <edit-resi
v-if="dialogEditVisible"
ref="baseForm"
:disabled="disabled"
:form-info="editForm"
:fixed="true"
:form-list="formList"
@changegroup="handleChangeGroup"
/>
<div v-if="dialogEditVisible" class="resi-other">
<div class="resi-other-title">其他</div> <div class="resi-other-title">其他</div>
<div class="tabs-other-info"> <div class="tabs-other-info">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabsList" :key="item.columnName" <el-tab-pane
:label="item.label" :name="'group' + item.groupId"> v-for="item in tabsList"
<edit-resi :ref="'group' + item.groupId" :columns="3" :support-add="item.supportAdd" :key="item.columnName"
:form-id="item.columnName" :muti-list="item.mutiList" :form-list=" item.itemList" :disabled="disabled" /> :label="item.label"
:name="'group' + item.groupId"
>
<edit-resi
:ref="'group' + item.groupId"
:columns="3"
:support-add="item.supportAdd"
:form-id="item.columnName"
:muti-list="item.mutiList"
:form-list="item.itemList"
:disabled="disabled"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
<div class="resi-btns"> <div class="resi-btns">
<el-button size="small" @click="handlerEditCancle">取消</el-button> <el-button size="small" @click="handlerEditCancle">取消</el-button>
<el-button v-if="!disabled" type="primary" size="small" :loading="btnLoading" @click="handleEditSUbmit">提交</el-button> <el-button
v-if="!disabled"
type="primary"
size="small"
:loading="btnLoading"
@click="handleEditSUbmit"
>提交</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -129,7 +198,7 @@ export default {
resiForm, resiForm,
editResi editResi
}, },
data () { data() {
return { return {
tableLoading: false, tableLoading: false,
btnLoading: false, btnLoading: false,
@ -150,15 +219,14 @@ export default {
BUILD_ID: '', BUILD_ID: '',
HOME_ID: '' HOME_ID: ''
}, },
editTableName: { editTableName: {},
formName: '',
},
formList: [], formList: [],
tableHeader: [], tableHeader: [],
tabsList: [] tabsList: []
} }
}, },
async created () { async created() {
await this.getSearchList() await this.getSearchList()
// await this.getFormList() // await this.getFormList()
await this.getTableHeader() await this.getTableHeader()
@ -167,38 +235,38 @@ export default {
console.log('storeoooo----0000', this.$store) console.log('storeoooo----0000', this.$store)
}, },
methods: { methods: {
filterEdit (id) { filterEdit(id) {
const { user } = this.$store.state const { user } = this.$store.state
return id === user.agencyId return id === user.agencyId
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val}`) console.log(`每页 ${val}`)
this.pageSize = val this.pageSize = val
this.getTableData() this.getTableData()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.currentPage = val this.currentPage = val
this.getTableData() this.getTableData()
}, },
handleFilterSpan (row, item) { handleFilterSpan(row, item) {
let _val = '' let _val = ''
if (item.itemType === 'radio' && item.options.length > 0) { if (item.itemType === 'radio' && item.options.length > 0) {
item.options.forEach(n => { item.options.forEach((n) => {
if (n.value === row[item.columnName]) _val = n.label if (n.value === row[item.columnName]) _val = n.label
}) })
} }
return _val || row[item.columnName] return _val || row[item.columnName]
}, },
handleSearch (val) { handleSearch(val) {
console.log('searchhh--', val) console.log('searchhh--', val)
this.currentPage = 1 this.currentPage = 1
this.conditions = val this.conditions = val
this.getTableData() this.getTableData()
}, },
// //
download (data, fileName) { download(data, fileName) {
console.log('data',data) console.log('data', data)
if (!data) { if (!data) {
return return
} }
@ -206,29 +274,28 @@ export default {
var csvData = new Blob([data]) var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) { if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName); window.navigator.msSaveOrOpenBlob(csvData, fileName)
} }
// for Non-IE (chrome, firefox etc.) // for Non-IE (chrome, firefox etc.)
else { else {
var a = document.createElement('a'); var a = document.createElement('a')
document.body.appendChild(a); document.body.appendChild(a)
a.style = 'display: none'; a.style = 'display: none'
var url = window.URL.createObjectURL(csvData); var url = window.URL.createObjectURL(csvData)
a.href = url; a.href = url
a.download = fileName; a.download = fileName
a.click(); a.click()
a.remove(); a.remove()
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url)
} }
}, },
handleExport () { handleExport() {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
conditions: this.conditions conditions: this.conditions
} }
// .post('epmetuser/icresiuser/exportExcel', params) // .post('epmetuser/icresiuser/exportExcel', params)
this.$http({ this.$http({
url: 'epmetuser/icresiuser/exportExcel', url: 'epmetuser/icresiuser/exportExcel',
method: 'post', method: 'post',
@ -237,46 +304,47 @@ export default {
headers: { 'Content-Type': 'application/x-download' } headers: { 'Content-Type': 'application/x-download' }
}, },
responseType: 'blob' responseType: 'blob'
}).then(({ data: res }) => { })
.then(({ data: res }) => {
// var headerData = res.headers // var headerData = res.headers
// this.download(res, '.xlsx') // this.download(res, '.xlsx')
console.log('res',res) console.log('res', res)
const fileName = '人员数据.xlsx' const fileName = '人员数据.xlsx'
let blob = new Blob([res], {type: 'application/vnd.ms-excel'}) let blob = new Blob([res], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob); var url = window.URL.createObjectURL(blob)
var aLink = document.createElement("a"); var aLink = document.createElement('a')
aLink.style.display = "none"; aLink.style.display = 'none'
aLink.href = url; aLink.href = url
aLink.setAttribute("download", fileName); aLink.setAttribute('download', fileName)
document.body.appendChild(aLink); document.body.appendChild(aLink)
aLink.click(); aLink.click()
document.body.removeChild(aLink); // document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url); //blob window.URL.revokeObjectURL(url) //blob
// window.location.href = res.data // window.location.href = res.data
}) })
.catch(err => { .catch((err) => {
console.log('获取导出情失败', err) console.log('获取导出情失败', err)
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
handleClick (tab, event) { handleClick(tab, event) {
console.log(tab, event) console.log(tab, event)
}, },
async handleLook (row) { async handleLook(row) {
this.disabled = true this.disabled = true
await this.getFormList() await this.getFormList()
this.getrowInfo(row.icResiUserId) this.getrowInfo(row.icResiUserId)
}, },
async handleEdit (row) { async handleEdit(row) {
this.disabled = false this.disabled = false
await this.getFormList('edit') await this.getFormList('edit')
await this.getrowInfo(row.icResiUserId) await this.getrowInfo(row.icResiUserId)
}, },
async handleAdd () { async handleAdd() {
await this.getFormList() await this.getFormList()
this.dialogVisible = true this.dialogVisible = true
}, },
async handleChangeGroup (val) { async handleChangeGroup(val) {
console.log('changeguoprrrrr----', val) console.log('changeguoprrrrr----', val)
let { childGroup, value } = val let { childGroup, value } = val
let hasT = false let hasT = false
@ -291,9 +359,9 @@ export default {
if (value === 1 || value === '1') { if (value === 1 || value === '1') {
// console.log('changegroup----999', value) // console.log('changegroup----999', value)
if (!hasT) { if (!hasT) {
childGroup.itemList.forEach(async item => { childGroup.itemList.forEach(async (item) => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
await this.getOptionsList(item.optionSourceValue).then(res => { await this.getOptionsList(item.optionSourceValue).then((res) => {
item.options = res item.options = res
}) })
// console.log('') // console.log('')
@ -306,17 +374,19 @@ export default {
if (hasT) this.tabsList.splice(i, 1) if (hasT) this.tabsList.splice(i, 1)
} }
}, },
formetForm () { formetForm() {
const _baseForm = this.$refs.baseForm.handleForm() const _baseForm = this.$refs.baseForm.handleForm()
let arr = [] let arr = []
if (_baseForm.length === 0) return false if (_baseForm.length === 0) return false
arr.push([ ..._baseForm ]) arr.push([..._baseForm])
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
arr.push([ ...this.$refs['group' + item.groupId][0].handleForm() ]) arr.push([...this.$refs['group' + item.groupId][0].handleForm()])
})
let arr2 = arr.reduce(function (a, b) {
return a.concat(b)
}) })
let arr2 = arr.reduce(function (a, b) { return a.concat(b) })
let noChange = true let noChange = true
arr2.forEach(item => { arr2.forEach((item) => {
if (item.list.length !== 0) noChange = false if (item.list.length !== 0) noChange = false
}) })
console.log('arr2', arr2) console.log('arr2', arr2)
@ -344,11 +414,12 @@ export default {
}) })
console.log('res', res) console.log('res', res)
// listlist // listlist
res.forEach(item => { res.forEach((item) => {
let _form = {} let _form = {}
item.list.length > 0 && item.list.forEach(n => { item.list.length > 0 &&
_form = { ..._form, ...n } item.list.forEach((n) => {
}) _form = { ..._form, ...n }
})
if (item.list.length > 0) { if (item.list.length > 0) {
finalArr.push({ finalArr.push({
tableName: item.tableName, tableName: item.tableName,
@ -359,15 +430,15 @@ export default {
console.log('finalArr', finalArr) console.log('finalArr', finalArr)
return finalArr return finalArr
}, },
async handleEditSUbmit () { async handleEditSUbmit() {
const arr = await this.formetForm() const arr = await this.formetForm()
if (arr) this.submitEdit(arr) if (arr) this.submitEdit(arr)
}, },
async handleSUbmit () { async handleSUbmit() {
const arr = await this.formetForm() const arr = await this.formetForm()
if (arr) this.submitAdd(arr) if (arr) this.submitAdd(arr)
}, },
handleDel (row) { handleDel(row) {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
icResiUserId: row.icResiUserId icResiUserId: row.icResiUserId
@ -386,24 +457,24 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
handleFormatUrl (url) { handleFormatUrl(url) {
return url.includes('?') return url.includes('?')
}, },
handlerEditCancle () { handlerEditCancle() {
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.dialogEditVisible = false this.dialogEditVisible = false
}, },
handlerCancle () { handlerCancle() {
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.dialogVisible = false this.dialogVisible = false
}, },
async submitAdd (arr) { async submitAdd(arr) {
this.btnLoading = true this.btnLoading = true
await this.$http await this.$http
.post('/epmetuser/icresiuser/add', arr) .post('/epmetuser/icresiuser/add', arr)
@ -414,7 +485,7 @@ export default {
this.$message.success('提交成功') this.$message.success('提交成功')
// this.$refs[formName].resetFields(); // this.$refs[formName].resetFields();
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.getTableData() this.getTableData()
@ -424,21 +495,20 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
this.btnLoading = false this.btnLoading = false
}, },
async submitEdit (arr) { async submitEdit(arr) {
this.btnLoading = true this.btnLoading = true
await this.$http await this.$http
.post('/epmetuser/icresiuser/edit', arr) .post('/epmetuser/icresiuser/edit', arr)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
this.$message.success('提交成功') this.$message.success('提交成功')
// this.$refs[formName].resetFields(); // this.$refs[formName].resetFields();
this.$refs.baseForm.resetForm() this.$refs.baseForm.resetForm()
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
this.$refs['group' + item.groupId][0].resetForm() this.$refs['group' + item.groupId][0].resetForm()
}) })
this.getTableData() this.getTableData()
@ -448,11 +518,13 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
this.btnLoading = false this.btnLoading = false
}, },
getTableHeader () { getTableHeader() {
this.$http this.$http
.post('/oper/customize/icform/tableheaders', { formCode: 'resi_base_info' }) .post('/oper/customize/icform/tableheaders', {
formCode: 'resi_base_info'
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -464,7 +536,7 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
async getTableData () { async getTableData() {
this.tableLoading = true this.tableLoading = true
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
@ -485,9 +557,9 @@ export default {
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
this.tableLoading = false this.tableLoading = false
}, },
getrowInfo (id) { getrowInfo(id) {
let params = { let params = {
formCode: 'resi_base_info', formCode: 'resi_base_info',
icResiUserId: id icResiUserId: id
@ -505,7 +577,7 @@ export default {
for (let n in list) { for (let n in list) {
this.editForm[n] = list[n] this.editForm[n] = list[n]
} }
this.formList.forEach(item => { this.formList.forEach((item) => {
if (item.childGroup && info[item.childGroup.tableName]) { if (item.childGroup && info[item.childGroup.tableName]) {
// let _info = info[item.childGroup.tableName] // let _info = info[item.childGroup.tableName]
// item.childGroup.itemList.forEach(n => { // item.childGroup.itemList.forEach(n => {
@ -516,7 +588,7 @@ export default {
item.columnValue = list[item.columnName] item.columnValue = list[item.columnName]
item.ID = list.ID item.ID = list.ID
}) })
this.tabsList.forEach(item => { this.tabsList.forEach((item) => {
let _info = info[item.tableName] let _info = info[item.tableName]
if (item.supportAdd) { if (item.supportAdd) {
// console.log('tabsList---333', item.label) // console.log('tabsList---333', item.label)
@ -527,7 +599,7 @@ export default {
// console.log('mutiList----555' + index, mutiList, _list) // console.log('mutiList----555' + index, mutiList, _list)
mutiList.splice(index, 0, { mutiList.splice(index, 0, {
row: index, row: index,
itemList: _list.map(m => { itemList: _list.map((m) => {
// console.log('itemList---item' + index, m) // console.log('itemList---item' + index, m)
return { return {
...m, ...m,
@ -542,7 +614,7 @@ export default {
item.mutiList = mutiList item.mutiList = mutiList
} else { } else {
if (_info) { if (_info) {
item.itemList.forEach(n => { item.itemList.forEach((n) => {
n.ID = _info[0].ID n.ID = _info[0].ID
n.columnValue = _info[0][n.columnName] n.columnValue = _info[0][n.columnName]
}) })
@ -558,7 +630,7 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
async getOptionsList (url) { async getOptionsList(url) {
let options = [] let options = []
// console.log('getOptionsList----', url) // console.log('getOptionsList----', url)
await this.$http await this.$http
@ -575,18 +647,21 @@ export default {
}) })
return options return options
}, },
getSearchList () { getSearchList() {
this.$http this.$http
.post('/oper/customize/icform/conditionlist', { formCode: 'resi_base_info', dynamic: true }) .post('/oper/customize/icform/conditionlist', {
formCode: 'resi_base_info',
dynamic: true
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
// console.log('', res.data) // console.log('', res.data)
this.searchList = res.data this.searchList = res.data
res.data.forEach(item => { res.data.forEach((item) => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
this.getOptionsList(item.optionSourceValue).then(res => { this.getOptionsList(item.optionSourceValue).then((res) => {
item.options = res item.options = res
}) })
// console.log('') // console.log('')
@ -598,30 +673,36 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
async getFormList (type) { async getFormList(type) {
await this.$http await this.$http
.post('/oper/customize/icform/getcustomerform', { formCode: 'resi_base_info', dynamic: true }) .post('/oper/customize/icform/getcustomerform', {
formCode: 'resi_base_info',
dynamic: true
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
console.log('获取详情成功getFormList') console.log('获取详情成功getFormList')
let { itemList, groupList } = res.data let { itemList, groupList, formName } = res.data
this.formName = formName
this.activeName = 'group' + res.data.groupList[0].groupId this.activeName = 'group' + res.data.groupList[0].groupId
if (type !== 'edit') { if (type !== 'edit') {
itemList.forEach(async item => { itemList.forEach(async (item) => {
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
await this.getOptionsList(item.optionSourceValue).then(res => { await this.getOptionsList(item.optionSourceValue).then(
item.options = res (res) => {
}) item.options = res
}
)
} }
}) })
} }
groupList.forEach(item => { groupList.forEach((item) => {
item.itemList.forEach(async n => { item.itemList.forEach(async (n) => {
n.tableName = item.tableName n.tableName = item.tableName
if (n.optionSourceType === 'remote' && type !== 'edit') { if (n.optionSourceType === 'remote' && type !== 'edit') {
await this.getOptionsList(n.optionSourceValue).then(res => { await this.getOptionsList(n.optionSourceValue).then((res) => {
n.options = res n.options = res
}) })
} }
@ -652,20 +733,21 @@ export default {
font-weight: 500; font-weight: 500;
color: #666666; color: #666666;
line-height: 20px; line-height: 20px;
background: #EBECF1; background: #ebecf1;
border-radius: 2px; border-radius: 2px;
} }
.el-tabs__nav-wrap::after, .el-tabs__active-bar { .el-tabs__nav-wrap::after,
.el-tabs__active-bar {
display: none; display: none;
} }
.el-tabs__nav-next, .el-tabs__nav-prev { .el-tabs__nav-next,
.el-tabs__nav-prev {
line-height: 20px; line-height: 20px;
} }
} }
.resi-table { .resi-table {
.el-button--text { .el-button--text {
text-decoration: underline; text-decoration: underline;
} }
.btn-color-del { .btn-color-del {
margin-left: 10px; margin-left: 10px;
@ -711,5 +793,4 @@ export default {
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
} }
</style> </style>

Loading…
Cancel
Save