万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

215 lines
8.2 KiB

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改税发票列表')"/>
<th:block th:include="include :: datetimepicker-css"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
<style type="text/css">
.select2-container--open {
z-index: 9999999
}
</style>
</head>
<body class="white-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12">
</div>
<form class="form-horizontal m" id="form-poinvoicehead-edit" th:object="${poInvoiceHead}">
<input name="invoiceid" th:field="*{invoiceid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">发票号:</label>
<div class="col-sm-8">
<input name="Invoiceno" th:field="*{Invoiceno}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">厂商代码:</label>
<div class="col-sm-8">
<select name="pCode" class="form-control m-b" disabled>
<option value="-1">--请选择--</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">厂商名称:</label>
<div class="col-sm-8">
<select name="pName" class="form-control m-b">
<option value="-1">--请选择--</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 name="invoicedate"
th:value="${#dates.format(poInvoiceHead.invoicedate, 'yyyy-MM-dd')}"
class="form-control time-input" placeholder="yyyy-MM-dd" 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">
<select class="form-control" name="crlName" id="crlName"
th:with="type=${@dict.getType('sys_coin_class')}">
<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">
<input name="taxInvoiceNo" th:field="*{taxInvoiceNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">发票印字版号:</label>
<div class="col-sm-8">
<input name="taxPrintVersion" th:field="*{taxPrintVersion}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">发票金额:</label>
<div class="col-sm-8">
<input name="totalamt" th:field="*{totalamt}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">实付金额:</label>
<div class="col-sm-8">
<input name="getmoney" th:field="*{getmoney}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">此次支付金额:</label>
<div class="col-sm-8">
<input name="getmoney" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款备注:</label>
<div class="col-sm-8">
<textarea name="getmoneyMemotext" class="form-control">[[*{getmoneyMemotext}]]</textarea>
</div>
</div>
</form>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
let prefix = ctx + "invoice/poInvoicePay";
$("#form-poinvoicehead-edit").validate({
focusCleanup: true
});
function submitHandler() {
submit();
}
let getData = [[${poInvoiceHead}]];
$("select[name='crlName']").val(getData.crlName).trigger("change");
//模态框select2可输入
$.fn.modal.Constructor.prototype.enforceFocus = function () {
};
//获取供应商编号和名称
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/all",
type: "post",
resultType: "json",
success: function (resp) {
if (resp.data.length > 0) {
$("select [name='pCode']").empty();
$("select [name='pName']").empty();
let data = resp.data;
for (let i in data) {
//alert(data[i].pCode);
$("select[name='pCode']").append("<option value='" + data[i].pCode + "'>" + data[i].pCode + "</option>");
$("select[name='pName']").append("<option value='" + data[i].pName + "'>" + data[i].pName + "</option>");
}
$("select[name='pName']").val(getData.pName).select2();
$("select[name='pCode']").val(getData.pCode).select2();
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
//供应商名称改变时改变供应商编号
$("select[name='pName']").change(function () {
if ($(this).attr("id") === "pName") {
return false;
}
let pName = $(this).val();
$.ajax({
url: ctx + "ProviderPrice/ProviderPrice/findOne",
data: {"pName": pName},
type: "post",
resultType: "json",
success: function (resp) {
$("select[name='pCode']").val(resp.data.pCode).trigger("change");
},
error: function () {
$.modal.msgError("出错了!");
}
})
});
// //关闭模态框并刷新
// function closeModal() {
// $("#itemModal").modal("hide");
// reset();
// $("#itemTable2").bootstrapTable("removeAll");
// }
//提交修改
function submit() {
let formData = new FormData($("#form-poinvoicehead-edit")[0]);
//formData.append("poInvoiceListList", JSON.stringify(bootstrapTable));
let data = {};
formData.forEach((value, key) => data[key] = value);
//alert(JSON.stringify(data1));
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: {"jsonStr": JSON.stringify(data)},
success: function (resp) {
if (resp.code === 0) {
alert("修改成功!");
//window.location.href = prefix;\
var index = parent.layer.getFrameIndex(window.name);
var parent2 = window.parent;
parent2.$.table.refresh();
parent.layer.close(index);//关闭当前页
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
</script>
</body>
</html>