123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- @{
- ViewBag.Title = "机构管理";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script>
- var keyValue = request('keyValue');
- var parentId = request('parentId');
- $(function () {
- initControl();
- })
- //初始化控件
- function initControl() {
- //上级公司
- $("#ParentId").ComboBoxTree({
- url: "../../BaseManage/Organize/GetTreeJson",
- description: "==请选择==",
- height: "260px",
- allowSearch: true
- });
- //公司性质
- $("#Nature").ComboBox({
- url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
- param: { EnCode: "CompanyNature" },
- id: "ItemValue",
- text: "ItemName",
- description: "==请选择==",
- height: "200px"
- });
- //负责人
- $("#ManagerId").ComboBoxTree({
- url: "../../BaseManage/User/GetTreeJson",
- description: "==请选择==",
- height: "220px",
- allowSearch: true
- });
- //省份
- $("#ProvinceId").ComboBox({
- url: "../../SystemManage/Area/GetAreaListJson",
- param: { parentId: "0" },
- id: "AreaCode",
- text: "AreaName",
- description: "选择省",
- height: "170px"
- }).bind("change", function () {
- var value = $(this).attr('data-value');
- $("#CityId").ComboBox({
- url: "../../SystemManage/Area/GetAreaListJson",
- param: { parentId: value },
- id: "AreaCode",
- text: "AreaName",
- description: "选择市",
- height: "170px"
- });
- });
- //城市
- $("#CityId").ComboBox({
- description: "选择市",
- height: "170px"
- }).bind("change", function () {
- var value = $(this).attr('data-value');
- if (value) {
- $("#CountyId").ComboBox({
- url: "../../SystemManage/Area/GetAreaListJson",
- param: { parentId: value },
- id: "AreaCode",
- text: "AreaName",
- description: "选择县/区",
- height: "170px"
- });
- }
- });
- //县/区
- $("#CountyId").ComboBox({
- description: "选择县/区",
- height: "170px"
- });
- //获取表单
- if (!!keyValue) {
- $.SetForm({
- url: "../../BaseManage/Organize/GetFormJson",
- param: { keyValue: keyValue },
- success: function (data) {
- $("#form1").SetWebControls(data);
- $("#FoundedTime").val(formatDate(data.FoundedTime, "yyyy-MM-dd"));
- $("#ProvinceId").trigger("change");
- if (data.CityId != undefined) {
- $("#CityId").ComboBoxSetValue(data.CityId).trigger("change");
- $("#CountyId").ComboBoxSetValue(data.CountyId);
- }
- }
- });
- } else {
- $("#ParentId").ComboBoxTreeSetValue(parentId);
- }
- }
- //保存表单
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = $("#form1").GetWebControls(keyValue);
- postData["Manager"] = $("#ManagerId").attr('data-text');
- if (postData["ParentId"] == "") {
- postData["ParentId"] = 0;
- }
- $.SaveForm({
- url: "../../BaseManage/Organize/SaveForm?keyValue=" + keyValue,
- param: postData,
- loading: "正在保存数据...",
- success: function () {
- $.currentIframe().$("#gridTable").resetSelection();
- $.currentIframe().$("#gridTable").trigger("reloadGrid");
- }
- })
- }
- </script>
- <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
- <table class="form">
- <tr>
- <th class="formTitle">公司名称<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="FullName" type="text" onblur="$.ExistField(this.id,'../../BaseManage/Organize/ExistFullName')" class="form-control" />
- </td>
- <th class="formTitle">公司性质</th>
- <td class="formValue">
- <div id="Nature" type="select" class="ui-select">
- </div>
- </td>
- </tr>
- <tr>
- <th class="formTitle">外文名称</th>
- <td class="formValue">
- <input id="EnCode" type="text" onblur="$.ExistField(this.id,'../../BaseManage/Organize/ExistEnCode')" class="form-control" />
- </td>
- <th class="formTitle">中文名称</th>
- <td class="formValue">
- <input id="ShortName" type="text" onblur="$.ExistField(this.id,'../../BaseManage/Organize/ExistShortName')" class="form-control" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">上级公司</th>
- <td class="formValue">
- <div id="ParentId" type="selectTree" class="ui-select">
- </div>
- </td>
- <th class="formTitle">成立时间</th>
- <td class="formValue">
- <input id="FoundedTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">负责人</th>
- <td class="formValue">
- <div id="ManagerId" type="selectTree" class="ui-select"></div>
- </td>
- <th class="formTitle">电话</th>
- <td class="formValue">
- <input id="OuterPhone" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">电子邮箱</th>
- <td class="formValue">
- <input id="Email" type="text" class="form-control" />
- </td>
- <th class="formTitle">传真</th>
- <td class="formValue">
- <input id="Fax" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">公司地点</th>
- <td class="formValue" colspan="3">
- <div style="float: left; width: 255px;">
- <div id="ProvinceId" type="select" class="ui-select" style="float: left; width: 84px; margin-right: 1px;"></div>
- <div id="CityId" type="select" class="ui-select" style="float: left; width: 84px; margin-right: 1px;"></div>
- <div id="CountyId" type="select" class="ui-select" style="float: left; width: 84px; margin-right: 1px;"></div>
- </div>
- <div style="margin: 0 auto; width: 100%;">
- <input id="Address" type="text" class="form-control" style="float: left; width: 355px;" />
- </div>
- </td>
- </tr>
- <tr>
- <th class="formTitle">邮编</th>
- <td class="formValue">
- <input id="Postalcode" type="text" class="form-control" />
- </td>
- <th class="formTitle">公司官网</th>
- <td class="formValue">
- <input id="WebAddress" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">经营范围
- </th>
- <td class="formValue" colspan="3">
- <input id="BusinessScope" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <th class="formTitle" valign="top" style="padding-top: 4px;">备注
- </th>
- <td class="formValue" colspan="3">
- <textarea id="Description" class="form-control" style="height: 70px;"></textarea>
- </td>
- </tr>
- </table>
- </div>
|