文件上传加头部参数

master
anthonywj 4 years ago
parent d01d1f43fd
commit 6f7e4ec2d2

@ -503,14 +503,14 @@ export const asyncRouterMap = [
authRule: ["thrsys/thrCorpsImport"]
}
},
{
path: "thrCorpsExport",
name: "往来单位导出",
component: thrCorpsExport,
meta: {
authRule: ["thrsys/thrCorpsExport"]
}
}
// {
// path: "thrCorpsExport",
// name: "往来单位导出",
// component: thrCorpsExport,
// meta: {
// authRule: ["thrsys/thrCorpsExport"]
// }
// }
],
},

@ -1,5 +1,6 @@
import { getStore, setStore } from "../../utils/store";
import {getStore, setStore} from "../../utils/store";
import * as types from "../mutation-types";
import store from "@/store";
const state = {
sidebar: {
@ -16,16 +17,16 @@ const getters = {
// actions
const actions = {
ToggleSideBar({ commit }) {
ToggleSideBar({commit}) {
commit(types.TOGGLE_SIDEBAR);
},
ShowSideBar({ commit }) {
ShowSideBar({commit}) {
commit(types.SHOW_SIDEBAR);
},
addVisitedViews({ commit }, view) {
addVisitedViews({commit}, view) {
commit(types.ADD_VISITED_VIEWS, view);
},
delVisitedViews({ commit, state }, view) {
delVisitedViews({commit, state}, view) {
return new Promise(resolve => {
commit(types.DEL_VISITED_VIEWS, view);
resolve([...state.visitedViews]);
@ -51,7 +52,7 @@ const mutations = {
},
[types.ADD_VISITED_VIEWS](state, view) {
if (state.visitedViews.some(v => v.path === view.path)) return;
state.visitedViews.push({ name: view.name, path: view.path });
state.visitedViews.push({name: view.name, path: view.path});
},
[types.DEL_VISITED_VIEWS](state, view) {
let index;
@ -65,9 +66,11 @@ const mutations = {
}
};
export default {
state,
getters,
actions,
mutations
mutations,
};

@ -28,6 +28,7 @@
:action="uploadFileUrl"
multiple
:limit="3"
:headers="headers"
:show-file-list="false"
:on-success="handleChange"
:file-list="fileList"
@ -145,6 +146,7 @@ import {
import modifyDialog from "./BussinessTypeModify";
import axios from "axios";
import store from "@/store";
export default {
data() {
@ -197,6 +199,8 @@ export default {
total: 0,
multipleSelection: [],
uploadFileUrl: null,
headers: {},
};
},
@ -359,6 +363,10 @@ export default {
let response = res.data.BASE_URL;
this.uploadFileUrl = response + "/udiwms/busstiness/file/upload";
});
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
},
},
components: {

@ -36,17 +36,17 @@
:action="uploadFileUrl"
multiple
:limit="3"
:headers="headers"
:data="uploadData"
:show-file-list="false"
:on-success="handleChange"
:file-list="fileList"
>
<el-button size="mini" type="primary">导入往来单位</el-button>
</el-upload>
<!-- <el-button type="primary" icon="search" @click="jumpDl"-->
<!-- v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1">模板下载-->
<!-- </el-button>-->
<!-- <el-button type="primary" icon="search" @click="jumpDl"-->
<!-- v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1">模板下载-->
<!-- </el-button>-->
<el-button type="primary" icon="search" @click="downloadCorps"
v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==3">
下载往来单位
@ -151,15 +151,16 @@
</template>
<script>
import {filterLog, deleteLog} from "../../api/thrsys/thrCorpsImport";
import {getBasicThirdSys, filterDetailByKey} from "../../api/basic/basicThirdSys";
import {downloadAll} from "../../api/thrsys/thrCorps";
import {selectIp} from "../../api/param/systemParamConfig";
import thrCorpsImportDetail from "./ThrCorpsImportDetail";
import thrCorpSelect from "./ThrCorpSelect";
import axios from "axios";
import {filterLog, deleteLog} from "../../api/thrsys/thrCorpsImport";
import {getBasicThirdSys, filterDetailByKey} from "../../api/basic/basicThirdSys";
import {downloadAll} from "../../api/thrsys/thrCorps";
import {selectIp} from "../../api/param/systemParamConfig";
import thrCorpsImportDetail from "./ThrCorpsImportDetail";
import thrCorpSelect from "./ThrCorpSelect";
import axios from "axios";
import store from "@/store";
export default {
export default {
data() {
return {
filterQuery: {
@ -174,6 +175,7 @@
thrCorpSelectVisible: false,
checked: false,
list: [],
headers: {},
detailList: [],
thirdSys: [],
thirdSysDetail: null,
@ -416,32 +418,36 @@
},
components: {thrCorpsImportDetail, thrCorpSelect},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getBasicThirdSys();
// this.getList();
},
};
};
</script>
<style>
.itemTag {
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 100px;
}
}
.text {
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
}
.el-row {
.el-row {
display: flex;
flex-wrap: wrap;
}
}
.el-col {
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
}
</style>

@ -37,6 +37,7 @@
multiple
:limit="3"
:data="uploadData"
:headers="headers"
:show-file-list="false"
:on-success="handleChange"
:file-list="fileList"
@ -159,6 +160,7 @@
import thrProductsImportDetail from "./ThrProductsImportDetail";
import thrProductsSelect from "./ThrProductsSelect";
import axios from "axios";
import store from "@/store";
export default {
data() {
@ -171,6 +173,7 @@
limit: 20,
thirdSysFk: null,
},
headers:{},
udiImportDetailVisible: false,
thrProductsSelectVisible: false,
checked: false,
@ -396,6 +399,10 @@
},
components: {thrProductsImportDetail,thrProductsSelect},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getBasicThirdSys();
// this.getList();
},

Loading…
Cancel
Save