万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

325 lines
13 KiB

2 years ago
<!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('供应商资料列表')" />
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
</head>
<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="supplierCode"/>
</li>
<li>
<label>供应商名称:</label>
<input type="text" name="supplierName"/>
</li>
<li>
<label>内外销:</label>
<select name="exportSales" th:with="type=${@dict.getType('sys_export_sales')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>企业名称:</label>
<input type="text" name="enterpriseName"/>
</li>
<li>
<label>主联系人:</label>
<input type="text" name="customerContact"/>
</li>
<li>
<label>跟单员:</label>
<input type="text" name="merchandiser"/>
</li>
<li>
<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" onclick="$.operate.add()" shiro:hasPermission="system:supplier:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:supplier:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:supplier:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:supplier:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<a class="btn btn-warning single disabled" onclick="exportSupplierInfo()" shiro:hasPermission="system:supplier:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:supplier:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:supplier:remove')}]];
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]];
var enterpriseNatureDatas = [[${@dict.getType('sys_enterprise_nature')}]];
var customerCountryDatas = [[${@dict.getType('sys_country')}]];
var paymentTermsDatas = [[${@dict.getType('sys_paymentTerms')}]];
var confirmTaxDatas = [[${@dict.getType('sys_confirm_tax')}]];
var prefix = ctx + "system/supplier";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "供应商资料",
columns: [{
checkbox: true
},
{
field: 'supplierId',
title: '供应商id',
visible: false
},
{
field: 'supplierCode',
title: '供应商编号'
},
{
field: 'supplierName',
title: '供应商名称'
},
{
field: 'exportSales',
title: '内外销',
formatter: function(value, row, index) {
return $.table.selectDictLabel(exportSalesDatas, value);
}
},
{
field: 'enterpriseName',
title: '企业名称'
},
{
field: 'enterpriseNature',
title: '企业性质',
formatter: function(value, row, index) {
return $.table.selectDictLabel(enterpriseNatureDatas, value);
}
},
{
field: 'customerAddress',
title: '企业地址'
},
{
field: 'manufacturerCategory',
title: '厂商类别'
},
{
field: 'postalCode',
title: '邮编'
},
{
field: 'businessScope',
title: '经营范围'
},
{
field: 'customerCountry',
title: '国家',
formatter: function(value, row, index) {
return $.table.selectDictLabel(customerCountryDatas, value);
}
},
{
field: 'establishedTime',
title: '成立日期'
},
{
field: 'legalRepresentative',
title: '法人代表'
},
{
field: 'customerContact',
title: '主联系人'
},
{
field: 'contactNumber',
title: '联系电话'
},
{
field: 'customerFax',
title: '传真'
},
{
field: 'customerEmail',
title: 'Email'
},
{
field: 'website',
title: '网站'
},
{
field: 'paymentTerms',
title: '付款条件',
formatter: function(value, row, index) {
return $.table.selectDictLabel(paymentTermsDatas, value);
}
},
{
field: 'supplierDays',
title: '天数'
},
{
field: 'actualPaymentDays',
title: '实际付款天数'
},
{
field: 'settlementBank',
title: '结汇银行',
visible: false
},
{
field: 'exchangeSettlementAccount',
title: '结汇账号',
visible: false
},
{
field: 'depositBank',
title: '开户银行'
},
{
field: 'bankAccount',
title: '开户银行账号'
},
{
field: 'rmbRegisteredCapital',
title: 'RMB注册资金'
},
{
field: 'industryCode',
title: '行业代码'
},
{
field: 'merchandiser',
title: '跟单员'
},
{
field: 'merchandiserTelephone',
title: '跟单电话'
},
{
field: 'financialContact',
title: '财务联系人'
},
{
field: 'confirmTax',
title: '是否含税',
formatter: function(value, row, index) {
return $.table.selectDictLabel(confirmTaxDatas, value);
}
},
{
field: 'taxRate',
title: '税率'
},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
}
}
}
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.supplierId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.supplierId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
//导出
function exportSupplierInfo() {
// rows为选中行的id
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
//选择的行数据
var selectData = $("#bootstrap-table").bootstrapTable("getSelections")
// console.log(JSON.stringify(selectData))
// console.log(selectData)
if (rows.length !== 1) {
$.modal.alert("请选择一条记录");
return;
} else {
$.modal.confirm("是否确认要导出本条信息?", function (){
axios({
url: prefix + '/exportSupplierInfo',
data:{
selectData:JSON.stringify(selectData)
},
method: 'POST',
responseType: 'blob'
}).then(response => {
// console.log(response)
// console.log(response.data)
const URL = window.URL.createObjectURL(response.data)
// 创建隐藏<a>标签进行下载
const tempLink = document.createElement('a')
tempLink.style.display = 'none'
tempLink.href = URL
let time = new Date().toLocaleString()
tempLink.setAttribute('download', time + "供应商基本信息.xlsx")
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank')
}
document.body.appendChild(tempLink)
tempLink.click()
document.body.removeChild(tempLink)// 移除dom元素
window.URL.revokeObjectURL(URL)//释放内存
})
});
}
}
</script>
</body>
</html>