自动化立体仓库 - WMS系统
*
pjb
3 天以前 053ac6f96d5fbbf3580f683dea33be8ca0f69554
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
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <title>手动站位转移</title>
    <link rel="stylesheet" href="../../static/css/element.css">
    <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../../static/js/common.js"></script>
    <script type="text/javascript" src="../../static/js/vue.min.js"></script>
    <script type="text/javascript" src="../../static/js/element.js"></script>
</head>
 
<body>
    <div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
        <div style="width: 100%;display: flex;justify-content: center;">
            <div style="width: 100%;margin-right: 10px;">
                <el-card class="box-card">
                    <div slot="header" class="clearfix">
                        <span>手动站位转移</span>
                    </div>
                    <div>
                        <el-form :model="formParam" label-position="top" :inline="true" class="demo-form-inline">
                            <el-form-item label="源站">
                                <el-input v-model="formParam.sourceStaNo" placeholder="源站"></el-input>
                            </el-form-item>
                            <el-form-item label="目标站">
                                <el-input v-model="formParam.staNo" placeholder="目标站"></el-input>
                            </el-form-item>
                        </el-form>
                        <div>
                            <el-button @click="requestOperate('add')" type="primary">添加</el-button>
                        </div>
                    </div>
                </el-card>
            </div>
        </div>
 
        <div style="width: 100%;margin-top: 10px;">
            <el-table ref="singleTable" :data="tableData" highlight-current-row @row-click="handleRowClick"
                max-height="450" style="width: 100%">
                <el-table-column property="wrkNo" label="工作号">
                </el-table-column>
                <el-table-column property="wrkSts$" label="工作状态">
                </el-table-column>
                <el-table-column property="ioType$" label="入出库类型">
                </el-table-column>
                <el-table-column property="sourceStaNo" label="源站">
                </el-table-column>
                <el-table-column property="staNo" label="目标站">
                </el-table-column>
                <el-table-column property="ioTime$" label="工作时间">
                </el-table-column>
            </el-table>
        </div>
 
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                tableData: [],
                currentRow: null,
                currentTitle: "未选择设备",
                currentIndex: null,
                formParam: {
                    sourceStaNo: null,
                    staNo: null
                }
            },
            created() {
                this.init()
            },
            watch: {
 
            },
            methods: {
                init() {
                    this.getTableData()
 
                    setInterval(() => {
                        this.getTableData()
                    }, 1000)
                },
                handleRowClick(row, col, event) {
                    const index = this.tableData.indexOf(row)
                    this.currentRow = row;
                    this.currentIndex = index
                    this.currentTitle = row.devNo + "站点"
                    
                    this.formParam.devNo = row.devNo
                    this.formParam.workNo = row.workNo
                    this.formParam.staNo = row.staNo
                },
                getTableData() {
                    let that = this;
                    $.ajax({
                        url: baseUrl + "/wrkMast/ioType120/list/auth",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: {},
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
                        method: 'GET',
                        success: function (res) {
                            that.tableData = res.data
                        }
                    });
                },
                requestOperate(method) {
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/wrkMast/ioType120/"+method,
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: this.formParam,
                            method: 'POST',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
 
                }
            }
        })
    </script>
</body>
 
</html>