Commit 572dacf9 by 李少勇

修改fxdsdb交易修改

parent f0c5d63a
......@@ -3,12 +3,19 @@
<el-dialog v-if="visible" v-dialogDrag :visible="visible" :modal-append-to-body="false" :close-on-click-modal="false"
title="新增" destroy-on-close width="50%">
<div>
<el-upload action="#" :before-upload="beforeUpload" :show-file-list="false" accept=".xml">
<el-upload action="/webapi/gjzf/fxdsdb/upload" :before-upload="handleBeforeUpload" :on-success="handleSuccess" :limit="1" :show-file-list="false" accept=".xml">
<c-button slot="trigger" size="small" type="primary">导入</c-button>
</el-upload>
<el-table :data="stmData.data" :columns="stmData.columns" v-loading="load" style="width: 100%;margin-top: 10px;"
size="small" :border="true"
:highlight-current-row="true">
<el-table-column v-for="(item, key) in stmData.columns" :key="key" :label="item.label" :prop="item.prop"
:min-width="item.width">
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button v-if="!isDispaly" type="primary" @click="handleSubmit()">确 定</el-button>
<el-button v-if="isDispaly" type="primary" @click="handleSubmit()">确 定</el-button>
<el-button @click="handleCancel()">取 消</el-button>
</span>
</el-dialog>
......@@ -26,14 +33,39 @@ export default {
data() {
return {
visible: false,
isDispaly: false,
load: false,
stmData: {
columns: [
{
label: "导入日期",
prop: "credat",
width: "120px"
},
],
data: []
}
};
},
watch: {
},
methods: {
beforeUpload(file) {
// 上传前校检大小
handleBeforeUpload(file) {
// 校检文件大小
const isLt = file.size / 1024 / 1024 < 100;
if (!isLt) {
this.$notify.error(`上传文件大小不能超过 100 MB!`);
return false;
}
this.load = true;
return true;
},
handleSuccess(res, file) {
console.log('=====', res)
this.load = false;
this.isDispaly = true;
},
handleSubmit() {
this.visible = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment