OrderMg.cshtml 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179
  1. @using System.Web.UI.HtmlControls
  2. @using Abp.Authorization
  3. @using IwbZero.Session
  4. @using ShwasherSys
  5. @using ShwasherSys.Authorization.Permissions
  6. @using ShwasherSys.BasicInfo
  7. @using ShwasherSys.Models.Layout
  8. @using ShwasherSys.Models.Modal
  9. @using ShwasherSys.Views.Shared.New.Table
  10. @{
  11. /**/
  12. ViewBag.ActiveMenu = PermissionNames.PagesOrderInfoOrderMg; //The menu item will be active for this page.
  13. ViewBag.Title = "订单维护";
  14. bool isCanViewPrice = IsGranted(PermissionNames.PagesOrderInfoOrderMgQueryOrderPrice);
  15. List<SelectListItem> OrderStatusList = ViewBag.OrderStatus;
  16. List<SelectListItem> OrderItemStatusList = ViewBag.OrderItemStatus;
  17. List<Currency> loCurrencies = ViewBag.FromCurrenyId;
  18. List<CurrencyExchangeRate> loToCNYCurrenyRate = ViewBag.ToCNYCurreny;
  19. List<SelectListItem> emergencyLevelList = ViewBag.EmergencyLevel;
  20. List<SelectListItem> productionOrderStatus = ViewBag.ProductionOrderStatus;
  21. string strCurrencies = "";
  22. if (loCurrencies != null)
  23. {
  24. foreach (var loCurrency in loCurrencies)
  25. {
  26. if (loCurrency.Id == "CNY")
  27. {
  28. strCurrencies += "<option value=\"" + loCurrency.Id + "\" selected=\"selected\">" + loCurrency.CurrencyName + "</option>";
  29. }
  30. else
  31. {
  32. strCurrencies += "<option value=\"" + loCurrency.Id + "\">" + loCurrency.CurrencyName + "</option>";
  33. }
  34. }
  35. }
  36. List<SelectListItem> OrderSaleTypeList = ViewBag.OrderSaleType;
  37. var searchForm = new SearchFormViewModal(new List<SearchItem>()
  38. {
  39. new SearchItem("id", "流水号"),
  40. new SearchItem("orderDate", "订单日期",FiledType.D,ExpType.Greater),
  41. new SearchItem("orderDate", "到",FiledType.D,ExpType.LessOrEqual),
  42. new SearchItem("customerId", "客户编号").SetSearchIcon("query_customer_modal"),
  43. new SearchItem("stockNo", "客户订单号"),
  44. new SearchItem("orderStatusId", "状态",FiledType.I,ExpType.Equal).SetSearchItem(OrderStatusList),
  45. new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("query_employee_modal","SearchForm") ,
  46. }, false);
  47. }
  48. @section css{
  49. <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
  50. <link href="~/Views/OrderInfo/css/OrderMg.css" rel="stylesheet" />
  51. <style>
  52. .store-query > strong {
  53. width: 70px;
  54. text-align: right;
  55. }
  56. #storeQuantity, #orderQuantity {
  57. padding: 0 5px;
  58. color: red;
  59. }
  60. .store_box {
  61. position: absolute;
  62. z-index: 10001;
  63. width: 400px;
  64. background: rgba(209,220,249,.9);
  65. display: none;
  66. font-size: 1rem;
  67. padding: 5px;
  68. font-family: "iconfont" !important;
  69. }
  70. .store_box:before {
  71. content: "\e616";
  72. position: absolute;
  73. top: -12px;
  74. left: 3px;
  75. color: rgba(209, 220, 249, .9);
  76. }
  77. .store_box .close {
  78. position: absolute;
  79. width: 20px;
  80. height: 20px;
  81. right: -8px;
  82. top: -8px;
  83. color: #000;
  84. border-radius: 50%;
  85. border: 2px solid #000;
  86. display: flex;
  87. justify-content: center;
  88. align-items: center;
  89. }
  90. .tool-rc-group {
  91. border: 0px solid #ba63d3;
  92. float: left;
  93. margin: 0 5px;
  94. padding-right: 5px;
  95. border-radius: 5px;
  96. }
  97. </style>
  98. }
  99. <div class="table-box mr-4 iwb-bootstrap-table">
  100. @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
  101. <table id="table"
  102. data-url="/api/services/app/OrderHeaders/GetAll"
  103. data-striped="true" data-id-field="id" data-unique-id="id"
  104. data-method="post"
  105. data-side-pagination="server"
  106. data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  107. data-cache="false"
  108. 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"
  109. data-query-params="QueryParams"
  110. data-response-handler="ResponseHandler"
  111. data-click-to-select="true"
  112. data-single-select="true"
  113. data-show-jumpto="true">
  114. <thead>
  115. <tr class="row" id="header">
  116. <th data-field="state" data-checkbox="true"></th>
  117. <th data-align="center" data-field="id">流水号</th>
  118. <th data-align="center" data-field="orderStatusName">订单状态</th>
  119. <th data-align="center" data-field="isLock" data-formatter="IsLockFormatter">是否删除</th>
  120. <th data-align="center" data-field="customerId">客户编号</th>
  121. <th data-align="center" data-field="orderDate" data-formatter="DateFormatter">订单日期</th>
  122. <th data-align="center" data-field="linkName">联系人</th>
  123. <th data-align="center" data-field="telephone">电话</th>
  124. <th data-align="center" data-field="saleManName">业务员</th>
  125. <th data-align="center" data-field="saleTypeName">外销/内销</th>
  126. @*<th data-align="center" data-formatter="ActionsFormatter"></th>*@
  127. </tr>
  128. </thead>
  129. </table>
  130. </div>
  131. <div class="table-box mr-4 iwb-bootstrap-table" id="orderItemInfo" style="display: none;">
  132. <div class="btn-toolbar row" role="toolbar" aria-label="Toolbar with button groups">
  133. <div class="col-sm-12 col-lg-12 pull-left" style="padding: 0">
  134. <div class="btn-group btn-group-sm" id="Tool1" role="group" aria-label="First group">
  135. @if (PermissionChecker.IsGranted(PermissionNames.PagesOrderInfoOrderMgCreateOrderItem))
  136. {
  137. <button type="button" class="btn btn-default btnOrderTool" data-type="_btnCreate" data-url="/api/services/app/OrderItems/Create" onclick="CreateItem()">
  138. <i class="iconfont icon-add">添加订单明细</i>
  139. </button>
  140. }
  141. @if (PermissionChecker.IsGranted(PermissionNames.PagesOrderInfoOrderMgUpdateOrderItem))
  142. {
  143. <button type="button" class="btn btn-default btnOrderTool" data-type="btnUpdate" data-url="/api/services/app/OrderItems/Update" onclick="UpdateItem()">
  144. <i class="iconfont icon-edit">修改订单明细</i>
  145. </button>
  146. }
  147. @if (PermissionChecker.IsGranted(PermissionNames.PagesOrderInfoOrderMgDeleteOrderItem))
  148. {
  149. <button type="button" class="btn btn-default btnOrderTool" data-type="btnDelete" data-url="/api/services/app/OrderItems/Delete" onclick="DeleteItem()">
  150. <i class="iconfont icon-delete">删除订单明细</i>
  151. </button>
  152. }
  153. </div>
  154. </div>
  155. </div>
  156. <table id="tableOrderItem"
  157. data-url="/api/services/app/OrderItems/GetAll"
  158. data-id-field="id" data-unique-id="id"
  159. data-striped="true" data-click-to-select="true" data-single-select="true"
  160. data-method="post" data-side-pagination="server" data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
  161. data-cache="false" data-pagination="true" data-page-size="10" data-page-number="1" data-page-list="[10,30,50,100]"
  162. data-pagination-h-align="left" data-pagination-detail-h-align="right"
  163. data-query-params="QueryItemParams" data-response-handler="ResponseHandler" data-show-jumpto="true">
  164. <thead>
  165. <tr class="row">
  166. <th data-field="state" data-checkbox="true"></th>
  167. <th data-align="center" data-field="id">明细流水号</th>
  168. <th data-align="center" data-field="productNo">产品编号</th>
  169. <th data-align="center" data-field="emergencyLevel" data-formatter="EmergencyLevelFormatter">紧急程度</th>
  170. <th data-align="center" data-field="isLock" data-formatter="IsLockFormatter">是否删除</th>
  171. <th data-align="center" data-field="quantity">数量</th>
  172. @if (isCanViewPrice)
  173. {
  174. <th data-align="center" data-field="price">含税价格</th>
  175. <th data-align="center" data-field="afterTaxPrice">不含税价格</th>
  176. <th data-align="center" data-field="currencyId">货币</th>
  177. <th data-align="center" data-field="logisticsFee">运费</th>
  178. <th data-align="center" data-field="moldFee">模具费</th>
  179. @*<th data-align="center" data-field="currencyPrice">货币价格(含税)</th>*@
  180. }
  181. <th data-align="center" data-field="sendDate" data-formatter="DateFormatter">送货时间</th>
  182. </tr>
  183. </thead>
  184. </table>
  185. </div>
  186. @section modal{
  187. <section>
  188. <!--Main Modal-->
  189. <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  190. <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
  191. <div class="modal-content">
  192. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("订单"))
  193. @{
  194. var inputs = new List<InputViewModel>
  195. {
  196. new InputViewModel("customerId",hide:true),
  197. new InputViewModel("saleMan",hide:true),
  198. new InputViewModel("saleManId",hide:true),
  199. new InputViewModel("id",displayName:"流水号"),
  200. new InputViewModel("stockNo",displayName:"客户订单号"),
  201. new InputViewModel("orderStatusId",InputTypes.List, displayName:"订单状态").SetSelectOptions(OrderStatusList),
  202. new InputViewModel("orderDate", displayName:"订单日期").SetNotRequired(),
  203. new InputViewModel("customerName",displayName:"客户名称").SetSearchIcon("query_customer_modal","modal"),
  204. new InputViewModel("saleType",InputTypes.List, displayName: "外销/内销").SetSelectOptions(OrderSaleTypeList),
  205. new InputViewModel("customerSendId",InputTypes.List, displayName: "送货地址名称").SetEvents("onchange=ChangeCustomerSend()"),
  206. new InputViewModel("linkName", displayName: "联系人"),
  207. new InputViewModel("fax", displayName: "传真").SetNotRequired(),
  208. new InputViewModel("telephone", displayName: "电话").SetNotRequired(),
  209. new InputViewModel("sendAdress",displayName:"送货地址"),
  210. new InputViewModel("saleManName",displayName:"销售人员").SetSearchIcon("query_employee_modal")
  211. };
  212. //var specials = new List<SpecialInputModel>();
  213. }
  214. @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
  215. @Html.Partial("Modals/_ModalFooter", "0")
  216. </div>
  217. </div>
  218. </div>
  219. </section>
  220. <section>
  221. @*@Html.Hidden("isForSearch", "0");*@
  222. @Html.Partial("Modals/Query/_Customer", "customerId|KeyWords-4")
  223. @Html.Partial("Modals/Query/_Employee", "saleMan|KeyWords-7,saleManName|KeyWords-saleManName-7,saleManId")
  224. </section>
  225. <section>
  226. <!--Main Modal-->
  227. <div class="modal fade" id="modal_OrderItemEdit" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
  228. <div class="modal-dialog modal-dialog-centered" role="document">
  229. <div class="modal-content" style="width: 680px;">
  230. @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("订单明细"))
  231. <div class="modal-body container-fluid" style="padding: 0; padding-top: 15px;">
  232. <form class="pr-3 pl-3 form-horizontal" style="padding: 0 10px" id="formItem">
  233. <input type="hidden" name="id" />
  234. <input type="hidden" id="orderNo" name="orderNo" />
  235. <input type="hidden" id="orderItemStatusId" name="orderItemStatusId" />
  236. <input type="hidden" id="orderUnitId" name="orderUnitId" />
  237. <div class="form-group-sm row">
  238. <label class="iwb-label col-md-2 control-label iwb-label-required" for="productNo">产品编号</label>
  239. <div class="col-md-5">
  240. <div class="input-group">
  241. <select class="form-control" Required id="productNo" name="productNo" placeholder="请输入..." value="" style="width: 100%;" type="text" onchange="RefreshProductInfo()">
  242. @*@Html.Raw(ViewBag.CustomerDefaultProducts)*@
  243. </select>
  244. <div class="input-group-addon" onclick="ShowModal('query_Product_modal');">
  245. <i class="iconfont icon-search"></i>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="col-md-1" style="padding: 0 0">
  250. <button type="button" class="btn btn-info btn-flat" style="height: 30px; width: 40px;" onclick="showSelectProductDialog()"><i class="iconfont icon-search"></i></button>
  251. </div>
  252. <div class="col-md-4" style="padding: 0 5px;margin-top: -6px;">
  253. <span class="store-query"> <strong>库存量:</strong><span id="storeQuantity">0</span><span>千件</span></span>
  254. <br>
  255. <span class="store-query"><strong>被定量:</strong><span id="orderQuantity">0</span><span>千件</span></span>
  256. <br>
  257. </div>
  258. </div>
  259. <div class="form-group-sm row">
  260. <label class="iwb-label col-md-2 control-label" for="sendDate">送货时间</label>
  261. <div class="col-md-4">
  262. <input class="form-control" id="sendDate" name="sendDate" placeholder="请输入..." value="" style="" type="text">
  263. </div>
  264. <label class="iwb-label col-md-2 control-label" for="IsStandard">标准件</label>
  265. <div class="col-md-4">
  266. <input class="form-control" style="width: 100%" id="IsStandard" disabled="disabled" name="IsStandard" placeholder="请输入..." value="" type="text">
  267. </div>
  268. </div>
  269. <div class="form-group-sm row">
  270. <label class="iwb-label col-md-2 control-label iwb-label-required" for="price">货币类型</label>
  271. <div class="col-md-4">
  272. <select class="form-control" style="width: 100%" id="currencyId" name="currencyId" placeholder="请输入..." value="" onchange="RefreshCurrency()" type="text">
  273. @Html.Raw(@strCurrencies);
  274. </select>
  275. </div>
  276. <label class="iwb-label col-md-2 control-label iwb-label-required" for="toCnyRate">当前汇率</label>
  277. <div class="col-md-4">
  278. <input class="form-control required number" Required style="width: 100%" id="toCnyRate" name="toCnyRate" placeholder="请输入..." min="0" value="" type="text">
  279. </div>
  280. </div>
  281. <div class="form-group-sm row">
  282. <label class="iwb-label col-md-2 control-label iwb-label-required" for="price">含税价格</label>
  283. <div class="col-md-4">
  284. <input class="form-control required number" Required style="width: 100%" id="price" name="price" placeholder="请输入..." value="" min="0" type="text">
  285. </div>
  286. <label class="iwb-label col-md-2 control-label iwb-label-required" for="quantity">数量</label>
  287. <div class="col-md-4">
  288. <input class="form-control required number" Required style="width: 100%" id="quantity" name="quantity" placeholder="请输入..." min="0" value="" type="text">
  289. </div>
  290. </div>
  291. <div class="form-group-sm row" id="noTaxDiv">
  292. <label class="iwb-label col-md-2 control-label iwb-label-required" for="price">不含税价格</label>
  293. <div class="col-md-4">
  294. <input class="form-control required number" Required style="width: 100%" id="afterTaxPrice" name="afterTaxPrice" placeholder="请输入..." value="" min="0" type="text">
  295. </div>
  296. <div class="col-md-4" style="padding: 6px 25px;">
  297. <span class="store-query"> <strong>当前税率:</strong><span id="currentTaxRate">@ViewBag.TagRate</span><span>%</span></span>
  298. <br>
  299. </div>
  300. </div>
  301. <div class="form-group-sm row">
  302. <label class="iwb-label col-md-2 control-label" for="logisticsFee">运费(含税)</label>
  303. <div class="col-md-4">
  304. <input class="form-control number" id="logisticsFee" name="logisticsFee" placeholder="请输入..." value="0" min="0" style="" type="number">
  305. </div>
  306. <label class="iwb-label col-md-2 control-label " for="moldFee">模具费(含税)</label>
  307. <div class="col-md-4">
  308. <input class="form-control number" id="moldFee" name="moldFee" placeholder="请输入..." value="0" style="" min="0" type="number">
  309. </div>
  310. </div>
  311. <div class="form-group-sm row">
  312. <label class="iwb-label col-md-2 control-label" for="logisticsFee">运费(不含税)</label>
  313. <div class="col-md-4">
  314. <input class="form-control number" id="logisticsFeeAfterTax" name="logisticsFeeAfterTax" placeholder="请输入..." value="0" min="0" style="" type="number">
  315. </div>
  316. <label class="iwb-label col-md-2 control-label " for="moldFee">模具费(不含税)</label>
  317. <div class="col-md-4">
  318. <input class="form-control number" id="moldFeeAfterTax" name="moldFeeAfterTax" placeholder="请输入..." value="0" style="" min="0" type="number">
  319. </div>
  320. </div>
  321. <div class="form-group-sm row">
  322. <label class="iwb-label col-md-2 control-label" for="isReport">检验报告</label>
  323. <div class="col-md-4">
  324. <select class="form-control" style="width: 100%" id="isReport" name="isReport" placeholder="请输入..." value="" style="" type="text">
  325. <option value="Y" selected="selected">是</option>
  326. <option value="N">否</option>
  327. </select>
  328. </div>
  329. <label class="iwb-label col-md-2 control-label" for="isPartSend">部分送货</label>
  330. <div class="col-md-4">
  331. <select class="form-control" style="width: 100%" id="isPartSend" name="isPartSend" placeholder="请输入..." value="" style="" type="text">
  332. <option value="Y" selected="selected">是</option>
  333. <option value="N">否</option>
  334. </select>
  335. </div>
  336. </div>
  337. <div class="form-group-sm row">
  338. <label class="iwb-label col-md-2 control-label" for="Material">材质</label>
  339. <div class="col-md-4">
  340. <input class="form-control" id="Material" name="Material" placeholder="请输入..." value="" style="" type="text">
  341. </div>
  342. <label class="iwb-label col-md-2 control-label" for="Model">规格</label>
  343. <div class="col-md-4">
  344. <input class="form-control" id="Model" name="Model" placeholder="请输入..." value="" style="" type="text">
  345. </div>
  346. </div>
  347. <div class="form-group-sm row">
  348. <label class="iwb-label col-md-2 control-label" for="SurfaceColor">表色</label>
  349. <div class="col-md-4">
  350. <input class="form-control" id="SurfaceColor" name="surfaceColor" placeholder="请输入..." value="" style="" type="text">
  351. </div>
  352. <label class="iwb-label col-md-2 control-label" for="Rigidity">硬度</label>
  353. <div class="col-md-4">
  354. <input class="form-control" id="Rigidity" name="Rigidity" placeholder="请输入..." value="" style="" type="text">
  355. </div>
  356. </div>
  357. <div class="form-group-sm row">
  358. <label class="iwb-label col-md-2 control-label" for="ProductName">产品名称</label>
  359. <div class="col-md-4">
  360. <input class="form-control" id="ProductName" name="ProductName" placeholder="请输入..." value="" style="" type="text">
  361. </div>
  362. <label class="iwb-label col-md-2 control-label" for="partNo">零件号</label>
  363. <div class="col-md-4">
  364. <div class="input-group">
  365. <input class="form-control" id="partNo" name="partNo" placeholder="请输入..." value="" style="" type="text">
  366. <div class="input-group-addon" onclick="f_QueryProductByPartNo();" title="通过零件号查询对应的产品">
  367. <i class="iconfont icon-search"></i>
  368. </div>
  369. </div>
  370. </div>
  371. </div>
  372. <div class="form-group-sm row">
  373. <label class="iwb-label col-md-2 control-label" for="wareHouse">送货仓库</label>
  374. <div class="col-md-4">
  375. <input class="form-control" id="wareHouse" name="wareHouse" placeholder="请输入..." value="" style="" type="text">
  376. </div>
  377. <label class="iwb-label col-md-2 control-label iwb-label-required" for="emergencyLevel">紧急程度</label>
  378. <div class="col-md-4">
  379. @*<input class="form-control" id="emergencyLevel" name="emergencyLevel" placeholder="请输入..." value="" style="" type="text">*@
  380. @Html.DropDownList("emergencyLevel", emergencyLevelList, htmlAttributes: new { @class = "form-control Required", placeholder = "请选择", style = "width: 100%" })
  381. </div>
  382. </div>
  383. <div class="form-group-sm row">
  384. <label class="iwb-label col-md-2 control-label " for="productHsCode">产品海关号</label>
  385. <div class="col-md-4">
  386. <input class="form-control" id="productHsCode" name="productHsCode" placeholder="请输入..." value="" style="" type="text"/>
  387. </div>
  388. <label class="iwb-label col-md-2 control-label " for="mHsCode">材料海关号</label>
  389. <div class="col-md-4">
  390. <input class="form-control" id="mHsCode" name="mHsCode" disabled="disabled" placeholder="请输入..." value="" style="" type="text"/>
  391. </div>
  392. </div>
  393. <div class="form-group-sm row">
  394. <label class="iwb-label col-md-2 control-label" for="wareHouse">客户标准名称</label>
  395. <div class="col-md-4">
  396. <input class="form-control" id="standardName" name="standardName" placeholder="请输入..." value="" style="" type="text">
  397. </div>
  398. <label class="iwb-label col-md-2 control-label " for="orderItemDesc">描述</label>
  399. <div class="col-md-4">
  400. <input class="form-control" id="orderItemDesc" name="orderItemDesc" placeholder="请输入..." value="" style="" type="text">
  401. </div>
  402. </div>
  403. </form>
  404. </div>
  405. @Html.Partial("Modals/_ModalFooter", "0")
  406. </div>
  407. </div>
  408. </div>
  409. @Html.Partial("Modals/Query/_Product01", "productNo")
  410. @Html.Partial("_searchInfoByProductNo")
  411. </section>
  412. <div class="store_box">
  413. <div class="close" onclick="f_closeStore_box(this)"><i class="iconfont icon-close"></i></div>
  414. <table class="table table-striped">
  415. <tbody>
  416. <tr>
  417. <th style="width: 150px">批次号</th>
  418. <th style="width: 150px">库位</th>
  419. <th style="width: 150px">库存(千件)</th>
  420. <th style="width: 150px">可用数量(千件)</th>
  421. </tr>
  422. </tbody>
  423. </table>
  424. </div>
  425. }
  426. @section scripts
  427. {
  428. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
  429. <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  430. @*<script src="~/Views/OrderInfo/js/OrderMg.js"></script>*@
  431. <script type="text/javascript">
  432. //cId cStockNo cOrderStatusId cCustomerId cStartDate cEndDate
  433. var loToCNYCurrenyRate = [];
  434. var datePickerOpt = {
  435. language: 'zh-CN',
  436. format: "yyyy-mm-dd",
  437. todayBtn: true,
  438. autoclose: true,
  439. startView: 2,
  440. minView: 2,
  441. maxView: 4
  442. //showSecond: true,
  443. //showHours: true,
  444. //minuteStep: 10
  445. };
  446. var itemTable = $("#tableOrderItem");
  447. $(function() {
  448. @{
  449. // List<CurrencyExchangeRate> loToCNYCurrenyRate
  450. foreach (var currency in loToCNYCurrenyRate ?? new List<CurrencyExchangeRate>())
  451. {
  452. <text>
  453. loToCNYCurrenyRate.push({
  454. FromCurrencyId: "@currency.FromCurrencyId",
  455. ExchangeRate: "@currency.ExchangeRate"
  456. });
  457. </text>
  458. }
  459. }
  460. //show完毕前执行
  461. //$("#orderDate").datetimepicker(datePickerOpt).on('show', function (event) {
  462. // event.preventDefault();
  463. // event.stopPropagation();
  464. //}).on('hide',
  465. // function (event) {
  466. // event.preventDefault();
  467. // event.stopPropagation();
  468. // });
  469. $("#sendDate").datetimepicker(datePickerOpt).on('show',
  470. function(event) {
  471. event.preventDefault();
  472. event.stopPropagation();
  473. }).on('hide',
  474. function(event) {
  475. event.preventDefault();
  476. event.stopPropagation();
  477. });
  478. $("#KeyWords-2").datetimepicker(datePickerOpt);
  479. $("#KeyWords-3").datetimepicker(datePickerOpt);
  480. LoadTable({
  481. onCheck: ShowOrderItem,
  482. onUncheck: UnShowOrderItem,
  483. onLoadSuccess: OnLoadSuccessOrder,
  484. });
  485. //LoadQueryCustomerTable();
  486. var funs = window.funs || { none: function() { console.log("No type"); } };
  487. funs["btnUpdate"] = function() {
  488. BtnUpdate({ readonly: "standardName,saleManName", disabled: "saleType" });
  489. };
  490. funs["btnCreate"] = function() {
  491. abp.ajax({
  492. url: window.appUrl + 'OrderHeaders/GetNewOrderNo',
  493. async: true,
  494. type: "Post",
  495. contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
  496. isValidate: false,
  497. dataType: "json",
  498. success: function(res) {
  499. BtnCreate({
  500. readonly: "id,sendAdress,customerName,saleManName,orderDate ",
  501. disabled: "orderStatusId,saleType",
  502. data: { orderStatusId: "2", id: res, orderDate: GetNowFormatDate() }
  503. });
  504. //$("#OrderStatusId").val("2").select2();
  505. }
  506. });
  507. }
  508. funs["btnDelete"] = function(url) {
  509. var rows = $("#table").bootstrapTable("getSelections");
  510. if (rows.length === 1) {
  511. //if (rows[0].orderStatusId === 2) {
  512. // abp.message.confirm(abp.localization.localize("DeleteConfirmMsg"),
  513. // abp.localization.localize("DeleteConfirmTitle"),
  514. // function() {
  515. // SaveAjax({ url: url, data: { Id: rows[0].id }, isValidate: false, table: $("#table") });
  516. // });
  517. //} else {
  518. // abp.message.warn("非新建的订单不可删除!");
  519. //}
  520. abp.message.confirm(abp.localization.localize("DeleteConfirmMsg"),
  521. abp.localization.localize("DeleteConfirmTitle"),
  522. function() {
  523. SaveAjax({ url: url, data: { Id: rows[0].id }, isValidate: false, table: $("#table") });
  524. });
  525. } else
  526. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  527. }
  528. funs["btnShow"] = function(url) {
  529. BtnShow(url);
  530. }
  531. //$("#currencyPrice").off("blur").on("blur",
  532. // function() {
  533. // RefreshCurrency();
  534. // });
  535. $("#price").off("blur").on("blur",
  536. function() {
  537. //var p = $(this).val();
  538. //var rate = $("#currentTaxRate").text();
  539. //SaveAjax({
  540. // url: window.appUrl + `Query/CalcTaxPrice?type=${1}&input=${p}&rate=${rate}`,
  541. // isValidate: false,
  542. // isAlert: false,
  543. // async: false,
  544. // success: function(res) {
  545. // $("#afterTaxPrice").val(res);
  546. // }
  547. //});
  548. tranTax(1, $("#price"), $("#afterTaxPrice"));
  549. });
  550. $("#afterTaxPrice").off("blur").on("blur",
  551. function() {
  552. //var p = $(this).val();
  553. //var rate = $("#currentTaxRate").text();
  554. ////var r = (Number(p) * (1 + Number(rate) / 100)).toFixed(3);
  555. ////$("#price").val(r);
  556. //SaveAjax({
  557. // url: window.appUrl + `Query/CalcTaxPrice?type=${2}&input=${p}&rate=${rate}`,
  558. // isValidate: false,
  559. // isAlert: false,
  560. // async: false,
  561. // success: function(res) {
  562. // $("#price").val(res);
  563. // }
  564. //});
  565. tranTax(2, $("#afterTaxPrice"), $("#price"));
  566. });
  567. $("#logisticsFee").off("blur").on("blur",
  568. function() {
  569. tranTax(1, $("#logisticsFee"), $("#logisticsFeeAfterTax"));
  570. });
  571. $("#logisticsFeeAfterTax").off("blur").on("blur",
  572. function () {
  573. tranTax(2, $("#logisticsFeeAfterTax"), $("#logisticsFee"));
  574. });
  575. $("#moldFee").off("blur").on("blur",
  576. function () {
  577. tranTax(1, $("#moldFee"), $("#moldFeeAfterTax"));
  578. });
  579. $("#moldFeeAfterTax").off("blur").on("blur",
  580. function () {
  581. tranTax(2, $("#moldFeeAfterTax"), $("#moldFee"));
  582. });
  583. });
  584. function tranTax(type,sourceDom,targetDom) {
  585. var p = $(sourceDom).val();
  586. var rate = $("#currentTaxRate").text();
  587. if (p && rate) {
  588. SaveAjax({
  589. url: window.appUrl + `Query/CalcTaxPrice?type=${type}&input=${p}&rate=${rate}`,
  590. isValidate: false,
  591. isAlert: false,
  592. async: false,
  593. success: function(res) {
  594. $(targetDom).val(res);
  595. }
  596. });
  597. } else {
  598. abp.message.warn('价格不能为空!');
  599. }
  600. }
  601. function RefreshCurrency() {
  602. var currency = $("#currencyId").val();
  603. if (!currency) {
  604. return;
  605. }
  606. loToCNYCurrenyRate.forEach(function(v, i) {
  607. if (currency === v.FromCurrencyId) {
  608. //var p = $("#currencyPrice").val();
  609. var rate = v.ExchangeRate;
  610. //var r = Number(p) * Number(rate);
  611. $("#toCnyRate").val(rate);
  612. }
  613. if (currency !== "CNY") {
  614. $("#noTaxDiv").hide();
  615. } else {
  616. $("#noTaxDiv").show();
  617. }
  618. });
  619. }
  620. function BtnShow(url) {
  621. var rows = config.table.bootstrapTable("getSelections");
  622. if (rows.length === 1) {
  623. window.open("@Url.Action("OrderDetail")/" + rows[0].id, "_blank");
  624. } else
  625. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  626. }
  627. function ActionsFormatter(v, r) {
  628. var str = '<span class="table-action" onclick="OrderItemDetail(\'' +
  629. r.id +
  630. '\')"><i class="iconfont icon-right"></i>订单明细</span>';
  631. return str;
  632. }
  633. function OrderItemDetail(id) {
  634. window.location.href = "OrderItemDetail/" + id;
  635. }
  636. function Submit_query_customer_modal(row) {
  637. var $modal = $("#query_customer_modal");
  638. row = row || $modal.find("table").bootstrapTable("getSelections")[0];
  639. if (targetDom !== "#modal") {
  640. $("#KeyWords-4").val(row.id);
  641. $modal.modal("hide");
  642. return;
  643. }
  644. if (row) {
  645. $("#customerId").val(row.id);
  646. $("#customerName").val(row.customerName);
  647. abp.ajax({
  648. url: window.appUrl + "CustomerSends/GetCustomerSendDtoByCustomerId",
  649. async: true,
  650. type: "Post",
  651. data: { customerId: row.id },
  652. contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
  653. isValidate: false,
  654. dataType: "json",
  655. success: function(res) {
  656. if (res && res.length > 0) {
  657. $("#customerSendId").empty();
  658. var options = "";
  659. $("#saleType").val(row.saleType).select2();
  660. res.forEach(function(value, index) {
  661. console.log(value, index);
  662. if (index === 0) {
  663. options += '<option value=\"' +
  664. value.id +
  665. '\" selected=\"selected\">' +
  666. value.customerSendName +
  667. '</option>';
  668. } else {
  669. options += '<option value=\"' +
  670. value.id +
  671. '\">' +
  672. value.customerSendName +
  673. '</option>';
  674. }
  675. });
  676. $("#customerSendId").html(options);
  677. $("#customerSendId").trigger("change");
  678. }
  679. }
  680. });
  681. $modal.modal("hide");
  682. } else
  683. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  684. }
  685. function ChangeCustomerSend() {
  686. var customerSendId = $("#customerSendId").val();
  687. if (!customerSendId) {
  688. customerSendId = 0;
  689. }
  690. abp.ajax({
  691. url: window.appUrl + "Query/GetCustomerSendInfo",
  692. async: false,
  693. type: "Post",
  694. data: { Id: customerSendId },
  695. contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
  696. isValidate: false,
  697. dataType: "json",
  698. success: function(res) {
  699. if (res) {
  700. $("#linkName").val(res.linkMan);
  701. $("#fax").val(res.fax);
  702. $("#telephone").val(res.telephone);
  703. $("#sendAdress").val(res.sendAdress);
  704. }
  705. }
  706. });
  707. }
  708. function OnAllItem(eName, eData, table) {
  709. //console.log(eName, eData);
  710. var $table = config.table;
  711. if (table) {
  712. if (typeof (table) === "string") {
  713. $table = $("#" + table);
  714. } else {
  715. $table = $(table);
  716. }
  717. }
  718. $table.closest(".table-box").find("#Tool1 .btn[data-type^='btn']")
  719. .prop('disabled', $table.bootstrapTable('getSelections').length !== 1);
  720. }
  721. function OnLoadSuccessOrder(data, table) {
  722. var $table = config.table;
  723. if (table) {
  724. if (typeof (table) === "string") {
  725. $table = $("#" + table);
  726. } else {
  727. $table = $(table);
  728. }
  729. }
  730. $table.find(".bs-checkbox").find("input").addClass("filled-in").after("<label></label");
  731. _isSearching = false;
  732. abp.ui.clearBusy();
  733. setTimeout(function() {
  734. var alldata = $("#table").bootstrapTable('getData');
  735. if (alldata.length > 0) {
  736. $("#table").bootstrapTable('check', 0);
  737. } else {
  738. $("#orderItemInfo").css("display", "none");
  739. }
  740. },
  741. 500);
  742. }
  743. var checkedOrderNo = "";
  744. var orderSaleType = 1;
  745. function ShowOrderItem(row, $element) {
  746. $("#table").bootstrapTable('resetView', { height: 500 });
  747. $("#orderItemInfo").css("display", "block");
  748. checkedOrderNo = row.id;
  749. orderSaleType = row.saleType;
  750. itemTable.bootstrapTable("destroy");
  751. LoadTable({
  752. table: itemTable,
  753. queryParams: QueryItemParams,
  754. onAll: function(eName, eData) {
  755. OnAllItem(eName, eData, "tableOrderItem");
  756. },
  757. onLoadSuccess: function(data) {
  758. OnLoadSuccess(data, "tableOrderItem");
  759. },
  760. onPostBody: function(data) {
  761. OnPostBody(data, "tableOrderItem");
  762. }
  763. });
  764. /*if (row.orderStatusId !== 2) {
  765. $("#orderItemInfo .btnOrderTool").prop('disabled', true);
  766. } else {
  767. $("#orderItemInfo .btnOrderTool").prop('disabled', false);
  768. }*/
  769. itemTable.bootstrapTable('resetView');
  770. if (orderSaleType === 2) {
  771. itemTable.bootstrapTable('hideColumn', "afterTaxPrice");
  772. }
  773. initCurrentProduct();
  774. }
  775. function UnShowOrderItem(row, $element) {
  776. $("#orderItemInfo").css("display", "none");
  777. itemTable.bootstrapTable("destroy");
  778. $("#table").bootstrapTable('resetView', { height: 800 });
  779. }
  780. function QueryItemParams(params) {
  781. return {
  782. MaxResultCount: params.limit,
  783. SkipCount: params.offset,
  784. sort: params.sort,
  785. sortOrder: params.order,
  786. SearchList: [{ KeyWords: checkedOrderNo, KeyField: "OrderNo", FieldType: "0", ExpType: "0" }]
  787. };
  788. }
  789. function Submit_query_Product_modal(row) {
  790. row = row || $("#query_Product_modal").find("table").bootstrapTable("getSelections")[0];
  791. if (row) {
  792. var productNo = row.id;
  793. //RefreshProductInfo(productNo);
  794. $("#productNo").append('<option value=\"' + productNo + '\">' + productNo + '</option>');
  795. $("#productNo").val(productNo);
  796. $("#productNo").trigger("change");
  797. $("#query_Product_modal").modal("hide");
  798. } else {
  799. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  800. }
  801. }
  802. function RefreshProductInfo() {
  803. var productNo = $("#productNo").val();
  804. if (!productNo) {
  805. return;
  806. }
  807. //abp.ajax({
  808. // url: window.appUrl + 'Query/GetProductById',
  809. // data: { Id: productNo },
  810. // async: true,
  811. // type: "Post",
  812. // contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
  813. // isValidate: false,
  814. // dataType: "json",
  815. // success: function (res) {
  816. // if (res) {
  817. // $("#ProductName").val(res.productName);
  818. // $("#Model").val(res.model);
  819. // $("#Material").val(res.material);
  820. // $("#SurfaceColor").val(res.surfaceColor);
  821. // $("#Rigidity").val(res.rigidity);
  822. // $("#IsStandard").val(res.isStandard === "Y" ? "是" : "否");
  823. // }
  824. // }
  825. //});
  826. SaveAjax({
  827. url: window.appUrl + 'Common/GetNewProductInfo?productNo=' + productNo,
  828. isValidate: false,
  829. isAlert: false,
  830. async: false,
  831. success: function(res) {
  832. if (res) {
  833. let pNo = res.id;
  834. let reg = new RegExp(/^s.{13}/g);
  835. if (productNo !== pNo && reg.test(pNo)) {
  836. $("#productNo").append('<option value=\"' + pNo + '\">' + pNo + '</option>');
  837. abp.message.warn(`此产品已被弃用,系统自动更换新产品!`);
  838. }
  839. $("#productNo").val(pNo);
  840. $('#select2-productNo-container').prop('title', pNo);
  841. $('#select2-productNo-container').html(pNo);
  842. $("#ProductName").val(res.productName);
  843. $("#Model").val(res.model);
  844. $("#Material").val(res.material);
  845. $("#SurfaceColor").val(res.surfaceColor);
  846. $("#Rigidity").val(res.rigidity);
  847. $("#mHsCode").val(res.materialHsCode);
  848. $("#IsStandard").val(res.isStandard === "Y" ? "是" : "否");
  849. RefreshDefaultPartNo(res.partNo);
  850. }
  851. }
  852. });
  853. RefreshCurrentStore();
  854. // RefreshDefaultPartNo();
  855. }
  856. function RefreshDefaultPartNo(partNo) {
  857. var productNo = $("#productNo").val();
  858. $("#partNo").val(partNo);
  859. SaveAjax({
  860. url: window.appUrl +
  861. "OrderItems/GetDefaultPartNoByOrderNo?orderNo=" +
  862. checkedOrderNo +
  863. "&productNo=" +
  864. productNo,
  865. isValidate: false,
  866. isAlert: false,
  867. dataType: "json",
  868. success: function(res) {
  869. //console.log(res);
  870. if (res) {
  871. $("#partNo").val(res.partNo || "");
  872. $("#productHsCode").val(res.productHsCode || "");//新增的客户产品海关编码
  873. }
  874. }
  875. });
  876. }
  877. function RefreshCurrentStore() {
  878. var productNo = $("#productNo").val();
  879. if (!productNo) {
  880. return;
  881. }
  882. SaveAjax({
  883. url: window.appUrl + "OrderItems/QueryCurrentProductNum",
  884. data: { Id: productNo },
  885. isAlert: false,
  886. isValidate: false,
  887. success: function(res) {
  888. if (res) {
  889. $("#storeQuantity").text(res.canUserQuantity ? Number(res.canUserQuantity) : 0);
  890. $("#orderQuantity").text(res.bookedQuantity ? Number(res.bookedQuantity) : 0);
  891. }
  892. }
  893. });
  894. }
  895. function initCurrentProduct() {
  896. SaveAjax({
  897. url: window.appUrl + "Query/GetDefualtProductByOrderNo?orderNo=" + checkedOrderNo,
  898. isValidate: false,
  899. isAlert: false,
  900. dataType: "json",
  901. success: function(res) {
  902. //console.log(res);
  903. if (res) {
  904. $("#productNo").html(res);
  905. }
  906. }
  907. });
  908. }
  909. function f_QueryProductByPartNo() {
  910. let partNo = $("#partNo").val();
  911. if (partNo) {
  912. SaveAjax({
  913. url: window.appUrl + `Query/GetDefaultProductByPartNo?partNo=${partNo}&orderNo=${checkedOrderNo}`,
  914. isValidate: false,
  915. isAlert: false,
  916. dataType: "json",
  917. success: function(res) {
  918. //console.log(res);
  919. if (res) {
  920. $("#productNo").val(res).select2();
  921. RefreshProductInfo();
  922. }
  923. }
  924. });
  925. }
  926. }
  927. function CreateItem() {
  928. var firstProductNo = $("#productNo").find("option").first().attr("value");
  929. //console.log('firstProductNo' + firstProductNo);
  930. var currencyId = "CNY";
  931. if (orderSaleType === 2) {
  932. currencyId = "USD";
  933. }
  934. BtnCreate({
  935. modal: $("#modal_OrderItemEdit"),
  936. url: "/api/services/app/OrderItems/Create",
  937. readonly: "IsStandard,ProductName,SurfaceColor,Rigidity,Material,Model,mHsCode",
  938. data: {
  939. orderNo: checkedOrderNo,
  940. productNo: firstProductNo,
  941. orderUnitId: "4",
  942. currencyId: currencyId,
  943. emergencyLevel: '@OrderItemEmergencyLevel.Normal',
  944. logisticsFee: "0",
  945. moldFee: "0",
  946. logisticsFeeAfterTax: "0",
  947. moldFeeAfterTax: "0"
  948. },
  949. disabled: "",
  950. table: itemTable
  951. });
  952. $("#isReport").val("Y").select2();
  953. $("#isPartSend").val("Y").select2();
  954. }
  955. function UpdateItem() {
  956. var rows = itemTable.bootstrapTable("getSelections");
  957. console.error('---------------------------------------');
  958. if (rows.length === 1) {
  959. console.table(rows[0]);
  960. var defaultOption = {
  961. modal: $("#modal_OrderItemEdit"),
  962. modalContent: "",
  963. modaltitle: window.opUpdate,
  964. data: rows[0],
  965. savebtn: null,
  966. form: null,
  967. disabled:
  968. "IsStandard,ProductName,SurfaceColor,Rigidity,Material,Model,SendDate,currencyId,toCnyRate,price,afterTaxPrice,quantity,mHsCode",
  969. url: "/api/services/app/OrderItems/Update",
  970. select2: true,
  971. select2tree: false,
  972. save: null,
  973. table: itemTable
  974. };
  975. OpenModal(defaultOption);
  976. $("#productNo").trigger("change");
  977. } else {
  978. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  979. }
  980. }
  981. function DeleteItem() {
  982. var rows = itemTable.bootstrapTable("getSelections");
  983. if (rows.length === 1) {
  984. abp.message.confirm(abp.localization.localize("DeleteConfirmMsg"),
  985. abp.localization.localize("DeleteConfirmTitle"),
  986. function() {
  987. /*SaveAjax({ url: "/api/services/app/OrderItems/Delete", data: { Id: rows[0].id }, isValidate: false});*/
  988. abp.services.app.orderItems.delete({ Id: rows[0].id },
  989. {
  990. async: false,
  991. timeout: 30000
  992. }).done(function() {
  993. RefreshTable("tableOrderItem");
  994. });
  995. });
  996. } else
  997. abp.message.warn(abp.localization.localize("ChooseOneToOp"));
  998. }
  999. function DateFormatter(v, r) {
  1000. var sendDate = new Date(v);
  1001. return '<span style="text-decoration:underline;" >' + sendDate.Format('yyyy-MM-dd') + '</span>';
  1002. }
  1003. function EmergencyLevelFormatter(v, r) {
  1004. var name = $('#hid-emergencyLevel option[value="' + v + '"]').text();
  1005. if (v === '1') {
  1006. return '<span class="label label-success">' + name + '</span>';
  1007. } else {
  1008. return '<span class="label label-danger">' + name + '</span>';
  1009. }
  1010. }
  1011. function IsLockFormatter(v, r) {
  1012. if (v === 'Y') {
  1013. return '<span class="label label-danger">已删除</span>';
  1014. } else {
  1015. return '<span class="label label-success">-</span>';
  1016. }
  1017. }
  1018. function ProductNameFormatter(v, r) {
  1019. return `<span class="label label-default">${v}<a href="#" onclick="f_ShowStoreInfo('${r.id}',this)">(库存)</a></span>`;
  1020. }
  1021. function f_ShowStoreInfo(pno,dom) {
  1022. var $tbody = $(".store_box .table.table-striped > tbody");
  1023. $tbody.find("tr:not(:first)").remove();
  1024. var formatterShowStore = function (res) {
  1025. $(".store_box ").show();
  1026. $(".store_box").off('mouseleave').on('mouseleave',
  1027. function(e) {
  1028. $(".store_box ").hide(1000);
  1029. });
  1030. $(".store_box ").offset({
  1031. left: $(dom).offset().left,
  1032. top: $(dom).offset().top+25
  1033. });
  1034. res.forEach(function(r) {
  1035. var sTr = '<tr>';
  1036. sTr += '<td class="productionOrderNo">' + r.productionOrderNo + '</td>';
  1037. sTr += '<td class="storeLocationNo">' + r.storeLocationNo + '</td>';
  1038. sTr += '<td >' + r.quantity + '</td>';
  1039. var isCanUser = formatNum(Number(r.quantity), Number(r.freezeQuantity), 3);
  1040. sTr += '<td>' + isCanUser + '</td>';
  1041. sTr += '</tr>';
  1042. $tbody.append(sTr);
  1043. });
  1044. }
  1045. SaveAjax({
  1046. url: window.appUrl + `Common/GetProductStoreInfoByProductNo?productNo=${pno}`,
  1047. isValidate: false,
  1048. isAlert: false,
  1049. dataType: "json",
  1050. success: function (res) {
  1051. //console.log(res);
  1052. if (res && res.length > 0) {
  1053. formatterShowStore(res);
  1054. } else {
  1055. $(".store_box ").hide();
  1056. abp.message.warn("未查询到库存或库存为空!");
  1057. }
  1058. }
  1059. });
  1060. }
  1061. function f_closeStore_box(dom) {
  1062. $(".store_box ").hide();
  1063. }
  1064. var formatNum = function(f1, f2, digit) {
  1065. //var m = Math.pow(10, digit);
  1066. //return parseInt(f1*m-f2*m, 10) / m;
  1067. var z = f1 - f2;
  1068. return z.toFixed(digit);
  1069. }
  1070. function CanUserQuantityFormatte(v, r) {
  1071. var count = r.actualQuantity - r.freezeQuantity;
  1072. var str = '<span class="label label-warning">' + count + '</span>';
  1073. if (count > 0) {
  1074. str = '<span class="label label-info">' + count + '</span>';
  1075. } else if (count < 0) {
  1076. str = '<span class="label label-danger">' + count + '</span>';
  1077. }
  1078. return str;
  1079. }
  1080. </script>
  1081. }
  1082. <section style="display: none">
  1083. <select id="hid-type">
  1084. <option value=""></option>
  1085. </select>
  1086. @Html.DropDownList("hid-emergencyLevel", emergencyLevelList);
  1087. @Html.DropDownList("hide-ProductionOrderStatus", productionOrderStatus)
  1088. </section>