getjyHwList.html
5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('下拉框')"/>
<th:block th:include="include :: select2-css"/>
<th:block th:include="include :: bootstrap-select-css"/>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-menu-add" th:object="${piccErrOrder}">
<input id="ent_name" name="ent_name" type="hidden"/>
<input id="ent_code" name="ent_code" type="hidden"/>
<input id="id" name="id" type="hidden" th:field="*{id}"/>
<div class="form-group" id="countryDiv">
<label class="col-sm-3 control-label"><span style="color: red; ">*</span>国别:</label>
<div class="col-sm-8">
<select id="country" class="form-control m-b" required>
<option th:each="item:${countryList}" th:value="${item.jcCode}" th:text="${item.gj}" th:field="*{country}"></option>
</select>
</div>
</div>
<!-- <div class="form-group" id="countryDiv">-->
<!-- <label class="col-sm-3 control-label"><span style="color: red; ">*</span>国别:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input id="country" name="country" th:field="*{country}" class="form-control" type="text" >-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label"><span style="color: red; ">*</span>订单名称:</label>
<div class="col-sm-8">
<input id="name" type="text" placeholder="请选择订单名称" class="form-control" th:field="*{enterpriseName}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<button type="button" class="btn btn-success" id="select" onclick="search()">查询</button>
</div>
</div>
<div class="col-sm-12 select-table table-striped">
<table class="table table-bordered" id="table_own">
<thead>
<tr>
<th>企业名称</th>
<th>企业状态</th>
<th>国家</th>
<th>所在城市</th>
<th>企业地址</th>
<th>企业注册号</th>
<th>操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-select-js"/>
<script th:inline="javascript">
let searchData = []
let picc = [[${piccErrOrder}]]
search();
function search() {
var country = $("#country").val();
var name = $("#name").val();
$("#table_own tbody").html('正在查询中。。。');
if (name === '') {
$.modal.alertError("请输入企业名称")
return;
}
$.ajax({
url: '/web/monitorCompany/getjyEnterpraseInfo',
data: {
countryCode: country,
name: name
},
type: 'get',
dataType: 'json',
success: function (res) {
console.log(res)
$("#table_own tbody").empty();
if (res.code == '2000') {
let itemList = res.data.items;
searchData = res.data.items;
let tempList = ``
itemList.forEach((item, index) => {
let temp = `<tr>
<td>${item.nameEnglish}</td>
<td>${item.status}</td>
<td>${item.country}</td>
<td>${item.city}</td>
<td>${item.addressLine}</td>
<td>${item.nationalIdNo}</td>
<td><button type="button" class="btn btn-warning choiceBtn" onclick="handleChoice('${index}')">下单</button></td>
</tr>`
tempList += temp;
})
$("#table_own tbody").append(tempList);
} else {
$.modal.alertError(res.msg)
}
}
})
}
function handleChoice(index) {
console.log(index)
searchData.forEach((item, dataIndex)=> {
if (dataIndex == index) {
console.log(item)
var ename= item.nameEnglish;
var ewin= item.eid;
var ecountry=item.country;
var type=picc.reportType == 0 ? "简易":"标准"
$.modal.confirm("您确定要下单"+ename+"的"+type+"版企业信用报告吗?",function (){
this.order(ename, ewin,ecountry)
})
}
})
}
function order(ename, ewin,ecountry) {
console.log(picc)
$.ajax({
type: "POST",
url: "/business/piccErrOrder/addJyOrder",
dataType: "json",
data:{name:ename,win:ewin,id:picc.id,country:ecountry},
success: function (response) {
if(response.code==2000){
$.modal.alertSuccess(response.msg)
}else {
$.modal.alertError(response.msg)
}
// $.modal.closeAll();
}
})
}
function err(){
var id = $("#id").val();
parent.layer.close(parent.layer.getFrameIndex(window.name))
parent.layer.open({
type: 2,
title: '简易版海外异常下单',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '620px'],
btn: ['确定', '关闭'],
yes: function (index, layero) {
var iframeWin = layero.find('iframe')[0];
iframeWin.contentWindow.submitHandler(index, layero);
},
content: "/business/piccErrOrder/searchError/"+id // iframe的url
});
}
</script>
</body>
</html>