Browse Source

导入ddd

shibei_master
13176889840 4 years ago
parent
commit
7633b946ef
  1. 65
      src/views/modules/communityService/sqzzz/index.vue
  2. 25
      src/views/modules/visual/communityParty/community.vue

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

@ -270,34 +270,53 @@ export default {
} }
return fileType && isLt1M; return fileType && isLt1M;
}, },
uploadHttpRequest(file) { async uploadHttpRequest(file) {
this.importLoading = true; this.importLoading = true;
this.importBtnTitle = "正在上传中..."; this.importBtnTitle = "正在上传中...";
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
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); //
axios({ await this.$http
url: .post('/heart/iccommunityselforganization/importcommunityselforganization', formData).then(res => {
window.SITE_CONFIG["apiURL"] + console.log('res-up', res)
"/heart/iccommunityselforganization/importcommunityselforganization", if (res.data.code == 0 && res.data.msg == 'success') {
method: "post", this.$message.success('导入成功')
data: formData, this.getTableData()
// responseType: "blob", } else this.$message.error(res.data.msg)
}).catch(err => {
console.log('失败', err)
file.onError() //
this.$message.error('导入失败')
}) })
.then((res) => { // axios({
this.importLoading = false; // url:
this.importBtnTitle = "excel导入"; // window.SITE_CONFIG["apiURL"] +
console.log("resresresresresresres", res); // "/heart/iccommunityselforganization/importcommunityselforganization",
// method: "post",
this.getTableData(); // data: formData,
if (res.data.code == 0) { // // responseType: "blob",
return this.$message.success(res.data.data || "导入成功"); // })
} else { // .then((res) => {
return this.$message.error(res.data.msg); // this.importLoading = false;
} // this.importBtnTitle = "excel";
}) // console.log("resresresresresresres", res);
.catch((err) => {
console.log("失败", err); // this.getTableData();
}); // if (res.data.code == 0) {
// return this.$message.success(res.data.data || "");
// } else {
// return this.$message.error(res.data.msg);
// }
// })
// .catch((err) => {
// console.log("", err);
// });
this.importLoading = false
this.importBtnTitle = 'excel导入'
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
}, },

25
src/views/modules/visual/communityParty/community.vue

@ -36,7 +36,8 @@
prefix-icon="el-icon-caret-bottom" prefix-icon="el-icon-caret-bottom"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:clearable="false" :clearable="false"
:default-time="['00:00:00', '23:59:59']"> :default-time="['00:00:00', '23:59:59']"
@change="handleTimeChange">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
@ -121,6 +122,7 @@
<script> <script>
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import util from '@js/util.js';
import screenTable from "../components/screen-table/index"; import screenTable from "../components/screen-table/index";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
@ -232,12 +234,27 @@ export default {
watch: { watch: {
timeRange (val) { timeRange (val) {
console.log('val-www', val) console.log('val-www', val)
this.getList(this.agencyId); // this.getList(this.agencyId);
this.getCateCount(this.agencyId) // this.getCateCount(this.agencyId)
} }
}, },
methods: { methods: {
handleTimeChange (time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-')
const endTimeArray = util.dateFormatter(time[1], 'date').split('-')
const startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00'
const endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59'
this.timeRange = [startTime, endTime]
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.initTime()
}
this.getList(this.agencyId);
this.getCateCount(this.agencyId)
},
// //
async getList (agencyId) { async getList (agencyId) {
this.visibleLoading = true this.visibleLoading = true

Loading…
Cancel
Save