This commit is contained in:
liushuai
2019-08-03 11:05:12 +08:00
parent 18e4df60c4
commit 40712e0786
2 changed files with 326 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
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 searchgroupName(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_组件名称_查询数据_查询名称',
param: '组件流水号=' + num
}
})
}

View File

@@ -0,0 +1,291 @@
<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>
</el-row>
</el-card>
<el-card>
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div class="action"/>
<div v-if="file.suffix==='pdf'" class="icon"><svg-icon icon-class="pdf" /></div>
<div v-else-if="file.suffix==='docx'||file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc" /></div>
<div v-else-if="file.suffix==='xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel" /></div>
<div v-else-if="file.suffix==='pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt" /></div>
<div v-else-if="file.suffix==='jpg' || file.suffix === 'jpeg'|| file.suffix === 'png'" class="icon"><svg-icon icon-class="pic" /></div>
<div v-else class="icon"><svg-icon icon-class="file" /></div>
<a :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-card>
<el-card>
<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>
</el-card>
<el-card>
<el-button size="small" icon="el-icon-circle-plus" type="primary" style="float:left;margin: 7px 0 0 0" @click="addTable()">增加</el-button>
<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">
<template v-if="scope.row.edit">
<el-select v-model="scope.row.组件流水号" filterable clearable size="small" style="width: 100px" @change="groupChange(scope.row, scope.$index)">
<el-option
v-for="item in groupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<template v-else>
{{ scope.row.组号 }}
</template>
</template>
</el-table-column>
<el-table-column label="任务名称" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.任务名称" size="mini" style="width: 100%"/>
</template>
<template v-else>
{{ scope.row.任务名称 }}
</template>
</template>
</el-table-column>
<el-table-column label="计划工时" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.计划工时" size="mini" style="width: 100%"/>
</template>
<template v-else>
{{ scope.row.计划工时 }}
</template>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250px" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="primary" size="small" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="primary" size="small" @click="scope.row.edit=!scope.row.edit">取消</el-button>
<el-button type="delete" size="small" @click="deleteData">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>import { initProject, searchgroup, searchgroupName } from '@/api/Assembly/MakeAssemblyPlan'
// import { mapGetters } from 'vuex'
export default {
data() {
return {
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
groupNum: [],
tableData1: [],
tableData2: []
}
},
created() {
},
mounted() {
this.initProject()
},
methods: {
groupChange(row, index) {
if (row.组件流水号 !== '') {
searchgroupName(row.组件流水号).then(response => {
console.log(response.data)
this.tableData2[index].任务名称 = response.data[0].组件名称
})
}
},
// // 取消开始总装
// 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.groupNum = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
deleteData(row) {
}
// 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>