1.修改第三方系统,业务单据提交绑定交互方式

2.第三方系统设置页面增加测试连通性按钮
master
x_z 3 years ago
parent 409bde8023
commit a61deaecf0

@ -76,6 +76,21 @@ export function deleteThirdSysBusType(params) {
}) })
} }
export function enableInterfaces(data) {
return axios({
url: "/udiwms/basic/thirdsys/enableInterfaces",
method: "post",
data: data
})
}
export function testThirdService(data) {
return axios({
url: "/udiwms/basic/thirdsys/testThirdService",
method: "post",
data: data
})
}

@ -55,6 +55,13 @@
>编辑 >编辑
</el-button </el-button
> >
<el-button
type="text"
size="small"
@click.native.stop="handleAddInterface(scope.row)"
>添加接口
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -66,7 +73,6 @@
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="modifyDialogVisible" :visible.sync="modifyDialogVisible"
width="70%" width="70%"
v-if="modifyDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
@ -155,18 +161,10 @@
<el-table v-loading="busTypeLoading" :data="busTypeList" style="width: 100%"> <el-table v-loading="busTypeLoading" :data="busTypeList" style="width: 100%">
<el-table-column label="序号" type="index" show-overflow-tooltip="true"></el-table-column> <el-table-column label="序号" type="index" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="单据类型" prop="name" show-overflow-tooltip="true"></el-table-column> <el-table-column label="单据类型" prop="name" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="单据类型代码" prop="code"></el-table-column>
<el-table-column v-if="addBussinessTypeBtnVisible" label="第三方单据类型" prop="thirdBuyName"></el-table-column> <el-table-column v-if="addBussinessTypeBtnVisible" label="第三方单据类型" prop="thirdBuyName"></el-table-column>
<el-table-column v-if="addBussinessTypeBtnVisible" label="第三方单据类型" prop="thirdBuyCode"></el-table-column> <el-table-column label="接口地址" prop="url" width="400" show-overflow-tooltip></el-table-column>
<el-table-column label="接口地址" prop="url" width="400" show-overflow-tooltip>
<template slot-scope="scope">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.url"
placeholder="请输入"></el-input>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" show-overflow-tooltip></el-table-column> <el-table-column label="备注" prop="remark" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200" prop="price" fixed="right"> <el-table-column label="操作" width="200" prop="price" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -175,19 +173,6 @@
@click="handleEdit(scope.$index, scope.row)" @click="handleEdit(scope.$index, scope.row)"
>编辑 >编辑
</el-button> </el-button>
<el-button
v-if="addBussinessTypeBtnVisible"
type="text"
size="small"
@click="bindThirdBuyType(scope.$index, scope.row)"
>绑定
</el-button>
<el-button
type="text"
size="small"
@click="handleSave(scope.$index, scope.row)"
>保存
</el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -206,23 +191,77 @@
<!--添加单据类型弹窗--> <!--添加单据类型弹窗-->
<el-dialog <el-dialog
title="单据类型" :title="formMap[formName]"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="bussinessTypeFormVisible" :visible.sync="bussinessTypeFormVisible"
style="width: 80%" style="width: 100%"
> >
<el-table v-loading="loading" :data="bussinessTypeList" ref="typeList" <div>
@selection-change="handleBussinessTypeSelectionChange" <el-row :gutter="20" class="el-row" type="flex">
style="width: 100%"> <el-col :span="10" class="el-col">
<el-table-column <div class="text item">
type="selection" <div class="itemTag">
:reserve-selection="false" <span>单据类型:&nbsp;</span>
width="55"> </div>
</el-table-column> <el-select style="width: 350px;" v-model="thirdBuyForm.name" placeholder="单据类型">
<el-table-column label="单据类型编码" prop="action" fixed></el-table-column> <el-option
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column> v-for="item in bussinessTypeList"
</el-table> :key="item.action"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>第三方单据类型:&nbsp;</span>
</div>
<el-select style="width: 350px;" v-model="thirdBuyForm.thirdBuyName" placeholder="第三方单据类型">
<el-option
v-for="item in thirdBuyList"
:key="item.name"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>接口地址:&nbsp;</span>
</div>
<el-input
style="width: 350px"
size="small"
splaceholder="请输入内容"
v-model="thirdBuyForm.url"
></el-input>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="itemTag">
<span>备注:&nbsp;</span>
</div>
<el-input
style="width: 350px"
size="small"
splaceholder="请输入内容"
v-model="thirdBuyForm.remark"
></el-input>
</div>
</el-col>
</el-row>
</div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible" <el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible"
@ -232,38 +271,36 @@
<el-button <el-button
type="primary" type="primary"
@click.native="addBussinessTypeData()" @click.native="addBussinessTypeData()"
>提交 >保存
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--绑定第三方单据类型弹窗-->
<el-dialog <el-dialog
title="第三方系统单据类型" title="添加接口"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="bindBuyTypeFormVisible" :visible.sync="addInterfaceVisible"
style="width: 80%" style="width: 100%"
> >
<el-table v-loading="loading" :data="thirdBuyList" ref="typeList" <el-table :data="thirdSysDetailList" style="width: 100%;" @selection-change="selectedInterface">
@selection-change="handleBussinessTypeSelectionChange" <el-table-column type="selection" :reserve-selection="false" width="55"></el-table-column>
style="width: 100%"> <el-table-column prop="name" label="接口名称"></el-table-column>
<el-table-column label="单据类型编码" prop="code" fixed></el-table-column> <el-table-column prop="value" label="接口地址"></el-table-column>
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column>
<el-table-column label="操作" width="200" prop="price" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="bindThirdBuyTypeData(scope.$index, scope.row)"
>绑定
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div slot="footer" class="dialog-footer">
<el-button @click.native="addInterfaceVisible = !addInterfaceVisible"
>取消
</el-button
>
<el-button
type="primary"
@click.native="addInterfaceData()"
>提交
</el-button>
</div>
</el-dialog> </el-dialog>
</div> </div>
@ -274,7 +311,7 @@
import { import {
getBasicThirdSys, getBasicThirdSys,
updateBasicThirdSys, getDetailBasicThirdSys, updateDetailBasicThirdSys, filterBusTypeDetail, saveBusTypeDetail, updateBasicThirdSys, getDetailBasicThirdSys, updateDetailBasicThirdSys, filterBusTypeDetail, saveBusTypeDetail,
saveBusTypes, deleteThirdSysBusType saveBusTypes, deleteThirdSysBusType, enableInterfaces
} from "../../api/basic/basicThirdSys"; } from "../../api/basic/basicThirdSys";
import modifyDialog from "./BasicThirdSysModify"; import modifyDialog from "./BasicThirdSysModify";
@ -308,6 +345,11 @@ export default {
2: "第三方上传缓存", 2: "第三方上传缓存",
3: "接口本地缓存" 3: "接口本地缓存"
}, },
formMap: {
edit: "编辑",
add: "单据类型"
},
formName: null,
detailList: null, detailList: null,
busTypeList: [], busTypeList: [],
total: 0, total: 0,
@ -317,12 +359,24 @@ export default {
bussinessTypeFormVisible: false, bussinessTypeFormVisible: false,
bussinessTypeList: [], bussinessTypeList: [],
addBussinessTypeBtnVisible: false, addBussinessTypeBtnVisible: false,
addInterfaceVisible: false,
selectBussinessTypeList: [], selectBussinessTypeList: [],
thirdSysFk: null, thirdSysFk: null,
submitOrderRow: null, submitOrderRow: null,
thirdBuyForm: {
id: null,
thirdBuyName: null,
thirdBuyCode: null,
name: null,
code: null,
type: null,
thirdSys: null,
url: null,
remark: null
},
thirdBuyList: [], //, thirdBuyList: [], //,
bindBuyTypeFormVisible: false, thirdSysDetailList: [],
submitTypeRowId: null //ID selectInterfaceList: []
}; };
}, },
@ -346,6 +400,9 @@ export default {
this.modifyBusYypeDialogVisible = false; this.modifyBusYypeDialogVisible = false;
}, },
handleCurrentChange(row) { handleCurrentChange(row) {
if (row != null) {
this.thirdSysFk = row.thirdId;
}
this.getDetailList(row); this.getDetailList(row);
}, },
handleBustypeChange(row) { handleBustypeChange(row) {
@ -356,7 +413,7 @@ export default {
} else { } else {
this.addBussinessTypeBtnVisible = false; this.addBussinessTypeBtnVisible = false;
} }
this.thirdSysFk = row.thirdSysFk; this.thirdSysFk = this.thirdSysFk;
}, },
getList() { getList() {
this.loading = true; this.loading = true;
@ -373,11 +430,10 @@ export default {
this.total = 0; this.total = 0;
}); });
}, },
getDetailList() {
getDetailList(row) {
let query = { let query = {
thirdSysFk: row.thirdId thirdSysFk: this.thirdSysFk,
enabled: true
}; };
this.loading = true; this.loading = true;
getDetailBasicThirdSys(query) getDetailBasicThirdSys(query)
@ -392,10 +448,9 @@ export default {
this.total = 0; this.total = 0;
}); });
}, },
getBustyList(row) { getBustyList(row) {
let query = { let query = {
thirdSysFk: row.thirdSysFk, thirdSysFk: this.thirdSysFk,
type: 0, type: 0,
}; };
if (row.key == "orderQueryUrl") { if (row.key == "orderQueryUrl") {
@ -418,17 +473,16 @@ export default {
}); });
}, },
onModifySubmit() { onModifySubmit() {
this.modifyDialogVisible = false;
updateBasicThirdSys(this.inputQuery) updateBasicThirdSys(this.inputQuery)
.then((response) => { .then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.loading = false; this.loading = false;
this.cancelDialog();
this.getList(); this.getList();
this.$message.success(response.data); this.$message.success(response.data);
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
@ -440,13 +494,13 @@ export default {
.then((response) => { .then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.loading = false; this.loading = false;
this.cancelDialog(); this.modifyDetailDialogVisible = false;
this.getList(); this.handleCurrentChange();
// this.getList();
this.$message.success(response.data); this.$message.success(response.data);
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
@ -463,6 +517,20 @@ export default {
}, },
handleEdit(index, row) { handleEdit(index, row) {
this.currentCheckIndex = index; this.currentCheckIndex = index;
this.formName = "edit";
this.getBussinessType();
this.getThirdBuyType();
this.bussinessTypeFormVisible = true;
this.thirdBuyForm = {
id: row.id,
code: row.code,
name: row.name,
thirdBuyCode: row.thirdBuyCode,
thirdBuyName: row.thirdBuyName,
type: row.type,
thirdSys: row.thirdSys,
remark: row.remark
};
}, },
handleSave(index, row) { handleSave(index, row) {
this.currentCheckIndex = -1; this.currentCheckIndex = -1;
@ -474,37 +542,52 @@ export default {
}, },
addBussinessType() { addBussinessType() {
this.bussinessTypeFormVisible = true; this.bussinessTypeFormVisible = true;
this.formName = "add";
this.getBussinessType();
this.getThirdBuyType();
this.thirdBuyForm = {
id: null,
code: null,
name: null,
thirdBuyCode: null,
thirdBuyName: null,
type: null,
thirdSys: null,
remark: null
};
},
getBussinessType() {
filterForThirdSys().then((res) => { filterForThirdSys().then((res) => {
this.bussinessTypeList = res.data; this.bussinessTypeList = res.data;
}) })
}, },
addBussinessTypeData() { addBussinessTypeData() {
if (this.selectBussinessTypeList.length == 0) { this.bussinessTypeFormVisible = false;
this.$message.error("请选择单据类型") //
} else { if (this.formName == "add") {
this.bussinessTypeFormVisible = false; this.thirdBuyForm.type = 2;
let data = []; this.thirdBuyForm.thirdSys = this.thirdSysFk;
this.selectBussinessTypeList.forEach((row) => {
let item = {
code: row.action,
name: row.name,
type: 2,
thirdSys: this.thirdSysFk
}
data.push(item);
});
saveBusTypes(data).then((res) => {
this.handleBustypeChange(this.submitOrderRow);
}).catch((error) => {
this.$message.error(error.message);
})
} }
},
handleBussinessTypeSelectionChange(row) { //
let _this = this; this.bussinessTypeList.forEach(item =>{
_this.selectBussinessTypeList = []; //
row.forEach((item) => { if (item.name === this.thirdBuyForm.name) {
_this.selectBussinessTypeList.push(item); this.thirdBuyForm.code = item.action;
}
});
this.thirdBuyList.forEach(item => {
//
if (item.name === this.thirdBuyForm.thirdBuyName) {
this.thirdBuyForm.thirdBuyCode = item.code;
}
});
saveBusTypes(this.thirdBuyForm).then((res) => {
this.handleBustypeChange(this.submitOrderRow);
}).catch((error) => {
this.$message.error(error.message);
}) })
}, },
handleDelete(index, row) { handleDelete(index, row) {
@ -515,34 +598,63 @@ export default {
this.$message.error(error.message); this.$message.error(error.message);
}) })
}, },
bindThirdBuyType(index,row) { getThirdBuyType() {
this.bindBuyTypeFormVisible = true;
let query = { let query = {
thirdSysFk: row.thirdSysFk, thirdSysFk: this.thirdSysFk,
type: 1, type: 1,
} }
this.submitTypeRowId = row.id;
//
filterBusTypeDetail(query).then((res)=> { filterBusTypeDetail(query).then((res)=> {
this.thirdBuyList = res.data.list; this.thirdBuyList = res.data.list;
}); });
}, },
bindThirdBuyTypeData(index, row){ handleAddInterface(row) {
let params = { this.addInterfaceVisible = true;
"id": this.submitTypeRowId, if (this.thirdSysFk == null) {
"thirdBuyName": row.name, this.thirdSysFk = row.thirdId;
"thirdBuyCode": row.code }
let query = {
thirdSysFk: row.thirdId,
enabled: false
}; };
saveBusTypeDetail(params).then((res) => { getDetailBasicThirdSys(query)
if (res.code == 20000) { .then((response) => {
this.$message.success("绑定成功"); this.thirdSysDetailList = response.data.list;
this.bindBuyTypeFormVisible = false; })
this.handleBustypeChange(this.submitOrderRow); .catch(() => {
} else { });
this.$message.error("绑定失败"); },
selectedInterface(rows) {
let _this = this;
_this.selectInterfaceList = [];
rows.forEach(row => {
_this.selectInterfaceList.push(row.id);
});
},
addInterfaceData(){
this.addInterfaceVisible = false;
enableInterfaces(this.selectInterfaceList).then((res) => {
if (res.code === 20000) {
this.selectInterfaceList = [];
this.$message.success("添加成功");
let query = {
thirdSysFk: this.thirdSysFk,
enabled: true
};
this.loading = true;
getDetailBasicThirdSys(query)
.then((response) => {
this.loading = false;
this.detailList = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
} }
}).catch((error) => { }).catch((error) => {
this.$message.error(error.message); this.$message.error("添加失败");
}) })
} }
}, },
@ -563,5 +675,16 @@ export default {
/*transition: all .5s;*/ /*transition: all .5s;*/
} }
.el-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 20px;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style> </style>

@ -62,11 +62,12 @@
</div> </div>
<el-input <el-input
style="width: 80%" style="width: 70%"
size="mini" size="mini"
splaceholder="请输入内容" splaceholder="请输入内容"
v-model="inputQuery.thridUrl" v-model="inputQuery.thridUrl"
></el-input> ></el-input>
<el-button style="margin-left: 5px;" type="primary" @click="testThirdService"></el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -78,7 +79,7 @@
</div> </div>
<el-input <el-input
style="width: 80%" style="width: 70%"
size="mini" size="mini"
splaceholder="请输入内容" splaceholder="请输入内容"
v-model="inputQuery.thirdSysUrl" v-model="inputQuery.thirdSysUrl"
@ -159,6 +160,8 @@
</template> </template>
<script> <script>
import {testThirdService} from "../../api/basic/basicThirdSys";
export default { export default {
name: "inputQuery", name: "inputQuery",
props: { props: {
@ -167,6 +170,15 @@
required: true, required: true,
}, },
}, },
methods: {
testThirdService (){
testThirdService(this.inputQuery).then((res) => {
if (res.code === 20000) {
this.$message.success("连接成功");
}
});
}
}
}; };
</script> </script>
<style scoped> <style scoped>

Loading…
Cancel
Save