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

852 lines
31 KiB

3 years ago
3 years ago
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. if (Type == "10")
  289. {
  290. strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  291. FROM dbo.ICSInventoryLot a
  292. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  293. left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  294. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  295. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  296. }
  297. if (Type == "11")
  298. {
  299. strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
  300. FROM dbo.ICSInventoryLot a
  301. left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
  302. left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
  303. left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
  304. where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
  305. }
  306. //string strSql = @"Select * From CashLog";
  307. DataTable dtCashLog = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
  308. // string strPrintTempFile = pJson.ShowReport(dtCashLog); //产生JSON文件内容
  309. string strPrintTempFile = pJson.ShowReport(dtCashLog); //导出PDF文件
  310. //把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
  311. string strServerURL = GetUrlPath() + "PrintTemp/";
  312. string strData = strServerURL + strPrintTempFile;
  313. strPrintData = PrintFunction.EnBase64(strData);
  314. var JsonData = new
  315. {
  316. strPrintData_1 = strPrintData,
  317. bIsInstallPrintControl_1 = bIsInstallPrintControl,
  318. strPrintControlCookie_1 = strPrintControlCookie
  319. };
  320. //多站点
  321. string sql = @"UPDATE dbo.ICSInventoryLot
  322. SET PrintTimes=ISNULL(PrintTimes,0)+1,
  323. LastPrintUser='',
  324. LastPrintTime=GETDATE()
  325. WHERE ID IN (" + keyValue.TrimEnd(',') + ") and WorkPoint in ('" + WorkPoint.TrimEnd(',') + "')";
  326. SqlHelper.ExecuteNonQuery(sql);
  327. return Content(JsonData.ToJson());
  328. }
  329. /// <summary>
  330. /// 设置控件调用的Cookie值,判断是否安装了打印控件
  331. /// </summary>
  332. /// <param name="pJson"></param>
  333. private void SetCookieAndURL(PrintJson pJson)
  334. {
  335. bIsInstallPrintControl = false;
  336. strPrintControlCookie = "";
  337. HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
  338. if (pCookieInstall != null)
  339. { //Cookie存在
  340. strPrintControlCookie = pCookieInstall.Value.ToString();
  341. //以Cookie值查找在数据表中是否存在
  342. string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
  343. SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
  344. using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
  345. {
  346. if (drCookie.Read())
  347. { //标识为已经安装
  348. bIsInstallPrintControl = true;
  349. }
  350. drCookie.Close();
  351. }
  352. //更新Cookie的保存时间
  353. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  354. Response.SetCookie(pCookieInstall);
  355. }
  356. else
  357. {//Cookie不存在,则新建Cookie
  358. strPrintControlCookie = System.Guid.NewGuid().ToString();
  359. pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
  360. pCookieInstall.Expires = DateTime.Now.AddYears(10);
  361. Response.Cookies.Add(pCookieInstall);
  362. }
  363. string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
  364. pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
  365. }
  366. [HttpGet]
  367. [HandlerAjaxOnly]
  368. public ActionResult GetGridJsonWeiWai(Pagination pagination, string queryJson)
  369. {
  370. DataTable ListData = App.GetGridJsonWeiWai(queryJson, ref pagination);
  371. var JsonData = new
  372. {
  373. total = pagination.total,
  374. page = pagination.page,
  375. records = pagination.records,
  376. rows = ListData,
  377. };
  378. return Content(JsonData.ToJson());
  379. }
  380. [HttpGet]
  381. [HandlerAjaxOnly]
  382. public ActionResult GetSubGridJsonWeiWai(string OApplyNegCode, string Sequence, Pagination pagination)
  383. {
  384. DataTable ListData = App.GetSubGridJsonWeiWai(OApplyNegCode, Sequence, ref pagination);
  385. var JsonData = new
  386. {
  387. total = pagination.total,
  388. page = pagination.page,
  389. records = pagination.records,
  390. rows = ListData,
  391. };
  392. return Content(JsonData.ToJson());
  393. }
  394. /// <summary>
  395. /// 点击生成条码查询
  396. /// </summary>
  397. [HttpGet]
  398. [HandlerAjaxOnly]
  399. public ActionResult GetSubGridJsonWeiWaiByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
  400. {
  401. DataTable ListData = App.GetSubGridJsonWeiWaiByCreate(OApplyNegCode, Sequence, WorkPoint);
  402. var JsonData = new
  403. {
  404. rows = ListData,
  405. };
  406. return Content(JsonData.ToJson());
  407. }
  408. [HttpGet]
  409. [HandlerAjaxOnly]
  410. public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
  411. {
  412. DataTable ListData = App.GetGridJsonChengPing(queryJson, ref pagination);
  413. var JsonData = new
  414. {
  415. total = pagination.total,
  416. page = pagination.page,
  417. records = pagination.records,
  418. rows = ListData,
  419. };
  420. return Content(JsonData.ToJson());
  421. }
  422. /// <summary>
  423. /// 点击生成条码查询(成品)
  424. /// </summary>
  425. [HttpGet]
  426. [HandlerAjaxOnly]
  427. public ActionResult GetSubGridJsonChengPingByCreate(string MOCode, string Sequence, string WorkPoint)
  428. {
  429. DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint);
  430. var JsonData = new
  431. {
  432. rows = ListData,
  433. };
  434. return Content(JsonData.ToJson());
  435. }
  436. [HttpGet]
  437. [HandlerAjaxOnly]
  438. public ActionResult GetGridJsonXiaoShou(Pagination pagination, string queryJson)
  439. {
  440. DataTable ListData = App.GetGridJsonXiaoShou(queryJson, ref pagination);
  441. var JsonData = new
  442. {
  443. total = pagination.total,
  444. page = pagination.page,
  445. records = pagination.records,
  446. rows = ListData,
  447. };
  448. return Content(JsonData.ToJson());
  449. }
  450. [HttpGet]
  451. [HandlerAjaxOnly]
  452. public ActionResult GetGridJsonQiTa(Pagination pagination, string queryJson)
  453. {
  454. DataTable ListData = App.GetGridJsonQiTa(queryJson, ref pagination);
  455. var JsonData = new
  456. {
  457. total = pagination.total,
  458. page = pagination.page,
  459. records = pagination.records,
  460. rows = ListData,
  461. };
  462. return Content(JsonData.ToJson());
  463. }
  464. /// <summary>
  465. /// 点击生成条码查询(销售退货)
  466. /// </summary>
  467. [HttpGet]
  468. [HandlerAjaxOnly]
  469. public ActionResult GetSubGridJsonXiaoShouByCreate(string SDNCode, string Sequence, string WorkPoint)
  470. {
  471. DataTable ListData = App.GetSubGridJsonXiaoShouByCreate(SDNCode, Sequence, WorkPoint);
  472. var JsonData = new
  473. {
  474. rows = ListData,
  475. };
  476. return Content(JsonData.ToJson());
  477. }
  478. /// <summary>
  479. /// 点击生成条码查询(其他入库)
  480. /// </summary>
  481. [HttpGet]
  482. [HandlerAjaxOnly]
  483. public ActionResult GetSubGridJsonQiTaByCreate(string InCode, string Sequence, string WorkPoint)
  484. {
  485. DataTable ListData = App.GetSubGridJsonQiTaByCreate(InCode, Sequence, WorkPoint);
  486. var JsonData = new
  487. {
  488. rows = ListData,
  489. };
  490. return Content(JsonData.ToJson());
  491. }
  492. //归还
  493. [HttpGet]
  494. [HandlerAjaxOnly]
  495. public ActionResult GetGridJsonGuiHuan(Pagination pagination, string queryJson)
  496. {
  497. DataTable ListData = App.GetGridJsonGuiHuan(queryJson, ref pagination);
  498. var JsonData = new
  499. {
  500. total = pagination.total,
  501. page = pagination.page,
  502. records = pagination.records,
  503. rows = ListData,
  504. };
  505. return Content(JsonData.ToJson());
  506. }
  507. //审核到货单
  508. [HttpGet]
  509. [HandlerAjaxOnly]
  510. public ActionResult GetGridJsonSHDH(Pagination pagination, string queryJson)
  511. {
  512. DataTable ListData = App.GetGridJsonSHDH(queryJson, ref pagination);
  513. var JsonData = new
  514. {
  515. total = pagination.total,
  516. page = pagination.page,
  517. records = pagination.records,
  518. rows = ListData,
  519. };
  520. return Content(JsonData.ToJson());
  521. }
  522. //审核到货单
  523. [HttpGet]
  524. [HandlerAjaxOnly]
  525. public ActionResult GetGridJsonWWSHDH(Pagination pagination, string queryJson)
  526. {
  527. DataTable ListData = App.GetGridJsonWWSHDH(queryJson, ref pagination);
  528. var JsonData = new
  529. {
  530. total = pagination.total,
  531. page = pagination.page,
  532. records = pagination.records,
  533. rows = ListData,
  534. };
  535. return Content(JsonData.ToJson());
  536. }
  537. //审核到货单
  538. [HttpGet]
  539. [HandlerAjaxOnly]
  540. public ActionResult GetGridJsonKLCPRK(Pagination pagination, string queryJson)
  541. {
  542. DataTable ListData = App.GetGridJsonKLCPRK(queryJson, ref pagination);
  543. var JsonData = new
  544. {
  545. total = pagination.total,
  546. page = pagination.page,
  547. records = pagination.records,
  548. rows = ListData,
  549. };
  550. return Content(JsonData.ToJson());
  551. }
  552. /// <summary>
  553. /// 点击生成条码查询(审核到货单)
  554. /// </summary>
  555. [HttpGet]
  556. [HandlerAjaxOnly]
  557. public ActionResult GetSubGridJsonSHDHByCreate(string DNCode, string Sequence, string WorkPoint)
  558. {
  559. DataTable ListData = App.GetSubGridJsonSHDHByCreate(DNCode, Sequence, WorkPoint);
  560. var JsonData = new
  561. {
  562. rows = ListData,
  563. };
  564. return Content(JsonData.ToJson());
  565. }
  566. /// <summary>
  567. /// 点击生成条码查询(审核委外到货单)
  568. /// </summary>
  569. [HttpGet]
  570. [HandlerAjaxOnly]
  571. public ActionResult GetSubGridJsonWWSHDHByCreate(string ODNCode, string Sequence, string WorkPoint)
  572. {
  573. DataTable ListData = App.GetSubGridJsonWWSHDHByCreate(ODNCode, Sequence, WorkPoint);
  574. var JsonData = new
  575. {
  576. rows = ListData,
  577. };
  578. return Content(JsonData.ToJson());
  579. }
  580. /// <summary>
  581. /// 点击生成条码查询(审核委外到货单)
  582. /// </summary>
  583. [HttpGet]
  584. [HandlerAjaxOnly]
  585. public ActionResult GetSubGridJsonKLCPRKByCreate(string RCVCode, string Sequence, string WorkPoint)
  586. {
  587. DataTable ListData = App.GetSubGridJsonKLCPRKByCreate(RCVCode, Sequence, WorkPoint);
  588. var JsonData = new
  589. {
  590. rows = ListData,
  591. };
  592. return Content(JsonData.ToJson());
  593. }
  594. /// <summary>
  595. /// 点击生成条码查询(归还)
  596. /// </summary>
  597. [HttpGet]
  598. [HandlerAjaxOnly]
  599. public ActionResult GetSubGridJsonGuiHuanByCreate(string ReturnCode, string Sequence, string WorkPoint)
  600. {
  601. DataTable ListData = App.GetSubGridJsonGuiHuanByCreate(ReturnCode, Sequence, WorkPoint);
  602. var JsonData = new
  603. {
  604. rows = ListData,
  605. };
  606. return Content(JsonData.ToJson());
  607. }
  608. //归还
  609. [HttpPost]
  610. [HandlerAjaxOnly]
  611. [ValidateAntiForgeryToken]
  612. public ActionResult SubmitFormGuiHuan(string ReturnCode, string Sequence, string keyValue, string WorkPoint)
  613. {
  614. int i = App.SubmitFormGuiHuan(ReturnCode, Sequence, keyValue, WorkPoint);
  615. if (i > 0)
  616. {
  617. return Success("生成成功!");
  618. }
  619. else
  620. {
  621. return Error("生成失败!");
  622. }
  623. }
  624. //审核到货单
  625. [HttpPost]
  626. [HandlerAjaxOnly]
  627. [ValidateAntiForgeryToken]
  628. public ActionResult SubmitFormSHDH(string DNCode, string Sequence, string keyValue, string WorkPoint)
  629. {
  630. int i = App.SubmitFormSHDH(DNCode, Sequence, keyValue, WorkPoint);
  631. if (i > 0)
  632. {
  633. return Success("生成成功!");
  634. }
  635. else
  636. {
  637. return Error("生成失败!");
  638. }
  639. }
  640. //审核委外到货单
  641. [HttpPost]
  642. [HandlerAjaxOnly]
  643. [ValidateAntiForgeryToken]
  644. public ActionResult SubmitFormWWSHDH(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  645. {
  646. int i = App.SubmitFormWWSHDH(ODNCode, Sequence, keyValue, WorkPoint);
  647. if (i > 0)
  648. {
  649. return Success("生成成功!");
  650. }
  651. else
  652. {
  653. return Error("生成失败!");
  654. }
  655. }
  656. //开立成品入库
  657. [HttpPost]
  658. [HandlerAjaxOnly]
  659. [ValidateAntiForgeryToken]
  660. public ActionResult SubmitFormKLCPRK(string RCVCode, string Sequence, string keyValue, string WorkPoint)
  661. {
  662. int i = App.SubmitFormKLCPRK(RCVCode, Sequence, keyValue, WorkPoint);
  663. if (i > 0)
  664. {
  665. return Success("生成成功!");
  666. }
  667. else
  668. {
  669. return Error("生成失败!");
  670. }
  671. }
  672. //委外拒收单
  673. [HttpGet]
  674. [HandlerAjaxOnly]
  675. public ActionResult GetGridJsonWWJSD(Pagination pagination, string queryJson)
  676. {
  677. DataTable ListData = App.GetGridJsonWWJSD(queryJson, ref pagination);
  678. var JsonData = new
  679. {
  680. total = pagination.total,
  681. page = pagination.page,
  682. records = pagination.records,
  683. rows = ListData,
  684. };
  685. return Content(JsonData.ToJson());
  686. }
  687. //拒收单
  688. [HttpGet]
  689. [HandlerAjaxOnly]
  690. public ActionResult GetGridJsonJSD(Pagination pagination, string queryJson)
  691. {
  692. DataTable ListData = App.GetGridJsonJSD(queryJson, ref pagination);
  693. var JsonData = new
  694. {
  695. total = pagination.total,
  696. page = pagination.page,
  697. records = pagination.records,
  698. rows = ListData,
  699. };
  700. return Content(JsonData.ToJson());
  701. }
  702. //审核到货单
  703. [HttpPost]
  704. [HandlerAjaxOnly]
  705. [ValidateAntiForgeryToken]
  706. public ActionResult SubmitFormJSD(string DNCode, string Sequence, string keyValue, string WorkPoint)
  707. {
  708. int i = App.SubmitFormJSD(DNCode, Sequence, keyValue, WorkPoint);
  709. if (i > 0)
  710. {
  711. return Success("生成成功!");
  712. }
  713. else
  714. {
  715. return Error("生成失败!");
  716. }
  717. }
  718. //审核委外到货单
  719. [HttpPost]
  720. [HandlerAjaxOnly]
  721. [ValidateAntiForgeryToken]
  722. public ActionResult SubmitFormWWJSD(string ODNCode, string Sequence, string keyValue, string WorkPoint)
  723. {
  724. int i = App.SubmitFormWWJSD(ODNCode, Sequence, keyValue, WorkPoint);
  725. if (i > 0)
  726. {
  727. return Success("生成成功!");
  728. }
  729. else
  730. {
  731. return Error("生成失败!");
  732. }
  733. }
  734. //领料申请退料
  735. [HttpGet]
  736. [HandlerAjaxOnly]
  737. public ActionResult GetGridJsonLLSQTL(Pagination pagination, string queryJson)
  738. {
  739. DataTable ListData = App.GetGridJsonLLSQTL(queryJson, ref pagination);
  740. var JsonData = new
  741. {
  742. total = pagination.total,
  743. page = pagination.page,
  744. records = pagination.records,
  745. rows = ListData,
  746. };
  747. return Content(JsonData.ToJson());
  748. }
  749. /// <summary>
  750. /// 点击生成条码查询(审核到货单)
  751. /// </summary>
  752. [HttpGet]
  753. [HandlerAjaxOnly]
  754. public ActionResult GetSubGridJsonJSDByCreate(string DNCode, string Sequence, string WorkPoint)
  755. {
  756. DataTable ListData = App.GetSubGridJsonJSDByCreate(DNCode, Sequence, WorkPoint);
  757. var JsonData = new
  758. {
  759. rows = ListData,
  760. };
  761. return Content(JsonData.ToJson());
  762. }
  763. /// <summary>
  764. /// 点击生成条码查询(审核委外到货单)
  765. /// </summary>
  766. [HttpGet]
  767. [HandlerAjaxOnly]
  768. public ActionResult GetSubGridJsonWWJSDByCreate(string ODNCode, string Sequence, string WorkPoint)
  769. {
  770. DataTable ListData = App.GetSubGridJsonWWJSDByCreate(ODNCode, Sequence, WorkPoint);
  771. var JsonData = new
  772. {
  773. rows = ListData,
  774. };
  775. return Content(JsonData.ToJson());
  776. }
  777. }
  778. }