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.

375 lines
16 KiB

1 month ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. var ID = $.request("ID");
  7. var WorkPoints = $.request("WorkPoint");
  8. $(function () {
  9. debugger;
  10. InitControl3();
  11. var BidUser = $("#BidUser");
  12. BidUser.select2({
  13. allowClear: true,
  14. escapeMarkup: function (m) {
  15. return m;
  16. }
  17. });
  18. $.ajax({
  19. url: "/SRM/BicDoc_Publish/GetBidUser" + "?" + Math.random() + "&WorkPoint=" + WorkPoints,
  20. dataType: "json",
  21. async: false,
  22. success: function (data) {
  23. $.each(data, function (index, item) {
  24. BidUser.append("<option value='" + item.F_ItemCode + "'>" + item.F_ItemName + "</option>");
  25. });
  26. }
  27. });
  28. if (ID == null || ID == "") {
  29. debugger;
  30. ID = GUID();
  31. $.ajax({
  32. url: "/SRM/BicDoc_Publish/InsertID" + "?" + Math.random(),
  33. data: {
  34. ID: ID
  35. },
  36. dataType: "json",
  37. async: false,
  38. success: function (data) {
  39. $("#txtID").val(data.GUID);
  40. }
  41. });
  42. $("#txtID").val(ID);
  43. }
  44. else {
  45. debugger;
  46. $.ajax({
  47. url: "/SRM/BicDoc_Publish/GetFormDetail?" + Math.random(),
  48. data: {
  49. ID: ID,
  50. WorkPoint: WorkPoints
  51. },
  52. dataType: "json",
  53. async: false,
  54. success: function (data) {
  55. if (data.state == "error") {
  56. layer.msg(data.message);
  57. }
  58. else {
  59. $("#BidUser option:contains('" + data.BidUser + "')").attr('selected', true).trigger("change");
  60. //$("#BidUser").val(data.BidUser).trigger("change");
  61. $("#sel_WorkPoint").val(data.WorkPoint).trigger("change");
  62. $("#txtBidStatus").val(data.BidStatus);
  63. $("#txtBidName").val(data.BidName);
  64. $("#txtStarTime").val(data.StarTime);
  65. $("#txtEndTime").val(data.EndTime);
  66. $("#txtRemark").val(data.Remark);
  67. $("#txtBidCode").val(data.BidCode);
  68. $("#txtZTBCount").val(data.ZTBCount);
  69. $("#fileName").val(data.FileName);
  70. $("#BidUser").select2({ disabled: true });
  71. $("#sel_WorkPoint").select2({ disabled: true });
  72. }
  73. },
  74. });
  75. }
  76. InitControl1();//加载负责人
  77. InitControl2();
  78. })
  79. function GUID() {
  80. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  81. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  82. return v.toString(16);
  83. });
  84. }
  85. function InitControl11() {
  86. debugger;
  87. var IDISOK = "";
  88. IDISOK = $("#txtBidCode").val();
  89. if (WorkPoints == "") {
  90. WorkPoints = $("#sel_WorkPoint option:checked").val();
  91. }
  92. document.getElementById("gridPanel1").innerHTML = ' <table id="gridList1"></table> ';//重置grid
  93. $("#gridList1").dataGrid({
  94. url: "/SRM/BicDoc_Publish/GetBidDocBDInfoByBidCode?" + Math.random() + "&WorkPoint=" + WorkPoints,
  95. postData: { queryJson: JSON.stringify(IDISOK) },
  96. height: $(window).height() - 400,
  97. width: $(window).width(),
  98. //cellEdit: true,
  99. colModel: [
  100. { label: '主键', name: 'ID', width: 150, align: 'left', hidden: true, key: true },
  101. { label: '行号', name: 'RowNo', width: 150, align: 'left', hidden: true },
  102. { label: '物料编码', name: 'INVCODE', width: 150, align: 'left', sortable: false, },
  103. { label: '物料名称', name: 'INVNAME', width: 100, align: 'left', sortable: false, },
  104. { label: '规格型号', name: 'InvStd', width: 150, align: 'left', sortable: false, },
  105. { label: '计划采购数量', name: 'Quantity', width: 150, align: 'left', edittype: 'text', editrules: { number: true }, sortable: false, },
  106. { label: '单位', name: 'INVUOM', width: 100, align: 'left', sortable: false, },
  107. //{ label: '交期', name: 'DeliveryTime', width: 100, align: 'left' },
  108. {
  109. label: '交期', name: 'DeliveryTime', width: 150, align: 'left'
  110. },
  111. { label: '备注', name: 'Remark', width: 100, align: 'left', sortable: false, },
  112. { label: '来源', name: 'Source', width: 100, align: 'left', sortable: false, },
  113. ],
  114. //sortorder: "asc",
  115. //sortname: 'RowNo ',
  116. rowNum: 10000,
  117. multiselect: true,
  118. shrinkToFit: true,//宽度自适应
  119. cellsubmit: "clientArray",
  120. });
  121. }
  122. function InitControl1() {
  123. debugger;
  124. var IDISOK = "";
  125. if ($("#txtID").val(ID) == "") {
  126. IDISOK = ID;
  127. } else {
  128. IDISOK = $("#txtID").val();
  129. }
  130. document.getElementById("gridPanel1").innerHTML = ' <table id="gridList1"></table> ';//重置grid
  131. $("#gridList1").dataGrid({
  132. url: "/SRM/BicDoc_Publish/GetBidDocBDInfoByCode?" + Math.random(),
  133. postData: { queryJson: JSON.stringify(IDISOK) },
  134. height: $(window).height() - 400,
  135. width: $(window).width(),
  136. //cellEdit: true,
  137. colModel: [
  138. { label: '主键', name: 'ID', width: 150, align: 'left', hidden: true, key: true },
  139. { label: '行号', name: 'RowNo', width: 150, align: 'left', hidden: true },
  140. { label: '物料编码', name: 'INVCODE', width: 150, align: 'left' },
  141. { label: '物料名称', name: 'INVNAME', width: 100, align: 'left' },
  142. { label: '规格型号', name: 'InvStd', width: 150, align: 'left' },
  143. { label: '计划采购数量', name: 'Quantity', width: 150, align: 'left', editable: true, edittype: 'text', editrules: { number: true } },
  144. { label: '单位', name: 'INVUOM', width: 100, align: 'left' },
  145. //{ label: '交期', name: 'DeliveryTime', width: 100, align: 'left' },
  146. {
  147. label: '交期', name: 'DeliveryTime', width: 150, align: 'left', cellattr: addArriveDateCellAttr,
  148. editable: true,
  149. editoptions: {
  150. dataInit: function (el) {
  151. $(el).click(function () {
  152. WdatePicker({
  153. dateFmt: "yyyy-MM-dd HH:mm:ss"//时间显示格式
  154. });
  155. })
  156. }
  157. }
  158. },
  159. { label: '备注', name: 'Remark', width: 100, align: 'left', editable: true },
  160. { label: '来源', name: 'Source', width: 100, align: 'left' },
  161. ],
  162. //sortorder: "asc",
  163. //sortname: 'RowNo ',
  164. rowNum: 10000,
  165. sortable: false,
  166. //multiselect: true,
  167. shrinkToFit: true,//宽度自适应
  168. cellsubmit: "clientArray",
  169. });
  170. }
  171. function InitControl2() {
  172. if (WorkPoints == "") {
  173. WorkPoints = $("#sel_WorkPoint option:checked").val();
  174. }
  175. document.getElementById("gridPanel2").innerHTML = ' <table id="gridList2"></table> ';//重置grid
  176. $("#gridList2").dataGrid({
  177. url: "/SRM/BicDoc_Publish/GetBidDocGYSInfoByCode?" + Math.random() + "&WorkPoint=" + WorkPoints,
  178. postData: { queryJson: JSON.stringify(ID) },
  179. height: $(window).height() - 400,
  180. width: $(window).width(),
  181. //cellEdit: true,
  182. colModel: [
  183. { label: '主键', name: 'ID', width: 150, align: 'left', hidden: true, key: true },
  184. { label: '行号', name: 'RowNo', width: 150, align: 'left', hidden: true },
  185. { label: '供应商编码', name: 'cVenCode', width: 150, align: 'left' },
  186. { label: '供应商名称', name: 'cVenName', width: 100, align: 'left' },
  187. //{ label: '是否已交保证金', name: 'EarnestMoney', width: 100, align: 'left', edittype: 'select', editoptions: { value: GetSelectICSBadCode(), }, editable: true },
  188. { label: '来源', name: 'Source', width: 100, align: 'lreft' },
  189. ],
  190. sortorder: "asc",
  191. rowNum: 10000,
  192. sortname: 'RowNo ',
  193. cellsubmit: "clientArray",
  194. multiselect: true,
  195. viewrecords: true,
  196. });
  197. }
  198. function InitControl3() {
  199. var $VenCode = $("#sel_WorkPoint");
  200. $VenCode.select2({
  201. allowClear: true,
  202. escapeMarkup: function (m) {
  203. return m;
  204. }
  205. });
  206. $.ajax({
  207. url: "/SRM/ASNAdd/GetVendors" + "?" + Math.random(),
  208. dataType: "json",
  209. async: false,
  210. success: function (data) {
  211. $.each(data, function (index, item) {
  212. $VenCode.append("<option value='" + item.WorkPointCode + "'>&nbsp;" + item.WorkPointName + "</option>");
  213. });
  214. }
  215. });
  216. }
  217. function addArriveDateCellAttr(rowId, val, rawObject, cm, rdata) {
  218. if (rdata.ArriveDate != "" && rdata.ArriveDate != null) {
  219. if (rdata.Free5 == "" || rdata.Free5 == null) {
  220. //var nowDate = GetNowDate();
  221. //var pass = new Date(rdata.PreArriveDate).getDate() - new Date(rdata.ArriveDate).getDate();
  222. var pass = daysBetween(rdata.PreArriveDate, rdata.ArriveDate);
  223. if (pass <= 3 && pass >= 0) {
  224. //return "style='background-color:darkgray'";
  225. return "style='background-color:yellow'";
  226. }
  227. else if (pass > 3) {
  228. return "style='background-color:darkgray'";
  229. }
  230. else {
  231. return "style='background-color:red'";
  232. }
  233. }
  234. }
  235. else {
  236. return "style='background-color:null'";
  237. }
  238. }
  239. function daysBetween(sDate1, sDate2) {
  240. //Date.parse() 解析一个日期时间字符串,并返回1970/1/1 午夜距离该日期时间的毫秒数
  241. var time1 = Date.parse(new Date(sDate1));
  242. var time2 = Date.parse(new Date(sDate2));
  243. var nDays = Math.abs(parseInt((time2 - time1) / 1000 / 3600 / 24));
  244. return nDays;
  245. };
  246. function GetSelectICSBadCode() {
  247. var str = ":;1:是;0:否";
  248. return str;
  249. }
  250. function getJQAllData(list) {
  251. //拿到grid对象
  252. var obj = $(list);
  253. //获取grid表中所有的rowid值
  254. var rowIds = obj.getDataIDs();
  255. //初始化一个数组arrayData容器,用来存放rowData
  256. var arrayData = new Array();
  257. if (rowIds.length > 0) {
  258. for (var i = 0; i < rowIds.length; i++) {
  259. //rowData=obj.getRowData(rowid);//这里rowid=rowIds[i];
  260. arrayData.push(obj.getRowData(rowIds[i]));
  261. }
  262. }
  263. return arrayData;
  264. }
  265. </script>
  266. <form id="form1">
  267. <div class="topPanel" style="height:10px">
  268. <div class="btn-group">
  269. <input id="CurrentPoCode" name="CurrentPoCode" type="hidden" />
  270. @*<a id="AddItemLot" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><i class="fa fa-pencil-square-o"></i>添加明细</a>
  271. <a id="refresh" class="btn btn-primary" style="margin-left:3px;" onclick="reloadData()"><span class="glyphicon glyphicon-refresh"></span></a>*@
  272. </div>
  273. </div>
  274. <div style="margin-right: 20px;">
  275. <table class="form">
  276. <tr>
  277. <th class="formTitle">
  278. 招标编号:
  279. </th>
  280. <td class="formValue">
  281. <input id="txtBidCode" type="text" class="form-control" readonly="readonly" />
  282. <input id="txtID" type="text" class="form-control" style="display:none" />
  283. </td>
  284. <th class="formTitle">招标负责人:</th>
  285. <td class="formValue">
  286. <select id="BidUser" name="BidUser" class="form-control select2" placeholder="请选择负责人..."></select>
  287. </td>
  288. </tr>
  289. <tr>
  290. <th class="formTitle">
  291. 标案名称:
  292. </th>
  293. <td class="formValue">
  294. <input id="txtBidName" type="text" class="form-control" readonly="readonly" />
  295. </td>
  296. <th class="formTitle">
  297. 招标状态:
  298. </th>
  299. <td class="formValue">
  300. <input type="text" id="txtBidStatus" class="form-control" readonly="readonly" />
  301. </td>
  302. </tr>
  303. <tr>
  304. <th class="formTitle">投标开始时间:</th>
  305. <td class="formValue">
  306. <input type="text" id="txtStarTime" class="form-control" autocomplete="off" readonly="readonly" />
  307. </td>
  308. <th class="formTitle">投标截止时间:</th>
  309. <td class="formValue">
  310. <input type="text" id="txtEndTime" class="form-control" autocomplete="off" readonly="readonly" />
  311. </td>
  312. </tr>
  313. <tr>
  314. <th class="formTitle">
  315. 投标次数:
  316. </th>
  317. <td class="formValue">
  318. <input id="txtZTBCount" type="text" class="form-control" readonly="readonly" />
  319. </td>
  320. <th class="formTitle">站点:</th>
  321. <td class="formValue">
  322. <select id="sel_WorkPoint" name="sel_WorkPoint" class="form-control select2" style="width: 120px" placeholder="请选择站点..." readonly="readonly"></select>
  323. <input type="hidden" id="hidetext" />
  324. </td>
  325. </tr>
  326. <tr>
  327. <th class="formTitle">备注:</th>
  328. <td class="formValue" colspan="3">
  329. <textarea id="txtRemark" name="Remarks" cols="200" class="form-control" style="height:32px;line-height:32px" readonly="readonly"></textarea>
  330. </td>
  331. </tr>
  332. <tr>
  333. <th class="formTitle">附件名称:</th>
  334. <td class="formValue" colspan="3">
  335. <input id="fileName" name="fileName" class="form-control" readonly="readonly" style="width:600px" />
  336. </td>
  337. <td class="formValue">
  338. <input id='FileUp' type='file' style="display: none" onchange="UpLoadFile(this)" multiple="multiple" />
  339. </td>
  340. </tr>
  341. </table>
  342. </div>
  343. <div class="gridPanel" style="margin-left:10px">
  344. <span><strong>标的维护</strong></span>
  345. <div id="gridPanel1">
  346. <table id="gridList1"></table>
  347. <div id="gridPager"></div>
  348. </div>
  349. </div>
  350. <div class="gridPane2" style="margin-left:10px">
  351. <span style="display:block;margin-top:20px">
  352. <strong>应标供应商维护</strong>
  353. </span>
  354. <div id="gridPanel2">
  355. <table id="gridList2"></table>
  356. <div id="gridPager"></div>
  357. </div>
  358. </div>
  359. </form>