<!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>
|