Commit 6d3594a5 by 张杰

修复bug

1 parent c28cb236
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination_list"> <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>
</div> </div>
</template> </template>
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
justify-content: center; justify-content: center;
.cell { .cell {
position: relative; position: relative;
width: 200px; //width: 200px;
flex:1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
text-align: center; text-align: center;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</el-popover> </el-popover>
</el-form-item> </el-form-item>
<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-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button> <el-button type="primary" icon="el-icon-refresh" size="mini" @click="rest()">重置</el-button>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div class="upload_box" v-show="!showResult"> <div class="upload_box" v-show="!showResult">
<div class="input_box"> <div class="input_box">
<el-input v-model="uploadFile.name" placeholder="未选择任何文件..." class="a_input" size="small" readonly></el-input> <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-button size="small" type="primary">浏览</el-button>
</el-upload> </el-upload>
</div> </div>
...@@ -157,6 +157,8 @@ export default { ...@@ -157,6 +157,8 @@ export default {
uploadHeaders: {}, uploadHeaders: {},
uploadResult: {}, uploadResult: {},
IMPORT_FAKEOFFLINE_FILES, IMPORT_FAKEOFFLINE_FILES,
fileList: [],
acceptFile: ".xlsx,.xls",
}; };
}, },
...@@ -176,8 +178,11 @@ export default { ...@@ -176,8 +178,11 @@ export default {
// 获取列表 // 获取列表
getList(options) { getList(options) {
let oParams = this.getParams(); let oParams = this.getParams();
console.log(options);
console.log(this.$refs.glsxTable.pageSizeNum); 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; oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true; this.loading = true;
...@@ -260,6 +265,7 @@ export default { ...@@ -260,6 +265,7 @@ export default {
console.log(file); console.log(file);
if (!file.response) { if (!file.response) {
this.uploadFile = file; this.uploadFile = file;
this.fileList = [file];
} }
}, },
...@@ -278,13 +284,27 @@ export default { ...@@ -278,13 +284,27 @@ export default {
// 上传文件 // 上传文件
saveFile() { saveFile() {
let o = this.uploadFile;
console.log(o);
if (!this.uploadFile.name) { if (!this.uploadFile.name) {
showToast({ showToast({
message: "请选择上传文件", message: "请选择上传文件",
}); });
return false; 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.aloading = true;
this.$refs.elUpload.submit(); 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!