| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Models.Modal
- @{
- /**/
- ViewBag.ActiveMenu = PermissionNames.PagesFinshedStoreInfoFinshedEnterStoreApplyMg; //The menu item will be active for this page.
- ViewBag.Title = "成品入库申请审核";
- List<SelectListItem> applyStatus = ViewBag.FinshedApplyStatus;
- List<SelectListItem> storeHouse = ViewBag.StoreHouse;
- List<SelectListItem> createSourceType = ViewBag.CreateSourceType;
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("productionOrderNo","排产单号"),
- new SearchItem("productName","产品名称"),
- new SearchItem("model","规格"),
- new SearchItem("material","材质"),
- new SearchItem("rigidity","硬度"),
- new SearchItem("surfaceColor","表色"),
- new SearchItem("productNo","产品编码").SetSearchIcon("query_Product_modal"),
- new SearchItem("applyStatus","申请状态",FiledType.I,ExpType.Equal )
- .SetSearchItem(applyStatus),
- }, false);
- }
- <section style="display: none">
- @Html.DropDownList("hide-ApplyStatus", applyStatus)
- @Html.DropDownList("hide-StoreHouse", storeHouse)
- @Html.DropDownList("hide-CreateSourceType", createSourceType)
- </section>
- <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/FinshedEnterStore/GetViewAll"
- 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">
- <thead>
- <tr class="row" id="header">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="productionOrderNo">排产单编号</th>
- <th data-align="center" data-field="productNo">产品编号</th>
- @*<th data-align="center" data-field="packageProductNo">产品编码</th>*@
- <th data-align="center" data-field="packageEnterNum">包装入库号</th>
- <th data-align="center" data-field="quantity">申请数量</th>
- <th data-align="center" data-field="packageSpecification">包装规格(千件/包)</th>
- <th data-align="center" data-field="packageCount">申请数量(包)</th>
- <th data-align="center" data-field="actualPackageCount" data-formatter="QuantityFormatte">入库数量(包)</th>
- <th data-align="center" data-field="applyStatus" data-formatter="ApplyStatusFormatter">申请状态</th>
- <th data-align="center" data-field="productName">产品名称</th>
- <th data-align="center" data-field="surfaceColor">表色</th>
- <th data-align="center" data-field="model">规格</th>
- <th data-align="center" data-field="rigidity">硬度</th>
- <th data-align="center" data-field="material">材质</th>
- <th data-align="center" data-field="partNo">零件号</th>
- <th data-align="center" data-field="remark">备注</th>
- <th data-align="center" data-field="storeHouseId" data-formatter="StoreHouseIdFormatter">仓库</th>
- <th data-align="center" data-field="storeLocationNo">库位编号</th>
- <th data-align="center" data-field="createSourceType" data-formatter="CreateSourceTypeFormatter">申请类型</th>
- <th data-align="center" data-field="sourceStoreHouseId" data-formatter="StoreHouseIdFormatter">来源仓库</th>
- <th data-align="center" data-field="applyEnterDate">申请时间</th>
- @*<th data-align="center" data-formatter="ActionFormatter"></th>*@
- </tr>
- </thead>
- </table>
- </div>
- @section modal{
- <section>
- <!--Main Modal-->
- <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("成品入库数量确认", ""))
- @{
- var inputs = new List<InputViewModel>
- {
- new InputViewModel("id", hide:true),
- new InputViewModel("createSourceType", hide:true),
- new InputViewModel("actualPackageCount", displayName:"入库包数(包)",@class:"number",other:"min=0.001"),
- new InputViewModel("packageSpecification", displayName:"包装规格(千件/包)",@class:"number",other:"min=0.001"),
- new InputViewModel("storeHouseId",InputTypes.List,displayName: "仓库").SetSelectOptions(storeHouse),
- new InputViewModel("storeLocationNo", displayName:"库位编号").SetSearchIcon("query_storeHouseLocation_modal"),
- };
- //var specials = new List<SpecialInputModel>();
- }
- @Html.Partial("Modals/_ModalBody", new ModalBodyViewModel(inputs))
- @Html.Partial("Modals/_ModalFooter", "0")
- </div>
- </div>
- </div>
- </section>
- @Html.Partial("Modals/Query/_Product", "KeyWords-7")
- @Html.Partial("Modals/Query/_StoreHouseLocation", "storeHouseId,storeLocationNo")
- }
- @section scripts
- {
- <script type="text/javascript">
- $(function () {
- $("#KeyWords-8").val("1").select2();//默认先未审核的
- //show完毕前执行
- LoadTable();
- var funs = window.funs || { none: function () { console.log("No type"); } };
- funs["btnUpdate"] = function () {
- var rows = config.table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- if (rows[0].applyStatus === "5") {
- abp.message.warn("申请已审核入库,不能再操作!");
- return;
- }
- queryParams.storeHouseId = rows[0].storeHouseId;
- $("#modal #storeHouseId").off('change');
- BtnUpdate({ disabled: "storeHouseId,packageSpecification", readonly: "storeLocationNo", data: { id: rows[0].id, packageSpecification: rows[0].packageSpecification, actualPackageCount: rows[0].packageCount, storeHouseId: rows[0].storeHouseId, storeLocationNo: rows[0].storeLocationNo, createSourceType: rows[0].createSourceType } });
- $("#modal #storeHouseId").on('change', function () {
- queryParams.storeHouseId = $(this).val();
- $("#modal #storeLocationNo").val('');
- });
- }
- };
- funs["btnDelete"] = function () {
- var rows = config.table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- //console.log('申请--' + rows[0].applyStatus)
- if (rows[0].applyStatus === 2 || rows[0].applyStatus === 5) {
- abp.message.warn("申请已审核通过,不能操作!");
- return;
- }
- //console.log('退货/返工返镀/降级'+rows[0].createSourceType)
- if (rows[0].createSourceType === 3 || rows[0].createSourceType === 4 || rows[0].createSourceType === 5) {
- abp.message.warn("退货/返工返镀/降级,不能拒绝入库操作!");
- return;
- }
- var url = config.tableTool.find('.btn[data-type=btnDelete]').data('url');
- abp.message.confirm("确认拒绝入库申请?", "拒绝申请", function () {
- SaveAjax({ url: url, data: { Id: rows[0].id }, isValidate: false });
- });
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- });
- function QuantityFormatte(v, r) {
- if (r.actualQuantity === 0) {
- return '<span class="label label-default">' + v + '</span>';
- }
- if (r.actualQuantity > r.quantity) {
- return '<span class="label label-success">' + v + '</span>';
- } else if (r.actualQuantity === r.quantity) {
- return '<span class="label label-info">' + v + '</span>';
- } else {
- return '<span class="label label-danger">' + v + '</span>';
- }
- }
- function StoreHouseIdFormatter(v, r) {
- var name = $("#hide-StoreHouse option[value='" + v + "']").text();
- return name;
- }
- function ApplyStatusFormatter(v, r) {
- if (r.isClose) {
- return '<span class="label label-primary">已结束</span>';
- }
- var name = $("#hide-ApplyStatus option[value='" + v + "']").text();
- if (v === 1) {
- return '<span class="label label-info">' + name + '</span>';
- } else if (v === 2) {
- return '<span class="label label-success">' + name + '</span>';
- } else if (v === 3) {
- return '<span class="label label-warning">' + name + '</span>';
- } else if (v === 4) {
- return '<span class="label label-danger">' + name + '</span>';
- }
- return '<span class="label label-info">' + name + '</span>';
- }
- function CreateSourceTypeFormatter(v, r) {
-
- var name = $("#hide-CreateSourceType option[value='" + v + "']").text();
- return '<span class="label label-info">' + name + '</span>';
- }
- function ActionFormatter(v, r) {
- var str = '';
- if (r.applyStatus === 2 && r.createSourceType === 2) {
- str = '<span class="table-action" onclick="BtnConfirmEnter(\'' +
- r.id +
- '\')"><i class="iconfont icon-right"></i>确认入库</span>';
- }
- return str;
- }
- function BtnConfirmEnter(id) {
- abp.message.confirm("确认产品入库数量正确吗?",
- "确认入库数量",
- function () {
- SaveAjax({
- url: window.appUrl + 'FinshedEnterStore/ConfirmEnterStoreQuantity',
- data: { Id: id },
- isValidate: false
- });
- });
- }
- </script>
- }
|