| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682 |
- @using System.Net.Mime
- @using System.Web.UI.HtmlControls
- @using Abp.Authorization
- @using IwbZero.Session
- @using ShwasherSys
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Models.Modal
- @using ShwasherSys.Views.Shared.New.Table
- @{
- /**/
- ViewBag.ActiveMenu = PermissionNames.PagesOrderInfoOrderStatusMg; //The menu item will be active for this page.
- ViewBag.Title = "订单状态维护";
- List<SelectListItem> OrderStatusList = ViewBag.OrderStatus;
- List<SelectListItem> OrderItemStatusList = ViewBag.OrderItemStatus;
- List<SelectListItem> emergencyLevelList = ViewBag.EmergencyLevel;
- Boolean isCanChangeOrderItemStatus = IsGranted(PermissionNames.PagesOrderInfoOrderStatusMgChangeStatus);
- Boolean isCanViewPrice = IsGranted(PermissionNames.PagesOrderInfoOrderStatusMgQueryOrderPrice);
- string startDate = DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd");
- string endDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
- List<SelectListItem> OrderSaleTypeList = ViewBag.OrderSaleType;
-
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("id", "流水号"),
- new SearchItem("orderDate", "订单日期",FiledType.D,ExpType.GreaterOrEqual,value:startDate),
- new SearchItem("orderDate", "到",FiledType.D,ExpType.LessOrEqual,value:endDate),
- new SearchItem("customerId", "客户编号").SetSearchIcon("query_customer_modal"),
- new SearchItem("stockNo", "客户订单号"),
- new SearchItem("orderStatusId", "状态",FiledType.I,ExpType.Equal).SetSearchItem(OrderStatusList),
- new SearchItem("saleMan", "业务员",showField:"saleManName").SetSearchIcon("query_employee_modal","SearchForm") ,
- new SearchItem("saleType", "销售类型",FiledType.Inull,ExpType.Equal).SetSearchItem(OrderSaleTypeList),
- }, false);
-
- }
- @section css{
- <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
- <link href="~/Content/Plugins/bootstrap-table-fixd-columns/bootstrap-table-fixed-columns.css" rel="stylesheet" />
- <link href="~/Views/OrderInfo/css/OrderStatusMg.css" rel="stylesheet" />
- <style>
- .form-panel {
- margin-bottom: 5px;
- }
- .form-panel-header {
- padding: 3px 10px;
- }
- .query-label {
- margin-bottom: 1px;
- }
- .query-form-control {
- padding: 1px 12px;
- height: 25px;
- }
- .query-form-group {
- margin-bottom: 5px;
- }
- .item-tool-col {
- padding: 10px;
- color: azure
- }
- .sendQuantity {
- }
- .box {
- border: 2px solid #938f9a;
- border-radius: 10px;
- padding: 0px 0px;
- }
- .box .box-header {
- height: 50px;
- background: #938f9a;
- }
- .form-input-send {
- height: 30px;
- }
- </style>
- }
- <style>
- label.error {
- bottom: 12px;
- right: 15px;
- }
- [type="radio"]:not(:checked) + label, [type="radio"]:checked + label {
- padding-left: 25px;
- font-size: 1.5rem;
- color: #dad9db;
- }
- [type="radio"]:not(:checked) + label::before, [type="radio"]:not(:checked) + label::after {
- border: 2px solid rgb(0,155,244) !important;
- }
- .MapperItem {
- border: 1px solid rebeccapurple;
- border-radius: 4px;
- padding: 3px 10px;
- margin-top: 3px;
- }
- .MapperItem:after, .MapperItem:before {
- display: table;
- content: " ";
- }
- .MapperItem:after {
- clear: both;
- }
- .accordion-toggle {
- font-size: 1.5rem;
- color: #000080;
- cursor: pointer;
- }
- .accordion-toggle > i, .guide > i {
- display: inline-block;
- color: #ffffff;
- transition: all 1s ease;
- }
- .accordion-toggle .down-direction {
- transform: rotate(-90deg);
- }
- .down-direction2 {
- transform: rotate(180deg);
- }
- </style>
- <div class="table-box mr-4 iwb-bootstrap-table">
- @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
- <table id="table"
- data-url="/api/services/app/OrderHeaders/GetAll"
- data-striped="true" data-id-field="id" data-unique-id="id"
- data-method="post"
- data-side-pagination="server"
- data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
- data-cache="false"
- 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"
- data-query-params="QueryParams"
- data-response-handler="ResponseHandler"
- data-click-to-select="true"
- data-single-select="true"
- data-show-jumpto="true">
- <thead>
- <tr class="row" id="header">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="id">流水号</th>
- <th data-align="center" data-field="orderStatusId" data-formatter="OrderStatusFormatter">订单状态</th>
- <th data-align="center" data-field="isLock" data-formatter="IsLockFormatter">是否删除</th>
- <th data-align="center" data-field="customerId">客户编号</th>
- <th data-align="center" data-field="stockNo">客户订单号</th>
- <th data-align="center" data-field="orderDate" data-formatter="DateFormatter">订单日期</th>
- <th data-align="center" data-field="linkName">联系人</th>
- <th data-align="center" data-field="telephone">电话</th>
- <th data-align="center" data-field="saleManName">订单业务员</th>
- <th data-align="center" data-field="saleTypeName">外销/内销</th>
- <th data-align="center" data-field="timeCreated">创建日期</th>
- @*
- <th data-align="center" data-formatter="ActionsFormatter"></th>
- *@
- </tr>
- </thead>
- </table>
- </div>
- <div class="table-box mr-4 iwb-bootstrap-table" id="orderItemDiv" style="display: none;">
- <div class="btn-toolbar row" role="toolbar" aria-label="Toolbar with button groups">
- <div class="col-sm-2 col-lg-2 item-tool-col">
- <span style=""><strong>流水号:</strong></span><span id="orderHeaderNo"></span>
- </div>
- <div class="col-sm-2 col-lg-2 item-tool-col">
- <span><strong>客户订单号:</strong></span><span id="stockNo"></span>
- </div>
- <div class="col-sm-2 col-lg-2 item-tool-col">
- <button class="btn btn-info" style="height: 20px; padding: 0px 12px; margin-right: 3px;border-radius: 50px;" id="BtnChangeOrderItemStoreCompleteStatus" onclick="f_ChangeOrderItemStoreCompleteStatus()"><i class="iconfont icon-edit"></i>修改货物配齐状态</button>
- @if (isCanChangeOrderItemStatus)
- {
- <button class="btn btn-info" style="height: 20px; padding: 0px 12px; border-radius: 50px;" id="BtnChangeOrderItemStatus" onclick="f_ChangeOrderItemStatus()"><i class="iconfont icon-edit"></i>修改订单明细状态</button>
- }
- </div>
- <div class="col-sm-3 col-lg-3 item-tool-col">
- @if (IsGranted(PermissionNames.PagesOrderInfoOrderStatusMgAuditItem))
- {
- <button class="btn btn-warning" style="height: 20px; padding: 0px 12px; border-radius: 50px;" id="BtnAuditNewOrderItems" onclick="f_AuditNewOrderItems()"><i class="iconfont icon-shenhe"></i>审核全部新建订单</button>
- }
- </div>
- <div class="col-sm-3 col-lg-3 item-tool-col">
- <span><strong>当前订单是否已全部完成发货:</strong></span><span id="isAllSend" style="color: red">未完成</span>
- </div>
- </div>
- <table id="tableOrderItem"
- data-striped="true" data-id-field="id" data-unique-id="id"
- data-method="post"
- data-side-pagination="server"
- data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
- data-cache="false"
- data-pagination="false" 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"
- data-click-to-select="true"
- data-single-select="false" data-show-footer="true">
- <thead>
- <tr class="row">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="orderStatusName" data-formatter="OrderItemStatusFormatter" data-footer-formatter="合计:">当前状态</th>
- <th data-align="center" data-field="id">明细流水号</th>
- <th data-align="center" data-field="productNo">产品编号</th>
- <th data-align="center" data-field="partNo">零件号</th>
- <th data-align="center" data-field="standardName">标准名称</th>
- <th data-align="center" data-field="model">规格</th>
- <th data-align="center" data-field="material">材质</th>
- <th data-align="center" data-field="productName">型号</th>
- <th data-align="center" data-field="surfaceColor">表色</th>
- <th data-align="center" data-field="rigidity">硬度</th>
- <th data-align="center" data-field="emergencyLevel" data-formatter="EmergencyLevelFormatter">紧急程度</th>
- <th data-align="center" data-field="storeCompleteState" data-formatter="StoreCompleteStateFormatter">是否库齐</th>
- @if (isCanViewPrice)
- {
- @*<th data-align="center" data-field="currencyId">货币</th>*@
- @*<th data-align="center" data-field="currencyPrice" data-formatter="CurrencyPriceFormatter">货币价格(含税)</th>*@
- <th data-align="center" data-field="price" data-formatter="PriceFormatter">含税价格</th>
- <th data-align="center" data-field="afterTaxPrice" data-formatter="TaxPriceFormatter">不含税价格</th>
- <th data-align="center" data-field="logisticsFee">运费</th>
- <th data-align="center" data-field="moldFee">模具费</th>
- }
- <th data-align="center" data-field="quantity" data-formatter="QuantityFormatter">总数</th>
- <th data-align="center" data-field="isSendQuantity">已发数</th>
- <th data-align="center" data-field="remainingQuantity">剩余数</th>
- @if (isCanViewPrice)
- {
- <th data-align="center" data-field="totalPrice" data-footer-formatter="AllTotalPriceFormatter" data-formatter="TotalPriceFormatter">含税总金额</th>
- <th data-align="center" data-field="afterTaxTotalPrice" data-footer-formatter="AllAfterTaxTotalPriceFormatter" data-formatter="TotalPriceFormatter">不含税总金额</th>
- }
- <th data-align="center" data-field="sendDate" data-formatter="SendDateFormatter">送货日期</th>
- @*<th data-align="center" data-field="isReport" data-formatter="IsReportFormatter">检验报告</th>*@
- <th data-align="center" data-field="operatorAction" data-formatter="ActionsItemFormatter"></th>
- </tr>
- </thead>
- </table>
- </div>
- @section modal{
- <section>
- <div class="modal fade" id="modalSendOrder" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 850px; ">
- <div class="modal-content">
- <div class="modal-header">
- <input type="hidden" id="totalQuantity" />
- <input type="hidden" id="isSendQuantity" />
- <input type="hidden" id="canSendQuantity" />
- <input type="hidden" id="orderItemNo_ForSend" />
- <div class="box-title" style="line-height: 25px; color: #f9f9f9;display: block;">
- @*<span id="productId"></span>*@
- @*<input type="text" name="productId" id="productId" />*@
- <label class="iwb-label col-md-2 control-label iwb-label-required" for="productId" style="padding: 3px 3px;">产品编号</label>
- <div class="col-md-4" style="margin-left: -30px;">
- <div class="input-group">
- <input class="form-control" Required id="productId" disabled="disabled" name="productId" placeholder="请输入..." value="" style="width:100%;" type="text" />
- @if (PermissionChecker.IsGranted(PermissionNames.PagesOrderInfoOrderStatusMgReplaceSendItem))
- {
- <div class="input-group-addon" onclick="ShowModal('query_Product_modal');">
- <i class="iconfont icon-search"></i>
- </div>
- }
- </div>
- </div>
-
- <div class="col-md-5">已发/总数:<span id="IsSendQuantity" style="text-decoration: underline"></span> 被定量:<span id="IsLockQuantity" style="text-decoration: underline"></span></div>
- </div>
- <div style="position: absolute; right: 5px; top: 8px">
- <button class="btn btn-info" onclick="SendOrderAction()">确认发货</button>
- <button class="btn btn-default" onclick="$('#modalSendOrder').modal('hide')">取消</button>
- </div>
- </div>
- <div class="modal-body">
- <form id="formSend">
- @*<input type="number" class="form-control number sendQuantity form-input-send" id="ffffff" name="ffffff" required min="0" />*@
- <table class="table table-striped fahuo">
- <tbody>
- <tr>
- <th style="width: 150px">批次号</th>
- <th style="width: 150px">库位</th>
- @*<th style="width: 125px">包装(每包千件数)</th>*@
- <th style="width: 150px">可用数量(千件)</th>
- <th style="width: 200px">发货数量</th>
- <th style="width: 200px">千件/每包</th>
- </tr>
- </tbody>
- </table>
- <div class=" accordion" style="padding: 0; border-top: 2px dotted #ffffff; display: none;">
- <div class="accordion-group">
- <div class="accordion-heading" style="background: #ccc; padding: 4px;">
- <label class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
- 选择本次计划发货的信息 <i class="iconfont icon-left down-direction "></i>
- </label>
- </div>
- <div id="collapseOne" class="accordion-body collapse in" style="height: 100px; ">
- <div class="accordion-inner" style="display: flex;justify-content: flex-start;flex-direction: row;">
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </section>
- <section>
- <!--Main Modal-->
- <div class="modal fade" id="modalChangePrice" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("价格变更", ""))
- @{
- var inputs = new List<InputViewModel>
- {
- new InputViewModel("orderItemNo",displayName:"订单明细编号",name:"orderItemNo").SetDisabled(),
- new InputViewModel("oldPrice",displayName:"原价格",@class:"number",other:"min=0.001").SetReadOnly(),
- new InputViewModel("newPrice", displayName:"修改的价格",@class:"number",other:"min=0.001"),
- };
- //var specials = new List<SpecialInputModel>();
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("modalChangePrice", "ChangePrice()"))
- </div>
- </div>
- </div>
- <div class="modal fade" id="modalChangeAfterTaxPrice" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("税后价格变更", ""))
- @{
- var inputs5 = new List<InputViewModel>
- {
- new InputViewModel("orderItemNo5",displayName:"订单明细编号",name:"orderItemNo").SetDisabled(),
- new InputViewModel("oldPrice2",displayName:"原税后价格",@class:"number",name:"oldPrice",other:"min=0").SetReadOnly().SetNotRequired(),
- new InputViewModel("newAfterTaxPrice", displayName:"修改的价格",@class:"number",other:"min=0"),
- };
- //var specials = new List<SpecialInputModel>();
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs5))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("modalChangeAfterTaxPrice", "ChangeAfterTaxPrice()"))
- </div>
- </div>
- </div>
- <div class="modal fade" id="modalChangeQuantity" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("数量变更", ""))
- @{
- var inputs2 = new List<InputViewModel>
- {
- new InputViewModel("orderItemNo2",displayName:"订单明细编号",name:"orderItemNo").SetDisabled(),
- new InputViewModel("oldQuantity",displayName:"原数量",@class:"number",other:"min=0.001").SetReadOnly(),
- new InputViewModel("newQuantity", displayName:"修改的数量",@class:"number",other:"min=0.001"),
- };
- //var specials = new List<SpecialInputModel>();
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs2))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("modalChangeQuantity", "ChangeQuantity()"))
- </div>
- </div>
- </div>
- <div class="modal fade" id="modalChangeSendDate" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("发货日期变更", ""))
- @{
- var inputs3 = new List<InputViewModel>
- {
- new InputViewModel("orderItemNo3",displayName:"订单明细编号",name:"orderItemNo").SetDisabled(),
- new InputViewModel("oldSendDate",displayName:"原发货日期",@class:"date").SetDisabled(),
- new InputViewModel("newSendDate", displayName:"修改日期",@class:"date"),
- };
- //var specials = new List<SpecialInputModel>();
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs3))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("modalChangeSendDate", "ChangeSendDate()"))
- </div>
- </div>
- </div>
- <div class="modal fade" id="modalChangeStatus" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("订单明细状态变更", ""))
- @{
- var inputs4 = new List<InputViewModel>
- {
- new InputViewModel("orderItemStatusId",InputTypes.List,"变更状态").SetSelectOptions(OrderItemStatusList)
- };
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs4))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("modalChangeStatus", "ChangeOrderItemStatus()"))
- </div>
- </div>
- </div>
- <div class="modal fade" id="modalCompleteStoreStatus" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("货物配齐状态变更", ""))
- @{
- var inputs6 = new List<InputViewModel>
- {
- new InputViewModel("storeCompleteStateId",InputTypes.List,"货物配齐状态").SetSelectOptions(new List<SelectListItem>(){new SelectListItem(){Text = "到齐",Value = "1"},new SelectListItem(){ Text = "未到齐", Value = "0" },new SelectListItem(){ Text = "货物已齐,待改包", Value = "2" } })
- };
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs6))
- @Html.Partial("Modals/_SwModalFooter", new ModelFooterModel("modalChangeStatus", "ChangeCompleteStoreStatus()"))
- </div>
- </div>
- </div>
- <div class="modal fade" id="showProductProcess" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width: 600px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("生产进度", ""))
- <div class="timeline-small">
- <div class="timeline-small-body">
- <ul>
- </ul>
- </div>
- </div>
- @Html.Partial("Modals/_ModalFooter", "1")
- </div>
- </div>
- </div>
- </section>
- <section>
- @Html.Partial("Modals/Query/_Customer", "KeyWords-4")
- @Html.Partial("Modals/Query/_Product", "productId")
- @Html.Partial("Modals/Query/_Employee", "saleMan|KeyWords-7,saleManName|KeyWords-saleManName-7,saleManId")
-
- </section>
- }
- @Html.Partial("_searchInfoByProductNo")
- @section scripts
- {
- <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
- <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
- <script src="~/Content/Plugins/bootstrap-table-fixd-columns/bootstrap-table-fixed-columns.js"></script>
- <script src="http://apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
- <script src="~/Views/OrderInfo/js/OrderStatusMg.js"></script>
- @*<script src="~/Views/OrderInfo/js/OrderMg.js"></script>*@
- <script type="text/javascript">
- var customerNo;
- var datePickerOpt = {
- language: 'zh-CN',
- format: "yyyy-mm-dd",
- todayBtn: true,
- autoclose: true,
- startView: 2,
- minView: 2,
- maxView: 4
- //showSecond: true,
- //showHours: true,
- //minuteStep: 10
- };
- $(function() {
- //show完毕前执行
- $("#KeyWords-2").datetimepicker(datePickerOpt).on('show',
- function(event) {
- event.preventDefault();
- event.stopPropagation();
- }).on('hide',
- function(event) {
- event.preventDefault();
- event.stopPropagation();
- });
- $("#KeyWords-3").datetimepicker(datePickerOpt).on('show',
- function(event) {
- event.preventDefault();
- event.stopPropagation();
- }).on('hide',
- function(event) {
- event.preventDefault();
- event.stopPropagation();
- });
- $("#newSendDate").datetimepicker(datePickerOpt).on('show',
- function(event) {
- event.preventDefault();
- event.stopPropagation();
- }).on('hide',
- function(event) {
- event.preventDefault();
- event.stopPropagation();
- });
- LoadTable();
- var funs = window.funs || { none: function() { console.log("No type"); } };
- $.extend(funs, { btnAudit: function(url) { BtnAudit(url); } });
- funs["btnPrint"] = function(url) {
- BtnPrint(url);
- }
- funs["btnQuery"] = function(url) {
- BtnShow(url);
- }
- //$(".sendQuantity").on('change',
- // function() {
- // var quantity = Number($(this).val());
- // var max = Number($(this).data("maxquantity"));
- // if (quantity > max) {
- // $(this).val(max);
- // }
- // });
- $(".modal-dialog").draggable();
- $(".accordion-toggle").on('click',
- function() {
- $(".accordion-toggle i").toggleClass("down-direction");
- });
- });
- function BtnPrint(url) {
- var rows = config.table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- window.open("@Url.Action("OrderPrint")/" + rows[0].id, "_blank");
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- function BtnShow(url) {
- var rows = config.table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- window.open("@Url.Action("OrderDetail")/" + rows[0].id, "_blank");
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- function OnLoadSuccess() {
- $(".bs-checkbox").find("input").addClass("filled-in").after("<label></label>");
- _isSearching = false;
- abp.ui.clearBusy();
- setTimeout(function() {
- var alldata = $("#table").bootstrapTable('getData');
- console.log(alldata);
- if (alldata.length > 0) {
- console.log(alldata);
- $("#table").bootstrapTable('check', 0);
- } else {
- $("#orderItemDiv").css("display", "none");
- }
- },
- 500);
- }
- function BtnAudit(url) {
- var rows = $("#table").bootstrapTable("getSelections");
- if (rows.length === 1) {
- abp.message.confirm("确认审核通过?",
- "订单审核",
- function() {
- if (rows[0].orderStatusId !== 2) {
- abp.message.warn("非新建的订单,无法进行审核!");
- return;
- }
- SaveAjax({
- url: url,
- dataType: "json",
- data: { id: rows[0].id },
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- $("#table").bootstrapTable("updateCellById",
- { id: rows[0].id, field: "orderStatusId", value: 3 });
- RefreshOrderItemTable(rows[0].id, rows[0].orderStatusId, rows[0].saleType);
- }
- }
- });
- });
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- function OnCheck(row, $element) {
- RefreshOrderItemTable(row.id, row.orderStatusId, row.saleType);
- $("#orderHeaderNo").html(row.id);
- $("#stockNo").html(row.stockNo);
- //$("#isAllSend")
- customerNo = row.customerId;
- console.log(customerNo);
- }
- function OnUnCheck(row, $element) {
- $("#table").bootstrapTable('resetView');
- $orderItemDiv.css("display", "none");
- customerNo = "";
- $("#table").bootstrapTable('resetView', { height: 800 });
- }
- function OrderStatusFormatter(v, r) { //danger
- if (r.orderStatusId === 2) {
- return '<span class="label label-success">新建</span>';
- } else if (r.orderStatusId === 3) {
- return '<span class="label label-danger">已审核</span>';
- } else if (r.orderStatusId === 12) {
- return '<span class="label label-primary">完成</span>';
- }
- return v;
- }
- //item
- var $tableOrderItem = $("#tableOrderItem");
- var $orderItemDiv;
- function RefreshOrderItemTable(orderNo, orderStatusId, saleType) {
- $orderItemDiv = $("#orderItemDiv");
- if (orderNo) {
- $("#table").bootstrapTable('resetView', { height: 300 });
- $orderItemDiv.css("display", "block");
- SaveAjax({
- url: window.appUrl + "OrderItems/GetOrderItemsByOrderNo?pcOrderNo=" + orderNo,
- dataType: "json",
- isAlert: false,
- isValidate: false,
- success: function(res) {
- console.log(res);
- if (res && res.orderItems.length > 0) {
- if (res.isAllSend) {
- $('#isAllSend').html("完成");
- } else {
- $('#isAllSend').html("未完成");
- }
- $tableOrderItem.bootstrapTable("destroy");
- $tableOrderItem.bootstrapTable({
- data: res.orderItems,
- onPostBody: OnPostBody,
- onAll: OnAllItem
- });
- if (orderStatusId === 2) {
- $tableOrderItem.bootstrapTable("hideColumn", "operatorAction");
- } else {
- $tableOrderItem.bootstrapTable("showColumn", "operatorAction");
- }
- if (saleType === 2) {
- $tableOrderItem.bootstrapTable("hideColumn", "afterTaxPrice");
- $tableOrderItem.bootstrapTable("hideColumn", "afterTaxTotalPrice");
- }
- $tableOrderItem.bootstrapTable('resetView');
- $(".bs-checkbox").find("input").addClass("filled-in").after("<label></label");
- $("#tableOrderItem thead th.bs-checkbox ").off("click.checkOnTable").on(
- "click.checkOnTable",
- function() {
- $(this).find("input").click();
- });
- } else {
- $orderItemDiv.css("display", "none");
- $tableOrderItem.bootstrapTable("destroy");
- $tableOrderItem.bootstrapTable({ data: "", onPostBody: OnPostBody });
- $("#table").bootstrapTable('resetView', { height: 800 });
- }
- }
- });
- } else {
- $orderItemDiv.css("display", "none");
- $tableOrderItem.bootstrapTable("destroy");
- $tableOrderItem.bootstrapTable({ data: "", onPostBody: OnPostBody });
- $("#table").bootstrapTable('resetView', { height: 800 });
- }
- }
- function OnAllItem() {
- $("#BtnChangeOrderItemStatus,#BtnChangeOrderItemStoreCompleteStatus")
- .prop('disabled', $tableOrderItem.bootstrapTable('getSelections').length < 1);
- }
- </script>
- <script>
- function Submit_query_Product_modal(row) {
- row = row || $query_Product_modal_table.bootstrapTable("getSelections")[0];
- if (row) {
- var productNo = row.id;
- $("#productId").val(productNo);
- reloadSendTable(productNo);
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- $("#query_Product_modal").modal('hide');
- }
- function reloadSendTable(productNo) {
- var $tbody = $(".table.table-striped.fahuo > tbody");
- $tbody.find("tr:not(:first)").remove();
- var customerId = $("#table").bootstrapTable("getSelections")[0].customerId;
- SaveAjax({
- url: window.appUrl + "Query/QueryStoreFilter?productNo=" + productNo + '&customerId=' + customerId,
- isAlert: false,
- isValidate: false,
- success: function(res) {
- //console.log(res);
- if (res && res.length > 0) {
- res.forEach(function(r) {
- var sTr = '<tr>';
- sTr += '<td class="currentProductStoreHouseNo" style="display:none;">' +
- r.currentProductStoreHouseNo +
- '</td>';
- sTr += '<td class="productionOrderNo">' + r.productionOrderNo + '</td>';
- sTr += '<td class="storeLocationNo">' + r.storeLocationNo + '</td>';
- var isCanUser = formatNum(Number(r.quantity), Number(r.freezeQuantity), 3);
- sTr += '<td>' + isCanUser + '</td>';
- sTr +=
- '<td style="position:relative"><input type="text" name="SendQuantity" class="form-control number sendQuantity form-input-send" min="0" max="' +
- isCanUser +
- '"/></td>';
- sTr +=
- '<td style="position:relative"><input type="text" name="AvgSendQuantity" class="form-control number avgQuantity form-input-send" min="0"/></td>';
- sTr += '</tr>';
- $tbody.append(sTr);
- });
- }
- }
- });
- SaveAjax({
- url: window.appUrl +
- "OrderItems/GetCurrentProductLock?productNo=" +
- productNo +
- '&orderNo=' +
- $("#orderHeaderNo").text(),
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- $("#IsLockQuantity").html(res.quantity);
- }
- }
- });
- //accordion-inner
- $('#modalSendOrder .accordion-inner').html('');
- SaveAjax({
- url: window.appUrl +
- "OrderItems/GetSendDateWarns?orderItemId=" +
- $("#orderItemNo_ForSend").val(),
- isAlert: false,
- isValidate: false,
- success: function(res) {
- var rendInfo = '';
- if (res && res.length > 0) {
- res.forEach(function(v, i) {
- if (v.sendState !== 1) {
- rendInfo += `<div class="tool-radio"><input name="sendDateItemCheck" type="radio" checked="${i === 0 ? 'checked' : ''}" id="sendDateItemCheck${i}" class="activeStatus" value="${v.id}" /><label for="sendDateItemCheck${i}" style="color: #000;">日期:${DateFormatter(v.planDate)}(${v.planQuantity} 千件)</label></div>`;
- }
- });
- $('#modalSendOrder .accordion-inner').append(rendInfo);
- $('#modalSendOrder .tool-radio input[type="radio"]').on('click',
- function(e) {
- var $that = $(e.target);
- $that.attr('checked', 'checked');
- });
- $("#modalSendOrder .accordion").show();
- }
- if (!rendInfo) {
- $("#modalSendOrder .accordion").hide();
- }
- }
- });
- }
- function f_SendOrderItem(id, quantity, isSendQuantity, productNo) {
- $("#productId").val(productNo);
- $("#orderItemNo_ForSend").val(id);
- if (!isSendQuantity || !(isSendQuantity > 0)) {
- isSendQuantity = 0;
- }
- $("#IsSendQuantity").html('' + isSendQuantity + '/' + quantity);
- var totalQuantity = Number(quantity);
- isSendQuantity = Number(isSendQuantity);
- var canSendQuantity = formatNum(totalQuantity, isSendQuantity, 3);
- $("#canSendQuantity").val(canSendQuantity);
- $("#isSendQuantity").val(isSendQuantity);
- $("#totalQuantity").val(totalQuantity);
- reloadSendTable(productNo);
- $("#modalSendOrder").modal("show");
- }
- function SendOrderAction() {
- var orderItemId = $("#orderItemNo_ForSend").val();
- console.log("orderItemId" + orderItemId);
- var productId = $("#productId").val();
- var $tbody = $(".table.table-striped.fahuo > tbody");
- var trDatas = $tbody.find("tr:not(:first)");
- var sendAll = 0;
- var dataParam = {
- ProductNo: productId,
- CustomerNo: customerNo,
- SendItems: [],
- Id: orderItemId,
- SendAllQuantity: 0,
- SendDateWarnId: 0
- };
- if (trDatas) {
- for (var i = 0; i < trDatas.length; i++) {
- var sendItem = {};
- var sendQuantity = $(trDatas[i]).find(".sendQuantity").val();
- if (!sendQuantity || Number(sendQuantity) <= 0) {
- continue;
- }
- sendItem.SendQuantity = Number(sendQuantity);
- var avgQuantity = $(trDatas[i]).find(".avgQuantity").val();
- if (!avgQuantity || Number(avgQuantity) <= 0) {
- avgQuantity = sendQuantity;
- }
- sendItem.AvgQuantity = Number(avgQuantity);
- var currentProductStoreHouseNo = $(trDatas[i]).find(".currentProductStoreHouseNo").text();
- if (currentProductStoreHouseNo) {
- sendItem.CurrentProductStoreHouseNo = currentProductStoreHouseNo;;
- }
- var productionOrderNo = $(trDatas[i]).find(".productionOrderNo").text();
- if (productionOrderNo) {
- sendItem.ProductBatchNum = productionOrderNo;
- } else {
- sendItem.ProductBatchNum = "00000000000";
- }
- var storeLocationNo = $(trDatas[i]).find(".storeLocationNo").text();
- if (storeLocationNo) {
- sendItem.StoreLocationNo = storeLocationNo;
- }
- dataParam.SendItems.push(sendItem);
- sendAll += Number(sendQuantity);
- }
- }
- if (sendAll <= 0) {
- abp.message.warn("发货总量需要大于0千件!");
- return;
- }
- var canSendQuantity = Number($("#canSendQuantity").val());
- dataParam.SendAllQuantity = sendAll;
- dataParam.SendDateWarnId = $('#modalSendOrder .tool-radio input[name="sendDateItemCheck"]:checked').val();
- var save = function() {
- SaveAjax({
- url: window.appUrl + "OrderItems/SendOrderAction",
- //contentType: 'application/json',
- dataType: "json",
- form: $("#formSend"),
- data: dataParam,
- isAlert: false,
- isValidate: true,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderNo);
- $("#modalSendOrder").modal("hide");
- }
- }
- });
- }
- if (sendAll > canSendQuantity) {
- var isSendQuantity = $("#isSendQuantity").val(), totalQuantity = $("#totalQuantity").val();
- var temp = formatNum(Number(sendAll) + Number(isSendQuantity),
- Number(totalQuantity) + Number(totalQuantity * 0.05),
- 3);
- if (temp > 0) {
- abp.message.warn("发货总量已超出订单发货量5%,不能继续操作!");
- return;
- }
- abp.message.confirm("发货总量已超出订单发货量,是否要继续发货?",
- "确认发货",
- function(isConfirmed) {
- if (isConfirmed) {
- save();
- }
- });
- } else {
- save();
- }
- }
- var formatNum = function(f1, f2, digit) {
- //var m = Math.pow(10, digit);
- //return parseInt(f1*m-f2*m, 10) / m;
- var z = f1 - f2;
- return z.toFixed(digit);
- }
- function DateFormatter(v, r) {
- var sendDate = new Date(v);
- return '<span style="text-decoration:underline;" >' + sendDate.Format('yyyy-MM-dd') + '</span>';
- }
- function f_AuditOrderItem(id) {
- abp.message.confirm("确认审核通过?",
- "订单明细审核",
- function() {
- SaveAjax({
- url: window.appUrl + "OrderItems/Audit",
- dataType: "json",
- data: { id: id },
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderNo);
- }
- }
- });
- });
- }
- function f_CloseOrderItem(id) {
- SaveAjax({
- url: window.appUrl + "OrderItems/End",
- dataType: "json",
- data: { id: id },
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderItem.orderNo);
- //$("#table").bootstrapTable("refresh", { silent: true });
- /*setTimeout(function() {
- $("#table").bootstrapTable("checkBy", { field: "id", value: res.orderNo });//updateCellById
- },
- 500);*/
- if (res.isAllEnd) {
- $("#table").bootstrapTable("updateCellById",
- {
- id: res.orderItem.orderNo,
- field: "orderStatusId",
- value: '<span class="label label-primary">完成</span>'
- });
- $("#table").bootstrapTable("checkBy", { field: "id", value: res.orderItem.orderNo });
- }
- }
- }
- });
- }
- function f_ChangeOrderItemStatus() {
- var rows = $tableOrderItem.bootstrapTable("getSelections");
- if (rows.length > 0) {
- if (rows[0].isLock === 'Y') {
- abp.message.warn("订单已删除,不能变更明细!");
- return;
- }
- $("#modalChangeStatus").modal("show");
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- }
- function f_ChangeOrderItemStoreCompleteStatus() {
- var rows = $tableOrderItem.bootstrapTable("getSelections");
- if (rows.length > 0) {
- if (rows[0].isLock === 'Y') {
- abp.message.warn("订单已删除,不能变更明细!");
- return;
- }
- $("#modalCompleteStoreStatus").modal("show");
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- }
- function f_AuditNewOrderItems() {
- var headRow = config.table.bootstrapTable("getSelections");
- if (headRow[0].isLock === 'Y') {
- abp.message.warn("订单已删除,不能审核明细!");
- return;
- }
- if (headRow[0].orderStatusId === 2) {
- abp.message.warn("订单未审核,不能审核明细!");
- return;
- }
- var datas = $tableOrderItem.bootstrapTable("getData");
- if (datas.length > 0) {
- var newDataId = [];
- datas.forEach(function(r) {
- if (r.orderItemStatusId === 2) {
- newDataId.push(r.id);
- }
- });
- if (newDataId.length > 0) {
- var nd = newDataId.join(',');
- abp.message.confirm("确认审核通过全部新建订单?",
- "订单明细审核",
- function() {
- SaveAjax({
- url: window.appUrl + "OrderItems/AuditAllItems",
- data: { Id: nd },
- isAlert: false,
- isValidate: false,
- success: function(res) {
- RefreshOrderItemTable(res[0].orderNo);
- }
- });
- });
- } else {
- abp.message.warn("没有可审核的订单明细!");
- }
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- }
- function ChangeOrderItemStatus() {
- var rows = $tableOrderItem.bootstrapTable("getSelections");
- if (rows.length > 0) {
- var ids = "";
- rows.forEach(function(r) {
- ids += "," + r.id;
- });
- ids = ids.substr(1);
- abp.message.confirm("确认变更选中明细的状态?",
- "订单明细状态变更",
- function() {
- SaveAjax({
- url: window.appUrl + "OrderItems/ChangeOrderItemStatusOnHeader",
- dataType: "json",
- data: { id: ids, orderItemStatusId: $("#orderItemStatusId").val() },
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderItems[0].orderNo);
- if (res.isAllEnd) {
- $("#table").bootstrapTable("updateCellById",
- {
- id: res.orderItems[0].orderNo,
- field: "orderStatusId",
- value: '<span class="label label-primary">完成</span>'
- });
- $("#table").bootstrapTable("checkBy",
- { field: "id", value: res.orderItems[0].orderNo });
- }
- $("#modalChangeStatus").modal("hide");
- }
- }
- });
- });
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- }
- function ChangeCompleteStoreStatus() {
- var rows = $tableOrderItem.bootstrapTable("getSelections");
- if (rows.length > 0) {
- var ids = "";
- rows.forEach(function(r) {
- ids += "," + r.id;
- });
- ids = ids.substr(1);
- abp.message.confirm("确认变更选中明细的到货状态?",
- "订单明细到货状态变更",
- function() {
- SaveAjax({
- url: window.appUrl + "OrderItems/ChangeOrderItemCompleteStoreStatus",
- dataType: "json",
- data: { id: ids, orderItemStoreCompleteState: $("#storeCompleteStateId").val() },
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderItems[0].orderNo);
- $("#modalCompleteStoreStatus").modal("hide");
- }
- }
- });
- });
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- }
- function ActionsItemFormatter(v, r) {
- var str = "";
- if (r.orderItemStatusId === 15) {
- str = '<span class="table-action" onclick="f_SendOrderItem(\'' +
- r.id +
- '\',\'' +
- r.quantity +
- '\',\'' +
- r.isSendQuantity +
- '\',\'' +
- r.productNo +
- '\')"><i class="iconfont icon-right"></i>发货</span>';
- } else if (r.orderItemStatusId === 9) {
- str = '<span class="table-action" onclick="f_CloseOrderItem(\'' +
- r.id +
- '\')"><i class="iconfont icon-right"></i>结束</span>';
- } else if (r.orderItemStatusId === 2) {
- str = '<span class="table-action" onclick="f_AuditOrderItem(' +
- r.id +
- ')"><i class="iconfont icon-right"></i>完成审核</span>';
- }
- //else if (r.orderItemStatusId !== 15 && r.orderItemStatusId !== 9 && r.orderItemStatusId !== 11) {
- // str = '<span class="table-action" onclick="f_AuditOrderItem(' +
- // r.id +
- // ')"><i class="iconfont icon-right"></i>完成审核</span>';
- //}
- return str;
- }
- function OrderItemStatusFormatter(v, r) {
- if (r.orderItemStatusId === 15) {
- return '<span class="label label-success">完成审核</span>';
- } else if (r.orderItemStatusId === 9) {
- return '<span class="label label-danger">发货</span>';
- } else if (r.orderItemStatusId === 11) {
- return '<span class="label label-primary">结束</span>';
- } else if (r.orderItemStatusId === 2) {
- return '<span class="label label-primary">新建</span>';
- } else if (r.orderItemStatusId === 20) {
- return '<span class="label label-primary">协商完成</span>';
- }
- return v;
- }
- function IsReportFormatter(v, r) {
- var str = "";
- if (v === "Y") {
- str = '<span class="table-action">需要</span>';
- } else if (v === "N") {
- str = '<span class="table-action">不需要</span>';;
- }
- return str;
- }
- function SendDateFormatter(v, r) {
- var dataNow = abp.clock.now();
- var sendDate = new Date(v);
- var s1 = dataNow.getTime(), s2 = sendDate.getTime();
- var span = (s2 - s1) / 1000;
- var dayspan = parseInt(span / (24 * 60 * 60));
- if (dayspan < 0) {
- return '<span style="text-decoration:underline;color:#ff0000" onclick="f_showChangeSendDate(' +
- r.id +
- ',\'' +
- r.sendDate +
- '\',' +
- r.orderItemStatusId +
- ')">' +
- sendDate.Format('yyyy-MM-dd') +
- '</span>';
- }
- if (dayspan > -1 && dayspan < 4) {
- return '<span style="text-decoration:underline;color:#dd4b39" onclick="f_showChangeSendDate(' +
- r.id +
- ',\'' +
- r.sendDate +
- '\',' +
- r.orderItemStatusId +
- ')">' +
- sendDate.Format('yyyy-MM-dd') +
- '</span>';
- }
- return '<span style="text-decoration:underline;" onclick="f_showChangeSendDate(' +
- r.id +
- ',\'' +
- r.sendDate +
- '\',' +
- r.orderItemStatusId +
- ')">' +
- sendDate.Format('yyyy-MM-dd') +
- '</span>';
- }
- function f_showChangeSendDate(id, sendDate, s) {
- if (s != @OrderItemStatusEnum.NewCreate.ToInt() && s != @OrderItemStatusEnum.Audited.ToInt()) {
- abp.message.warn("已发货(或已结束),不能操作!");
- return;
- }
- $("#orderItemNo3").val(id);
- $("#oldSendDate").val(sendDate);
- $("#newSendDate").val(sendDate);
- $('#modalChangeSendDate form #btn_addWarnItem').remove();
- $('#modalChangeSendDate form .MapperItem').remove();
- $('#modalChangeSendDate form').append(` <div id="btn_addWarnItem" class="form-group-sm" style="margin-right: 15px;text-align: right"><button type="button" class="btn btn-sm btn-info" style="width:20%; background-color: #583d9c;border-color: #583d9c;" onclick="AddSendDateWarnItem()">增加分次发货提醒</button></div>`);
- SaveAjax({
- url: window.appUrl + "OrderItems/GetSendDateWarns?orderItemId=" + id,
- //data: formUtil.Serialize(form),
- modal: $("#modalChangeSendDate"),
- dataType: "json",
- isAlert: false,
- isValidate: false,
- success: function(res) {
- if (res) {
- res.forEach(function(v, i) {
- AddSendDateWarnItem();
- $('.MapperItem:eq(' + i + ') [name="id"]').val(v.id);
- $('.MapperItem:eq(' + i + ') [name="planDate"]').val(v.planDate);
- $('.MapperItem:eq(' + i + ') [name="planQuantity"]').val(v.planQuantity);
- $('.MapperItem:eq(' + i + ') [name="remark"]').val(v.remark);
- $('.MapperItem:eq(' + i + ') [name="planDate"]').prop('disabled', true);
- $('.MapperItem:eq(' + i + ') [name="planQuantity"]').prop('readonly', true);
- $('.MapperItem:eq(' + i + ') [name="remark"]').prop('readonly', true);
- });
- }
- }
- });
- $("#modalChangeSendDate").modal("show");
- }
- function ChangeSendDate() {
- //var form = $("#modalChangeSendDate").find("form");
- var data = getSendDateItemFormData();
- SaveAjax({
- url: window.appUrl + "OrderItems/ChangeSendDate",
- //data: formUtil.Serialize(form),
- data: data,
- modal: $("#modalChangeSendDate"),
- dataType: "json",
- isAlert: false,
- isValidate: true,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderNo);
- $("#modalChangeSendDate").modal("hide");
- }
- }
- });
- }
- //分批发货提醒 2023
- function AddSendDateWarnItem() {
- var str = ' <div class="MapperItem"><input class="form-control" name="id" type="hidden" value="0" >';
- str += '<label class="iwb-label col-md-2 control-label iwb-label-required" for="planDate">送货日期</label>';
- str += ' <div class="col-md-4">';
- str +=
- '<input class="form-control iwb-date" name="planDate" type="text" placeholder="请输入日期..." value="" style="width: 100%;">';
- str += '</div>';
- str += '<label class="iwb-label col-md-2 control-label iwb-label-required" for="planQuantity">数量(千件)</label>';
- str += '<div class="col-md-4">';
- str +=
- '<input class="form-control" name="planQuantity" type="number" placeholder="请输入数量..." value="" style="width: 100%;">';
- str += '</div>';
- str +=
- '<label class="iwb-label col-md-2 control-label " for="remark" style="margin-top:10px;">备注</label>';
- str += '<div class="col-md-4">';
- str +=
- '<input class="form-control" name="remark" type="text" placeholder="请输入..." value="" style="width: 100%;margin-top:10px">';
- str += '</div>';
- str += ' <div class="col-md-6" style="text-align:center;">';
- str +=
- ' <button type="button" class="btn btn-sm btn-danger" style="width:90%;margin-top:10px; " onclick="DeleteSendDateItem(this)">删除</button>';
- str += ' </div>';
- str += '</div>';
- $("#modalChangeSendDate form").append(str);
- $('.MapperItem:last .iwb-date').iwbDate({ language: window.lang });
- }
- function DeleteSendDateItem(that) {
- var $item = $(that).closest('.MapperItem');
- var $id = $item.find('input[name="id"]');
- if ($id.val() > 0) {
- abp.message.confirm("确认删除发货提醒?",
- "删除发货提醒",
- function() {
- SaveAjax({
- url: window.appUrl + "OrderItems/DeleteSendDateWarns?sendDateWarnId=" + $id.val(),
- dataType: "json",
- isAlert: false,
- isValidate: false,
- success: function(res) {
- $item.remove();
- }
- });
- });
- } else {
- $item.remove();
- }
- }
- function getSendDateItemFormData() {
- var d = {
- orderItemNo: $("#orderItemNo3").val(),
- oldSendDate: $("#oldSendDate").val(),
- newSendDate: $("#newSendDate").val(),
- sendDateWarns: []
- };
- var items = $('.MapperItem');
- for (var i = 0; i < items.length; i++) {
- if (!$('.MapperItem:eq(' + i + ') [name="planDate"]').val()) {
- continue;
- }
- d.sendDateWarns[i] = {
- Id: $('.MapperItem:eq(' + i + ') [name="id"]').val(),
- PlanDate: $('.MapperItem:eq(' + i + ') [name="planDate"]').val(),
- PlanQuantity: $('.MapperItem:eq(' + i + ') [name="planQuantity"]').val(),
- Remark: $('.MapperItem:eq(' + i + ') [name="remark"]').val()
- }
- }
- return d;
- }
- //分批发货提醒 2023-end
- function StoreCompleteStateFormatter(v, r) {
- var str = "";
- if (v === 0) {
- str = '<span class="label label-danger">货物不齐全</span>';
- } else if (v === 1) {
- str = '<span class="label label-success">货物已齐</span>';;
- } else if (v === 2) {
- str = '<span class="label label-success">货物已齐,待改包</span>';;
- }
- return str;
- }
- function PriceFormatter(v, r) {
- var str = "0.00";
- if (v && v > 0) {
- v = (v * 10000) / 10000;
- str = _formatAmount(v, 4);
- }
- str = '<span style="text-decoration:underline;color:red;" onclick="f_showChangePrice(' +
- r.id +
- ',' +
- r.price +
- ',' +
- r.orderItemStatusId +
- ')">' +
- str +
- ' ' +
- r.currencyId +
- '</span>';
- return str;
- }
- function CurrencyPriceFormatter(v, r) {
- var str = "0.00";
- if (v && v > 0) {
- v = (v * 10000) / 10000;
- str = _formatAmount(v, 4);
- }
- str = '<span style="text-decoration:underline;color:red;">' +
- str +
- ' ' +
- r.currencyId +
- '</span>';
- return str;
- }
- function TaxPriceFormatter(v, r) {
- var str = "0.00";
- if (v && v > 0) {
- v = (v * 10000) / 10000;
- str = _formatAmount(v, 4);
- }
- str = '<span style="text-decoration:underline;color:red;" onclick="f_showChangeAfterTaxPrice(' +
- r.id +
- ',' +
- r.afterTaxPrice +
- ',' +
- r.orderItemStatusId +
- ')">' +
- str +
- ' ' +
- r.currencyId +
- '</span>';
- return str;
- }
- function f_showChangePrice(id, price, s) {
- if (s != @OrderItemStatusEnum.NewCreate.ToInt() && s != @OrderItemStatusEnum.Audited.ToInt()) {
- abp.message.warn("已发货(或已结束),不能操作!");
- return;
- }
- $("#orderItemNo").val(id);
- $("#oldPrice").val(price);
- $("#newPrice").val("");
- $("#modalChangePrice").modal("show");
- }
- function ChangePrice() {
- var form = $("#modalChangePrice").find("form");
- SaveAjax({
- url: window.appUrl + "OrderItems/ChangePrice",
- data: formUtil.Serialize(form),
- modal: $("#modalChangePrice"),
- dataType: "json",
- isAlert: false,
- isValidate: true,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderNo);
- $("#modalChangePrice").modal("hide");
- }
- }
- });
- }
- function f_showChangeAfterTaxPrice(id, price, s) {
- if (s != @OrderItemStatusEnum.NewCreate.ToInt() && s != @OrderItemStatusEnum.Audited.ToInt()) {
- abp.message.warn("已发货(或已结束),不能操作!");
- return;
- }
- $("#orderItemNo5").val(id);
- if (price <= 0) {
- price = 0;
- }
- $("#oldPrice2").val(price);
- $("#newAfterTaxPrice").val("");
- $("#modalChangeAfterTaxPrice").modal("show");
- }
- function ChangeAfterTaxPrice() {
- var form = $("#modalChangeAfterTaxPrice").find("form");
- SaveAjax({
- url: window.appUrl + "OrderItems/ChangeAfterTaxPrice",
- data: formUtil.Serialize(form),
- modal: $("#modalChangeAfterTaxPrice"),
- dataType: "json",
- isAlert: false,
- isValidate: true,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderNo);
- $("#modalChangeAfterTaxPrice").modal("hide");
- }
- }
- });
- }
- function QuantityFormatter(v, r) {
- var str = '<span style="text-decoration:underline;" onclick="f_showChangeQuantity(' +
- r.id +
- ',' +
- r.quantity +
- ',' +
- r.orderItemStatusId +
- ')">' +
- v +
- '</span>';
- return str;
- }
- function f_showChangeQuantity(id, quantity, s) {
- if (s != @OrderItemStatusEnum.NewCreate.ToInt() && s != @OrderItemStatusEnum.Audited.ToInt()) {
- abp.message.warn("已发货(或已结束),不能操作!");
- return;
- }
- $("#orderItemNo2").val(id);
- $("#oldQuantity").val(quantity);
- $("#newQuantity").val("");
- $("#modalChangeQuantity").modal("show");
- }
- function ChangeQuantity() {
- var form = $("#modalChangeQuantity").find("form");
- SaveAjax({
- url: window.appUrl + "OrderItems/ChangeQuantity",
- data: formUtil.Serialize(form),
- modal: $("#modalChangeQuantity"),
- dataType: "json",
- isAlert: false,
- isValidate: true,
- success: function(res) {
- if (res) {
- RefreshOrderItemTable(res.orderNo);
- $("#modalChangeQuantity").modal("hide");
- }
- }
- });
- }
- function TotalPriceFormatter(v, r) {
- var str = "0.00";
- if (v && v > 0) {
- v = (v * 10000) / 10000;
- str = _formatAmount(v, 4);
- }
- str = '<span style="text-decoration:underline;">' + str + '' + r.currencyId + '</span>';
- return str;
- }
- function AllTotalPriceFormatter(data) {
- console.log(data);
- var count = 0;
- var currencyId = "CNY";
- data.forEach(function(e) {
- currencyId = e.currencyId;
- count += e.totalPrice;
- });
- if (count && count > 0) {
- count = (count * 10000) / 10000;
- count = _formatAmount(count, 4);
- }
- return '<strong>' + count + ' ' + currencyId + '<strong>';
- }
- function AllAfterTaxTotalPriceFormatter(data) {
- var count = 0;
- var currencyId = "CNY";
- data.forEach(function(e) {
- currencyId = e.currencyId;
- count += e.afterTaxTotalPrice;
- });
- if (count && count > 0) {
- count = (count * 10000) / 10000;
- count = _formatAmount(count, 4);
- }
- return '<strong>' + count + currencyId + '<strong>';
- }
- function EmergencyLevelFormatter(v, r) {
- let result = '';
- var name = $('#hid-emergencyLevel option[value="' + v + '"]').text();
- if (v === '1') {
- result += '<span class="label label-success">' + name + '</span>';
- } else {
- result += '<span class="label label-danger">' + name + '</span>';
- }
- result +=
- `<span class="label label-success" style="text-decoration:underline;margin-left:2px;" onclick="showProductProcess(${r.id
- })">生产进度</span>`;
- result += `<span class="label label-success" style="text-decoration:underline;margin-left:2px;" onclick="showSelectProductDialog('${r.productNo}')">产品查询</span>`;
- return result;
- }
- function IsLockFormatter(v, r) {
- if (v === 'Y') {
- return '<span class="label label-danger">已删除</span>';
- } else {
- return '<span class="label label-success">-</span>';
- }
- }
- //function StoreHouseIdFormatter(v,r) {
- // var name = $("#hide-StoreHouses option[value='" + v + "']").text();
- // return '<span class="label label-primary">' + name + '</span>';
- // }
- </script>
- <script>
- </script>
- <script>
- //将数字转换成金额显示 n是小数点后位数
- function toNumber(num, n) {
- var re = String(num);
- var dotfront = "";
- var dotlast = "";
- if (re.indexof('.') > -1) {
- var sarr = re.spilt('.');
- dotfront = sarr[0];
- dotlast = sarr[1];
- var dotlastlength = strlen(dotlast);
- if (dotlastlength < n) {
- for (var j = 0; j < n - dotlastlength; j++) {
- dotlast += "0";
- }
- }
- if (dotlastlength > n) {
- dotlast = dotlast.substr(0, n);
- }
- } else {
- dotfront = re;
- for (var i = 0; i < n; i++) {
- dotlast += "0";
- }
- }
- num = dotfront + '.' + dotlast;
- return num;
- }
- function _formatAmount(strData, n) {
- var CurrencyAndAmountRegExp =
- /^(\d{1,18})|(\d{1,18}\.)|(\d{1,17}\.\d{0,1})|(\d{1,16}\.\d{0,2})|(\.\d{1,2})$/;
- var _result = CurrencyAndAmountRegExp.test(strData);
- if (_result == false) {
- return strData;
- } // 一般来说最多就6位吧,当然如果有特殊需求可自行更改(`・∀・´)
- n = n > 0 && n <= 6 ? n : 2;
- var formatData = parseFloat((strData + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
- var l = formatData.split('.')[0].split('').reverse();
- var r = formatData.split('.')[1];
- var t = '';
- for (i = 0; i < l.length; i++) {
- t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : '');
- }
- return t.split('').reverse().join('') + '.' + r;
- }
- function strlen(str) {
- var len = 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charCodeAt(i);
- //单字节加1
- if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
- len++;
- } else {
- len += 2;
- }
- }
- return len;
- }
- </script>
- }
- <section style="display: none">
- <select id="hid-type">
- <option value=""></option>
- </select>
- @Html.DropDownList("hid-emergencyLevel", emergencyLevelList);
- @*@Html.DropDownList("hide-StoreHouses", storeHouses)*@
- </section>
|