'123'
This commit is contained in:
parent
c30010c017
commit
840c62fd3d
|
@ -1,5 +1,5 @@
|
|||
#for tests only !
|
||||
#Wed May 15 15:21:44 CST 2024
|
||||
#Fri May 17 13:23:58 CST 2024
|
||||
jco.destination.pool_capacity=10
|
||||
jco.client.lang=ZH
|
||||
jco.client.ashost=172.19.0.120
|
||||
|
|
|
@ -60,6 +60,20 @@ public class SapRfcController
|
|||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 获取SAP 客户数据
|
||||
* @param rfcResult
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listCustomer")
|
||||
public AjaxResult listCustomer(RfcResult rfcResult)
|
||||
{
|
||||
List<RfcResult> res = SapRfcUtils.listCustomer(rfcResult);
|
||||
return AjaxResult.success(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取SAP 国家数据
|
||||
* @param customer
|
||||
|
|
|
@ -11,6 +11,39 @@ import java.util.List;
|
|||
|
||||
public class SapRfcUtils {
|
||||
|
||||
/**
|
||||
* 获取SAP 国家数据
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public static List<RfcResult> listCustomer(RfcResult param) {
|
||||
JCoFunction function = null;
|
||||
RfcResult rfcResult = null;
|
||||
List<RfcResult> rfcResults = new ArrayList<>();
|
||||
|
||||
JCoDestination destination = ConnectToSAP.connect();
|
||||
try {
|
||||
function = destination.getRepository().getFunctionTemplate("ZOA03_SEND_COM").getFunction();
|
||||
if (function == null)
|
||||
throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP.");
|
||||
JCoParameterList input = function.getImportParameterList();
|
||||
input.getStructure("KH").setValue("KUNNR",param.getValue());
|
||||
input.getStructure("KH").setValue("NAME1",param.getLabel());
|
||||
function.execute(destination);
|
||||
JCoTable table = function.getTableParameterList().getTable("OUTKH");
|
||||
for(int i = 0; i<table.getNumRows(); i++){
|
||||
table.setRow(i);
|
||||
rfcResult = new RfcResult();
|
||||
rfcResult.setValue(table.getString("KUNNR"));
|
||||
rfcResult.setLabel(table.getString("NAME1"));
|
||||
rfcResults.add(rfcResult);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return rfcResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取SAP国家数据
|
||||
* @param param 不传查询全部
|
||||
|
@ -439,4 +472,32 @@ public class SapRfcUtils {
|
|||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
JCoFunction function = null;
|
||||
RfcResult rfcResult = null;
|
||||
List<RfcResult> countrys = new ArrayList<>();
|
||||
|
||||
JCoDestination destination = ConnectToSAP.connect();
|
||||
try {
|
||||
function = destination.getRepository().getFunctionTemplate("ZOA03_SEND_COM").getFunction();
|
||||
if (function == null)
|
||||
throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP.");
|
||||
JCoParameterList input = function.getImportParameterList();
|
||||
input.getStructure("KH").setValue("NAME1","无锡");
|
||||
function.execute(destination);
|
||||
JCoTable table = function.getTableParameterList().getTable("OUTKH");
|
||||
for(int i = 0; i<table.getNumRows(); i++){
|
||||
table.setRow(i);
|
||||
rfcResult = new RfcResult();
|
||||
rfcResult.setValue(table.getString("KUNNR"));
|
||||
rfcResult.setLabel(table.getString("NAME1"));
|
||||
countrys.add(rfcResult);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(countrys.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询SAP 客户数据
|
||||
export function listCustomer(query) {
|
||||
return request({
|
||||
url: '/rfc/rfc/listCustomer',
|
||||
method: 'get',
|
||||
params: {'value':query.Code,'label':query.Name}
|
||||
})
|
||||
}
|
||||
|
||||
// 查询SAP 国家数据
|
||||
export function getCountrys(query) {
|
||||
return request({
|
||||
|
|
|
@ -0,0 +1,150 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="客户选择"
|
||||
:visible.sync="open"
|
||||
:width="width || '900px'"
|
||||
:height="height || '650px'"
|
||||
:show-close="false" append-to-body>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
|
||||
<el-form-item label="公司编码" prop="Code">
|
||||
<el-input
|
||||
v-model="queryParams.Code"
|
||||
placeholder="请输入公司编码"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司名称" prop="Name">
|
||||
<el-input
|
||||
v-model="queryParams.Name"
|
||||
placeholder="请输入公司名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" ref="table" :data="pagedData" @selection-change="handleSelectionChange" height="300">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="公司编码" align="center" prop="value" />
|
||||
<el-table-column label="公司名称" align="center" prop="label" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="currentPage"
|
||||
:limit.sync="pageSize"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirm" :disabled="single">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCustomer } from "@/api/common/sapRfc";// sap-rfc 函数
|
||||
|
||||
export default {
|
||||
name: "CustomerSelect",
|
||||
props: {
|
||||
width: {
|
||||
type: String,
|
||||
default: "900px",
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '650px'
|
||||
},
|
||||
open: {
|
||||
type: Boolean,
|
||||
default:false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
Code: null,
|
||||
Name: null
|
||||
},
|
||||
// 总条数
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
customerList: [],
|
||||
|
||||
//已选择的客户信息
|
||||
checkedCustomer: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 切换每页显示条数 */
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.currentPage = 1;
|
||||
},
|
||||
/** 页码选择 */
|
||||
handleCurrentChange(val) {
|
||||
this.currentPage = val;
|
||||
},
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCustomer(this.queryParams).then(response => {
|
||||
this.customerList = response.data;
|
||||
this.total = response.data.length;
|
||||
this.currentPage = 1;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
if(this.queryParams.Code || this.queryParams.Name){
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
}else{
|
||||
this.$message.warning("请输入查询条件!");
|
||||
return;
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.checkedCustomer = selection[0];
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.$emit('cancel');
|
||||
},
|
||||
// 确定按钮
|
||||
confirm() {
|
||||
this.customerList = [];
|
||||
this.total = 0;
|
||||
this.resetForm("queryForm");
|
||||
this.$emit("submit", this.checkedCustomer); //返回username和nickname
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
// 分页后的数据
|
||||
pagedData() {
|
||||
const startIndex = (this.currentPage - 1) * this.pageSize;
|
||||
const endIndex = startIndex + this.pageSize;
|
||||
return this.customerList.slice(startIndex, endIndex);
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -6,7 +6,8 @@
|
|||
:width="width || '900px'"
|
||||
:height="height || '650px'"
|
||||
:before-close="handleClose"
|
||||
append-to-body>
|
||||
append-to-body
|
||||
class="customer-dialog">
|
||||
|
||||
<div class="selectBox">
|
||||
<div class="bottomBox" v-show="showSearch">
|
||||
|
@ -141,8 +142,6 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
|
@ -151,14 +150,15 @@
|
|||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<style>
|
||||
/** 弹出框设置 */
|
||||
.customer-dialog .el-dialog__body {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
|
||||
|
||||
import { listUser, getUser, deptTreeSelect } from "@/api/system/user";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
|
||||
export default {
|
||||
|
@ -188,9 +188,7 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
loading: false,
|
||||
|
||||
// open: false,
|
||||
activeName: 'first',
|
||||
defaultProps: {
|
||||
|
@ -219,10 +217,8 @@
|
|||
|
||||
//已选择的用户信息
|
||||
checkedUsers: [],
|
||||
|
||||
// userNodeAll: false,
|
||||
// cancelUserNodeAll: false,
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -247,11 +243,9 @@
|
|||
console.log(tab, event);
|
||||
},
|
||||
|
||||
|
||||
//获取选中的人员昵称列表
|
||||
getNickNameList(uns) {
|
||||
let result = [];
|
||||
|
||||
uns.forEach(item => {
|
||||
if(this.allUserMap.has(item)) {
|
||||
var json = {};
|
||||
|
@ -377,17 +371,14 @@
|
|||
this.updateCheckedUsers();
|
||||
},
|
||||
|
||||
|
||||
clearAll() {
|
||||
this.checkedUsers = [];
|
||||
this.updateCheckedUsers();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.selectBox {
|
||||
width:100%;
|
||||
min-width: 900px;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</el-row>
|
||||
</div>
|
||||
|
||||
<PeopleSelect ref="peopleSelect" :type="'multiple'" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen=false" @submit="submitPeople"></PeopleSelect>
|
||||
<PeopleSelect ref="peopleSelect" :type="'multiple'" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen=false" @submit="submitPeople"></PeopleSelect>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
<el-form-item label="客户" prop="quotCustomerName">
|
||||
<el-input v-model="form.quotCustomerBm" v-if="false"/>
|
||||
<el-input v-model="form.quotCustomerName" placeholder="请输入客户" :disabled="true">
|
||||
<div v-hasPermi="['quot:quot:add']"><el-button icon="el-icon-search" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null"></el-button></div>
|
||||
<el-button slot="append" icon="el-icon-search" @click="openCustomer" v-if="this.form.quotApprovalStatus == '0' || this.form.quotApprovalStatus == null"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -681,6 +681,8 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<CustomerSelect ref="customerSelect" :open="customerOpen" @submit="submitCustomer" @cancel="customerOpen=false"></CustomerSelect>
|
||||
|
||||
<!-- 技术确认单详情对话框 -->
|
||||
<jsqrDialog ref="jsqrDialog"></jsqrDialog>
|
||||
|
||||
|
@ -723,15 +725,18 @@ import { getToken } from "@/utils/auth";
|
|||
import { checkPermi } from '@/utils/permission';// 权限判断函数
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
|
||||
// 导入技术确认单详情组件
|
||||
/** 导入客户选择组件 */
|
||||
import CustomerSelect from "@/views/components/Tools/CustomerSelect/index.vue";
|
||||
/** 导入技术确认单详情组件*/
|
||||
import jsqrDialog from '@/views/technicalConfirm/technicalConfirm/jsxzInfo.vue';
|
||||
// 导入核价单详情组件
|
||||
/** 导入核价单详情组件*/
|
||||
import hjDialog from '@/views/priceVerification/priceVerification/hjInfo.vue';
|
||||
|
||||
export default {
|
||||
name: "Quot",
|
||||
components: {
|
||||
// 注册组件
|
||||
'CustomerSelect': CustomerSelect,
|
||||
'jsqrDialog': jsqrDialog,
|
||||
'hjDialog': hjDialog
|
||||
},
|
||||
|
@ -775,6 +780,10 @@ export default {
|
|||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
|
||||
//是否打开客户选择组件,默认不打开
|
||||
customerOpen:false,
|
||||
|
||||
// 反馈附件显示弹窗
|
||||
addFileOpen: false,
|
||||
// 反馈附件显示弹窗标题
|
||||
|
@ -834,6 +843,17 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//打开客户选择弹窗
|
||||
openCustomer(){
|
||||
this.customerOpen=true;
|
||||
},
|
||||
//客户选择确定按钮事件
|
||||
submitCustomer(customer){
|
||||
this.form.quotCustomerBm = customer.value;
|
||||
this.form.quotCustomerName = customer.label;
|
||||
this.customerOpen=false;
|
||||
},
|
||||
|
||||
/** 清空表单 */
|
||||
reset(){
|
||||
this.form = {
|
||||
|
|
Loading…
Reference in New Issue