|
@@ -10,13 +10,20 @@
|
|
|
:http-request="handlSuccess"
|
|
:http-request="handlSuccess"
|
|
|
:before-upload="beforeUpload"
|
|
:before-upload="beforeUpload"
|
|
|
>
|
|
>
|
|
|
- <!-- x -->
|
|
|
|
|
|
|
+ <!-- x -->
|
|
|
<el-button icon="el-icon-plus" size="small" type="primary"
|
|
<el-button icon="el-icon-plus" size="small" type="primary"
|
|
|
>文件上传</el-button
|
|
>文件上传</el-button
|
|
|
>
|
|
>
|
|
|
- <div slot="tip" class="el-upload__tip"
|
|
|
|
|
- >只能上传excel文件</div
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
|
|
+ 只能上传excel文件,点击
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ @click="downLoadTemplate()"
|
|
|
|
|
+ >
|
|
|
|
|
+ 下载模板</el-link
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
@@ -26,9 +33,9 @@
|
|
|
<span> {{ item.name }}</span>
|
|
<span> {{ item.name }}</span>
|
|
|
<el-link @click="delFileList(index)" type="primary">删除</el-link>
|
|
<el-link @click="delFileList(index)" type="primary">删除</el-link>
|
|
|
</p>
|
|
</p>
|
|
|
- <el-progress
|
|
|
|
|
|
|
+ <el-progress
|
|
|
v-if="progressVisible"
|
|
v-if="progressVisible"
|
|
|
- :percentage="percentage"
|
|
|
|
|
|
|
+ :percentage="percentage"
|
|
|
:status="uploadStatus"
|
|
:status="uploadStatus"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -36,13 +43,16 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="dialogVisible = false">关 闭</el-button>
|
|
<el-button size="small" @click="dialogVisible = false">关 闭</el-button>
|
|
|
- <el-button size="small" :loading="loading" @click="upload" type="primary">上 传</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" :loading="loading" @click="upload" type="primary"
|
|
|
|
|
+ >上 传</el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { importPBom } from '@/api/system/file/index.js';
|
|
import { importPBom } from '@/api/system/file/index.js';
|
|
|
|
|
+ import { downLoadBom } from '@/api/system/file/index.js';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
props: {
|
|
props: {
|
|
@@ -57,9 +67,9 @@
|
|
|
module: '',
|
|
module: '',
|
|
|
attaments: [], //上传文件
|
|
attaments: [], //上传文件
|
|
|
file: '',
|
|
file: '',
|
|
|
- percentage: 0, // 进度百分比 (0-100)
|
|
|
|
|
|
|
+ percentage: 0, // 进度百分比 (0-100)
|
|
|
progressVisible: false, // 是否显示进度条
|
|
progressVisible: false, // 是否显示进度条
|
|
|
- uploadStatus: '', // 进度条状态 (success/exception)
|
|
|
|
|
|
|
+ uploadStatus: '', // 进度条状态 (success/exception)
|
|
|
loading: false
|
|
loading: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -92,7 +102,11 @@
|
|
|
this.file = param.file;
|
|
this.file = param.file;
|
|
|
this.attaments.push(param.file);
|
|
this.attaments.push(param.file);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ downLoadTemplate() {
|
|
|
|
|
+ downLoadBom();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
// 文件上传
|
|
// 文件上传
|
|
|
async upload() {
|
|
async upload() {
|
|
|
if (this.attaments.length == 0) {
|
|
if (this.attaments.length == 0) {
|