123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <template>
- <!-- 点击excel导入之后的弹窗:excel导入 -->
- <div class="excel-inputWindow">
- <div class="excel-titleWords">
- excel导入
- <div class="excel-closeIcon">
- <i class="el-icon-close" @click="closeExcelWindow"></i>
- </div>
- </div>
- <div class="folder-area">
- <div class="name-boxDiv">
- 名称
- </div>
- <el-input class="excelFolder-Input" v-model="fullExcelNameFolder" placeholder=""></el-input>
- <el-upload ref="upload" action="#" multiple :limit="1" :file-list="fileList" :auto-upload="false"
- :show-file-list="false" accept=".xls,.xlsx" :on-change="handleChange">
- <el-button class="excelFolder-search" slot="trigger" type="primary" @click="clearFilesBeforeUpload">浏览
- </el-button>
- </el-upload>
- </div>
- <div class="confirmORcancel-button">
- <el-button class="excelFolder-confirm-button" type="primary" @click="confirm">确认
- </el-button>
- <el-button class="excelFolder-cancel-button" type="primary" @click="closeExcelWindow">取消</el-button>
- </div>
- </div>
- </template>
- <script>
- import { mapState } from 'vuex';
- import {
- getXQTBListViaExcelSelect
- } from '@/api/xqglApi.js';
- export default {
- name: "excelPop",
- components: {},
- data() {
- return {
- fullExcelNameFolder: '',
- fileList: [],
- };
- },
- computed: {
- ...mapState("xqgl", ['parentId']),
- },
- watch: {
- },
- methods: {
- closeExcelWindow() {
- this.$emit('closePop');
- },
- confirm() {
- getXQTBListViaExcelSelect(this.excelUploadFile).then(res => {
- if (res.code === 200) {
- this.$emit('comfirm');
- this.$emit('closePop');
- }
- });
- },
- //excel上传时,为后端传输数据准备该接口的 data
- handleChange(file, fileList) {
- this.fullExcelNameFolder = file.name
- console.log('fileList:', fileList);
- let tempExcelFileFormData = new FormData();
- let tempExcelFile = file.raw;
- tempExcelFileFormData.append("file", tempExcelFile);
- tempExcelFileFormData.append("parentId", this.parentId);
- this.excelUploadFile = tempExcelFileFormData;
- console.log("this.excelUploadFile:", this.excelUploadFile);
- },
- //excel文件上传时,清空之情的待上传文件
- clearFilesBeforeUpload() {
- this.$refs.upload.clearFiles()
- },
- },
- mounted() {
- }
- };
- </script>
- <style lang='scss' scoped>
- .excel-inputWindow {
- width: 356px;
- height: 194px;
- position: absolute;
- top: 74px;
- left: 100%;
- z-index: 1;
- background: url('@/assets/ClipImage/dikuang/tanchuang/exceldaoru.png');
- background-size: 100% 100%;
- .excel-titleWords {
- width: 320px;
- height: 32px;
- line-height: 32px;
- text-align: center;
- position: relative;
- top: 34px;
- background-color: #0095ff;
- margin: 0px 18px;
- font-family: 'SourceHanSansCN-Bold';
- font-size: 14px;
- color: #fff;
- .excel-closeIcon {
- float: right;
- margin-right: 12px;
- cursor: pointer;
- }
- }
- .folder-area {
- width: 320px;
- height: 64px;
- position: relative;
- top: 17px;
- margin: 17px 18px;
- font-family: 'SourceHanSansCN-Regular';
- color: #fff;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .name-boxDiv {
- width: 24px;
- height: 12px;
- font-size: 12px;
- }
- // /deep/ .excelFolder-Input {
- // width: 210px;
- // height: 30px;
- // background-color: rgba(299, 299, 299, 0.3);
- // // opacity: 0.3;
- // /deep/ .el-input__inner {
- // height: 30px;
- // line-height: 30px;
- // border: none;
- // color: #fff;
- // padding: 0 8px;
- // background: transparent;
- // }
- // }
- /deep/ .excelFolder-search {
- width: 60px;
- height: 30px;
- background-color: #006ebb;
- border-radius: 4px;
- padding: 0;
- }
- }
- .confirmORcancel-button {
- width: 320px;
- height: 30px;
- display: flex;
- justify-content: space-around;
- align-items: center;
- margin: 0 18px;
- .excelFolder-confirm-button,
- .excelFolder-cancel-button {
- width: 92px;
- height: 30px;
- background: url('@/assets/ClipImage/anniu/quxiao_link.png');
- background-size: 100% 100%;
- border: none;
- padding: 0;
- margin: 0;
- font-family: SourceHanSansCN-Regular;
- }
- .excelFolder-confirm-button {
- background: url('@/assets/ClipImage/anniu/queren_link.png');
- }
- .excelFolder-confirm-button:hover {
- background: url('@/assets/ClipImage/anniu/queren_hover.png');
- }
- .excelFolder-confirm-button:focus {
- background: url('@/assets/ClipImage/anniu/queren_check.png');
- }
- .excelFolder-cancel-button {
- background: url('@/assets/ClipImage/anniu/quxiao_link.png');
- }
- .excelFolder-cancel-button:hover {
- background: url('@/assets/ClipImage/anniu/quxiao_hover.png');
- }
- .excelFolder-cancel-button:focus {
- background: url('@/assets/ClipImage/anniu/quxiao_check.png');
- }
- }
- }
- </style>
- <style lang="scss">
- .excelFolder-Input {
- width: 210px;
- height: 30px;
- background-color: rgba(299, 299, 299, 0.3);
- .el-input__inner {
- height: 30px;
- line-height: 30px;
- border: none;
- color: #fff;
- padding: 0 8px;
- background: transparent;
- }
- }
- </style>
|