Browse Source

Merge branch 'master' into dev-fangyi

shibei_master
jiangyy 3 years ago
parent
commit
d317d1c3ab
  1. 6
      src/js/store/modules/app.js
  2. 4
      src/views/modules/base/community/buildTable.vue
  3. 2
      src/views/modules/base/community/community.vue
  4. 10
      src/views/modules/base/community/communityTable.vue
  5. 6
      src/views/modules/base/community/roomTable.vue
  6. 256
      src/views/modules/communityService/dqfwzx/index.vue
  7. 8
      src/views/modules/communityService/ninePlaces/inspect/inspect.vue
  8. 8
      src/views/modules/communityService/ninePlaces/places/places.vue
  9. 8
      src/views/modules/communityService/ninePlaces/team/team.vue
  10. 217
      src/views/modules/communityService/sqzzz/index.vue

6
src/js/store/modules/app.js

@ -5,13 +5,15 @@ export default {
clientHeight: document.documentElement.clientHeight, clientHeight: document.documentElement.clientHeight,
size: 'medium', size: 'medium',
resolution: 'medium', resolution: 'medium',
env: 'dev' env: 'dev',
iframeHeight:120
}, },
getters: { getters: {
clientHeight: (state) => state.clientHeight, clientHeight: (state) => state.clientHeight,
size: (state) => state.size, size: (state) => state.size,
resolution: (state) => state.resolution, resolution: (state) => state.resolution,
env: (state) => state.env env: (state) => state.env,
iframeHeight: (state) => state.iframeHeight
}, },
mutations: { mutations: {
[type.client_height](state, payload) { [type.client_height](state, payload) {

4
src/views/modules/base/community/buildTable.vue

@ -235,11 +235,11 @@ export default {
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 300) return this.$store.state.inIframe ? this.clientHeight - 300 + this.iframeHeight : this.clientHeight - 300
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight', 'iframeHeight'])
}, },
methods: { methods: {
// //

2
src/views/modules/base/community/community.vue

@ -307,7 +307,7 @@ export default {
.div_table { .div_table {
margin-left: 15px; margin-left: 15px;
// flex: 1; // flex: 1;
width: calc(100vw - 550px); width: calc(100% - 300px);
background-color: #ffffff; background-color: #ffffff;
border-radius: 5px; border-radius: 5px;
padding: 10px; padding: 10px;

10
src/views/modules/base/community/communityTable.vue

@ -285,13 +285,13 @@ export default {
}, },
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 300)
return this.$store.state.inIframe ? this.clientHeight - 300 + this.iframeHeight : this.clientHeight - 300
}, },
rowHeight () {
return (this.clientHeight - 200) + 'px' ...mapGetters(['clientHeight', 'iframeHeight'])
},
...mapGetters(['clientHeight'])
}, },
methods: { methods: {
// //

6
src/views/modules/base/community/roomTable.vue

@ -131,7 +131,7 @@
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="scope.row.showBtn" <el-button v-if="scope.row.showBtn"
type="text" type="text"
class="div-table-button--edit" class="div-table-button--edit"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
@ -230,11 +230,11 @@ export default {
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 300) return this.$store.state.inIframe ? this.clientHeight - 300 + this.iframeHeight : this.clientHeight - 300
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight', 'iframeHeight'])
}, },
methods: { methods: {
// //

256
src/views/modules/communityService/dqfwzx/index.vue

@ -2,25 +2,26 @@
<div> <div>
<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" <el-button class="diy-button--add" size="small" @click="handleAdd"
size="small" >新增</el-button
@click="handleAdd">新增</el-button> >
</div> </div>
<div class="m-center" <div class="m-center" v-if="tableData.length > 0">
v-if="tableData.length > 0">
<div class="center-left"> <div class="center-left">
<div class="list"> <div class="list" :class="{ 'z-iframe': $store.state.inIframe }">
<div @click="currentIndex = index" <div
class="item" @click="currentIndex = index"
:class="{ 'z-on': currentIndex == index }" class="item"
:key="'ct' + index" :class="{ 'z-on': currentIndex == index }"
v-for="(item, index) in tableData"> :key="'ct' + index"
<div class="item-btn" v-for="(item, index) in tableData"
v-if="currentIndex == index" >
@click="handleEdit"> <div class="item-btns">
修改 <a v-if="currentIndex == index" @click="handleEdit">修改</a>
<a v-if="currentIndex == index" @click="handleDel">删除</a>
</div> </div>
<div class="item-name">{{ item.centerName }}</div> <div class="item-name">{{ item.centerName }}</div>
<div class="item-prop"> <div class="item-prop">
<div class="prop-field">社区地址</div> <div class="prop-field">社区地址</div>
@ -48,95 +49,114 @@
> >
</div> --> </div> -->
<div id="centerIndexApp" <div id="centerIndexApp" class="div_map"></div>
class="div_map"></div>
<el-table
<el-table :data="tableData[currentIndex].matterList" :data="tableData[currentIndex].matterList"
border border
style="width: 100%" style="width: 100%"
class="resi-table" class="resi-table"
:max-height="maxTableHeight"> :max-height="maxTableHeight"
<el-table-column label="序号" >
type="index" <el-table-column
align="center" label="序号"
width="50" /> type="index"
<el-table-column prop="matterName" align="center"
label="事项名称"> width="50"
/>
<el-table-column prop="matterName" label="事项名称">
</el-table-column> </el-table-column>
<el-table-column prop="allowTime" <el-table-column prop="allowTime" label="可预约时间 ">
label="可预约时间 ">
</el-table-column> </el-table-column>
<el-table-column fixed="right" <el-table-column
label="操作" fixed="right"
align="center" label="操作"
width="120"> align="center"
width="120"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleOrder(scope.$index)" <el-button
type="text" @click="handleOrder(scope.$index)"
size="small" type="text"
style="color: #1c6afd">预约</el-button> size="small"
style="color: #1c6afd"
<el-button @click="handleOrderList(scope.$index)" >预约</el-button
type="text" >
size="small"
style="margin-right: 10px; color: #1c6afd">预约记录</el-button> <el-button
@click="handleOrderList(scope.$index)"
type="text"
size="small"
style="margin-right: 10px; color: #1c6afd"
>预约记录</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<div class="m-hint" <div class="m-hint" v-else>
v-else> <el-empty description="暂无内容" :image-size="200"></el-empty>
<el-empty description="暂无内容"
:image-size="200"></el-empty>
</div> </div>
</el-card> </el-card>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow" <el-dialog
:close-on-click-modal="false" :visible.sync="formShow"
:close-on-press-escape="false" :close-on-click-modal="false"
:title="formTitle" :close-on-press-escape="false"
width="850px" :title="formTitle"
top="5vh" width="850px"
class="dialog-h" top="5vh"
@closed="handleClose"> class="dialog-h"
<edit-form ref="eleEditForm" @closed="handleClose"
@dialogCancle="handleClose" >
@dialogOk="handleEditSuccess"></edit-form> <edit-form
ref="eleEditForm"
@dialogCancle="handleClose"
@dialogOk="handleEditSuccess"
></edit-form>
</el-dialog> </el-dialog>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog :visible.sync="form2Show" <el-dialog
:close-on-click-modal="false" :visible.sync="form2Show"
:close-on-press-escape="false" :close-on-click-modal="false"
title="预约" :close-on-press-escape="false"
width="850px" title="预约"
top="5vh" width="850px"
class="dialog-h" top="5vh"
@closed="handleCloseForm2"> class="dialog-h"
<order-form ref="eleOrderForm" @closed="handleCloseForm2"
@dialogCancle="handleCloseForm2" >
@dialogOk="handleOrderSuccess"></order-form> <order-form
ref="eleOrderForm"
@dialogCancle="handleCloseForm2"
@dialogOk="handleOrderSuccess"
></order-form>
</el-dialog> </el-dialog>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<el-dialog :visible.sync="orderListShow" <el-dialog
:close-on-click-modal="false" :visible.sync="orderListShow"
:close-on-press-escape="false" :close-on-click-modal="false"
title="预约记录" :close-on-press-escape="false"
width="850px" title="预约记录"
top="5vh" width="850px"
class="dialog-h" top="5vh"
@closed="handleCloseOrderList"> class="dialog-h"
<order-list ref="eleOrderList" @closed="handleCloseOrderList"
@dialogCancle="handleCloseOrderList"></order-list> >
<order-list
ref="eleOrderList"
@dialogCancle="handleCloseOrderList"
></order-list>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request2";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import editForm from "./cpts/edit"; import editForm from "./cpts/edit";
@ -151,7 +171,7 @@ let loading; // 加载动画
export default { export default {
components: { editForm, orderForm, orderList }, components: { editForm, orderForm, orderList },
data () { data() {
return { return {
openSearch: false, openSearch: false,
@ -168,23 +188,25 @@ export default {
}; };
}, },
computed: { computed: {
maxTableHeight () { maxTableHeight() {
return this.clientHeight - 520; return this.$store.state.inIframe
? this.clientHeight - 520 + 120
: this.clientHeight - 520;
}, },
...mapGetters(["clientHeight"]), ...mapGetters(["clientHeight"]),
}, },
watch: { watch: {
currentIndex () { currentIndex() {
this.setMap(); this.setMap();
}, },
}, },
async mounted () { async mounted() {
await this.loadAgency(); await this.loadAgency();
await this.getTableData(); await this.getTableData();
}, },
methods: { methods: {
// init // init
initMap () { initMap() {
// //
var center = new window.TMap.LatLng(36.0722275, 120.38945519); var center = new window.TMap.LatLng(36.0722275, 120.38945519);
// map TMap.Map() // map TMap.Map()
@ -204,7 +226,7 @@ export default {
infoWindowList = Array(10); infoWindowList = Array(10);
}, },
setMarker (lat, lng, centerName) { setMarker(lat, lng, centerName) {
markers.setGeometries([]); markers.setGeometries([]);
markers.add([ markers.add([
{ {
@ -218,11 +240,11 @@ export default {
]); ]);
}, },
setCenter (lat, lng) { setCenter(lat, lng) {
map.setCenter(new window.TMap.LatLng(lat, lng)); map.setCenter(new window.TMap.LatLng(lat, lng));
}, },
setMap () { setMap() {
const { tableData, currentIndex } = this; const { tableData, currentIndex } = this;
let item = tableData[currentIndex]; let item = tableData[currentIndex];
if (item) { if (item) {
@ -231,24 +253,24 @@ export default {
} }
}, },
handleClose () { handleClose() {
this.formShow = false; this.formShow = false;
}, },
handleCloseForm2 () { handleCloseForm2() {
this.form2Show = false; this.form2Show = false;
}, },
handleCloseOrderList () { handleCloseOrderList() {
this.orderListShow = false; this.orderListShow = false;
}, },
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 handleWatch () { async handleWatch() {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm( this.$refs.eleEditForm.initForm(
@ -257,7 +279,7 @@ export default {
); );
}, },
async handleEdit () { async handleEdit() {
this.formShow = true; this.formShow = true;
await nextTick(); await nextTick();
this.$refs.eleEditForm.initForm( this.$refs.eleEditForm.initForm(
@ -266,12 +288,12 @@ export default {
); );
}, },
handleEditSuccess () { handleEditSuccess() {
this.handleClose(); this.handleClose();
this.getTableData(); this.getTableData();
}, },
async handleOrder (index) { async handleOrder(index) {
this.form2Show = true; this.form2Show = true;
await nextTick(); await nextTick();
this.$refs.eleOrderForm.initForm( this.$refs.eleOrderForm.initForm(
@ -281,36 +303,34 @@ export default {
); );
}, },
handleOrderSuccess () { handleOrderSuccess() {
this.handleCloseForm2(); this.handleCloseForm2();
}, },
async handleOrderList (index) { async handleOrderList(index) {
this.orderListShow = true; this.orderListShow = true;
await nextTick(0); await nextTick(0);
console.log(this.$refs); console.log(this.$refs);
this.$refs.eleOrderList.init(this.tableData[this.currentIndex], index); this.$refs.eleOrderList.init(this.tableData[this.currentIndex], index);
}, },
async handleDel (rowData, rowIndex) { async handleDel() {
console.log(rowData, rowIndex); if (!confirm("删除后不可恢复,确定删除?")) return;
const url =
"/heart/iccommunityselforganization/delcommunityselforganization";
const { tableData } = this;
const { data, code, msg } = await requestPost(url, { const item = this.tableData[this.currentIndex];
orgId: tableData[rowIndex].orgId, const url = "/gov/org/icpartyservicecenter/del";
});
const { data, code, msg } = await requestPost(url, [
item.partyServiceCenterId,
]);
if (code === 0) { if (code === 0) {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.getTableData(); this.getTableData();
} else {
this.$message.success("操作失败!");
} }
}, },
async getTableData () { async getTableData() {
const oldLen = this.tableData.length; const oldLen = this.tableData.length;
const url = "/gov/org/icpartyservicecenter/partyservicecenterlist"; const url = "/gov/org/icpartyservicecenter/partyservicecenterlist";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -331,7 +351,7 @@ export default {
}, },
// //
async loadAgency () { async loadAgency() {
const url = "/epmetuser/customerstaff/staffbasicinfo"; const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {}; let params = {};
@ -339,8 +359,6 @@ export default {
if (code === 0) { if (code === 0) {
this.agencyId = data.agencyId; this.agencyId = data.agencyId;
} else {
this.$message.error(msg);
} }
}, },
}, },
@ -362,6 +380,11 @@ export default {
padding-right: 10px; padding-right: 10px;
height: calc(100vh - 210px); height: calc(100vh - 210px);
overflow-y: auto; overflow-y: auto;
&.z-iframe {
height: calc(100vh - 210px + 120px);
}
&::-webkit-scrollbar { &::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 8px; /*高宽分别对应横竖滚动条的尺寸*/ width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
@ -394,7 +417,8 @@ export default {
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0 0 10px #6aa; box-shadow: 0 0 10px #6aa;
} }
.item-btn {
.item-btns {
position: absolute; position: absolute;
top: 5px; top: 5px;
right: 5px; right: 5px;
@ -423,10 +447,12 @@ export default {
} }
} }
} }
.item-name { .item-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-bottom: 10px; margin-bottom: 10px;
width: calc(100% - 70px);
} }
.item-prop { .item-prop {
display: flex; display: flex;

8
src/views/modules/communityService/ninePlaces/inspect/inspect.vue

@ -529,13 +529,11 @@ export default {
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 420) return this.$store.state.inIframe ? this.clientHeight - 420 + this.iframeHeight : this.clientHeight - 420
}, },
rowHeight () {
return (this.clientHeight - 200) + 'px' ...mapGetters(['clientHeight', 'iframeHeight'])
},
...mapGetters(['clientHeight'])
}, },
watch: { watch: {

8
src/views/modules/communityService/ninePlaces/places/places.vue

@ -464,13 +464,11 @@ export default {
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 420) return this.$store.state.inIframe ? this.clientHeight - 300 + this.iframeHeight : this.clientHeight - 300
}, },
rowHeight () {
return (this.clientHeight - 200) + 'px' ...mapGetters(['clientHeight', 'iframeHeight'])
},
...mapGetters(['clientHeight'])
}, },
watch: { watch: {

8
src/views/modules/communityService/ninePlaces/team/team.vue

@ -441,13 +441,11 @@ export default {
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 370) return this.$store.state.inIframe ? this.clientHeight - 370 + this.iframeHeight : this.clientHeight - 370
}, },
rowHeight () {
return (this.clientHeight - 200) + 'px' ...mapGetters(['clientHeight', 'iframeHeight'])
},
...mapGetters(['clientHeight'])
}, },
watch: { watch: {

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

@ -1,44 +1,60 @@
<template> <template>
<div class="resi-container"> <div class="resi-container">
<el-card ref="searchCard" class="search-card"> <el-card ref="searchCard" class="search-card">
<el-form ref="searchForm" :inline="true" :model="fmData" class="demo-form-inline"> <el-form
<el-form-item label="组织名称" prop="organizationName"> ref="searchForm"
<el-input :inline="true"
v-model="fmData.organizationName" :model="fmData"
class="resi-cell-input" class="demo-form-inline"
size="small" >
clearable <el-form-item label="组织名称" prop="organizationName">
placeholder="请输入" <el-input
> v-model="fmData.organizationName"
</el-input> class="resi-cell-input"
</el-form-item> size="small"
<el-form-item label="创建时间" prop="createTime"> clearable
<el-date-picker placeholder="请输入"
v-model="fmData.createTime" >
type="daterange" </el-input>
range-separator="至" </el-form-item>
start-placeholder="开始日期" <el-form-item label="创建时间" prop="createTime">
end-placeholder="结束日期" <el-date-picker
value-format="yyyy-MM-dd" v-model="fmData.createTime"
> type="daterange"
</el-date-picker> range-separator="至"
</el-form-item> start-placeholder="开始日期"
<el-form-item> end-placeholder="结束日期"
<el-button class="diy-button--search" size="small" @click="handleSearch">查询</el-button> value-format="yyyy-MM-dd"
<el-button class="diy-button--reset" size="small" @click="resetForm('searchForm')">重置</el-button> >
</el-form-item> </el-date-picker>
</el-form> </el-form-item>
<el-form-item>
</el-card> <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>
</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" size="small" @click="handleAdd"
>新增</el-button >新增</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-button
>
<el-upload <el-upload
ref="upload" ref="upload"
class="upload-btn" class="upload-btn"
@ -53,9 +69,12 @@
:before-upload="beforeExcelUpload" :before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest" :http-request="uploadHttpRequest"
> >
<el-button size="small" class="diy-button--delete" :loading="importLoading">{{ <el-button
importBtnTitle size="small"
}}</el-button> 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" class="diy-button--reset" size="small"
@ -70,22 +89,41 @@
:height="maxTableHeight" :height="maxTableHeight"
> >
<el-table-column label="序号" type="index" align="center" width="50" /> <el-table-column label="序号" type="index" align="center" width="50" />
<el-table-column prop="organizationName" label="组织名称" align="center"> <el-table-column
prop="organizationName"
label="组织名称"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<a class="name-a" @click="handleWatch(scope.row)"> <a class="name-a" @click="handleWatch(scope.row)">
{{ scope.row.organizationName }} {{ scope.row.organizationName }}
</a> </a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="organizationPersonCount" align="center" label="组织人数"> <el-table-column
prop="organizationPersonCount"
align="center"
label="组织人数"
>
</el-table-column>
<el-table-column
prop="serviceItem"
label="服务事项"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column> </el-table-column>
<el-table-column prop="serviceItem" label="服务事项" align="center" :show-overflow-tooltip="true"> </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> <el-table-column prop="principalName" align="center" label="负责人">
</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="organizationCreatedTime" align="center" label="创建时间"> <el-table-column
prop="organizationCreatedTime"
align="center"
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">
@ -121,7 +159,7 @@
type="text" type="text"
size="small" size="small"
class="div-table-button--delete" class="div-table-button--delete"
style="margin-left: 10px;" style="margin-left: 10px"
>删除</el-button >删除</el-button
> >
</el-popconfirm> </el-popconfirm>
@ -218,7 +256,9 @@ export default {
}, },
computed: { computed: {
maxTableHeight() { maxTableHeight() {
return this.clientHeight - 360; return this.$store.state.inIframe
? this.clientHeight - 360 + 120
: this.clientHeight - 360;
}, },
...mapGetters(["clientHeight"]), ...mapGetters(["clientHeight"]),
}, },
@ -237,38 +277,41 @@ export default {
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 = {};
await this.$http({ await this.$http({
method: 'POST', method: "POST",
url, url,
responseType: 'blob', responseType: "blob",
data: params data: params,
}) })
.then(res => { .then((res) => {
// this.download(res.data, title + '.xls') // this.download(res.data, title + '.xls')
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(
console.log('filename', fileName) res.headers["content-disposition"].split(";")[1].split("=")[1]
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) );
var url = window.URL.createObjectURL(blob) console.log("filename", fileName);
var aLink = document.createElement('a') let blob = new Blob([res.data], {
aLink.style.display = 'none' type: "application/vnd.ms-excel",
aLink.href = url });
aLink.setAttribute('download', fileName) var url = window.URL.createObjectURL(blob);
document.body.appendChild(aLink) var aLink = document.createElement("a");
aLink.click() aLink.style.display = "none";
document.body.removeChild(aLink) // aLink.href = url;
window.URL.revokeObjectURL(url) //blob aLink.setAttribute("download", fileName);
} else this.$message.error('下载失败') document.body.appendChild(aLink);
}) aLink.click();
.catch(err => { document.body.removeChild(aLink); //
console.log('err', err) window.URL.revokeObjectURL(url); //blob
return this.$message.error('网络错误') } else this.$message.error("下载失败");
}) })
.catch((err) => {
console.log("err", err);
return this.$message.error("网络错误");
});
}, },
// //
handleExcelSuccess(res, file) { handleExcelSuccess(res, file) {
@ -304,23 +347,28 @@ export default {
this.importBtnTitle = "正在上传中..."; this.importBtnTitle = "正在上传中...";
this.$message({ this.$message({
showClose: true, showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度', message: "导入中,请到系统管理-导入记录中查看进度",
duration: 0 duration: 0,
}) });
const formData = new FormData(); //FormDataappend('key', value) const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); // formData.append("file", file.file); //
await this.$http await this.$http
.post('/heart/iccommunityselforganization/importcommunityselforganization', formData).then(res => { .post(
console.log('res-up', res) "/heart/iccommunityselforganization/importcommunityselforganization",
if (res.data.code == 0 && res.data.msg == 'success') { formData
)
.then((res) => {
console.log("res-up", res);
if (res.data.code == 0 && res.data.msg == "success") {
// this.$message.success('') // this.$message.success('')
this.getTableData() this.getTableData();
} else this.$message.error(res.data.msg) } else this.$message.error(res.data.msg);
}).catch(err => {
console.log('失败', err)
file.onError() //
// this.$message.error('')
}) })
.catch((err) => {
console.log("失败", err);
file.onError(); //
// this.$message.error('')
});
// axios({ // axios({
// url: // url:
// window.SITE_CONFIG["apiURL"] + // window.SITE_CONFIG["apiURL"] +
@ -344,8 +392,8 @@ export default {
// .catch((err) => { // .catch((err) => {
// console.log("", err); // console.log("", err);
// }); // });
this.importLoading = false this.importLoading = false;
this.importBtnTitle = '导入' this.importBtnTitle = "导入";
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
}, },
@ -370,8 +418,8 @@ export default {
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;
@ -521,5 +569,4 @@ export default {
position: relative; position: relative;
overflow: visible; overflow: visible;
} }
</style> </style>

Loading…
Cancel
Save