CurrentFinshedStoreHouseMg.cshtml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. @using Microsoft.Ajax.Utilities
  2. @using ShwasherSys.Authorization.Permissions
  3. @using ShwasherSys.Models.Layout
  4. @using ShwasherSys.Models.Modal
  5. @{
  6. /**/
  7. ViewBag.ActiveMenu = PermissionNames.PagesFinshedStoreInfoCurrentFinshedStoreHouseMg; //The menu item will be active for this page.
  8. ViewBag.Title = "成品库存实时信息";
  9. //List<SelectListItem> semiApplyStatus = ViewBag.SemiApplyStatus;
  10. List<SelectListItem> storeHouses = ViewBag.StoreHouses;
  11. string AddEnterAuth = PermissionNames.PagesFinshedStoreInfoCurrentFinshedStoreHouseMgAddEnter;
  12. string AddOutAuth = PermissionNames.PagesFinshedStoreInfoCurrentFinshedStoreHouseMgAddOut;
  13. string updateStoreLocation = PermissionNames.PagesFinshedStoreInfoCurrentFinshedStoreHouseMgUpdateStoreLocation;
  14. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  15. {
  16. new SearchItem("productionOrderNo","流转单编号"),
  17. new SearchItem("productName","成品名称"),
  18. new SearchItem("model","规格"),
  19. new SearchItem("material","材质"),
  20. new SearchItem("surfaceColor","表色"),
  21. new SearchItem("rigidity","硬度"),
  22. new SearchItem("timeCreated","创建时间",FiledType.Dnull,ExpType.GreaterOrEqual),
  23. new SearchItem("timeCreated","至",FiledType.Dnull,ExpType.LessOrEqual),
  24. new SearchItem("productNo","成品编号").SetSearchIcon("query_Product_modal"),
  25. new SearchItem("actualQuantity","异常数据",FiledType.Dec,ExpType.LessOrEqual).SetSearchItem(new List<SelectListItem> {new SelectListItem(){Text = "异常",Value = "0"}}),
  26. }, false);
  27. }
  28. @section css{
  29. <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
  30. <style>
  31. .tool-rc-group {
  32. border: 1px solid #ba63d3;
  33. float: left;
  34. margin: 0 5px;
  35. padding-right: 5px;
  36. border-radius: 5px;
  37. }
  38. /*[type="checkbox"] + label::before, [type="checkbox"]:not(.filled-in) + label::after {
  39. content: '';
  40. position: absolute;
  41. top: 0;
  42. left: 0;
  43. width: 18px;
  44. height: 18px;
  45. z-index: 0;
  46. border: 2px solid #008080;
  47. border-radius: 1px;
  48. margin-top: -10px;
  49. transition: .2s;
  50. margin: -10px 20px 0 0;
  51. margin-left: -5px;
  52. }*/
  53. #showZoreCheckBox + label::before,#showZoreCheckBox:not(.filled-in) + label::after {
  54. top: -10px;
  55. left: -5px;
  56. width: 18px;
  57. height: 18px;
  58. }
  59. #showZoreCheckBox:checked + label::before {
  60. top: -10px;
  61. left: -8px;
  62. width: 11px;
  63. height: 15px;
  64. border-top: 2px solid transparent;
  65. border-left: 2px solid transparent;
  66. border-right: 2px solid #26a69a;
  67. border-bottom: 2px solid #26a69a;
  68. transform: rotate(40deg);
  69. -webkit-backface-visibility: hidden;
  70. backface-visibility: hidden;
  71. -webkit-transform-origin: 100% 100%;
  72. transform-origin: 100% 100%;
  73. }
  74. </style>
  75. }
  76. <div class="table-box mr-4 iwb-bootstrap-table">
  77. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  78. <table id="table"
  79. data-url="/api/services/app/CurrentFinshedStoreHouse/GetViewAll"
  80. data-striped="true" data-id-field="id" data-unique-id="id"
  81. data-method="post"
  82. data-side-pagination="server"
  83. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  84. data-cache="false"
  85. data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
  86. data-query-params="QueryParams"
  87. data-response-handler="ResponseHandler"
  88. data-click-to-select="true"
  89. data-single-select="true">
  90. <thead>
  91. <tr class="row" id="header">
  92. <th data-field="state" data-checkbox="true"></th>
  93. <th data-align="center" data-field="productionOrderNo">批次号</th>
  94. <th data-align="center" data-field="productNo">成品编号</th>
  95. <th data-align="center" data-field="quantity">当前库存数量(千件)</th>
  96. <th data-align="center" data-field="freezeQuantity">被冻结数量</th>
  97. <th data-align="center" data-field="actualQuantity" data-formatter="ActualQuantityFormatte">可用数量</th>
  98. <th data-align="center" data-field="storeHouseId" data-formatter="StoreHouseIdFormatte">仓库</th>
  99. @*<th data-align="center" data-field="storeLocationNo" data-formatter="StoreLocationFormatte">库位</th>*@
  100. <th data-align="center" data-field="storeLocationNo">库位</th>
  101. <th data-align="center" data-field="locationRemark">库位说明</th>
  102. <th data-align="center" data-field="productName">产品名称</th>
  103. <th data-align="center" data-field="surfaceColor">表色</th>
  104. <th data-align="center" data-field="model">规格</th>
  105. <th data-align="center" data-field="rigidity">硬度</th>
  106. <th data-align="center" data-field="material">材质</th>
  107. <th data-align="center" data-field="productDesc">成品备注</th>
  108. <th data-align="center" data-field="timeCreated" data-formatter="TimeCreateFormatter">创建时间</th>
  109. @*<th data-align="center" data-field="applyStatus" data-formatter="ApplyStatusFormatter">状态</th>*@
  110. <th data-align="center" data-formatter="ActionFormatter"></th>
  111. </tr>
  112. </thead>
  113. </table>
  114. </div>
  115. @section modal{
  116. <section>
  117. <!--Main Modal-->
  118. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  119. <div class="modal-dialog modal-dialog-centered" role="document">
  120. <div class="modal-content">
  121. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("零库存入库操作", ""))
  122. @{
  123. var inputs = new List<InputViewModel>
  124. {
  125. new InputViewModel("quantity", hide:true),
  126. new InputViewModel("freezeQuantity", hide:true),
  127. new InputViewModel("currentProductStoreHouseNo", hide:true),
  128. new InputViewModel("storeHouseId", hide:true),
  129. new InputViewModel("productionOrderNo", displayName: "流转单号"),
  130. new InputViewModel("productNo", displayName: "成品编码").SetSearchIcon("query_Product_modal"),
  131. };
  132. //var specials = new List<SpecialInputModel>();
  133. }
  134. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  135. @Html.Partial("Modals/_ModalFooter", "0")
  136. </div>
  137. </div>
  138. </div>
  139. <div class="modal fade" id="addEnterModal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  140. <div class="modal-dialog modal-dialog-centered" role="document">
  141. <div class="modal-content">
  142. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("入库平衡", ""))
  143. @{
  144. var inputs3 = new List<InputViewModel>
  145. {
  146. //new InputViewModel("freezeQuantity", hide:true),
  147. //new InputViewModel("currentProductStoreHouseNo", hide:true),
  148. new InputViewModel("storeHouseId", hide:true),
  149. new InputViewModel("productionOrderNo", displayName: "流转单号"),
  150. new InputViewModel("productNo", displayName: "成品编码").SetSearchIcon("query_Product_modal","addEnterModal"),
  151. //new InputViewModel("quantity", displayName:"入库数量",@class:"number",other:"min=0.001"),
  152. new InputViewModel("packageSpecification", displayName:"包装规格(千件/包)",@class:"number",other:"min=0.001"),
  153. new InputViewModel("packageCount", displayName:"包数",@class:"number",other:"min=0.001"),
  154. new InputViewModel("storeLocationNo", hide:true)
  155. //new InputViewModel("storeLocationNo", displayName:"库位").SetSearchIcon("query_storeHouseLocation_modal","addEnterModal"),
  156. };
  157. //var specials = new List<SpecialInputModel>();
  158. }
  159. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs3))
  160. @Html.Partial("Modals/_ModalFooter", "0")
  161. </div>
  162. </div>
  163. </div>
  164. <div class="modal fade" id="addOutModal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  165. <div class="modal-dialog modal-dialog-centered" role="document">
  166. <div class="modal-content">
  167. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("出库平衡", ""))
  168. @{
  169. var inputs4 = new List<InputViewModel>
  170. {
  171. //new InputViewModel("freezeQuantity", hide:true),
  172. new InputViewModel("currentProductStoreHouseNo", hide:true),
  173. new InputViewModel("storeHouseId", hide:true),
  174. new InputViewModel("productionOrderNo", displayName: "流转单号"),
  175. new InputViewModel("productNo", displayName: "成品编码"),
  176. new InputViewModel("quantity", displayName:"出库数量",@class:"number",other:"min=0.001"),
  177. };
  178. //var specials = new List<SpecialInputModel>();
  179. }
  180. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs4))
  181. @Html.Partial("Modals/_ModalFooter", "0")
  182. </div>
  183. </div>
  184. </div>
  185. <div class="modal fade" id="updateLocationModal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  186. <div class="modal-dialog modal-dialog-centered" role="document">
  187. <div class="modal-content">
  188. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("变更库位", ""))
  189. @{
  190. var inputs5 = new List<InputViewModel>
  191. {
  192. //new InputViewModel("freezeQuantity", hide:true),
  193. new InputViewModel("id", hide:true),
  194. new InputViewModel("storeHouseId",InputTypes.List, displayName:"仓库").SetSelectOptions(storeHouses),
  195. new InputViewModel("storeLocationNo", displayName:"库位编号").SetSearchIcon("query_storeHouseLocation_modal","#updateLocationModal"),
  196. new InputViewModel("changeQuantity", displayName:"变更数量",@class:"number",other:"min=0.001")
  197. };
  198. //var specials = new List<SpecialInputModel>();
  199. }
  200. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs5))
  201. @Html.Partial("Modals/_ModalFooter", "0")
  202. </div>
  203. </div>
  204. </div>
  205. </section>
  206. <section>
  207. <!--Main Modal-->
  208. <div class="modal fade" id="package-modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  209. <div class="modal-dialog modal-dialog-centered" role="document">
  210. <div class="modal-content">
  211. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("申请包装", ""))
  212. @{
  213. var inputs2 = new List<InputViewModel>
  214. {
  215. new InputViewModel("id", hide:true),
  216. new InputViewModel("packType", hide:true),
  217. new InputViewModel("currentProductStoreHouseNo", hide:true),
  218. new InputViewModel("productNo", hide:true),
  219. new InputViewModel("productionOrderNo",displayName:"流转单编号").SetDisabled(),
  220. new InputViewModel("surfaceColor", displayName: "表色"),
  221. new InputViewModel("model", displayName: "规格"),
  222. new InputViewModel("rigidity", displayName: "硬度"),
  223. new InputViewModel("material", displayName: "材质"),
  224. //new InputViewModel("kgWeight", displayName: "千件重"),
  225. new InputViewModel("quantity", displayName:"包装数量",@class:"number",other:"min=0.001"),
  226. new InputViewModel("remark",InputTypes.Textarea, "备注").SetNotRequired(),
  227. };
  228. //var specials = new List<SpecialInputModel>();
  229. }
  230. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs2))
  231. @Html.Partial("Modals/_ModalFooter", "0")
  232. </div>
  233. </div>
  234. </div>
  235. </section>
  236. <section>
  237. <!--Main Modal-->
  238. <div class="modal fade" id="disCustomer-modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  239. <div class="modal-dialog modal-dialog-centered" role="document">
  240. <div class="modal-content">
  241. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("降级客户", ""))
  242. <table class="table table-striped disCustomer">
  243. <tbody>
  244. <tr>
  245. <th style="width: 150px">批次号</th>
  246. <th style="width: 150px">客户编号</th>
  247. <th style="width: 150px">客户名称</th>
  248. </tr>
  249. </tbody>
  250. </table>
  251. @Html.Partial("Modals/_ModalFooter", "1")
  252. </div>
  253. </div>
  254. </div>
  255. </section>
  256. <section>
  257. <!--Main Modal-->
  258. <div class="modal fade" id="replating-modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  259. <div class="modal-dialog modal-dialog-centered" role="document">
  260. <div class="modal-content">
  261. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("改镀出库申请", ""))
  262. @{
  263. var inputs14 = new List<InputViewModel>
  264. {
  265. //new InputViewModel("freezeQuantity", hide:true),
  266. new InputViewModel("currentProductStoreHouseNo", hide:true),
  267. new InputViewModel("storeHouseId", hide:true),
  268. new InputViewModel("productionOrderNo", displayName: "流转单号"),
  269. new InputViewModel("productNo", displayName: "成品编码"),
  270. new InputViewModel("quantity", displayName:"出库数量",@class:"number",other:"min=0.001"),
  271. };
  272. //var specials = new List<SpecialInputModel>();
  273. }
  274. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs14))
  275. @Html.Partial("Modals/_ModalFooter", "0")
  276. </div>
  277. </div>
  278. </div>
  279. </section>
  280. @Html.Partial("Modals/Query/_Product", "KeyWords-9|productNo")
  281. @Html.Partial("Modals/Query/_StoreHouseLocation", "storeLocationNo")
  282. }
  283. @section scripts
  284. {
  285. @*<script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  286. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>*@
  287. <script type="text/javascript">
  288. var datePickerOpt = {
  289. language: 'zh-CN',
  290. format: "yyyy-mm-dd",
  291. todayBtn: true,
  292. autoclose: true,
  293. startView: 2,
  294. minView: 2,
  295. maxView: 4,
  296. //showSecond: true,
  297. //showHours: true,
  298. //minuteStep: 10
  299. };
  300. $(function() {
  301. $("#tableTool").css("min-height", "40px");
  302. //$("#KeyWords-7").datetimepicker(datePickerOpt);
  303. //$("#KeyWords-8").datetimepicker(datePickerOpt);
  304. LoadTable();
  305. funs["btnPackage"] = function(url) {
  306. var rows = config.table.bootstrapTable("getSelections");
  307. if (rows.length === 1) {
  308. var data = rows[0];
  309. data.quantity = rows[0].actualQuantity;
  310. data.packType = 2;
  311. BtnUpdate({
  312. table: config.table,
  313. url: url,
  314. modal: $('#package-modal'),
  315. disabled: "productionOrderNo,model,surfaceColor,rigidity,material,kgWeight",
  316. data: data,
  317. success: function(res) {
  318. $('#package-modal').modal("hide");
  319. RefreshTable(config.table);
  320. DownLoadFilePath(res);
  321. }
  322. });
  323. } else {
  324. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  325. }
  326. }
  327. funs["btnAddVirtualStore"] = function(url) {
  328. SaveAjax({
  329. url: window.appUrl + "CurrentFinshedStoreHouse/GetVirtualProOrderNo",
  330. isAlert: false,
  331. isValidate: false,
  332. success: function(res) {
  333. OpenModal(url,
  334. {
  335. data: {
  336. quantity: 0,
  337. freezeQuantity: 0,
  338. currentProductStoreHouseNo: guid(),
  339. storeHouseId: 1
  340. },
  341. readonly: "productionOrderNo"
  342. });
  343. $("#productionOrderNo").val(res);
  344. }
  345. });
  346. }
  347. funs["btnUpdateStoreLocation"] = function (url) {
  348. var rows = config.table.bootstrapTable("getSelections");
  349. if (rows.length === 1) {
  350. var data = rows[0];
  351. queryParams.storeHouseId = data.storeHouseId;
  352. $("#updateLocationModal #storeHouseId").off('change.22');
  353. OpenModal(url, { url: url, data: data, disabled:"storeLocationNo", modal: $("#updateLocationModal") });
  354. $("#updateLocationModal #storeHouseId").on('change.22', function () {
  355. queryParams.storeHouseId = $(this).val();
  356. $("#updateLocationModal #storeLocationNo").val('');
  357. });
  358. } else {
  359. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  360. }
  361. }
  362. funs["btnExportExcel"] = function(url) {
  363. BtnExportExcel(url);
  364. }
  365. funs["btnAddEnter"] = function(url) {
  366. BtnAddEnter();
  367. }
  368. funs["btnRePlating"] = function(url) {
  369. BtnRePlating(url);
  370. }
  371. $("#Tool1").append(
  372. '<div class="tool-rc-group">'+
  373. '<div class="tool-radio"><input name="radioType" type="radio" id="radioType1" checked value=""/><label for="radioType1">全部</label></div>' +
  374. '<div class="tool-radio"><input name="radioType" type="radio" id="radioType2" value="1"/><label for="radioType2">降级</label></div>'+
  375. '<div class="tool-radio"><input name="radioType" type="radio" id="radioType3" value="2"/><label for="radioType3">非降级</label></div></div>' +
  376. '<div class="tool-rc-group">'+
  377. '<div class="tool-radio" style="padding:5px;" ><input name="showZoreCheckBox" type="checkbox" id="showZoreCheckBox" value=""/><label for="showZoreCheckBox" style="color:white;padding-left: 15px; font-size: 1.5rem;">显示0库存</label></div>' +
  378. '</div>');
  379. $(".tool-radio input[type='radio'],.tool-radio input[type='checkbox']").on('click', function () {
  380. document.getElementById("SearchForm").reset();
  381. GetSearchList();
  382. RefreshTable();
  383. });
  384. });
  385. function BtnRePlating(url) {
  386. var rows = config.table.bootstrapTable("getSelections");
  387. if (rows.length === 1) {
  388. var data = rows[0];
  389. data.quantity = rows[0].actualQuantity;
  390. OpenModal(url,
  391. {
  392. modal:$('#replating-modal'),
  393. data: data,
  394. readonly: "productionOrderNo,productNo",
  395. success: function() { $("#replating-modal").modal("hide"); }
  396. });
  397. }else {
  398. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  399. }
  400. }
  401. function BtnAddEnter(productionOrderNo,
  402. productNo,
  403. quantity,
  404. packageSpecification,
  405. packageCount,
  406. storeLocationNo) {
  407. if (productionOrderNo&&(!storeLocationNo || storeLocationNo === 'null')){
  408. abp.message.warn('请补全库位信息!');
  409. return;
  410. }
  411. OpenModal(window.appUrl + "CurrentFinshedStoreHouse/AddEnter",
  412. {
  413. data: { quantity: 0, storeHouseId: 1 },
  414. readonly: "productionOrderNo,productNo,storeLocationNo",
  415. modal: $("#addEnterModal"),
  416. success: function() { $("#addEnterModal").modal("hide"); }
  417. });
  418. if (!productionOrderNo) {
  419. SaveAjax({
  420. url: window.appUrl + "CurrentFinshedStoreHouse/GetVirtualBlanceProOrderNo",
  421. isAlert: false,
  422. isValidate: false,
  423. success: function(res) {
  424. $("#addEnterModal #productionOrderNo").val(res);
  425. }
  426. });
  427. $("#addEnterModal").find("#productNo").siblings(".input-group-addon").css("display", "table-cell");
  428. } else {
  429. $("#addEnterModal #productionOrderNo").val(productionOrderNo);
  430. $("#addEnterModal").find("#productNo").siblings(".input-group-addon").css("display", "none");
  431. }
  432. $("#addEnterModal #productNo").val(productNo);
  433. $("#addEnterModal #quantity").val(quantity);
  434. $("#addEnterModal #packageSpecification").val("");
  435. $("#addEnterModal #packageCount").val("");
  436. if (!storeLocationNo) {
  437. storeLocationNo = '';
  438. }
  439. $("#addEnterModal #storeLocationNo").val(storeLocationNo);
  440. }
  441. function BtnAddOut(currentProductStoreHouseNo, productionOrderNo, productNo, quantity, storeLocationNo) {
  442. if (!storeLocationNo || storeLocationNo === 'null'){
  443. abp.message.warn('请补全库位信息!');
  444. return;
  445. }
  446. OpenModal(window.appUrl + "CurrentFinshedStoreHouse/AddOut",
  447. {
  448. data: {
  449. quantity: quantity,
  450. storeHouseId: 1,
  451. currentProductStoreHouseNo: currentProductStoreHouseNo,
  452. productionOrderNo: productionOrderNo,
  453. productNo: productNo
  454. },
  455. readonly: "productionOrderNo,productNo",
  456. modal: $("#addOutModal"),
  457. success: function() { $("#addOutModal").modal("hide"); }
  458. });
  459. }
  460. function BtnExportExcel(url) {
  461. GetSearchList();
  462. console.log(_searchList);
  463. abp.ajax({
  464. url: url,
  465. async: true,
  466. data: JSON.stringify(_searchList),
  467. type: "Post",
  468. contentType: 'application/json',
  469. isValidate: false,
  470. dataType: "json",
  471. success: function(res) {
  472. window.location.href = "/" + res;
  473. }
  474. });
  475. }
  476. function StoreHouseIdFormatte(v, r) {
  477. if (v === 1) {
  478. return '<span class="label label-primary">成品仓库</span>';
  479. } else if (v === 2) {
  480. return '<span class="label label-info">半成品仓库</span>';
  481. }
  482. return v;
  483. }
  484. function TimeCreateFormatter(v, r,i,f) {
  485. var value = DateDiff(v);
  486. v = DateFormatter(v, r, i, f);
  487. if (value > 180) {
  488. return '<span style="color:red">'+v+'</span>';
  489. } else if (value > 90) {
  490. return '<span style="color:#f39c12">'+v+'</span>';
  491. } else if (value > 30) {
  492. return '<span class="text-success">'+v+'</span>';
  493. }
  494. return '<span class="text-default">'+v+'</span>';
  495. }
  496. function ActualQuantityFormatte(v, r) {
  497. var str = '<span class="label label-warning">' + v + '</span>';
  498. if (v > 0) {
  499. str = '<span class="label label-info">' + v + '</span>';
  500. } else if (v < 0) {
  501. str = '<span class="label label-danger">' + v + '</span>';
  502. }
  503. return str;
  504. }
  505. function ShowNotDisCustomer(orderNo) {
  506. var $tbody = $(".table.table-striped.disCustomer > tbody");
  507. $tbody.find("tr:not(:first)").remove();
  508. SaveAjax({
  509. url: window.appUrl + "Common/GetDisCustomerInfo",
  510. data: { id: orderNo },
  511. isAlert: false,
  512. isValidate: false,
  513. success: function(res) {
  514. if (res && res.length > 0) {
  515. res.forEach(function(r) {
  516. var sTr = '<tr>';
  517. sTr += '<td class="currentProductStoreHouseNo" >' +
  518. r.productionOrderNo +
  519. '</td>';
  520. sTr += '<td class="customerId">' + r.customerId + '</td>';
  521. sTr += '<td class="customerName">' + r.customerName + '</td>';
  522. sTr += '</tr>';
  523. $tbody.append(sTr);
  524. });
  525. }
  526. $("#disCustomer-modal").modal('show');
  527. }
  528. });
  529. }
  530. function ActionFormatter(v, r) {
  531. var str = '';
  532. if (abp.auth.isGranted('@AddEnterAuth')) {
  533. str = '<span class="table-action" onclick="BtnAddEnter(\'' +
  534. r.productionOrderNo +
  535. '\',\'' +
  536. r.productNo +
  537. '\',\'' +
  538. r.quantity +
  539. '\',\'' +
  540. r.packageSpecification +
  541. '\',\'' +
  542. r.packageCount +
  543. '\',\'' +
  544. r.storeLocationNo +
  545. '\')"><i class="iconfont icon-right"></i>入库平衡</span>';
  546. }
  547. if (abp.auth.isGranted('@AddOutAuth')) {
  548. str += '<span class="table-action" onclick="BtnAddOut(\'' +
  549. r.currentProductStoreHouseNo +
  550. '\',\'' +
  551. r.productionOrderNo +
  552. '\',\'' +
  553. r.productNo +
  554. '\',\'' +
  555. r.quantity +
  556. '\',\'' +
  557. r.storeLocationNo +
  558. '\')"><i class="iconfont icon-right"></i>出库平衡</span>';
  559. }
  560. str += '<span class="table-action" onclick="ShowNotDisCustomer(\'' +
  561. r.productionOrderNo +
  562. '\')"><i class="iconfont icon-right"></i>降级的客户</span>';
  563. return str;
  564. }
  565. function StoreLocationFormatte(v, r) {
  566. var str = '';
  567. if (v == null || v === '' || v === 'null') {
  568. v = "----";
  569. r.storeLocationNo = '';
  570. }
  571. if (abp.auth.isGranted('@updateStoreLocation')) {
  572. str += '<span class="table-action" onclick="BtnUpdateStoreLocation(\'' +
  573. r.id +
  574. '\',\'' +
  575. v +
  576. '\')">' +
  577. v +
  578. '</span>';
  579. } else {
  580. str = v;
  581. }
  582. return str;
  583. }
  584. function BtnUpdateStoreLocation(id, storeLocationNo) {
  585. if (storeLocationNo === '----') {
  586. storeLocationNo = '';
  587. }
  588. OpenModal(window.appUrl + "CurrentFinshedStoreHouse/UpdateStoreLocation",
  589. {
  590. data: { id: id, storeLocationNo: storeLocationNo },
  591. readonly: "storeLocationNo",
  592. modal: $("#updateLocationModal"),
  593. success: function() {
  594. $("#updateLocationModal").modal("hide");
  595. RefreshTable(config.table);
  596. }
  597. });
  598. }
  599. function GetSearchList() {
  600. var count = $("#SearchForm").find(".KeyWords").length;
  601. window._searchList = [];
  602. var radioType = $('input[name="radioType"]:checked').val();
  603. if (radioType) {
  604. window._searchList.push({ KeyWords: radioType, KeyField: "isUseDowngrade", FieldType: "1", ExpType: "0" });
  605. }
  606. var isShowZoreCheckBox = $("#showZoreCheckBox").is(':checked')?"1":"0";
  607. window._searchList.push({ KeyWords: isShowZoreCheckBox, KeyField: "showZoreCheckBox", FieldType: "0", ExpType: "0" });
  608. for (var i = 1; i <= count; i++) {
  609. var keyWords = $("#KeyWords-" + i).val();
  610. if (keyWords) {
  611. var keyField = $("#KeyField-" + i).val();
  612. var fieldType = $("#FieldType-" + i).val();
  613. var expType = $("#ExpType-" + i).val();
  614. if (keyField === 'timeCreated' && expType === "5") {
  615. var endDate = new Date(keyWords);
  616. keyWords = new Date(endDate.getTime() + 24 * 60 * 60 * 1000).Format("yyyy-MM-dd");
  617. }
  618. _searchList.push({
  619. KeyWords: keyWords,
  620. KeyField: keyField,
  621. FieldType: fieldType,
  622. ExpType: expType
  623. });
  624. }
  625. }
  626. }
  627. </script>
  628. @*<script>
  629. function DownLoadFile(filepath) {
  630. var downLoadId = "downLoad";
  631. var nameStart = filepath.lastIndexOf("\/");
  632. var downName = filepath.substr(nameStart + 1, filepath.length);
  633. $(document.body).append('<a id="' + downLoadId + '" download="' + downName + '" href="' + filepath + '" ><span></span></a>');
  634. $("#" + downLoadId + " span").click();
  635. $("#" + downLoadId).remove();
  636. }
  637. </script>*@
  638. }