场所出入登记修改

pg_adapter
dshclm 8 months ago
parent b07e86ddb4
commit 7711bbce58

@ -16,7 +16,7 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">场所名称:</label>
<div class="col-sm-8">
<select id="placeName" name="placeName" onchange="doPlaceName()" required class="form-control">
<select id="placeName" onchange="doPlaceName()" required class="form-control">
<option value="">请选择场所名称</option>
</select>
</div>
@ -150,9 +150,11 @@
}
});
});
var placeName = ''
function doPlaceName(){
var selectedOption = $('#placeName option:selected');
var placeId = selectedOption.val();
placeName = selectedOption.text();
$("input[name='placeId']").val(placeId);
}
function selectDeptTree() {
@ -176,8 +178,10 @@
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-placeRegist-add').serialize());
console.log($('#form-placeRegist-add').serialize());
var data = $("#form-placeRegist-add").serializeArray();
data.push({"name": "placeName", "value": placeName});
$.operate.save(prefix + "/add", data);
console.log(data);
}
}
</script>

@ -17,7 +17,7 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">场所名称:</label>
<div class="col-sm-8">
<select id="placeName" name="placeName" onchange="doPlaceName()" required class="form-control">
<select id="placeName" onchange="doPlaceName()" required class="form-control">
<option value="">请选择场所名称</option>
</select>
</div>
@ -158,10 +158,11 @@
}
});
});
var placeName = ''
function doPlaceName(){
var selectedOption = $('#placeName option:selected');
var placeId = selectedOption.val();
placeName = selectedOption.text();
$("input[name='placeId']").val(placeId);
}
function selectDeptTree() {
@ -185,7 +186,9 @@
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-placeRegist-edit').serialize());
var data = $("#form-placeRegist-edit").serializeArray();
data.push({"name": "placeName", "value": placeName});
$.operate.save(prefix + "/edit",data);
console.log($('#form-placeRegist-edit').serialize());
}
}

@ -14,6 +14,14 @@
<label>场所名称:</label>
<input type="text" name="placeName"></input>
</li>
<li>
<label>登记人员:</label>
<input type="text" name="registName"></input>
</li>
<li>
<label>登记日期:</label>
<input type="text" class="time-input" placeholder="请选择登记日期" name="registTime"/>
</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>
@ -45,23 +53,6 @@
var editFlag = [[${@permission.hasPermi('system:placeRegist:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:placeRegist:remove')}]];
var prefix = ctx + "system/placeRegist";
var placeCache = {};
// 预加载数据函数
function loadPlacesData() {
var apiUrl = ctx + 'system/place/getList';
return $.ajax({
url: apiUrl,
method: 'POST',
dataType: 'json'
}).done(function(data) {
data.data.forEach(function(item) {
placeCache[item.id] = item.placeName;
});
}).fail(function(xhr, status, error) {
console.error('预加载数据失败:', error);
});
}
$(function() {
var options = {
url: prefix + "/list",
@ -86,9 +77,6 @@
{
field: 'placeName',
title: '场所名称',
formatter:function (value, row, index){
return placeCache[value] || '加载中...';
}
},
{
field: 'registName',
@ -161,11 +149,6 @@
};
$.table.init(options);
});
$(document).ready(function() {
loadPlacesData().done(function() {
$('#bootstrap-table').bootstrapTable('refresh');
});
});
</script>
</body>
</html>

Loading…
Cancel
Save