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

668 lines
29 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('供应商报价列表')"/>
<th:block th:include="include :: datetimepicker-css"/>
</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="quotationCode"/>
</li>
<li>
<label>原辅料代码:</label>
<!-- <select name="rawSubsidiaryCode">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<input type="text" name="rawSubsidiaryCode"/>
</li>
<li>
<label>原辅料名称:</label>
<input type="text" name="rawSubsidiaryName"/>
</li>
<li>
<label>供应商名称:</label>
<!-- <select name="supplierName">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<input type="text" name="supplierName"/>
</li>
<li>
<label>是否为当前报价:</label>
<select name="currentQuote" 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="confirmNo" 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="auditNo" 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="approveNo" 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>
<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:supplierquotation:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="system:supplierquotation:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="system:supplierquotation:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="system:supplierquotation:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-info" onclick="quotationAudit()" shiro:hasPermission="system:supplierquotation:audit">
2 years ago
<i class="fa fa-file-text"></i> 审核
</a>
<a class="btn btn-success" onclick="quotationConfirm()" shiro:hasPermission="system:supplierquotation:confirm">
2 years ago
<i class="fa fa-hand-grab-o"></i> 确认
</a>
<a class="btn btn-primary" onclick="quotationApprove()" shiro:hasPermission="system:supplierquotation:approved">
2 years ago
<i class="fa fa-hand-grab-o"></i> 核准
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table>
</div>
</div>
</div>
<!--审核确认-->
<div class="modal fade" id="AuditModel">
<div class="modal-dialog">
<div class="modal-content message_align">
<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-audit-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="supplierQuotationId" name="supplierQuotationId" 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="auditNo" name="auditNo" 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">
<div class="input-group date">
<input id="auditTime" name="auditTime" class="form-control "
placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核人:</label>
<div class="col-sm-8">
<input id="auditName" name="auditName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="AuditConfirmSubmit()" class="btn btn-success" data-dismiss="modal">确定
</button>
</div>
</div>
</div>
</div>
<div class="alert alert-success hide">审核成功</div>
<!--核准-->
<div class="modal fade" id="approveModel">
<div class="modal-dialog">
<div class="modal-content message_align">
<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-approve-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="supplierQuotationId3" name="supplierQuotationId" 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="approveNo" name="approveNo" 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">
<div class="input-group date">
<input id="approveTime" name="approveTime" 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>
<div class="form-group">
<label class="col-sm-3 control-label">核准人:</label>
<div class="col-sm-8">
<input id="approveName" name="approveName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="ApproveConfirmSubmit()" class="btn btn-success" data-dismiss="modal">确定
</button>
</div>
</div>
</div>
</div>
<div class="alert alert-warning hide">供应商报价已核准</div>
<!--确认-->
<div class="modal fade" id="confirmModel">
<div class="modal-dialog">
<div class="modal-content message_align">
<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-confirm-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="supplierQuotationId2" name="supplierQuotationId" 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="confirmNo" name="confirmNo" 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">
<div class="input-group date">
<input id="confirmTime" name="confirmTime" 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>
<div class="form-group">
<label class="col-sm-3 control-label">确认人:</label>
<div class="col-sm-8">
<input id="confirmName" name="confirmName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="ConfirmSubmit()" class="btn btn-success" data-dismiss="modal">确定</button>
</div>
</div>
</div>
</div>
<div class="alert alert-info hide">供应商报价已确认</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:supplierquotation:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:supplierquotation:remove')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]];
2 years ago
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]];
var confirmTaxDatas = [[${@dict.getType('sys_whether')}]];
var currentQuoteDatas = [[${@dict.getType('sys_whether')}]];
var confirmNoDatas = [[${@dict.getType('sys_whether')}]];
var auditNoDatas = [[${@dict.getType('sys_whether')}]];
var approveNoDatas = [[${@dict.getType('sys_whether')}]];
var prefix = ctx + "system/supplierquotation";
$(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: 'supplierQuotationId',
title: '供应商报价id',
visible: false
},
{
field: 'auditNo',
title: '审核否',
formatter: function (value, row, index) {
// return $.table.selectDictLabel(auditNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(auditNoDatas, 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: 'confirmNo',
title: '确认否',
formatter: function (value, row, index) {
// return $.table.selectDictLabel(confirmNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(confirmNoDatas, 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: 'approveNo',
title: '核准否',
formatter: function (value, row, index) {
// return $.table.selectDictLabel(confirmNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(approveNoDatas, 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: 'quotationCode',
title: '报价编码'
},
{
field: 'rawSubsidiaryCode',
title: '原辅料代码'
},
{
field: 'rawSubsidiaryName',
title: '原辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'typeMachine',
title: '机种'
},
{
field: 'materialType',
title: '物料类别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(materialTypeDatas, value);
}
},
2 years ago
{
field: 'inventoryUnit',
title: '库存单位'
},
{
field: 'commonCurrency',
title: '币别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(commonCurrencyDatas, value);
}
},
{
field: 'inventoryPrice',
title: '库存单价'
},
{
field: 'purchasingUnit',
title: '采购单位',
formatter: function (value, row, index) {
return $.table.selectDictLabel(purchasingUnitDatas, value);
}
},
{
field: 'purchasePrice',
title: '采购单价'
},
{
field: 'relationalFormula',
title: '关系公式'
},
{
field: 'supplierCode',
title: '供应商编号'
},
{
field: 'supplierName',
title: '供应商名称'
},
{
field: 'pricingDate',
title: '定价日期'
},
{
field: 'confirmTax',
title: '含税否',
formatter: function (value, row, index) {
return $.table.selectDictLabel(confirmTaxDatas, value);
}
},
{
field: 'taxRate',
title: '税率'
},
{
field: 'quotationExplain',
title: '说明'
},
{
field: 'currentQuote',
title: '是否为当前报价',
formatter: function (value, row, index) {
return $.table.selectDictLabel(currentQuoteDatas, value);
}
},
{
field: 'registrant',
title: '登记人'
},
{
field: 'confirmName',
title: '确认人'
},
{
field: 'confirmTime',
title: '确认时间'
},
{
field: 'auditName',
title: '审核人'
},
{
field: 'auditTime',
title: '审核时间'
},
{
field: 'approveName',
title: '核准人'
},
{
field: 'approveTime',
title: '核准时间'
},
{
field: 'standbyOne',
title: '备用一',
visible: false
},
{
field: 'standbyTwo',
title: '备用二',
visible: false
},
{
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.supplierQuotationId + '\')"><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.supplierQuotationId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
// 审核确认
function quotationAudit() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length === 1) {
$("#supplierQuotationId").val(data[0].supplierQuotationId)
$("#auditNo").val(1).trigger("change")
$("#auditName").val(userName)
$("#auditTime").datetimepicker("setDate", new Date());
$("#AuditModel").modal("show");
} else {
$.modal.alert("请选择一条数据");
}
}
// 审核确认
function AuditConfirmSubmit() {
var auditNo = $("#auditNo").val()
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-audit-edit').serialize(),
success: function (resp) {
console.log(resp)
$("#bootstrap-table").bootstrapTable('refresh');
// $(".alert-success").addClass("show");
// window.setTimeout(function () {
// $(".alert-success").removeClass("show");
// }, 1000);//显示的时间
if (auditNo == 1) {
$.modal.msgSuccess("审核成功!")
} else if (auditNo == 0) {
$.modal.msgSuccess("取消审核成功!")
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
// 确认
function quotationConfirm() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length === 1) {
$("#supplierQuotationId2").val(data[0].supplierQuotationId)
$("#confirmNo").val(1).trigger("change")
$("#confirmName").val(userName)
$("#confirmTime").datetimepicker("setDate", new Date());
$("#confirmModel").modal("show");
} else {
$.modal.alert("请选择一条数据");
}
}
// 确认
function ConfirmSubmit() {
var confirmNo = $("#confirmNo").val()
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-confirm-edit').serialize(),
success: function (resp) {
console.log(resp)
$("#bootstrap-table").bootstrapTable('refresh');
// $(".alert-info").addClass("show");
// window.setTimeout(function () {
// $(".alert-info").removeClass("show");
// }, 1000);//显示的时间
if (confirmNo == 1) {
$.modal.msgSuccess("确认成功!")
} else if (confirmNo == 0) {
$.modal.msgSuccess("取消确认成功!")
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
// 核准
function quotationApprove() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length === 1) {
$("#supplierQuotationId3").val(data[0].supplierQuotationId)
$("#approveNo").val(1).trigger("change")
$("#approveName").val(userName)
$("#approveTime").datetimepicker("setDate", new Date());
$("#approveModel").modal("show");
} else {
$.modal.alert("请选择一条数据");
}
}
// 核准
function ApproveConfirmSubmit() {
var approveNo = $("#approveNo").val()
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-approve-edit').serialize(),
success: function (resp) {
$("#bootstrap-table").bootstrapTable('refresh');
// $(".alert-warning").addClass("show");
// window.setTimeout(function () {
// $(".alert-warning").removeClass("show");
// }, 1000);//显示的时间
if (approveNo == 1) {
$.modal.msgSuccess("核准成功!")
} else if (approveNo == 0) {
$.modal.msgSuccess("取消核准成功!")
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
</script>
</body>
</html>