@{
|
Layout = "~/Views/Shared/_LayoutVue.cshtml";
|
ViewBag.Title = "OutList";
|
}
|
@section head{
|
<link href="~/js/Vue/split-pane/split-pane.css" rel="stylesheet" />
|
<link href="~/js/Vue/split-pane/pretty-split-pane.css" rel="stylesheet" />
|
}
|
<div id="outList" v-cloak>
|
<el-card class="box-card">
|
<el-form label-width="90px" v-bind:model="formData" class="demo-ruleForm" v-bind:inline="true">
|
<el-form-item label="发货通知单:">
|
<el-input v-model="formData.CN_S_OP_NO" size="mini"></el-input>
|
</el-form-item>
|
<el-form-item label="状态:">
|
<hh-select-url v-model="formData.CN_S_STATE"
|
v-bind:options="stateOptions"
|
ref="ztt"></hh-select-url>
|
</el-form-item>
|
<el-form-item label="创建日期:" style="width:490px">
|
<el-date-picker v-model="formData.CN_T_CREATE"
|
type="daterange"
|
align="right"
|
unlink-panels
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
value-format="yyyy-MM-dd"
|
size="mini" style="width: 395px">
|
</el-date-picker>
|
</el-form-item>
|
<el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">查 询</el-button>
|
</el-form>
|
<el-row style="padding-left: 10px; margin-top: 7px;">
|
<el-button size="mini" type="primary" v-on:click="add">新 增</el-button>
|
<el-button size="mini" type="primary" v-on:click="edit(false)">编 辑</el-button>
|
<el-button size="mini" type="warning" v-on:click="submit">提 交</el-button>
|
<el-button size="mini" type="success" v-on:click="edit(true)">查 看</el-button>
|
<el-button size="mini" type="danger" v-on:click="del">删 除</el-button>
|
@*<el-button size="mini" type="danger" v-on:click="test">test</el-button>*@
|
</el-row>
|
</el-card>
|
|
<div class="pretty-split-pane-frame" v-bind:style="'height:'+autoFrameHeight+'px;'">
|
<div class="split-pane fixed-bottom">
|
<div class="split-pane-component" id="top-component">
|
<div class="pretty-split-pane-component-inner">
|
|
<hh-table v-bind:paging="true"
|
v-bind:check="true"
|
v-bind:single="true"
|
dh="115"
|
url="@Url.Action("GetOutList")"
|
v-bind:coloptions="outCols"
|
v-bind:serialize="true"
|
v-bind:height="tableHeight"
|
v-on:clickrow="clickRow"
|
ref="outlist"></hh-table>
|
|
</div>
|
</div>
|
|
<div class="split-pane-divider" id="my-divider"></div>
|
|
<div class="split-pane-component" id="bottom-component">
|
<div class="pretty-split-pane-component-inner">
|
|
|
<el-tabs type="border-card" v-bind:style="'height:'+tabHeight+'px'">
|
<el-tab-pane label="物料列表">
|
<hh-table v-bind:coloptions="itemCols"
|
v-bind:single="true"
|
v-bind:url="itemUrl"
|
ref="itemList"
|
v-bind:height="tabHeight-50"></hh-table>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
|
</div>
|
@section scripts{
|
<script src="~/js/Vue/split-pane/split-pane.js"></script>
|
<script>
|
var outList = new Vue({
|
mixins: [useAutoHeight],
|
data: {
|
autoFrameHeight: 0,
|
tableHeight: 0,
|
tabHeight: 0,
|
itemUrl: "",
|
formData: {
|
CN_S_OP_NO: "",
|
CN_S_STATE: "",
|
CN_T_CREATE: "",
|
},
|
stateOptions: [{
|
value: '',
|
label: '全部'
|
}, {
|
value: '新建',
|
label: '新建'
|
}, {
|
value: '已提交',
|
label: '已提交'
|
}, {
|
value: '分拣中',
|
label: '分拣中'
|
}, {
|
value: '已分拣',
|
label: '已分拣'
|
}, {
|
value: '已完成',
|
label: '已完成'
|
}],
|
outCols: [
|
{ f: 'CN_S_OP_NO', n: '发货通知单' },
|
{ f: 'CN_S_STATE', n: '状态' },
|
{ f: 'CN_S_OPERATOR', n: '制单人' },
|
{ f: 'CN_T_CREATE', n: '创建日期' },
|
{ f: 'CN_S_NOTE', n: '摘要' },
|
],
|
itemCols: [
|
{ f: "CN_S_ITEM_CODE", n: "物料编码" },
|
{ f: "CN_S_ITEM_NAME", n: "物料名称" },
|
{ f: "CN_S_MEASURE_UNIT", n: "计量单位" },
|
{ f: "CN_F_QUANTITY", n: "数量" },
|
],
|
currentTitle: wms.currentTitle,
|
},
|
methods: {
|
clickRow: function (row, event, column) {
|
var opNo = row.CN_S_OP_NO;
|
this.opNo = opNo;
|
var _t = (new Date()).valueOf()
|
this.itemUrl = "/OutStock/HKOut/GetOutDtl?opNo=" + opNo + "&_t=" + _t;
|
},
|
test: function () {
|
console.log(this.$refs.ztt);
|
var $this = this;
|
this.selectRowEvent(true, function (row) {
|
ajaxManage({
|
url: "@Url.Action("SubmitOut")?opNo=" + row.CN_S_OP_NO,
|
success: function (data) {
|
wms.showMsg(data, function () {
|
console.log('data', data);
|
});
|
}
|
});
|
})
|
},
|
search: function () {
|
this.$refs.outlist.loadData(this.formData);
|
},
|
add: function () {
|
var $this = this;
|
parent.tab.tabAdd({
|
title: '发货通知单-新增',
|
href: '@Url.Action("OutEdit")?mainPage=' + $this.currentTitle
|
});
|
},
|
selectRowEvent: function (isSingle, callBack) {
|
var selectRow = this.$refs.outlist.selections;
|
var row = null;
|
if (isSingle) {
|
if (selectRow.length != 1) {
|
wms.warning("请选择一条记录操作");
|
return;
|
}
|
row = selectRow[0];
|
} else {
|
if (selectRow.length <= 0) {
|
wms.warning("请至少选择一条记录操作");
|
return;
|
}
|
row = selectRow;
|
}
|
if (callBack)
|
callBack(row);
|
},
|
edit: function (read) {
|
var $this = this;
|
this.selectRowEvent(true, function (row) {
|
if (!read && (row.CN_S_STATE != '新建' && row.CN_S_STATE != '已驳回')) {
|
wms.warning("请选择状态为 新建、已驳回 的单据编辑");
|
return;
|
}
|
var title = read ? '发货通知单-查看' : '发货通知单-编辑'
|
parent.tab.tabAdd({
|
title: title,
|
href: '@Url.Action("OutEdit")?mainPage=' + $this.currentTitle + '&opNo=' + row.CN_S_OP_NO + '&read=' + read
|
});
|
})
|
},
|
submit: function () {
|
var $this = this;
|
this.selectRowEvent(true, function (row) {
|
if (row.CN_S_STATE != '新建' && row.CN_S_STATE != '已驳回') {
|
wms.warning("请选择状态为 新建、已驳回 的单据提交");
|
return;
|
}
|
wms.confirm("确认提交?", function () {
|
ajaxManage({
|
url: "@Url.Action("SubmitOut")?opNo=" + row.CN_S_OP_NO,
|
success: function (data) {
|
wms.showMsg(data, function () {
|
wms.success("提交成功");
|
$this.$refs.outlist.loadData();
|
});
|
}
|
});
|
});
|
});
|
},
|
del: function () {
|
var $this = this;
|
this.selectRowEvent(true, function (row) {
|
if (row.CN_S_STATE != '新建' && row.CN_S_STATE != '已驳回') {
|
wms.warning("请选择状态为 新建、已驳回 的单据删除");
|
return;
|
}
|
wms.confirm("确认删除?", function () {
|
ajaxManage({
|
url: "@Url.Action("DeleteOut")?opNo=" + row.CN_S_OP_NO,
|
success: function (data) {
|
wms.showMsg(data, function () {
|
wms.success("删除成功");
|
$this.$refs.outlist.loadData();
|
});
|
}
|
});
|
});
|
});
|
},
|
resizeFrame: function (changePosition) {
|
if (!changePosition) {
|
//80是上面搜索条件的高度
|
this.autoFrameHeight = this.autoHeight - 80;
|
//var _h = this.autoFrameHeight / 2;
|
//上面占2/3 下面占1/3
|
var top = this.autoFrameHeight * (2 / 3);
|
var bottom = this.autoFrameHeight * (1 / 3);
|
|
$("#top-component").css("height", top + "px");
|
$("#my-divider").css("bottom", bottom + "px");
|
$("#bottom-component").css("height", bottom + "px");
|
}
|
|
var b = $("#bottom-component").height();
|
//这个3是固定的
|
outList.tabHeight = b - 3;
|
|
var t = $("#top-component").height();
|
//这个41是列表分页控件的高度,也是固定的
|
outList.tableHeight = this.autoFrameHeight - b - 41;
|
}
|
},
|
el: '#outList',
|
mounted: function () {
|
var $this = this;
|
this.$nextTick(function () {
|
$('div.split-pane').splitPane();
|
$("#my-divider").onPositionChanged(function () {
|
outList.resizeFrame(true);
|
}, 10);
|
$this.resizeFrame();
|
$(window).resize(function () {
|
$this.resizeFrame();
|
});
|
});
|
},
|
});
|
</script>
|
}
|