|
@ -1,203 +1,180 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div v-if="pageLoading" class="resi-container"> |
|
|
<div v-if="pageLoading" |
|
|
<resi-search |
|
|
class="resi-container"> |
|
|
v-if="searchList.length > 0" |
|
|
<resi-search v-if="searchList.length > 0" |
|
|
ref="resiSearch" |
|
|
ref="resiSearch" |
|
|
:form-list="searchList" |
|
|
:form-list="searchList" |
|
|
@search="handleSearch" |
|
|
@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> |
|
|
<el-button type="success" |
|
|
<el-button type="warning" size="small" :loading="exportBtn" @click="handleExport">{{exportBtnTitle}}</el-button> |
|
|
size="small" |
|
|
|
|
|
@click="handleAdd">新增</el-button> |
|
|
|
|
|
<el-button type="warning" |
|
|
|
|
|
size="small" |
|
|
|
|
|
:loading="exportBtn" |
|
|
|
|
|
@click="handleExport">{{exportBtnTitle}}</el-button> |
|
|
<!-- <el-button type="primary" size="small">下载人口模板</el-button> --> |
|
|
<!-- <el-button type="primary" size="small">下载人口模板</el-button> --> |
|
|
<el-upload |
|
|
<el-upload ref="upload" |
|
|
ref="upload" |
|
|
class="upload-demo" |
|
|
class="upload-demo" |
|
|
action="uploadUlr" |
|
|
action="uploadUlr" |
|
|
:limit="1" |
|
|
:limit="1" |
|
|
:with-credentials="true" |
|
|
:with-credentials="true" |
|
|
:show-file-list="false" |
|
|
:show-file-list="false" |
|
|
:auto-upload="true" |
|
|
:auto-upload="true" |
|
|
:on-progress="handleProgress" |
|
|
:on-progress="handleProgress" |
|
|
:on-success="handleExcelSuccess" |
|
|
:on-success="handleExcelSuccess" |
|
|
:before-upload="beforeExcelUpload" |
|
|
:before-upload="beforeExcelUpload" |
|
|
:http-request="uploadHttpRequest"> |
|
|
:http-request="uploadHttpRequest" |
|
|
<el-button type="danger" |
|
|
> |
|
|
size="small" |
|
|
<el-button type="danger" size="small" :loading="importLoading">{{importBtnTitle}}</el-button> |
|
|
:loading="importLoading">{{importBtnTitle}}</el-button> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<el-table |
|
|
<el-table :data="tableData" |
|
|
:data="tableData" |
|
|
v-loading="tableLoading" |
|
|
v-loading="tableLoading" |
|
|
border |
|
|
border |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
class="resi-table"> |
|
|
class="resi-table" |
|
|
<el-table-column label="序号" |
|
|
> |
|
|
type="index" |
|
|
<el-table-column label="序号" 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" |
|
|
:key="item.columnName" |
|
|
:key="item.columnName" |
|
|
:prop="item.columnName" |
|
|
:prop="item.columnName" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
align="center" |
|
|
align="center" |
|
|
:show-overflow-tooltip="true" |
|
|
:show-overflow-tooltip="true" |
|
|
:width="item.itemType === 'radio' ? computedWidth(item.label) : 180"> |
|
|
:width="item.itemType === 'radio' ? computedWidth(item.label) : 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 fixed="right" label="操作" align="center" width="120"> |
|
|
<el-table-column fixed="right" |
|
|
|
|
|
label="操作" |
|
|
|
|
|
align="center" |
|
|
|
|
|
width="120"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-button |
|
|
<el-button @click="handleLook(scope.row)" |
|
|
@click="handleLook(scope.row)" |
|
|
type="text" |
|
|
type="text" |
|
|
size="small" |
|
|
size="small" |
|
|
class="btn-color-look">查看</el-button> |
|
|
class="btn-color-look" |
|
|
|
|
|
>查看</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<template v-if="filterEdit(scope.row.ORG_ID)"> |
|
|
<template v-if="filterEdit(scope.row.ORG_ID)"> |
|
|
<el-button |
|
|
<el-button @click="handleEdit(scope.row)" |
|
|
@click="handleEdit(scope.row)" |
|
|
type="text" |
|
|
type="text" |
|
|
size="small" |
|
|
size="small" |
|
|
class="btn-color-edit">编辑</el-button> |
|
|
class="btn-color-edit" |
|
|
<el-popconfirm title="删除之后无法回复,确认删除?" |
|
|
>编辑</el-button |
|
|
@onConfirm="handleDel(scope.row)"> |
|
|
> |
|
|
<el-button slot="reference" |
|
|
<el-popconfirm |
|
|
type="text" |
|
|
title="删除之后无法回复,确认删除?" |
|
|
size="small" |
|
|
@onConfirm="handleDel(scope.row)" |
|
|
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> |
|
|
<div> |
|
|
<div> |
|
|
<el-pagination |
|
|
<el-pagination @size-change="handleSizeChange" |
|
|
@size-change="handleSizeChange" |
|
|
@current-change="handleCurrentChange" |
|
|
@current-change="handleCurrentChange" |
|
|
:current-page.sync="currentPage" |
|
|
:current-page.sync="currentPage" |
|
|
: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="formName" |
|
|
: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" |
|
|
<resi-form |
|
|
:fixed="true" |
|
|
v-if="dialogVisible" |
|
|
:form-list="formList" |
|
|
ref="baseForm" |
|
|
@changegroup="handleChangeGroup" /> |
|
|
:fixed="true" |
|
|
<div v-if="dialogVisible" |
|
|
:form-list="formList" |
|
|
class="resi-other"> |
|
|
@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" |
|
|
<el-tab-pane |
|
|
@tab-click="handleClick"> |
|
|
v-for="item in tabsList" |
|
|
<el-tab-pane v-for="item in tabsList" |
|
|
:key="item.columnName" |
|
|
:key="item.columnName" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:name="'group' + item.groupId" |
|
|
:name="'group' + item.groupId"> |
|
|
> |
|
|
<resi-form :ref="'group' + item.groupId" |
|
|
<resi-form |
|
|
:columns="3" |
|
|
:ref="'group' + item.groupId" |
|
|
:support-add="item.supportAdd" |
|
|
:columns="3" |
|
|
:form-id="item.columnName" |
|
|
:support-add="item.supportAdd" |
|
|
:form-list="item.itemList" /> |
|
|
: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" |
|
|
<el-button |
|
|
@click="handlerCancle">取消</el-button> |
|
|
type="primary" |
|
|
<el-button type="primary" |
|
|
size="small" |
|
|
size="small" |
|
|
:loading="btnLoading" |
|
|
:loading="btnLoading" |
|
|
@click="handleSUbmit" |
|
|
@click="handleSUbmit">提交</el-button> |
|
|
>提交</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
<el-dialog :title="formName" |
|
|
: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" |
|
|
<edit-resi |
|
|
:disabled="disabled" |
|
|
v-if="dialogEditVisible" |
|
|
:form-info="editForm" |
|
|
ref="baseForm" |
|
|
:fixed="true" |
|
|
:disabled="disabled" |
|
|
:form-list="formList" |
|
|
:form-info="editForm" |
|
|
:agency-id="editAgencyId" |
|
|
:fixed="true" |
|
|
@changegroup="handleChangeGroup" /> |
|
|
:form-list="formList" |
|
|
<div v-if="dialogEditVisible" |
|
|
:agency-id="editAgencyId" |
|
|
class="resi-other"> |
|
|
@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" |
|
|
<el-tab-pane |
|
|
@tab-click="handleClick"> |
|
|
v-for="item in tabsList" |
|
|
<el-tab-pane v-for="item in tabsList" |
|
|
:key="item.columnName" |
|
|
:key="item.columnName" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:name="'group' + item.groupId" |
|
|
:name="'group' + item.groupId"> |
|
|
> |
|
|
<edit-resi :ref="'group' + item.groupId" |
|
|
<edit-resi |
|
|
:columns="3" |
|
|
:ref="'group' + item.groupId" |
|
|
:support-add="item.supportAdd" |
|
|
:columns="3" |
|
|
:form-id="item.columnName" |
|
|
:support-add="item.supportAdd" |
|
|
:muti-list="item.mutiList" |
|
|
:form-id="item.columnName" |
|
|
:form-list="item.itemList" |
|
|
:muti-list="item.mutiList" |
|
|
:disabled="disabled" |
|
|
:form-list="item.itemList" |
|
|
:label-width="'140px'" |
|
|
:disabled="disabled" |
|
|
:agency-id="editAgencyId" /> |
|
|
:label-width="'140px'" |
|
|
|
|
|
:agency-id="editAgencyId" |
|
|
|
|
|
/> |
|
|
|
|
|
</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" |
|
|
<el-button |
|
|
@click="handlerEditCancle">取消</el-button> |
|
|
v-if="!disabled" |
|
|
<el-button v-if="!disabled" |
|
|
type="primary" |
|
|
type="primary" |
|
|
size="small" |
|
|
size="small" |
|
|
:loading="btnLoading" |
|
|
:loading="btnLoading" |
|
|
@click="handleEditSUbmit" |
|
|
@click="handleEditSUbmit">提交</el-button> |
|
|
>提交</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
@ -214,7 +191,7 @@ export default { |
|
|
resiForm, |
|
|
resiForm, |
|
|
editResi |
|
|
editResi |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
exportBtn: false, |
|
|
exportBtn: false, |
|
|
exportBtnTitle: '导出', |
|
|
exportBtnTitle: '导出', |
|
@ -246,10 +223,28 @@ export default { |
|
|
formName: '', |
|
|
formName: '', |
|
|
formList: [], |
|
|
formList: [], |
|
|
tableHeader: [], |
|
|
tableHeader: [], |
|
|
tabsList: [] |
|
|
tabsList: [], |
|
|
|
|
|
|
|
|
|
|
|
defaultCategotyKey: '' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
props: { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
activated () { |
|
|
|
|
|
if (this.$route.query) { |
|
|
|
|
|
let query = this.$route.query |
|
|
|
|
|
this.defaultCategotyKey = query.columnName |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
async created() { |
|
|
async created () { |
|
|
|
|
|
if (this.$route.query) { |
|
|
|
|
|
let query = this.$route.query |
|
|
|
|
|
this.defaultCategotyKey = query.columnName |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await this.getSearchList() |
|
|
await this.getSearchList() |
|
|
// await this.getFormList() |
|
|
// await this.getFormList() |
|
|
await this.getTableHeader() |
|
|
await this.getTableHeader() |
|
@ -258,25 +253,25 @@ export default { |
|
|
console.log('storeoooo----0000', this.$store) |
|
|
console.log('storeoooo----0000', this.$store) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
computedWidth(label) { |
|
|
computedWidth (label) { |
|
|
const wd = 20 * label.length |
|
|
const wd = 20 * label.length |
|
|
return wd > 80 ? wd : 80 |
|
|
return wd > 80 ? wd : 80 |
|
|
}, |
|
|
}, |
|
|
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) => { |
|
@ -285,14 +280,14 @@ export default { |
|
|
} |
|
|
} |
|
|
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 |
|
@ -316,7 +311,7 @@ export default { |
|
|
window.URL.revokeObjectURL(url) |
|
|
window.URL.revokeObjectURL(url) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async handleExport() { |
|
|
async handleExport () { |
|
|
this.exportBtn = true |
|
|
this.exportBtn = true |
|
|
this.exportBtnTitle = '正在导出...' |
|
|
this.exportBtnTitle = '正在导出...' |
|
|
let params = { |
|
|
let params = { |
|
@ -333,7 +328,7 @@ export default { |
|
|
responseType: 'blob' |
|
|
responseType: 'blob' |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
|
|
|
|
|
|
console.log('resllll', res) |
|
|
console.log('resllll', res) |
|
|
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
console.log('filename', fileName) |
|
|
console.log('filename', fileName) |
|
@ -352,8 +347,8 @@ export default { |
|
|
console.log('获取导出情失败', err) |
|
|
console.log('获取导出情失败', err) |
|
|
this.$message.error('获取导出失败') |
|
|
this.$message.error('获取导出失败') |
|
|
}) |
|
|
}) |
|
|
this.exportBtnTitle = '导出' |
|
|
this.exportBtnTitle = '导出' |
|
|
this.exportBtn = false |
|
|
this.exportBtn = false |
|
|
}, |
|
|
}, |
|
|
// 上传大图标成功 |
|
|
// 上传大图标成功 |
|
|
handleExcelSuccess (res, file) { |
|
|
handleExcelSuccess (res, file) { |
|
@ -365,7 +360,7 @@ export default { |
|
|
this.$message.error(res.msg) |
|
|
this.$message.error(res.msg) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleProgress(event, file, fileList) { |
|
|
handleProgress (event, file, fileList) { |
|
|
console.log('percentage', file.percentage) |
|
|
console.log('percentage', file.percentage) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -375,16 +370,16 @@ export default { |
|
|
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
const fileType = isType || isTypeComputer |
|
|
const fileType = isType || isTypeComputer |
|
|
const isLt1M = (file.size / 1024 / 1024) < 10 |
|
|
const isLt1M = (file.size / 1024 / 1024) < 10 |
|
|
if(!fileType) { |
|
|
if (!fileType) { |
|
|
this.$message.error('上传文件只能是xls/xlsx格式!') |
|
|
this.$message.error('上传文件只能是xls/xlsx格式!') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!isLt1M) { |
|
|
if (!isLt1M) { |
|
|
this.$message.error('上传文件大小不能超过 10MB!') |
|
|
this.$message.error('上传文件大小不能超过 10MB!') |
|
|
} |
|
|
} |
|
|
return fileType && isLt1M |
|
|
return fileType && isLt1M |
|
|
}, |
|
|
}, |
|
|
async uploadHttpRequest(file) { |
|
|
async uploadHttpRequest (file) { |
|
|
this.importLoading = true |
|
|
this.importLoading = true |
|
|
this.importBtnTitle = '正在上传中...' |
|
|
this.importBtnTitle = '正在上传中...' |
|
|
const formData = new FormData() //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
const formData = new FormData() //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
@ -395,53 +390,53 @@ export default { |
|
|
data: formData, |
|
|
data: formData, |
|
|
responseType: 'blob' |
|
|
responseType: 'blob' |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
if (res.headers["content-disposition"]) { |
|
|
if (res.headers["content-disposition"]) { |
|
|
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
console.log('filename', fileName) |
|
|
console.log('filename', fileName) |
|
|
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) |
|
|
let blob = new Blob([res.data], { 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对象 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.getTableData() |
|
|
this.getTableData() |
|
|
}) |
|
|
}) |
|
|
.catch( err => { |
|
|
.catch(err => { |
|
|
console.log('失败', err) |
|
|
console.log('失败', err) |
|
|
file.onError() //上传失败的文件会从文件列表中删除 |
|
|
file.onError() //上传失败的文件会从文件列表中删除 |
|
|
this.$message.error('导入失败') |
|
|
this.$message.error('导入失败') |
|
|
}) |
|
|
}) |
|
|
this.importLoading = false |
|
|
this.importLoading = false |
|
|
this.importBtnTitle = '导入人员数据' |
|
|
this.importBtnTitle = '导入人员数据' |
|
|
this.$refs.upload.clearFiles() |
|
|
this.$refs.upload.clearFiles() |
|
|
}, |
|
|
}, |
|
|
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 |
|
|
this.editAgencyId = row.ORG_ID |
|
|
this.editAgencyId = row.ORG_ID |
|
|
await this.getFormList('edit') |
|
|
await this.getFormList('edit') |
|
|
this.getrowInfo(row.icResiUserId) |
|
|
this.getrowInfo(row.icResiUserId) |
|
|
}, |
|
|
}, |
|
|
async handleEdit(row) { |
|
|
async handleEdit (row) { |
|
|
this.disabled = false |
|
|
this.disabled = false |
|
|
this.editAgencyId = row.ORG_ID |
|
|
this.editAgencyId = row.ORG_ID |
|
|
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 |
|
@ -471,7 +466,7 @@ 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 |
|
@ -527,15 +522,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 |
|
@ -558,24 +553,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) |
|
@ -598,13 +593,13 @@ export default { |
|
|
}) |
|
|
}) |
|
|
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('提交成功') |
|
@ -622,7 +617,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
this.btnLoading = false |
|
|
this.btnLoading = false |
|
|
}, |
|
|
}, |
|
|
getTableHeader() { |
|
|
getTableHeader () { |
|
|
this.$http |
|
|
this.$http |
|
|
.post('/oper/customize/icform/tableheaders', { |
|
|
.post('/oper/customize/icform/tableheaders', { |
|
|
formCode: 'resi_base_info' |
|
|
formCode: 'resi_base_info' |
|
@ -638,7 +633,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', |
|
@ -661,7 +656,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
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 |
|
@ -737,7 +732,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 |
|
@ -754,7 +749,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
return options |
|
|
return options |
|
|
}, |
|
|
}, |
|
|
getSearchList() { |
|
|
getSearchList () { |
|
|
this.$http |
|
|
this.$http |
|
|
.post('/oper/customize/icform/conditionlist', { |
|
|
.post('/oper/customize/icform/conditionlist', { |
|
|
formCode: 'resi_base_info', |
|
|
formCode: 'resi_base_info', |
|
@ -780,13 +775,13 @@ export default { |
|
|
return this.$message.error('网络错误') |
|
|
return this.$message.error('网络错误') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getTreeData(data){ |
|
|
getTreeData (data) { |
|
|
if (!Array.isArray(data)) return [] |
|
|
if (!Array.isArray(data)) return [] |
|
|
let arr = data.map(item => { |
|
|
let arr = data.map(item => { |
|
|
let _item = {} |
|
|
let _item = {} |
|
|
if (item.children) { |
|
|
if (item.children) { |
|
|
if (item.children.length === 0) _item = { ...item, children: undefined } |
|
|
if (item.children.length === 0) _item = { ...item, children: undefined } |
|
|
else _item = { ...item, children: this.getTreeData(item.children)} |
|
|
else _item = { ...item, children: this.getTreeData(item.children) } |
|
|
} else { |
|
|
} else { |
|
|
_item = { ...item } |
|
|
_item = { ...item } |
|
|
} |
|
|
} |
|
@ -794,7 +789,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
return arr |
|
|
return arr |
|
|
}, |
|
|
}, |
|
|
async getFormList(type) { |
|
|
async getFormList (type) { |
|
|
await this.$http |
|
|
await this.$http |
|
|
.post('/oper/customize/icform/getcustomerform', { |
|
|
.post('/oper/customize/icform/getcustomerform', { |
|
|
formCode: 'resi_base_info', |
|
|
formCode: 'resi_base_info', |
|
@ -867,12 +862,12 @@ export default { |
|
|
// height: 12px; |
|
|
// height: 12px; |
|
|
color: rgba(30, 122, 254, 1); |
|
|
color: rgba(30, 122, 254, 1); |
|
|
line-height: 20px; |
|
|
line-height: 20px; |
|
|
background: rgba(30, 122, 254, .2); |
|
|
background: rgba(30, 122, 254, 0.2); |
|
|
// border-radius: 50%; |
|
|
// border-radius: 50%; |
|
|
} |
|
|
} |
|
|
::v-deep .el-tabs__item.is-active { |
|
|
::v-deep .el-tabs__item.is-active { |
|
|
color: #fff; |
|
|
color: #fff; |
|
|
background: linear-gradient(90deg, #1A5AFD, #26C4FF); |
|
|
background: linear-gradient(90deg, #1a5afd, #26c4ff); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.resi-container .resi-card-table { |
|
|
.resi-container .resi-card-table { |
|
|