Commit 0803a94e authored by 高宇's avatar 高宇

1.导入

parent 46f96f03
......@@ -294,9 +294,26 @@
</el-dialog>
<!-- 导入配置对话框 -->
<el-dialog class="importDialog" :title="importControls.title" :visible="importControls.open" width="80" append-to-body :close-on-click-modal="false" @close="cancelFileFrom">
<el-tabs type="border-card">
<el-tab-pane label="导入一">
<div class="importOne">
<el-form :model="typeFrom">
<el-form-item v-model="typeFrom.type">
<el-select
v-model="typeFrom.type"
placeholder="typeFrom"
clearable
:maxlength="2"
size="small"
style="width: 150px"
>
<el-option
v-for="(dict,index) in typeList"
:key="index"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-form>
<div v-if="typeFrom.type === '1'" class="importOne">
<div>
<!-- 下载模型按钮 -->
<div class="downloadTemplateDiv">
......@@ -332,8 +349,6 @@
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelFileFrom">取 消</el-button>
<el-button :loading="importLoading" type="primary" @click="submitFileForm">确 定</el-button>
......@@ -436,6 +451,21 @@ export default {
name: 'OutcomeWmsJbapplyTemp',
data() {
return {
// 类型表单
typeFrom: {
type: '1'
},
// 类型下拉框
typeList: [
{
label: '类型1',
value: '1'
},
{
label: '类型2',
value: '20'
}
],
// 导入列表
files: [],
// 下载模板loading
......@@ -670,6 +700,7 @@ export default {
// 导入取消
cancelFileFrom() {
this.importControls.open = false
this.files = []
},
// 导入确认
submitFileForm() {
......@@ -684,12 +715,15 @@ export default {
formData.append('file', this.files)
importJbapplyExcel(formData).then(res => {
if (res.code === 200) {
this.$message.success(`成功导入`+res.data.rows+`条`)
this.importLoading = false
this.importControls.open = false
this.files = []
this.getList()
}
}).catch(() => {
this.importLoading = false
this.files = []
})
}
// this.importControls.open = 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