增加月度计划导入

master
xhj 8 months ago
parent 160f02bb7f
commit ae7ffa3549

@ -65,6 +65,18 @@
<!-- <el-button type="success" @click="confirmModal"></el-button>-->
<el-button type="success" @click="creatYdjh"></el-button>
<el-button type="success" @click="symxhz"></el-button>
<el-button type="success" @click="uploadExcel" >
<el-upload
:action="uploadAction"
:show-file-list="false"
:before-upload="beforeAvatarUpload"
:data="uploadData"
:on-success="handleAvatarSuccess"
:headers="heads"
>
月度计划导入
</el-upload>
</el-button>
<vxe-grid
id="id"
ref="xGrid"
@ -361,6 +373,8 @@ import Sbjgry from '@/views/sjzx/sbjgryWH.vue';
import Sbcnwh from '@/views/jhzx/components/sygdpc/Sbcn.vue';
import GxCD from '@/views/jhzx/components/sygdpc/GxCD.vue';
import Dhjh from '@/views/jhzx/components/sygdpc/Dhjh.vue';
import {endLoading, startLoading} from "@/utils";
import {Message} from "element-ui";
export default {
name: 'SymxCX',
components: {ScrollPane,Gcrl,Sbcnwh,Sbwxjh,Sbjgry,GxCD,Dhjh},
@ -389,6 +403,10 @@ export default {
list3: [],
checkedList: [],
heads: {token: getToken()},
uploadData:{
},
uploadAction: process.env.VUE_APP_BASE_API + '/dmSygdMx/ydjhImport',
dictData: [],
height: '500px',
/*
@ -1240,7 +1258,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', },
},
{ field: '', title: '二垮龙门板数', width: 120,
{ field: 'eksk2', title: '二垮龙门板数', width: 120,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', },
},
@ -3173,7 +3191,36 @@ export default {
},
format (val) {
this.queryParam.endTime=XEUtils.toDateString(XEUtils.getWhatMonth(val, 0, 'last'),'yyyy/MM/dd')
}
},
beforeAvatarUpload(file) {
//
const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer
if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式')
return
}
startLoading()
return fileType
},
handleAvatarSuccess(res, file) {
endLoading()
if (res.success) {
this.$message({ message: '导入成功', type: 'success' })
this.initList();
} else {
Message({
message: res.message || 'Error',
type: 'error',
duration: 5 * 1000
})
}
},
}
}
</script>

Loading…
Cancel
Save