236 lines
9.0 KiB
Plaintext
236 lines
9.0 KiB
Plaintext
@page "{handler?}"
|
|
@model YBDevice.NWeb.Pages.OutProduct.IndexModel
|
|
@{
|
|
ViewData["Title"] = "出货管理";
|
|
}
|
|
<div class="layui-card">
|
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<div class="layui-input-inline">
|
|
<select id="BusinessId" lay-search>
|
|
<option value="">请选择客户</option>
|
|
@foreach (var item in Model.businesslist)
|
|
{
|
|
<option value="@item.Id">@item.Name</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div class="layui-input-inline">
|
|
<select id="DevType" lay-search>
|
|
<option value="">设备类型</option>
|
|
@foreach (var item in Model.types)
|
|
{
|
|
<option value="@item.Code">@item.Name</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div class="layui-input-inline">
|
|
<input type="text" class="layui-input" name="Code" id="Code" placeholder="请输入设备序列号" />
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
|
@Html.Raw(Model.viewdata.Top)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-card-body">
|
|
<table class="layui-table" id="list" lay-filter="list">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<script type="text/html" id="optpl">
|
|
@Html.Raw(Model.viewdata.Table)
|
|
</script>
|
|
<script type="text/html" id="lefttoolbar">
|
|
<button class="btn btn-primary btn-lg" lay-event="js-fenpei">分配</button>
|
|
<button class="btn btn-primary btn-lg" lay-event="reback">回收</button>
|
|
</script>
|
|
@section Scripts{
|
|
<script type="text/javascript">
|
|
layui.use(['common', 'layer', 'table'], function () {
|
|
var common = layui.common, table = layui.table;
|
|
common.initTable({
|
|
url: '/api/product/getlist'
|
|
/* toolbar: "#lefttoolbar"*/
|
|
, method: 'post'
|
|
, ontoolbarevent: function (obj) {
|
|
if (obj.event == "js-fenpei" || obj.event == "reback") {
|
|
var checkStatus = table.checkStatus(obj.config.id);
|
|
if (checkStatus.data.length == 0) {
|
|
common.alert("请选择订单");
|
|
return;
|
|
}
|
|
var ids = [];
|
|
$.each(checkStatus.data, function () {
|
|
ids.push(this.Id);
|
|
});
|
|
switch (obj.event) {
|
|
case "js-fenpei":
|
|
common.confirm("确定分配?", function () {
|
|
common.uajax({
|
|
url: "/api/product/batchset",
|
|
type: "post",
|
|
data: {
|
|
ids: ids,
|
|
type: 1
|
|
}
|
|
});
|
|
});
|
|
break;
|
|
case "reback":
|
|
common.confirm("确定回收?", function () {
|
|
common.uajax({
|
|
url: "/api/product/batchset",
|
|
type: "post",
|
|
data: {
|
|
ids: ids,
|
|
type: 2
|
|
}
|
|
});
|
|
});
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
, cols: [[
|
|
{ type: "checkbox" },
|
|
{
|
|
field: 'businessname', title: '客户'
|
|
}
|
|
,
|
|
{
|
|
field: 'type', title: '类型', templet: function (d) {
|
|
return OutProductType[d.type];
|
|
}
|
|
}
|
|
,
|
|
{
|
|
field: 'typename', title: '设备类型'
|
|
}
|
|
,
|
|
{
|
|
field: 'expressname', title: '物流'
|
|
}
|
|
,
|
|
{
|
|
field: 'expressno', title: '物流单号', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'sender', title: '发货人', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'senderphone', title: '发货人电话', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'senderaddress', title: '发货地址', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'recver', title: '收货人', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'recverphone', title: '收货人电话', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'recveradderess', title: '收货地址', hide: true
|
|
}
|
|
,
|
|
{
|
|
field: 'cnt', title: '设备台数'
|
|
}
|
|
,
|
|
{
|
|
field: 'status', title: '状态', templet: function (d) {
|
|
return OutProductStatus[d.status];
|
|
}
|
|
}
|
|
,
|
|
{
|
|
field: 'createtime', title: '时间'
|
|
}
|
|
,
|
|
{
|
|
title: '操作', templet: "#optpl", fixed: 'right'
|
|
}
|
|
]]
|
|
});
|
|
$(".js-search").on("click", function () {
|
|
common.reloadtable("list", {
|
|
where: {
|
|
queryParam: [{
|
|
"Name": 'BusinessId',
|
|
"Type": QueryCond.Equal,
|
|
"Value": $("#BusinessId").val()
|
|
}, {
|
|
"Name": 'Code',
|
|
"Type": QueryCond.Equal,
|
|
"Value": $("#Code").val()
|
|
}, {
|
|
"Name": 'DevType',
|
|
"Type": QueryCond.Equal,
|
|
"Value": $("#DevType").val()
|
|
}]
|
|
}
|
|
});
|
|
});
|
|
$(".js-add").on("click", function () {
|
|
common.dialog({
|
|
title: '添加订单',
|
|
content: '/OutProduct/Edit'
|
|
});
|
|
});
|
|
$("body").on("click", ".js-edit", function () {
|
|
var id = $(this).data('id');
|
|
common.dialog({
|
|
title: '编辑订单',
|
|
content: '/OutProduct/Edit?id=' + id
|
|
});
|
|
});
|
|
$("body").on("click", ".js-cancel", function () {
|
|
var id = $(this).data('id');
|
|
common.prompt({
|
|
formType: 2,
|
|
value:''
|
|
}, function (value, index, elem) {
|
|
if (value == "") {
|
|
common.alert("请先输入取消原因");
|
|
return;
|
|
}
|
|
layui.layer.close(index);
|
|
common.uajax({
|
|
url: "/api/product/cancel?id=" + id + "&remark=" + value
|
|
});
|
|
});
|
|
});
|
|
$("body").on("click", ".js-Set", function () {
|
|
var id = $(this).data('id');
|
|
var status = $(this).data('status');
|
|
var msg = "确定设备已打包?";
|
|
if (status == 3) {
|
|
msg = "确定已发货?";
|
|
}
|
|
if (status == 4) {
|
|
msg = "确定已收货?";
|
|
}
|
|
common.confirm(msg, function () {
|
|
common.uajax({
|
|
url: "/api/product/setStatus?id=" + id + "&status=" + status
|
|
});
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
} |