Files
zszq-trs/YLErpWeb/Views/MarginCalculation/MarginCalculationThresholdEdit.cshtml
T
2024-05-09 14:06:26 +08:00

79 lines
3.0 KiB
Plaintext

@model MarginCalculationThreshold
@{
ViewBag.Title = "预付金系数 | 编辑";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
var pageObj = new
{
isNew = Model.id == 0
};
}
@section CSS{
<style>
.form-layout input, .form-layout select {
width: 220px;
}
.form-layout .form-label, .form-layout .formlabel {
width: 140px;
}
</style>
<link href="~/Statics/libs/datetime/flatpickr/flatpickr.min.css" rel="stylesheet" />
}
@section JS{
<script>
var page = @Json.Serialize(pageObj);
</script>
<script src="~/Scripts/app/tradeHelper.js?v=@HtmlUtil.JsVersion"></script>
<script src="~/Statics/libs/datetime/flatpickr/flatpickr.min.js?v=@(HtmlUtil.JsVersion)"></script>
<script type="text/javascript">
function checkSubmitData() {
if (!$("#TakeEffectDate").val()) {
main.message("生效日期不能为空");
return false;
}
var pass = $('#form1').valid();
return pass;
}
function saveMarginCalculationThreshold() {
if (!checkSubmitData()) return false;
var data = $("#form1").serialize();
main.post("/MarginCalculation/MarginCalculationThresholdEditJson", data).done(function (res) {
layer.closeMe();
window.parent.reload();
});
}
$(function () {
$(".datepicker").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true });
const fp = flatpickr(".form_datetime", {
enableTime: true, dateFormat: "Y-m-d H:i",
allowInput: true, time_24hr: true
});
})
</script>
}
<form id="form1" method="post" autocomplete="off">
<div class="form-layout">
@Html.HiddenFor(model => model.id)
@Html.HiddenFor(model => model.EncryptId)
@Html.MyDropdownFor(model => model.ClientId, ClientDataModel.GetAllClient())
<div class="form-group col-md-6">
<label class="formlabel">预付金计算阈值</label>
<input class="text-box" type="text" value="@(Model.MarginCalcuThreshold)" name="MarginCalcuThreshold" id="MarginCalcuThreshold">
</div>
<div class="form-group col-md-6">
<label class="formlabel">生效日期:</label>
<input class="search-input datepicker" id="TakeEffectDate" name="TakeEffectDate" value="@(Model.id == 0 ? "" : Model.TakeEffectDate.ToString("yyyy-MM-dd"))" type="text" autocomplete="off" required="required">
<span style="color:red">*</span>
</div>
</div>
<div class="form-buttons">
<button class="btn btn-primary " type="button" onclick="saveMarginCalculationThreshold();">保存</button>
<button class="btn btn-primary " type="button" onclick="layer.closeMe();">关闭</button>
</div>
</form>