zhao
2021-06-11 98186752629a7bd38965418af84db382d90b9c07
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
@{
    ViewBag.Title = "ShowLocationContextZjhk";
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
}
 
<style type="text/css">
    .el-form-item__content{
        width: 100px!important;
    }
</style>
 
<div id="list" v-cloak>
    <el-card class="box-card">
        <el-form label-width="90px"  class="demo-ruleForm" v-bind:inline="true">
            <el-form-item label="货位号:">
                <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>
                            <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="toNormal">恢复正常</el-button>
                        </el-form-item>
                    }
                }
                else
                {
                    <el-form-item>
                        <el-button style="margin-top:2px;margin-left:50px" size="mini" type="primary" v-on:click="toNormal">恢复正常</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-button style="margin-top: 2px; margin-left: 50px" size="mini" type="primary" v-on:click="unBindTray">解绑托盘</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-button style="margin-top: 2px; margin-left: 50px" size="mini" type="primary" v-on:click="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;" size="mini" type="primary" v-on:click="emptyTray">空</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-button style="margin-top:2px;" size="mini" type="primary" v-on:click="fullTray">满</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: "物料编号", w: 200 },
                    { f: "CN_S_ITEM_NAME", n: "物料名称", w: 200 },
                    { f: "CN_S_MODEL", n: "规格型号", w: 110 },
                    { f: "CN_S_PRODUCTION_BATCH", n: "生产批次", w: 130 },
                    { f: "CN_S_TRAY_CODE", n: "托盘码", w: 140 },
                    //{ f: "CN_S_USE_STATE", n: "托盘状态", w: 80 },
                  //  { f: "CN_S_UNIQUE_CODE", n: "料箱码", w: 120 },
                    //{ f: "CN_F_QUANTITY", n: "箱数", w: 50 },
                   // { f: "CN_S_SERIAL_NO", n: "重量(KG)", w: 80 },
                    {
                        f: "CN_F_QUANTITY", n: "数量", w: 100//,
                        //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>
}