| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Views.Shared.New.Modals
- @using ShwasherSys.Views.Shared.New.Table
- @using ModalBodyViewModel = ShwasherSys.Views.Shared.New.Modals.ModalBodyViewModel
- @{
- ViewBag.Title = "原材料入库信息维护";
- string activeMenu = PermissionNames.PagesRawMaterialStoreRmStoreEnterMg; //The menu item will be active for this page.
- ViewBag.ActiveMenu = activeMenu;
- List<SelectListItem> applyStatus = ViewBag.ApplyStatus;
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("rmProductNo","原材料编码"),
- new SearchItem("productName","名称"),
- new SearchItem("model","规格"),
- new SearchItem("applyEnterDate","申请时间",FiledType.Dnull,ExpType.GreaterOrEqual),
- new SearchItem("applyEnterDate","至",FiledType.Dnull,ExpType.LessOrEqual),
- new SearchItem("applyStatus","申请状态",FiledType.I,ExpType.Equal).SetSearchItem(applyStatus)
- });
- var table = new TableViewModel("/api/services/app/RmEnterStore/GetAllView", activeMenu, searchForm)
- .SetFields(new List<FieldItem>()
- {
- new FieldItem("rmProductNo", "原材料编码"),
- new FieldItem("productName", "名称"),
- new FieldItem("productBatchNum", "批次号"),
- new FieldItem("material", "材质"),
- new FieldItem("model", "规格"),
- new FieldItem("applyQuantity","申请数量"),
- new FieldItem("applyEnterDate","申请入库时间","DateFormatter"),
- new FieldItem("quantity","入库数量"),
- new FieldItem("storeLocationNo", "库区"),
- new FieldItem("auditDate","审核时间","DateFormatter"),
- new FieldItem("applyStatus","状态","ApplyStatusFormatter"),
- });
- }
- @section css{
- }
- @Html.Partial("New/Table/_Table", table)
- @section modal{
- <!--Main Modal-->
- @{
- var modal = new ModalViewModel("原材料申请", new ModalBodyViewModel(new List<Input>()
- {
- new Input("id",hide:true),
- new Input("storeHouseId",hide:true),
- new Input("applyStatus",hide:true),
- //new Input("productBatchNum","批次号").SetNotRequired(),
- new Input("rmProductNo", "原材料编号").SetSearchIcon("query_rmProduct_modal","modal"),
- new Input("applyQuantity", "申请数量",@class:"number",other:"min=0.001"),
- new Input("model", "规格"),
- new Input("material", "材质"),
- new Input("storeLocationNo", "库区").SetSearchIcon("query_storeHouseLocation_modal","modal"),
- }));
- var modal2 = new ModalViewModel("入库确认","", new ModalBodyViewModel(new List<Input>()
- {
- new Input("id",hide:true),
- new Input("storeHouseId",hide:true),
- new Input("applyStatus",hide:true),
- new Input("productBatchNum","批次号"),
- new Input("rmProductNo", "原材料编号"),
- new Input("applyQuantity", "申请数量",@class:"number"),
- new Input("quantity", "入库数量",@class:"number",other:"min=0.001"),
- }), "modal2");
- }
- @Html.Partial("New/Modals/_Modal", modal)
- @Html.Partial("New/Modals/_Modal", modal2)
- @Html.Partial("Modals/Query/_RmProduct", "rmProductNo,model,material")
- @Html.Partial("Modals/Query/_StoreHouseLocation", "storeHouseId,storeLocationNo")
- }
- @section scripts
- {
- <script type="text/javascript">
- var $table = $('#table');
- $(function() {
- LoadTable();
- var funs = window.funs || { none: function() { console.log("No type"); } };
- funs["btnCreate"] = function (url) {
- queryParams.storeHouseId = 5;
- BtnCreate({ data: {storeHouseId:5,applyStatus:1}, readonly: "rmProductNo,model,material,productBatchNum",
- save: function() {
- var q = Number($("#applyQuantity").val());
- if (q <= 0) {
- abp.message.warn("申请入库数量必须大于0!");
- return;
- }
- SaveAjax({
- url: url,
- modal: $("#modal"),
- form: $('#modal #form')
- });
- }
- });
- }
- funs["btnUpdate"] = function(url) {
- var rows = $table.bootstrapTable("getSelections");
- console.log(rows[0].applyStatus);
- if (rows.length === 1) {
- if (rows[0].applyStatus === 1) {
- var row = rows[0];
- var data = $.extend({}, row, { applyStatus: 2, quantity:row.applyQuantity });
- OpenModal(url,
- {
- data: data,
- readonly: "rmProductNo,applyQuantity,productBatchNum",
- modal: $("#modal2"),
- save: function() {
- var q = Number($("#quantity").val());
- if (q <= 0) {
- abp.message.warn("审核数量必须大于0!");
- return;
- }
- SaveAjax({
- url: url,
- modal: $("#modal2"),
- form: $('#modal2 #form')
- });
- }
- });
- } else {
- abp.message.warn("只有申请中的入库记录可审核!");
- }
-
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
-
- };
- funs["btnDelete"] = function(url) {
- var rows = $table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- if (rows[0].applyStatus === 1) {
- abp.message.confirm("取消入库",
- "确认取消入库?",
- function() {
- SaveAjax({
- url: url,
- data: { Id: rows[0].id, ApplyStatus: 3 },
- isValidate: false,
- table: $table
- });
- });
- } else {
- abp.message.warn("只有申请中的入库记录可审核!");
- }
-
- } else
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- };
- });
- </script>
- <!--格式化-->
- <script id="formatter-script" type="text/javascript">
- function ApplyStatusFormatter(v, r) {
- var name = $("#hid-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>';
- }
- return '<span class="label label-info">' + name + '</span>';
- }
- </script>
- }
- <section style="display: none">
- <select id="hid-type">
- <option value=""></option>
- </select>
- @Html.DropDownList("hid-applyStatus", applyStatus)
- @*@Html.DropDownList("hid-du", duty)
- @Html.DropDownList("hid-de", depart)
- @Html.DropDownList("hid-gender", gender)*@
- </section>
|