Forma - 副本 (2).cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. @using LeaRun.Application.Entity.InstallManage
  2. @{
  3. ViewBag.Title = "添加产品";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. List<InstallMaterialTypeEntity> lstType = ViewBag.databaseType as List<InstallMaterialTypeEntity>;
  6. List<InstallMaterialGoodsEntity> lstGoods = ViewBag.databaseGoods as List<InstallMaterialGoodsEntity>;
  7. //List<InstallMaterialGoodsEntity> lstGoodsTemp = null;
  8. List<InstallMaterialUnitEntity> lstUnit = ViewBag.databaseUnit as List<InstallMaterialUnitEntity>;
  9. }
  10. <script>
  11. var keyValue = request('keyValue');
  12. $(function () {
  13. //function checkField(d) {
  14. // $("#myGoodsSpec").val(我是传奇);
  15. // //alert("规格型号是 " + d);
  16. //}
  17. initControl();
  18. });
  19. //初始化控件
  20. function initControl() {
  21. //材料名称
  22. $("#name").ComboBox({
  23. description: "==请选择110==",
  24. height: "200px",
  25. });
  26. //材料型号
  27. $("#Version").ComboBox({
  28. description: "==请选择110==",
  29. height: "200px",
  30. });
  31. //单位
  32. $("#unit").ComboBox({
  33. description: "==请选择110==",
  34. height: "200px",
  35. });
  36. //材料类别
  37. $("#Type").ComboBox({
  38. description: "==请选择110==",
  39. height: "200px",
  40. });
  41. $("#myGoodsName").ComboBox({
  42. description: "==请选择==",
  43. height: "200px",
  44. });
  45. //获取表单 界面加载的时候从数据库取得数据加载到界面
  46. //if (!!keyValue) {
  47. // $.SetForm({
  48. // url: "../../InstallManage/Dudget/GetBudgetDetail",
  49. // //param: { keyValue: keyValue },
  50. // success: function (data) {
  51. // $("#form1").SetWebControls(data);
  52. // }
  53. // })
  54. //}
  55. }
  56. //保存表单;
  57. function AcceptClick() {
  58. if (!$('#form1').Validform()) {
  59. return false;
  60. }
  61. var postData = $("#form1").GetWebControls(keyValue);
  62. postData["TraceUserName"] = $("#TraceUserId").attr('data-text');
  63. $.SaveForm({
  64. url: "../../InstallManage/Dudget/SaveForma?applyId=" + keyValue,
  65. param: postData,
  66. loading: "正在保存数据...",
  67. success: function () {
  68. //var a = document.getElementById('Form').contentWindow.document;
  69. //var b = a.getElementById('gridTableForm');
  70. ////$(b).trigger("reloadGrid");
  71. //var c = $(b);
  72. //c.context = a;
  73. //c.selector = '#gridTableForm';
  74. //c.trigger("reloadGrid");
  75. // $("#gridTableForm").trigger("reloadGrid");
  76. // console.log($("#gridTableForm").context.getElementById('gridTableForm'));
  77. $.currentIframe().$("#gridTableForm").trigger("reloadGrid");
  78. }
  79. })
  80. }
  81. </script>
  82. <script>
  83. function checkField(d) {
  84. $("#myGoodsSpec").val(d);
  85. //alert("规格型号是 " + d );
  86. }
  87. function MaterialClick(val) {
  88. //lstGoodsTemp = lstGoods;
  89. alert(lstGoods);
  90. }
  91. </script>
  92. <div style="margin-top: 20px; margin-right: 30px;">
  93. <table class="form">
  94. @*<tr>
  95. <td class="formTitle">客户名称<font face="宋体">*</font></td>
  96. <td class="formValue">
  97. <input id="FullName" type="text" onblur="$.ExistField(this.id,'../../CustomerManage/Customer/ExistFullName')" class="form-control" />
  98. </td>
  99. <td class="formTitle">客户简称<font face="宋体">*</font></td>
  100. <td class="formValue">
  101. <input id="ShortName" type="text" class="form-control" />
  102. </td>
  103. </tr>*@
  104. <tr>
  105. <td class="formTitle">材料类别<font face="宋体">*</font></td>
  106. <td class="formValue">
  107. <div id="Type" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
  108. <ul>
  109. @foreach (var item in lstType)
  110. {
  111. <li data-value="@item.MaterialId" onclick="MaterialClick('@item.MaterialId')">@item.Name</li>
  112. }
  113. </ul>
  114. </div>
  115. @*<div>
  116. <span>
  117. <select id="myType" required="required" style="width: 250px;">
  118. <option>==请选择==</option>
  119. @foreach (var item in lstType)
  120. {
  121. <option value="@item.MaterialId">@item.Name</option>
  122. }
  123. </select>
  124. </span>
  125. </div>*@
  126. </td>
  127. <td class="formTitle">材料名称<font face="宋体">*</font></td>
  128. <td class="formValue">
  129. <div id="name" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
  130. <ul>
  131. @foreach (var item in lstGoods)
  132. {
  133. <li data-value="@item.GoodId" mydata="@item.Specifications" onclick="checkField('@item.Specifications')">@item.Name</li>
  134. }
  135. </ul>
  136. </div>
  137. @*<select onclick="checkField(options[this.options.selectedIndex].getAttribute('mydata'))">
  138. @foreach (var item in lstGoods)
  139. {
  140. <option value="@item.GoodId" mydata="@item.Specifications">@item.Name</option>
  141. }
  142. </select>*@
  143. </td>
  144. </tr>
  145. <tr>
  146. <td class="formTitle">材料型号<font face="宋体">*</font>
  147. </td>
  148. <td class="formValue">
  149. <div>
  150. <span>
  151. <input type="text" name="myGoodsSpec" value="" id="myGoodsSpec" readonly="true" style="width: 260px; height: 28px;" />
  152. </span>
  153. </div>
  154. </td>
  155. <td class="formTitle">计量单位<font face="宋体">*</font></td>
  156. <td class="formValue">
  157. <div id="unit" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
  158. <ul>
  159. @foreach (var item in lstUnit)
  160. {
  161. <li data-value="@item.UnitId">@item.CalculateUnit</li>
  162. }
  163. </ul>
  164. </div>
  165. @*<div>
  166. <span>
  167. <select id="myUnit" required="required" style="width: 250px;">
  168. <option>==请选择==</option>
  169. @foreach (var item in lstUnit)
  170. {
  171. <option value="@item.UnitId">@item.CalculateUnit</option>
  172. }
  173. </select>
  174. </span>
  175. </div>*@
  176. </td>
  177. </tr>
  178. <tr>
  179. <td class="formTitle">数量</td>
  180. <td class="formValue">
  181. <input id="number" type="number" class="form-control" style="width: 260px;" />
  182. </td>
  183. <td class="formTitle">单价(元)</td>
  184. <td class="formValue">
  185. <input id="price" type="number" class="form-control" style="width: 260px;" />
  186. </td>
  187. </tr>
  188. <tr>
  189. <td class="formTitle">人工费(元)</td>
  190. <td class="formValue">
  191. <input id="LabourCost" type="number" class="form-control" style="width: 260px;" />
  192. </td>
  193. </tr>
  194. @*<tr>
  195. <td class="formTitle">公司情况</td>
  196. <td class="formValue" colspan='3'>
  197. <input id="CompanyDesc" type="text" class="form-control" />
  198. </td>
  199. </tr>
  200. <tr>
  201. <td class="formTitle">公司地址</td>
  202. <td class="formValue" colspan='3'>
  203. <input id="CompanyAddress" type="text" class="form-control" />
  204. </td>
  205. </tr>
  206. <tr>
  207. <td class="formTitle">所在省份</td>
  208. <td class="formValue">
  209. <div id="Province" type="select" class="ui-select"></div>
  210. </td>
  211. <td class="formTitle">所在城市</td>
  212. <td class="formValue">
  213. <div id="City" type="select" class="ui-select"></div>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td class="formTitle">联系人<font face="宋体">*</font></td>
  218. <td class="formValue">
  219. <input id="Contact" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
  220. </td>
  221. <td class="formTitle">手机</td>
  222. <td class="formValue">
  223. <input id="Mobile" type="text" class="form-control" />
  224. </td>
  225. </tr>
  226. <tr>
  227. <td class="formTitle">电话</td>
  228. <td class="formValue">
  229. <input id="Tel" type="text" class="form-control" />
  230. </td>
  231. <td class="formTitle">传真</td>
  232. <td class="formValue">
  233. <input id="Fax" type="text" class="form-control" />
  234. </td>
  235. </tr>
  236. <tr>
  237. <td class="formTitle">QQ</td>
  238. <td class="formValue">
  239. <input id="QQ" type="text" class="form-control" />
  240. </td>
  241. <td class="formTitle">Email</td>
  242. <td class="formValue">
  243. <input id="Email" type="text" class="form-control" />
  244. </td>
  245. </tr>
  246. <tr>
  247. <td class="formTitle">微信</td>
  248. <td class="formValue">
  249. <input id="Wechat" type="text" class="form-control" />
  250. </td>
  251. <td class="formTitle">爱好</td>
  252. <td class="formValue">
  253. <input id="Hobby" type="text" class="form-control" />
  254. </td>
  255. </tr>*@
  256. <tr>
  257. <td class="formTitle">备注</td>
  258. <td class="formValue" colspan='3'>
  259. <textarea id="Description" class="form-control" style="height: 50px;"></textarea>
  260. </td>
  261. </tr>
  262. </table>
  263. </div>