Browse Source

Merge branch 'Luckysheet-mk' into luckysheet

luckysheet-xiaowang-Intelligen
mk 7 months ago
parent
commit
cd5b9fb334
  1. 37
      src/views/modules/base/smartExcel/cpts/excel-upload-data.vue
  2. 32
      src/views/modules/base/smartExcel/cpts/excel-view.vue

37
src/views/modules/base/smartExcel/cpts/excel-upload-data.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="m-detail-main"> <div class="m-detail-main" v-loading="dataListLoading">
<div class="steps1"> <div class="steps1">
<el-steps :active="progress"> <el-steps :active="progress">
<el-step :class="[this.operatorName == null ? 'showNum' : '']" title="填写基本信息" <el-step :class="[this.operatorName == null ? 'showNum' : '']" title="填写基本信息"
@ -76,7 +76,7 @@
</div> </div>
<span slot="footer" style="margin-top: 100px;"> <span slot="footer" style="margin-top: 100px;">
<el-button v-if="progress != 1" @click="progress = progress - 1">上一步</el-button> <el-button v-if="progress != 1" @click="progress = progress - 1">上一步</el-button>
<el-button type="primary" @click="onClickNext()">下一步</el-button> <el-button type="primary" @click="onClickNext()" >下一步</el-button>
</span> </span>
</div> </div>
</template> </template>
@ -84,6 +84,7 @@
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import resiSearch from "../../../../components/resiSearch.vue"; import resiSearch from "../../../../components/resiSearch.vue";
import HoseSearch from "./hose-search.vue"; import HoseSearch from "./hose-search.vue";
import { Loading } from "element-ui";
export default { export default {
data() { data() {
return { return {
@ -140,6 +141,7 @@ export default {
groupList: [], groupList: [],
fileCode: null, fileCode: null,
dataList: [], dataList: [],
dataListLoading:false
}; };
}, },
props: { props: {
@ -158,6 +160,10 @@ export default {
currentTable: { currentTable: {
type: Array, type: Array,
default: () => [] default: () => []
},
sheetRow:{
type:Number,
default:0
} }
}, },
created() { created() {
@ -179,6 +185,7 @@ export default {
}, },
onClickNext() { onClickNext() {
if (this.progress === 1) { if (this.progress === 1) {
this.dataListLoading = true;
this.progress = 2; this.progress = 2;
this.checkExtractExcelHead() this.checkExtractExcelHead()
} else if (this.progress === 2) { } else if (this.progress === 2) {
@ -191,14 +198,34 @@ export default {
this.formData.columnMateJson = JSON.stringify(obj) this.formData.columnMateJson = JSON.stringify(obj)
this.progress = 3; this.progress = 3;
} else { } else {
this.dataListLoading = true;
if(this.formData1.importCategory === 'BASEINFO'){ if(this.formData1.importCategory === 'BASEINFO'){
this.formData.searchForm= this.$refs['resi_form'].form; this.formData.searchForm= this.$refs['resi_form'].form;
}else{ }else{
this.formData.searchForm= this.$refs['house_form'].form; this.formData.searchForm= this.$refs['house_form'].form;
} }
this.$emit('saveUploadForm',this.formData) this.saveUploadForm()
}
},
async saveUploadForm() {
const url = '/actual/base/residentBaseInfo/exportOneSheet'
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.updataSheet(data)
} else {
console.log(msg);
} }
}, },
updataSheet(list) {
list.forEach((item, index) => {
luckysheet.insertRow(this.currentTable[0].data.length, 1)
for (let k in item) {
luckysheet.setCellValue(index + this.sheetRow + 1, k - 1, item[k])
}
})
this.dataListLoading = false;
this.$emit('handelUploadDataHide')
},
async loadPersonGroup() { async loadPersonGroup() {
const url = "/oper/customize/fileModeColumns/listModule"; const url = "/oper/customize/fileModeColumns/listModule";
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree' // const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree'
@ -259,9 +286,7 @@ export default {
this.progress = 2; this.progress = 2;
this.fileCode = fileCode; this.fileCode = fileCode;
}, },
handelClickBack() {
this.$emit("handleClose");
},
successImport() { successImport() {
this.progress = 3; this.progress = 3;
this.progressNum = 100; this.progressNum = 100;

32
src/views/modules/base/smartExcel/cpts/excel-view.vue

@ -34,8 +34,8 @@
</div> </div>
<el-dialog title="上传共享数据" v-if="showUploadData" :visible.sync="showUploadData" width="60%" <el-dialog title="上传共享数据" v-if="showUploadData" :visible.sync="showUploadData" width="60%"
:close-on-click-modal="false"> :close-on-click-modal="false">
<excelUploadData @handelUploadData="handelUploadData" :currentTable="currentTable" <excelUploadData @handelUploadDataHide="handelUploadDataHide" :currentTable="currentTable"
@saveUploadForm="saveUploadForm"> :btnLoading="btnLoading" :sheetRow="sheetR">
</excelUploadData> </excelUploadData>
</el-dialog> </el-dialog>
</div> </div>
@ -56,7 +56,8 @@ export default {
menuActive: 0, menuActive: 0,
socket: null, socket: null,
currentTable: null, currentTable: null,
currentId: '' currentId: '',
btnLoading:false,
}; };
}, },
props: { props: {
@ -113,17 +114,7 @@ export default {
this.loadWorkBook() this.loadWorkBook()
} }
}, },
async saveUploadForm(val) {
const url = '/actual/base/residentBaseInfo/exportOneSheet'
const { data, code, msg } = await requestPost(url, val)
if (code === 0) {
this.showUploadData = false
this.updataSheet(data)
} else {
console.log(msg);
}
},
// //
async handleClickInspect() { async handleClickInspect() {
//cellData //cellData
@ -155,11 +146,10 @@ export default {
}; };
this.sheetR = findLastNonNullIndex(this.currentTable[0].data) this.sheetR = findLastNonNullIndex(this.currentTable[0].data)
if (this.sheetR != -1) { if (this.sheetR != -1) {
luckysheet.insertRow(this.currentTable[0].data.length, 5) luckysheet.insertRow(this.currentTable[0].data.length, 5)//5
// this.updataSheet()
} }
}, },
handelUploadData() { handelUploadDataHide() {
this.showUploadData = false this.showUploadData = false
}, },
loadWorkBook() { loadWorkBook() {
@ -192,14 +182,6 @@ export default {
this.$emit('close') this.$emit('close')
}, },
updataSheet(list) {
list.forEach((item, index) => {
luckysheet.insertRow(this.currentTable[0].data.length, 1)
for (let k in item) {
luckysheet.setCellValue(index + this.sheetR + 1, k - 1, item[k])
}
})
},
// //
async handleClickCurrencyEvent(val){ async handleClickCurrencyEvent(val){
const url = '/actual/base/communityOneTablePeriodPublish/update' const url = '/actual/base/communityOneTablePeriodPublish/update'

Loading…
Cancel
Save