电气装配
This commit is contained in:
87
src/api/Assembly/ElectricalAssembly.js
Normal file
87
src/api/Assembly/ElectricalAssembly.js
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
// 初始化机床项目
|
||||||
|
export function initProject() {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_项目名称_查询数据'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 组件查询
|
||||||
|
export function searchgroup(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_组件名称_查询数据',
|
||||||
|
param: '机床流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 机床查询
|
||||||
|
export function searchTable1(machineNumberValue, check2) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间装配管理_机床信息_查询数据',
|
||||||
|
param: '机床流水号_check=' + check2 + '&机床流水号=' + machineNumberValue
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 组件查询
|
||||||
|
export function searchTable2(machineNumberValue, check2, groupNumberValue, check3) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间管理_基本件采购_查询数据_电气',
|
||||||
|
param: '机床流水号_check=' + check2 + '&机床流水号=' + machineNumberValue + '&组件流水号_check=' + check3 + '&组件流水号=' + groupNumberValue
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 机床名称_机床状态_修改数据
|
||||||
|
export function MachineToolStateUpdate(machineNumberValue, check) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_机床名称_机床状态_修改数据',
|
||||||
|
param: '机床流水号=' + machineNumberValue + '&装配状态=' + check
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 机床名称_调试状态_修改数据
|
||||||
|
export function DebugStatusUpdate(machineNumberValue, check) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_机床名称_调试状态_修改数据',
|
||||||
|
param: '机床流水号=' + machineNumberValue + '&调试状态=' + check
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组件名称_组件状态_修改数据
|
||||||
|
export function ComponentStateUpdate(machineNumberValue, check) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: 'PDM_组件名称_组件状态_修改数据',
|
||||||
|
param: '组件流水号=' + machineNumberValue + '&组件是否完成=' + check
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
284
src/views/Assembly/ElectricalAssembly/index.vue
Normal file
284
src/views/Assembly/ElectricalAssembly/index.vue
Normal file
@@ -0,0 +1,284 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<el-row>
|
||||||
|
<span>机床编号:</span>
|
||||||
|
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable1()">
|
||||||
|
<el-option
|
||||||
|
v-for="item in machineNumber"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
<div style="float: left">{{ item.label }}</div>
|
||||||
|
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<!-- <span>组号:</span>-->
|
||||||
|
<!-- <el-select v-model="groupNumberValue" filterable placeholder="组号" size="small" clearable @change="searchTable2()">-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="item in groupNumber"-->
|
||||||
|
<!-- :key="item.value"-->
|
||||||
|
<!-- :label="item.label"-->
|
||||||
|
<!-- :value="item.value"/>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- <el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable1();searchTable2()">查询</el-button>-->
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<h3 style="text-align: center;">总装调试</h3>
|
||||||
|
<el-table :data="tableData1" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="200px">
|
||||||
|
<el-table-column label="项目名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.项目名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床编号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床数量" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!--<el-table-column label="操作" align="center" width="460px" fixed="right">-->
|
||||||
|
<!--<template slot-scope="scope">-->
|
||||||
|
<!--<el-button v-if="scope.row.装配状态===null || scope.row.装配状态===0" type="success" size="small" @click="handlestart_1(scope.row)">开始装配</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.装配状态===1" type="danger" size="small" @click="handleend_1(scope.row)">结束装配</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.装配状态===2" type="info" size="small" >装配完成</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.装配状态===1" plain size="small" @click="handleCancelStart_1(scope.row)">取消开始装配</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.装配状态===2" plain size="small" @click="handleCancelEnd_1(scope.row)">取消结束装配</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.调试状态===null || scope.row.调试状态===0" type="success" size="small" @click="handlestart_2(scope.row)">开始调试</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.调试状态===1" type="danger" size="small" @click="handleend_2(scope.row)">结束调试</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.调试状态===2" type="info" size="small" >调试完成</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.调试状态===1" plain size="small" @click="handleCancelStart_2(scope.row)">取消开始调试</el-button>-->
|
||||||
|
<!--<el-button v-if="scope.row.调试状态===2" plain size="small" @click="handleCancelEnd_2(scope.row)">取消结束调试</el-button>-->
|
||||||
|
<!--</template>-->
|
||||||
|
<!--</el-table-column>-->
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<h3 style="text-align: center;">部装</h3>
|
||||||
|
<el-table :data="tableData2" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="380px">
|
||||||
|
<el-table-column label="项目名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.项目名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床编号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床图号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="机床名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.机床名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="组号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="组件名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.组件名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="250px" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-if="scope.row.buttonStatus === 1" type="success" size="small" @click="handlestart_3(scope.row)">开始装配</el-button>
|
||||||
|
<el-button v-if="scope.row.buttonStatus === 2" type="danger" size="small" @click="handleend_3(scope.row)">结束装配</el-button>
|
||||||
|
<el-button v-if="scope.row.buttonStatus === 3" type="info" size="small" >装配完成</el-button>
|
||||||
|
<el-button v-if="scope.row.buttonStatus === 2" plain size="small" @click="handleCancelStart_3(scope.row)">取消开始装配</el-button>
|
||||||
|
<el-button v-if="scope.row.buttonStatus === 3" plain size="small" @click="handleCancelEnd_3(scope.row)">取消结束装配</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>import { initProject, searchgroup, searchTable1, searchTable2, MachineToolStateUpdate, DebugStatusUpdate, ComponentStateUpdate } from '@/api/Assembly/ElectricalAssembly'
|
||||||
|
// import { mapGetters } from 'vuex'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
machineNumberValue: '',
|
||||||
|
machineNumber: [],
|
||||||
|
groupNumberValue: '',
|
||||||
|
groupNumber: [],
|
||||||
|
tableData1: [],
|
||||||
|
tableData2: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initProject()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 取消开始总装
|
||||||
|
handleCancelStart_1(row) {
|
||||||
|
MachineToolStateUpdate(row.机床流水号, 3).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消结束总装
|
||||||
|
handleCancelEnd_1(row) {
|
||||||
|
MachineToolStateUpdate(row.机床流水号, 4).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消开始调试
|
||||||
|
handleCancelStart_2(row) {
|
||||||
|
DebugStatusUpdate(row.机床流水号, 3).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消结束调试
|
||||||
|
handleCancelEnd_2(row) {
|
||||||
|
DebugStatusUpdate(row.机床流水号, 4).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消开始部装
|
||||||
|
handleCancelStart_3(row) {
|
||||||
|
ComponentStateUpdate(row.组件流水号, 3).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
row.buttonStatus = 1
|
||||||
|
// this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消结束部装
|
||||||
|
handleCancelEnd_3(row) {
|
||||||
|
ComponentStateUpdate(row.组件流水号, 4).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
row.buttonStatus = 2
|
||||||
|
// this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initProject() {
|
||||||
|
initProject().then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.machineNumber.push({
|
||||||
|
label: response.data[i].机床图号,
|
||||||
|
name: response.data[i].项目名称,
|
||||||
|
value: response.data[i].机床流水号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
machineChange() {
|
||||||
|
this.groupNumberValue = ''
|
||||||
|
this.groupNumber = []
|
||||||
|
searchgroup(this.machineNumberValue).then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.groupNumber.push({
|
||||||
|
label: response.data[i].组号,
|
||||||
|
value: response.data[i].组件流水号
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
searchTable1() {
|
||||||
|
this.tableData1 = []
|
||||||
|
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
|
||||||
|
if (this.check2 === 0) {
|
||||||
|
this.tableData1 = []
|
||||||
|
this.tableData2 = []
|
||||||
|
} else {
|
||||||
|
searchTable1(this.machineNumberValue, this.check2).then(response => {
|
||||||
|
this.tableData1 = response.data
|
||||||
|
}).then(() => {
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
searchTable2() {
|
||||||
|
this.tableData2 = []
|
||||||
|
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) {
|
||||||
|
this.check2 = 1
|
||||||
|
searchTable2(this.machineNumberValue, this.check2).then(response => {
|
||||||
|
console.log(response.data, 111)
|
||||||
|
this.tableData2 = response.data
|
||||||
|
this.tableData2.map(v => {
|
||||||
|
if (v.组件是否完成 === null || v.组件是否完成 === 0) {
|
||||||
|
this.$set(v, 'buttonStatus', 1)
|
||||||
|
} else if (v.组件是否完成 === 1) {
|
||||||
|
this.$set(v, 'buttonStatus', 2)
|
||||||
|
} else {
|
||||||
|
this.$set(v, 'buttonStatus', 3)
|
||||||
|
}
|
||||||
|
return v
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else { this.check2 = 0 }
|
||||||
|
},
|
||||||
|
// 总装开始装配
|
||||||
|
handlestart_1(row) { // 弹出单据编辑
|
||||||
|
MachineToolStateUpdate(row.机床流水号, 1).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 总装结束装配
|
||||||
|
handleend_1(row) { // 弹出单据编辑
|
||||||
|
MachineToolStateUpdate(row.机床流水号, 2).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 总装开始调试
|
||||||
|
handlestart_2(row) { // 弹出单据编辑
|
||||||
|
DebugStatusUpdate(row.机床流水号, 1).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 总装结束调试
|
||||||
|
handleend_2(row) { // 弹出单据编辑
|
||||||
|
DebugStatusUpdate(row.机床流水号, 2).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 部装开始装配
|
||||||
|
handlestart_3(row) { // 弹出单据编辑
|
||||||
|
ComponentStateUpdate(row.组件流水号, 1).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
row.buttonStatus = 2
|
||||||
|
// this.searchTable2()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 部装结束装配
|
||||||
|
handleend_3(row) { // 弹出单据编辑
|
||||||
|
ComponentStateUpdate(row.组件流水号, 2).then(response => {
|
||||||
|
this.searchTable1()
|
||||||
|
row.buttonStatus = 3
|
||||||
|
// this.searchTable2()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user