1
|
<template>
|
1
|
<template>
|
2
|
<el-container>
|
2
|
<el-container>
|
3
|
<el-main>
|
3
|
<el-main>
|
4
|
- <div style="background-color:white;padding-top: 20px;padding-bottom: 20px ">
|
4
|
+ <el-row>
|
5
|
<el-row>
|
5
|
<el-row>
|
6
|
- <el-col :span="6">
|
6
|
+ <el-col :span="24"><div class="grid-content"><p>请导入原始/理货数据:</p></div></el-col>
|
|
|
7
|
+ </el-row>
|
|
|
8
|
+ <el-row>
|
|
|
9
|
+ <el-col :span="24"><div class="grid-content"><h1>Please import original / tally data:</h1></div></el-col>
|
|
|
10
|
+ </el-row>
|
|
|
11
|
+ </el-row>
|
|
|
12
|
+ <el-row style="margin-top: 60px">
|
|
|
13
|
+ <el-col :offset="4" :span="7" style="background-color: white;padding-top: 20px;padding-bottom: 20px;border-radius: 10px">
|
7
|
<el-upload
|
14
|
<el-upload
|
8
|
class="upload-demo"
|
15
|
class="upload-demo"
|
9
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
10
|
- :on-preview="handlePreview"
|
|
|
11
|
- :on-remove="handleRemove"
|
|
|
12
|
- :before-remove="beforeRemove"
|
|
|
13
|
- multiple
|
|
|
14
|
- :limit="3"
|
|
|
15
|
- :on-exceed="handleExceed"
|
|
|
16
|
- :file-list="fileList">
|
|
|
17
|
- <el-button size="small" type="primary">点击上传原始数据</el-button>
|
|
|
18
|
- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
|
16
|
+ action=""
|
|
|
17
|
+ :http-request="uploadOri"
|
|
|
18
|
+ :limit=1
|
|
|
19
|
+ :on-exceed="fileExceed"
|
|
|
20
|
+ accept="application/vnd.ms-excel,application/vnd.ms-excels"
|
|
|
21
|
+ ref="fileupload">
|
|
|
22
|
+ <el-button size="medium" type="primary">点击上传原始数据</el-button>
|
|
|
23
|
+ <div slot="tip" class="el-upload__tip">只能上传excel文件</div>
|
19
|
</el-upload>
|
24
|
</el-upload>
|
20
|
</el-col>
|
25
|
</el-col>
|
21
|
- <el-col :span="6">
|
26
|
+ <el-col :offset="2" :span="7" style="background-color: white;padding-top: 20px;padding-bottom: 20px;border-radius: 10px">
|
22
|
<el-upload
|
27
|
<el-upload
|
23
|
class="upload-demo"
|
28
|
class="upload-demo"
|
24
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
25
|
- :on-preview="handlePreview"
|
|
|
26
|
- :on-remove="handleRemove"
|
|
|
27
|
- :before-remove="beforeRemove"
|
|
|
28
|
- multiple
|
|
|
29
|
- :limit="3"
|
|
|
30
|
- :on-exceed="handleExceed"
|
|
|
31
|
- :file-list="fileList">
|
|
|
32
|
- <el-button size="small" type="primary">点击上传理货数据</el-button>
|
|
|
33
|
- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
|
29
|
+ action=""
|
|
|
30
|
+ :http-request="uploadTal"
|
|
|
31
|
+ :limit=1
|
|
|
32
|
+ :on-exceed="fileExceed2"
|
|
|
33
|
+ accept="application/vnd.ms-excel,application/vnd.ms-excels"
|
|
|
34
|
+ ref="fileupload">
|
|
|
35
|
+ <el-button size="medium" type="success">点击上传理货数据</el-button>
|
|
|
36
|
+ <div slot="tip" class="el-upload__tip">只能上传excel文件</div>
|
34
|
</el-upload>
|
37
|
</el-upload>
|
35
|
</el-col>
|
38
|
</el-col>
|
36
|
</el-row>
|
39
|
</el-row>
|
37
|
- </div>
|
|
|
38
|
</el-main>
|
40
|
</el-main>
|
39
|
</el-container>
|
41
|
</el-container>
|
40
|
</template>
|
42
|
</template>
|
|
@@ -48,14 +50,49 @@ |
|
@@ -48,14 +50,49 @@ |
48
|
</style>
|
50
|
</style>
|
49
|
|
51
|
|
50
|
<script>
|
52
|
<script>
|
51
|
- import { selectAirport } from '../../api/mt1201'
|
|
|
52
|
- import jsutil from "@/common/js/util";
|
53
|
+ import {upfile,upfiles} from "../../api/technological";
|
|
|
54
|
+ import axios from 'axios'
|
|
|
55
|
+ import Vue from 'vue'
|
|
|
56
|
+ import VueAxios from 'vue-axios'
|
53
|
export default {
|
57
|
export default {
|
54
|
data() {
|
58
|
data() {
|
55
|
return {
|
59
|
return {
|
|
|
60
|
+ fileList: [],
|
56
|
};
|
61
|
};
|
57
|
},
|
62
|
},
|
58
|
methods:{
|
63
|
methods:{
|
|
|
64
|
+ // excel 原始导入
|
|
|
65
|
+ fileExceed(){
|
|
|
66
|
+ this.$message.error('别贪心!一次只能上传一个哦~');
|
|
|
67
|
+ },
|
|
|
68
|
+ // 自定义上传 excel
|
|
|
69
|
+ uploadOri (item) {
|
|
|
70
|
+ const form = new FormData()
|
|
|
71
|
+ form.append('file', item.file);
|
|
|
72
|
+ upfile(form).then(res =>{
|
|
|
73
|
+ if(res.data.count >0){
|
|
|
74
|
+ return this.$message.error('主单导入失败')
|
|
|
75
|
+ }else {
|
|
|
76
|
+ this.$message.success('主单导入成功')
|
|
|
77
|
+ }
|
|
|
78
|
+ }).catch((e) => {})
|
|
|
79
|
+ },
|
|
|
80
|
+ // excel 理货导入
|
|
|
81
|
+ fileExceed2(){
|
|
|
82
|
+ this.$message.error('别贪心!一次只能上传一个哦~');
|
|
|
83
|
+ },
|
|
|
84
|
+ // 自定义上传 excel
|
|
|
85
|
+ uploadTal (item) {
|
|
|
86
|
+ const form = new FormData()
|
|
|
87
|
+ form.append('file', item.file);
|
|
|
88
|
+ upfiles(form).then(res =>{
|
|
|
89
|
+ if(res.data.count >0){
|
|
|
90
|
+ return this.$message.error('主单导入失败')
|
|
|
91
|
+ }else {
|
|
|
92
|
+ this.$message.success('主单导入成功')
|
|
|
93
|
+ }
|
|
|
94
|
+ }).catch((e) => {})
|
|
|
95
|
+ },
|
59
|
},
|
96
|
},
|
60
|
computed:{
|
97
|
computed:{
|
61
|
},
|
98
|
},
|