万材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.
 
 
 
 

852 lines
38 KiB

<!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('销售对账列表')"/>
<th:block th:include="include :: datetimepicker-css"/>
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
<style>
.table-striped {
border: 0px !important;
white-space: nowrap;
}
</style>
</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 class="select-time">
<label>创建时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endTime]"/>
</li>
<li>
<label>订单号码:</label>
<input type="text" name="salesOrderNumber"/>
</li>
<li>
<label>客户代码:</label>
<select name="enterpriseCode">
<option value="">所有</option>
</select>
</li>
<li>
<label>客户名称:</label>
<select name="enterpriseName">
<option value="">所有</option>
</select>
</li>
<li>
<label>客户使用否:</label>
<select name="customerUseOrNot" th:with="type=${@dict.getType('sys_whether')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>对账否:</label>
<select name="accountReconciliationOrNot" th:with="type=${@dict.getType('sys_whether')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>是否开国税发票:</label>
<select name="nationalTaxBill" th:with="type=${@dict.getType('sys_whether')}">
<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="finishProductCode"/>
</li>
<li>
<label>成品名称:</label>
<input type="text" name="finishProductName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formId', 'bootstrap-table')"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId', 'bootstrap-table')"><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="salesAccountReconciliation:salesAccountReconciliation:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<b>销售信息</b>
<a class="btn btn-success" onclick="confirmAccountReconciliation()"
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:confirm">
<i class="fa fa-hand-grab-o"></i> 销售对账确认
</a>
<a class="btn btn-success" onclick="confirmCustomerUse()"
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:customConfirm">
<i class="fa fa-hand-grab-o"></i> 客户使用确认
</a>
<a class="btn btn-warning" onclick="exportAccountReconciliation()"
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:export">
<i class="fa fa-download"></i> 导出
</a>
<!-- <a class="btn btn-primary" onclick="toNationalTaxBill()">-->
<!-- <i class="fa fa-file-text"></i> 开国税发票-->
<!-- </a>-->
</div>
<!--<div class="btn-group-sm" id="toolbar1" role="group">
<b>退货信息</b>
<a class="btn btn-success" onclick="confirmRGAccountReconciliation()"
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:returnConfirm">
<i class="fa fa-hand-grab-o"></i> 退货对账确认
</a>
<a class="btn btn-warning" onclick="exportRGExcel('formId')">
<i class="fa fa-download"></i> 导出
</a>
</div>-->
<div class="col-sm-12 select-table table-striped" style="white-space: nowrap;">
<table id="bootstrap-table"></table>
<!-- <table id="bootstrap-table1"></table>-->
</div>
</div>
</div>
<!--销售对账确认-->
<div class="modal fade" id="accountReconciliationModal" tabindex="-1"
role="dilog" aria-hidden="true">
<div class="modal-dialog" style="width: 500px;max-height: 800px; background-color: #FFFFFF">
<div class="modal-content" style="background-color: #FFFFFF">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">销售对账确认</h4>
</div>
<div class="modal-body" style="height: 180px">
<form id="form-accountReconciliation-edit">
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">订单id:</label>
<div class="col-sm-8">
<input id="salesFinishId" name="salesFinishId" class="form-control" type="text" required
readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对账否:</label>
<div class="col-sm-8">
<select id="accountReconciliationOrNot" name="accountReconciliationOrNot"
class="form-control" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对账人:</label>
<div class="col-sm-8">
<input id="accountReconciliationPerson" name="accountReconciliationPerson"
class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对账时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input id="accountReconciliationTime" name="accountReconciliationTime"
class="form-control" placeholder="yyyy-mm-dd hh:ii:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-success" onclick="updateAccountReconciliation()">确认</button>
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="closeAccountReconciliationModal()">关闭</button>-->
</div>
</div>
</div>
</div>
<!--客户使用确认-->
<div class="modal fade" id="customerUseModal" tabindex="-1"
role="dilog" aria-hidden="true">
<div class="modal-dialog" style="width: 500px;max-height: 800px; background-color: #FFFFFF">
<div class="modal-content" style="background-color: #FFFFFF">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">客户使用确认</h4>
</div>
<div class="modal-body" style="height: 300px">
<form id="form-customerUse-edit">
<div class="form-group" style="display: none">
<label class="col-sm-4 control-label is-required">订单id:</label>
<div class="col-sm-8">
<input id="salesFinishId1" name="salesFinishId" class="form-control" type="text" required
readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">订单编号:</label>
<div class="col-sm-8">
<input id="salesOrderCode" name="salesOrderCode" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">成品代码:</label>
<div class="col-sm-8">
<input id="finishProductCode" name="finishProductCode" class="form-control" type="text"
required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">成品名称:</label>
<div class="col-sm-8">
<input id="finishProductName" name="finishProductName" class="form-control" type="text"
required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">客户使用否:</label>
<div class="col-sm-8">
<select id="customerUseOrNot" name="customerUseOrNot" class="form-control"
th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">客户使用数量:</label>
<div class="col-sm-8">
<input id="customerUseQuantity" name="customerUseQuantity" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<!-- <input id="customerUseRemarks" name="customerUseRemarks" class="form-control" type="text">-->
<textarea id="customerUseRemarks" name="customerUseRemarks" style="width: 100%;"
rows="4"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-success" onclick="updateCustomerUse()">客户使用确认</button>
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="closeAccountReconciliationModal()">关闭</button>-->
</div>
</div>
</div>
</div>
<!--退货对账确认-->
<!--<div class="modal fade" id="RGAccountReconciliationModal" tabindex="-1"
role="dilog" aria-hidden="true">
<div class="modal-dialog" style="width: 500px;max-height: 800px; background-color: #FFFFFF">
<div class="modal-content" style="background-color: #FFFFFF">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">退货对账确认</h4>
</div>
<div class="modal-body" style="height: 180px">
<form id="form-rgAccountReconciliation-edit">
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">退货产品id:</label>
<div class="col-sm-8">
<input id="returnGoodsProductId" name="returnGoodsProductId" class="form-control"
type="text" required
readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对账否:</label>
<div class="col-sm-8">
<select id="accountReconciliationOrNot1" name="accountReconciliationOrNot"
class="form-control" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对账人:</label>
<div class="col-sm-8">
<input id="accountReconciliationPerson1" name="accountReconciliationPerson"
class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">对账时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input id="accountReconciliationTime1" name="accountReconciliationTime"
class="form-control" placeholder="yyyy-mm-dd hh:ii:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-success" onclick="updateRGAccountReconciliation()">确认</button>
&lt;!&ndash; <button type="button" class="btn btn-default" data-dismiss="modal" onclick="closeAccountReconciliationModal()">关闭</button>&ndash;&gt;
</div>
</div>
</div>
</div>-->
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('sales:salesAccountReconciliation:edit')}]];
var removeFlag = [[${@permission.hasPermi('sales:salesAccountReconciliation:remove')}]];
var customerUseOrNotDatas = [[${@dict.getType('sys_whether')}]];
var accountReconciliationOrNotDatas = [[${@dict.getType('sys_whether')}]];
var nationalTaxBillDatas = [[${@dict.getType('sys_whether')}]];
var closeCaseOrNotDatas = [[${@dict.getType('sys_whether')}]];
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var prefix = ctx + "sales/salesAccountReconciliation";
var prefix1 = ctx + "returnGoods/returnGoodsProduct";
$(function () {
/*显示销售列表数据*/
var options = {
id: "bootstrap-table",
formId: "formId",
toolbar: "toolbar",
url: prefix + '/list',
exportUrl: prefix + '/export',
clickToSelect: true,
modalName: "销售对账",
columns: [{
checkbox: true
},
{
field: 'salesFinishId',
title: '销售物料id',
visible: false
},
{
field: 'accountReconciliationOrNot',
title: '对账否',
formatter: function (value, row, index) {
// return $.table.selectDictLabel(accountReconciliationOrNotDatas, value);
var actions = [];
if ($.table.selectDictLabel(accountReconciliationOrNotDatas, value) == "<span class=''>是</span>") {
actions.push('<a class="btn btn-primary btn-xs disabled">已对账</a> ');
} else {
actions.push('<a class="btn btn-danger btn-xs disabled">未对账</a> ');
}
return actions.join('');
}
},
{
field: 'noticeOrderNumber',
title: '发货通知单号'
},
{
field: 'deliveryDate',
title: '发货日期',
visible: false
},
{
field: 'salesOrderNumber',
title: '订单号码'
},
{
field: 'enterpriseCode',
title: '客户代码'
},
{
field: 'enterpriseName',
title: '客户名称'
},
{
field: 'customerContact',
title: '联系人'
},
{
field: 'finishProductCode',
title: '成品代码'
},
{
field: 'finishProductName',
title: '成品名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'customerNumber',
title: '客户料号'
},
{
field: 'commonCurrency',
title: '币别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(commonCurrencyDatas, value);
},
visible: false
},
{
field: 'processPrice',
title: '单价'
},
{
field: 'productQuantity',
title: '数量'
},
{
field: 'amountMoney',
title: '金额'
},
{
field: 'customerUseOrNot',
title: '客户使用否',
formatter: function (value, row, index) {
return $.table.selectDictLabel(customerUseOrNotDatas, value);
},
visible: false
},
{
field: 'customerUseQuantity',
title: '客户使用数量',
visible: false
},
{
field: 'customerUseRemarks',
title: '客户使用备注说明',
visible: false
},
{
field: 'accountReconciliationPerson',
title: '对账人'
},
{
field: 'accountReconciliationTime',
title: '对账时间'
},
{
field: 'nationalTaxBill',
title: '是否开国税发票',
formatter: function (value, row, index) {
return $.table.selectDictLabel(nationalTaxBillDatas, value);
},
visible: false
}]
};
$.table.init(options);
/*显示退货列表数据*/
/* var options1 = {
id: "bootstrap-table1",
url: prefix1 + "/list",
exportUrl: prefix1 + '/export',
formId: "formId",
toolbar: "toolbar1",
clickToSelect: true,
modalName: "退货对账",
columns: [{
checkbox: true
},
{
field: 'accountReconciliationOrNot',
title: '对账否',
formatter: function (value, row, index) {
// return $.table.selectDictLabel(accountReconciliationOrNotDatas, value);
var actions = [];
if ($.table.selectDictLabel(accountReconciliationOrNotDatas, value) == "<span class=''>是</span>") {
actions.push('<a class="btn btn-primary btn-xs disabled">已对账</a> ');
} else {
actions.push('<a class="btn btn-danger btn-xs disabled">未对账</a> ');
}
return actions.join('');
}
},
{
field: 'returnGoodsProductId',
title: '退货产品id',
visible: false
},
{
field: 'returnGoodsNumber',
title: '退货单号'
},
{
field: 'orderNumber',
title: '订单号'
},
{
field: 'finishProductCode',
title: '成品代码'
},
{
field: 'finishProductName',
title: '成品名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'typeMachine',
title: '机种'
},
{
field: 'inventoryUnit',
title: '单位',
formatter: function (value, row, index) {
return $.table.selectDictLabel(inventoryUnitDatas, value);
}
},
{
field: 'commonCurrency',
title: '币别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(commonCurrencyDatas, value);
}
},
{
field: 'processPrice',
title: '单价'
},
{
field: 'taxRate',
title: '税率',
visible: false
},
{
field: 'priceExcludingTax',
title: '不含税价',
visible: false
},
{
field: 'priceIncludingTax',
title: '含税价',
visible: false
},
{
field: 'quantity',
title: '数量'
},
{
field: 'amountOfMoney',
title: '金额'
},
{
field: 'deliveryDate',
title: '交期',
visible: false
},
{
field: 'batchNumber',
title: '批号',
visible: false
},
{
field: 'description',
title: '说明',
visible: false
},
{
field: 'completedQuantity',
title: '完成数量',
visible: false
},
{
field: 'incompletedQuantity',
title: '欠单数量',
visible: false
},
{
field: 'piNo',
title: 'pi_no',
visible: false
},
{
field: 'accountReconciliationPerson',
title: '对账人'
},
{
field: 'accountReconciliationTime',
title: '对账时间'
}
// ,
// {
// 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.returnGoodsProductId + '\')"><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.returnGoodsProductId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
}
$.table.init(options1);*/
/*获取客户信息*/
getCustomerList();
});
/*表单搜索*/
function searchAll() {
$.table.search('formId', 'bootstrap-table');
$.table.search('formId', 'bootstrap-table1');
}
/*表单重置*/
function resetAll() {
$.form.reset('formId', 'bootstrap-table');
$.form.reset('formId', 'bootstrap-table1');
}
/*获取客户信息*/
function getCustomerList() {
$.ajax({
url: prefix + "/getCustomerList",
type: "POST",
success: function (res) {
//console.log(res)
if (res.length > 0) {
customerListData = res;
//alert(JSON.stringify(data));
for (let i in customerListData) {
$("select[name='enterpriseCode']").append("<option value='" + customerListData[i].enterpriseCode + "'>" + customerListData[i].enterpriseCode + "</option>");
$("select[name='enterpriseName']").append("<option value='" + customerListData[i].enterpriseName + "'>" + customerListData[i].enterpriseName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
}
/*销售对账确认*/
function confirmAccountReconciliation() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
// console.log(data)
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length === 1) {
$("#salesFinishId").val(data[0].salesFinishId)
$("#accountReconciliationOrNot").val(1).trigger("change")
$("#accountReconciliationPerson").val(userName)
$("#accountReconciliationTime").datetimepicker("setDate", new Date());
$("#accountReconciliationModal").modal("show");
// console.log(userName)
} else {
$.modal.alertWarning("请选择一条数据")
}
}
/*销售对账确认提交*/
function updateAccountReconciliation() {
let data = $('#form-accountReconciliation-edit').serialize();
// console.log(data)
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: data,
success: function (resp) {
// console.log(resp)
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("对账确认完成!")
$("#accountReconciliationModal").modal("hide");
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
/*客户使用确认*/
function confirmCustomerUse() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
// console.log(data)
if (data.length === 1) {
$("#salesFinishId1").val(data[0].salesFinishId)
$("#salesOrderCode").val(data[0].salesOrderCode)
$("#finishProductCode").val(data[0].finishProductCode)
$("#finishProductName").val(data[0].finishProductName)
$("#customerUseOrNot").val(1).trigger("change")
$("#customerUseModal").modal("show");
// console.log(userName)
} else {
$.modal.alertWarning("请选择一条数据")
}
}
/*客户确认提交*/
function updateCustomerUse() {
// $.modal.msgWarning("111")
let data = $('#form-customerUse-edit').serialize();
// console.log(data)
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: data,
success: function (resp) {
console.log(resp)
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("客户确认完成!")
$("#customerUseModal").modal("hide");
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
/*退货对账确认*/
function confirmRGAccountReconciliation() {
let data = $("#bootstrap-table1").bootstrapTable("getSelections");
// console.log(data)
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length === 1) {
$("#returnGoodsProductId").val(data[0].returnGoodsProductId)
$("#accountReconciliationOrNot1").val(1).trigger("change")
$("#accountReconciliationPerson1").val(userName)
$("#accountReconciliationTime1").datetimepicker("setDate", new Date());
$("#RGAccountReconciliationModal").modal("show");
// console.log(userName)
} else {
$.modal.alertWarning("请选择一条数据")
}
}
/*退货对账确认提交*/
function updateRGAccountReconciliation() {
let data = $('#form-rgAccountReconciliation-edit').serialize();
// console.log(data)
$.ajax({
url: prefix1 + "/edit",
type: "post",
resultType: "json",
data: data,
success: function (resp) {
// console.log(resp)
$("#bootstrap-table1").bootstrapTable('refresh');
$.modal.msgSuccess("对账确认完成!")
$("#RGAccountReconciliationModal").modal("hide");
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
/*退货对账导出*/
function exportRGExcel(formId) {
table.set();
// console.log(table)
$.modal.confirm("确定导出所有" + table.options.modalName + "吗?", function () {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
var params = $("#" + table.options.id).bootstrapTable('getOptions');
var dataParam = $("#" + currentId).serializeArray();
dataParam.push({"name": "orderByColumn", "value": params.sortName});
dataParam.push({"name": "isAsc", "value": params.sortOrder});
$.modal.loading("正在导出数据,请稍后...");
$.post(table.options.exportUrl, dataParam, function (result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
//导出
function exportAccountReconciliation() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
// console.log(rows)
// console.log(rows.join())
var data = $("#bootstrap-table").bootstrapTable("getSelections")
if (rows.length == 0) {
$.modal.alert("未选择数据,请选择数据!");
return;
} else {
// rows为选中行的id
// console.log(rows);
console.log(data);
// console.log(data[0].orderNumber)
var ids = [];
for (let i=0;i<rows.length;i++) {
ids.push(data[i].salesFinishId)
}
// console.log(ids)
// console.log(ids.join())
$.modal.confirm("确认要导出销售对账吗?", function (){
axios({
url: prefix + '/exportSelected/'+ ids.join(),
method: 'POST',
responseType: 'blob'
}).then(response => {
// sendSearchParameter(supplierCode, supplierName);
// console.log(response)
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>