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.

969 lines
47 KiB

1 month ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. @*<meta http-equiv="refresh" content="1">*@
  6. @*<meta http-equiv="refresh" content="1" url="{:url('~/SRM/BicDoc_Seller/ICSBiddingAdd_Seller')}" />*@
  7. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  8. <script src="~/Content/js/select2/select2.min.js"></script>
  9. <style>
  10. #Tool {
  11. background: #988c8c;
  12. position: absolute;
  13. width: 200px;
  14. height: 100px;
  15. top: 20px;
  16. right: 50px;
  17. }
  18. </style>
  19. <!--指定页面中div[id=dq]进行刷新-->
  20. <script type="text/javascript">
  21. var Time = '@System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Time"].ConnectionString';
  22. debugger;
  23. $(document).ready(function () {
  24. setInterval("startRequest()", Time);
  25. });
  26. </script>
  27. <script>
  28. debugger;
  29. var list = "";
  30. var BidCode = decodeURI($.request("BidCode"));
  31. var Status = decodeURI($.request("status"))
  32. var WorkPoints = $.request("WorkPoint");
  33. var BidType = decodeURI($.request("BidType"))
  34. var expArrivalDate = $
  35. var Price = '';
  36. var PriceHidd = '';
  37. var RowsIDs = '';
  38. function startRequest() {
  39. var BidStatus = $("#txt_BidStatusTB").val();
  40. debugger;
  41. if (BidType == "明标") {
  42. $.ajax({
  43. //url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  44. url: "/SRM/BicDoc_Seller/GetICSBidDocInfoSum?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints + "&Status=" + BidStatus,
  45. dataType: "json",
  46. async: false,
  47. success: function (data) {
  48. $("#txt_RowNum").val(data.rows[0].rn);
  49. }
  50. });
  51. }
  52. }
  53. $(function () {
  54. debugger;
  55. //InitControl();
  56. if (!!BidCode) {
  57. GetDetails();
  58. }
  59. gridList();
  60. //获取文件-采购上传
  61. GetCGFile();
  62. GetVenDorFile();
  63. })
  64. function GetCGFile() {
  65. debugger;
  66. var Fules = '';
  67. $.ajax({
  68. //url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  69. url: "/SRM/BicDoc_Seller/GetCGFile?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  70. dataType: "json",
  71. async: false,
  72. success: function (data) {
  73. debugger;
  74. Fules = data.rows[0].Filename;
  75. }
  76. });
  77. debugger
  78. var innerhtml = '';
  79. if (Fules != "" && Fules != null) {
  80. debugger;
  81. Fules = Fules.substring(0, Fules.length - 1);
  82. var File = Fules.split(';');
  83. for (var i = 0; i < File.length; i++) {
  84. innerhtml += " <a href='../../../File/ZTBFile/" + BidCode + "/" + File[i] + "' download='" + File[i] + "' style='color:blue;'>" + File[i] + "</a><br>";
  85. }
  86. $("#hidbtnYL").html(innerhtml);
  87. }
  88. }
  89. function GetVenDorFile() {
  90. debugger;
  91. var Fules = '';
  92. $.ajax({
  93. //url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  94. url: "/SRM/BicDoc_Seller/GetVenDorFileTB?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  95. dataType: "json",
  96. async: false,
  97. success: function (data) {
  98. debugger;
  99. Fules = data.rows[0].VendorFileName;
  100. }
  101. });
  102. debugger
  103. var innerhtml = '';
  104. if (Fules != "" && Fules != null) {
  105. debugger;
  106. Fules = Fules.substring(0, Fules.length - 1);
  107. var File = Fules.split(';');
  108. for (var i = 0; i < File.length; i++) {
  109. innerhtml += " <a href='../../../File/GYSZTBFile/" + BidCode + "/" + File[i] + "' download='" + File[i] + "' style='color:blue;'>" + File[i] + "</a>";
  110. }
  111. $("#hidbtn").html(innerhtml);
  112. }
  113. }
  114. function GetDetails() {
  115. $.ajax({
  116. //url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  117. url: "/SRM/BicDoc_Seller/GetICSBidDocInfoSum?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints + "&Status=" + Status,
  118. dataType: "json",
  119. async: false,
  120. success: function (data) {
  121. debugger;
  122. $("#txt_BidCode").val(data.rows[0].BidCode);
  123. $("#txt_BidUser").val(data.rows[0].BidUser);
  124. $("#txt_BidName").val(data.rows[0].BidName);
  125. $("#txt_BidStatus").val(data.rows[0].BidStatus);
  126. $("#txt_BidStatusTB").val(data.rows[0].Statuss);
  127. $("#txt_StarTime").val(data.rows[0].StarTime);
  128. $("#txt_EndTime").val(data.rows[0].EndTime);
  129. $("#txt_Remark").val(data.rows[0].Remark);
  130. $("#txtID").val(data.rows[0].ID);
  131. $("#txt_YBBCounrt").val(data.rows[0].YBBCount);
  132. $("#txt_WYBCounrt").val(data.rows[0].RowCounts - data.rows[0].YBBCount);
  133. $("#txt_SumPrice").val(data.rows[0].Amount);
  134. if (BidType == "明标") {
  135. $("#txt_RowNum").val(data.rows[0].rn);
  136. }
  137. //$("#txt_TBCount").val(data.rows[0].TBCount);
  138. if (data.rows[0].BidCode != '') {
  139. $("#txt_BidCode").attr("disabled", "disabled");
  140. $("#txt_BidUser").attr("disabled", "disabled");
  141. $("#txt_BidName").attr("disabled", "disabled");
  142. $("#txt_BidStatus").attr("disabled", "disabled");
  143. $("#txt_StarTime").attr("disabled", "disabled");
  144. $("#txt_EndTime").attr("disabled", "disabled");
  145. $("#txt_Remark").attr("disabled", "disabled");
  146. $("#txt_YBBCounrt").attr("disabled", "disabled");
  147. $("#txt_WYBCounrt").attr("disabled", "disabled");
  148. $("#txt_SumPrice").attr("disabled", "disabled");
  149. $("#txt_RowNum").attr("disabled", "disabled");
  150. //$("#txt_TBCount").attr("disabled", "disabled");
  151. //$("#txt_BidCode").val(data.STNO);
  152. //$("#txt_F_RealName").val(data.VenCode);
  153. //$("#txt_BidName").val(data.VenCode);
  154. //$("#txt_BidStatus").val(data.VenCode);
  155. //$("#txt_StarTime").val(data.VenCode);
  156. //$("#txt_EndTime").val(data.VenCode);
  157. //$("#txt_Remark").val(data.VenCode);
  158. }
  159. }
  160. });
  161. }
  162. function GetDetailsScrah() {
  163. var BidStatus = $("#txt_BidStatusTB").val();
  164. $.ajax({
  165. //url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  166. url: "/SRM/BicDoc_Seller/GetICSBidDocInfoSum?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints + "&Status=" + BidStatus,
  167. dataType: "json",
  168. async: false,
  169. success: function (data) {
  170. debugger;
  171. $("#txt_BidCode").val(data.rows[0].BidCode);
  172. $("#txt_BidUser").val(data.rows[0].BidUser);
  173. $("#txt_BidName").val(data.rows[0].BidName);
  174. //$("#txt_BidStatus").val(data.rows[0].BidStatus);
  175. $("#txt_StarTime").val(data.rows[0].StarTime);
  176. $("#txt_EndTime").val(data.rows[0].EndTime);
  177. $("#txt_Remark").val(data.rows[0].Remark);
  178. $("#txtID").val(data.rows[0].ID);
  179. $("#txt_YBBCounrt").val(data.rows[0].YBBCount);
  180. $("#txt_WYBCounrt").val(data.rows[0].RowCounts - data.rows[0].YBBCount);
  181. $("#txt_SumPrice").val(data.rows[0].Amount);
  182. if (BidType == "明标") {
  183. $("#txt_RowNum").val(data.rows[0].rn);
  184. }
  185. //$("#txt_TBCount").val(data.rows[0].TBCount);
  186. if (data.rows[0].BidCode != '') {
  187. $("#txt_BidCode").attr("disabled", "disabled");
  188. $("#txt_BidUser").attr("disabled", "disabled");
  189. $("#txt_BidName").attr("disabled", "disabled");
  190. $("#txt_BidStatus").attr("disabled", "disabled");
  191. $("#txt_StarTime").attr("disabled", "disabled");
  192. $("#txt_EndTime").attr("disabled", "disabled");
  193. $("#txt_Remark").attr("disabled", "disabled");
  194. $("#txt_YBBCounrt").attr("disabled", "disabled");
  195. $("#txt_WYBCounrt").attr("disabled", "disabled");
  196. $("#txt_SumPrice").attr("disabled", "disabled");
  197. $("#txt_RowNum").attr("disabled", "disabled");
  198. //$("#txt_TBCount").attr("disabled", "disabled");
  199. //$("#txt_BidCode").val(data.STNO);
  200. //$("#txt_F_RealName").val(data.VenCode);
  201. //$("#txt_BidName").val(data.VenCode);
  202. //$("#txt_BidStatus").val(data.VenCode);
  203. //$("#txt_StarTime").val(data.VenCode);
  204. //$("#txt_EndTime").val(data.VenCode);
  205. //$("#txt_Remark").val(data.VenCode);
  206. }
  207. }
  208. });
  209. }
  210. //function InitControl() {
  211. // var $VenCode = $("#BidUser");
  212. // $VenCode.select2({
  213. // allowClear: true,
  214. // escapeMarkup: function (m) {
  215. // return m;
  216. // }
  217. // });
  218. // $.ajax({
  219. // url: "/SRM/BicDoc_Publish/GetBidUser" + "?" + Math.random(),
  220. // dataType: "json",
  221. // async: false,
  222. // success: function (data) {
  223. // $.each(data, function (index, item) {
  224. // BidUser.append("<option value='" + item.F_Account + "'>&nbsp;" + item.F_RealName + "</option>");
  225. // });
  226. // }
  227. // });
  228. //}
  229. // function gridList() {
  230. // document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table><div id="gridPager"></div> ';//重置grid
  231. // var $gridList = $("#gridList");
  232. // debugger;
  233. // $gridList.dataGrid({
  234. // url: "/SRM/BicDoc_Seller/SearchBidDocBDInfoByBidCodeSeller" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  235. // height: $(window).height() - 350,
  236. // width: $(window).width() - 400,
  237. // cellEdit: true,
  238. // colModel: [
  239. // { label: "ID", name: "ID", hidden: true },
  240. // { label: "IID", name: "IID", hidden: true },
  241. // { label: "DID", name: "DID", hidden: true },
  242. // //{ label: '行号', name: 'RowNo', width: 50, align: 'left' },
  243. // { label: '物料编码', name: 'InvCode', width: 80, align: 'left' },
  244. // { label: "物料名称", name: "InvName", width: 150, align: 'left' },
  245. // { label: "规格型号", name: "InvStd", width: 100, align: 'left' },
  246. // { label: '计划采购数量', name: 'Quantity', width: 50, align: 'left' },
  247. // { label: '单位', name: 'Unit', width: 50, align: 'left' },
  248. // { label: '交期', name: 'DeliveryTime', width: 100, align: 'left' },
  249. // { label: '来源', name: 'Source', width: 50, align: 'left' },
  250. // { label: '备注', name: 'Remarks', width: 100, align: 'left' },
  251. // { label: '是否应标', name: 'IsCast', width: 100, align: 'left', edittype: 'select',editable: true , editoptions: { value: GetSelectICSBadCode(), } },
  252. // { label: '应标单价(人民币未税)', name: 'WSCastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
  253. // {
  254. // label: '税额', name: 'TaxAmount', width: 80, align: 'center', editable: true,
  255. // editrules: {
  256. // number: true,
  257. // //required: true,//必填设置
  258. // custom: true,
  259. // custom_func: function (value, colname) {
  260. // if (value < 0) {
  261. // return [false, colname + '必须为正数'];
  262. // } else {
  263. // return [true];
  264. // }
  265. // }
  266. // }
  267. // },
  268. // { label: '应标单价(人民币含税)', name: 'CastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
  269. // //{ label: '投标次数', name: 'TBCount', width: 50, align: 'left' },
  270. // { label: '比较', name: 'CastPriceHidd', hidden: true },
  271. // { label: " 产地/品牌/规格/原卷价格", name: "Remark", width: 150, align: 'left', editable: true },
  272. ///* { label: '币种', name: 'Currency', width: 130, align: 'center', editable: true },*/
  273. // {
  274. // label: '币种', name: 'Currency', width: 130, align: 'center', edittype: 'select', editoptions: { value: GetItemCode(), }, editable: true, size: '50px', fontWeight: 'bolder',
  275. // // 设置默认值为人民币
  276. // formatter: function (cellvalue, options, rowObject) {
  277. // return cellvalue || "人民币";
  278. // },
  279. // unformat: function (cellvalue, options, cell) {
  280. // return cellvalue || "人民币";
  281. // }
  282. // },
  283. // { label: '最小包装量', name: 'MinPackQuantity', width: 130, align: 'center', editable: true },
  284. // { label: '最小起定量', name: 'MOQ', width: 130, align: 'center', editable: true },
  285. // {
  286. // label: '货期(天)', name: 'Futures', width: 150, align: 'center', editable: true,
  287. // editrules: {
  288. // number: true,
  289. // //required: true,//必填设置
  290. // custom: true,
  291. // custom_func: function (value, colname) {
  292. // if (value < 0) {
  293. // return [false, colname + '必须为正数'];
  294. // } else {
  295. // return [true];
  296. // }
  297. // }
  298. // }
  299. // },
  300. // { label: '供应商全称', name: 'VenFullName', width: 130, align: 'center', editable: true },
  301. // { label: '采购员', name: 'Purchaser', width: 130, align: 'center', editable: true },
  302. // { label: '产地', name: 'Origin', width: 130, align: 'center', editable: true },
  303. // { label: '当日金属价格', name: 'DailyMetalPrices', width: 130, align: 'center', editable: true },
  304. // { label: '加工费', name: 'ProcessingFee', width: 130, align: 'center', editable: true },
  305. // { label: '汇率', name: 'ExchangeRate', width: 100, align: 'center', editable: true, editrules: { number: true } },
  306. // { label: '关税', name: 'Tariff', width: 100, align: 'center', editable: true, editrules: { number: true } },
  307. // { label: '运输费', name: 'TransportFee', width: 100, align: 'center', editable: true, editrules: { number: true } },
  308. // { label: '贸易方式', name: 'TradeMethod', width: 100, align: 'center', editable: true },
  309. // { label: '增值税', name: 'VAT', width: 100, align: 'center', editable: true, editrules: { number: true } }
  310. // ],
  311. // afterSaveCell: function (rowid, cellname, value) {
  312. // debugger;
  313. // //总扣分数加其他扣分数
  314. // if (cellname === 'CastPrice') {
  315. // Price = Number(value);
  316. // if (Price < 0) {
  317. // $.modalAlert("请输入大于0的单价!");
  318. // return;
  319. // }
  320. // PriceHidd = Number($gridList.jqGrid("getCell", rowid, 'CastPriceHidd'));
  321. // RowsIDs = rowid;
  322. // if (PriceHidd != 0) {
  323. // if (Price > PriceHidd) {
  324. // $("#gridList").jqGrid('setCell', rowid, "CastPrice", PriceHidd);
  325. // $.modalAlert("价格不可大于上一次提交价格");
  326. // return;
  327. // }
  328. // }
  329. // //if (Number(Price) > Number(PriceHidd) && Number(PriceHidd) > 0) {
  330. // // $.modalAlert("如需应标,请填写应标单价!");
  331. // // $gridList.jqGrid("setCell", rowid, 'CastPrice', PriceHidd);
  332. // // return;
  333. // //}
  334. // }
  335. // var obj_vendor = $("#gridList");
  336. // var SUM_ZJ = 0;
  337. // var rowIds_vendor = obj_vendor.getDataIDs();
  338. // if (rowIds_vendor.length > 0) {
  339. // debugger;
  340. // for (var i = 0; i < rowIds_vendor.length; i++) {
  341. // var vendorRowData = obj_vendor.getRowData(rowIds_vendor[i]);
  342. // var SUM_ZJZH = Number(vendorRowData.CastPrice * vendorRowData.Quantity).toFixed(2);
  343. // SUM_ZJ = Number(SUM_ZJ) + Number(SUM_ZJZH);
  344. // }
  345. // }
  346. // $("#txt_SumPrice").val(SUM_ZJ);
  347. // },
  348. // gridComplete: function () {
  349. // debugger;
  350. // //设置select
  351. // var RowDatas = $("#gridList").jqGrid('getDataIDs');
  352. // for (var j = 0; j < RowDatas.length; j++) {
  353. // var IsCast = $("#gridList").jqGrid("getCell", RowDatas[j], "IsCast");
  354. // if (IsCast == "否") {
  355. // if (BidType == "明标") {
  356. // $("#txt_RowNum").val("未投标");
  357. // }
  358. // }
  359. // }
  360. // },
  361. // pager: "#gridPager",
  362. // sortname: 'RowNo',
  363. // viewrecords: true,
  364. // cellsubmit: "clientArray",
  365. // shrinkToFit: false,
  366. // autoScroll: true,//设置水平滚动条
  367. // rowNum: 200
  368. // });
  369. // $("#refresh").click(function () {
  370. // var queryJson = {
  371. // CartonNo: CartonNo,
  372. // }
  373. // $gridList.jqGrid('setGridParam', {
  374. // postData: { queryJson: JSON.stringify(queryJson) },
  375. // page: 1
  376. // }).trigger('reloadGrid');
  377. // });
  378. // }
  379. // function GetItemCode() {
  380. // var str = ":;人民币:人民币;欧元:欧元;美元:美元";
  381. // return str;
  382. // }
  383. function gridList() {
  384. document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table><div id="gridPager"></div> ';
  385. var $gridList = $("#gridList");
  386. // 定义所有列,包括额外的币种相关字段
  387. var colModel = [
  388. { label: "ID", name: "ID", hidden: true },
  389. { label: "IID", name: "IID", hidden: true },
  390. { label: "DID", name: "DID", hidden: true },
  391. { label: '物料编码', name: 'InvCode', width: 80, align: 'left' },
  392. { label: "物料名称", name: "InvName", width: 150, align: 'left' },
  393. { label: "规格型号", name: "InvStd", width: 100, align: 'left' },
  394. { label: '计划采购数量', name: 'Quantity', width: 50, align: 'left' },
  395. { label: '单位', name: 'Unit', width: 50, align: 'left' },
  396. { label: '交期', name: 'DeliveryTime', width: 100, align: 'left' },
  397. { label: '来源', name: 'Source', width: 50, align: 'left' },
  398. { label: '备注', name: 'Remarks', width: 100, align: 'left' },
  399. { label: '是否应标', name: 'IsCast', width: 100, align: 'left', edittype: 'select', editable: true, editoptions: { value: GetSelectICSBadCode(), } },
  400. { label: '应标单价(人民币未税)', name: 'WSCastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
  401. {
  402. label: '税额', name: 'TaxAmount', width: 80, align: 'center', editable: true,
  403. editrules: {
  404. number: true,
  405. custom: true,
  406. custom_func: function (value, colname) {
  407. if (value < 0) {
  408. return [false, colname + '必须为正数'];
  409. } else {
  410. return [true];
  411. }
  412. }
  413. }
  414. },
  415. { label: '应标单价(人民币含税)', name: 'CastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
  416. { label: '比较', name: 'CastPriceHidd', hidden: true },
  417. { label: " 产地/品牌/规格/原卷价格", name: "Remark", width: 150, align: 'left', editable: true },
  418. {
  419. label: '币种', name: 'Currency', width: 130, align: 'center', edittype: 'select', editoptions: { value: GetItemCode(), }, editable: true, size: '50px', fontWeight: 'bolder',
  420. formatter: function (cellvalue, options, rowObject) {
  421. return cellvalue || "人民币";
  422. },
  423. unformat: function (cellvalue, options, cell) {
  424. return cellvalue || "人民币";
  425. }
  426. },
  427. { label: '最小包装量', name: 'MinPackQuantity', width: 130, align: 'center', editable: true },
  428. { label: '最小起定量', name: 'MOQ', width: 130, align: 'center', editable: true },
  429. {
  430. label: '货期(天)', name: 'Futures', width: 150, align: 'center', editable: true,
  431. editrules: {
  432. number: true,
  433. custom: true,
  434. custom_func: function (value, colname) {
  435. if (value < 0) {
  436. return [false, colname + '必须为正数'];
  437. } else {
  438. return [true];
  439. }
  440. }
  441. }
  442. },
  443. { label: '供应商全称', name: 'VenFullName', width: 130, align: 'center', editable: true },
  444. { label: '采购员', name: 'Purchaser', width: 130, align: 'center', editable: true },
  445. { label: '产地', name: 'Origin', width: 130, align: 'center', editable: true },
  446. { label: '当日金属价格', name: 'DailyMetalPrices', width: 130, align: 'center', editable: true },
  447. { label: '加工费', name: 'ProcessingFee', width: 130, align: 'center', editable: true },
  448. { label: '汇率', name: 'ExchangeRate', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
  449. { label: '关税', name: 'Tariff', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
  450. { label: '增值税', name: 'VAT', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
  451. { label: '国际运输费', name: 'TransportFee', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
  452. { label: '贸易方式', name: 'TradeMethod', width: 100, align: 'center', editable: true, hidden: true },
  453. ];
  454. // 币种相关列的名称数组
  455. var currencyRelatedColumns = ['ExchangeRate', 'Tariff', 'VAT', 'TransportFee', 'TradeMethod'];
  456. $gridList.dataGrid({
  457. url: "/PNSRM/BicDoc_Seller/SearchBidDocBDInfoByBidCodeSeller" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  458. height: $(window).height() - 350,
  459. width: $(window).width() - 400,
  460. cellEdit: true,
  461. colModel: colModel,
  462. afterSaveCell: function (rowid, cellname, value) {
  463. // 价格验证逻辑...
  464. // 当币种变更时,调整列显示
  465. if (cellname === 'Currency') {
  466. var rowData = $gridList.jqGrid('getRowData', rowid);
  467. toggleCurrencyColumns(rowData.Currency);
  468. }
  469. // 计算总价逻辑...
  470. },
  471. gridComplete: function () {
  472. // 检查第一行的币种并调整列显示
  473. var rowDatas = $("#gridList").jqGrid('getDataIDs');
  474. if (rowDatas.length > 0) {
  475. var currency = $("#gridList").jqGrid("getCell", rowDatas[0], "Currency");
  476. toggleCurrencyColumns(currency);
  477. }
  478. // 设置select逻辑...
  479. },
  480. pager: "#gridPager",
  481. sortname: 'RowNo',
  482. viewrecords: true,
  483. cellsubmit: "clientArray",
  484. shrinkToFit: false,
  485. autoScroll: true,
  486. rowNum: 200
  487. });
  488. // 根据币种切换列的显示/隐藏
  489. function toggleCurrencyColumns(currency) {
  490. var $grid = $("#gridList");
  491. // 遍历所有币种相关列
  492. currencyRelatedColumns.forEach(function (colName) {
  493. // 如果不是人民币,显示这些列;否则隐藏
  494. if (currency !== "人民币") {
  495. $grid.jqGrid('showCol', colName);
  496. } else {
  497. $grid.jqGrid('hideCol', colName);
  498. }
  499. });
  500. }
  501. // 刷新按钮逻辑...
  502. }
  503. function GetItemCode() {
  504. var str = ":;人民币:人民币;欧元:欧元;美元:美元;英镑:英镑;日元:日元;港币:港币;澳元:澳元;新西兰元:新西兰元;瑞典克朗:瑞典克朗;韩币:韩币;新加坡元:新加坡元;加元:加元;卢布:卢布;南非兰特:南非兰特;卢比:卢比;泰铢:泰铢";
  505. return str;
  506. }
  507. //获取不良原因
  508. function GetSelectICSBadCode() {
  509. var str = "1:是;0:否";
  510. return str;
  511. }
  512. //刷新
  513. function reloadData() {
  514. STNO = $("#STNO").text();
  515. var queryJson = {
  516. STNO: STNO,
  517. }
  518. $("#gridList").jqGrid('setGridParam', {
  519. postData: { queryJson: JSON.stringify(queryJson) },
  520. page: 1
  521. }).trigger('reloadGrid');
  522. }
  523. function formatDate(fomatType, date) {
  524. let ret;
  525. let valueDate = date;
  526. if (!date) valueDate = new Date()
  527. let opt = {
  528. "Y+": valueDate.getFullYear().toString(), // 年
  529. "m+": (valueDate.getMonth() + 1).toString(), // 月
  530. "d+": valueDate.getDate().toString(), // 日
  531. "H+": valueDate.getHours().toString(), // 时
  532. "M+": valueDate.getMinutes().toString(), // 分
  533. "S+": valueDate.getSeconds().toString() // 秒
  534. };
  535. for (let k in opt) {
  536. ret = new RegExp("(" + k + ")").exec(fomatType);
  537. if (ret) {
  538. fomatType = fomatType.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
  539. };
  540. };
  541. return fomatType;
  542. }
  543. //确定提交
  544. function submitForm() {
  545. debugger;
  546. $("#gridList").find($("td[aria-describedby='gridList_rn']")).click();//提交取消编辑状态
  547. var Remark = $("#txt_Remark").val();
  548. //var TBCount = $("#txt_TBCount").val();
  549. var myDate = new Date;
  550. var DateFormt = formatDate("YYYY-mm-dd HH:MM:SS", myDate)
  551. var EndTime = $("#txt_EndTime").val();
  552. var IsCast = "";
  553. var IDlist = "";
  554. var Details = [];
  555. if (DateFormt > EndTime) {
  556. $.modalAlert("投票截止日期已过 无法保存价格!");
  557. return;
  558. }
  559. //else if (Status == "已投标") {
  560. // $.modalAlert("已投标,请取消提交再进行投标!");
  561. // return;
  562. //}
  563. var obj_vendor = $("#gridList");
  564. var rowIds_vendor = obj_vendor.getDataIDs();
  565. var arrayData_vendor = new Array();
  566. if (rowIds_vendor.length > 0) {
  567. debugger;
  568. for (var i = 0; i < rowIds_vendor.length; i++) {
  569. var vendorRowData = obj_vendor.getRowData(rowIds_vendor[i]);
  570. if (vendorRowData.IsCast == "是") {
  571. if (PriceHidd != 0) {
  572. if (Price > PriceHidd) {
  573. $("#gridList").jqGrid('setCell', rowid, "CastPrice", PriceHidd);
  574. $.modalAlert("价格不可大于上一次提交价格");
  575. return;
  576. }
  577. }
  578. if (vendorRowData.Currency == "人民币") {
  579. if (vendorRowData.CastPrice < 0) {
  580. $.modalAlert("请输入大于0的应标单价(人民币含税)!");
  581. return;
  582. }
  583. if (vendorRowData.WSCastPrice == "") {
  584. $.modalAlert("应标单价(人民币未税)为必填项目,请填写!");
  585. return;
  586. }
  587. if (vendorRowData.TaxAmount == "") {
  588. $.modalAlert("税额为必填项目,请填写!");
  589. return;
  590. }
  591. if (vendorRowData.MinPackQuantity == "") {
  592. $.modalAlert("最小包装量为必填项目,请填写!");
  593. return;
  594. }
  595. if (vendorRowData.MOQ == "") {
  596. $.modalAlert("最小起定量为必填项目,请填写!");
  597. return;
  598. }
  599. if (vendorRowData.Futures == "") {
  600. $.modalAlert("货期(天)为必填项目,请填写!");
  601. return;
  602. }
  603. } else {
  604. if (vendorRowData.CastPrice < 0) {
  605. $.modalAlert("请输入大于0的应标单价(人民币含税)!");
  606. return;
  607. }
  608. if (vendorRowData.WSCastPrice == "") {
  609. $.modalAlert("应标单价(人民币未税)为必填项目,请填写!");
  610. return;
  611. }
  612. if (vendorRowData.TaxAmount == "") {
  613. $.modalAlert("税额为必填项目,请填写!");
  614. return;
  615. }
  616. if (vendorRowData.ExchangeRate == "") {
  617. $.modalAlert("汇率为必填项目,请填写!");
  618. return;
  619. }
  620. if (vendorRowData.Tariff == "") {
  621. $.modalAlert("关税为必填项目,请填写!");
  622. return;
  623. }
  624. if (vendorRowData.VAT == "") {
  625. $.modalAlert("增值税为必填项目,请填写!");
  626. return;
  627. }
  628. if (vendorRowData.TransportFee == "") {
  629. $.modalAlert("国际运输费为必填项目,请填写!");
  630. return;
  631. }
  632. if (vendorRowData.TradeMethod == "") {
  633. $.modalAlert("贸易方式为必填项目,请填写!");
  634. return;
  635. }
  636. }
  637. //if (vendorRowData.TBCount=="0") {
  638. // $.modalAlert("投标次数为0无法再次投标!");
  639. // return;
  640. //}
  641. if (vendorRowData.CastPrice == "0" || vendorRowData.CastPrice == "") {
  642. $.modalAlert("如需应标,请填写应标单价!");
  643. return;
  644. }
  645. if (Remark == "板材类") {
  646. $.modalAlert("标的为板材类,如需应标,请填写产地/品牌/规格/原卷价格!");
  647. return;
  648. }
  649. }
  650. if (vendorRowData.IsCast == "否") {
  651. IsCast = 0;
  652. } else {
  653. IsCast = 1;
  654. }
  655. var obj = {
  656. ID: vendorRowData.DID,
  657. InfoID: vendorRowData.IID,
  658. BDID: vendorRowData.ID,
  659. IsCast: IsCast,
  660. CastPrice: vendorRowData.CastPrice,
  661. BidCode: BidCode,
  662. Remarks: vendorRowData.Remark,
  663. WorkPoint: WorkPoints,
  664. WSCastPrice: vendorRowData.WSCastPrice == "" ? 0 : vendorRowData.WSCastPrice,
  665. TaxAmount: vendorRowData.TaxAmount == "" ? 0 : vendorRowData.TaxAmount,
  666. Currency: vendorRowData.Currency,
  667. MinPackQuantity: vendorRowData.MinPackQuantity == "" ? 0 : vendorRowData.MinPackQuantity,
  668. MOQ: vendorRowData.MOQ == "" ? 0 : vendorRowData.MOQ,
  669. Futures: vendorRowData.Futures,
  670. VenFullName: vendorRowData.VenFullName,
  671. Purchaser: vendorRowData.Purchaser,
  672. Origin: vendorRowData.Origin,
  673. DailyMetalPrices: vendorRowData.DailyMetalPrices == "" ? 0 : vendorRowData.DailyMetalPrices,
  674. ProcessingFee: vendorRowData.ProcessingFee == "" ? 0 : vendorRowData.ProcessingFee,
  675. ExchangeRate: vendorRowData.ExchangeRate == "" ? 0 : vendorRowData.ExchangeRate,
  676. Tariff: vendorRowData.Tariff == "" ? 0: vendorRowData.Tariff,
  677. VAT: vendorRowData.VAT == "" ? 0 : vendorRowData.VAT,
  678. TransportFee: vendorRowData.TransportFee=="" ? 0 : vendorRowData.TransportFee,
  679. TradeMethod: vendorRowData.TradeMethod,
  680. };
  681. arrayData_vendor.push(obj);
  682. }
  683. var arrayVendor = JSON.stringify(arrayData_vendor);
  684. $.modalConfirm("确定是否提交当前价格?提交后无法撤回。", function (r) {
  685. if (r) {
  686. $.submitFormNOClose({
  687. url: "/PNSRM/BicDoc_Seller/SaveForm" + "?" + Math.random(),
  688. type: "POST",
  689. data: {
  690. arrayShellFabricDetail: arrayVendor,
  691. },
  692. //dataType: "json",
  693. //async: false,
  694. //success: function (data) {
  695. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  696. //},
  697. param: { arrayShellFabricDetail: arrayVendor },
  698. success: function () {
  699. $("#txt_BidStatusTB").val("已投标");
  700. //var BidStatus = $("#txt_BidStatusTB").val();
  701. //$.currentWindow().$("#gridList").trigger("reloadGrid");
  702. GetDetailsScrah();
  703. gridList();
  704. }
  705. });
  706. }
  707. })
  708. }
  709. }
  710. function UpLoadFile(fileinfo) {
  711. debugger;
  712. //$("#CurrentPoCode").val(poCode);
  713. var files = fileinfo.files;
  714. var GUID = $("#txtID").val();
  715. var BidCode = $("#txt_BidCode").val();
  716. var fileName='';
  717. for (var i = 0; i < files.length; i++) {
  718. var regex = /\s/;
  719. if (regex.test(files[i].name)) {
  720. $.modalAlert("文件名:<span style='color: red;'>" + files[i].name + "</span>,包含空格,上传失败,请修改后重新上传!", "warning");
  721. document.getElementById("FileUp").value = "";
  722. return false;
  723. }
  724. fileName += ""+files[i].name+"";
  725. if (fileName != null && fileName != "") {
  726. var data = new FormData();
  727. jQuery.each(jQuery('#FileUp')[0].files, function (i, file) {
  728. data.append('file-' + i, file);
  729. });
  730. //data.append("STNO", $("#CurrentSTNO").val());
  731. //var info = document.getElementById("form1");
  732. //var formData = new FormData(info);
  733. $.modalConfirm("确定上传文件吗?", function (r) {
  734. if (r) {
  735. $.ajax({
  736. url: "/SRM/BicDoc_Seller/UpLoadFileImport" + "?" + Math.random() + "&BidCode=" + BidCode + "&ID=" + GUID,
  737. type: "post",
  738. data: data,
  739. contentType: false,
  740. processData: false,
  741. success: function (data) {
  742. if (data != "" && data != "获取文件失败" && data != "上传文件失败") {
  743. $.ajax({
  744. //url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  745. url: "/SRM/BicDoc_Seller/GetVenDorFileTB?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
  746. dataType: "json",
  747. async: false,
  748. success: function (data) {
  749. debugger;
  750. Fules = data.rows[0].VendorFileName;
  751. }
  752. });
  753. debugger
  754. var innerhtml = '';
  755. if (Fules != "" && Fules != null) {
  756. debugger;
  757. Fules = Fules.substring(0, Fules.length - 1);
  758. var File = Fules.split(';');
  759. for (var i = 0; i < File.length; i++) {
  760. innerhtml += " <a href='../../../File/GYSZTBFile/" + BidCode + "/" + File[i] + "' download='" + File[i] + "' style='color:blue;'>" + File[i] + "</a>";
  761. }
  762. $("#hidbtn").html(innerhtml);
  763. }
  764. $.modalAlert("上传成功");
  765. //$("#CurrentSTNO").val(fileName);
  766. ////$.currentWindow().$("#gridList").trigger("reloadGrid");
  767. }
  768. else {
  769. $.modalAlert("异常:" + data);
  770. }
  771. },
  772. error: function (aa) {
  773. $.modalAlert("上传失败:" + aa);
  774. }
  775. });
  776. }
  777. });
  778. }
  779. }
  780. document.getElementById("FileUp").value = "";
  781. }
  782. function UpLoadFiles(STNO) {
  783. $("#FileUp").click();
  784. }
  785. </script>
  786. @*<form id="form1">
  787. <div style="padding-top: 20px; margin-right: 20px;">
  788. <table class="form">
  789. <tr>
  790. <td class="formTitle">招标编号:</td>
  791. <td class="input-group">
  792. <div class="input-group">
  793. <input id="txt_BidCode" name="txt_BidCode" type="text" class="form-control" placeholder="招标编号" />
  794. </div>
  795. </td>
  796. <td class="formTitle">招标负责人:</td>
  797. <td class="formValue">
  798. <select id="BidUser" name="BidUser" class="form-control select2" placeholder="请选择供应商..."></select>
  799. <input type="hidden" id="hidetext" />
  800. </td>
  801. </tr>
  802. <tr>
  803. <td class="formTitle">标案名称:</td>
  804. <td class="input-group">
  805. <input id="txt_BidName" name="txt_BidName" class="form-control" type="text" placeholder="标案名称" />
  806. </td>
  807. <td class="formTitle">招标状态:</td>
  808. <td class="input-group">
  809. <input id="txt_BidStatus" name="txt_BidStatus" class="form-control" type="text" placeholder="标案名称" />
  810. <input type="hidden" id="hidetext" />
  811. </td>
  812. </tr>
  813. <tr>
  814. <td class="formTitle">投标开始日期:</td>
  815. <td class="input-group">
  816. <input id="txt_StarTime" name="txt_StarTime" type="text" class="form-control required" style="width:70%;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="预计到货时间" />
  817. </td>
  818. <td class="formTitle">投标截止日期:</td>
  819. <td class="input-group">
  820. <input id="txt_EndTime" name="txt_EndTime" type="text" class="form-control required" style="width:70%;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="预计到货时间" />
  821. </td>
  822. </tr>
  823. <tr>
  824. <td class="formTitle">招标备注:</td>
  825. <td class="input-group">
  826. <input id="txt_Remark" name="txt_Remark" type="text" class="form-control" style="width:70%;" maxlength="10" placeholder="标案名称" />
  827. </td>
  828. </tr>
  829. </table>
  830. </div>
  831. <div class="gridPanel">
  832. <table id="gridList"></table>
  833. <div id="gridPager"></div>
  834. </div>
  835. </form>*@
  836. <form id="form1">
  837. <div id="Tool"style="position:absolute;width:18%;height:30%;top:3%;right:5%">
  838. <input id="txt_RowNum" name="txt_RowNum" type="text" style="width: 98%;height:99%;text-align:center;font-size:200px;color:red"maxlength="10" />
  839. </div>
  840. <div style="position:absolute;width:18%;height:8%;top:33%;right:5%">
  841. <h1 style="text-align: center; color: #5BC0DE">当前排名</h1>
  842. </div>
  843. <div style="padding-top: 20px; margin-right: 20px;">
  844. <table class="form">
  845. <tr>
  846. <th class="formTitle">招标编号:</th>
  847. <td class="formValue">
  848. <input id="txt_BidCode" name="txt_BidCode" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  849. <input id="txtID" type="text" class="form-control" style="display:none" />
  850. </td>
  851. <th class="formTitle">招标负责人:</th>
  852. <td class="formValue">
  853. <input id="txt_BidUser" name="txt_BidUser" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  854. </td>
  855. </tr>
  856. <tr>
  857. <th class="formTitle">标案名称:</th>
  858. <td class="formValue">
  859. <input id="txt_BidName" name="txt_BidName" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  860. </td>
  861. <th class="formTitle">招标状态:</th>
  862. <td class="formValue">
  863. <input id="txt_BidStatus" name="txt_BidStatus" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  864. <input id="txt_BidStatusTB" name="txt_BidStatusTB" type="text" class="form-control required" style="width:70%;display:none" maxlength="10" />
  865. </td>
  866. </tr>
  867. <tr>
  868. <th class="formTitle">投标开始日期:</th>
  869. <td class="formValue">
  870. <input id="txt_StarTime" name="txt_StarTime" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  871. </td>
  872. <th class="formTitle">投标截止日期:</th>
  873. <td class="formValue">
  874. <input id="txt_EndTime" name="txt_EndTime" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  875. </td>
  876. </tr>
  877. <tr>
  878. <th class="formTitle">应标项目数:</th>
  879. <td class="formValue">
  880. <input id="txt_YBBCounrt" name="txt_YBBCounrt" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  881. </td>
  882. <th class="formTitle">未应标项目数:</th>
  883. <td class="formValue">
  884. <input id="txt_WYBCounrt" name="txt_WYBCounrt" type="text" class="form-control required" style="width:70%;" maxlength="10" />
  885. </td>
  886. </tr>
  887. <tr>
  888. <th class="formTitle">招标备注:</th>
  889. <td class="formValue">
  890. <input id="txt_Remark" name="txt_Remark" type="text" class="form-control required" style="width: 70%;" maxlength="10" />
  891. </td>
  892. <th class="formTitle" style="font-size:27px">投标总价:</th>
  893. <td class="formValue">
  894. <input id="txt_SumPrice" name="txt_SumPrice" type="text" class="form-control required" style="width:70%;font-size:30px" maxlength="10" />
  895. </td>
  896. @*<th class="formTitle">总价排名:</th>
  897. <td class="formValue">
  898. </td>*@
  899. </tr>
  900. @*<tr>
  901. </tr>*@
  902. @*<tr>
  903. </tr>*@
  904. <tr>
  905. <th class="formTitle">采购附件:</th>
  906. <td class="formValue" colspan="2">
  907. <div id="hidbtnYL" style=" border: 1px #edeff3 solid"></div>
  908. </td>
  909. </tr>
  910. <tr>
  911. <th class="formTitle">附件名称:</th>
  912. <td class="formValue" colspan="3">
  913. @*<input id="fileName" name="fileName" class="form-control" readonly="readonly" style="width:600px" />*@
  914. <div id="hidbtn" style=" border: 1px #edeff3 solid"></div>
  915. </td>
  916. <td class="formValue">
  917. <input id='FileUp' type='file' style="display: none" onchange="UpLoadFile(this)" multiple="multiple" />
  918. <button id="btn_FileUp" class="btn btn-info" type="button" onclick="UpLoadFiles(this)">上传附件</button>
  919. </td>
  920. </tr>
  921. </table>
  922. </div>
  923. <div class="gridPanel" id="gridPanel">
  924. <table id="gridList"></table>
  925. <div id="gridPager"></div>
  926. </div>
  927. </form>