Browse Source

[feat]报销单新增页修改样式

dev
zhangsiqi 5 months ago
parent
commit
0f40279813
  1. 102
      ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html

102
ruoyi-admin/src/main/resources/templates/system/baseExpense/add.html

@ -19,19 +19,19 @@
<div class="col-xs-4"> <div class="col-xs-4">
<label class="col-sm-6 control-label">部门:</label> <label class="col-sm-6 control-label">部门:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input name="deptName" class="form-control" type="text"> <input name="deptName" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<label class="col-sm-6 control-label">岗位:</label> <label class="col-sm-6 control-label">岗位:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input name="postName" class="form-control" type="text"> <input name="postName" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<label class="col-sm-6 control-label">姓名:</label> <label class="col-sm-6 control-label">姓名:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input name="fullName" class="form-control" type="text"> <input name="fullName" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
</div> </div>
@ -55,8 +55,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-6 control-label">供应商ID:</label> <label class="col-sm-6 control-label">供应商ID:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select name="supplierCode" class="form-control" th:with="supplierList=${@supplier.selectSysSupplierListAll()}"> <select id="supplierCode" name="supplierCode" class="form-control">
<option th:each="supplier : ${supplierList}" th:text="${supplier.supplierName}" th:value="${supplier.supplierCode}"></option>
</select> </select>
</div> </div>
</div> </div>
@ -94,40 +94,22 @@
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "system/baseExpense" var prefix = ctx + "system/baseExpense";
$("#form-baseExpense-add").validate({focusCleanup: true}); $("#form-baseExpense-add").validate({focusCleanup: true});
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; var costTypeDatas = [[${@category.getChildByCode('costType')}]];
var $table = $("#bootstrap-sub-table-expense"); var $table = $("#bootstrap-sub-table-expense");
var costTypes; var costType;
$(function() {
$.ajax({
url: prefix + "/getId",
type: "post",
dataType: "json",
success: function (result) {
if (result.code == 0) {
$("input[name='expenseCode']").val(result.data);
} else {
$.modal.msgError(result.msg);
}
}
});
// 假设此函数返回供应商列表
});
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
//获取子表信息 //获取子表信息
$(function() { $(function() {
getSelections();
var options = { var options = {
id:'bootstrap-sub-table-expense', id:'bootstrap-sub-table-expense',
pagination: false, pagination: false,
sidePagination: "client",
model: "报销单数据", model: "报销单数据",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
@ -190,7 +172,57 @@
], ],
}; };
$.table.init(options); $.table.init(options);
$.ajax({
url: prefix + "/getId",
type: "post",
dataType: "json",
success: function (result) {
if (result.code == 0) {
$("input[name='expenseCode']").val(result.data);
} else {
$.modal.msgError(result.msg);
}
}
})
// 假设此函数返回供应商列表
$("#supplierCode").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: '/system/supplier/getSupplier',
dataType: 'json',
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.rows;
for(let i in resultList){
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
options.push(option);
}
}
return {
results: options
};
}
}
}); });
});
$('#supplierCode').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='corporatePayee']").val(data.supplierName);
$("input[name='corporateReceivingAccount']").val(data.bankAccount);
$("input[name='publicAccountBanks']").val(data.depositBank);
});
// function costTypeFormatter(value,row,index){
// var costType = $.common.selectArrayValue(costTypeDatas,value);
// return costType;
// }
function insertRow() { function insertRow() {
$table.bootstrapTable('insertRow', { $table.bootstrapTable('insertRow', {
index:1, index:1,
@ -277,6 +309,18 @@
// 更新行数据 // 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
} }
function getSelections(){
$.ajax({
url: ctx + "system/requisitioning/getEmpUserName",
type: "get",
dataType: "json",
success: function (data) {
$("input[name='deptName']").val(data.deptName);
$("input[name='fullName']").val(data.userName);
$("input[name='postName']").val(data.postName);
}
});
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save