1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- @{;
- ViewBag.Title = "表单页面";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- $(function () {
- initControl();
- });
- //初始化控件
- function initControl() {
- //客户名称
- $("#CustomerId").ComboBox({
- url: "../../CustomerManage/Customer/GetListJson",
- id: "CustomerId",
- text: "FullName",
- description: "==请选择==",
- height: "220px",
- allowSearch: true
- });
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "../../CustomerManage/Invoice/GetFormJson",
- param: { keyValue: keyValue },
- success: function (data) {
- $("#form1").SetWebControls(data);
- }
- })
- }
- }
- //保存表单;
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = $("#form1").GetWebControls(keyValue);
- postData["CustomerName"] = $("#CustomerId").attr('data-text');
- $.SaveForm({
- url: "../../CustomerManage/Invoice/SaveForm?keyValue=" + keyValue,
- param: postData,
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#gridTable").trigger("reloadGrid");
- }
- })
- }
- </script>
- <div style="margin-top: 20px; margin-right: 30px;">
- <table class="form">
- <tr>
- <th class="formTitle" >客户名称</th>
- <td class="formValue">
- <div id="CustomerId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
- </td>
- </tr>
- <tr>
- <th class="formTitle" valign="top" style="padding-top: 4px;">开票信息</th>
- <td class="formValue">
- <textarea id="InvoiceContent" class="form-control" style="height: 230px;" isvalid="yes" checkexpession="NotNull"></textarea>
- </td>
- </tr>
- </table>
- </div>
|