纽威
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.

752 lines
27 KiB

3 years ago
3 years ago
3 years ago
3 years ago
  1. using NFine.Application.WMS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.IO;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using NFine.Code;
  10. using System.Data.SqlClient;
  11. using NFine.Data.Extensions;
  12. using System.Data.OleDb;
  13. using System.Configuration;
  14. using ICS.Application.Entity;
  15. namespace NFine.Web.Areas.WMS.Controllers
  16. {
  17. public class WMSCreateItemLotController : ControllerBase
  18. {
  19. // GET: WMS/WMSCreateItemLot
  20. private WMSCreateItemLotApp App = new WMSCreateItemLotApp();
  21. public ActionResult CreateItemLot()
  22. {
  23. return View();
  24. }
  25. public ActionResult From()
  26. {
  27. return View();
  28. }
  29. [HttpGet]
  30. [HandlerAjaxOnly]
  31. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  32. {
  33. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  34. var JsonData = new
  35. {
  36. total = pagination.total,
  37. page = pagination.page,
  38. records = pagination.records,
  39. rows = ListData,
  40. };
  41. return Content(JsonData.ToJson());
  42. }
  43. [HttpGet]
  44. [HandlerAjaxOnly]
  45. public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, Pagination pagination)
  46. {
  47. DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, ref pagination);
  48. var JsonData = new
  49. {
  50. total = pagination.total,
  51. page = pagination.page,
  52. records = pagination.records,
  53. rows = ListData,
  54. };
  55. return Content(JsonData.ToJson());
  56. }
  57. /// <summary>
  58. /// 点击生成条码查询
  59. /// </summary>
  60. [HttpGet]
  61. [HandlerAjaxOnly]
  62. public ActionResult GetSubGridJsonByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
  63. {
  64. DataTable ListData = App.GetSubGridJsonByCreate(ApplyNegCode, Sequence, WorkPoint);
  65. var JsonData = new
  66. {
  67. rows = ListData,
  68. };
  69. return Content(JsonData.ToJson());
  70. }
  71. [HttpGet]
  72. [HandlerAjaxOnly]
  73. public ActionResult GetVendorLotNo(string VenCode, string WorkPoint)
  74. {
  75. DataTable ListData = App.GetVendorLotNo(VenCode, WorkPoint);
  76. var JsonData = new
  77. {
  78. VendorLotNo = ListData.Rows[0][0].ToString(),
  79. };
  80. return Content(JsonData.ToJson());
  81. }
  82. [HttpPost]
  83. [HandlerAjaxOnly]
  84. [ValidateAntiForgeryToken]
  85. public ActionResult SubmitForm(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  86. {
  87. int i = App.CreateItemLotNo(ApplyNegCode, Sequence, keyValue, WorkPoint);
  88. if (i > 0)
  89. {
  90. return Success("生成成功!");
  91. }
  92. else
  93. {
  94. return Error("生成失败!");
  95. }
  96. }
  97. [HttpPost]
  98. [HandlerAjaxOnly]
  99. [ValidateAntiForgeryToken]
  100. public ActionResult DeleteItemLot(string keyValue)
  101. {
  102. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  103. //WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
  104. string msg = App.DeleteItemLot(keyValue);
  105. if (string.IsNullOrWhiteSpace(msg))
  106. {
  107. return Success("删除成功!");
  108. }
  109. else
  110. {
  111. return Error(msg);
  112. }
  113. }
  114. [HttpPost]
  115. [HandlerAjaxOnly]
  116. [ValidateAntiForgeryToken]
  117. public ActionResult SubmitFormWeiWai(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
  118. {
  119. int i = App.SubmitFormWeiWai(OApplyNegCode, Sequence, keyValue, WorkPoint);
  120. if (i > 0)
  121. {
  122. return Success("生成成功!");
  123. }
  124. else
  125. {
  126. return Error("生成失败!");
  127. }
  128. }
  129. //成品
  130. [HttpPost]
  131. [HandlerAjaxOnly]
  132. [ValidateAntiForgeryToken]
  133. public ActionResult SubmitFormChengPing(string MOCode, string Sequence, string keyValue, string WorkPoint)
  134. {
  135. int i = App.SubmitFormChengPing(MOCode, Sequence, keyValue, WorkPoint);
  136. if (i > 0)
  137. {
  138. return Success("生成成功!");
  139. }
  140. else
  141. {
  142. return Error("生成失败!");
  143. }
  144. }
  145. //销售退货
  146. [HttpPost]
  147. [HandlerAjaxOnly]
  148. [ValidateAntiForgeryToken]
  149. public ActionResult SubmitFormXiaoShou(string SDNCode, string Sequence, string keyValue, string WorkPoint)
  150. {
  151. int i = App.SubmitFormXiaoShou(SDNCode, Sequence, keyValue, WorkPoint);
  152. if (i > 0)
  153. {
  154. return Success("生成成功!");
  155. }
  156. else
  157. {
  158. return Error("生成失败!");
  159. }
  160. }
  161. //其他
  162. [HttpPost]
  163. [HandlerAjaxOnly]
  164. [ValidateAntiForgeryToken]
  165. public ActionResult SubmitFormQiTa(string InCode, string Sequence, string keyValue, string WorkPoint)
  166. {
  167. int i = App.SubmitFormQiTa(InCode, Sequence, keyValue, WorkPoint);
  168. if (i > 0)
  169. {
  170. return Success("生成成功!");
  171. }
  172. else
  173. {
  174. return Error("生成失败!");
  175. }
  176. }
  177. /// <summary>
  178. /// 打印数据参数:服务器的URL+打印的文件名,转化为Base64编码
  179. /// </summary>
  180. protected string strPrintData;
  181. /// <summary>
  182. /// 标识是否安装了控件
  183. /// </summary>
  184. protected bool bIsInstallPrintControl = true;
  185. /// <summary>
  186. /// 打印控件的Cookie值
  187. /// </summary>
  188. protected string strPrintControlCookie = "";
  189. /// <summary>
  190. /// 获取Url中去掉文件名的路径
  191. /// </summary>
  192. /// <returns></returns>
  193. private string GetUrlPath()
  194. {
  195. string strUrl = Request.Url.ToString();
  196. int iEnd = strUrl.LastIndexOf("/");
  197. strUrl = strUrl.Substring(0, iEnd + 1);
  198. return strUrl;
  199. }
  200. //打印
  201. [HttpPost]
  202. [HandlerAjaxOnly]
  203. public ActionResult PrintItemLot(string keyValue, string WorkPoint,string Type)
  204. {
  205. // string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  206. keyValue = keyValue.Substring(1, keyValue.Length - 2);
  207. WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
  208. string strPrintFileName = Server.MapPath("/ReportFile/") + "纷纷无法b_成品条码.fr3";
  209. PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName);
  210. pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息
  211. //pJson.CheckRegister("注册姓名", "8ECCCD6A1302DFEE1A6456A5D"); //注册信息
  212. //pJson.AddPrintParam("ShopName", "测试酒楼");
  213. //pJson.AddPrintParam("PrintDepositAdd", "说明:本单据为贵客押金收取凭证,盖章有效。退房时请出示,遗失者自负,请妥善保存。退房时间为12:00时,延时退房18:00时以前按半天房费收取,18:00时以后算全天房价。押金单有效期为一个月,过期作废。 贵重物品请交前台寄存,未寄存丢失自负。 谢谢!");
  214. SetCookieAndURL(pJson);// 设置控件调用的Cookie值,判断是否安装了打印控件
  215. string strSql = "";
  216. if (Type=="1")
  217. {
  218. strSql = @"select a.LotNo, c.ApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  219. FROM dbo.ICSInventoryLot a
  220. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  221. left join ICSMOApplyNegDetail c on b.TransCode=c.ApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  222. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  223. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  224. }
  225. if (Type=="2")
  226. {
  227. strSql = @"select a.LotNo, c.OApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  228. FROM dbo.ICSInventoryLot a
  229. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  230. left join ICSOApplyNegDetail c on b.TransCode=c.OApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  231. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  232. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  233. }
  234. if (Type == "3")
  235. {
  236. strSql = @"select a.LotNo, c.MOCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  237. FROM dbo.ICSInventoryLot a
  238. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  239. left join ICSMO c on b.TransCode=c.MOCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  240. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  241. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  242. }
  243. if (Type == "5")
  244. {
  245. strSql = @"select a.LotNo, c.InCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  246. FROM dbo.ICSInventoryLot a
  247. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  248. left join ICSOtherIn c on b.TransCode=c.InCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  249. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  250. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  251. }
  252. if (Type == "6")
  253. {
  254. strSql = @"select a.LotNo, c.ReturnCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  255. FROM dbo.ICSInventoryLot a
  256. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  257. left join ICSReturn c on b.TransCode=c.ReturnCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  258. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  259. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  260. }
  261. if (Type == "7")
  262. {
  263. strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  264. FROM dbo.ICSInventoryLot a
  265. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  266. left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  267. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  268. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  269. }
  270. if (Type == "8")
  271. {
  272. strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  273. FROM dbo.ICSInventoryLot a
  274. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  275. left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  276. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  277. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  278. }
  279. if (Type == "9")
  280. {
  281. strSql = @" select a.LotNo, c.RCVCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  282. FROM dbo.ICSInventoryLot a
  283. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  284. left join ICSManufactureReceive c on b.TransCode=c.RCVCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  285. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  286. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  287. }
  288. //string strSql = @"Select * From CashLog";
  289. DataTable dtCashLog = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  290. // string strPrintTempFile = pJson.ShowReport(dtCashLog); //产生JSON文件内容
  291. string strPrintTempFile = pJson.ShowReport(dtCashLog); //导出PDF文件
  292. //把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
  293. string strServerURL = GetUrlPath() + "PrintTemp/";
  294. string strData = strServerURL + strPrintTempFile;
  295. strPrintData = PrintFunction.EnBase64(strData);
  296. var JsonData = new
  297. {
  298. strPrintData_1 = strPrintData,
  299. bIsInstallPrintControl_1 = bIsInstallPrintControl,
  300. strPrintControlCookie_1 = strPrintControlCookie
  301. };
  302. //多站点
  303. string sql = @"UPDATE dbo.ICSInventoryLot
  304. SET PrintTimes=ISNULL(PrintTimes,0)+1,
  305. LastPrintUser='',
  306. LastPrintTime=GETDATE()
  307. WHERE ID IN (" + keyValue.TrimEnd(',') + ") and WorkPoint in ('" + WorkPoint.TrimEnd(',') + "')";
  308. SqlHelper.ExecuteNonQuery(sql);
  309. return Content(JsonData.ToJson());
  310. }
  311. /// <summary>
  312. /// 设置控件调用的Cookie值,判断是否安装了打印控件
  313. /// </summary>
  314. /// <param name="pJson"></param>
  315. private void SetCookieAndURL(PrintJson pJson)
  316. {
  317. bIsInstallPrintControl = false;
  318. strPrintControlCookie = "";
  319. HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
  320. if (pCookieInstall != null)
  321. { //Cookie存在
  322. strPrintControlCookie = pCookieInstall.Value.ToString();
  323. //以Cookie值查找在数据表中是否存在
  324. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  325. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
  326. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  327. {
  328. if (drCookie.Read())
  329. { //标识为已经安装
  330. bIsInstallPrintControl = true;
  331. }
  332. drCookie.Close();
  333. }
  334. //更新Cookie的保存时间
  335. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  336. Response.SetCookie(pCookieInstall);
  337. }
  338. else
  339. {//Cookie不存在,则新建Cookie
  340. strPrintControlCookie = System.Guid.NewGuid().ToString();
  341. pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
  342. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  343. Response.Cookies.Add(pCookieInstall);
  344. }
  345. string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
  346. pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
  347. }
  348. [HttpGet]
  349. [HandlerAjaxOnly]
  350. public ActionResult GetGridJsonWeiWai(Pagination pagination, string queryJson)
  351. {
  352. DataTable ListData = App.GetGridJsonWeiWai(queryJson, ref pagination);
  353. var JsonData = new
  354. {
  355. total = pagination.total,
  356. page = pagination.page,
  357. records = pagination.records,
  358. rows = ListData,
  359. };
  360. return Content(JsonData.ToJson());
  361. }
  362. [HttpGet]
  363. [HandlerAjaxOnly]
  364. public ActionResult GetSubGridJsonWeiWai(string OApplyNegCode, string Sequence, Pagination pagination)
  365. {
  366. DataTable ListData = App.GetSubGridJsonWeiWai(OApplyNegCode, Sequence, ref pagination);
  367. var JsonData = new
  368. {
  369. total = pagination.total,
  370. page = pagination.page,
  371. records = pagination.records,
  372. rows = ListData,
  373. };
  374. return Content(JsonData.ToJson());
  375. }
  376. /// <summary>
  377. /// 点击生成条码查询
  378. /// </summary>
  379. [HttpGet]
  380. [HandlerAjaxOnly]
  381. public ActionResult GetSubGridJsonWeiWaiByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  382. {
  383. DataTable ListData = App.GetSubGridJsonWeiWaiByCreate(OApplyNegCode, Sequence, WorkPoint);
  384. var JsonData = new
  385. {
  386. rows = ListData,
  387. };
  388. return Content(JsonData.ToJson());
  389. }
  390. [HttpGet]
  391. [HandlerAjaxOnly]
  392. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  393. {
  394. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  395. var JsonData = new
  396. {
  397. total = pagination.total,
  398. page = pagination.page,
  399. records = pagination.records,
  400. rows = ListData,
  401. };
  402. return Content(JsonData.ToJson());
  403. }
  404. /// <summary>
  405. /// 点击生成条码查询(成品)
  406. /// </summary>
  407. [HttpGet]
  408. [HandlerAjaxOnly]
  409. public ActionResult GetSubGridJsonChengPingByCreate(string MOCode, string Sequence, string WorkPoint)
  410. {
  411. DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint);
  412. var JsonData = new
  413. {
  414. rows = ListData,
  415. };
  416. return Content(JsonData.ToJson());
  417. }
  418. [HttpGet]
  419. [HandlerAjaxOnly]
  420. public ActionResult GetGridJsonXiaoShou(Pagination pagination, string queryJson)
  421. {
  422. DataTable ListData = App.GetGridJsonXiaoShou(queryJson, ref pagination);
  423. var JsonData = new
  424. {
  425. total = pagination.total,
  426. page = pagination.page,
  427. records = pagination.records,
  428. rows = ListData,
  429. };
  430. return Content(JsonData.ToJson());
  431. }
  432. [HttpGet]
  433. [HandlerAjaxOnly]
  434. public ActionResult GetGridJsonQiTa(Pagination pagination, string queryJson)
  435. {
  436. DataTable ListData = App.GetGridJsonQiTa(queryJson, ref pagination);
  437. var JsonData = new
  438. {
  439. total = pagination.total,
  440. page = pagination.page,
  441. records = pagination.records,
  442. rows = ListData,
  443. };
  444. return Content(JsonData.ToJson());
  445. }
  446. /// <summary>
  447. /// 点击生成条码查询(销售退货)
  448. /// </summary>
  449. [HttpGet]
  450. [HandlerAjaxOnly]
  451. public ActionResult GetSubGridJsonXiaoShouByCreate(string SDNCode, string Sequence, string WorkPoint)
  452. {
  453. DataTable ListData = App.GetSubGridJsonXiaoShouByCreate(SDNCode, Sequence, WorkPoint);
  454. var JsonData = new
  455. {
  456. rows = ListData,
  457. };
  458. return Content(JsonData.ToJson());
  459. }
  460. /// <summary>
  461. /// 点击生成条码查询(其他入库)
  462. /// </summary>
  463. [HttpGet]
  464. [HandlerAjaxOnly]
  465. public ActionResult GetSubGridJsonQiTaByCreate(string InCode, string Sequence, string WorkPoint)
  466. {
  467. DataTable ListData = App.GetSubGridJsonQiTaByCreate(InCode, Sequence, WorkPoint);
  468. var JsonData = new
  469. {
  470. rows = ListData,
  471. };
  472. return Content(JsonData.ToJson());
  473. }
  474. //归还
  475. [HttpGet]
  476. [HandlerAjaxOnly]
  477. public ActionResult GetGridJsonGuiHuan(Pagination pagination, string queryJson)
  478. {
  479. DataTable ListData = App.GetGridJsonGuiHuan(queryJson, ref pagination);
  480. var JsonData = new
  481. {
  482. total = pagination.total,
  483. page = pagination.page,
  484. records = pagination.records,
  485. rows = ListData,
  486. };
  487. return Content(JsonData.ToJson());
  488. }
  489. //审核到货单
  490. [HttpGet]
  491. [HandlerAjaxOnly]
  492. public ActionResult GetGridJsonSHDH(Pagination pagination, string queryJson)
  493. {
  494. DataTable ListData = App.GetGridJsonSHDH(queryJson, ref pagination);
  495. var JsonData = new
  496. {
  497. total = pagination.total,
  498. page = pagination.page,
  499. records = pagination.records,
  500. rows = ListData,
  501. };
  502. return Content(JsonData.ToJson());
  503. }
  504. //审核到货单
  505. [HttpGet]
  506. [HandlerAjaxOnly]
  507. public ActionResult GetGridJsonWWSHDH(Pagination pagination, string queryJson)
  508. {
  509. DataTable ListData = App.GetGridJsonWWSHDH(queryJson, ref pagination);
  510. var JsonData = new
  511. {
  512. total = pagination.total,
  513. page = pagination.page,
  514. records = pagination.records,
  515. rows = ListData,
  516. };
  517. return Content(JsonData.ToJson());
  518. }
  519. //审核到货单
  520. [HttpGet]
  521. [HandlerAjaxOnly]
  522. public ActionResult GetGridJsonKLCPRK(Pagination pagination, string queryJson)
  523. {
  524. DataTable ListData = App.GetGridJsonKLCPRK(queryJson, ref pagination);
  525. var JsonData = new
  526. {
  527. total = pagination.total,
  528. page = pagination.page,
  529. records = pagination.records,
  530. rows = ListData,
  531. };
  532. return Content(JsonData.ToJson());
  533. }
  534. /// <summary>
  535. /// 点击生成条码查询(审核到货单)
  536. /// </summary>
  537. [HttpGet]
  538. [HandlerAjaxOnly]
  539. public ActionResult GetSubGridJsonSHDHByCreate(string DNCode, string Sequence, string WorkPoint)
  540. {
  541. DataTable ListData = App.GetSubGridJsonSHDHByCreate(DNCode, Sequence, WorkPoint);
  542. var JsonData = new
  543. {
  544. rows = ListData,
  545. };
  546. return Content(JsonData.ToJson());
  547. }
  548. /// <summary>
  549. /// 点击生成条码查询(审核委外到货单)
  550. /// </summary>
  551. [HttpGet]
  552. [HandlerAjaxOnly]
  553. public ActionResult GetSubGridJsonWWSHDHByCreate(string ODNCode, string Sequence, string WorkPoint)
  554. {
  555. DataTable ListData = App.GetSubGridJsonWWSHDHByCreate(ODNCode, Sequence, WorkPoint);
  556. var JsonData = new
  557. {
  558. rows = ListData,
  559. };
  560. return Content(JsonData.ToJson());
  561. }
  562. /// <summary>
  563. /// 点击生成条码查询(审核委外到货单)
  564. /// </summary>
  565. [HttpGet]
  566. [HandlerAjaxOnly]
  567. public ActionResult GetSubGridJsonKLCPRKByCreate(string RCVCode, string Sequence, string WorkPoint)
  568. {
  569. DataTable ListData = App.GetSubGridJsonKLCPRKByCreate(RCVCode, Sequence, WorkPoint);
  570. var JsonData = new
  571. {
  572. rows = ListData,
  573. };
  574. return Content(JsonData.ToJson());
  575. }
  576. /// <summary>
  577. /// 点击生成条码查询(归还)
  578. /// </summary>
  579. [HttpGet]
  580. [HandlerAjaxOnly]
  581. public ActionResult GetSubGridJsonGuiHuanByCreate(string ReturnCode, string Sequence, string WorkPoint)
  582. {
  583. DataTable ListData = App.GetSubGridJsonGuiHuanByCreate(ReturnCode, Sequence, WorkPoint);
  584. var JsonData = new
  585. {
  586. rows = ListData,
  587. };
  588. return Content(JsonData.ToJson());
  589. }
  590. //归还
  591. [HttpPost]
  592. [HandlerAjaxOnly]
  593. [ValidateAntiForgeryToken]
  594. public ActionResult SubmitFormGuiHuan(string ReturnCode, string Sequence, string keyValue, string WorkPoint)
  595. {
  596. int i = App.SubmitFormGuiHuan(ReturnCode, Sequence, keyValue, WorkPoint);
  597. if (i > 0)
  598. {
  599. return Success("生成成功!");
  600. }
  601. else
  602. {
  603. return Error("生成失败!");
  604. }
  605. }
  606. //审核到货单
  607. [HttpPost]
  608. [HandlerAjaxOnly]
  609. [ValidateAntiForgeryToken]
  610. public ActionResult SubmitFormSHDH(string DNCode, string Sequence, string keyValue, string WorkPoint)
  611. {
  612. int i = App.SubmitFormSHDH(DNCode, Sequence, keyValue, WorkPoint);
  613. if (i > 0)
  614. {
  615. return Success("生成成功!");
  616. }
  617. else
  618. {
  619. return Error("生成失败!");
  620. }
  621. }
  622. //审核委外到货单
  623. [HttpPost]
  624. [HandlerAjaxOnly]
  625. [ValidateAntiForgeryToken]
  626. public ActionResult SubmitFormWWSHDH(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  627. {
  628. int i = App.SubmitFormWWSHDH(ODNCode, Sequence, keyValue, WorkPoint);
  629. if (i > 0)
  630. {
  631. return Success("生成成功!");
  632. }
  633. else
  634. {
  635. return Error("生成失败!");
  636. }
  637. }
  638. //开立成品入库
  639. [HttpPost]
  640. [HandlerAjaxOnly]
  641. [ValidateAntiForgeryToken]
  642. public ActionResult SubmitFormKLCPRK(string RCVCode, string Sequence, string keyValue, string WorkPoint)
  643. {
  644. int i = App.SubmitFormKLCPRK(RCVCode, Sequence, keyValue, WorkPoint);
  645. if (i > 0)
  646. {
  647. return Success("生成成功!");
  648. }
  649. else
  650. {
  651. return Error("生成失败!");
  652. }
  653. }
  654. //委外拒收单
  655. [HttpGet]
  656. [HandlerAjaxOnly]
  657. public ActionResult GetGridJsonWWJSD(Pagination pagination, string queryJson)
  658. {
  659. DataTable ListData = App.GetGridJsonWWJSD(queryJson, ref pagination);
  660. var JsonData = new
  661. {
  662. total = pagination.total,
  663. page = pagination.page,
  664. records = pagination.records,
  665. rows = ListData,
  666. };
  667. return Content(JsonData.ToJson());
  668. }
  669. //拒收单
  670. [HttpGet]
  671. [HandlerAjaxOnly]
  672. public ActionResult GetGridJsonJSD(Pagination pagination, string queryJson)
  673. {
  674. DataTable ListData = App.GetGridJsonJSD(queryJson, ref pagination);
  675. var JsonData = new
  676. {
  677. total = pagination.total,
  678. page = pagination.page,
  679. records = pagination.records,
  680. rows = ListData,
  681. };
  682. return Content(JsonData.ToJson());
  683. }
  684. }
  685. }