中煤报价界面

This commit is contained in:
JIAL 2024-01-17 16:51:06 +08:00
parent 188efaf733
commit 4f94015889
8 changed files with 281 additions and 3 deletions

View File

@ -1,10 +1,9 @@
package com.JN.utils; package com.JN.utils;
import org.apache.http.Header; import org.apache.http.*;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException; import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
@ -15,6 +14,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
@ -26,6 +26,8 @@ import java.net.URLEncoder;
import java.security.KeyManagementException; import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -87,6 +89,57 @@ public class HttpHelper {
return null; return null;
} }
/**
* @title httpPost
* @description 支持传入自己的head头的post请求
* @author JIAL
* @param: url
* @param: params
* @param: headers
* @updateTime 2024/1/17 10:34
* @return: java.lang.String
*/
public static String httpPost(String url, Map<String, String> params, Map<String, String> headers) throws Exception {
HttpPost post = new HttpPost(url);
// Add custom headers
if (headers != null && !headers.isEmpty()) {
for (Map.Entry<String, String> entry : headers.entrySet()) {
post.addHeader(entry.getKey(), entry.getValue());
}
}
// Set request body if params is not null
if (params != null && !params.isEmpty()) {
List<NameValuePair> formParams = new ArrayList<>();
for (Map.Entry<String, String> entry : params.entrySet()) {
formParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(formParams, Consts.UTF_8);
post.setEntity(urlEncodedFormEntity);
}
HttpResponse httpresponse = null;
CloseableHttpClient httpClient = null;
try {
httpClient = declareHttpClientSSL(url);
httpresponse = httpClient.execute(post);
HttpEntity httpEntity = httpresponse.getEntity();
String result = EntityUtils.toString(httpEntity, REQ_ENCODEING_UTF8);
return result;
} catch (ClientProtocolException e) {
System.out.println(String.format("http请求失败uri{%s},exception{%s}", new Object[] { url, e }));
} catch (IOException e) {
System.out.println(String.format("IO Exceptionuri{%s},exception{%s}", new Object[] { url, e }));
} finally {
if (null != httpClient)
httpClient.close();
}
return null;
}
private static CloseableHttpClient declareHttpClientSSL(String url) { private static CloseableHttpClient declareHttpClientSSL(String url) {
if (url.startsWith("https://")) { if (url.startsWith("https://")) {
return sslClient(); return sslClient();

View File

@ -0,0 +1,12 @@
.container {
display: flex;
height: 100vh;
}
.center-container {
text-align: center;
margin: auto;
width: 80%;
height: 100vh;
}

View File

@ -71,6 +71,7 @@
<script src="/plugins/calendar/calendar.js"></script> <script src="/plugins/calendar/calendar.js"></script>
<script src="/plugins/axios/axios.min.js"></script> <script src="/plugins/axios/axios.min.js"></script>
<script src="/plugins/axios/request.js"></script> <script src="/plugins/axios/request.js"></script>
<!-- import Script -->
<script src="/static/bizquery/js/index.js"></script> <script src="/static/bizquery/js/index.js"></script>
<script> <script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>客户付款方式</title>
<meta name="author" content="JIAL">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="HandheldFriendly" content="true">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<link rel="icon" href="/static/image/JNlogo.png" type="image/x-icon">
<link rel="stylesheet" href="/plugins/element-ui/index.css">
<!-- import CSS -->
<link rel="stylesheet" href="/static/paymethod/css/index.css">
</head>
<body>
<div class="container" id="index-app">
</div>
<script src="/plugins/vue/vue.js"></script>
<script src="/plugins/element-ui/index.js"></script>
<script src="/plugins/calendar/calendar.js"></script>
<script src="/plugins/axios/axios.min.js"></script>
<script src="/plugins/axios/request.js"></script>
<!-- import Script -->
<script src="/static/paymethod/js/index.js"></script>
<script>
new Vue({
el: '#index-app',
data() {
return {
}
},
computed: {
},
created() {
},
mounted() {
},
methods: {
async init () {
},
}
})
</script>
</body>
</html>

View File

@ -0,0 +1,158 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>报价</title>
<meta name="author" content="JIAL">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="HandheldFriendly" content="true">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<link rel="icon" href="/static/image/JNlogo.png" type="image/x-icon">
<link rel="stylesheet" href="/plugins/element-ui/index.css">
<!-- import CSS -->
<link rel="stylesheet" href="/static/zmquotation/css/index.css">
</head>
<body>
<div class="container" id="index-app">
<div class="center-container">
<div class="form-box">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-row>
<el-col :span="8">
<el-form-item label="审批人">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审批人">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审批人">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="物料编码">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="省">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="市区">
<el-input v-model="formInline.user" placeholder="审批人"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="table-box">
<el-table
:data="tableData"
border
row-height="20px">
<el-table-column
fixed
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="180"
prop="name1"
label="客户名称">
</el-table-column>
<el-table-column
width="180"
label="操作">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text">查看</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<script src="/plugins/vue/vue.js"></script>
<script src="/plugins/element-ui/index.js"></script>
<script src="/plugins/calendar/calendar.js"></script>
<script src="/plugins/axios/axios.min.js"></script>
<script src="/plugins/axios/request.js"></script>
<!-- import Script -->
<script src="/static/zmquotation/js/index.js"></script>
<script>
new Vue({
el: '#index-app',
data() {
return {
formInline: {
user: '',
region: ''
}
}
},
computed: {
},
created() {
},
mounted() {
},
methods: {
async init () {
},
}
})
</script>
</body>
</html>