|
|
|
@ -1,29 +1,41 @@ |
|
|
|
<template> |
|
|
|
<div v-if="pageLoading" class="resi-container"> |
|
|
|
<el-card ref="searchCard" class="search-card"> |
|
|
|
<div v-if="pageLoading" |
|
|
|
class="resi-container"> |
|
|
|
<el-card ref="searchCard" |
|
|
|
class="search-card"> |
|
|
|
<div class=""> |
|
|
|
<el-form ref="searchForm" :inline="true" :model="searchForm" class="demo-form-inline"> |
|
|
|
<el-form-item label="所属网格" prop="gridId"> |
|
|
|
<el-select v-model="searchForm.gridId" filterable placeholder="请选择" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsG" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
<el-form ref="searchForm" |
|
|
|
:inline="true" |
|
|
|
:model="searchForm" |
|
|
|
class="demo-form-inline"> |
|
|
|
<el-form-item label="所属网格" |
|
|
|
prop="gridId"> |
|
|
|
<el-select v-model="searchForm.gridId" |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in optionsG" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="分类类别" prop="categoryId"> |
|
|
|
<el-select v-model="searchForm.categoryId" filterable placeholder="请选择" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsC" |
|
|
|
:key="item.categoryId" |
|
|
|
:label="item.categoryName" |
|
|
|
:value="item.categoryId"> |
|
|
|
<el-form-item label="分类类别" |
|
|
|
prop="categoryId"> |
|
|
|
<el-select v-model="searchForm.categoryId" |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in optionsC" |
|
|
|
:key="item.categoryId" |
|
|
|
:label="item.categoryName" |
|
|
|
:value="item.categoryId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="党员姓名" prop="name"> |
|
|
|
<el-form-item label="党员姓名" |
|
|
|
prop="name"> |
|
|
|
<!-- <el-select v-model="searchForm.name" filterable placeholder="请选择" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in demandOptions" |
|
|
|
@ -32,212 +44,266 @@ |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> --> |
|
|
|
<el-input v-model="searchForm.name" placeholder="请输入" class="input-width" clearable></el-input> |
|
|
|
<el-input v-model="searchForm.name" |
|
|
|
placeholder="请输入" |
|
|
|
class="input-width" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="主要事迹" prop="mainDeed" > |
|
|
|
<el-input v-model="searchForm.mainDeed" placeholder="请输入" class="input-width" clearable></el-input> |
|
|
|
<el-form-item label="主要事迹" |
|
|
|
prop="mainDeed"> |
|
|
|
<el-input v-model="searchForm.mainDeed" |
|
|
|
placeholder="请输入" |
|
|
|
class="input-width" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button class="diy-button--search" size="small" @click="handleSearch">查询</el-button> |
|
|
|
<el-button class="diy-button--reset" size="small" @click="resetForm('searchForm')">重置</el-button> |
|
|
|
<el-button class="diy-button--search" |
|
|
|
size="small" |
|
|
|
@click="handleSearch">查询</el-button> |
|
|
|
<el-button class="diy-button--reset" |
|
|
|
size="small" |
|
|
|
@click="resetForm('searchForm')">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
<el-card class="resi-card-table"> |
|
|
|
|
|
|
|
|
|
|
|
<div class="resi-row-btn"> |
|
|
|
<el-button class="diy-button--add" size="small" @click="handleAdd">新增</el-button> |
|
|
|
<el-button |
|
|
|
class="diy-button--export" |
|
|
|
<el-button class="diy-button--add" |
|
|
|
size="small" |
|
|
|
@click="handleAdd">新增</el-button> |
|
|
|
<el-button class="diy-button--export" |
|
|
|
size="small" |
|
|
|
@click="handleExportModule('room')">下载模板</el-button> |
|
|
|
<el-upload :headers="$getElUploadHeaders()" |
|
|
|
ref="upload" |
|
|
|
class="upload-demo" |
|
|
|
action="uploadUlr" |
|
|
|
:limit="1" |
|
|
|
:accept="'.xls,.xlsx'" |
|
|
|
:with-credentials="true" |
|
|
|
:show-file-list="false" |
|
|
|
:auto-upload="true" |
|
|
|
:on-success="handleExcelSuccess" |
|
|
|
:before-upload="beforeExcelUpload" |
|
|
|
:http-request="uploadHttpRequest" |
|
|
|
> |
|
|
|
<el-button size="small" class="diy-button--delete" :loading="importLoading">{{importBtnTitle}}</el-button> |
|
|
|
<el-upload :headers="$getElUploadHeaders()" |
|
|
|
ref="upload" |
|
|
|
class="upload-demo" |
|
|
|
action="uploadUlr" |
|
|
|
:limit="1" |
|
|
|
:accept="'.xls,.xlsx'" |
|
|
|
:with-credentials="true" |
|
|
|
:show-file-list="false" |
|
|
|
:auto-upload="true" |
|
|
|
:on-success="handleExcelSuccess" |
|
|
|
:before-upload="beforeExcelUpload" |
|
|
|
:http-request="uploadHttpRequest"> |
|
|
|
<el-button size="small" |
|
|
|
class="diy-button--delete" |
|
|
|
:loading="importLoading">{{importBtnTitle}}</el-button> |
|
|
|
</el-upload> |
|
|
|
<el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button> |
|
|
|
|
|
|
|
<el-button class="diy-button--reset" |
|
|
|
size="small" |
|
|
|
:loading="exportBtn" |
|
|
|
@click="handleExport">{{ exportBtnTitle }}</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
|
row-key="id" |
|
|
|
v-loading="tableLoading" |
|
|
|
border |
|
|
|
:height="tableHeight" |
|
|
|
style="width: 100%" |
|
|
|
class="resi-table" |
|
|
|
> |
|
|
|
<el-table-column label="序号" type="index" align="center" width="50"> |
|
|
|
|
|
|
|
<el-table :data="tableData" |
|
|
|
row-key="id" |
|
|
|
v-loading="tableLoading" |
|
|
|
border |
|
|
|
:height="tableHeight" |
|
|
|
style="width: 100%" |
|
|
|
class="resi-table"> |
|
|
|
<el-table-column label="序号" |
|
|
|
type="index" |
|
|
|
align="center" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="item in tableHeader" |
|
|
|
:key="item.columnName" |
|
|
|
:prop="item.columnName" |
|
|
|
:label="item.label" |
|
|
|
:align="item.align" |
|
|
|
:width="item.width" |
|
|
|
> |
|
|
|
<el-table-column v-for="item in tableHeader" |
|
|
|
:key="item.columnName" |
|
|
|
:prop="item.columnName" |
|
|
|
:label="item.label" |
|
|
|
:align="item.align" |
|
|
|
:width="item.width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="div-content">{{ handleFilterSpan(scope.row, item) }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" width="200"> |
|
|
|
<el-table-column label="操作" |
|
|
|
align="center" |
|
|
|
width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
@click="handleLook(scope.row)" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="btn-color-look" |
|
|
|
>查看</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
@click="handleEdit(scope.row, 'edit')" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="btn-color-edit" |
|
|
|
>修改</el-button |
|
|
|
> |
|
|
|
<el-popconfirm |
|
|
|
title="删除之后无法恢复,确认删除?" |
|
|
|
@onConfirm="handleDel(scope.row)" |
|
|
|
> |
|
|
|
<el-button |
|
|
|
slot="reference" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="btn-color-del" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</el-popconfirm> |
|
|
|
<el-button @click="handleLook(scope.row)" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="btn-color-look">查看</el-button> |
|
|
|
<el-button @click="handleEdit(scope.row, 'edit')" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="btn-color-edit">修改</el-button> |
|
|
|
<el-popconfirm title="删除之后无法恢复,确认删除?" |
|
|
|
@onConfirm="handleDel(scope.row)"> |
|
|
|
<el-button slot="reference" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
class="btn-color-del">删除</el-button> |
|
|
|
</el-popconfirm> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div> |
|
|
|
<el-pagination |
|
|
|
@size-change="handleSizeChange" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
:current-page.sync="currentPage" |
|
|
|
:page-sizes="[20, 50, 100, 200]" |
|
|
|
:page-size="pageSize" |
|
|
|
layout="sizes, prev, pager, next, total" |
|
|
|
:total="total" |
|
|
|
> |
|
|
|
<el-pagination @size-change="handleSizeChange" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
:current-page.sync="currentPage" |
|
|
|
:page-sizes="[20, 50, 100, 200]" |
|
|
|
:page-size="pageSize" |
|
|
|
layout="sizes, prev, pager, next, total" |
|
|
|
:total="total"> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
title="党员风采" |
|
|
|
:visible.sync="dialogVisible" |
|
|
|
width="50%" |
|
|
|
top="5vh" |
|
|
|
class="dialog-h" |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
:before-close="handlerCancle" |
|
|
|
> |
|
|
|
<el-form v-if="dialogVisible" label-width="100px" :model="form" :rules="rules" ref="ruleForm" |
|
|
|
class="form-wr dialog-h-content scroll-h"> |
|
|
|
<el-form-item label="所属网格" prop="gridId"> |
|
|
|
<el-select v-model="form.gridId" filterable |
|
|
|
:disabled="disabled" placeholder="请选择" class="input-width" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsEditG" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-dialog title="党员风采" |
|
|
|
:visible.sync="dialogVisible" |
|
|
|
width="50%" |
|
|
|
top="5vh" |
|
|
|
class="dialog-h" |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
:before-close="handlerCancle"> |
|
|
|
<el-form v-if="dialogVisible" |
|
|
|
label-width="100px" |
|
|
|
:model="form" |
|
|
|
:rules="rules" |
|
|
|
ref="ruleForm" |
|
|
|
class="form-wr dialog-h-content scroll-h"> |
|
|
|
<el-form-item label="所属网格" |
|
|
|
prop="gridId"> |
|
|
|
<el-select v-model="form.gridId" |
|
|
|
filterable |
|
|
|
:disabled="disabled" |
|
|
|
placeholder="请选择" |
|
|
|
class="input-width" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in optionsEditG" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="disabled" label="分类类别" prop="categoryId"> |
|
|
|
<el-select v-model="form.categoryId" filterable :disabled="disabled" placeholder="请选择" class="input-width" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsC" |
|
|
|
:key="item.categoryId" |
|
|
|
:label="item.categoryName" |
|
|
|
:value="item.categoryId"> |
|
|
|
<el-form-item v-if="disabled" |
|
|
|
label="分类类别" |
|
|
|
prop="categoryId"> |
|
|
|
<el-select v-model="form.categoryId" |
|
|
|
filterable |
|
|
|
:disabled="disabled" |
|
|
|
placeholder="请选择" |
|
|
|
class="input-width" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in optionsC" |
|
|
|
:key="item.categoryId" |
|
|
|
:label="item.categoryName" |
|
|
|
:value="item.categoryId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else label="分类类别" prop="categoryId"> |
|
|
|
<el-select v-model="form.categoryId" filterable :disabled="disabled" placeholder="请选择" class="input-width" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsEditC" |
|
|
|
:key="item.categoryId" |
|
|
|
:label="item.categoryName" |
|
|
|
:value="item.categoryId"> |
|
|
|
<el-form-item v-else |
|
|
|
label="分类类别" |
|
|
|
prop="categoryId"> |
|
|
|
<el-select v-model="form.categoryId" |
|
|
|
filterable |
|
|
|
:disabled="disabled" |
|
|
|
placeholder="请选择" |
|
|
|
class="input-width" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in optionsEditC" |
|
|
|
:key="item.categoryId" |
|
|
|
:label="item.categoryName" |
|
|
|
:value="item.categoryId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="党员姓名" prop="name"> |
|
|
|
<el-input v-model="form.name" placeholder="请输入" :disabled="disabled" class="input-width" clearable></el-input> |
|
|
|
<el-form-item label="党员姓名" |
|
|
|
prop="name"> |
|
|
|
<el-input v-model="form.name" |
|
|
|
placeholder="请输入" |
|
|
|
:disabled="disabled" |
|
|
|
class="input-width" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="主要事迹" prop="mainDeed"> |
|
|
|
<el-input v-model="form.mainDeed" :autosize="{ minRows: 10, maxRows: 10}" :disabled="disabled" type="textarea" clearable class="input-width-textarea" placeholder="请输入内容"></el-input> |
|
|
|
<el-form-item label="主要事迹" |
|
|
|
prop="mainDeed"> |
|
|
|
<el-input v-model="form.mainDeed" |
|
|
|
:autosize="{ minRows: 10, maxRows: 10}" |
|
|
|
:disabled="disabled" |
|
|
|
type="textarea" |
|
|
|
clearable |
|
|
|
class="input-width-textarea" |
|
|
|
placeholder="请输入内容"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="状态"> |
|
|
|
<el-switch v-model="form.usableFlag"></el-switch> |
|
|
|
</el-form-item> --> |
|
|
|
<el-form-item label="照片"> |
|
|
|
<div class="imsg-list"> |
|
|
|
<div v-for="(item, index) in form.imageList" :key="index" class="imgs-item"> |
|
|
|
<el-image |
|
|
|
style="width: 100px; height: 100px" |
|
|
|
:src="item" |
|
|
|
fit="fill" |
|
|
|
:preview-src-list="form.imageList"></el-image> |
|
|
|
<i class="el-icon-delete" @click="handleDelimg(item, index)"></i> |
|
|
|
<div v-for="(item, index) in form.imageList" |
|
|
|
:key="index" |
|
|
|
class="imgs-item"> |
|
|
|
<el-image style="width: 100px; height: 100px" |
|
|
|
:src="item" |
|
|
|
fit="fill" |
|
|
|
:preview-src-list="form.imageList"></el-image> |
|
|
|
<i class="el-icon-delete" |
|
|
|
@click="handleDelimg(item, index)"></i> |
|
|
|
</div> |
|
|
|
<el-upload :headers="$getElUploadHeaders()" class="avatar-uploader" |
|
|
|
v-if="form.imageList.length < 3 && !disabled" |
|
|
|
:action="uploadUlr" |
|
|
|
:data="{customerId:customerId}" |
|
|
|
:show-file-list="false" |
|
|
|
:disabled="disabled" |
|
|
|
:on-progress="handleProgress" |
|
|
|
:on-success="handleImgSuccess" |
|
|
|
:before-upload="beforeImgUpload"> |
|
|
|
<el-progress v-if="uploading" :width="100" type="circle" :percentage="unloadPencent"></el-progress> |
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
|
|
|
|
|
|
|
<el-upload :headers="$getElUploadHeaders()" |
|
|
|
class="avatar-uploader" |
|
|
|
v-if="form.imageList.length < 3 && !disabled" |
|
|
|
:action="uploadUlr" |
|
|
|
:data="{customerId:customerId}" |
|
|
|
:show-file-list="false" |
|
|
|
:disabled="disabled" |
|
|
|
:on-progress="handleProgress" |
|
|
|
:on-success="handleImgSuccess" |
|
|
|
:before-upload="beforeImgUpload"> |
|
|
|
<el-progress v-if="uploading" |
|
|
|
:width="100" |
|
|
|
type="circle" |
|
|
|
:percentage="unloadPencent"></el-progress> |
|
|
|
<i v-else |
|
|
|
class="el-icon-plus avatar-uploader-icon"></i> |
|
|
|
|
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div class="resi-btns"> |
|
|
|
<el-button size="small" @click="handlerCancle">取消</el-button> |
|
|
|
<el-button |
|
|
|
v-if="!disabled" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
:loading="btnLoading" |
|
|
|
@click="handleSUbmit" |
|
|
|
>提交</el-button |
|
|
|
> |
|
|
|
<el-button size="small" |
|
|
|
@click="handlerCancle">取消</el-button> |
|
|
|
<el-button v-if="!disabled" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
:loading="btnLoading" |
|
|
|
@click="handleSUbmit">提交</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 详情弹出框 --> |
|
|
|
<el-dialog :visible.sync="detailShow" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:close-on-press-escape="false" |
|
|
|
:title="'党员风采详情'" |
|
|
|
width="850px" |
|
|
|
top="5vh" |
|
|
|
class="dialog-h" |
|
|
|
@closed="detailFormCancle"> |
|
|
|
<detail-form ref="ref_form_detail"></detail-form> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import axios from 'axios' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import detailForm from "./detail"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
components: { detailForm }, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', |
|
|
|
importBtnTitle: '导入', |
|
|
|
@ -267,7 +333,7 @@ export default { |
|
|
|
{ |
|
|
|
label: '是', |
|
|
|
value: 1 |
|
|
|
},{ |
|
|
|
}, { |
|
|
|
label: '否', |
|
|
|
value: 2 |
|
|
|
} |
|
|
|
@ -320,18 +386,19 @@ export default { |
|
|
|
categoryId: [{ required: true, message: '分类类别不能为空', trigger: 'blur' }], |
|
|
|
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }], |
|
|
|
mainDeed: [{ required: true, message: '主要事迹不能为空', trigger: 'blur' }], |
|
|
|
} |
|
|
|
}, |
|
|
|
detailShow: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapGetters(['clientHeight', 'iframeHeight']), |
|
|
|
tableHeight() { |
|
|
|
tableHeight () { |
|
|
|
const h = this.clientHeight - this.searchH - 280 + this.iframeHeigh |
|
|
|
const _h = this.clientHeight - 280 - this.searchH |
|
|
|
return this.$store.state.inIframe ? h : _h |
|
|
|
} |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
async created () { |
|
|
|
this.customerId = localStorage.getItem('customerId') |
|
|
|
// setTimeout(() => { |
|
|
|
// this.getTableData() |
|
|
|
@ -341,35 +408,35 @@ export default { |
|
|
|
// this.getCateList('addorupdate') |
|
|
|
// }, 200) |
|
|
|
this.getTableData() |
|
|
|
this.getGridList('query') |
|
|
|
this.getGridList('addorupdate') |
|
|
|
this.getCateList('query') |
|
|
|
this.getCateList('addorupdate') |
|
|
|
this.getGridList('query') |
|
|
|
this.getGridList('addorupdate') |
|
|
|
this.getCateList('query') |
|
|
|
this.getCateList('addorupdate') |
|
|
|
this.pageLoading = true |
|
|
|
|
|
|
|
|
|
|
|
// this.tableHeight = document.documentElement.clientHeight - this.$refs.searchCard.$el.offsetHeight - 280 + 'px' |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
|
|
|
|
|
|
|
|
mounted () { |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.searchH = this.$refs.searchCard.$el.offsetHeight |
|
|
|
console.log('tableHeight', this.tableHeight) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleSizeChange(val) { |
|
|
|
handleSizeChange (val) { |
|
|
|
console.log(`每页 ${val} 条`) |
|
|
|
this.pageSize = val |
|
|
|
this.getTableData() |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
handleCurrentChange (val) { |
|
|
|
console.log(`当前页: ${val}`) |
|
|
|
this.currentPage = val |
|
|
|
this.getTableData() |
|
|
|
}, |
|
|
|
handleFilterSpan(row, item) { |
|
|
|
handleFilterSpan (row, item) { |
|
|
|
let _val = '' |
|
|
|
if (item.options && item.options.length > 0) { |
|
|
|
item.options.forEach((n) => { |
|
|
|
@ -388,7 +455,7 @@ export default { |
|
|
|
this.$message.error(res.msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleProgress(event, file, fileList) { |
|
|
|
handleProgress (event, file, fileList) { |
|
|
|
console.log('percentage', event, file.percentage) |
|
|
|
this.uploading = true |
|
|
|
this.unloadPencent = Number(file.percentage.toFixed(0)) |
|
|
|
@ -419,7 +486,7 @@ export default { |
|
|
|
}, |
|
|
|
async handleExportModule () { |
|
|
|
let url = "/resi/partymember/icpartymemberstyle/import/template-download" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let params = {} |
|
|
|
// app.ajax.exportFilePost( |
|
|
|
@ -468,16 +535,16 @@ export default { |
|
|
|
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
const fileType = isType || isTypeComputer |
|
|
|
const isLt1M = (file.size / 1024 / 1024) < 10 |
|
|
|
if(!fileType) { |
|
|
|
this.$message.error('上传文件只能是xls/xlsx格式!') |
|
|
|
if (!fileType) { |
|
|
|
this.$message.error('上传文件只能是xls/xlsx格式!') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!isLt1M) { |
|
|
|
this.$message.error('上传文件大小不能超过 10MB!') |
|
|
|
} |
|
|
|
return fileType && isLt1M |
|
|
|
}, |
|
|
|
async uploadHttpRequest(file) { |
|
|
|
async uploadHttpRequest (file) { |
|
|
|
this.importLoading = true |
|
|
|
this.importBtnTitle = '正在上传中...' |
|
|
|
this.$message({ |
|
|
|
@ -533,7 +600,7 @@ export default { |
|
|
|
this.importBtnTitle = '导入' |
|
|
|
this.$refs.upload.clearFiles() |
|
|
|
}, |
|
|
|
async handleExport() { |
|
|
|
async handleExport () { |
|
|
|
this.exportBtn = true |
|
|
|
this.exportBtnTitle = '正在导出...' |
|
|
|
let params = { |
|
|
|
@ -568,8 +635,8 @@ export default { |
|
|
|
console.log('获取导出情失败', err) |
|
|
|
this.$message.error('获取导出失败') |
|
|
|
}) |
|
|
|
this.exportBtn = false |
|
|
|
this.exportBtnTitle = '导出' |
|
|
|
this.exportBtn = false |
|
|
|
this.exportBtnTitle = '导出' |
|
|
|
}, |
|
|
|
beforeImgUpload (file) { |
|
|
|
const isPNG = (file.type === 'image/png') || (file.type === 'image/jpeg') |
|
|
|
@ -595,41 +662,50 @@ export default { |
|
|
|
this.$message.error(res.msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleDelimg(item, index) { |
|
|
|
handleDelimg (item, index) { |
|
|
|
this.form.imageList.splice(index, 1) |
|
|
|
}, |
|
|
|
handleSearch(val) { |
|
|
|
handleSearch (val) { |
|
|
|
console.log('searchhh--', val) |
|
|
|
this.currentPage = 1 |
|
|
|
this.getTableData() |
|
|
|
}, |
|
|
|
resetForm(formName) { |
|
|
|
resetForm (formName) { |
|
|
|
this.$refs[formName].resetFields() |
|
|
|
this.handleSearch() |
|
|
|
}, |
|
|
|
handleAdd() { |
|
|
|
|
|
|
|
handleAdd () { |
|
|
|
|
|
|
|
this.dialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
handlerCancle() { |
|
|
|
for(const n in this.form) { |
|
|
|
handlerCancle () { |
|
|
|
for (const n in this.form) { |
|
|
|
this.form[n] = '' |
|
|
|
if (n === 'imageList') this.form[n] = [] |
|
|
|
} |
|
|
|
this.disabled = false |
|
|
|
this.dialogVisible = false |
|
|
|
}, |
|
|
|
async handleLook(row) { |
|
|
|
this.disabled = true |
|
|
|
await this.getDetail(row.id) |
|
|
|
async handleLook (row) { |
|
|
|
await this.getDetail(row.id, 'detail') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
async handleEdit(row, addType) { |
|
|
|
|
|
|
|
detailFormCancle () { |
|
|
|
|
|
|
|
this.detailShow = false |
|
|
|
}, |
|
|
|
|
|
|
|
async handleEdit (row, addType) { |
|
|
|
// this.form = { ...row } |
|
|
|
await this.getDetail(row.id) |
|
|
|
// this.dialogVisible = true |
|
|
|
}, |
|
|
|
async addNew() { |
|
|
|
async addNew () { |
|
|
|
const { user } = await this.$store.state |
|
|
|
const _form = { |
|
|
|
...this.form, |
|
|
|
@ -644,27 +720,27 @@ export default { |
|
|
|
this.$message.success('操作成功') |
|
|
|
this.handlerCancle() |
|
|
|
this.getTableData() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
this.btnLoading = false |
|
|
|
this.btnLoading = false |
|
|
|
}, |
|
|
|
handleSUbmit() { |
|
|
|
handleSUbmit () { |
|
|
|
this.$refs.ruleForm.validate(async (valid) => { |
|
|
|
if (valid) { |
|
|
|
this.btnLoading = true |
|
|
|
this.addNew() |
|
|
|
this.addNew() |
|
|
|
} else { |
|
|
|
console.log('error submit!!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
handleDel(row) { |
|
|
|
handleDel (row) { |
|
|
|
let params = { |
|
|
|
id: row.id |
|
|
|
} |
|
|
|
@ -686,7 +762,7 @@ export default { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async getDetail(id) { |
|
|
|
async getDetail (id, type) { |
|
|
|
let params = { |
|
|
|
id, |
|
|
|
} |
|
|
|
@ -698,12 +774,20 @@ export default { |
|
|
|
} else { |
|
|
|
this.form = { ...res.data } |
|
|
|
const _arr = this.optionsEditC.map(item => item.categoryId) |
|
|
|
|
|
|
|
|
|
|
|
if (!_arr.includes(res.data.categoryId) && !this.disabled) this.form.categoryId = '' |
|
|
|
// this.optionsEditC.forEach(item => { |
|
|
|
// if (item.categoryId === res.data.categoryId) |
|
|
|
// }) |
|
|
|
this.dialogVisible = true |
|
|
|
if (type === 'detail') { |
|
|
|
this.detailShow = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.ref_form_detail.initForm(this.form) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.dialogVisible = true |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
@ -711,7 +795,7 @@ export default { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async getGridList(type, agencyId) { |
|
|
|
async getGridList (type, agencyId) { |
|
|
|
const { user } = await this.$store.state |
|
|
|
console.log('user---ppp', user) |
|
|
|
// addorupdate query |
|
|
|
@ -722,7 +806,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'query') this.optionsG = res.data |
|
|
|
else this.optionsEditG = res.data |
|
|
|
} |
|
|
|
@ -731,7 +815,7 @@ export default { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async getCateList(type) { |
|
|
|
async getCateList (type) { |
|
|
|
const { user } = await this.$store.state |
|
|
|
console.log('user---ppp', user) |
|
|
|
const params = { |
|
|
|
@ -746,7 +830,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'query') this.optionsC = res.data |
|
|
|
else this.optionsEditC = res.data |
|
|
|
} |
|
|
|
@ -755,7 +839,7 @@ export default { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async getTableData() { |
|
|
|
async getTableData () { |
|
|
|
this.tableLoading = true |
|
|
|
const { user } = await this.$store.state |
|
|
|
let params = { |
|
|
|
@ -779,7 +863,7 @@ export default { |
|
|
|
}) |
|
|
|
this.tableLoading = false |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -809,7 +893,6 @@ export default { |
|
|
|
.form-wr { |
|
|
|
.input-width { |
|
|
|
width: 260px; |
|
|
|
|
|
|
|
} |
|
|
|
.input-width-textarea { |
|
|
|
width: 500px; |
|
|
|
@ -841,7 +924,6 @@ export default { |
|
|
|
</style> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
.resi-row-btn { |
|
|
|
display: flex; |
|
|
|
margin-bottom: 13px; |
|
|
|
@ -870,14 +952,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
.avatar-uploader { |
|
|
|
::v-deep |
|
|
|
.el-upload { |
|
|
|
::v-deep .el-upload { |
|
|
|
cursor: pointer; |
|
|
|
position: relative; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
.el-upload:hover { |
|
|
|
border-color: #409EFF; |
|
|
|
border-color: #409eff; |
|
|
|
} |
|
|
|
.avatar { |
|
|
|
width: 100px; |
|
|
|
@ -895,8 +976,6 @@ export default { |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.resi-btns { |
|
|
|
margin-top: 20px; |
|
|
|
|