@ -13,53 +13,57 @@
< div class = "select-list" >
< ul >
< li >
< label > 订购单号:< / label >
< input type = "text" name = "purchaseOrderNumber" / >
< label > 采购单号:< / label >
< input type = "text" name = "purchaseOrderCode" / >
< / li >
< li >
< label > 采购员:< / label >
< input type = "text" name = "supplierNumber" / >
< / li >
< li >
< label > 供应商代码:< / label >
< select name = "supplierCode" >
< option value = "" > 所有< / option >
< / select >
< input name = "supplierCode" class = "form-control" type = "text" / >
< / li >
< li >
< label > 供应商名称:< / label >
< input type = "text" name = "supplierName" / >
< / li >
< li class = "select-time" >
< label > 开单日期:< / label >
< input type = "text" class = "time-input" id = "startTime" placeholder = "开始时间" name = "params[beginBillingDate]" / >
< span > -< / span >
< input type = "text" class = "time-input" id = "endTime" placeholder = "结束时间" name = "params[endBillingDate]" / >
< / li >
< li >
< label > 结案否 :< / label >
< select name = "closeC aseNo " th:with = "type=${@dict.getType('sys_whether ')}" >
< label > 审核状态:< / label >
< select name = "auditStatus" th:with = "type=${@dict.getType('auditStatus')}" >
< 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 ')}" >
< label > 使用状态 :< / label >
< select name = "useStatus " th:with = "type=${@dict.getType('useStatus ')}" >
< 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 ')}" >
< label > 收货状态 :< / label >
< select name = "eceiptStatus " th:with = "type=${@dict.getType('sys_eceipt_status ')}" >
< 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 ')}" >
< label > 打款结案状态 :< / label >
< select name = "paymentStatus " th:with = "type=${@dict.getType('sys_pay_close ')}" >
< option value = "" > 所有< / option >
< option th:each = "dict : ${type}" th:text = "${dict.dictLabel}" th:value = "${dict.dictValue}" > < / option >
< / select >
< / li >
< li class = "select-time" >
< label > 录入时间:< / label >
< input type = "text" class = "time-input" id = "startTime" placeholder = "开始时间" name = "params[beginBillingDate]" / >
< span > -< / span >
< input type = "text" class = "time-input" id = "endTime" placeholder = "结束时间" name = "params[endBillingDate]" / >
< / li >
< li >
< a class = "btn btn-primary btn-rounded btn-sm" onclick = "$.table.search()" > < i class = "fa fa-search" > < / i > 搜索< / a >
< a class = "btn btn-warning btn-rounded btn-sm" onclick = "$.form.reset()" > < i class = "fa fa-refresh" > < / i > 重置< / a >
@ -70,14 +74,8 @@
< / div >
< div class = "btn-group-sm" id = "toolbar" role = "group" >
< a class = "btn btn-success" onclick = "$.operate.add()" shiro:hasPermission = "purchase:purchaseOrder:add" >
< i class = "fa fa-plus" > < / i > 添加
< / a >
< a class = "btn btn-primary single disabled" onclick = "$.operate.edit()" shiro:hasPermission = "purchase:purchaseOrder:edit" >
< i class = "fa fa-edit" > < / i > 修改
< / a >
< a class = "btn btn-danger multiple disabled" onclick = "removeSelected()" shiro:hasPermission = "purchase:purchaseOrder:remove" >
< i class = "fa fa-remove" > < / i > 删除
< a class = "btn btn-success" onclick = "importPurchaseOrder()" shiro:hasPermission = "purchase:purchaseOrder:add" >
< i class = "fa fa-plus" > < / i > 导入
< / a >
< a class = "btn btn-warning" onclick = "exportPurchaseOrder()" shiro:hasPermission = "purchase:purchaseOrder:export" >
< i class = "fa fa-download" > < / i > 导出
@ -86,15 +84,6 @@
< i class = "fa fa-hand-grab-o" > < / i > 结案
< / a >
< a class = "btn btn-primary" onclick = "reviewConfirm()" shiro:hasPermission = "purchase:purchaseOrder:confirm" >
< i class = "fa fa-hand-grab-o" > < / i > 确认
< / a >
< a class = "btn btn-primary" onclick = "reviewAudit()" shiro:hasPermission = "purchase:purchaseOrder:audit" >
< i class = "fa fa-hand-grab-o" > < / i > 审核
< / a >
< a class = "btn btn-primary" onclick = "reviewApprove()" shiro:hasPermission = "purchase:purchaseOrder:approve" >
< i class = "fa fa-hand-grab-o" > < / i > 核准
< / a >
< / div >
< div class = "col-sm-12 select-table table-striped" style = "white-space: nowrap" >
< table id = "bootstrap-table" > < / table >
@ -156,169 +145,6 @@
< / div >
< / div >
< / 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 = "purchaseOrderId2" name = "purchaseOrderId" 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 = "modal fade" id = "auditModal" >
< 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 = "purchaseOrderId3" name = "purchaseOrderId" 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: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="auditName" name="auditName" class="form - control" type="text" th:value="${@permission.getPrincipalProperty('userName')}"> -->
< 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 = "auditSubmit()" class = "btn btn-success" data-dismiss = "modal" > 确定< / button >
< / div >
< / div >
< / div >
< / div >
<!-- 订单核准 -->
< div class = "modal fade" id = "approveModal" >
< 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 = "purchaseOrderId4" name = "purchaseOrderId" 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="auditName" name="auditName" class="form - control" type="text" th:value="${@permission.getPrincipalProperty('userName')}"> -->
< 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 = "approveSubmit()" class = "btn btn-success" data-dismiss = "modal" > 确定< / button >
< / div >
< / div >
< / div >
< / div >
< th:block th:include = "include :: footer" / >
< th:block th:include = "include :: datetimepicker-js" / >
< script th:inline = "javascript" >
@ -328,9 +154,12 @@
var confirmNoDatas = [[${@dict.getType('sys_whether')}]];
var auditNoDatas = [[${@dict.getType('sys_whether')}]];
var approveNoDatas = [[${@dict.getType('sys_whether')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var eceiptStatusDatas = [[${@dict.getType('eceiptStatus')}]];
var paymentStatusDatas = [[${@dict.getType('sys_pay_status')}]];
var purchaseCategoryDatas = [[${@dict.getType('purchase_category')}]];
var prefix = ctx + "purchase/purchaseOrder";
$(function() {
var options = {
url: prefix + "/list",
@ -340,181 +169,30 @@
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "采购订单",
columns: [{
checkbox: true
},
{
field: 'purchaseOrderId',
title: '采购订单id',
visible: false
},
{
field: 'closeCaseNo',
title: '结案否',
formatter: function(value, row, index) {
// return $.table.selectDictLabel(closeCaseNoDatas, value);
var actions = [];
if ($.table.selectDictLabel(closeCaseNoDatas, 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: '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: 'approveNo',
title: '核准否',
formatter: function(value, row, index) {
// return $.table.selectDictLabel(approveNoDatas, 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: 'purchaseOrderNumber',
title: '订购单号'
},
{
field: 'supplierCode',
title: '供应商代码'
},
{
field: 'supplierName',
title: '供应商名称'
},
{
field: 'customerContact',
title: '联系人'
},
{
field: 'contactNumber',
title: '联系电话'
},
{
field: 'customerFax',
title: '传真号码'
},
{
field: 'deliveryAddress',
title: '交货地点'
},
{
field: 'paymentTerms',
title: '付款条件'
},
{
field: 'deliveryConditions',
title: '交货条件'
},
{
field: 'deliveryMethod',
title: '交货方式'
},
{
field: 'purchaseName',
title: '购方名称'
},
{
field: 'billingDate',
title: '开单日期'
},
{
field: 'taxRate',
title: '税率'
},
{
field: 'purchaseCategory',
title: '订购种类',
formatter: function (value, row, index) {
return $.table.selectDictLabel(purchaseCategoryDatas, value);
}
},
{
field: 'purchaseCommander',
title: '采购担当'
},
{
field: 'customerOrderNumber',
title: '客户订单号'
},
{
field: 'remarkContent',
title: '备注内容'
},
{
field: 'closeCaseName',
title: '结案人',
visible: false
},
{
field: 'closeCaseTime',
title: '结案时间',
visible: false
},
{
field: 'confirmName',
title: '确认人',
visible: false
},
{
field: 'confirmTime',
title: '确认时间',
visible: false
},
{
field: 'auditName',
title: '审核人',
visible: false
},
{
field: 'auditTime',
title: '审核时间',
visible: false
},
{
field: 'approveName',
title: '核准人',
visible: false
},
{
field: 'approveTime',
title: '核准时间',
visible: false
},
columns: [{checkbox: true},
{title: '采购订单id',field: 'purchaseOrderId', visible: false},
{title:'审核状态',field: 'auditStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(auditStatusDatas, value);
}},
{title:'使用状态',field: 'useStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(useStatusDatas, value);
}},
{title:'收货状态',field: 'eceiptStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(eceiptStatusDatas, value);}
},
{title:'打款结案状态',field: 'paymentStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(paymentStatusDatas, value);
}},
{title:'采购单号',field: 'purchaseOrderCode'},
{ title: '供应商ID',field: 'supplierCode'},
{title: '供应商名称',field: 'supplierName'},
{title: '联系人',field: 'customerContact',visible: false},
{title: '联系电话',field: 'contactNumber',visible: false},
{title:'供应商数量',field: 'supplierNum'},
{title:'物料合计',field: 'materialAmount'},
{title:'数量合计',field: 'materialSum'},
{title:'不含税总价(RMB)',field: 'noRmbSum'},
{title:'含税总价',field: 'rmbSum'},
{
field: 'firstAddTime',
title: '录入时间',
@ -528,7 +206,7 @@
},
{
field: 'updateInfoTime',
title: '上次修改 时间',
title: '上次更新 时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
@ -537,8 +215,8 @@
return vArr[0];
}
}
}]
/* {
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
@ -547,7 +225,7 @@
actions.push('< a class = "btn btn-danger btn-xs ' + removeFlag + '" href = "javascript:void(0)" onclick = "$.operate.remove(\'' + row.purchaseOrderId + '\')" > < i class = "fa fa-remove" > < / i > 删除< / a > ');
return actions.join('');
}
}*/
}]
};
$.table.init(options);
});
@ -614,33 +292,6 @@
}
}
//删除
function removeSelected() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
console.log(rows)
console.log(rows.join())
if (rows.length > 0) {
$.modal.confirm("是否删除选中的"+ rows.length +"条采购订单?", function () {
$.ajax({
url: prefix + '/removeSelected',
type: 'post',
data: {
ids : rows.join()
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
} else {
$.modal.msgWarning("请选择一条数据")
}
}
// 订单结案
function reviewCloseCase(){
@ -676,113 +327,6 @@
}
});
}
// 订单确认
function reviewConfirm(){
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length ===1) {
$("#purchaseOrderId2").val(data[0].purchaseOrderId)
$("#confirmNo").val(data[0].confirmNo).trigger("change")
$("#confirmName").val(userName)
$("#confirmTime").datetimepicker("setDate", new Date());
$("#confirmModel").modal("show");
}else {
$.modal.alert("请选择一条数据");
}
}
// 订单确认
function confirmSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-confirm-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#confirmModel").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
//审核
function reviewAudit() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
// console.log(data.length)
if (data.length === 1) {
$("#purchaseOrderId3").val(data[0].purchaseOrderId)
$("#auditNo").val(data[0].auditNo).trigger("change")
$("#auditName").val(userName)
$("#auditTime").datetimepicker("setDate", new Date());
$("#auditModal").modal("show");
} else {
// alert("请选择一条数据")
$.modal.alert("请选择一条数据");
}
}
// 审核修改
function auditSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-audit-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#auditModal").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
//核准
function reviewApprove() {
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
// console.log(data.length)
if (data.length === 1) {
$("#purchaseOrderId4").val(data[0].purchaseOrderId)
$("#approveNo").val(data[0].approveNo).trigger("change")
$("#approveName").val(userName)
$("#approveTime").datetimepicker("setDate", new Date());
$("#approveModal").modal("show");
} else {
// alert("请选择一条数据")
$.modal.alert("请选择一条数据");
}
}
// 核准
function approveSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-approve-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#approveModal").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
< / script >
< / body >
< / html >