zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
@{
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
    ViewBag.Title = "SortingList";
}
<div id="sortingList" 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.sortingNo" size="mini"></el-input>
            </el-form-item>
            <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="search">查 询</el-button>
            <el-button size="mini" type="primary" v-on:click="print">打印</el-button>
        </el-form>
        @*<el-row style="padding-left: 10px; margin-top: 7px;">
            </el-row>*@
    </el-card>
    <hh-table v-bind:coloptions="sortingCols"
              v-bind:paging="true"
              v-bind:single="true"
              v-bind:check="true"
              v-bind:where="where"
              v-on:clickrow="clickRow"
              url="@Url.Action("GetSortingList")"
              ref="sortinglist"
              v-bind:dh="tableHeight"></hh-table>
    <el-tabs type="border-card" tab-position="left" v-bind:style="'height:'+tabHeight+'px'">
        <el-tab-pane label="分拣数据">
            <hh-table v-bind:coloptions="sortingsCols"
                      v-bind:single="true"
                      v-bind:url="dtlUrl"
                      ref="sortingDtlList"
                      v-bind:dh="tabTableHeight"
                      v-bind:rowno="true"></hh-table>
        </el-tab-pane>
        <el-tab-pane label="分拣明细">
            <hh-table v-bind:coloptions="locationCols"
                      v-bind:single="true"
                      v-bind:url="locationUrl"
                      ref="sortingLocationList"
                      v-bind:dh="tabTableHeight"
                      v-bind:rowno="true"></hh-table>
        </el-tab-pane>
        <el-tab-pane label="分拣结果">
            <hh-table v-bind:coloptions="sortingsCols"
                      v-bind:single="true"
                      v-bind:url="resultUrl"
                      ref="sortingResultList"
                      v-bind:dh="tabTableHeight"
                      v-bind:rowno="true"></hh-table>
        </el-tab-pane>
    </el-tabs>
</div>
@section scripts{
    <script>
        new Vue({
            mixins: [useAutoHeight, wmsApps],
            data: {
                sortingNo: "",
                dtlUrl: "",
                locationUrl: "",
                resultUrl: "",
                formData: {
                    sortingNo: "",
                },
                where: {},
            },
            computed: {
                tableHeight: function () {
                    return (this.autoHeight + 100) / 2;
                },
                tabHeight: function () {
                    return (this.autoHeight - 60) / 2;
                },
                tabTableHeight: function () {
                    return (this.autoHeight + 80) / 2;
                },
                locationCols: function () {
                    var $this = this;
                    return [
                        { f: "CN_S_ITEM_CODE", n: "物料编码" },
                        { f: "CN_S_ITEM_NAME", n: "物料名称" },
                        { f: "CN_S_MODEL", n: "规格型号", hidden: $this.wmsApp.ss },
                        { f: "CN_S_FIGURE_NO", n: "图号", hidden: $this.wmsApp.ss },
                        { f: "CN_F_QUANTITY", n: "数量" },
                        { f: "CN_S_MEASURE_UNIT", n: "计量单位" },
                        { f: "CN_S_LOCATION_CODE", n: "货位" },
                        { f: "CN_S_TRAY_CODE", n: "容器" },
                    ];
                },
                sortingsCols: function () {
                    var $this = this;
                    return [
                        { f: "CN_S_ITEM_CODE", n: "物料编码" },
                        { f: "CN_S_ITEM_NAME", n: "物料名称" },
                        { f: "CN_S_MODEL", n: "规格型号", hidden: $this.wmsApp.ss },
                        { f: "CN_S_FIGURE_NO", n: "图号", hidden: $this.wmsApp.ss },
                        { f: "CN_F_QUANTITY", n: "数量" },
                        { f: "CN_S_MEASURE_UNIT", n: "计量单位" },
                    ];
                },
                sortingCols: function () {
                    return [
                        { f: "CN_S_SORTING_NO", n: "分拣单号", w: 130 },
                        //{ f: "CN_S_SEEDING_MODE", n: "分拣模式", w: 130 },
                        { f: "CN_S_FROM_NO", n: "来源单号", w: 150 },
                        { f: "CN_S_STOCK_CODE", n: "所属仓库", },
                        { f: "CN_S_STOCK_AREA", n: "所属库区" },
                        //{ f: "CN_S_SEEDING_MODE", n: "分拣模式" },
                        { f: "CN_S_STATE", n: "状态", w: 85 },
                        { f: "CN_S_MODIFY_BY", n: "修改人", w: 85 },
                        { f: "CN_T_MODIFY", n: "修改时间" }
                    ];
                }
            },
            methods: {
                selectRowEvent: function (isSingle, callBack) {
                    var selectRow = this.$refs.sortinglist.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);
                },
                search: function () {
                    this.$refs.sortinglist.loadData(this.formData);
                },
                clickRow: function (row, event, column) {
                    var sortingNo = row.CN_S_SORTING_NO;
                    this.sortingNo = sortingNo;
                    this.dtlUrl = "@Url.Action("GetSortingDtl")?sortingNo=" + sortingNo;
                    this.locationUrl = "@Url.Action("GetSortingLocation")?sortingNo=" + sortingNo;
                    this.resultUrl = "@Url.Action("GetSortingResult")?sortingNo=" + sortingNo;
                },
                print: function () {
                    this.selectRowEvent(true, function (row) {
                        var title = '分拣单-打印';
                        parent.tab.tabAdd({
                            title: title,
                            href: '/Basic/Common/PrintReport?no=' + row.CN_S_SORTING_NO + '&rdlx=SortingReport.rdlx&asmx=SortingService'
                        });
                    })
                }
            },
            el: '#sortingList'
        }
        );
    </script>
}