|
@@ -7,9 +7,15 @@
|
|
|
:maskClosable="false"
|
|
|
:confirmLoading="confirmLoading"
|
|
|
:getContainer ='()=>$refs.replyModal'
|
|
|
- @ok="handleOk"
|
|
|
@cancel="handleCancel"
|
|
|
destroyOnClose>
|
|
|
+ <template #footer>
|
|
|
+ <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" @change="handleImportExcel" :customRequest="implementImport" >
|
|
|
+ <a-button type="primary">导入</a-button>
|
|
|
+ </a-upload>
|
|
|
+ <a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
|
|
|
+ <a-button type="primary" @click="handleOk">保存</a-button>
|
|
|
+ </template>
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<!-- 主表单区域 -->
|
|
|
<a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
|
|
@@ -138,6 +144,8 @@
|
|
|
import { FormTypes } from '@/utils/JEditableTableUtil'
|
|
|
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
|
|
import { putAction,postAction,getAction } from '@/api/manage'
|
|
|
+ import {fileDetail} from '@api/oa/cd-sy-cotton'
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
name: 'SyCottonYarnModal',
|
|
@@ -378,6 +386,24 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ // 导入
|
|
|
+ implementImport(file) {
|
|
|
+ const formData = new FormData()
|
|
|
+ formData.append('file', file.file)
|
|
|
+ fileDetail(formData).then(res => {
|
|
|
+ // this.loading = false
|
|
|
+ if (res.success) {
|
|
|
+ // this.visible = true
|
|
|
+ this.message = res.message.split(';').filter((element) => {
|
|
|
+ return element !== "";
|
|
|
+ });
|
|
|
+ this.file = file
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
//关闭
|
|
|
handleCancel(){
|