@using DTO;
|
@{
|
ViewBag.Title = "AdmGoodsManage";
|
Layout = "~/Views/Shared/_Layout_Search.cshtml";
|
|
List<PageEntity> ActionInfo2 = ViewData["ActionInfo2"] as List<PageEntity>;
|
}
|
@section headerStyle{
|
<script type="text/javascript">
|
var GoodsStatus = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.GoodsStatus))';
|
|
var ClassifyId = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ClassifyId))';
|
|
var Goods = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Goods))';
|
|
|
dataCol = [
|
{ label: 'id', name: 'Id', labtype: 'txt', hidden: true },
|
{
|
label: '物品类别', name: 'ClassifyName', labtype: 'txt', hidden: false, width: 100
|
},
|
|
{
|
label: '物品名称', name: 'GoodsName', labtype: 'txt', hidden: false, width: 100,
|
formatter: function (cellvalue, options, rowObject) {
|
return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/AdmGoodsManage/Edit?id=" + rowObject.Id + "')\" >" + cellvalue + "</a>";
|
}
|
},
|
{ label: '价格', name: 'GoodsPrice', labtype: 'txt', hidden: true, width: 100 },
|
|
{ label: '总数量', name: 'GoodsNum', labtype: 'txt', hidden: false, width: 100 },
|
{ label: '剩余数量', name: 'GoodsLeft', labtype: 'txt', hidden: false, width: 100 },
|
|
{ label: '物品状态', name: 'GoodsStatusName', labtype: 'txt', hidden: false, width: 100 },
|
{
|
label: '入库', name: 'GoodsName', labtype: 'txt', hidden: false, width: 50,
|
formatter: function (cellvalue, options, rowObject) {
|
return "<a class='Ruku' style='display: none;' onclick=\"OpenWindow('入库','98%','100%', '/AdmGoodsManage/Ruku?id=" + rowObject.Id + "')\" >入库</a>";
|
}
|
},
|
{
|
label: '出库', name: 'GoodsName', labtype: 'txt', hidden: false, width: 50,
|
formatter: function (cellvalue, options, rowObject) {
|
return "<a class='Chuku' style='display: none;' onclick=\"OpenWindow('出库','98%','100%', '/AdmGoodsManage/Chuku?id=" + rowObject.Id + "')\" >出库</a>";
|
}
|
},
|
{
|
label: '出入库记录', name: 'Remark', labtype: 'txt', hidden: false,
|
formatter: function (cellvalue, options, rowObject) {
|
return "<a onclick=\"OpenWindow('" + rowObject.GoodsName + "','98%','100%', '/AdmGoodsManage/Liushuizhang?id=" + rowObject.Id + "')\" >出入库记录</a>";
|
}
|
},
|
];
|
dataUrl = "/AdmGoodsManage/GetList";
|
searchCol = [
|
|
{ label: '物品类别', name: 'ClassifyId', labtype: 'combox', hidden: false, data: JSON.parse(ClassifyId), cwidth: '5%', cccwidth: '15%' },
|
{ label: '物品名称', name: 'GoodsName', labtype: 'combox', hidden: false, data: JSON.parse(Goods), cwidth: '5%', cccwidth: '15%'},
|
{ label: '物品状态', name: 'GoodsStatus', labtype: 'combox', hidden: false, data: JSON.parse(GoodsStatus), cwidth: '5%', cccwidth: '15%' },
|
|
|
|
|
|
|
|
];
|
|
|
var _pageAdd = function () {
|
OpenWindow("新增物品", "98%", "90%", "/AdmGoodsManage/Edit/");
|
}
|
|
var _pageRuku = function () {
|
OpenWindow("物品入库", "98%", "90%", "/AdmGoodsManage/Ruku/");
|
}
|
|
var _pageChuku = function () {
|
OpenWindow("物品出库", "98%", "90%", "/AdmGoodsManage/Chuku/");
|
}
|
|
|
var _afterSave = function (result) {
|
if (result) {
|
toastr.success("保存成功");
|
} else {
|
toastr.error("保存失败");
|
}
|
}
|
|
var _afterDel = function (result) {
|
if (result) {
|
toastr.success("删除成功");
|
} else {
|
/**/
|
toastr.error("删除成功");
|
/**/
|
}
|
}
|
|
var ActionInfo22 = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ActionInfo2))';
|
var _afterLoadDataload = function (xhr) {
|
var data = JSON.parse(ActionInfo22);
|
for (var o in data) {
|
//alert(o);
|
//alert(data[o]);
|
/* alert("PageShortcut:" + data[o].PageShortcut + " PageName:" + data[o].PageName);*/
|
$("." + data[o].PageShortcut).show();
|
|
}
|
|
|
};
|
</script>
|
}
|
|
@section footerScripts{
|
<script type="text/javascript">
|
|
|
|
function send() {
|
|
var msg = $("#PBSClassifyId");
|
|
|
if (msg.length > 0) {
|
$("#PBSClassifyId").change(function () {
|
var classifyId = $("#PBSClassifyId").val();
|
$.ajax({
|
type: "GET",
|
url: "/AdmGoodsManage/getGoods?ClassifyId=" + classifyId,
|
dataType: "json",
|
global: false,
|
data: "",
|
success: function (data) {
|
|
var GoodsName = $("#PBSGoodsName");
|
GoodsName.find('option').remove();
|
var aaa = '<option value="" hassubinfo="true"> </option>';
|
GoodsName.append(aaa);
|
if (data.length > 0) {
|
for (var i = 0; i < data.length; i++) {
|
|
var o = '<option value="' + data[i].Id + '" hassubinfo="true">' + data[i].GoodsName + '</option>';
|
GoodsName.append(o);
|
}
|
}
|
$("#PBSGoodsName").trigger('chosen:updated');//更新选项
|
},
|
error: function () {
|
|
|
parent.layer.msg('失败', { icon: 5 });
|
}
|
});
|
});
|
|
} else {
|
setTimeout(send, 1000);
|
}
|
}
|
|
|
send();
|
|
</script>
|
}
|