文件上传加头部参数

master
anthonywj 4 years ago
parent d01d1f43fd
commit 6f7e4ec2d2

@ -503,14 +503,14 @@ export const asyncRouterMap = [
authRule: ["thrsys/thrCorpsImport"] authRule: ["thrsys/thrCorpsImport"]
} }
}, },
{ // {
path: "thrCorpsExport", // path: "thrCorpsExport",
name: "往来单位导出", // name: "往来单位导出",
component: thrCorpsExport, // component: thrCorpsExport,
meta: { // meta: {
authRule: ["thrsys/thrCorpsExport"] // 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 * as types from "../mutation-types";
import store from "@/store";
const state = { const state = {
sidebar: { sidebar: {
@ -16,16 +17,16 @@ const getters = {
// actions // actions
const actions = { const actions = {
ToggleSideBar({ commit }) { ToggleSideBar({commit}) {
commit(types.TOGGLE_SIDEBAR); commit(types.TOGGLE_SIDEBAR);
}, },
ShowSideBar({ commit }) { ShowSideBar({commit}) {
commit(types.SHOW_SIDEBAR); commit(types.SHOW_SIDEBAR);
}, },
addVisitedViews({ commit }, view) { addVisitedViews({commit}, view) {
commit(types.ADD_VISITED_VIEWS, view); commit(types.ADD_VISITED_VIEWS, view);
}, },
delVisitedViews({ commit, state }, view) { delVisitedViews({commit, state}, view) {
return new Promise(resolve => { return new Promise(resolve => {
commit(types.DEL_VISITED_VIEWS, view); commit(types.DEL_VISITED_VIEWS, view);
resolve([...state.visitedViews]); resolve([...state.visitedViews]);
@ -51,7 +52,7 @@ const mutations = {
}, },
[types.ADD_VISITED_VIEWS](state, view) { [types.ADD_VISITED_VIEWS](state, view) {
if (state.visitedViews.some(v => v.path === view.path)) return; 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) { [types.DEL_VISITED_VIEWS](state, view) {
let index; let index;
@ -65,9 +66,11 @@ const mutations = {
} }
}; };
export default { export default {
state, state,
getters, getters,
actions, actions,
mutations mutations,
}; };

@ -1,374 +1,382 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini"> <el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input <el-input
v-model="filterQuery.action" v-model="filterQuery.action"
placeholder="业务类型" placeholder="业务类型"
style="width: 400px" style="width: 400px"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.enabled" placeholder="状态"> <el-select v-model="filterQuery.enabled" placeholder="状态">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="已启用" value=1></el-option> <el-option label="已启用" value=1></el-option>
<el-option label="未启用" value=0></el-option> <el-option label="未启用" value=0></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group style="margin-left: 10px;display:flex;"> <el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
>新增 >新增
</el-button </el-button
> >
<el-upload <el-upload
:action="uploadFileUrl" :action="uploadFileUrl"
multiple multiple
:limit="3" :limit="3"
:show-file-list="false" :headers="headers"
:on-success="handleChange" :show-file-list="false"
:file-list="fileList" :on-success="handleChange"
> :file-list="fileList"
<el-button size="mini" type="primary">导入单据类型</el-button> >
</el-upload> <el-button size="mini" type="primary">导入单据类型</el-button>
</el-button-group> </el-upload>
</el-button-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="list" style="width: 100%"> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index" width="120" fixed></el-table-column> <el-table-column label="序号" type="index" width="120" fixed></el-table-column>
<el-table-column label="扫码单据类型" prop="name" fixed></el-table-column> <el-table-column label="扫码单据类型" prop="name" fixed></el-table-column>
<!-- <el-table-column label="出入库类型代码" prop="mainAction" fixed></el-table-column>--> <!-- <el-table-column label="出入库类型代码" prop="mainAction" fixed></el-table-column>-->
<el-table-column label="扫码单据类型代码" prop="action" fixed></el-table-column> <el-table-column label="扫码单据类型代码" prop="action" fixed></el-table-column>
<el-table-column label="是否启用" prop="enable" fixed> <el-table-column label="是否启用" prop="enable" fixed>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ enableMap[scope.row.enable] }}</span> <span>{{ enableMap[scope.row.enable] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="必须选择业务单据校验" prop="checkEnable" fixed> <el-table-column label="必须选择业务单据校验" prop="checkEnable" fixed>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ enableMap[scope.row.checkEnable] }}</span> <span>{{ enableMap[scope.row.checkEnable] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="二次核对" prop="secCheckEnable" fixed> <el-table-column label="二次核对" prop="secCheckEnable" fixed>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ enableMap[scope.row.secCheckEnable] }}</span> <span>{{ enableMap[scope.row.secCheckEnable] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="关联业务单据" prop="localName" fixed></el-table-column> <el-table-column label="关联业务单据" prop="localName" fixed></el-table-column>
<!-- <el-table-column label="第三方系统" prop="thirdName" fixed></el-table-column>--> <!-- <el-table-column label="第三方系统" prop="thirdName" fixed></el-table-column>-->
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="handleModifyClick(scope.row)" @click.native.stop="handleModifyClick(scope.row)"
>编辑 >编辑
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="deleteDialog(scope.row)" @click.native.stop="deleteDialog(scope.row)"
>删除 >删除
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog <el-dialog
title="新增业务类型关联" title="新增业务类型关联"
:visible.sync="addDialogVisible" :visible.sync="addDialogVisible"
width="70%" width="70%"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="addDialogVisible" v-if="addDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="onAddSubmit" <el-button type="primary" size="small" icon="search" @click="onAddSubmit"
>提交 >提交
</el-button </el-button
> >
<el-button type="primary" size="small" icon="search" @click="cancelDialog" <el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消 >取消
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="编辑扫码单据类型" title="编辑扫码单据类型"
:visible.sync="modifyDialogVisible" :visible.sync="modifyDialogVisible"
width="70%" width="70%"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="modifyDialogVisible" v-if="modifyDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="onModifySubmit" <el-button type="primary" size="small" icon="search" @click="onModifySubmit"
>提交 >提交
</el-button </el-button
> >
<el-button type="primary" size="small" icon="search" @click="cancelDialog" <el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消 >取消
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-pagination <el-pagination
:page-size="filterQuery.limit" :page-size="filterQuery.limit"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:total="total" :total="total"
></el-pagination> ></el-pagination>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { import {
getJoinBussinessType, getJoinBussinessType,
deleteBussinessType, deleteBussinessType,
updateBussinessType, updateBussinessType,
insertBussinessType, insertBussinessType,
} from "../../api/basic/bussinessType"; } from "../../api/basic/bussinessType";
import modifyDialog from "./BussinessTypeModify"; import modifyDialog from "./BussinessTypeModify";
import axios from "axios"; import axios from "axios";
import store from "@/store";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
enabled: "1", enabled: "1",
udiwmsType: "", udiwmsType: "",
thirdType: "", thirdType: "",
page: 1, page: 1,
limit: 20, limit: 20,
}, },
addDialogVisible: false, addDialogVisible: false,
modifyDialogVisible: false, modifyDialogVisible: false,
list: [], list: [],
inputQuery: { inputQuery: {
action: "", action: "",
name: "", name: "",
enable: "", enable: "",
remark: "", remark: "",
mainAction: "", mainAction: "",
thirdSysFk: "", thirdSysFk: "",
id: "", id: "",
localAction: null, localAction: null,
checkEnable: false, checkEnable: false,
genUnit: false, genUnit: false,
innerOrder: false, innerOrder: false,
spUse: null, spUse: null,
secCheckEnable: null, secCheckEnable: null,
checkUdims: null, checkUdims: null,
checkPdaEd: null, checkPdaEd: null,
checkPdaUn: null, checkPdaUn: null,
checkPc: null, checkPc: null,
checkWebNew: null, checkWebNew: null,
checkChange: null, checkChange: null,
secCheckUdims: null, secCheckUdims: null,
secCheckPdaEd: null, secCheckPdaEd: null,
secCheckPdaUn: null, secCheckPdaUn: null,
secCheckPc: null, secCheckPc: null,
secCheckWebNew: null, secCheckWebNew: null,
secCheckChange: null, secCheckChange: null,
corpType: null, corpType: null,
storageCode: null, storageCode: null,
supplementOrderType: null, supplementOrderType: null,
}, },
enableMap: { enableMap: {
true: "是", true: "是",
false: "否", false: "否",
}, },
fileList: [], fileList: [],
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
uploadFileUrl: null, uploadFileUrl: null,
}; headers: {},
},
methods: { };
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
udiwmsType: "",
thirdType: "",
page: 1,
limit: 20,
};
this.getList();
},
cancelDialog() {
this.modifyDialogVisible = false;
this.addDialogVisible = false;
},
handleChange() {
this.getList();
},
getList() {
this.loading = true;
getJoinBussinessType(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
methods: {
onAddSubmit() { onReset() {
if (this.inputQuery.enable && this.inputQuery.localAction == "") { this.$router.push({
this.$message.error("本地单据不能为空!"); path: "",
return; });
} this.filterQuery = {
if (this.inputQuery.mainAction == "" || this.inputQuery.mainAction == null) { udiwmsType: "",
this.$message.error("出入库类型不能为空!"); thirdType: "",
return; page: 1,
} limit: 20,
insertBussinessType(this.inputQuery) };
.then((response) => {
this.loading = false;
this.cancelDialog();
this.getList(); this.getList();
}) },
.catch(() => { cancelDialog() {
this.loading = false; this.modifyDialogVisible = false;
this.cancelDialog(); this.addDialogVisible = false;
}); },
}, handleChange() {
this.getList();
},
getList() {
this.loading = true;
getJoinBussinessType(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
onModifySubmit() {
if (this.inputQuery.enable && this.inputQuery.localAction == "") {
this.$message.error("本地单据不能为空!");
return;
}
if (this.inputQuery.mainAction == "" || this.inputQuery.mainAction == null) { onAddSubmit() {
this.$message.error("出入库类型不能为空!"); if (this.inputQuery.enable && this.inputQuery.localAction == "") {
return; this.$message.error("本地单据不能为空!");
} return;
updateBussinessType(this.inputQuery) }
.then((response) => { if (this.inputQuery.mainAction == "" || this.inputQuery.mainAction == null) {
this.loading = false; this.$message.error("出入库类型不能为空!");
this.cancelDialog(); return;
this.getList(); }
}) insertBussinessType(this.inputQuery)
.catch(() => { .then((response) => {
this.loading = false; this.loading = false;
this.cancelDialog(); this.cancelDialog();
}); this.getList();
}, })
.catch(() => {
this.loading = false;
this.cancelDialog();
});
},
handleAddClick() { onModifySubmit() {
this.inputQuery = {}; if (this.inputQuery.enable && this.inputQuery.localAction == "") {
this.addDialogVisible = true; this.$message.error("本地单据不能为空!");
}, return;
}
handleModifyClick(row) { if (this.inputQuery.mainAction == "" || this.inputQuery.mainAction == null) {
this.inputQuery = { this.$message.error("出入库类型不能为空!");
id: row.id, return;
remark: row.remark, }
action: row.action, updateBussinessType(this.inputQuery)
name: row.name, .then((response) => {
enable: row.enable, this.loading = false;
mainAction: row.mainAction, this.cancelDialog();
localAction: row.localAction, this.getList();
thirdSysFk: row.thirdSysFk, })
checkEnable: row.checkEnable, .catch(() => {
genUnit: row.genUnit, this.loading = false;
innerOrder: row.innerOrder, this.cancelDialog();
spUse: row.spUse, });
secCheckEnable: row.secCheckEnable, },
checkUdims: row.checkUdims,
checkPdaEd: row.checkPdaEd,
checkPdaUn: row.checkPdaUn,
checkPc: row.checkPc,
checkWebNew: row.checkWebNew,
checkChange: row.checkChange,
secCheckUdims: row.secCheckUdims,
secCheckPdaEd: row.secCheckPdaEd,
secCheckPdaUn: row.secCheckPdaUn,
secCheckPc: row.secCheckPc,
secCheckWebNew: row.secCheckWebNew,
secCheckChange: row.secCheckChange,
corpType: row.corpType + "",
storageCode: row.storageCode,
supplementOrderType: row.supplementOrderType,
};
this.modifyDialogVisible = true;
},
deleteDialog(rowId) { handleAddClick() {
this.$confirm("此操作将永久删除该扫码类型信息, 是否继续?", "提示", { this.inputQuery = {};
confirmButtonText: "确定", this.addDialogVisible = true;
cancelButtonText: "取消", },
type: "warning",
})
.then(() => {
this.deleteOrders(rowId);
})
.catch(() => {
});
},
deleteOrders(data) { handleModifyClick(row) {
this.loading = true; this.inputQuery = {
let tquery = { id: row.id,
id: data.id + "", remark: row.remark,
}; action: row.action,
name: row.name,
enable: row.enable,
mainAction: row.mainAction,
localAction: row.localAction,
thirdSysFk: row.thirdSysFk,
checkEnable: row.checkEnable,
genUnit: row.genUnit,
innerOrder: row.innerOrder,
spUse: row.spUse,
secCheckEnable: row.secCheckEnable,
checkUdims: row.checkUdims,
checkPdaEd: row.checkPdaEd,
checkPdaUn: row.checkPdaUn,
checkPc: row.checkPc,
checkWebNew: row.checkWebNew,
checkChange: row.checkChange,
secCheckUdims: row.secCheckUdims,
secCheckPdaEd: row.secCheckPdaEd,
secCheckPdaUn: row.secCheckPdaUn,
secCheckPc: row.secCheckPc,
secCheckWebNew: row.secCheckWebNew,
secCheckChange: row.secCheckChange,
corpType: row.corpType + "",
storageCode: row.storageCode,
supplementOrderType: row.supplementOrderType,
};
this.modifyDialogVisible = true;
},
deleteBussinessType(tquery) deleteDialog(rowId) {
.then((response) => { this.$confirm("此操作将永久删除该扫码类型信息, 是否继续?", "提示", {
this.getList(); confirmButtonText: "确定",
if (response.code == 20000) { cancelButtonText: "取消",
this.$message({ type: "warning",
type: "success", })
message: "删除成功!", .then(() => {
}); this.deleteOrders(rowId);
} else { })
this.$message.error(response.message); .catch(() => {
} });
},
deleteOrders(data) {
this.loading = true;
let tquery = {
id: data.id + "",
};
}) deleteBussinessType(tquery)
.catch(() => { .then((response) => {
}); this.getList();
if (response.code == 20000) {
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
},
init() {
axios.get("./config.json").then(res => {
//
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: {
modifyDialog,
},
mounted() {
}, },
init() { created() {
axios.get("./config.json").then(res => { this.init();
// this.getList();
let response = res.data.BASE_URL;
this.uploadFileUrl = response + "/udiwms/busstiness/file/upload";
});
}, },
},
components: {
modifyDialog,
},
mounted() {
},
created() {
this.init();
this.getList();
},
}; };
</script> </script>

@ -36,17 +36,17 @@
:action="uploadFileUrl" :action="uploadFileUrl"
multiple multiple
:limit="3" :limit="3"
:headers="headers"
:data="uploadData" :data="uploadData"
:show-file-list="false" :show-file-list="false"
:on-success="handleChange" :on-success="handleChange"
:file-list="fileList" :file-list="fileList"
> >
<el-button size="mini" type="primary">导入往来单位</el-button> <el-button size="mini" type="primary">导入往来单位</el-button>
</el-upload> </el-upload>
<!-- <el-button type="primary" icon="search" @click="jumpDl"--> <!-- <el-button type="primary" icon="search" @click="jumpDl"-->
<!-- v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1">模板下载--> <!-- v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1">模板下载-->
<!-- </el-button>--> <!-- </el-button>-->
<el-button type="primary" icon="search" @click="downloadCorps" <el-button type="primary" icon="search" @click="downloadCorps"
v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==3"> v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==3">
下载往来单位 下载往来单位
@ -151,297 +151,303 @@
</template> </template>
<script> <script>
import {filterLog, deleteLog} from "../../api/thrsys/thrCorpsImport"; import {filterLog, deleteLog} from "../../api/thrsys/thrCorpsImport";
import {getBasicThirdSys, filterDetailByKey} from "../../api/basic/basicThirdSys"; import {getBasicThirdSys, filterDetailByKey} from "../../api/basic/basicThirdSys";
import {downloadAll} from "../../api/thrsys/thrCorps"; import {downloadAll} from "../../api/thrsys/thrCorps";
import {selectIp} from "../../api/param/systemParamConfig"; import {selectIp} from "../../api/param/systemParamConfig";
import thrCorpsImportDetail from "./ThrCorpsImportDetail"; import thrCorpsImportDetail from "./ThrCorpsImportDetail";
import thrCorpSelect from "./ThrCorpSelect"; import thrCorpSelect from "./ThrCorpSelect";
import axios from "axios"; import axios from "axios";
import store from "@/store";
export default {
data() {
return {
filterQuery: {
genKey: null,
status: null,
fromType: null,
page: 1,
limit: 20,
thirdSysFk: null,
},
udiImportDetailVisible: false,
thrCorpSelectVisible: false,
checked: false,
list: [],
detailList: [],
thirdSys: [],
thirdSysDetail: null,
total: 0,
currentRow: null,
editQuery: null,
fromStatus: {
0: "产品信息",
1: "库存信息",
2: "异常第三方上传"
},
status: {
0: "等待处理",
1: "正在处理",
2: "处理异常",
3: "处理完成"
},
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
templateDlUrl: null,
};
},
methods: { export default {
onReset() { data() {
this.$router.push({ return {
path: "", filterQuery: {
}); genKey: null,
this.filterQuery = { status: null,
fromType: null, fromType: null,
genKey: null, page: 1,
status: null, limit: 20,
page: 1, thirdSysFk: null,
limit: 20,
thirdSysFk: null,
};
this.getList();
},
getList() {
this.loading = true;
filterLog(this.filterQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
downloadCorps() { udiImportDetailVisible: false,
this.selectType = 3; thrCorpSelectVisible: false,
this.thrCorpSelectVisible = true; checked: false,
list: [],
headers: {},
detailList: [],
thirdSys: [],
thirdSysDetail: null,
total: 0,
currentRow: null,
editQuery: null,
fromStatus: {
0: "产品信息",
1: "库存信息",
2: "异常第三方上传"
}, },
genInCode() { status: {
this.selectBasicUdiVisible = true; 0: "等待处理",
1: "正在处理",
2: "处理异常",
3: "处理完成"
}, },
sysChange() { uploadFileUrl: null,
this.getThirdSysDetail(); uploadData: {
// console.log( this.thirdSysDetail.thirdId+"\n"+ this.thirdSysDetail.fromType+"\n"+this.thirdSysDetail.enable); thirdSys: "thirdId",
}, },
templateDlUrl: null,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
fromType: null,
genKey: null,
status: null,
page: 1,
limit: 20,
thirdSysFk: null,
};
this.getList();
},
getList() {
this.loading = true;
filterLog(this.filterQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
downloadCorps() {
this.selectType = 3;
this.thrCorpSelectVisible = true;
},
genInCode() {
this.selectBasicUdiVisible = true;
},
sysChange() {
this.getThirdSysDetail();
// console.log( this.thirdSysDetail.thirdId+"\n"+ this.thirdSysDetail.fromType+"\n"+this.thirdSysDetail.enable);
},
handleDetailClick(row) { handleDetailClick(row) {
this.currentRow = row; this.currentRow = row;
console.log(this.currentRow.genKey) console.log(this.currentRow.genKey)
this.udiImportDetailVisible = true; this.udiImportDetailVisible = true;
}
,
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList();
} }
, }
cancelDialog(val) { ,
this.udiImportDetailVisible = false; handleCurrentChange(val) {
this.thrCorpSelectVisible = false; this.filterQuery.page = val;
if (val) { this.getList();
}
,
deleteDialog(rowId) {
this.$confirm("此操作将删除该往来单位信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: rowId,
};
deleteLog(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
} else {
this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
}
,
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSysFk = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getList(); this.getList();
} this.getThirdSysDetail();
} this.selectSysParam();
, })
handleCurrentChange(val) { .catch(() => {
this.filterQuery.page = val; this.loading = false;
this.list = [];
});
// axios.get("./config.json").then(res => {
// //
// let response = res.data.BASE_URL;
// this.uploadFileUrl = response + "/udiwms/thrOrder/importLog/upload";
// console.log(res.data.BASE_URL + "\n" + res.data.BASE_URL2);
//
// });
}
,
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
axios.get("./config.json").then(res => {
//
let response = res.data.BASE_URL;
this.uploadFileUrl = response + "/udiwms/thrCorp/importLog/uploadCorps";
});
}
,
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
this.getList();
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList(); this.getList();
} }
, }
deleteDialog(rowId) { ,
this.$confirm("此操作将删除该往来单位信息, 是否继续?", "提示", { statusFilterType(status) {
confirmButtonText: "确定", const statusMap = {
cancelButtonText: "取消", 0: "warning",
type: "warning", 1: "warning",
2: "danger",
3: "success",
};
return statusMap[status];
}
,
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "corpUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
}) })
.then(() => { .catch(() => {
let dQuery = { this.loading = false;
id: rowId, this.list = [];
}; });
deleteLog(dQuery) this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
.then((response) => { axios.get("./config.json").then(res => {
this.loading = false; let response = res.data.SERVER_IP;
if (response.code == 20000) { this.templateDlUrl = response + "/第三方往来单位信息导入模板.xlsx";
this.$message.success("删除成功"); });
} else {
this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
}
,
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSysFk = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getList();
this.getThirdSysDetail();
this.selectSysParam();
})
.catch(() => {
this.loading = false;
this.list = [];
});
// axios.get("./config.json").then(res => {
// //
// let response = res.data.BASE_URL;
// this.uploadFileUrl = response + "/udiwms/thrOrder/importLog/upload";
// console.log(res.data.BASE_URL + "\n" + res.data.BASE_URL2);
//
// });
} }
, ,
selectSysParam() { jumpDl() {
window.open(this.templateDlUrl, '_blank');
}
,
downloadDatas() {
this.$confirm("此操作从第三方系统下载全部往来单位信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let query = { let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk thirdSysFk: this.filterQuery.thirdSysFk
}; };
axios.get("./config.json").then(res => { downloadAll(query).then((response) => {
//
let response = res.data.BASE_URL;
this.uploadFileUrl = response + "/udiwms/thrCorp/importLog/uploadCorps";
});
}
,
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
this.getList();
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList();
}
}
,
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "warning",
2: "danger",
3: "success",
};
return statusMap[status];
}
,
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "corpUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
axios.get("./config.json").then(res => {
let response = res.data.SERVER_IP;
this.templateDlUrl = response + "/第三方往来单位信息导入模板.xlsx";
});
}
,
jumpDl() {
window.open(this.templateDlUrl, '_blank');
}
,
downloadDatas() {
this.$confirm("此操作从第三方系统下载全部往来单位信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk
};
downloadAll(query).then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.$message.success(response.data); this.$message.success(response.data);
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
}
this.getList();
});
});
}
,
formatterThirdSys(key) {
let data = null;
this.thirdSys.forEach((item, index) => {
if (key.thirdSysFk == item.thirdId) {
data = item.thirdName;
} }
this.getList();
}); });
return data; });
} }
, ,
}, formatterThirdSys(key) {
let data = null;
this.thirdSys.forEach((item, index) => {
if (key.thirdSysFk == item.thirdId) {
data = item.thirdName;
}
});
return data;
}
,
},
mounted() { mounted() {
}, },
components: {thrCorpsImportDetail, thrCorpSelect}, components: {thrCorpsImportDetail, thrCorpSelect},
created() { created() {
this.getBasicThirdSys(); this.headers = {
// this.getList(); ADMIN_ID: store.getters.adminId,
}, ADMIN_TOKEN: store.getters.token,
}; };
this.getBasicThirdSys();
// this.getList();
},
};
</script> </script>
<style> <style>
.itemTag { .itemTag {
float: left; float: left;
text-align: left; text-align: left;
margin-top: 10px; margin-top: 10px;
width: 100px; width: 100px;
} }
.text { .text {
font-size: 13px; font-size: 13px;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
} }
.el-row { .el-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.el-col { .el-col {
border-radius: 4px; border-radius: 4px;
flex-wrap: wrap; flex-wrap: wrap;
} }
</style> </style>

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

Loading…
Cancel
Save