修改了发货记录中选择关联合同

master
mula.liu 2025-04-28 19:07:37 +08:00
parent 339d5b32ef
commit dc08bf9c7f
4 changed files with 57 additions and 48 deletions

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>若依系统首页</title>
<title>应用管理系统首页</title>
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/>

View File

@ -160,21 +160,28 @@
minView: "month",
autoclose: true
});
function openList(id){
function openList(){
var options = {
title: "关联合同",
title: "选择合同",
url: prefix + '/selectOrder',
skin: 'layui-layer-gray',
btn: ['关闭'],
yes:function(index){
$.modal.close(index)
},
maxmin: false,
full: false,
index:1000
index:1000,
callBack: doSubmit
};
$.modal.openOptions(options)
}
function doSubmit(index, layero){
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$('[name="orderId"]').val(rows[0].id);
$(' [name="orderName"]').val(rows[0].orderName);
$.modal.close(index);
}
</script>
</body>
</html>

View File

@ -168,16 +168,23 @@
title: "关联合同",
url: prefix + '/selectOrder',
skin: 'layui-layer-gray',
btn: ['关闭'],
yes:function(index){
$.modal.close(index)
},
maxmin: false,
full: false,
index:1000
index:1000,
callBack: doSubmit
};
$.modal.openOptions(options)
}
function doSubmit(index, layero){
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$('[name="orderId"]').val(rows[0].id);
$(' [name="orderName"]').val(rows[0].orderName);
$.modal.close(index);
}
</script>
</body>
</html>

View File

@ -4,34 +4,31 @@
<th:block th:include="include :: header('关联合同')" />
</head>
<body class="gray-bg">
<div class="col-sm-12 select-table table-striped" >
<div>
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>合同编号:</label>
<input type="text" name="orderCode"/>
</li>
<li>
<label>合同名称:</label>
<input type="text" name="orderName"/>
</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 class="container-div">
<div class="col-sm-12 select-table table-striped">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>合同编号:</label>
<input type="text" name="orderCode"/>
</li>
<li>
<label>合同名称:</label>
<input type="text" name="orderName"/>
</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>
<table id="bootstrap-table"></table>
</div>
</div>
<table id="bootstrap-table"></table>
</div>
<th:block th:include="include :: footer" />
<script>
var prefixOrder = ctx + "manage/order";
$(function() {
@ -41,20 +38,14 @@
showColumns:false,
showToggle:false,
showRefresh:false,
pageSize:8,
showPageGo:true,
params:{
},
onClickRow:function (row,event) {
$(parent[parent.length-2].document).find("input[name='orderId']").val(row.id)
$(parent[parent.length-2].document).find("input[name='orderName']").val(row.orderName)
$.modal.close();
},
columns: [{
checkbox: false,
},
columns: [{
radio: true
},
{
field: 'id',
title: '主键',
@ -72,6 +63,10 @@
$.table.init(options);
});
function getSelections() {
var rows = $('#bootstrap-table').bootstrapTable('getSelections');
return rows;
}
</script>
</body>