Form.cshtml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. @{;
  2. ViewBag.Title = "表单页面";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. $(function () {
  8. initControl();
  9. });
  10. //初始化控件
  11. function initControl() {
  12. //商机类别
  13. $("#ChanceTypeId").ComboBox({
  14. url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
  15. param: { EnCode: "Client_ChanceSort" },
  16. id: "ItemValue",
  17. text: "ItemName",
  18. description: "==请选择==",
  19. height: "200px"
  20. });
  21. //商机来源
  22. $("#SourceId").ComboBox({
  23. url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
  24. param: { EnCode: "Client_ChanceSource" },
  25. id: "ItemValue",
  26. text: "ItemName",
  27. description: "==请选择==",
  28. height: "200px"
  29. });
  30. //商机阶段
  31. $("#StageId").ComboBox({
  32. url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
  33. param: { EnCode: "Client_ChancePhase" },
  34. id: "ItemValue",
  35. text: "ItemName",
  36. description: "==请选择==",
  37. height: "200px"
  38. });
  39. //跟进人员
  40. $("#TraceUserId").ComboBoxTree({
  41. url: "../../BaseManage/User/GetTreeJson",
  42. description: "==请选择==",
  43. height: "200px",
  44. allowSearch: true
  45. });
  46. //公司行业
  47. $("#CompanyNatureId").ComboBox({
  48. url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
  49. param: { EnCode: "Client_Trade" },
  50. id: "ItemValue",
  51. text: "ItemName",
  52. description: "==请选择==",
  53. height: "200px"
  54. });
  55. //所在省份
  56. $("#Province").ComboBox({
  57. url: "../../SystemManage/Area/GetAreaListJson",
  58. param: { parentId: "0" },
  59. id: "AreaCode",
  60. text: "AreaName",
  61. description: "==选择省==",
  62. height: "170px"
  63. }).bind("change", function () {
  64. var value = $(this).attr('data-value');
  65. $("#City").ComboBox({
  66. url: "../../SystemManage/Area/GetAreaListJson",
  67. param: { parentId: value },
  68. id: "AreaCode",
  69. text: "AreaName",
  70. description: "==选择市==",
  71. height: "170px"
  72. });
  73. });
  74. //所在城市
  75. $("#City").ComboBox({
  76. description: "==选择市==",
  77. height: "170px"
  78. });
  79. //获取表单
  80. if (!!keyValue) {
  81. $.SetForm({
  82. url: "../../CustomerManage/Chance/GetFormJson",
  83. param: { keyValue: keyValue },
  84. success: function (data) {
  85. $("#form1").SetWebControls(data);
  86. $("#Province").trigger("change"); $("#City").ComboBoxSetValue(data.City)
  87. }
  88. })
  89. }
  90. }
  91. //保存表单;
  92. function AcceptClick() {
  93. if (!$('#form1').Validform()) {
  94. return false;
  95. }
  96. var postData = $("#form1").GetWebControls(keyValue);
  97. postData["TraceUserName"] = $("#TraceUserId").attr('data-text');
  98. $.SaveForm({
  99. url: "../../CustomerManage/Chance/SaveForm?keyValue=" + keyValue,
  100. param: postData,
  101. loading: "正在保存数据...",
  102. success: function () {
  103. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  104. }
  105. })
  106. }
  107. </script>
  108. <div style="margin-top: 20px; margin-right: 20px;">
  109. <table class="form">
  110. <tr>
  111. <td class="formTitle">商机编号<font face="宋体">*</font></td>
  112. <td class="formValue">
  113. <input id="EnCode" type="text" class="form-control" value="@ViewBag.EnCode" isvalid="yes" checkexpession="NotNull" />
  114. </td>
  115. <td class="formTitle">商机名称<font face="宋体">*</font></td>
  116. <td class="formValue">
  117. <input id="FullName" type="text" onblur="$.ExistField(this.id,'../../CustomerManage/Chance/ExistFullName')" class="form-control" isvalid="yes" checkexpession="NotNull" />
  118. </td>
  119. </tr>
  120. <tr>
  121. <td class="formTitle">预计金额<font face="宋体">*</font></td>
  122. <td class="formValue">
  123. <input id="Amount" type="text" class="form-control" value="0.00" isvalid="yes" checkexpession="Double" />
  124. </td>
  125. <td class="formTitle">预计利润<font face="宋体">*</font></td>
  126. <td class="formValue">
  127. <input id="Profit" type="text" class="form-control" value="0.00" isvalid="yes" checkexpession="Double" />
  128. </td>
  129. </tr>
  130. <tr>
  131. <td class="formTitle">预计成交</td>
  132. <td class="formValue">
  133. <input id="DealDate" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
  134. </td>
  135. <td class="formTitle">销售费用</td>
  136. <td class="formValue">
  137. <input id="SaleCost" type="text" class="form-control" isvalid="yes" checkexpession="DoubleOrNull" />
  138. </td>
  139. </tr>
  140. <tr>
  141. <td class="formTitle">商机类别</td>
  142. <td class="formValue">
  143. <div id="ChanceTypeId" type="select" class="ui-select"></div>
  144. </td>
  145. <td class="formTitle">商机来源<font face="宋体">*</font></td>
  146. <td class="formValue">
  147. <div id="SourceId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td class="formTitle">商机阶段<font face="宋体">*</font></td>
  152. <td class="formValue">
  153. <div id="StageId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
  154. </td>
  155. <td class="formTitle">成功率%<font face="宋体">*</font></td>
  156. <td class="formValue">
  157. <input id="SuccessRate" type="text" class="form-control" isvalid="yes" checkexpession="Double" />
  158. </td>
  159. </tr>
  160. <tr>
  161. <td class="formTitle">公司名称<font face="宋体">*</font></td>
  162. <td class="formValue">
  163. <input id="CompanyName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
  164. </td>
  165. <td class="formTitle">跟进人员<font face="宋体">*</font></td>
  166. <td class="formValue">
  167. <div id="TraceUserId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td class="formTitle">公司行业</td>
  172. <td class="formValue">
  173. <div id="CompanyNatureId" type="select" class="ui-select"></div>
  174. </td>
  175. <td class="formTitle">公司网站</td>
  176. <td class="formValue">
  177. <input id="CompanySite" type="text" class="form-control" />
  178. </td>
  179. </tr>
  180. <tr>
  181. <td class="formTitle">公司情况</td>
  182. <td class="formValue" colspan="3">
  183. <input id="CompanyDesc" type="text" class="form-control" />
  184. </td>
  185. </tr>
  186. <tr>
  187. <td class="formTitle">公司地址</td>
  188. <td class="formValue" colspan="3">
  189. <input id="CompanyAddress" type="text" class="form-control" />
  190. </td>
  191. </tr>
  192. <tr>
  193. <td class="formTitle">所在省份</td>
  194. <td class="formValue">
  195. <div id="Province" type="select" class="ui-select"></div>
  196. </td>
  197. <td class="formTitle">所在城市</td>
  198. <td class="formValue">
  199. <div id="City" type="select" class="ui-select"></div>
  200. </td>
  201. </tr>
  202. <tr>
  203. <td class="formTitle">联系人<font face="宋体">*</font></td>
  204. <td class="formValue">
  205. <input id="Contacts" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
  206. </td>
  207. <td class="formTitle">手机</td>
  208. <td class="formValue">
  209. <input id="Mobile" type="text" class="form-control" />
  210. </td>
  211. </tr>
  212. <tr>
  213. <td class="formTitle">电话</td>
  214. <td class="formValue">
  215. <input id="Tel" type="text" class="form-control" />
  216. </td>
  217. <td class="formTitle">传真</td>
  218. <td class="formValue">
  219. <input id="Fax" type="text" class="form-control" />
  220. </td>
  221. </tr>
  222. <tr>
  223. <td class="formTitle">QQ</td>
  224. <td class="formValue">
  225. <input id="QQ" type="text" class="form-control" />
  226. </td>
  227. <td class="formTitle">Email</td>
  228. <td class="formValue">
  229. <input id="Email" type="text" class="form-control" />
  230. </td>
  231. </tr>
  232. <tr>
  233. <td class="formTitle">微信</td>
  234. <td class="formValue">
  235. <input id="Wechat" type="text" class="form-control" />
  236. </td>
  237. <td class="formTitle">爱好</td>
  238. <td class="formValue">
  239. <input id="Hobby" type="text" class="form-control" />
  240. </td>
  241. </tr>
  242. <tr>
  243. <td class="formTitle">备注</td>
  244. <td class="formValue" colspan="3">
  245. <input id="Description" type="text" class="form-control" />
  246. </td>
  247. </tr>
  248. </table>
  249. </div>