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
160
161
162
163
164
165
166
167
168
169
170
171
@{
    ViewBag.Title = "ShowLocationContext";
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
}
 
<style type="text/css">
    .el-form-item__content {
        width: 120px !important;
        margin-left: 10px;
    }
</style>
 
<div id="list" v-cloak>
    <el-card class="box-card">
        <el-form label-width="100px"  class="demo-ruleForm" v-bind:inline="true">
            <el-form-item label="@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_location_code"):">
                <el-input style="width:130px;" v-bind:disabled="true" v-model="locationCode" size="mini"></el-input>
            </el-form-item>
            @{
    if ("hcbh".Equals(ViewBag.PROJECT_CODE) || "tzlj".Equals(ViewBag.PROJECT_CODE))
    {
 
    }
    else if ("wxys".Equals(ViewBag.PROJECT_CODE))
    {
        if (ViewBag.DISPLAY_BTN)
        {
            <el-form-item style="width:130px;">
                <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="toNormal">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_returnnormal")</el-button>
            </el-form-item>
        }
    }
    else
    {
                    <el-form-item style="width:130px;">
                        <el-button style="margin-top: 2px; " size="mini" type="primary" v-on:click="toNormal">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_returnnormal")</el-button>
                    </el-form-item>
    <el-form-item style="width:130px;">
        <el-button style="margin-top: 2px;" size="mini" type="primary" v-on:click="unBindTray">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_unbindtray")</el-button>
    </el-form-item>
    <el-form-item style="width:130px;">
        <el-button style="margin-top: 2px;  " size="mini" type="primary" v-on:click="bindTray">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_bindtray")</el-button>
    </el-form-item>
                }
}
 
            
 
            @{
                if ("hcbh".Equals(ViewBag.PROJECT_CODE) || "tzlj".Equals(ViewBag.PROJECT_CODE))
                {
                    <el-form-item>
                        <el-button style="margin-top: 2px; margin-left: 10px" size="mini" type="primary" v-on:click="emptyTray">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_empty")</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-button style="margin-top: 2px; margin-left: 10px" size="mini" type="primary" v-on:click="fullTray">@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_full")</el-button>
                    </el-form-item>
                }
            }
 
        </el-form>
    </el-card>
    <hh-table v-bind:coloptions="outCols"
              v-bind:paging="false"
              v-bind:check="false"
              v-bind:where="where"
              v-bind:rowno="true"
              dh="110"
              url="@Url.Action("GetTrayItem")?locationCode=@ViewData["locationCode"]"
              ref="busslist"></hh-table>
</div>
@section scripts{
    <script>
        var outList = new Vue({
            data: {
                locationCode:"@ViewData["locationCode"]",
                //formData: {
                //    stockCode: "",
                //    opType: "",
                //    opNo: "",
                //    itemCode: "",
                //    itemName: "",
                //    model: ""
                //},
                where: {},
                outCols: [
                    { f: "CN_S_ITEM_CODE", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_itemcode")", w: 200 },
                    { f: "CN_S_ITEM_NAME", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_itemname")", w: 200 },
                    { f: "CN_S_MODEL", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_model")", w: 100 },
                    { f: "CN_S_LOT_NO", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_productbatch")", w: 100 },
                    { f: "CN_S_TRAY_CODE", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_traycode")", w: 120 },
                    //{ f: "CN_S_USE_STATE", n: "托盘状态", w: 80 },
                    { f: "CN_S_UNIQUE_CODE", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_bincode")", w: 120 },
                    //{ f: "CN_F_QUANTITY", n: "箱数", w: 50 },
                    { f: "CN_S_SERIAL_NO", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_weight")", w: 80 },
                    {
                        f: "CN_QTY", n: "@HH.WMS.WebUI.LanService.LanServiceDll.translate("cshtml_locationview_divisor")", w: 80,
                        format: function (row, column) {
                            var weight = parseFloat(row.CN_S_WEIGHT);
                            if (weight > 0) {
                                return Math.round(row.CN_S_SERIAL_NO / row.CN_S_WEIGHT);
                            } else {
                                return 0;
                            }
                        }
                    },
                    //{
                    //    f: "CN_S_MEASURE_UNIT", n: "单位", w: 50,
                    //    format: function (row, column) {
                    //        return "箱";
                    //    }
                    //},
                ]
 
                //{ f: "CN_S_ITEM_STATE", n: "物料状态", w: 80 },
                //{ f: "CN_S_PRODUCTION_BATCH", n: "生产批次", w: 120 }
            },
            methods: {
                //search: function () {
                //    this.$refs.busslist.loadData(this.locationCode);
                //}
                toNormal: function () {
                    var $this = this;
                    ajaxManage({
                        url: "@Url.Action("LocationToNormal")?locationCode=" + $this.locationCode + "&state=",
                        success: function (result) {
                            console.log(result);
                        }
                    });
                },
                unBindTray: function () {
                    var $this = this;
                    ajaxManage({
                        url: "@Url.Action("LocationToUnBind")?locationCode=" + $this.locationCode + "&state=",
                        success: function (result) {
                            console.log(result);
                        }
                });
                },
                bindTray: function () {
                    var $this = this;
                    ajaxManage({
                        url: "@Url.Action("LocationToBind")?locationCode=" + $this.locationCode + "&state=",
                        success: function (result) {
                            console.log(result);
                        }
                });
                },
                emptyTray: function () {
                        var $this = this;
                        ajaxManage({
                            url: "@Url.Action("UpdateUseState")?locationCode=" + $this.locationCode + "&state=空",
                            success: function (result) {
                                console.log(result);
                            }
                    });
                },
                fullTray: function () {
                    var $this = this;
                    ajaxManage({
                        url: "@Url.Action("UpdateUseState")?locationCode=" + $this.locationCode + "&state=满",
                        success: function (result) {
                            console.log(result);
                        }
                });
        }
            },
            el: '#list'
        });
    </script>
}