Browse Source

社区自组织错误信息提示

shibei_master
jiangyy 3 years ago
parent
commit
994aa9f596
  1. 381
      src/views/modules/communityService/sqzzz/index.vue

381
src/views/modules/communityService/sqzzz/index.vue

@ -1,149 +1,135 @@
<template> <template>
<div class="resi-container"> <div class="resi-container">
<el-card ref="searchCard" class="search-card"> <el-card ref="searchCard"
<el-form class="search-card">
ref="searchForm" <el-form ref="searchForm"
:inline="true" :inline="true"
:model="fmData" :model="fmData"
class="demo-form-inline" class="demo-form-inline">
> <el-form-item label="组织名称"
<el-form-item label="组织名称" prop="organizationName"> prop="organizationName">
<el-input <el-input v-model="fmData.organizationName"
v-model="fmData.organizationName" class="resi-cell-input"
class="resi-cell-input" size="small"
size="small" clearable
clearable placeholder="请输入">
placeholder="请输入"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间"
<el-date-picker prop="createTime">
v-model="fmData.createTime" <el-date-picker v-model="fmData.createTime"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd">
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注"
<el-input prop="remark">
v-model="fmData.remark" <el-input v-model="fmData.remark"
class="resi-cell-input" class="resi-cell-input"
size="small" size="small"
clearable clearable
placeholder="请输入" placeholder="请输入">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button class="diy-button--search"
class="diy-button--search" size="small"
size="small" @click="handleSearch">查询</el-button>
@click="handleSearch" <el-button class="diy-button--reset"
>查询</el-button size="small"
> @click="resetForm('searchForm')">重置</el-button>
<el-button
class="diy-button--reset"
size="small"
@click="resetForm('searchForm')"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<el-card class="resi-card-table"> <el-card class="resi-card-table">
<div class="resi-row-btn"> <div class="resi-row-btn">
<el-button class="diy-button--add" size="small" @click="handleAdd" <el-button class="diy-button--add"
>新增</el-button size="small"
> @click="handleAdd">新增</el-button>
<el-button <el-button class="diy-button--export"
class="diy-button--export" size="small"
size="small" @click="handleExportModule('room')">下载模板</el-button>
@click="handleExportModule('room')" <el-upload ref="upload"
>下载模板</el-button class="upload-btn"
> action="uploadUlr"
<el-upload :limit="1"
ref="upload" :accept="'.xls,.xlsx'"
class="upload-btn" :with-credentials="true"
action="uploadUlr" :show-file-list="false"
:limit="1" :auto-upload="true"
:accept="'.xls,.xlsx'" :on-progress="handleProgress"
:with-credentials="true" :on-success="handleExcelSuccess"
:show-file-list="false" :before-upload="beforeExcelUpload"
:auto-upload="true" :http-request="uploadHttpRequest">
:on-progress="handleProgress" <el-button size="small"
:on-success="handleExcelSuccess" class="diy-button--delete"
:before-upload="beforeExcelUpload" :loading="importLoading">{{ importBtnTitle }}</el-button>
:http-request="uploadHttpRequest"
>
<el-button
size="small"
class="diy-button--delete"
:loading="importLoading"
>{{ importBtnTitle }}</el-button
>
</el-upload> </el-upload>
<el-button @click="handleChu" class="diy-button--reset" size="small" <el-button @click="handleChu"
>导出</el-button class="diy-button--reset"
> size="small">导出</el-button>
</div> </div>
<el-table <el-table :data="tableData"
:data="tableData" border
border style="width: 100%"
style="width: 100%" class="resi-table"
class="resi-table" :height="maxTableHeight">
:height="maxTableHeight" <el-table-column label="序号"
> type="index"
<el-table-column label="序号" type="index" align="center" width="50" /> align="center"
<el-table-column width="50" />
prop="organizationName" <el-table-column prop="organizationName"
label="组织名称" label="组织名称"
align="center" align="center">
>
<template slot-scope="scope"> <template slot-scope="scope">
<a class="name-a" @click="handleWatch(scope.$index)"> <a class="name-a"
@click="handleWatch(scope.$index)">
{{ scope.row.organizationName }} {{ scope.row.organizationName }}
</a> </a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="categoryName"
prop="categoryName" align="center"
align="center" label="分类名称">
label="分类名称"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="organizationPersonCount"
prop="organizationPersonCount" align="center"
align="center" label="组织人数">
label="组织人数"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="serviceItem"
prop="serviceItem" label="服务事项"
label="服务事项" align="center"
align="center" :show-overflow-tooltip="true">
:show-overflow-tooltip="true"
>
</el-table-column> </el-table-column>
<el-table-column prop="score" width="100" align="center" label="积分"> <el-table-column prop="score"
width="100"
align="center"
label="积分">
</el-table-column> </el-table-column>
<el-table-column prop="principalName" align="center" label="负责人"> <el-table-column prop="principalName"
align="center"
label="负责人">
</el-table-column> </el-table-column>
<el-table-column prop="principalPhone" align="center" label="联系电话"> <el-table-column prop="principalPhone"
align="center"
label="联系电话">
</el-table-column> </el-table-column>
<el-table-column prop="remark" align="center" label="备注"> <el-table-column prop="remark"
align="center"
label="备注">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="organizationCreatedTime"
prop="organizationCreatedTime" align="center"
align="center" label="创建时间">
label="创建时间"
>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="160"> <el-table-column fixed="right"
label="操作"
align="center"
width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button <!-- <el-button
@click="handleWatch(scope.$index)" @click="handleWatch(scope.$index)"
@ -151,85 +137,64 @@
size="small" size="small"
>查看</el-button >查看</el-button
> --> > -->
<el-button <el-button type="text"
type="text" class="div-table-button--detail"
class="div-table-button--detail" size="small"
size="small" @click="handleScore(scope.row)">积分记录</el-button>
@click="handleScore(scope.row)"
>积分记录</el-button <el-button @click="handleEdit(scope.$index)"
> type="text"
size="small"
<el-button class="div-table-button--edit">修改</el-button>
@click="handleEdit(scope.$index)"
type="text" <el-popconfirm title="删除之后无法回复,确认删除?"
size="small" @onConfirm="handleDel(scope.row, scope.$index)"
class="div-table-button--edit" @confirm="handleDel(scope.row, scope.$index)">
>修改</el-button <el-button slot="reference"
> type="text"
size="small"
<el-popconfirm class="div-table-button--delete"
title="删除之后无法回复,确认删除?" style="margin-left: 10px">删除</el-button>
@onConfirm="handleDel(scope.row, scope.$index)"
@confirm="handleDel(scope.row, scope.$index)"
>
<el-button
slot="reference"
type="text"
size="small"
class="div-table-button--delete"
style="margin-left: 10px"
>删除</el-button
>
</el-popconfirm> </el-popconfirm>
</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="pageNo"
:current-page.sync="pageNo" :page-sizes="[20, 50, 100, 200]"
:page-sizes="[20, 50, 100, 200]" :page-size="parseInt(pageSize)"
:page-size="parseInt(pageSize)" layout="sizes, prev, pager, next, total"
layout="sizes, prev, pager, next, total" :total="total">
:total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog <el-dialog :visible.sync="formShow"
:visible.sync="formShow" :close-on-click-modal="false"
:close-on-click-modal="false" :close-on-press-escape="false"
:close-on-press-escape="false" :title="formTitle"
:title="formTitle" width="850px"
width="850px" top="5vh"
top="5vh" class="dialog-h"
class="dialog-h" @closed="handleClose">
@closed="handleClose" <edit-form ref="eleEditForm"
> @dialogCancle="handleClose"
<edit-form @dialogOk="handleEditSuccess"></edit-form>
ref="eleEditForm"
@dialogCancle="handleClose"
@dialogOk="handleEditSuccess"
></edit-form>
</el-dialog> </el-dialog>
<!-- 积分记录 --> <!-- 积分记录 -->
<el-dialog <el-dialog :visible.sync="scoreDiaShow"
:visible.sync="scoreDiaShow" :close-on-click-modal="false"
:close-on-click-modal="false" :close-on-press-escape="false"
:close-on-press-escape="false" :title="scoreDiaTitle"
:title="scoreDiaTitle" width="70%"
width="70%" top="5vh"
top="5vh" @closed="diaClose">
@closed="diaClose" <score-record ref="ref_score"
> :serviceType="'community_org'"></score-record>
<score-record
ref="ref_score"
:serviceType="'community_org'"
></score-record>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -244,7 +209,7 @@ import scoreRecord from "../../../components/scoreRecord.vue";
export default { export default {
components: { editForm, scoreRecord }, components: { editForm, scoreRecord },
data() { data () {
return { return {
openSearch: false, openSearch: false,
@ -274,7 +239,7 @@ export default {
}; };
}, },
computed: { computed: {
maxTableHeight() { maxTableHeight () {
return this.$store.state.inIframe return this.$store.state.inIframe
? this.clientHeight - 360 + this.iframeHeigh ? this.clientHeight - 360 + this.iframeHeigh
: this.clientHeight - 360; : this.clientHeight - 360;
@ -292,11 +257,11 @@ export default {
} }
}, },
}, },
mounted() { mounted () {
this.getTableData(); this.getTableData();
}, },
methods: { methods: {
async handleExportModule() { async handleExportModule () {
let url = "/heart/iccommunityselforganization/import-template-download"; let url = "/heart/iccommunityselforganization/import-template-download";
let params = {}; let params = {};
@ -333,18 +298,18 @@ export default {
}); });
}, },
// //
handleExcelSuccess(res, file) { handleExcelSuccess (res, file) {
if (res.code === 0 && res.msg === "success") { if (res.code === 0 && res.msg === "success") {
console.log("resss---ppp", res); console.log("resss---ppp", res);
} else { } else {
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);
}, },
beforeExcelUpload(file) { beforeExcelUpload (file) {
console.log("file", file); console.log("file", file);
const isType = file.type === "application/vnd.ms-excel"; const isType = file.type === "application/vnd.ms-excel";
const isTypeComputer = const isTypeComputer =
@ -361,7 +326,7 @@ export default {
} }
return fileType && isLt1M; return fileType && isLt1M;
}, },
async uploadHttpRequest(file) { async uploadHttpRequest (file) {
this.importLoading = true; this.importLoading = true;
this.importBtnTitle = "正在上传中..."; this.importBtnTitle = "正在上传中...";
this.$message({ this.$message({
@ -416,38 +381,38 @@ export default {
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
}, },
handleSizeChange(val) { handleSizeChange (val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
this.pageSize = val; this.pageSize = val;
window.localStorage.setItem("pageSize", val); window.localStorage.setItem("pageSize", val);
this.getTableData(); this.getTableData();
}, },
handleCurrentChange(val) { handleCurrentChange (val) {
console.log(`当前页: ${val}`); console.log(`当前页: ${val}`);
this.pageNo = val; this.pageNo = val;
this.getTableData(); this.getTableData();
}, },
handleClose() { handleClose () {
this.formShow = false; this.formShow = false;
}, },
handleSearch(val) { handleSearch (val) {
console.log(this.fmData); console.log(this.fmData);
this.pageNo = 1; this.pageNo = 1;
this.getTableData(); this.getTableData();
}, },
resetForm(formName) { resetForm (formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
this.handleSearch(); this.handleSearch();
}, },
async handleAdd() { async handleAdd () {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
console.log(this.$refs); console.log(this.$refs);
this.$refs.eleEditForm.initForm("add"); this.$refs.eleEditForm.initForm("add");
}, },
async handleChu() { async handleChu () {
const url = const url =
"/heart/iccommunityselforganization/exportcommunityselforganization"; "/heart/iccommunityselforganization/exportcommunityselforganization";
const { pageSize, pageNo, fmData } = this; const { pageSize, pageNo, fmData } = this;
@ -483,23 +448,23 @@ export default {
}); });
}, },
async handleWatch(rowIndex) { async handleWatch (rowIndex) {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm("detail", this.tableData[rowIndex]); this.$refs.eleEditForm.initForm("detail", this.tableData[rowIndex]);
}, },
async handleEdit(rowIndex) { async handleEdit (rowIndex) {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm("edit", this.tableData[rowIndex]); this.$refs.eleEditForm.initForm("edit", this.tableData[rowIndex]);
}, },
handleEditSuccess() { handleEditSuccess () {
this.handleClose(); this.handleClose();
this.getTableData(); this.getTableData();
}, },
async handleDel(rowData, rowIndex) { async handleDel (rowData, rowIndex) {
console.log(rowData, rowIndex); console.log(rowData, rowIndex);
const url = const url =
"/heart/iccommunityselforganization/delcommunityselforganization"; "/heart/iccommunityselforganization/delcommunityselforganization";
@ -513,11 +478,12 @@ export default {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.getTableData(); this.getTableData();
} else { } else {
this.$message.success("操作失败!"); this.$message.error(msg)
// this.$message.success("");
} }
}, },
async getTableData() { async getTableData () {
const url = const url =
"/heart/iccommunityselforganization/communityselforganizationlist"; "/heart/iccommunityselforganization/communityselforganizationlist";
const { pageSize, pageNo, fmData } = this; const { pageSize, pageNo, fmData } = this;
@ -531,22 +497,23 @@ export default {
this.total = data.total || 0; this.total = data.total || 0;
this.tableData = data.list this.tableData = data.list
? data.list.map((item) => { ? data.list.map((item) => {
return item; return item;
}) })
: []; : [];
} else { } else {
this.$message.error(msg)
} }
}, },
// //
handleScore(row) { handleScore (row) {
this.scoreDiaShow = true; this.scoreDiaShow = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_score.initForm(row.orgId); this.$refs.ref_score.initForm(row.orgId);
}); });
}, },
diaClose() { diaClose () {
this.scoreDiaShow = false; this.scoreDiaShow = false;
}, },
}, },

Loading…
Cancel
Save