| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.BasicInfo
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Models.Modal
- @using ShwasherSys.Views.Shared.New.Modals
- @using ShwasherSys.Views.Shared.New.Table
- @using InputTypes = ShwasherSys.Views.Shared.New.Modals.InputTypes
- @using ModalBodyViewModel = ShwasherSys.Views.Shared.New.Modals.ModalBodyViewModel
- @using ModalHeaderViewModel = ShwasherSys.Models.Modal.ModalHeaderViewModel
- @using SpecialInputModel = ShwasherSys.Views.Shared.New.Modals.SpecialInputModel
- @{
- ViewBag.Title = "原材料库存信息维护";
- string activeMenu = PermissionNames.PagesRawMaterialStoreRmCurrentStoreMg; //The menu item will be active for this page.
- ViewBag.ActiveMenu = activeMenu;
- //List<SelectListItem> applyStatus = ViewBag.ApplyStatus;
- string AddEnterAuth = PermissionNames.PagesRawMaterialStoreRmCurrentStoreMgAddEnter;
- string AddOutAuth = PermissionNames.PagesRawMaterialStoreRmCurrentStoreMgAddOut;
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("rmProductNo","原材料编码"),
- new SearchItem("productName","名称"),
- new SearchItem("model","规格")
- });
- var table = new TableViewModel("/api/services/app/CurrentRmStoreHouse/GetAllView", activeMenu, searchForm)
- .SetFields(new List<FieldItem>()
- {
- new FieldItem("rmProductNo", "原材料编码"),
- new FieldItem("productName", "名称"),
- new FieldItem("productBatchNum", "批次号"),
- new FieldItem("material", "材质"),
- new FieldItem("model", "规格"),
- new FieldItem("quantity","数量"),
- new FieldItem("freezeQuantity","冻结数量"),
- new FieldItem("storeLocationNo","库区"),
- new FieldItem("actionFormatter","","ActionFormatter"),
- });
- }
- @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("applyStatus",hide:true),
- new Input("storeHouseId",hide:true),
- new Input("productBatchNum","批次号"),
- new Input("rmProductNo", "原材料编号"),
- new Input("model", "规格"),
- new Input("material", "材质"),
- new Input("storeLocationNo", "库区"),
- new Input("quantity", "申请数量",@class:"number",other:"min=0.001"),
- }));
- var modal2 = new ModalViewModel("原材料出库平衡", new ModalBodyViewModel(new List<Input>()
- {
- //new Input("id",hide:true),
- new Input("currentRmStoreHouseNo",hide:true),
- new Input("productBatchNum","批次号"),
- new Input("rmProductNo", "原材料编号"),
- 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")*@
- }
- @section scripts
- {
- <script type="text/javascript">
- var $table = $('#table');
- $(function () {
- LoadTable();
- var funs = window.funs || { none: function () { console.log("No type"); } };
- //funs["AddEnter"] = function (url) {
- // //BtnCreate({ data: { storeHouseId: 5, applyStatus: 1 }, readonly: "rmProductNo,model,material" });
- // var rows = $table.bootstrapTable("getSelections");
- // if (rows.length === 1) {
- // var row = rows[0];
- // var data = $.extend({}, row, { applyStatus: 1 });
- // OpenModal(url,
- // { data: data, readonly: "rmProductNo,quantity,productBatchNum" });
- // } else
- // abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- //}
- //funs["AddOut"] = function (url) {
- // var rows = $table.bootstrapTable("getSelections");
- // if (rows.length === 1) {
- // var row = rows[0];
- // OpenModal(url,
- // { data: row, readonly: "rmProductNo,quantity,productBatchNum",modal:$("#modal2") });
- // } else
- // abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- //};
- });
- function BtnAddEnter(productBatchNum, rmProductNo, storeHouseId, storeLocationNo, model, material) {
- var data = {
- productBatchNum: productBatchNum,
- rmProductNo: rmProductNo,
- storeHouseId: storeHouseId,
- storeLocationNo: storeLocationNo,
- model: model,
- material: material,
- applyStatus: 1,
-
- }
- OpenModal(window.appUrl+"CurrentRmStoreHouse/AddEnter",
- {
- data: data, readonly: "rmProductNo,productBatchNum,model,material,storeLocationNo" ,
- save: function() {
- var q = Number($("#modal #quantity").val());
- if (q <= 0) {
- abp.message.warn("入库数量必须大于0!");
- return;
- }
- SaveAjax({
- url: window.appUrl+"CurrentRmStoreHouse/AddEnter",
- modal: $("#modal"),
- form: $('#modal #form')
- });
- }
- });
- }
- function BtnAddOut(currentRmStoreHouseNo,productBatchNum,rmProductNo) {
- var data = {
- productBatchNum: productBatchNum,
- rmProductNo: rmProductNo,
- currentRmStoreHouseNo: currentRmStoreHouseNo
- }
- OpenModal(window.appUrl+"CurrentRmStoreHouse/AddOut",
- { data: data, readonly: "rmProductNo,productBatchNum",modal:$("#modal2") ,
- save: function() {
- var q = Number($("#modal2 #quantity").val());
- if (q <= 0) {
- abp.message.warn("出库数量必须大于0!");
- return;
- }
- SaveAjax({
- url: window.appUrl+"CurrentRmStoreHouse/AddOut",
- modal: $("#modal2"),
- form: $('#modal2 #form')
- });
- }});
- }
- </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>';
- }
- function ActionFormatter(v, r) {
- var str = '';
- if (abp.auth.isGranted('@AddEnterAuth')) {
- str = '<span class="table-action" onclick="BtnAddEnter(\'' +
- r.productBatchNum +
- '\',\'' +
- r.rmProductNo +
- '\',\'' +
- r.storeHouseId +
- '\',\'' +
- r.storeLocationNo +
- '\',\'' +
- r.model +
- '\',\'' +
- r.material +
- '\')"><i class="iconfont icon-right"></i>入库平衡</span>';
- }
- if (abp.auth.isGranted('@AddOutAuth')) {
- str += '<span class="table-action" onclick="BtnAddOut(\'' +
- r.id +
- '\',\'' +
- r.productBatchNum +
- '\',\'' +
- r.rmProductNo +
- '\')"><i class="iconfont icon-right"></i>出库平衡</span>';
- }
- return str;
- }
- </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>
|