导入拆分结果
This commit is contained in:
@@ -50,12 +50,14 @@
|
|||||||
methods:{
|
methods:{
|
||||||
beforeUpload(file,fileList) {
|
beforeUpload(file,fileList) {
|
||||||
console.log('file',this.accept)
|
console.log('file',this.accept)
|
||||||
|
this.fileTypeSatus=false
|
||||||
if(this.myfileList&&this.myfileList.length>=1){
|
if(this.myfileList&&this.myfileList.length>=1){
|
||||||
this.$message.warning('只能上传一个文件')
|
this.$message.warning('只能上传一个文件')
|
||||||
return false
|
return false
|
||||||
}else{
|
}else{
|
||||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||||
if(file.type==this.accept){
|
if(file.type==this.accept){
|
||||||
|
// console.log('111111')
|
||||||
this.fileTypeSatus = true;
|
this.fileTypeSatus = true;
|
||||||
this.$message.destroy()
|
this.$message.destroy()
|
||||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||||
@@ -69,6 +71,7 @@
|
|||||||
},
|
},
|
||||||
handleChange(info) {
|
handleChange(info) {
|
||||||
// console.log('info',info)
|
// console.log('info',info)
|
||||||
|
|
||||||
let { file,fileList } = info;
|
let { file,fileList } = info;
|
||||||
const status = info.file.status;
|
const status = info.file.status;
|
||||||
info.fileList.forEach((val,index)=>{
|
info.fileList.forEach((val,index)=>{
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
:remove='remove'
|
:remove='remove'
|
||||||
@change="handleChange">
|
@change="handleChange">
|
||||||
<p>
|
<p>
|
||||||
<a-icon class="action-upload" type="cloud-upload"/>
|
<a-icon class="action-upload" type="cloud-upload" />
|
||||||
</p>
|
</p>
|
||||||
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">{{this.$t('clickUpload')}}</p>
|
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px;margin-left: 5px;">{{this.$t('clickUpload')}}</p>
|
||||||
</a-upload-dragger>
|
</a-upload-dragger>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,13 +70,11 @@
|
|||||||
},
|
},
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
let fileFlag=false
|
let fileFlag=false
|
||||||
console.log('accept',this.accept,file)
|
// console.log('accept',this.accept,file)
|
||||||
|
this.fileTypeSatus=false
|
||||||
let fileTypes=this.accept.split('/')
|
let fileTypes=this.accept.split('/')
|
||||||
let fileNowTypes=file.type.split('/')
|
let fileNowTypes=file.type.split('/')
|
||||||
fileFlag=fileTypes[0]==fileTypes[0]?true:false
|
fileFlag=fileTypes[0]==fileTypes[0]?true:false
|
||||||
|
|
||||||
|
|
||||||
// console.log('filetype',fileFlag)
|
// console.log('filetype',fileFlag)
|
||||||
if(!fileFlag){
|
if(!fileFlag){
|
||||||
this.$message.warning(this.$t('fileFormatIncorrect'))
|
this.$message.warning(this.$t('fileFormatIncorrect'))
|
||||||
|
|||||||
@@ -183,8 +183,16 @@
|
|||||||
// console.log('formdata',formData)
|
// console.log('formdata',formData)
|
||||||
axios({
|
axios({
|
||||||
url: '/jero-boot/split/sarFileSplitInfo/deleteBatch',
|
url: '/jero-boot/split/sarFileSplitInfo/deleteBatch',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
params:params,
|
data: params,
|
||||||
|
transformRequest: [function (data) {
|
||||||
|
// Do whatever you want to transform the data
|
||||||
|
let ret = ''
|
||||||
|
for (let it in data) {
|
||||||
|
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}],
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
'X-Access-Token':this.token
|
'X-Access-Token':this.token
|
||||||
|
|||||||
@@ -34,7 +34,8 @@
|
|||||||
:wrapper-col="wrapperCol"
|
:wrapper-col="wrapperCol"
|
||||||
>
|
>
|
||||||
<a-form-model-item ref="file" :label="$t('splitFile')" prop="file">
|
<a-form-model-item ref="file" :label="$t('splitFile')" prop="file">
|
||||||
<split-upload ref="uploadFile" :accept="accept" :disabled="disabled" :module="'split'" @uploadSuccess="uploadSuccess"></split-upload>
|
<split-upload ref="uploadFile" :accept="accept" :disabled="disabled" :module="'split'" @uploadSuccess="uploadSuccess"></split-upload>
|
||||||
|
<!-- <a-input v-model="form.file" >{{form.file}}</a-input>-->
|
||||||
<!-- <a-button type="primary" class="button-text"-->
|
<!-- <a-button type="primary" class="button-text"-->
|
||||||
<!-- @click="fileUpload()">-->
|
<!-- @click="fileUpload()">-->
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@
|
|||||||
form:{},
|
form:{},
|
||||||
rules:{
|
rules:{
|
||||||
file:[
|
file:[
|
||||||
{ required: true, message: this.$t('pleaseUploadFile'), trigger: 'blur' },
|
{ required: true, message: this.$t('pleaseUploadFile'), trigger: 'change' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
spinning:false, //loading标识
|
spinning:false, //loading标识
|
||||||
@@ -227,70 +228,92 @@
|
|||||||
//保存
|
//保存
|
||||||
handleSubmit(){
|
handleSubmit(){
|
||||||
// console.log('seleced',this.selectedRowKeys,this.rows)
|
// console.log('seleced',this.selectedRowKeys,this.rows)
|
||||||
|
console.log('this.form.file,',this.form.file)
|
||||||
if(this.rows.length===0){
|
if(this.rows.length===0){
|
||||||
this.$message.warning(this.$t('PleaseSelectData'))
|
this.$message.warning(this.$t('PleaseSelectData'))
|
||||||
}else if(this.rows&&this.rows.length>1){
|
}else if(this.rows&&this.rows.length>1){
|
||||||
this.$message.warning(this.$t('OnlyOneSelected'))
|
this.$message.warning(this.$t('OnlyOneSelected'))
|
||||||
}else if(this.rows&&this.rows.length===1){
|
}else if(this.rows&&this.rows.length===1){
|
||||||
this.$refs.ruleForm.validate(valid=>{
|
let params={
|
||||||
if(valid){
|
connectId:this.rows[0].connect_id,
|
||||||
this.flag=true
|
splitFileId:this.form.file,
|
||||||
if(this.flag){
|
fileName:this.rows[0].file_name,
|
||||||
let params={
|
serialNumber:this.rows[0].serial_number,
|
||||||
connectId:this.rows[0].connect_id,
|
title:this.rows[0].title,
|
||||||
splitFileId:this.form.file,
|
|
||||||
fileName:this.rows[0].file_name,
|
|
||||||
serialNumber:this.rows[0].serial_number,
|
|
||||||
title:this.rows[0].title,
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(this.rows[0].text_info=='发布稿(必读)'){
|
if(this.rows[0].text_info=='发布稿(必读)'){
|
||||||
params.fileType='1'
|
params.fileType='1'
|
||||||
}else if(this.rows[0].text_info=='增补件(必读)'){
|
}else if(this.rows[0].text_info=='增补件(必读)'){
|
||||||
params.fileType='2'
|
params.fileType='2'
|
||||||
}else if(this.rows[0].text_info=='报批稿'){
|
}else if(this.rows[0].text_info=='报批稿'){
|
||||||
params.fileType='3'
|
params.fileType='3'
|
||||||
}else if(this.rows[0].text_info=='征求意见稿'){
|
}else if(this.rows[0].text_info=='征求意见稿'){
|
||||||
params.fileType='4'
|
params.fileType='4'
|
||||||
}else if(this.rows[0].text_info=='测试程序'){
|
}else if(this.rows[0].text_info=='测试程序'){
|
||||||
params.fileType='5'
|
params.fileType='5'
|
||||||
}else if(this.rows[0].text_info=='相关资料'){
|
}else if(this.rows[0].text_info=='相关资料'){
|
||||||
params.fileType='6'
|
params.fileType='6'
|
||||||
}
|
}
|
||||||
let formData = new FormData()
|
let formData = new FormData()
|
||||||
Object.keys(params).forEach((key) => {
|
Object.keys(params).forEach((key) => {
|
||||||
console.log('key',key,params[key])
|
console.log('key',key,params[key])
|
||||||
formData.append(key, params[key]);
|
formData.append(key, params[key]);
|
||||||
});
|
});
|
||||||
console.log('formData',params,formData.getAll)
|
console.log('formData',params,formData.getAll)
|
||||||
axios({
|
if(!this.form.file) {
|
||||||
url: '/jero-boot/split/sarFileSplitItems/importSplitResult',
|
this.$refs.ruleForm.validate(valid => {
|
||||||
method: 'post',
|
if (valid) {
|
||||||
data:formData,
|
this.flag = true
|
||||||
// data: params,
|
if (this.flag) {
|
||||||
// transformRequest: [function (data) {
|
|
||||||
// // Do whatever you want to transform the data
|
|
||||||
// let ret = ''
|
|
||||||
// for (let it in data) {
|
|
||||||
// ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
|
||||||
// }
|
|
||||||
// return ret
|
|
||||||
// }],
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
// 'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
'X-Access-Token':this.token
|
|
||||||
}
|
|
||||||
}).then(res => {
|
|
||||||
if (res.data.success) {
|
|
||||||
|
|
||||||
}
|
axios({
|
||||||
}).finally(()=>[
|
url: '/jero-boot/split/sarFileSplitItems/importSplitResult',
|
||||||
this.flag=false
|
method: 'post',
|
||||||
])
|
data: formData,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
// 'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'X-Access-Token': this.token
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.$message.success(this.$t('OperationSuccessful'))
|
||||||
|
eventBUs.$emit('searchReset')
|
||||||
|
}else{
|
||||||
|
this.$message.warning(res.data.message)
|
||||||
|
}
|
||||||
|
}).finally(() => [
|
||||||
|
this.flag = false
|
||||||
|
])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
this.flag = true
|
||||||
|
this.$refs.ruleForm.clearValidate()
|
||||||
|
if (this.flag) {
|
||||||
|
axios({
|
||||||
|
url: '/jero-boot/split/sarFileSplitItems/importSplitResult',
|
||||||
|
method: 'post',
|
||||||
|
data: formData,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
// 'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'X-Access-Token': this.token
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data.success) {
|
||||||
|
this.$message.success(this.$t('OperationSuccessful'))
|
||||||
|
eventBUs.$emit('searchReset')
|
||||||
|
}else{
|
||||||
|
this.$message.warning(res.data.message)
|
||||||
|
}
|
||||||
|
}).finally(() => [
|
||||||
|
this.flag = false
|
||||||
|
])
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,8 @@
|
|||||||
{{ $t('add') }}
|
{{ $t('add') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="operator-text upload-split" @click="handleImportManage">
|
<div class="operator-text upload-split" @click="handleImportManage">
|
||||||
<a-icon type="import" :rotate="-90" v-if="!uploadMenuId" />
|
<a-icon type="import" :rotate="-90" v-if="uploadMenuId===undefined||uploadMenuId===''" />
|
||||||
{{ uploadMenuId===''? $t('import'):'' }}
|
{{ (uploadMenuId===''||uploadMenuId===undefined)? $t('import'):'' }}
|
||||||
<upload v-if="menuId" ref="uploadSplit":infoId="infoId" :menuId="uploadMenuId" @uploadSuccess="uploadSuccess"></upload>
|
<upload v-if="menuId" ref="uploadSplit":infoId="infoId" :menuId="uploadMenuId" @uploadSuccess="uploadSuccess"></upload>
|
||||||
<!-- <ImportFile :url="url"/>-->
|
<!-- <ImportFile :url="url"/>-->
|
||||||
|
|
||||||
@@ -412,6 +412,7 @@
|
|||||||
this.uploadMenuId=selectedKeys[0]
|
this.uploadMenuId=selectedKeys[0]
|
||||||
// eventBUs.$emit('searchReset')
|
// eventBUs.$emit('searchReset')
|
||||||
// console.log('sele',selectedKeys)
|
// console.log('sele',selectedKeys)
|
||||||
|
// console.log('uploadMenuId',this.uploadMenuId)
|
||||||
},
|
},
|
||||||
//树形新增
|
//树形新增
|
||||||
orgAdd(){
|
orgAdd(){
|
||||||
|
|||||||
Reference in New Issue
Block a user