Commit 6d3594a5 by 张杰

修复bug

1 parent c28cb236
......@@ -9,7 +9,7 @@
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination background layout="sizes, total,prev, pager, next, jumper" hide-on-single-page :total="pageTotal" :page-size.sync="pageSizeNum" :page-sizes="pageSizes" :current-page.sync="currentPage" @current-change="getList" @size-change="changePageSize" />
<el-pagination background layout="sizes, total,prev, pager, next, jumper" :total="pageTotal" :page-size.sync="pageSizeNum" :page-sizes="pageSizes" :current-page.sync="currentPage" @current-change="getList" @size-change="changePageSize" />
</div>
</div>
</template>
......
......@@ -39,7 +39,8 @@
justify-content: center;
.cell {
position: relative;
width: 200px;
//width: 200px;
flex:1;
display: flex;
flex-direction: column;
text-align: center;
......
......@@ -21,7 +21,7 @@
</el-popover>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
......@@ -55,7 +55,7 @@
<div class="upload_box" v-show="!showResult">
<div class="input_box">
<el-input v-model="uploadFile.name" placeholder="未选择任何文件..." class="a_input" size="small" readonly></el-input>
<el-upload ref="elUpload" :action="IMPORT_FAKEOFFLINE_FILES" :headers="uploadHeaders" :show-file-list="false" :auto-upload="false" :on-change="onFileChange" :on-success="onSuccess">
<el-upload ref="elUpload" :action="IMPORT_FAKEOFFLINE_FILES" :headers="uploadHeaders" :accept="acceptFile" :show-file-list="false" :auto-upload="false" :file-list="fileList" :on-change="onFileChange" :on-success="onSuccess">
<el-button size="small" type="primary">浏览</el-button>
</el-upload>
</div>
......@@ -157,6 +157,8 @@ export default {
uploadHeaders: {},
uploadResult: {},
IMPORT_FAKEOFFLINE_FILES,
fileList: [],
acceptFile: ".xlsx,.xls",
};
},
......@@ -176,8 +178,11 @@ export default {
// 获取列表
getList(options) {
let oParams = this.getParams();
console.log(options);
console.log(this.$refs.glsxTable.pageSizeNum);
oParams.pageSize = options?options.pageSize : this.$refs.glsxTable.pageSizeNum;
oParams.pageSize = options
? options.pageSize
: this.$refs.glsxTable.pageSizeNum;
oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true;
......@@ -260,6 +265,7 @@ export default {
console.log(file);
if (!file.response) {
this.uploadFile = file;
this.fileList = [file];
}
},
......@@ -278,13 +284,27 @@ export default {
// 上传文件
saveFile() {
let o = this.uploadFile;
console.log(o);
if (!this.uploadFile.name) {
showToast({
message: "请选择上传文件",
});
return false;
}
console.log(this.uploadFile);
let list = o.name.split(".");
let acceptFile = this.acceptFile;
let _type = list[list.length - 1];
console.log(_type);
let idx = acceptFile.includes(_type);
if (!idx) {
showToast({
message: `导入文件只支持${acceptFile}`,
});
return false;
}
this.aloading = true;
this.$refs.elUpload.submit();
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!