加工顺序调整

This commit is contained in:
zhangdingyu
2019-01-10 16:19:35 +08:00
parent 2dc96f67d4
commit 80d303dbf7
2 changed files with 194 additions and 48 deletions

View File

@@ -1,13 +1,48 @@
import request from '@/utils/request' import request from '@/utils/request'
// 初始化 项目名称 // 初始化 工位
export function searchtable() { export function getMachine() {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '1', type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据', name: '车间生产管理工艺_加工顺序调整_查询工位'
param: '考核状态=5=int' }
})
}
export function searchtable(num, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'MES_机加工MES_记录零件待加工显示',
param: 'MES终端编号=' + num,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 调序
export function Order(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: 'MES_机加工MES_待加工区列表_排序',
param: 'MES终端编号=' + num1 + '&排序ID=' + num2 + '&排序类型=' + num3
}
})
}
// 调序权限
export function JurisdictionControl(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_加工顺序调整_更改权限',
param: 'MES终端号=' + num1 + '&变更类型=' + num2
} }
}) })
} }

View File

@@ -2,7 +2,18 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-button type="success" class="el-icon-search" size="small">查询</el-button> <span>工位号:</span>
<el-select v-model="MachineValue" size="small" filterable placeholder="工位号" style="width: 180px;">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="searchTable();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
<el-badge :value="num" :max="99" class="item">
<el-button size="small" type="text" @click="dialogFormVisible=true;Jurisdiction()">调序权限</el-button>
</el-badge>
</el-card> </el-card>
<el-card> <el-card>
@@ -12,58 +23,45 @@
align="center" align="center"
type="index" type="index"
width="50"/> width="50"/>
<el-table-column label="外协厂家名称" align="center" width="280px"> <el-table-column label="零件名称" align="center" width="310px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.外协厂家名称 }} {{ scope.row.零件名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="外协厂家简称" align="center" width="110px"> <el-table-column label="零件图号" align="center" width="330px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.外协厂家简称 }} {{ scope.row.零件图号_短 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="地址" align="center" width="280px"> <el-table-column label="待加工工序" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.地址 }} {{ scope.row.工艺名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="联系人" align="center" width="120px"> <el-table-column label="操作" width="300" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.联系人 }} <div>
</template> <el-button
</el-table-column> size="mini"
<el-table-column label="电话" align="center" width="140px"> icon="el-icon-arrow-up"
<template slot-scope="scope"> type="primary"
{{ scope.row.电话 }} @click="upOne(scope.row)"/>
</template> <el-button
</el-table-column> size="mini"
<el-table-column label="传真" align="center" width="120px"> icon="el-icon-arrow-down"
<template slot-scope="scope"> type="primary"
{{ scope.row.传真 }} @click="downOne(scope.row)"/>
</template> <el-button
</el-table-column> size="mini"
<el-table-column label="设备情况" align="center" width="230px"> icon="el-icon-upload2"
<template slot-scope="scope"> type="primary"
{{ scope.row.设备情况 }} @click="TOP(scope.row)"/>
</template> <el-button
</el-table-column> size="mini"
<el-table-column label="备注" align="center" width="150px"> icon="el-icon-download"
<template slot-scope="scope"> type="primary"
{{ scope.row.备注 }} @click="Down(scope.row)"/>
</template> </div>
</el-table-column>
<el-table-column label="操作" align="center" width="200px" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
class="el-icon-edit"
@click="handleChange1(scope.$index, scope.row, 'form');param = 1">编辑</el-button>
<el-button
size="mini"
type="danger"
class="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -80,14 +78,50 @@
</div> </div>
</el-card> </el-card>
<el-dialog :visible.sync="dialogFormVisible" width="60%">
<el-table :data="gridData" height="500" size="mini" border>
<el-table-column property="date" label="工位号" width="300" align="center">
<template slot-scope="scope">
{{ scope.row.MES终端号 }}
</template>
</el-table-column>
<el-table-column property="name" label="调序权限" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.调序权限===1" type="success" size="small">已开放</el-tag>
<el-tag v-else type="info" size="small">未开放</el-tag>
</template>
</el-table-column>
<el-table-column property="date" label="操作" align="center">
<template slot-scope="scope">
<el-button
v-if="scope.row.调序权限===0"
size="mini"
type="success"
@click="JurisdictionControl1(scope.row)">开启</el-button>
<el-button
v-if="scope.row.调序权限===1"
size="mini"
type="danger"
@click="JurisdictionControl2(scope.row)">关闭</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {} from '@/api/ManufacturingCenter/MachiningSequenceAdjustment' import { getMachine, searchtable, Order, JurisdictionControl } from '@/api/ManufacturingCenter/MachiningSequenceAdjustment'
export default { export default {
data() { data() {
return { return {
num: 0,
count: 0,
dialogFormVisible: false,
gridData: [],
Machine: [],
MachineValue: '',
loading0: false, loading0: false,
tableData: [], // 表格数据 tableData: [], // 表格数据
pageSize: 10, pageSize: 10,
@@ -96,8 +130,80 @@ export default {
} }
}, },
created() { created() {
this.Jurisdiction()
this.fetchData()
}, },
methods: { methods: {
// 初始化获取工位
fetchData() {
this.MachineValue = ''
this.Machine = []
getMachine().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].MES终端号,
value: response.data[i].MES终端号
})
}
})
},
searchTable() {
if (this.MachineValue !== '' && this.MachineValue !== null) {
this.loading0 = true
searchtable(this.MachineValue, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
}).then(() => {
this.loading0 = false
})
} else {
this.$message.error('请选择工位')
}
},
Jurisdiction() {
this.count = 0
getMachine().then(response => {
this.gridData = response.data
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].调序权限 === 1) { this.count = this.count + 1 }
}
this.num = this.count
})
},
JurisdictionControl1(row) {
JurisdictionControl(row.MES终端号, 1).then(response => {
this.Jurisdiction()
})
},
JurisdictionControl2(row) {
JurisdictionControl(row.MES终端号, 2).then(response => {
this.Jurisdiction()
})
},
// 上移
upOne(row) {
Order(this.MachineValue, row.工序流水号, '上移').then(response => {
this.searchTable()
})
},
// 下移
downOne(row) {
Order(this.MachineValue, row.工序流水号, '下移').then(response => {
this.searchTable()
})
},
// 置顶
TOP(row) {
Order(this.MachineValue, row.工序流水号, '置顶').then(response => {
this.searchTable()
})
},
// 置底
Down(row) {
Order(this.MachineValue, row.工序流水号, '置底').then(response => {
this.searchTable()
})
},
// 分页 // 分页
handleSizeChange(val) { handleSizeChange(val) {
this.pageCurrent = 1 this.pageCurrent = 1
@@ -119,4 +225,9 @@ export default {
.el-input{ .el-input{
width: 210px; width: 210px;
} }
.item {
float: right;
margin-top: 10px;
margin-right: 40px;
}
</style> </style>