unis_sip/ruoyi-admin/src/main/resources/templates/project/info/selectCustomer.html

162 lines
5.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('选择客户')"/>
</head>
<style>
.select-list li {
display: inline-block;
}
.select-list li label {
width: 88px !important;
}
</style>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>客户编码:</label>
<input type="text" name="customerCode"/>
</li>
<li>
<label>客户名称:</label>
<input type="text" name="customerName"/>
</li>
<li>
<label>联系人:</label>
<input type="text" name="contactPerson"/>
</li>
<li>
<label>所属行业:</label>
<select name="industryType" class="form-control"
th:with="type=${@dict.getType('industry_code')}" required>
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li style="width: 46%;text-align: right;">
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success btn-rounded btn-sm" onclick="openAdd()"><i
class="fa fa-plus"></i>&nbsp;添加</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script>
var prefix = ctx + "system/customer";
function openAdd() {
window.localStorage.setItem('layerTable',1)
var options = {
title: "新建代理商",
url: prefix + `/add`,
maxmin: false,
full: false,
index: 1000,
width: 800,
end:function(){
window.localStorage.removeItem('layerTable')
},
yes: function (index, layero) {
let body = parent.layer.getChildFrame('body', index)
if ($(body.find('#form-info-add').get(0)).validate().form()) {
$.operate.save(prefix + "/add", body.find('#form-info-add').serialize(), function (res) {
if (res.code == web_status.SUCCESS) {
$.table.search()
parent.layer.close(index)
}
});
}
},
};
$.modal.openOptions(options)
}
$(function () {
var options = {
url: prefix + "/list",
showSearch: true,
showColumns: false,
showToggle: false,
showPageGo: true,
showRefresh: false,
search: false,
params: {},
columns: [{
radio: true
},
{
field: 'customerCode',
title: '客户编码'
},
{
field: 'customerName',
title: '客户名称'
},
{
field: 'address',
title: '详细地址'
},
{
field: 'contactPerson',
title: '联系人'
},
{
field: 'contactPhone',
title: '联系电话'
},
{
field: 'contactEmail',
title: '联系邮件'
},
{
field: 'industryType',
title: '所属行业',
formatter:(value,row)=>{
const arr=[]
$('[name="industryType"] option').each((index,item)=>{
arr.push({
text:$(item).text(),
value:$(item).val()
})
})
return arr.find((ele)=>ele.value==value)?.text
}
},
{
field: 'remark',
title: '备注'
},
]
};
$.table.init(options);
});
function getSelections() {
var rows = $('#bootstrap-table').bootstrapTable('getSelections');
return rows;
}
</script>
</body>
</html>