添加营销系统模块

This commit is contained in:
hedekun
2018-11-08 08:39:42 +08:00
commit f7eb22e5bb
181 changed files with 35426 additions and 0 deletions

View File

@@ -0,0 +1,399 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>项目名称:</span>
<el-select
v-model="entryNameValue"
:remote-method="remoteMethod"
placeholder="项目名称"
style="margin-right: 10px"
size="small"
clearable
filterable
remote
@change="projectChange"
@focus="projectInit">
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="machineNameValue" placeholder="机床号" style="margin-right: 10px" size="small" clearable @change="machineChange">
<el-option
v-for="item in machineName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="total1=0;pageSize1 = 10;pageCurrent1 = 1;searchData1()">查询</el-button>
</el-row>
</el-card>
<el-card style="margin-top: 15px">
<el-table
v-loading="listLoading2"
:data="tableData2"
style="width: 100%;max-height: 400px;"
height="400"
highlight-current-row
border
@row-click="searchSpareParts">
<el-table-column align="center" label="机床流水号">
<template slot-scope="scope">
{{ scope.row.机床流水号 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床图号">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="停产零件种类">
<template slot-scope="scope">
{{ scope.row.停产零件种类 }}
</template>
</el-table-column>
<el-table-column align="center" label="停产零件数量">
<template slot-scope="scope">
{{ scope.row.停产零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="已加工工时">
<template slot-scope="scope">
{{ scope.row.已加工工时 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card style="margin-top: 15px">
<el-row>
<span>组号:</span>
<el-select v-model="GroupNumValue" placeholder="组号" style="margin-right: 10px" size="small" clearable>
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件图号:</span>
<el-input v-model="PartDrawingNumber" placeholder="零件图号" size="small" clearable style="width:200px"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="total=0;pageSize = 10;pageCurrent = 1;searchData()">查询</el-button>
</el-row>
</el-card>
<el-card style="margin-top: 15px">
<el-table
v-loading="listLoading"
:data="tableData"
style="width: 100%;max-height: 400px;"
height="400"
highlight-current-row
border
@row-click="searchProcedure">
<el-table-column align="center" label="组号">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件图号">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件数量">
<template slot-scope="scope">
{{ scope.row.投产数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="停产时间">
<template slot-scope="scope">
{{ scope.row.停产时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="停产原因">
<template slot-scope="scope">
{{ scope.row.停产原因 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工工时">
<template slot-scope="scope">
{{ scope.row.加工工时 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card style="margin-top: 15px">
<el-table
v-loading="listLoading1"
:data="tableData1"
style="width: 100%;max-height: 400px;"
height="400"
highlight-current-row
border>
<el-table-column align="center" label="工序顺序" width="100">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺名称" width="150">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺要求">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
<el-table-column align="center" label="单件定额工时" width="150">
<template slot-scope="scope">
{{ scope.row.单件定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="准结定额工时" width="130">
<template slot-scope="scope">
{{ scope.row.准结定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺是否完成" width="130">
<template slot-scope="scope">
{{ scope.row.工序状态 }}
</template>
</el-table-column>
<el-table-column align="center" label="工时" width="80">
<template slot-scope="scope">
{{ scope.row.工序工时 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initProject, searchMachine, searchGroupNum, searchTable, searchTable1, searchTable2 } from '@/api/ManufacturingCenter/DiscardedPartsInquiry'
export default {
data() {
return {
pageCurrent: 1,
pageSize: 10,
total: 0,
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
list: [],
check3: '',
PartDrawingNumber: '',
remoteLoading: false,
listLoading: false,
listLoading1: false,
listLoading2: false,
entryName: [],
check: '',
entryNameValue: '', // 项目名称
entryValue: '', // 项目流水号
machineName: [],
check1: '',
machineNameValue: '', // 机床图号
machineValue: '', // 机床图号
GroupNum: [],
check2: '',
GroupNumValue: '', // 组号
tableData: [],
tableData1: [],
tableData2: []
}
},
created() {
this.projectInit()
},
mounted() {
this.getList()
},
methods: {
getList() {
this.list = []
initProject().then(response => { // 初始化项目名称
for (let i = 0; i < response.data.length; i++) {
this.list.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
remoteMethod(query) {
if (query !== '') {
setTimeout(() => {
this.entryName = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
})
}, 1000)
} else {
this.entryName = []
}
},
projectInit() { // 初始化项目
this.entryName = []
initProject().then(response => { // 初始化项目名称
for (let i = 0; i < response.data.length; i++) {
this.entryName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
projectChange() {
this.machineName = []
this.machineNameValue = ''
this.GroupNum = []
this.GroupNumValue = ''
searchMachine(this.entryNameValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineName.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
machineChange() {
this.GroupNum = []
this.GroupNumValue = ''
searchGroupNum(this.machineNameValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
searchData1() {
if (this.entryNameValue !== '' && this.entryNameValue !== null) {
this.listLoading2 = true
if (this.entryNameValue !== '' && this.entryNameValue !== null) {
this.check = 1
} else {
this.check = 0
}
if (this.machineNameValue !== '' && this.machineNameValue !== null) {
this.check1 = 1
} else {
this.check1 = 0
}
searchTable2(this.check, this.entryNameValue, this.check1, this.machineNameValue, this.pageCurrent1, this.pageSize1).then(response => {
console.log(response)
this.tableData2 = response.data.rows
this.total1 = response.data.total
this.listLoading2 = false
})
} else {
this.$message.warning('请选择项目')
}
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchData1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchData1()
},
searchSpareParts(row) {
this.tableData1 = []
this.machineValue = row.机床流水号
this.initGroup()
},
initGroup() {
this.GroupNum = []
this.GroupNumValue = ''
searchGroupNum(this.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
this.searchData()
},
searchData() {
this.listLoading = true
this.tableData1 = []
if (this.GroupNumValue !== '' && this.GroupNumValue !== null) {
this.check2 = 1
} else {
this.check2 = 0
}
if (this.PartDrawingNumber !== '' && this.PartDrawingNumber !== null) {
this.check3 = 1
} else {
this.check3 = 0
}
searchTable(this.entryNameValue, this.machineValue, this.check2, this.GroupNumValue, this.check3, this.PartDrawingNumber, this.pageCurrent, this.pageSize).then(response => {
console.log(response)
this.tableData = response.data.rows
this.total = response.data.total
this.listLoading = false
})
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.searchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchData()
},
searchProcedure(row) {
this.listLoading1 = true
searchTable1(row.工艺计划流水号).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].工序状态 === 4) {
response.data[i].工序状态 = '完成'
} else {
response.data[i].工序状态 = '未完成'
}
}
this.tableData1 = response.data
this.listLoading1 = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,468 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select
v-model="entryNameValue"
:remote-method="remoteMethod"
placeholder="项目名称"
style="width:200px"
size="small"
clearable
filterable
remote
@change="empty">
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床号:</span>
<el-input v-model="machineToolNumber" placeholder="机床号" size="small" clearable style="width:200px" @change="empty1" @dblclick.native="SearchMachine"/>
<span>组号:</span>
<el-input v-model="groupNumber" placeholder="组号" size="small" clearable style="width:200px" @dblclick.native="searchGroupList"/>
<span>:</span>
<el-date-picker
v-model="year"
type="year"
size="small"
format="yyyy"
value-format="yyyy"
placeholder="选择年"/>
<span>:</span>
<el-select v-model="month" placeholder="选择月" size="small" clearable style="width:180px">
<el-option
v-for="item in monthes"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>入库时间:</span>
<el-date-picker
v-model="time"
type="date"
size="small"
style="margin-top: 20px;width: 200px"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-top: 15px;margin-left: 10px" @click="searchData">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="loading"
:data="tableData"
style="width: 100%;max-height: 600px"
height="600"
highlight-current-row
border>
<el-table-column align="center" label="序号" type="index" width="60"/>
<el-table-column align="center" label="零件图号">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="投产数量">
<template slot-scope="scope">
{{ scope.row.投产数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="入库数量">
<template slot-scope="scope">
{{ scope.row.入库数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="类别">
<template slot-scope="scope">
{{ scope.row.类别 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划完成时间">
<template slot-scope="scope">
{{ scope.row.计划完成时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="入库时间">
<template slot-scope="scope">
{{ scope.row.入库时间 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible2" title="选择机床" center style="min-height: 300px">
<el-table
:data="tableData6"
style="width:100%;max-height: 300px;display: inline-block"
height="300"
highlight-current-row
border
@row-click="selectMachine">
<el-table-column align="center" label="机床图号">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床名称">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床开始时间">
<template slot-scope="scope">
{{ scope.row.机床开始时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床结束时间">
<template slot-scope="scope">
{{ scope.row.机床结束时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="工位属性">
<template slot-scope="scope">
{{ scope.row.工位属性 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床主管">
<template slot-scope="scope">
{{ scope.row.机床主管 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitName">提交</el-button>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="选择组号" center style="min-height: 300px">
<el-table
:data="tableData7"
style="width:100%;max-height: 300px;display: inline-block"
height="300"
highlight-current-row
border
@row-click="selectGroup">
<el-table-column align="center" label="机床图号">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床名称">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组件名称">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="组件介绍">
<template slot-scope="scope">
{{ scope.row.组件介绍 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize2"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitGroup">提交</el-button>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchTable, searchmachine, searchgroup } from '@/api/ManufacturingCenter/GroupMatching'
export default {
data() {
return {
entryNameValue: null, // 项目流水号
entryName: [], // 项目数组
machineToolNumber: '', // 机床图号
machineNumber: '',
machine: null, // 机床流水号
groupNumber: '', // 组号
groupNumber1: '',
groupNum: null, // 组件流水号
partNumber: '', // 零件号
num: null,
pageCurrent: 1,
pageSize: 10,
pageCurrent1: 1,
pageSize1: 10,
pageCurrent2: 1,
pageSize2: 10,
tableData7: [],
tableData6: [],
tableData: [],
state: null,
total: null,
total1: null,
total2: null,
title: '',
dialogFormVisible2: false,
dialogFormVisible3: false,
List: [],
check: null,
check1: null,
check2: null,
check3: null,
check4: null,
check5: null,
month: null,
year: null,
time: '',
loading: false,
monthes: [{
value: 1,
label: '1'
}, {
value: 2,
label: '2'
}, {
value: 3,
label: '3'
}, {
value: 4,
label: '4'
}, {
value: 5,
label: '5'
}, {
value: 6,
label: '6'
}, {
value: 7,
label: '7'
}, {
value: 8,
label: '8'
}, {
value: 9,
label: '9'
}, {
value: 10,
label: '10'
}, {
value: 11,
label: '11'
}, {
value: 12,
label: '12'
}]
}
},
created() {
},
mounted() {
this.getList()
},
methods: {
searchData() {
this.loading = true
if (this.entryNameValue !== null && this.entryNameValue !== '') {
if (this.entryNameValue !== null && this.entryNameValue !== '') {
this.check = 1
} else {
this.check = 0
}
if (this.machineToolNumber !== '') {
this.check1 = 1
} else {
this.check1 = 0
}
if (this.groupNumber !== '') {
this.check2 = 1
} else {
this.check2 = 0
}
if (this.year !== null && this.year !== '') {
this.check3 = 1
} else {
this.check3 = 0
}
if (this.month !== null && this.month !== '') {
this.check4 = 1
} else {
this.check4 = 0
}
if (this.time !== '' && this.time !== null) {
this.check5 = 1
} else {
this.check5 = 0
}
searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.year, this.check4, this.month, this.check5, this.time, this.pageCurrent, this.pageSize).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].入库时间 !== null) {
response.data.rows[i].入库时间 = response.data.rows[i].入库时间.split(' ', 2)[0]
}
if (response.data.rows[i].计划完成时间 !== null) {
response.data.rows[i].计划完成时间 = response.data.rows[i].计划完成时间.split(' ', 2)[0]
}
}
this.tableData = response.data.rows
this.total = parseInt(response.data.total)
this.loading = false
})
} else {
this.loading = false
this.$message.warning('请先选择项目')
}
},
getList() { // 初始化项目名称
this.list = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.list.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
remoteMethod(query) {
if (query !== '') {
setTimeout(() => {
this.entryName = this.list.filter(item => {
if (item.label !== null) {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
}
})
}, 1000)
} else {
this.entryName = []
}
},
empty() {
this.machineToolNumber = ''
this.groupNumber = ''
},
SearchMachine() { // 查询机床
if (this.entryNameValue !== null && this.entryNameValue !== '') {
this.dialogFormVisible2 = true
this.check6 = 1
searchmachine(this.entryNameValue, this.check6, this.pageCurrent1, this.pageSize1).then(response => {
for (let i = 0; i < response.data.result; i++) {
if (response.data.result[i].机床开始时间 !== '') {
response.data.result[i].机床开始时间 = response.data.result[i].机床开始时间.substr(0, 10)
}
if (response.data.result[i].机床结束时间 !== '') {
response.data.result[i].机床结束时间 = response.data.result[i].机床结束时间.substr(0, 10)
}
}
this.tableData6 = response.data.result
this.total1 = parseInt(response.data.output[0].ItemCount)
})
} else {
this.$message.warning('请先选择项目')
}
},
selectMachine(row) { // 选择机床号
this.machine = row.机床流水号
this.machineNumber = row.机床图号
},
submitName() { // 提交机床号
this.machineToolNumber = this.machineNumber
this.dialogFormVisible2 = false
},
empty1() {
this.groupNumber = ''
},
searchGroupList() { // 查询组号
if (this.machineToolNumber !== '') {
this.dialogFormVisible3 = true
searchgroup(this.machine, this.pageCurrent2, this.pageSize2).then(response => {
this.tableData7 = response.data.result
this.total2 = parseInt(response.data.output[0].ItemCount)
})
} else {
this.$message.warning('请先选择机床')
}
},
selectGroup(row) { // 选择组号
this.groupNumber1 = row.组号
this.groupNum = row.组件流水号
},
submitGroup() { // 提交组号
this.groupNumber = this.groupNumber1
this.dialogFormVisible3 = false
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchData()
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.SearchMachine()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.SearchMachine()
},
handleSizeChange3(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.searchGroupList()
},
handleCurrentChange3(val) {
this.pageCurrent2 = val
this.searchGroupList()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,968 @@
<template>
<div class="app-container">
<el-card>
<el-col :span="12">
<el-form label-width="270px" label-position="right" class="Time">
<el-form-item>
<el-radio-group v-model="radio" size="small">
<el-radio :label="0">正常件投产</el-radio>
<el-radio :label="1">整改件投产</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="项目名称">
<el-select v-model="entryNameValue" filterable size="small" style="margin-bottom:10px" placeholder="项目名称" @change="typeChange()">
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="机床号">
<el-select v-model="toolNumValue" filterable size="small" placeholder="机床号" style="margin-bottom:10px" @change="typeChange1()">
<el-option
v-for="item in toolNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="机床组号">
<el-select v-model="NumValue" filterable size="small" style="margin-bottom:10px" placeholder="机床组号">
<el-option
v-for="item in Num"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="total = 0;pageSize = 10;pageList = 1;getTable()">查询</el-button>
</el-form-item>
</el-form>
</el-col>
<el-col style="width: 530px">
<el-form label-width="70px" label-position="left" class="Time">
<el-form-item label="计划下达">
<el-col :span="11">
<el-date-picker v-model="time_planStart" size="small" type="datetime" class="time" readonly/>
</el-col>
<el-col :span="1" class="line"></el-col>
<el-col :span="11">
<el-date-picker v-model="time_planFinish" size="small" type="datetime" class="time" readonly/>
</el-col>
</el-form-item>
<el-form-item label="工艺">
<el-col :span="11">
<el-date-picker v-model="time_gongyiStart" size="small" type="datetime" class="time" readonly/>
</el-col>
<el-col :span="1" class="line"></el-col>
<el-col :span="11">
<el-date-picker v-model="time_gongyiFinish" size="small" type="datetime" class="time" readonly/>
</el-col>
</el-form-item>
<el-form-item label="定额">
<el-col :span="11">
<el-date-picker v-model="time_dingeStart" size="small" type="datetime" class="time" readonly/>
</el-col>
<el-col :span="1" class="line"></el-col>
<el-col :span="11">
<el-date-picker v-model="time_dingeFinish" size="small" type="datetime" class="time" readonly/>
</el-col>
</el-form-item>
<el-form-item label="计划平衡">
<el-col :span="11">
<el-date-picker v-model="time_planpinghengStart" size="small" type="datetime" class="time" readonly/>
</el-col>
<el-col :span="1" class="line"></el-col>
<el-col :span="11">
<el-date-picker v-model="time_planpinghengFinish" size="small" type="datetime" class="time" readonly/>
</el-col>
</el-form-item>
<el-form-item label="加工">
<el-col :span="11">
<el-date-picker v-model="time_machiningStart" size="small" type="datetime" class="time" readonly/>
</el-col>
<el-col :span="1" class="line"></el-col>
<el-col :span="11">
<el-date-picker v-model="time_machiningFinish" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="margin-bottom:20px;width:200px"/>
</el-col>
</el-form-item>
</el-form>
</el-col>
</el-card>
<el-card>
<div>
<el-table
v-loading="listLoading"
:data="tableData"
border
style="width: 100%;max-height: 400px"
height="400"
@selection-change="handleSelectionChange"
@row-click="handleCurrentChange1">
<el-table-column
type="selection"
align="center"
width="35"/>
<el-table-column label="零件号" align="center" min-width="220">
<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="100">
<template slot-scope="scope">
{{ scope.row.零件类型名称 }}
</template>
</el-table-column>
<el-table-column label="是否外协" align="center" width="90">
<template slot-scope="scope">
<el-checkbox v-model="tableData[scope.$index].checked_waixie" @change="gaibianwaixie(scope.$index, scope.row)"/>
外协
</template>
</el-table-column>
<el-table-column label="是否带料" align="center" width="90">
<template slot-scope="scope">
<el-checkbox :disabled="!tableData[scope.$index].checked_waixie" v-model="tableData[scope.$index].checked_dailiao"/>
带料
</template>
</el-table-column>
<el-table-column label="是否着急" align="center" width="90">
<template slot-scope="scope">
<el-checkbox v-model="tableData[scope.$index].checked_zhaoji"/>
着急
</template>
</el-table-column>
<!--<el-table-column prop="name" label="打回原因" width="170" align="center">-->
<!--<template slot-scope="scope">-->
<!--<el-input v-model="tableData[scope.$index].name" type="textarea" :rows="1" style="width:150px" placeholder="原因">-->
<!--</el-input>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="操作" width="300px" fixed="right" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="handleEdit(scope.$index, scope.row, 'form')">分批投产</el-button>
<el-button
size="mini"
type="primary"
@click="handleDele(scope.$index, scope.row, 'form1')">打回档案</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
style="width:50%;display:inline-block;"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
<el-checkbox v-model="checked_baitu" style="margin-top:0px">是否白图</el-checkbox>
<el-checkbox v-model="checked_gaonandu">是否高难度</el-checkbox>
<el-button type="primary" size="small" style="float:right;margin-top:10px" @click="production">投产</el-button>
</div>
<!--<el-row>-->
<!--<el-checkbox v-model="checked_baitu" style="margin-top:20px">是否白图</el-checkbox>-->
<!--<el-checkbox v-model="checked_gaonandu">是否高难度</el-checkbox>-->
<!--<el-button type="primary" size="small" @click="production" style="float:right;margin-top:10px">投产</el-button>-->
<!--</el-row>-->
</div>
</el-card>
<el-card>
<div>
<el-table
v-loading="listLoading1"
:data="tableData1"
stripe
size="mini"
tooltip-effect="dark"
style="width: 100%">
<el-table-column
label="零件号">
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
</el-table-column>
<el-table-column
label="零件名称">
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
</el-table-column>
<el-table-column
label="投产总数量">
<template slot-scope="scope">{{ scope.row.投产总数量 }}</template>
</el-table-column>
<el-table-column
label="未投产数量">
<template slot-scope="scope">{{ scope.row.未投产数量 }}</template>
</el-table-column>
<el-table-column
label="投产批次">
<template slot-scope="scope">{{ scope.row.投产批次 }}</template>
</el-table-column>
<el-table-column
label="批次数量">
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
</el-table-column>
<el-table-column
label="是否外协">
<template slot-scope="scope">{{ scope.row.是否外协 }}</template>
</el-table-column>
<el-table-column
label="是否带料">
<template slot-scope="scope">{{ scope.row.是否带料 }}</template>
</el-table-column>
<el-table-column
label="机加工开始时间">
<template slot-scope="scope">{{ scope.row.机加工开始时间 }}</template>
</el-table-column>
<el-table-column
label="机加工结束时间">
<template slot-scope="scope">{{ scope.row.机加工结束时间 }}</template>
</el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="scope">
<el-button
size="mini"
fixed="rihgt"
type="primary"
icon="el-icon-edit"
@click="handleEdit1(tableData1, scope.$index, scope.row, 'form')">编辑</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="currentPage3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible2" title="打回档案" center width="28%">
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="打回原因" prop="reason">
<el-input v-model="form1.reason" size="small" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff1('form1')">取消</el-button>
<el-button size="small" type="primary" @click="submit1('form1')"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center width="24%">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="零件图号" prop="PDnumber">
<el-input v-model="form.PDnumber" size="small" readonly style="width:250px" />
</el-form-item>
<el-form-item label="投产总数量" prop="quantity">
<el-input v-model="form.quantity" size="small" readonly style="width:250px" />
</el-form-item>
<el-form-item label="未投产数量" prop="unputquantity">
<el-input v-model="form.unputquantity" size="small" readonly style="width:250px"/>
</el-form-item>
<el-form-item label="投产批次" prop="productionBatch">
<el-input v-model="form.productionBatch" size="small" readonly style="width:250px" placeholder="请输入投产批次"/>
</el-form-item>
<el-form-item v-show="temp === 1" label="批次数量1" prop="batchQuantity">
<el-input-number v-model="form.batchQuantity" :min="1" :max="parseInt(form.unputquantity)" size="small" style="width:250px" label="批次数量"/>
</el-form-item>
<el-form-item v-show="temp === 2" label="批次数量2" prop="batchQuantity2">
<el-input-number v-model="form.batchQuantity2" :min="1" :max="parseInt(maxmax)" size="small" style="width:250px" label="批次数量"/>
</el-form-item>
<el-form-item label="加工开始时间">
<el-date-picker
v-model="form.startDate_F"
size="small"
readonly
type="date"
value-format="yyyy-MM-dd"
style="top: 1px;width:250px"
placeholder="选择开始日期"/>
</el-form-item>
<el-form-item label="加工结束时间" prop="endDate_F">
<el-date-picker
:readonly="readonly"
v-model="form.endDate_F"
size="small"
type="date"
value-format="yyyy-MM-dd"
style="top: 1px;width:250px"
placeholder="选择结束日期"/>
</el-form-item>
<el-row>
<el-col :span="14"/>
<el-form-item >
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button size="small" type="primary" @click="submit('form')"> </el-button>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele } from '@/api/ManufacturingCenter/InitialProduction'
import { mapGetters } from 'vuex'
export default {
data() {
return {
maxmax: '',
clearTable: 0,
readonly: true,
gongyirenwuzhuangtai: '',
count: 0, // 表单计数器
count2: 0,
count3: 0,
midcode: 0, // 查询表2的中间变量
shijiancuo: 0,
shijiancuo1: 0,
jieguo: 0,
value: '',
title: null,
temp: 0,
ComponentflowNumber: '', // 组件零件基本件流水号
TypeflowNumber: '',
dataType: '', // 数据类型
productionQuantity: '', // 投产总数量
checked_waixie1: '',
MaterialflowNumber: '', // 材料流水号
checked_zhaoji1: '',
time_planStart: '',
time_planFinish: '',
time_gongyiFinish: '',
time_gongyiStart: '',
time_dingeFinish: '',
time_dingeStart: '',
time_planpinghengFinish: '',
time_planpinghengStart: '',
time_machiningFinish: '',
time_machiningStart: '',
form: { // 修改表单
PDnumber: '',
quantity: '',
unputquantity: '',
productionBatch: '',
batchQuantity: '',
batchQuantity2: '',
startDate_F: '',
endDate_F: ''
},
form1: {
reason: ''
},
rules: { // 表单验证规则
batchQuantity: [{ required: true, message: '请输入批次数量', trigger: 'blur' }],
// startDate_F: [{ required: true, message: '请选择加工开始时间', trigger: 'change' }],
endDate_F: [{ required: true, message: '请选择加工结束时间', trigger: 'change' }],
reason: [{ required: true, message: '请输入打回原因', trigger: 'blur' }]
},
// value1: '',
result: 0,
dialogFormVisible1: false,
dialogFormVisible2: false,
date: '',
a: false,
multipleSelection: [],
checked_baitu: false,
checked_gaonandu: false,
tableData: [], // 表1
tableData1: [], // 表2
entryNameValue: '',
entryName: [], // 项目名称
toolNumValue: '',
toolNum: [], // 机床号
NumValue: '',
Num: [], // 机床后什么号
liushuihao: '',
gongyijihua: '',
radio: 0, // 第一组
total: 0, // 总条数
pageSize: 10, // 每页显示条数
pageList: 1, // 后台获取页
currentPage: 1, // 显示当前页
total3: 0, // 总条数
pageSize3: 10, // 每页显示条数
pageList3: 1, // 后台获取页
currentPage3: 1, // 显示当前页
listLoading: false,
listLoading1: false
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.fetchData()
this.getCurrentTime()
this.getNowTime()
},
methods: {
gaibianwaixie(index, row) {
if (row.checked_waixie === false) {
row.checked_dailiao = false
}
},
select(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row)
})
} else {
this.$refs.multipleTable.clearSelection()
}
},
getCurrentTime() {
this.time_planFinish = this.getTime0(0)
this.time_gongyiFinish = this.getTime0(2)
this.time_gongyiStart = this.getTime0(0)
this.time_dingeFinish = this.getTime0(2)
this.time_dingeStart = this.getTime0(2)
this.time_planpinghengFinish = this.getTime0(3)
this.time_planpinghengStart = this.getTime0(2)
this.time_machiningStart = this.getTime0(3)
const _this = this
setTimeout(() => {
_this.getCurrentTime()
}, 1000)
},
getTime0(num) {
var date0 = new Date()
var date = new Date(date0.getTime() + num * 24 * 60 * 60 * 1000)
var month = this.zeroFill(date.getMonth() + 1)
var day = this.zeroFill(date.getDate())
var hour = this.zeroFill(date.getHours())
var minute = this.zeroFill(date.getMinutes())
var second = this.zeroFill(date.getSeconds())
return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
},
getNowTime() {
var date = new Date()
var month = this.zeroFill(date.getMonth() + 1)
var day = this.zeroFill(date.getDate())
var hour = this.zeroFill(date.getHours())
var minute = this.zeroFill(date.getMinutes())
var second = this.zeroFill(date.getSeconds())
this.time_planStart = date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
},
zeroFill(i) {
if (i >= 0 && i <= 9) {
return '0' + i
} else {
return i
}
},
// 初始化获取项目名称
fetchData() {
getEntryNameValue().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.entryName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
typeChange() {
this.toolNumValue = ''
this.toolNum = []
this.NumValue = ''
this.Num = []
getToolNum(this.entryNameValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
typeChange1() {
this.NumValue = ''
this.Num = []
getNum(this.toolNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Num.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
getTable() {
if (this.NumValue === '') {
this.$message.error('请选择机床组号')
} else {
this.listLoading = true
this.tableData = []
this.tableData1 = []
getTable(this.NumValue, this.pageList, this.pageSize).then(response => {
this.total = parseInt(response.data.total)
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
零件图号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
投产总数量: response.data.rows[i].投产总数量,
最大投产批次: response.data.rows[i].最大投产批次,
已投产数量: response.data.rows[i].已投产数量,
未投产数量: response.data.rows[i].未投产数量,
零件类型名称: response.data.rows[i].零件类型名称,
组件零件基本件流水号: response.data.rows[i].组件零件基本件流水号,
投产类型流水号: response.data.rows[i].投产类型流水号,
数据类型: response.data.rows[i].数据类型,
材料流水号: response.data.rows[i].材料流水号,
checked_dailiao: false,
checked_waixie: false,
checked_zhaoji: false
})
}
}).then(() => {
this.listLoading = false
})
}
},
// 点击Table查询设备信息
handleCurrentChange1(row) {
this.tableData1 = []
this.listLoading1 = true
getTable1(row.组件零件基本件流水号, this.pageList3, this.pageSize3).then(response => {
if (response.data.total !== 0) {
this.gongyirenwuzhuangtai = response.data.rows[0].工艺任务分配状态
this.midcode = row.组件零件基本件流水号
this.total3 = parseInt(response.data.total)
this.tableData1 = response.data.rows
}
this.listLoading1 = false
})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
// 打开分批投产
handleEdit(index, row, formName) {
this.temp = 1
this.title = '分批投产'
this.readonly = true
this.midcode = row.组件零件基本件流水号
if (this.time_machiningFinish === '') {
this.$message.error('请选择加工结束时间')
} else {
this.count = this.count + 1
if (this.count !== 1) {
this.$refs[formName].resetFields()
}
this.form.endDate_F = this.time_machiningFinish
this.form.PDnumber = row.零件图号
this.form.quantity = row.投产总数量
if (row.未投产数量 !== '' && row.未投产数量 !== null) {
this.form.unputquantity = row.未投产数量
} else {
this.form.unputquantity = row.投产总数量
}
if (row.最大投产批次 !== '' && row.最大投产批次 !== null) {
this.form.productionBatch = parseInt(row.最大投产批次) + 1
} else {
this.form.productionBatch = 1
}
this.form.startDate_F = this.time_machiningStart
this.ComponentflowNumber = row.组件零件基本件流水号
this.TypeflowNumber = row.投产类型流水号
this.dataType = row.数据类型
this.productionQuantity = row.投产总数量
this.checked_waixie1 = row.checked_waixie
this.MaterialflowNumber = row.材料流水号
this.checked_zhaoji1 = row.checked_zhaoji
this.dialogFormVisible1 = true
}
},
// 打开编辑
handleEdit1(tableData, index, row, formName) {
let Sum = null
this.temp = 2
this.title = '编辑'
this.readonly = false
this.count3 = this.count3 + 1
if (this.count3 !== 1) {
this.$refs[formName].resetFields()
}
this.form.endDate_F = row.机加工结束时间
this.dialogFormVisible1 = true
this.form.PDnumber = row.零件图号
this.form.quantity = row.投产总数量
if (row.最大投产批次 !== '' && row.最大投产批次 !== null) {
this.form.productionBatch = row.最大投产批次
} else {
this.form.productionBatch = 1
}
this.form.startDate_F = row.机加工开始时间
this.ComponentflowNumber = row.组件零件基本件流水号
this.TypeflowNumber = row.投产类型流水号
this.dataType = row.数据类型
this.productionQuantity = row.投产总数量
this.checked_waixie1 = row.checked_waixie
this.MaterialflowNumber = row.材料流水号
this.checked_zhaoji1 = row.checked_zhaoji
this.form.batchQuantity2 = parseInt(row.批次数量)
this.form.batchQuantity = parseInt(row.批次数量)
this.gongyijihua = row.工艺计划流水号
this.form.unputquantity = row.投产总数量 - row.已投产数量
for (let i = 0; i < tableData.length; i++) {
Sum += parseInt(tableData[i].批次数量)
if (i === tableData.length - 1) {
Sum -= parseInt(row.批次数量)
this.maxmax = row.投产总数量 - Sum
}
}
},
// 提交编辑
submitEdit() {
this.shijiancuo1 = Date.parse(this.form.startDate_F)
this.shijiancuo = Date.parse(this.form.endDate_F)
this.jieguo = this.shijiancuo1 - this.shijiancuo
if (this.jieguo >= 0) {
this.$message.error('加工结束时间应大于开始时间')
} else {
this.temp = null
if (this.gongyirenwuzhuangtai === '1') {
editList(this.gongyijihua, this.form.batchQuantity2, this.form.startDate_F, this.form.endDate_F).then(response => {
if (response.data[0].result === '1') {
this.dialogFormVisible1 = false
this.$message({
type: 'success',
message: '信息更新成功!'
})
getTable1(this.midcode, this.pageList3, this.pageSize3).then(response => {
this.total3 = parseInt(response.data.total)
this.tableData1 = response.data.rows
this.listLoading1 = false
})
this.total = 0
this.pageSize = 10
this.pageList = 1
this.getTable()
} else {
this.dialogFormVisible1 = false
this.$message.error('信息更新失败')
}
})
} else {
this.dialogFormVisible1 = false
this.$message.error('零件任务已经分配,无法更改')
}
this.shijiancuo1 = 0
this.shijiancuo = 0
this.jieguo = 0
}
},
// 分批投产确定
revisionBatch() {
if (this.checked_waixie1 === false) {
this.checked_waixie1 = 1
} else {
this.checked_waixie1 = 2
}
if (this.checked_zhaoji1 === false) {
this.checked_zhaoji1 = 0
} else {
this.checked_zhaoji1 = 1
}
if (this.checked_gaonandu === false) {
this.checked_gaonandu = 0
} else {
this.checked_gaonandu = 1
}
if (this.checked_baitu === false) {
this.checked_baitu = 0
} else {
this.checked_baitu = 1
}
if (this.checked_dailiao === true) {
this.checked_dailiao = 2
} else {
this.checked_dailiao = 1
}
this.shijiancuo1 = Date.parse(this.time_machiningStart)
this.shijiancuo = Date.parse(this.form.endDate_F)
this.jieguo = this.shijiancuo1 - this.shijiancuo
if (this.jieguo >= 0) {
this.$message.error('加工结束时间应大于开始时间')
} else {
this.temp = null
this.listLoading = true
revisionBatch(this.ComponentflowNumber, this.TypeflowNumber, this.dataType, this.form.productionBatch, this.form.batchQuantity, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time_machiningFinish, this.time_planStart, this.checked_waixie1, this.checked_dailiao, this.id, this.MaterialflowNumber, this.radio, this.checked_gaonandu, this.checked_zhaoji1, this.checked_baitu).then(response => {
if (response.data[0].result === '1') {
this.dialogFormVisible1 = false
this.$message({
type: 'success',
message: '分批投产成功!'
})
this.clearTable = this.total
this.checked_baitu = false
this.checked_gaonandu = false
this.total = 0
this.pageSize = 10
this.pageList = 1
this.shijiancuo1 = 0
this.shijiancuo = 0
this.checked_dailiao = 0
this.jieguo = 0
this.tableData = []
getTable(this.NumValue, this.pageList, this.pageSize).then(response => {
this.total = parseInt(response.data.total)
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
零件图号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
投产总数量: response.data.rows[i].投产总数量,
最大投产批次: response.data.rows[i].最大投产批次,
已投产数量: response.data.rows[i].已投产数量,
未投产数量: response.data.rows[i].未投产数量,
零件类型名称: response.data.rows[i].零件类型名称,
组件零件基本件流水号: response.data.rows[i].组件零件基本件流水号,
投产类型流水号: response.data.rows[i].投产类型流水号,
数据类型: response.data.rows[i].数据类型,
材料流水号: response.data.rows[i].材料流水号,
checked_dailiao: false,
checked_waixie: false,
checked_zhaoji: false
})
}
return this.total
}).then((total) => {
this.listLoading = false
getTable1(this.midcode, this.pageList3, this.pageSize3).then(response => {
const data = response.data.rows
for (let i = 0; i < data.length; i++) {
data[i].批次数量 = parseInt(data[i].批次数量)
}
this.total3 = parseInt(response.data.total)
if (this.clearTable === total) {
this.tableData1 = data
} else {
this.tableData1 = []
}
this.listLoading1 = false
})
})
} else {
this.dialogFormVisible1 = false
this.$message.error('分批投产失败')
}
})
}
},
// 投产
production() {
this.result = 0
if (this.time_machiningFinish === '' || this.time_machiningFinish === null) {
this.$message.error('请输入加工结束时间')
} else {
this.shijiancuo1 = Date.parse(this.time_machiningStart)
this.shijiancuo = Date.parse(this.time_machiningFinish)
this.jieguo = this.shijiancuo1 - this.shijiancuo
if (this.jieguo >= 0) {
this.$message.error('加工结束时间应大于开始时间')
} else {
if (this.multipleSelection.length === 0) {
this.$message.error('请至少选择一个零件')
} else {
for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].checked_waixie === false) {
this.multipleSelection[i].checked_waixie = 1
} else {
this.multipleSelection[i].checked_waixie = 2
}
if (this.multipleSelection[i].checked_zhaoji === false) {
this.multipleSelection[i].checked_zhaoji = 0
} else {
this.multipleSelection[i].checked_zhaoji = 1
}
if (this.multipleSelection[i].checked_dailiao === true) {
this.multipleSelection[i].checked_dailiao = 2
} else {
this.multipleSelection[i].checked_dailiao = 1
}
if (this.checked_gaonandu === false) {
this.checked_gaonandu = 0
} else {
this.checked_gaonandu = 1
}
if (this.checked_baitu === false) {
this.checked_baitu = 0
} else {
this.checked_baitu = 1
}
production(this.multipleSelection[i].组件零件基本件流水号, this.multipleSelection[i].投产类型流水号, this.multipleSelection[i].数据类型, this.multipleSelection[i].投产总数量, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time_machiningFinish, this.time_planStart, this.multipleSelection[i].checked_waixie, this.multipleSelection[i].checked_dailiao, this.id, this.multipleSelection[i].材料流水号, this.radio, this.checked_gaonandu, this.multipleSelection[i].checked_zhaoji, this.checked_baitu).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.multipleSelection.length) {
this.$message.success('投产成功')
this.total = 0
this.pageSize = 10
this.pageList = 1
this.getTable()
this.checked_baitu = false
this.checked_gaonandu = false
this.tableData1 = []
} else if (response.data[0].result === '0') {
this.$message.error('投产失败')
}
})
this.shijiancuo1 = 0
this.shijiancuo = 0
this.jieguo = 0
}
}
}
}
},
// 打回档案
handleDele(index, row, formName) {
this.count2 = this.count2 + 1
if (this.count2 !== 1) {
this.$refs[formName].resetFields()
}
this.temp = 3
this.liushuihao = row.组件零件基本件流水号
this.form1.reason = ''
this.dialogFormVisible2 = true
},
Dele() {
dele(this.liushuihao, this.form1.reason, this.time_gongyiStart).then(response => {
if (response.data[0].result === '1') {
this.dialogFormVisible2 = false
this.$message({
type: 'success',
message: '打回档案成功!'
})
this.total = 0
this.pageSize = 10
this.pageList = 1
this.getTable()
} else {
this.dialogFormVisible2 = false
this.$message.error('打回档案失败')
}
})
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.temp === 1) {
this.revisionBatch()
} else if (this.temp === 2) {
this.submitEdit()
// this.temp = null
}
} else {
return false
}
})
},
// 重置表单
callOff(formName) {
this.dialogFormVisible1 = false
this.$refs[formName].resetFields()
},
submit1(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.Dele()
} else {
return false
}
})
},
// 重置表单
callOff1(formName) {
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
},
// 分页
handleSizeChange(val) {
this.pageSize = val
this.getTable()
},
handleCurrentChange(val) {
this.pageList = val
this.getTable()
},
handleSizeChange3(val) {
this.pageSize3 = val
this.getTable1()
},
handleCurrentChange3(val) {
this.pageList3 = val
this.getTable1()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px
}
.el-select{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.time{
width: 200px;
}
.Time>.el-form-item{
margin:2px;
/*margin-left: 120px;*/
}
</style>

View File

@@ -0,0 +1,202 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>项目名称:</span>
<el-select v-model="projectValue" size="small" filterable clearable placeholder="项目名称">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>开始日期:</span>
<el-date-picker
v-model="date1"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>结束日期:</span>
<el-date-picker
v-model="date2"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-radio-group v-model="radio" size="small" style="margin: 10px;">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
<el-radio :label="3"></el-radio>
</el-radio-group>
<el-button type="success" icon="el-icon-search" style="margin: 10px;" size="small" @click="search">查询</el-button>
</el-row>
</el-card>
<el-card v-loading="loading">
<div id="myChart" :style="{width: '100%', height: '470px', margin: 'auto'}"/>
</el-card>
</div>
</template>
<script>
import { initProject, searchData } from '@/api/ManufacturingCenter/OwnTimeStatistics'
import echarts from 'echarts'
export default {
data() {
return {
loading: false,
projectValue: '',
project: [],
date1: '',
date2: '',
radio: 1,
check1: 0,
dataX: [],
series: [],
delayOkTime: [],
planOkTime: [],
preOkTime: [],
noOkTime: [],
totalTime: [],
totalAblity: []
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.project = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.project.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
search() {
this.loading = true
var myChart = echarts.init(document.getElementById('myChart'))
myChart.clear()
if (this.projectValue === '' || this.projectValue === null) {
this.check1 = 0
} else {
this.check1 = 1
}
if (this.date1 === '' || this.date1 === null || this.date2 === '' || this.date2 === null) {
this.check2 = 0
} else {
this.check2 = 1
}
searchData(this.check1, this.projectValue, this.check2, this.date1, this.date2, this.radio).then(response => {
console.log(response.data)
if (response.data.length !== 0 && !response.data[0].hasOwnProperty('result')) {
this.drawLine(response.data)
} else {
this.$message.warning('没有数据或数据量太大,请重新选择查询条件')
this.loading = false
}
})
},
drawLine(data) {
this.dataX = []
this.delayOkTime = []
this.planOkTime = []
this.preOkTime = []
this.noOkTime = []
this.totalTime = []
this.totalAblity = []
this.series = []
for (let i = 0; i < data.length; i++) {
this.dataX.push(data[i].计划日期)
this.delayOkTime.push(data[i].拖延完成工时)
this.planOkTime.push(data[i].按计划完成工时)
this.preOkTime.push(data[i].提前完成工时)
this.noOkTime.push(data[i].未完成工时)
this.totalTime.push(data[i].计划总工时)
this.totalAblity.push(data[i].设备总能力)
}
var myChart = echarts.init(document.getElementById('myChart'))
myChart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['提前完成工时', '按计划完成工时', '未完成工时', '拖延完成工时', '设备总能力']
},
dataZoom: { // 实现缩放功能
show: true,
realtime: true,
start: 0,
end: 100
},
xAxis: {
type: 'category',
name: '计划日期',
data: this.dataX,
axisLabel: {
interval: 0,
rotate: 0,
margin: 10
}
},
yAxis: {
type: 'value',
name: '工时',
min: 0,
scale: 'true'
},
series: [
{
name: '提前完成工时',
type: 'bar',
// stack: '工时',
data: this.preOkTime
},
{
name: '按计划完成工时',
type: 'bar',
data: this.planOkTime
},
{
name: '未完成工时',
type: 'bar',
data: this.noOkTime
},
{
name: '拖延完成工时',
type: 'bar',
data: this.delayOkTime
},
{
name: '设备总能力',
type: 'bar',
data: this.totalAblity
}
]
})
this.loading = false
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,773 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>项目名称</span>
<el-select v-model="projectValue" filterable clearable size="small" placeholder="项目名称" @change="projectChange">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床编号:</span>
<el-select v-model="machineNumberValue" placeholder="机床编号" size="small" clearable @change="machineChange">
<el-option
v-for="item in machineNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="groupNumberValue" placeholder="组号" size="small" clearable>
<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="searchTable()">查询</el-button>
</el-row>
</el-card>
<el-card>
<el-table :data="tableData" border size="mini" highlight-current-row style="width: 100%;margin-top: 15px" height="250px" @row-click="searchPart">
<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>
<!--<div class="block" style="margin-top: 10px;">-->
<!--<el-pagination-->
<!--@size-change="handleSizeChange"-->
<!--@current-change="handleCurrentChange"-->
<!--:current-page="pageCurrent"-->
<!--:page-sizes="[10, 20, 30, 40, 50]"-->
<!--:page-size="pageSize"-->
<!--layout="total, sizes, prev, pager, next, jumper"-->
<!--:total="total">-->
<!--</el-pagination>-->
<!--</div>-->
</el-card>
<el-card>
<el-tabs type="border-card" @tab-click="selectPart">
<el-tab-pane label="基本件">
<el-table :data="tableData1" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<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>
</el-tab-pane>
<el-tab-pane label="外购件">
<el-table :data="tableData2" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<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>
</el-tab-pane>
<el-tab-pane label="标准件">
<el-table :data="tableData3" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<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>
</el-tab-pane>
</el-tabs>
<span>物料计划到货时间</span>
<el-date-picker
v-model="time"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-button type="success" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="purchaseRequisition()">车间请购</el-button>
<el-button type="primary" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="PurchasingDepartment()">采购部门采购</el-button>
<el-button type="warning" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="Production()">车间生产</el-button>
</el-card>
<el-card>
<el-row>
<span>请购单号</span>
<el-input v-model="PurchaseOrder" size="small" style="width: 200px" placeholder="请购单号" clearable/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable1()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left: 15px" @click="handleAdd()">创建</el-button>
<el-button type="warning" size="small" icon="el-icon-download">导出Excel</el-button>
</el-row>
</el-card>
<el-card>
<el-table :data="tableData4" border size="mini" style="width: 100%" height="200px" highlight-current-row @row-click="searchDetailed">
<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 type="primary" size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 15px" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-table :data="tableData5" border size="mini" style="width: 100%" height="300px">
<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">
<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 type="danger" size="mini" icon="el-icon-delete" @click="MoveOut(scope.row)">移出</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="请购单编号" prop="请购单编号">
<el-input
v-model="form.请购单编号"
size="small"
style="width:200px"/>
</el-form-item>
<el-form-item label="请购车间" prop="请购车间">
<el-input
v-model="form.请购车间"
size="small"
style="width:200px"/>
</el-form-item>
<el-form-item label="请购人" prop="请购人">
<el-input
v-model="name"
size="small"
readonly
style="width:200px"/>
</el-form-item>
<el-form-item label="请购时间" prop="请购时间">
<el-date-picker
v-model="form.请购时间"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel('form')">取消</el-button>
<el-button v-show="title==='增加'" type="primary" @click="submitAdd('form')">确定</el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchmachine, searchgroup, searchTable, searchPart, searchPart1, searchTable1, addData, editData, deleteData, searchDetailed, purchaseRequisition, purchaseRequisition1, MoveOut, MoveOut1, PurchasingDepartment, Production } from '@/api/ManufacturingCenter/PartAssignment'
import { mapGetters } from 'vuex'
export default {
inject: ['reload'],
data() {
return {
projectValue: '',
projectFloatValue: '',
project: [],
machineNumberValue: '',
machineFloatValue: '',
machineNumber: [],
machineName: '',
groupNumberValue: '',
groupFloatValue: '',
groupNumber: [],
PurchaseOrder: '',
PartType: '基本件',
tableData: [],
tableData1: [],
tableData2: [],
tableData3: [],
tableData4: [],
tableData5: [],
loading: false,
title: '',
dialogFormVisible: false,
RequisitionList: '',
form: {
请购单编号: '',
请购车间: '',
请购时间: ''
},
rules: {
请购单编号: [{ required: true, message: '请输入请购单编号', trigger: 'blur' }],
请购车间: [{ required: true, message: '请输入请购车间', trigger: 'blur' }],
请购时间: [{ required: true, message: '请选择请购时间', trigger: 'change' }]
},
BasicPartsNumber: [],
StandardPartsAndOutsourcing: [],
MaterialNum: [],
MaterialName: [],
MaterialSpecification: [],
MaterialModel: [],
NumberOfParts: [],
projectName: '',
MachineToolNumber: '',
groupName: '',
time: '',
result: 0,
pageSize: '',
pageCurrent: '',
total: '',
check: ''
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
},
projectChange() {
this.machineNumberValue = ''
this.machineNumber = []
this.groupNumberValue = ''
this.groupNumber = []
if (this.projectValue !== '') {
this.check = 1
searchmachine(this.projectValue, this.check).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
} else {
this.check = 0
}
},
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].组件流水号
})
}
})
},
searchTable() {
this.loading = true
if (this.projectValue !== '') {
this.check1 = 1
} else { this.check1 = 0 }
if (this.machineNumberValue !== '') {
this.check2 = 1
} else { this.check2 = 0 }
if (this.groupNumberValue !== '') {
this.check3 = 1
} else { this.check3 = 0 }
searchTable(this.projectValue, this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3).then(response => {
this.tableData = response.data
this.tableData1 = []
this.tableData2 = []
this.tableData3 = []
this.loading = false
})
},
selectPart(val) {
this.PartType = val.label
if (this.PartType === '基本件') {
searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data
})
} else if (this.PartType === '外购件') {
searchPart1(this.groupFloatValue, 1).then(response => {
this.tableData2 = response.data
})
} else if (this.PartType === '标准件') {
searchPart1(this.groupFloatValue, 2).then(response => {
this.tableData3 = response.data
})
}
},
searchPart(row) {
this.tableData1 = []
this.tableData2 = []
this.tableData3 = []
this.projectName = row.项目名称
this.projectFloatValue = row.项目流水号
this.MachineToolNumber = row.机床图号
this.machineFloatValue = row.机床流水号
this.groupName = row.组号
this.groupFloatValue = row.组件流水号
if (this.PartType === '基本件') {
searchPart(row.组件流水号).then(response => {
this.tableData1 = response.data
})
} else if (this.PartType === '外购件') {
searchPart1(row.组件流水号, 1).then(response => {
this.tableData2 = response.data
})
} else if (this.PartType === '标准件') {
searchPart1(row.组件流水号, 2).then(response => {
this.tableData3 = response.data
})
}
},
searchTable1() {
if (this.PurchaseOrder !== '') {
this.check4 = 1
} else {
this.check4 = 0
}
searchTable1(this.PurchaseOrder, this.check4).then(response => {
this.tableData4 = response.data
})
},
handleAdd() {
this.addForm('form', [this.dialogFormVisible = true, this.title = '增加'])
},
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
addData(this.form.请购单编号, this.form.请购车间, this.name, this.id, this.form.请购时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
this.tableData5 = []
this.searchTable1()
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleEdit(row) { // 弹出单据编辑
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑'
this.dialogFormVisible = true
this.RequisitionList = row.请购单流水号
this.form.请购单编号 = row.请购单编号
this.form.请购车间 = row.请购车间
this.form.请购时间 = row.请购时间
},
submitEdit(formName) { // 提交单据编辑
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.form.请购时间)
editData(this.RequisitionList, this.form.请购单编号, this.form.请购车间, this.form.请购时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible = false
this.tableData5 = []
this.searchTable1()
} else { this.$message.error('编辑失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleDelete(row) { // 删除单据
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteData(row.请购单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.tableData5 = []
this.searchTable1()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
cancel(formName) {
this.form = {}
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
searchDetailed(row) {
this.RequisitionList = row.请购单流水号
searchDetailed(row.请购单流水号).then(response => {
this.tableData5 = response.data
})
},
handleSelectionChange(val) {
console.log(val)
if (this.PartType === '基本件') {
this.BasicPartsNumber = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < val.length; i++) {
this.MaterialNum[i] = val[i].物料流水号
this.BasicPartsNumber[i] = val[i].基本件流水号
this.MaterialName[i] = val[i].零件名称
this.NumberOfParts[i] = val[i].零件数量
}
} else if (this.PartType === '外购件') {
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < val.length; i++) {
this.StandardPartsAndOutsourcing[i] = val[i].标准件和外购件流水号
this.MaterialNum[i] = val[i].物料流水号
this.MaterialName[i] = val[i].物料名称
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
}
} else if (this.PartType === '标准件') {
this.StandardPartsAndOutsourcing = []
for (let i = 0; i < val.length; i++) {
this.StandardPartsAndOutsourcing[i] = val[i].标准件和外购件流水号
this.MaterialNum[i] = val[i].物料流水号
this.MaterialName[i] = val[i].物料名称
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
}
}
},
purchaseRequisition() {
if (this.RequisitionList !== '') {
if (this.time !== '') {
this.result = 0
if (this.PartType === '基本件') {
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
purchaseRequisition(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.BasicPartsNumber[i], this.MaterialName[i], this.NumberOfParts[i], this.PartType, this.time, this.MaterialNum[i]).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.BasicPartsNumber.length) {
this.$message.success('请购成功')
searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data
})
searchDetailed(this.RequisitionList).then(response => {
this.tableData5 = response.data
})
}
})
}
} else if (this.PartType === '外购件') {
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], this.PartType, this.time, this.MaterialNum[i]).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.StandardPartsAndOutsourcing.length) {
this.$message.success('请购成功')
searchPart1(this.groupFloatValue, 1).then(response => {
this.tableData2 = response.data
})
searchDetailed(this.RequisitionList).then(response => {
this.tableData5 = response.data
})
}
})
}
} else if (this.PartType === '标准件') {
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], this.PartType, this.time, this.MaterialNum[i]).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.StandardPartsAndOutsourcing.length) {
this.$message.success('请购成功')
searchPart1(this.groupFloatValue, 2).then(response => {
this.tableData3 = response.data
})
searchDetailed(this.RequisitionList).then(response => {
this.tableData5 = response.data
})
}
})
}
}
} else {
this.$message.warning('请选择计划到货时间')
}
} else {
this.$message.warning('请先选择请购单')
}
},
PurchasingDepartment() {
if (this.time !== '') {
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
PurchasingDepartment(this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.time, this.MaterialNum[i], this.NumberOfParts[i], this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('请购成功')
if (this.PartType === '外购件') {
searchPart1(this.groupFloatValue, 1).then(response => {
this.tableData2 = response.data
})
} else {
searchPart1(this.groupFloatValue, 2).then(response => {
this.tableData3 = response.data
})
}
} else { this.$message.error('请购失败') }
})
}
} else {
this.$message.warning('请选择计划到货时间')
}
},
Production() {
if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) {
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
Production(this.groupFloatValue, this.BasicPartsNumber[i], this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('投产成功')
searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data
})
} else {
this.$message.error('投产失败')
}
})
}
} else {
this.$message.warning('请选择基本件')
}
},
MoveOut(row) {
this.$confirm('此操作将该物料移出, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (row.零件类型 === '基本件') {
MoveOut(row.请购单明细流水号, row.基本件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移出成功')
searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data
})
} else { this.$message.error('移出失败') }
})
} else if (row.零件类型 === '外购件') {
MoveOut1(row.请购单明细流水号, row.标准件和外购件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移出成功')
searchPart1(this.groupFloatValue, 1).then(response => {
this.tableData2 = response.data
})
} else { this.$message.error('移出失败') }
})
} else if (row.零件类型 === '标准件') {
MoveOut1(row.请购单明细流水号, row.标准件和外购件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移出成功')
searchPart1(this.groupFloatValue, 2).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('移出失败') }
})
}
searchDetailed(this.RequisitionList).then(response => {
this.tableData5 = response.data
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消移出'
})
})
},
handleSizeChange(val) {},
handleCurrentChange(val) {}
}
}
</script>
<style scoped>
span{
margin: 10px 0px 10px 10px;
}
</style>

View File

@@ -0,0 +1,721 @@
<template>
<div class="app-container">
<el-card>
<span>零件号</span>
<el-input v-model="PrNum" size="small" placeholder="零件号" clearable style="width: 200px"/>
<el-button type="success" size="small" style="margin-left: 10px" icon="el-icon-search" @click="pageCurrent=1;pageSize=10;total=0;searchData()">查询</el-button>
<el-button type="primary" size="small" style="margin-left: 10px" icon="el-icon-download" @click="downLoadCjn('cjn')">导出工艺定额卡</el-button>
<el-button type="primary" size="small" style="margin-left: 10px" icon="el-icon-download" @click="downLoadCjn1('cjn1')">导出加工路线单</el-button>
</el-card>
<el-card>
<el-table
v-loading="loading"
:data="tableData"
style="max-height: 300px"
height="300px"
border
highlight-current-row
@row-click="click">
<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>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[5, 10, 20]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<table id="cjn" style="width: 975px;" border="2px" cellspacing="0px" align="center">
<thead>
<tr height="25px">
<td colspan="4" rowspan="2" style="text-align:center;font-size: 30px;font-weight: bold">GAOJING</td>
<td rowspan="4" style="font-size: 30px;font-weight: bold;width: 210px">工艺定额卡</td>
<td>零件图号</td>
<td colspan="3">{{ 零件图号 }}</td>
</tr>
<tr>
<td>零件名称</td>
<td>{{ 零件名称 }}</td>
<td>数量</td>
<td>{{ 投产数量 }}</td>
</tr>
<tr>
<td colspan="4" style="text-align:center;">江苏高精机电装备有限公司</td>
<td colspan="2">材料</td>
<td colspan="2">原材料规格</td>
</tr>
<tr>
<td>机床号</td>
<td>{{ 机床号 }}</td>
<td>组号</td>
<td>{{ 组号 }}</td>
<td colspan="2">{{ 材料 }}</td>
<td colspan="2">{{ 原材料规格 }}</td>
</tr>
<tr>
<td rowspan="2" style="text-align:center;">序次</td>
<td rowspan="2" colspan="2" style="text-align:center;">工艺名称</td>
<td rowspan="2" colspan="4" style="text-align:center;width: 550px">工艺要求</td>
<td colspan="2" style="text-align:center;">定额工时</td>
</tr>
<tr>
<td style="text-align:center;">单件</td>
<td style="text-align:center;">准结</td>
</tr>
</thead>
<tbody>
<tr id="1">
<td>1</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="2">
<td>2</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="3">
<td>3</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="4">
<td>4</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="5">
<td>5</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="6">
<td>6</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="7">
<td>7</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="8">
<td>8</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="9">
<td>9</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="10">
<td>10</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="11">
<td>11</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="12">
<td>12</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="13">
<td>13</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="14">
<td>14</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="15">
<td>15</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="16">
<td>16</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="17">
<td>17</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="18">
<td>18</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="19">
<td>19</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
<tr id="20">
<td>20</td>
<td colspan="2"/>
<td colspan="4" style="text-align:left;"/>
<td/>
<td/>
</tr>
</tbody>
<tfoot>
<tr>
<td>工艺员:</td>
<td colspan="2">{{ 工艺员 }}</td>
<td>定额员:</td>
<td>{{ 定额员 }}</td>
<td>日期:</td>
<td colspan="3">{{ 日期 }}</td>
</tr>
</tfoot>
</table>
</el-card>
<el-card>
<table id="cjn1" style="width: 800px;" border="2px" cellspacing="0px" align="center">
<thead>
<tr height="60px">
<td colspan="6" style="text-align:center;width: 33%">江苏高精机电<br>装备有限公司</td>
<td colspan="6" style="font-size: 30px;font-weight: bold;text-align:center;width: 34%">零件加工路线单</td>
<td colspan="6" style="text-align:center;width: 33%"> <br> </td>
</tr>
<tr>
<td colspan="2" style="text-align:center">材料</td>
<td colspan="4" style="text-align:center">{{ 材料 }}</td>
<td colspan="3" style="text-align:center;width: 17%">材料规格</td>
<td colspan="9" style="text-align:center">{{ 原材料规格 }}</td>
</tr>
<tr>
<td colspan="4" style="text-align:center">机床号</td>
<td colspan="4" style="text-align:center">组号</td>
<td colspan="6" style="text-align:center">零件图号</td>
<td colspan="3" style="text-align:center">零件名称</td>
<td style="text-align:center">数量</td>
</tr>
<tr height="80px">
<td colspan="4" style="text-align:center">{{ 机床号 }}</td>
<td colspan="4" style="text-align:center">{{ 组号 }}</td>
<td colspan="6" style="text-align:center">{{ 零件图号 }}</td>
<td colspan="3" style="text-align:center">{{ 零件名称 }}</td>
<td style="text-align:center">{{ 投产数量 }}</td>
</tr>
<tr>
<td colspan="4" style="text-align:center">工序</td>
<td colspan="2" style="text-align:center">工时定额</td>
<td colspan="3" rowspan="3" style="text-align:center">工作者<br>(设备)</td>
<td colspan="4" style="text-align:center">检查结果</td>
<td colspan="2" rowspan="3" style="text-align:center">检章</td>
<td colspan="2" rowspan="3" style="text-align:center">计划完成日期</td>
<td rowspan="3" style="text-align:center">/</td>
</tr>
<tr>
<td rowspan="2" style="text-align:center">次序</td>
<td colspan="3" rowspan="2" style="text-align:center;width: 15%">名称</td>
<td rowspan="2" style="text-align:center">单件</td>
<td rowspan="2" style="text-align:center">准结</td>
<td rowspan="2" style="text-align:center">合格</td>
<td rowspan="2" style="text-align:center">回用</td>
<td colspan="2" style="text-align:center">废品</td>
</tr>
<tr>
<td style="text-align:center;width: 5%"></td>
<td style="text-align:center;width: 5%"></td>
</tr>
</thead>
<tbody>
<tr id="21">
<td style="text-align:center">1</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="22">
<td style="text-align:center">2</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="23">
<td style="text-align:center">3</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="24">
<td style="text-align:center">4</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="25">
<td style="text-align:center">5</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="26">
<td style="text-align:center">6</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="27">
<td style="text-align:center">7</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="28">
<td style="text-align:center">8</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="29">
<td style="text-align:center">9</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="30">
<td style="text-align:center">10</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="31">
<td style="text-align:center">11</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="32">
<td style="text-align:center">12</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="33">
<td style="text-align:center">13</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="34">
<td style="text-align:center">14</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="35">
<td style="text-align:center">15</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="36">
<td style="text-align:center">16</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="37">
<td style="text-align:center">17</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="38">
<td style="text-align:center">18</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="39">
<td style="text-align:center">19</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
<tr id="40">
<td style="text-align:center">20</td>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="3" style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td colspan="2" style="text-align:center"/>
<td style="text-align:center"/>
</tr>
</tbody>
</table>
</el-card>
</div>
</template>
<script>
import { search, searchtable1, searchtable2 } from '@/api/ManufacturingCenter/PartWorkCraftSelect_rdlc'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
export default {
data() {
return {
cell: [],
pageCurrent: 1,
pageSize: 10,
total: 0,
tableData: [],
loading: false,
PrNum: '027W191482-0001',
tableData2: [],
tableData3: [],
机床号: '',
组号: '',
零件图号: '',
零件名称: '',
投产数量: '',
材料: '',
原材料规格: '',
工艺员: '',
定额员: '',
日期: ''
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
for (let i = 0; i < 9; i++) {
for (let j = 1; j < 28; j++) {
this.cell.push(String.fromCharCode(65 + i) + j)
}
}
},
searchData() {
this.loading = true
search(this.pageCurrent, this.pageSize, this.PrNum).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
this.loading = false
})
},
click(row) {
searchtable1(row.工艺计划流水号).then(response => {
this.tableData2 = response.data
this.tableData2[0].工艺实际完成时间 = response.data[0].工艺实际完成时间.substr(0, 10) // 只处理了要显示的时间格式
this.机床号 = response.data[0].机床图号
this.组号 = response.data[0].组号
this.零件图号 = response.data[0].零件图号
this.零件名称 = response.data[0].零件名称
this.投产数量 = response.data[0].投产数量
this.材料 = response.data[0].材料
this.原材料规格 = response.data[0].原材料规格
this.工艺员 = response.data[0].工艺员
this.定额员 = response.data[0].定额员
this.日期 = response.data[0].工艺实际完成时间.substr(0, 10)
}).then(() => {
for (let j = 0; j < 20; j++) {
document.getElementById(String(j + 1)).children[1].innerHTML = ''
document.getElementById(String(j + 1)).children[2].innerHTML = ''
document.getElementById(String(j + 1)).children[3].innerHTML = ''
document.getElementById(String(j + 1)).children[4].innerHTML = ''
}
for (let j = 0; j < this.tableData2.length; j++) {
document.getElementById(String(j + 1)).children[1].innerHTML = this.tableData2[j].工艺名称
document.getElementById(String(j + 1)).children[2].innerHTML = this.tableData2[j].工艺要求
document.getElementById(String(j + 1)).children[3].innerHTML = this.tableData2[j].单件定额工时
document.getElementById(String(j + 1)).children[4].innerHTML = this.tableData2[j].准结定额工时
}
})
searchtable2(row.工艺计划流水号).then(response => {
this.tableData3 = response.data
}).then(() => {
for (let j = 0; j < 20; j++) {
document.getElementById(String(j + 21)).children[1].innerHTML = ''
document.getElementById(String(j + 21)).children[2].innerHTML = ''
document.getElementById(String(j + 21)).children[3].innerHTML = ''
document.getElementById(String(j + 21)).children[10].innerHTML = ''
}
for (let j = 0; j < this.tableData3.length; j++) {
document.getElementById(String(j + 21)).children[1].innerHTML = this.tableData3[j].工艺名称
document.getElementById(String(j + 21)).children[2].innerHTML = this.tableData3[j].单件定额工时
document.getElementById(String(j + 21)).children[3].innerHTML = this.tableData3[j].准结定额工时
document.getElementById(String(j + 21)).children[10].innerHTML = this.tableData3[j].计划日期.substr(5, 5)
}
})
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchData()
},
handleDownload() {
if (this.tableData2.length === 0) {
this.$message.error('请选择一个零件')
} else {
require.ensure([], () => {
const { export_json_to_excel } = require('@/vendor/Export2Excel1')
const list = this.tableData2
export_json_to_excel(list, '工艺定额卡', this.cell)
})
}
},
downLoadCjn(tableid) { // 下载工艺定额卡
getExplorer()
method5(tableid)
Cleanup()
},
downLoadCjn1(tableid) { // 下载零件加工路线单
getExplorer()
method5(tableid)
Cleanup()
}
}
}
</script>
<style>
td{
width: 100px;
height: 30px;
text-align:center;
}
</style>
<style scoped>
span{
margin: 10px 0 10px 10px;
}
.el-card{
margin-bottom: 15px;
}
.el-table {
max-height: 250px;
overflow: auto;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,375 @@
<template>
<div class="app-container">
<el-card>
<el-radio-group v-show="false" v-model="radio" size="small" style="margin: 10px;" @change="radioChange()">
<el-radio :label="1">当天</el-radio>
<el-radio :label="2">全部</el-radio>
</el-radio-group>
<span>项目名称:</span>
<el-select
v-loading="loading"
v-model="projectNameValue"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
filterable
clearable
size="small"
placeholder="请选择项目名称"
style="width: 200px;margin-right:10px"
@change="getGraphNum()">
<el-option
v-for="item in projectName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="graphNumValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="getGroupNum()">
<el-option
v-for="item in graphNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px" @change="total=0;PageCurrent=1;PageSize=10;getTable()">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" size="small" style="margin-left: 10px" @click="selectAll(tableData)">全选</el-button>
<el-button type="primary" size="small" icon="el-icon-cjn-09" style="" @click="save">保存</el-button>
</el-card>
<el-card>
<el-table
ref="multipleTable"
:data="tableData"
style="width: 100%;max-height: 440px;"
height="440"
highlight-current-row
border
@selection-change="handleSelectionChange">
<el-table-column align="center" type="selection"/>
<el-table-column align="center" label="零件号">
<template slot-scope="scope">
{{ scope.row.零件号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺开始时间" width="160">
<template slot-scope="scope">
{{ scope.row.工艺开始时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺结束时间" width="160">
<template slot-scope="scope">
{{ scope.row.工艺结束时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺员" width="230px">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].工艺员" size="mini" style="width:150px" placeholder="工艺员" @click.native="selectPerson(scope.$index)"/>
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="80">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="投产时间" width="160">
<template slot-scope="scope">
{{ scope.row.投产时间 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-show="!loading0"
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible" title="工艺定额人员选择" center>
<el-table
:data="tableData2"
style="width: 100%;max-height: 200px"
border
height="200px"
highlight-current-row
@row-click="confirmPerson">
<el-table-column align="center" label="考勤编号">
<template slot-scope="scope">
{{ scope.row.考勤编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="性别">
<template slot-scope="scope">
{{ scope.row.性别 }}
</template>
</el-table-column>
<el-table-column align="center" label="工作岗位">
<template slot-scope="scope">
{{ scope.row.岗位名称 }}
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogFormVisible=false">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getProject0, getProject, getGraphNum, getGroupNum, getTable0, getGraphNum0, getGroupNum0, getTable00, save, initPerson } from '@/api/ManufacturingCenter/ProcessTaskAssignment'
export default {
data() {
return {
loading: false,
loading0: false,
projectNameValue: '',
projectName: [],
// machineToolNum: '',
radio: 2,
graphNumValue: '',
graphNum: [],
GroupNumValue: '',
GroupNum: [],
tableData: [],
dialogFormVisible: false,
tableData2: [],
dialogPerson: '',
index: '',
multipleSelection: [],
result: 0,
PageCurrent: 1,
PageSize: 10,
total: 0
}
},
created() {
this.fetchData()
this.initPerson()
},
methods: {
fetchData() {
getProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.projectName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
initPerson() { // 初始化工艺员
initPerson().then(response => {
this.tableData2 = response.data
})
},
radioChange() { // radio改变
this.loading = true
this.projectName = []
this.projectNameValue = ''
this.graphNumValue = ''
this.GroupNumValue = ''
this.GroupNum = []
this.tableData = []
this.total = 0
if (this.radio === 1) {
getProject0().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.projectName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
this.loading = false
})
} else {
getProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.projectName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
this.loading = false
})
}
},
getGraphNum() { // 获取下拉图号
this.tableData = []
this.total = 0
this.graphNum = []
this.graphNumValue = ''
this.GroupNumValue = ''
this.GroupNum = []
if (this.radio === 2) { // 全部
getGraphNum(this.projectNameValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.graphNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
} else { // 当天
getGraphNum0(this.projectNameValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.graphNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
}
},
getGroupNum() { // 获取下拉组号
this.tableData = []
this.total = 0
this.GroupNum = []
this.GroupNumValue = ''
if (this.radio === 2) { // 全部
getGroupNum(this.graphNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
} else { // 当天
getGroupNum0(this.graphNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
}
},
getTable() { // 获取主表
this.loading0 = true
this.tableData = []
if (this.radio === 2) { // 全部
getTable0(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
this.total = response.data.total
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
零件号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
工艺开始时间: response.data.rows[i].工艺计划开始时间,
工艺结束时间: response.data.rows[i].工艺计划结束时间,
数量: response.data.rows[i].批次数量,
投产时间: response.data.rows[i].操作时间,
工艺员: '',
人员编号: '',
工艺计划流水号: response.data.rows[i].工艺计划流水号
})
}
this.loading0 = false
})
} else { // 当天
getTable00(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
this.total = response.data.total
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
零件号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
工艺开始时间: response.data.rows[i].工艺计划开始时间,
工艺结束时间: response.data.rows[i].工艺计划结束时间,
数量: response.data.rows[i].批次数量,
投产时间: response.data.rows[i].操作时间,
工艺员: '',
人员编号: '',
工艺计划流水号: response.data.rows[i].工艺计划流水号
})
}
this.loading0 = false
})
}
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.getTable()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.getTable()
},
selectPerson(index) { // 点击查询按钮
this.index = index
this.dialogFormVisible = true
},
confirmPerson(row) { // 选择一行
this.tableData[this.index].工艺员 = row.姓名
this.tableData[this.index].人员编号 = row.人员编号
},
selectAll(rows) {
if (this.tableData[0].工艺员 !== '') {
for (let i = 0; i < rows.length; i++) {
rows[i].工艺员 = this.tableData[0].工艺员
rows[i].人员编号 = this.tableData[0].人员编号
}
this.$refs.multipleTable.clearSelection()
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row)
})
} else { this.$message.error('请在第一行中填写工艺员姓名') }
},
handleSelectionChange(val) {
this.multipleSelection = val
console.log(this.multipleSelection)
},
save() {
for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].人员编号 === '') {
this.$message.error('请选择工艺员')
} else {
save(this.multipleSelection[i].工艺计划流水号, this.multipleSelection[i].人员编号, this.multipleSelection[i].零件号).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.multipleSelection.length) {
this.$message.success('保存成功')
this.PageCurrent = 1
this.PageSize = 10
this.getTable()
} else if (i === this.multipleSelection.length - 1 && this.result !== this.multipleSelection.length) {
this.$message.error('存在保存失败项')
}
})
}
}
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,564 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>项目名称:</span>
<el-select v-model="project" size="small" filterable clearable placeholder="项目名称" @change="getMachine">
<el-option
v-for="item in projects"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床号:</span>
<el-select v-model="Machine" size="small" clearable placeholder="机床号" @change="getGroup">
<el-option
v-for="item in Machines"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="Group" size="small" clearable placeholder="组号">
<el-option
v-for="item in Groups"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<span>是否外协:</span>
<el-select v-model="part" size="small" placeholder="是否外协">
<el-option
v-for="item in parts"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件号:</span>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 200px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
<span>进度颜色</span>
<el-radio v-model="radioList" label="0" style="background-color: white">全部</el-radio>
<el-radio v-model="radioList" label="1" style="background-color: red">拖期</el-radio>
<el-radio v-model="radioList" label="2" style="background-color: yellow">即将拖期</el-radio>
<el-radio v-model="radioList" label="3" style="background-color: lawngreen">如期</el-radio>
<el-radio v-model="radioList" label="4" style="background-color: deepskyblue">工序外协</el-radio>
</el-row>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableData1"
class="table"
border
height="650">
<el-table-column
label="序号"
align="center"
width="50"
type="index"/>
<el-table-column
align="center"
label="零件图号"
width="200px">
<template slot-scope="scope">{{ 零件图号[scope.$index] }}</template>
</el-table-column>
<el-table-column
align="center"
label="零件名称"
width="120px">
<template slot-scope="scope"> {{ 零件名称[scope.$index] }}</template>
</el-table-column>
<el-table-column
align="center"
prop="address"
label="数量">
<template slot-scope="scope">{{ 投产数量[scope.$index] }}</template>
</el-table-column>
<el-table-column label="零件加工计划进度(工艺名称,计划完成时间,实际完成时间,员工名称)" >
<el-table-column label="[1]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][0]">
<h4>{{ process[scope.$index][0] }}</h4><h4>{{ planDate[scope.$index][0] }} </h4><h4> {{ realDate[scope.$index][0] }}</h4><h4> {{ worker[scope.$index][0] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[2]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][1]">
<h4>{{ process[scope.$index][1] }}</h4><h4>{{ planDate[scope.$index][1] }} </h4><h4> {{ realDate[scope.$index][1] }}</h4><h4> {{ worker[scope.$index][1] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[3]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][2]">
<h4>{{ process[scope.$index][2] }}</h4><h4>{{ planDate[scope.$index][2] }} </h4><h4> {{ realDate[scope.$index][2] }}</h4><h4> {{ worker[scope.$index][2] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[4]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][3]">
<h4>{{ process[scope.$index][3] }}</h4><h4>{{ planDate[scope.$index][3] }} </h4><h4> {{ realDate[scope.$index][3] }}</h4><h4> {{ worker[scope.$index][3] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[5]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][4]">
<h4>{{ process[scope.$index][4] }}</h4><h4>{{ planDate[scope.$index][4] }} </h4><h4> {{ realDate[scope.$index][4] }}</h4><h4> {{ worker[scope.$index][4] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[6]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][5]">
<h4>{{ process[scope.$index][5] }}</h4><h4>{{ planDate[scope.$index][5] }} </h4><h4> {{ realDate[scope.$index][5] }}</h4><h4> {{ worker[scope.$index][5] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[7]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][6]">
<h4>{{ process[scope.$index][6] }}</h4><h4>{{ planDate[scope.$index][6] }} </h4><h4> {{ realDate[scope.$index][6] }}</h4><h4> {{ worker[scope.$index][6] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[8]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][7]">
<h4>{{ process[scope.$index][7] }}</h4><h4>{{ planDate[scope.$index][7] }} </h4><h4> {{ realDate[scope.$index][7] }}</h4><h4> {{ worker[scope.$index][7] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[9]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][8]">
<h4>{{ process[scope.$index][8] }}</h4><h4>{{ planDate[scope.$index][8] }} </h4><h4> {{ realDate[scope.$index][8] }}</h4><h4> {{ worker[scope.$index][8] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[10]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][9]">
<h4>{{ process[scope.$index][9] }}</h4><h4>{{ planDate[scope.$index][9] }} </h4><h4> {{ realDate[scope.$index][9] }}</h4><h4> {{ worker[scope.$index][9] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[11]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][10]">
<h4>{{ process[scope.$index][10] }}</h4><h4>{{ planDate[scope.$index][10] }} </h4><h4> {{ realDate[scope.$index][10] }}</h4><h4> {{ worker[scope.$index][10] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[12]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][11]">
<h4>{{ process[scope.$index][11] }}</h4><h4>{{ planDate[scope.$index][11] }} </h4><h4> {{ realDate[scope.$index][11] }}</h4><h4> {{ worker[scope.$index][11] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[13]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][12]">
<h4>{{ process[scope.$index][12] }}</h4><h4>{{ planDate[scope.$index][12] }} </h4><h4> {{ realDate[scope.$index][12] }}</h4><h4> {{ worker[scope.$index][12] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[14]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][13]">
<h4>{{ process[scope.$index][13] }}</h4><h4>{{ planDate[scope.$index][13] }} </h4><h4> {{ realDate[scope.$index][13] }}</h4><h4> {{ worker[scope.$index][13] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[15]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][14]">
<h4>{{ process[scope.$index][14] }}</h4><h4>{{ planDate[scope.$index][14] }} </h4><h4> {{ realDate[scope.$index][14] }}</h4><h4> {{ worker[scope.$index][14] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[16]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][15]">
<h4>{{ process[scope.$index][15] }}</h4><h4>{{ planDate[scope.$index][15] }} </h4><h4> {{ realDate[scope.$index][15] }}</h4><h4> {{ worker[scope.$index][15] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[17]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][16]">
<h4>{{ process[scope.$index][16] }}</h4><h4>{{ planDate[scope.$index][16] }} </h4><h4> {{ realDate[scope.$index][16] }}</h4><h4> {{ worker[scope.$index][16] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[18]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][17]">
<h4>{{ process[scope.$index][17] }}</h4><h4>{{ planDate[scope.$index][17] }} </h4><h4> {{ realDate[scope.$index][17] }}</h4><h4> {{ worker[scope.$index][17] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[19]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][18]">
<h4>{{ process[scope.$index][18] }}</h4><h4>{{ planDate[scope.$index][18] }} </h4><h4> {{ realDate[scope.$index][18] }}</h4><h4> {{ worker[scope.$index][18] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[20]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][19]">
<h4>{{ process[scope.$index][19] }}</h4><h4>{{ planDate[scope.$index][19] }} </h4><h4> {{ realDate[scope.$index][19] }}</h4><h4> {{ worker[scope.$index][19] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[21]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][20]">
<h4>{{ process[scope.$index][20] }}</h4><h4>{{ planDate[scope.$index][20] }} </h4><h4> {{ realDate[scope.$index][20] }}</h4><h4> {{ worker[scope.$index][20] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[22]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][21]">
<h4>{{ process[scope.$index][21] }}</h4><h4>{{ planDate[scope.$index][21] }} </h4><h4> {{ realDate[scope.$index][21] }}</h4><h4> {{ worker[scope.$index][21] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[23]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][22]">
<h4>{{ process[scope.$index][22] }}</h4><h4>{{ planDate[scope.$index][22] }} </h4><h4> {{ realDate[scope.$index][22] }}</h4><h4> {{ worker[scope.$index][22] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[24]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][23]">
<h4>{{ process[scope.$index][23] }}</h4><h4>{{ planDate[scope.$index][23] }} </h4><h4> {{ realDate[scope.$index][23] }}</h4><h4> {{ worker[scope.$index][23] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[25]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][24]">
<h4>{{ process[scope.$index][24] }}</h4><h4>{{ planDate[scope.$index][24] }} </h4><h4> {{ realDate[scope.$index][24] }}</h4><h4> {{ worker[scope.$index][24] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[26]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][25]">
<h4>{{ process[scope.$index][25] }}</h4><h4>{{ planDate[scope.$index][25] }} </h4><h4> {{ realDate[scope.$index][25] }}</h4><h4> {{ worker[scope.$index][25] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[27]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][26]">
<h4>{{ process[scope.$index][26] }}</h4><h4>{{ planDate[scope.$index][26] }} </h4><h4> {{ realDate[scope.$index][26] }}</h4><h4> {{ worker[scope.$index][26] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[28]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][27]">
<h4>{{ process[scope.$index][27] }}</h4><h4>{{ planDate[scope.$index][27] }} </h4><h4> {{ realDate[scope.$index][27] }}</h4><h4> {{ worker[scope.$index][27] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[29]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][28]">
<h4>{{ process[scope.$index][28] }}</h4><h4>{{ planDate[scope.$index][28] }} </h4><h4> {{ realDate[scope.$index][28] }}</h4><h4> {{ worker[scope.$index][28] }}</h4>
</div>
</template>
</el-table-column>
<el-table-column label="[30]" align="center" width="120px">
<template slot-scope="scope">
<div :class="colorCode[scope.$index][29]">
<h4>{{ process[scope.$index][29] }}</h4><h4>{{ planDate[scope.$index][29] }} </h4><h4> {{ realDate[scope.$index][29] }}</h4><h4> {{ worker[scope.$index][29] }}</h4>
</div>
</template>
</el-table-column>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>
import { getNames, getMachines, getGroups, getTable, getTable2 } from '@/api/ManufacturingCenter/ProcessingStatus'
export default {
data() {
return {
liushuihao: '',
// value2: null,
radioList: '0',
length: 0,
listLoading1: false,
tableData1: [],
project: '',
projects: [],
Machine: '',
Machines: [],
Group: '',
Groups: [],
part: '',
parts: [{
value: 0,
label: '全部零件'
}, {
value: 1,
label: '自家生产'
}, {
value: 2,
label: '外协生产'
}],
Speed: '',
Speeds: [{
value: 5,
label: '全部'
}, {
value: 1,
label: '拖期'
}, {
value: 2,
label: '即将拖期'
}, {
value: 3,
label: '如期'
}, {
value: 4,
label: '工序外协'
}],
number: '',
checkbox_project: false,
checkbox_Machine: false,
checkbox_Group: false,
checkbox_part: false,
checkbox_number: false,
零件图号: [],
零件名称: [],
投产数量: [],
result: [],
process: [[]],
planDate: [[]],
worker: [[]],
colorCode: [[]],
realDate: [[]],
// waixie: [[]],
total: 0, // 总条数
pageSize: 10,
pageCurrent: 1
}
},
created() {
this.fetchData()
},
methods: {
// 查询供应商名称
fetchData() {
this.projects = []
getNames().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.projects.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
this.part = 1
},
getMachine() {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
if (this.project !== '') {
getMachines(this.project).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
}
},
getGroup() {
this.Group = ''
this.Groups = []
getGroups(this.Machine).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Groups.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 按条件查询
getTableData() {
this.listLoading1 = true
if (this.project === '') {
this.checkbox_project = false
} else {
this.checkbox_project = true
}
if (this.Machine === '') {
this.checkbox_Machine = false
} else {
this.checkbox_Machine = true
}
if (this.Group === '') {
this.checkbox_Group = false
} else {
this.checkbox_Group = true
}
if (this.part === '') {
this.checkbox_part = false
} else {
this.checkbox_part = true
}
if (this.number === '') {
this.checkbox_number = false
} else {
this.checkbox_number = true
}
this.tableData1 = []
this.零件图号 = []
this.零件名称 = []
this.投产数量 = []
this.result = []
this.process = [[]]
this.planDate = [[]]
this.worker = [[]]
this.colorCode = [[]]
this.realDate = [[]]
this.length = 0
getTable(this.checkbox_project, this.project, this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, this.part, this.pageCurrent, this.pageSize).then(response => {
this.length = parseInt(response.data.total)
for (let i = 0; i < response.data.rows.length; i++) { // 声明二维数组
this.零件图号.push(response.data.rows[i].零件图号)
this.零件名称.push(response.data.rows[i].零件名称)
this.投产数量.push(response.data.rows[i].投产数量)
this.process[i] = []
this.planDate[i] = []
this.worker[i] = []
this.colorCode[i] = []
this.realDate[i] = []
this.result.push(response.data.rows[i])
}
if (this.零件图号.length !== 0) {
for (let i = 0; i < this.零件图号.length; i++) {
getTable2(this.checkbox_project, this.project, this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.零件图号[i], this.part).then(response => {
this.liushuihao = response.data[0].工艺计划流水号
for (let k = 0; k < response.data.length; k++) {
if (response.data[k].工艺计划流水号 === this.liushuihao) {
this.process[i][k] = response.data[k].工艺名称简称
this.planDate[i][k] = response.data[k].计划日期_短
this.worker[i][k] = response.data[k].员工姓名
this.realDate[i][k] = response.data[k].完成日期_短
if (response.data[k].工序状态 === 5) { // 灰色是已经完成 未入库
this.colorCode[i][k] = 'grey'
} else {
this.colorCode[i][k] = response.data[k].进度颜色
}
if (response.data[k].工序间是否外协 === 2) {
this.colorCode[i][k] = 'lightblue'
}
}
}
}).then(() => {
this.tableData1.push(this.result[i])
this.listLoading1 = false
this.total = this.length
})
}
} else {
this.tableData1 = []
this.listLoading1 = false
this.total = 0
}
})
},
handleSizeChange(val) {
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.getTableData()
}
}
}
</script>
<style>
.white{
background-color: ghostwhite;
border: 1px solid #1f2d3d;
}
.grey{
background-color: grey;
border: 1px solid #1f2d3d;
}
.red{
background-color: orangered;
border: 1px solid #1f2d3d;
}
.lightblue{
background-color: deepskyblue;
border: 1px solid #1f2d3d;
}
.yellow{
background-color: yellow;
border: 1px solid #1f2d3d;
}
.blank{
background-color: transparent;
border: 0px solid white;
}
.lightgreen{
background-color: lightgreen;
border: 1px solid #1f2d3d;
}
</style>
<style scoped>
.el-form-item{
margin-bottom: 22px;
}
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
.table h4{
border: 1px solid transparent;
margin: 0;
font-weight: normal;
width: 100px;
height: 24px;
}
</style>

View File

@@ -0,0 +1,352 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: -10px;">
<el-radio-group v-model="radio" style="margin: 10px;" @change="radioChange">
<el-radio :label="1">未编制</el-radio>
<el-radio :label="2">已编制</el-radio>
</el-radio-group>
<span style="margin: 10px">定额员:</span>
<el-select v-model="personValue" size="small" placeholder="定额员" @change="personChange">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin: 10px">零件号:</span>
<el-select v-model="partNumValue" size="small" filterable placeholder="零件号" style="margin: 10px">
<el-option
v-for="item in partNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin: 10px" @click="typeChange()">查询</el-button>
<span v-if="radio === 1" style="color: #53A3F7;font-size: 14px"> 未编制的数量{{ partNum.length }}</span>
<span v-if="radio === 2" style="color: #53A3F7;font-size: 14px"> {{ shuliang }}</span>
</div>
<div>
<span>种类:</span>
<el-input
v-model="typeValue"
size="small"
placeholder="种类"
readonly
style="margin: 10px;width:180px"/>
<span>零件名称:</span>
<el-input
v-model="partName"
size="small"
placeholder="零件名称"
readonly
style="margin: 10px;width:180px"/>
<span>投产总数量:</span>
<el-input
v-model="batchNum"
size="small"
placeholder="投产总数量"
readonly
style="margin: 10px;width:180px"/>
<span>材质:</span>
<el-input
v-model="material"
size="small"
placeholder="材质"
readonly
style="margin: 10px;width:180px"/>
</div>
</el-card>
<el-card>
<div>
<el-table v-loading="listLoading" :data="tableData" border style="width: 100%;" height="550px">
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="name" label="工艺名称" width="180" align="center">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].name" style="width:150px" placeholder="工艺名称" readonly/>
</template>
</el-table-column>
<el-table-column prop="request" label="工艺要求" align="center">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].request" :rows="1" placeholder="工艺要求" type="textarea" readonly/>
</template>
</el-table-column>
<el-table-column prop="singleton" label="单件" width="180" align="center">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].singleton" :readonly="tableData[scope.$index].name===''" style="width:150px" placeholder="单件"/>
</template>
</el-table-column>
<el-table-column prop="Settlement" label="准结" width="180" align="center">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].Settlement" :readonly="tableData[scope.$index].name===''" style="width:150px" placeholder="准结"/>
</template>
</el-table-column>
<el-table-column v-if="isShow" prop="budget" label="外协预算" width="180" align="center">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].budget" style="width:150px" placeholder="外协预算" readonly/>
</template>
</el-table-column>
</el-table>
<el-button v-if="radio === 2" type="primary" icon="el-icon-cjn-09" size="small" style="float:right;margin: 10px" @click="ADD">保存</el-button>
<el-button v-if="radio === 1" type="primary" icon="el-icon-cjn-09" size="small" style="float:right;margin: 10px" @click="ADD1">保存</el-button>
</div>
</el-card>
</div>
</template>
<script>
import { getPerson, mainTable, getPartnames1, getPartnames2, detailInfo, mainTable1, TableAddLi, TableAddLi1 } from '@/api/ManufacturingCenter/QuotaFormulation'
export default {
data() {
return {
listLoading: false,
shuliang: '',
q: 0,
result: 0,
budget1: [],
personValue: '',
person: [],
radio: 1, // 第一组
radio1: 1, // 第二组
partNumValue: '', // 零件号值
partNum: [], // 零件号
typeValue: '', // 种类
CraftsmenValue: '', // 工艺员值
Craftsmen: [], // 工艺员
CraftmanValue: '', // 完艺表单工艺员值
Craftman: [], // 完艺表单工艺员
partName: '', // 零件名称
batchNum: '', // 投产总数量
material: '', // 材质
// materialClass: [], // 材质类
typicalClassValue: '', // 典型工艺零件分类值
typicalClass: [], // 典型工艺零件分类
partNameValue1: '', // 典型工艺零件名称值
partName1: [], // 典型工艺零件名称
partNameValue1check: false, // 典型工艺零件名称check
processNumValue: '', // 典型工艺号值
processNum: [], // 典型工艺号
processNumValuecheck: false, // 典型工艺号check
remark: '', // 备注
remark1: '', // 完艺零件名称
numVal: '', // 输入数值
tolerance: '', // 公差
tableData: [],
tableData3: null, // 工艺定额人员
tableData4: null, // 完艺表格
processSelect: [], // 工艺分类流水号
processNameClass: [], // 工艺名称分类
processNameClassValue: '',
processName: [], // 工艺名称
processNameValue: '',
processRequest: [], // 工艺要求
processRequestValue: '',
processN1: [], // 工艺编号
str: '', // 拼接字符串用的
value: '', // 第一个select的
input1: '', // 种类
checked: false, // 是否核准
checked1: false, // 修改
input: '', // 规格
isShow: false, // 2的可见性
date0: ['', ''], // 完艺时间段
PN: '0000', // 零件号0000
num: '', // 工艺计划流水号
num0: '', // 主表工艺计划流水号
perNum: [],
tuhao: [],
tuhaoValue: '',
check1: '',
check2: '',
check3: '',
check4: '',
input2: '',
list: null,
value7: '',
restaurants: [],
state4: '',
timeout: null
}
},
created() {
this.fetchData()
},
methods: {
fetchData() { // 初始化未编制零件号、材料、公差
getPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
getPartnames1().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号
})
}
})
},
personChange() {
if (this.radio === 2) {
this.shuliang = '加载中...'
this.partNumValue = ''
this.partNum = []
this.typeValue = ''
this.Craftsmen = ''
this.batchNum = ''
this.material = ''
this.partName = ''
this.tableData = [] // 清主表
getPartnames2(this.personValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号
})
}
this.shuliang = '已编制的数量' + this.partNum.length
})
}
},
radioChange() { // radio改变 编制情况 获取不同零件号
if (this.radio === 2) { // 已编制
this.isShow = true
this.partNumValue = ''
this.partNum = []
this.typeValue = ''
this.Craftsmen = ''
this.partName = ''
this.batchNum = ''
this.material = ''
this.personValue = ''
this.tableData = [] // 清主表
} else { // 未编制
this.shuliang = ''
this.isShow = false
this.partNumValue = ''
this.partNum = []
this.typeValue = ''
this.Craftsmen = ''
this.partName = ''
this.batchNum = ''
this.material = ''
this.personValue = ''
this.tableData = [] // 清主表
getPartnames1().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号
})
}
})
}
},
typeChange() { // 当零件号改变时,改变种类、工艺员、零件名称、投产总数量、材质,并且显示主表信息
this.listLoading = true
this.tableData = []
this.num0 = ''
if (this.radio === 1) {
detailInfo(this.partNumValue).then(response => {
this.typeValue = response.data[0].零件类型名称
this.partName = response.data[0].零件名称
this.batchNum = response.data[0].批次数量
this.num0 = response.data[0].工艺计划流水号
console.log(response.data[0].工艺计划流水号, 520)
this.material = response.data[0].材料
mainTable(this.num0).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
name: response.data[i].工艺名称,
request: response.data[i].工艺要求,
num1: response.data[i].工序流水号,
Settlement: response.data[i].准结定额工时,
singleton: response.data[i].单件定额工时,
lingjian: response.data[i].零件图号,
numm: response.data[i].工艺计划流水号
})
}
this.listLoading = false
})
})
} else {
detailInfo(this.partNumValue).then(response => {
this.typeValue = response.data[0].零件类型名称
this.partName = response.data[0].零件名称
this.batchNum = response.data[0].批次数量
this.num0 = response.data[0].工艺计划流水号
this.material = response.data[0].材料
})
mainTable1(this.partNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
name: response.data[i].工艺名称,
request: response.data[i].工艺要求,
num1: response.data[i].工序流水号,
Settlement: response.data[i].准结定额工时,
singleton: response.data[i].单件定额工时,
budget: response.data[i].外协预算价格1,
lingjian: response.data[i].零件图号,
numm: response.data[i].工艺计划流水号
})
}
this.listLoading = false
})
}
},
ADD() {
this.result = 0
for (let i = 0; i < this.tableData.length; i++) {
TableAddLi(this.tableData[i].singleton, this.tableData[i].Settlement, this.tableData[i].lingjian, this.tableData[i].num1, this.tableData[i].numm).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.tableData.length) {
this.$message.success('保存成功')
} else if (response.data[0].result === '0') {
this.$message.error('第' + (i + 1) + '行保存失败')
}
})
}
},
ADD1() {
this.result = 0
if (this.personValue === '') {
this.$message.error('请选择人员')
} else {
for (let i = 0; i < this.tableData.length; i++) {
TableAddLi(this.tableData[i].singleton, this.tableData[i].Settlement, this.tableData[i].lingjian, this.tableData[i].num1, this.tableData[i].numm).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.tableData.length) {
TableAddLi1(this.partNumValue, this.personValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('保存成功')
this.radioChange()
} else {
this.$message.error('保存失败')
}
})
} else if (response.data[0].result === '0') {
this.$message.error('保存失败')
}
})
}
}
}
}
}
</script>
<style scoped>
.doing-row4{
background: #f0f9eb;
}
.el-card{
margin-bottom: 15px;
}
</style>

View File

@@ -0,0 +1,390 @@
<template>
<div class="app-container">
<el-card>
<span>人员名称:</span>
<el-input v-model="personnelNumber" placeholder="请选择人员名称" class="input-with-select" readonly clearable size="small" style="width:200px;margin:10px;">
<el-button slot="append" icon="el-icon-search" size="small" @click="dialogTableVisible"/>
</el-input>
<el-button type="success" class="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;searchTable()">查询</el-button>
<el-button type="primary" class="el-icon-circle-plus-outline" size="small" @click="editType1('form');param = 0">新增</el-button>
</el-card>
<el-card>
<el-table v-loading="loading0" :data="tableData" height="650" style="width: 100%;" border>
<el-table-column
label="序号"
type="index"
align="center"
width="50"/>
<el-table-column label="工艺名称" align="center" width="280px">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column label="修补工时" align="center" width="110px">
<template slot-scope="scope">
{{ scope.row.修补工时 }}
</template>
</el-table-column>
<el-table-column label="年" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="月" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="人员" align="center" width="140px">
<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="150px" 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>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading0"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :title="title1" :visible.sync="dialogFormVisible" center>
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm" style="width: 48%;margin: auto">
<el-form-item label="工艺" prop="TechnologyValue">
<el-select v-model="form.TechnologyValue" filterable size="small">
<el-option
v-for="item in Technology"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="年" prop="yearNumberValue">
<el-select v-model="form.yearNumberValue" size="small">
<el-option
v-for="item in yearNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="月" prop="monthNumberValue">
<el-select v-model="form.monthNumberValue" size="small">
<el-option
v-for="item in monthNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="修补工时" prop="timeNumber">
<el-input v-model="form.timeNumber" placeholder="修补工时" clearable size="small" style="width: 200px"/>
</el-form-item>
<el-row>
<el-col :span="14"/>
<el-form-item >
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button size="small" type="primary" @click="submit('form')"> </el-button>
</el-form-item>
</el-row>
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible1" title="人员信息" center width="750px">
<div style="height: 500px">
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
<el-tree
:data="data2"
node-key="id"
style="width: 150px;float: left"
height="400"
accordion
@node-click="handleNodeClick"
/>
</div>
<el-table :data="List1" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleCurrentChange2">
<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>
</div>
<el-button style="margin-left: 260px" @click="dialogFormVisible1 = false">取消</el-button>
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button>
</el-dialog>
</div>
</template>
<script>
import { getTable8, getTree, fn, dialogtablevisible, searchTechnology, searchperson, searchtable, edittype, handlechange } from '@/api/ManufacturingCenter/RepairTimeEntry'
export default {
data() {
return {
codes2: '',
Number2: '',
codes: '',
Number1: '',
Name: '',
ssks: '',
List1: [],
data2: [],
dialogFormVisible1: false,
a: '', // 初始化赋值中间变量
liushuihao: '', // 编辑流水号
renyuanbianhao: '', // 编辑人员编号
personnelNumber: '', // 人员编号
form: {
TechnologyValue: '',
yearNumberValue: '',
monthNumberValue: '',
timeNumber: ''
},
Technology: [], // 工艺
yearNumber: [], // 年
monthNumber: [], // 月
loading0: false,
count1: 0, // 清表单验证计数器
count2: 0, // 清表单验证计数器
tableData: [], // 表格数据
pageSize: 10,
pageCurrent: 1,
total: 0,
dialogFormVisible: false,
title1: '',
rules: {
TechnologyValue: [{ required: true, message: '请选择工艺', trigger: 'change' }],
timeNumber: [{ required: true, message: '请输入修补工时', trigger: 'blur' }]
}
}
},
created() {
this.fetchData()
this.fetchData3()
this.searchTable()
},
methods: {
handleCurrentChange2(row) { // 获取当前行人员信息
this.ssks = row.节点名称
this.Number1 = row.人员编号
this.codes = row.序号
this.Name = row.姓名
},
getName() { // 提交人员
this.dialogFormVisible1 = false
this.personnelNumber = this.Name
this.codes2 = this.codes
this.Number2 = this.Number1
},
handleNodeClick(data) { // 树节点点击
this.ssks = data.label
getTable8(data.id).then(response => {
this.List1 = response.data
})
},
fetchData3() {
getTree().then(response => { // 获取人员信息树
const data = response.data
this.data2 = fn(data, 0)
})
},
dialogTableVisible() {
this.dialogFormVisible1 = true
dialogtablevisible()
},
// 初始化工艺
fetchData() {
var time = new Date()
this.form.TechnologyValue = ''
this.Technology = []
searchTechnology().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Technology.push({
label: response.data[i].工艺名称,
value: response.data[i].工艺编号
})
}
})
for (let i = time.getFullYear() - 2; i <= time.getFullYear() + 2; i++) {
if (i === time.getFullYear()) {
this.a = i
}
this.yearNumber.push({
label: i,
value: i
})
}
for (let i = 0; i < 12; i++) {
this.monthNumber.push({
label: i + 1,
value: i + 1
})
}
this.form.yearNumberValue = this.a
this.form.monthNumberValue = 1
},
// 查询
searchTable() {
this.tableData = []
this.loading0 = true
if (this.personnelNumber !== '' && this.personnelNumber !== null) {
searchtable(1, this.Number2, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
this.loading0 = false
})
} else {
searchtable(0, this.Number2, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
this.loading0 = false
})
}
},
// 增加打开
editType1(formName) {
if (this.personnelNumber === '' || this.personnelNumber === null) {
this.$message.error('请输入人员编号')
} else {
this.count1 = this.count1 + 1
if (this.count1 !== 1) {
this.$refs[formName].resetFields()
}
this.title1 = '增加'
this.form.TechnologyValue = ''
this.form.timeNumber = ''
this.dialogFormVisible = true
}
},
// 增加确定
editType() {
searchperson(this.codes2).then(response => {
if (response.data.length !== 0) {
edittype(response.data[0].人员编号, this.form.TechnologyValue, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.pageCurrent = 1
this.pageSize = 10
this.searchTable()
this.dialogFormVisible = false
} else {
this.$message.error('增加失败')
this.dialogFormVisible = false
}
})
} else {
this.$message.error('人员编号无效')
this.dialogFormVisible = false
}
})
},
// 编辑打开
handleChange1(index, row, formName) {
this.count2 = this.count2 + 1
if (this.count2 !== 1) {
this.$refs[formName].resetFields()
}
this.renyuanbianhao = row.人员编号
this.liushuihao = row.员工月修补工时流水号
this.form.TechnologyValue = parseInt(row.工艺编号)
this.form.yearNumberValue = row.
this.form.monthNumberValue = row.
this.form.timeNumber = row.修补工时
this.dialogFormVisible = true
this.title1 = '编辑'
},
// 编辑确定
handleChange() {
handlechange(this.liushuihao, this.renyuanbianhao, this.form.TechnologyValue, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchTable()
} else {
this.$message.error('修改失败')
}
})
this.dialogFormVisible = false
},
// 提交添加或者修改
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.param === 0) {
this.editType()
} else {
this.handleChange()
}
} else {
return false
}
})
},
// 重置表单
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
</style>

View File

@@ -0,0 +1,528 @@
<!--零件报废补投-->
<template>
<div class="app-container">
<el-card>
<div>
<!--项目名称-->
<span>项目名称:</span>
<el-select v-model="ProjectNameValue" placeholder="请选择项目名称" style="width:200px" clearable size="small" @change="fetchMachineDrawingData" @clear="MachineDrawingValue = '';MachineDrawing = [];Team = [];TeamValue = ''">
<el-option
v-for="item in ProjectName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--机床号-->
<span style="margin-left: 15px">机床号:</span>
<el-select v-model="MachineDrawingValue" placeholder="请选择机床图号" style="width:200px" clearable size="small" @change="fetchTeamDrawingData" @clear="Team = [];TeamValue = ''">
<el-option
v-for="item in MachineDrawing"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--组号-->
<span style="margin-left: 15px">组号:</span>
<el-select v-model="TeamValue" placeholder="请选择组号" style="width:200px" clearable size="small">
<el-option
v-for="item in Team"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 15px">零件图号:</span>
<el-input v-model="PartDrawing" placeholder="请输入零件图号" size="small" style="width: 200px" clearable/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 20px" @click="currentPage1=1; fetchTableData()">查询</el-button>
</div>
</el-card>
<el-card>
<el-table
v-loading="loading"
:data="tableData"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(226,223,223,1)"
height="250"
highlight-current-row
border
stripe
style="width: 100%; text-align: center"
@current-change="fetchTableData2">
<el-table-column
prop="province1"
label="零件号"
>
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
</el-table-column>
<el-table-column
prop="province2"
label="零件名称"
>
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
</el-table-column>
<el-table-column
prop="province4"
label="批次数量"
>
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
</el-table-column>
<el-table-column
prop="province5"
label="开始时间"
>
<template slot-scope="scope">{{ scope.row.机加工开始时间 }}</template>
</el-table-column>
<el-table-column
prop="province6"
label="结束时间"
>
<template slot-scope="scope">{{ scope.row.机加工结束时间 }}</template>
</el-table-column>
<el-table-column
prop="province7"
label="批次零件状态"
>
<template slot-scope="scope">
<div v-if="scope.row.批次零件状态 === '2'">停产</div>
<div v-else >正常生产</div>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="100px"
>
<template slot-scope="scope" >
<el-button type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="currentPage1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<el-table
v-loading="loading2"
:data="tableData2"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(226,223,223,1)"
height="250"
highlight-current-row
border
stripe
style="width: 100%">
<el-table-column
width="80px"
prop="province1"
label="工序顺序"
>
<template slot-scope="scope">{{ scope.row.工序顺序 }}</template>
</el-table-column>
<el-table-column
width="200px"
prop="province2"
label="工艺名称"
>
<template slot-scope="scope">{{ scope.row.工艺名称 }}</template>
</el-table-column>
<el-table-column
prop="province4"
label="工艺要求"
>
<template slot-scope="scope">{{ scope.row.工艺要求 }}</template>
</el-table-column>
<el-table-column
width="80px"
prop="province5"
label="单件定额工时"
>
<template slot-scope="scope">{{ scope.row.单件定额工时 }}</template>
</el-table-column>
<el-table-column
width="80px"
prop="province6"
label="准结定额工时"
>
<template slot-scope="scope">{{ scope.row.准结定额工时 }}</template>
</el-table-column>
<el-table-column
width="100px"
prop="province7"
label="工艺是否完成"
>
<template slot-scope="scope">
<div v-if="scope.row.工序状态 === '4'"><div style="width: 12px;height: 12px;border-radius: 50%;background-color: rgb(103, 194, 58);display: inline-block;margin:0px 5px 0 0"/>完成</div>
<div v-else ><div style="width: 12px;height: 12px;border-radius: 50%;background-color: red;display: inline-block;margin:0px 5px 0 0"/>未完成</div>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="currentPage2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
<!--编辑对话框-->
<div style="text-align: left">
<el-dialog :visible.sync="dialogeditVisible" title="编辑" style="width: 800px;margin: auto" center >
<el-form ref="form" :model="form" label-position="left">
<el-form-item label="零件号" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
<el-input v-model="form.input1" :disabled="true" auto-complete="off" style="margin-left: 20px"/>
</el-form-item>
<el-form-item label="批次零件状态" label-width="123px" style="margin-bottom: 18px; display: inline-block" prop="input2">
<el-radio-group v-model="radio" fill="#B2DFEE" boolean @change="remark()">
<el-radio-button label="正常生产"/>
<el-radio-button label="停止生产"/>
</el-radio-group>
</el-form-item>
<el-form-item label="开始时间" label-width="120px" style="margin-bottom: 18px; display: inline-block">
<el-date-picker
v-model="input3"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="选择日期"/>
</el-form-item>
<el-form-item label="结束时间" label-width="120px" style="margin-bottom: 18px; display: inline-block">
<el-date-picker
v-model="input4"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="选择日期"/>
</el-form-item>
</el-form>
<div style="margin-right: 60px;margin-top: 10px">
<el-button style="margin-left: 35%" @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="submit('form')">确定</el-button>
</div>
</el-dialog>
</div>
<el-dialog :visible.sync="dialogeditVisible1" title="停产记录" style="width: 800px;margin: auto" center>
<el-form ref="form2" :model="form2" label-position="left">
<el-form-item label="停产原因" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
<el-input v-model="form2.reason" auto-complete="off"/>
</el-form-item>
<el-form-item label="停产时间" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
<el-date-picker
v-model="form2.time"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="选择日期"/>
</el-form-item>
</el-form>
<div style="margin-left: 140px;margin-top: 10px">
<el-button type="primary" @click="submitRemark()">确定</el-button>
</div>
</el-dialog>
<el-card>
<div>停产后,将重新补投两种零件一种是接着加工(执行原来的加工计划)另一种是从第一序重新加工(重新制定零件的加工计划)补投的零件号后加B</div>
<div style="margin-top: 20px; display: block">
<span>补投接着加工零件数量</span>
<el-input v-model="inputA" auto-complete="off" style="width: 200px" size="small"/>
<span>开始工序</span>
<el-input v-model="inputB" :disabled="true" auto-complete="off" style="width: 200px" size="small"/>
<el-button :disabled="disabled" type="success" size="small" @click="editA">补投接着生产零件</el-button>
</div>
<div style="margin-left: 800px; display: block">>>>><el-button type="success" size="small" style="margin-left: 40px" @click="goToCapacityBalance()">制定计划</el-button></div>
<div style="margin-top: 20px; display: block">
<span>补投重新加工零件数量</span>
<el-input v-model="inputC" auto-complete="off" style="width: 200px" size="small" />
<span>开始工序</span>
<el-input v-model="inputD" :disabled="true" auto-complete="off" style="width: 200px" size="small"/>
<el-button :disabled="disabledB" type="success" size="small" @click="editB">补投重新生产零件</el-button>
</div>
</el-card>
<el-card>
<el-table
:data="tableData4"
height="250"
highlight-current-row
border
stripe
style="width: 100%">
<el-table-column
prop="province1"
label="零件号"
>
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
</el-table-column>
<el-table-column
prop="province2"
label="零件名称"
>
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
</el-table-column>
<el-table-column
prop="province4"
label="重投数量"
>
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
</el-table-column>
<el-table-column
prop="province5"
label="开始工序"
>
<template slot-scope="scope">{{ scope.row.开始工序 }}</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { ProjectNameSelect, MachineDrawingSelect, TeamSelect, TableDataSelect, editTime, editStop, TableDta2Select, editA, TableData3Select, editchar } from '@/api/ManufacturingCenter/SparePartsForScrap'
export default {
data() {
return {
remark1: '',
remark2: '',
disabledB: false,
tableData4: [],
judge: '',
ProjectNameValue: '', // 项目名称
ProjectName: [], // 项目名称下拉框
MachineDrawingValue: '', // 机床号
MachineDrawing: [], // 机床图号下拉框
TeamValue: '', // 组号
Team: [], // 组号下拉框
currentPage1: 1,
pageSize1: 10,
total1: null,
currentPage2: 1,
pageSize2: 10,
total2: null,
tableData: [], // 主表格数据
tableData2: [], // 次表格数据
loading: '', // 主表格加载
loading2: '', // 次表格加载
ProjectCode_check: '', // 项目流水号_check
MachineCode_check: '', // 机床流水号_check
TeamCode_check: '', // 组件流水号_check
ComponentPartsBasicCattleTaxNumber_check: 0, // 组件零件基本件流水号_check
ComponentPartsBasicCattleTaxNumber: '', // 组件零件基本件流水号
CutCode_check: 0, // 工艺计划流水号_check
CutCode: '', // 工艺计划流水号
CutCodeBefore_check: 0, // 工艺计划流水号_补投前_check
CutCodeBefore: '', // 工艺计划流水号_补投前
Assess_check: 1, // 考核状态_check
Assess: 6, // 考核状态
PartDrawing_check: '', // 零件图号_check
PartDrawing: '', // 零件图号
dialogeditVisible: false, // 编辑对话框可见性
dialogeditVisible1: false, // 编辑对话框可见性
code: '', // 工艺计划流水号
temp: '', // 是否停产中间值
disabled: false,
form: {
input1: '',
input2: ''
},
form2: {
reason: '',
time: ''
},
radio: '',
input3: '', // 开始时间
input4: '', // 结束时间
inputA: 1,
inputB: '',
inputC: 1,
inputD: 1
}
},
created() {
this.fetchProjectNameData()
},
methods: {
// 项目名称查询
fetchProjectNameData() {
this.getSelect(ProjectNameSelect, ['项目名称', '项目流水号'], 'ProjectName', this.Assess)
},
// 机床图号查询
fetchMachineDrawingData() {
this.Team = []
this.TeamValue = ''
this.getSelect(MachineDrawingSelect, ['机床图号', '机床流水号'], 'MachineDrawing', this.ProjectNameValue)
},
// 组号查询
fetchTeamDrawingData() {
this.getSelect(TeamSelect, ['组号', '组件流水号'], 'Team', this.MachineDrawingValue)
},
fetchTableData() {
this.loading = true
this.ProjectNameValue ? this.ProjectCode_check = 1 : this.ProjectCode_check = 0
this.MachineDrawingValue ? this.MachineCode_check = 1 : this.MachineCode_check = 0
this.TeamValue ? this.TeamCode_check = 1 : this.TeamCode_check = 0
this.PartDrawing ? this.PartDrawing_check = 1 : this.PartDrawing_check = 0
this.getTable(TableDataSelect, [this.ProjectCode_check, this.ProjectNameValue, this.MachineCode_check, this.MachineDrawingValue, this.TeamCode_check, this.TeamValue, this.ComponentPartsBasicCattleTaxNumber_check, this.ComponentPartsBasicCattleTaxNumber, this.CutCode_check, this.CutCode, this.CutCodeBefore_check, this.CutCodeBefore, this.Assess_check, this.Assess, this.PartDrawing_check, this.PartDrawing, this.currentPage1, this.pageSize1], ['tableData', 'total1', 'loading'])
},
fetchTableData2(row) {
if (row) {
this.disabled = false
this.judge = row.批次零件状态
this.CutCodeBefore = row.工艺计划流水号
TableDta2Select(row.工艺计划流水号, this.currentPage2, this.pageSize2).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].工序状态 === '4') {
this.inputB = this.inputB + 1
}
if (response.data.rows[i].工序状态 !== '4') {
this.inputB = response.data.rows[i].工序顺序
break
}
}
})
}
},
handleSizeChange1(val) {
this.currentPage1 = 1
this.pageSize1 = val
this.fetchTableData()
},
handleCurrentChange1(val) {
this.currentPage1 = val
this.fetchTableData()
},
handleSizeChange2(val) {
this.pageSize2 = val
TableDta2Select(this.CutCodeBefore, this.currentPage2, this.pageSize2).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
this.currentPage2 = 1
this.pageSize2 = 10
},
handleCurrentChange2(val) {
this.currentPage2 = val
TableDta2Select(this.CutCodeBefore, this.currentPage2, this.pageSize2).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
this.currentPage2 = 1
this.pageSize2 = 10
},
handleEdit(row) {
this.remark1 = ''
this.remark2 = ''
this.form2.reason = ''
this.form2.time = ''
this.dialogeditVisible = true
this.form.input1 = row.零件图号
if (row.批次零件状态 === '2') {
this.radio = '停止生产'
} else if (row.批次零件状态 === '1') {
this.radio = '正常生产'
}
this.input3 = row.机加工开始时间
this.input4 = row.机加工结束时间
this.code = row.工艺计划流水号
},
async chaEdit() {
this.radio === '正常生产' ? this.temp = '1' : this.temp = '2'
const Time = await editTime(this.code, this.input3, this.input4)
const Char = await editchar(this.remark1, this.remark2, this.code)
const Stop = await editStop(this.code, this.temp)
if (Time.data[0].result === '1' && Char.data[0].result === '1' && Stop.data[0].result === '1') {
this.dialogeditVisible = false
this.$message.success('信息更新成功')
this.fetchTableData()
} else {
this.$message.error('信息更新失败')
}
},
// 提交添加或者修改
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.chaEdit()
}
})
},
// 重置表单
callOff(formName) {
this.form = {}
this.dialogeditVisible = false
this.$refs[formName].resetFields()
},
editA() {
if (this.judge === '2') {
editA(this.CutCodeBefore, this.inputA, this.inputB).then(response => {
if (response.data[0].result === '1') {
this.$message.success('补投成功')
this.disabled = true
TableData3Select(0, this.ProjectNameValue, 0, this.MachineDrawingValue, 0, this.TeamValue, 0, this.ComponentPartsBasicCattleTaxNumber, 0, this.CutCode, 1, this.CutCodeBefore).then(response => {
this.tableData4 = response.data
})
} else {
this.$message.error('补投失败')
}
})
} else { this.$message.warning('请选择停产零件') }
},
editB() {
if (this.judge === '2') {
editA(this.CutCodeBefore, this.inputC, this.inputD).then(response => {
if (response.data[0].result === '1') {
this.$message.success('补投成功')
this.disabledB = true
TableData3Select(0, this.ProjectNameValue, 0, this.MachineDrawingValue, 0, this.TeamValue, 0, this.ComponentPartsBasicCattleTaxNumber, 0, this.CutCode, 1, this.CutCodeBefore).then(response => {
this.tableData4 = response.data
})
} else {
this.$message.error('补投失败')
}
})
} else { alert('请选择停产零件') }
},
goToCapacityBalance() {
this.$router.push({ path: '/ProductionCapacityBalance/index' })
},
remark() {
if (this.radio === '停止生产') {
this.form2.reason = ''
this.form2.time = ''
this.dialogeditVisible1 = true
}
},
submitRemark() {
this.remark1 = this.form2.reason
this.remark2 = this.form2.time
this.dialogeditVisible1 = false
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px;
}
</style>

View File

@@ -0,0 +1,512 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select
v-model="entryNameValue"
:remote-method="remoteMethod"
placeholder="项目名称"
style="width:200px"
size="small"
clearable
filterable
remote
@change="empty">
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床号:</span>
<el-input v-model="machineToolNumber" placeholder="机床号" size="small" clearable style="width:200px" @dblclick.native="SearchMachine" @change="empty1"/>
<span>组号:</span>
<el-input v-model="groupNumber" placeholder="组号" size="small" clearable style="width:200px" @dblclick.native="searchGroupList"/>
<span>零件号:</span>
<el-input v-model="partNumber" placeholder="零件号" size="small" clearable style="width:200px"/>
<br>
<span>零件状态:</span>
<el-select v-model="partStateValue" placeholder="零件状态" size="small" clearable style="width:200px">
<el-option
v-for="item in partState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件类型:</span>
<el-select v-model="partTypeValue" placeholder="零件类型" size="small" clearable style="margin-top: 15px;width: 200px">
<el-option
v-for="item in partType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" icon="el-icon-search" size="small" style="margin: 15px 0 0 10px" @click="pageCurrent=1;pageSize=10;total=0;searchData()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="loading0"
:data="tableData"
style="width: 100%;max-height: 600px"
height="600"
size="mini"
highlight-current-row
border>
<el-table-column align="center" label="序号" type="index" width="60px"/>
<el-table-column align="center" label="机床图号" width="170px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号" width="140px">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件图号" width="200px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称" width="180px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="60px">
<template slot-scope="scope">
{{ scope.row.投产总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="投产时间" width="130px">
<template slot-scope="scope">
{{ scope.row.传递时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件状态" width="750px">
<template slot-scope="scope">
<el-steps :active="scope.row.考核状态" finish-status="success" simple>
<el-step title="投产" />
<el-step title="工艺" />
<el-step title="定额" />
<el-step title="平衡" />
<el-step title="完成" />
<el-step title="入库" />
<el-step title="出库" />
</el-steps>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="120px">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleEdit(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible4" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="零件状态" prop="零件状态" style="margin-left: 200px">
<el-select v-model="form.零件状态" placeholder="零件状态" size="small" clearable>
<el-option
v-for="item in partState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel('form')">取消</el-button>
<el-button type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="选择机床" center style="min-height: 300px">
<el-table
:data="tableData6"
style="width:100%;max-height: 300px;display: inline-block"
height="300"
highlight-current-row
border
@row-click="selectMachine">
<el-table-column align="center" label="机床图号">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床名称">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床开始时间">
<template slot-scope="scope">
{{ scope.row.机床开始时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床结束时间">
<template slot-scope="scope">
{{ scope.row.机床结束时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="工位属性">
<template slot-scope="scope">
{{ scope.row.工位属性 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床主管">
<template slot-scope="scope">
{{ scope.row.机床主管 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitName">提交</el-button>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="选择组号" center style="min-height: 300px">
<el-table
:data="tableData7"
style="width:100%;max-height: 300px;display: inline-block"
height="300"
highlight-current-row
border
@row-click="selectGroup">
<el-table-column align="center" label="机床图号">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床名称">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组件名称">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="组件介绍">
<template slot-scope="scope">
{{ scope.row.组件介绍 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize2"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
<el-button type="primary" style="margin-left: 350px;margin-top: 20px" @click="submitGroup">提交</el-button>
</el-dialog>
</div>
</template>
<script>
import { initProject, intPartState, searchTable, searchmachine, searchgroup, editData } from '@/api/ManufacturingCenter/StatusQuery'
export default {
data() {
return {
loading0: false,
entryNameValue: '', // 项目流水号
entryName: [], // 项目数组
machineToolNumber: '', // 机床图号
machineNumber: '',
machine: null, // 机床流水号
groupNumber: '', // 组号
groupNumber1: '',
groupNum: null, // 组件流水号
partNumber: '', // 零件号
partStateValue: null, // 零件状态
partState: [], // 零件状态数组
partTypeValue: null, // 零件类型
num: null,
pageCurrent: 1,
pageSize: 10,
pageCurrent1: 1,
pageSize1: 10,
pageCurrent2: 1,
pageSize2: 10,
tableData7: [],
tableData6: [],
tableData: [],
state: null,
total: null,
total1: null,
total2: null,
title: '',
dialogFormVisible2: false,
dialogFormVisible3: false,
dialogFormVisible4: false,
List: [],
check: null,
check1: null,
check2: null,
check3: null,
check4: null,
check5: null,
partType: [{
value: 1,
label: '自家生产'
}, {
value: 2,
label: '外协生产'
}],
form: {
零件状态: null
},
rules: {
零件状态: [
{ required: true, message: '请选择零件状态', trigger: 'change' }
]
}
}
},
created() {
this.fetchData()
},
mounted() {
this.getList()
},
methods: {
fetchData() {
intPartState().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partState.push({
label: response.data[i].考核状态名称,
value: response.data[i].考核状态
})
}
})
},
searchData() {
if (this.entryNameValue !== null && this.entryNameValue !== '') {
this.check = 1
} else {
this.check = 0
}
if (this.machineToolNumber !== '') {
this.check1 = 1
} else {
this.check1 = 0
}
if (this.groupNumber !== '') {
this.check2 = 1
} else {
this.check2 = 0
}
if (this.partNumber !== '') {
this.check3 = 1
} else {
this.check3 = 0
}
if (this.partStateValue !== null && this.partStateValue !== '') {
this.check4 = 1
} else {
this.check4 = 0
}
if (this.partTypeValue !== null && this.partTypeValue !== '') {
this.check5 = 1
} else {
this.check5 = 0
}
this.loading0 = true
searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.partNumber, this.check4, this.partStateValue, this.check5, this.partTypeValue, this.pageSize, this.pageCurrent).then(response => {
console.log(response.data)
for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].考核状态 = parseInt(response.data.rows[i].考核状态) - 2
if (response.data.rows[i].传递时间 !== undefined || response.data.rows[i].hasOwnProperty('传递时间')) {
response.data.rows[i].传递时间 = response.data.rows[i].传递时间.split(' ', 2)[0]
}
}
this.loading0 = false
this.tableData = response.data.rows
this.total = parseInt(response.data.total)
})
},
getList() { // 初始化项目名称
this.list = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.list.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
remoteMethod(query) {
if (query !== '') {
setTimeout(() => {
this.entryName = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
})
}, 1000)
} else {
this.entryName = []
}
},
empty() {
this.machineToolNumber = ''
this.groupNumber = ''
},
SearchMachine() { // 查询机床
if (this.entryNameValue !== null && this.entryNameValue !== '') {
this.dialogFormVisible2 = true
this.check6 = 1
searchmachine(this.entryNameValue, this.check6, this.pageCurrent1, this.pageSize1).then(response => {
for (let i = 0; i < response.data.result.length; i++) {
if (response.data.result[i].机床开始时间 !== '') {
response.data.result[i].机床开始时间 = response.data.result[i].机床开始时间.substr(0, 10)
}
if (response.data.result[i].机床结束时间 !== '') {
response.data.result[i].机床结束时间 = response.data.result[i].机床结束时间.substr(0, 10)
}
}
this.tableData6 = response.data.result
this.total1 = parseInt(response.data.output[0].ItemCount)
})
} else {
this.$message.warning('请先选择项目')
}
},
selectMachine(row) { // 选择机床号
this.machine = row.机床流水号
this.machineNumber = row.机床图号
},
submitName() { // 提交机床号
this.machineToolNumber = this.machineNumber
this.dialogFormVisible2 = false
},
empty1() {
this.groupNumber = ''
},
searchGroupList() { // 查询组号
if (this.machineToolNumber !== '') {
this.dialogFormVisible3 = true
searchgroup(this.machine, this.pageCurrent2, this.pageSize2).then(response => {
this.tableData7 = response.data.result
this.total2 = parseInt(response.data.output[0].ItemCount)
})
} else {
this.$message.warning('请先选择机床')
}
},
selectGroup(row) { // 选择组号
this.groupNumber1 = row.组号
this.groupNum = row.组件流水号
},
submitGroup() { // 提交组号
this.groupNumber = this.groupNumber1
this.dialogFormVisible3 = false
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form = {}
this.title = '编辑'
this.dialogFormVisible4 = true
this.num = row.工艺计划流水号
},
submitEdit(formName) { // 提交编辑
this.$refs[formName].validate((valid) => {
if (valid) {
editData(this.num, this.form.零件状态).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible4 = false
this.pageCurrent = 1
this.searchData()
} else { this.$message.error('编辑失败') }
})
} else {
return false
}
})
},
cancel(formName) { // 取消
this.form = {}
this.dialogFormVisible4 = false
this.$refs[formName].resetFields()
},
handleSizeChange(val) {
this.pageSize = val
this.searchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchData()
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.SearchMachine()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.SearchMachine()
},
handleSizeChange3(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.searchGroupList()
},
handleCurrentChange3(val) {
this.pageCurrent2 = val
this.searchGroupList()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,305 @@
<!--典型工艺维护-->
<template>
<div class="app-container">
<el-card>
<div style="margin-top: -10px;">
<el-row>
<span>零件分类:</span>
<el-select v-model="partsCategoriesValue" size="small" filterable clearable placeholder="零件分类" @change="getPartsName">
<el-option
v-for="item in partsCategories"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件名称:</span>
<el-select v-model="partsNameValue" size="small" filterable clearable placeholder="零件名称" @change="getTableData" >
<el-option
v-for="item in partsName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>典型工艺号:</span>
<el-input v-model="typicalNumValue" auto-complete="off" style="width: 200px" size="small" />
<el-button size="small" type="primary" icon="el-icon-search" style="margin: 10px 0 0 10px" @click="getTableData">查询</el-button>
<el-button size="small" type="info" icon="el-icon-circle-plus-outline" style="margin: 10px 0 0 10px" @click="addTableData">增加</el-button>
<el-button size="small" type="success" icon="el-icon-cjn-09" style="margin: 10px 0 0 10px" @click="editConfirm">保存</el-button>
</el-row>
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" border style="width: 100%;max-height: 550px;" size="mini" height="550px">
<el-table-column prop="num" label="序号" width="50" align="center" type="index"/>
<el-table-column prop="name" label="工艺名称" width="230" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.工艺名称"
size="mini"
style="width:200px"
placeholder="工艺名称"
@dblclick.native="tableSearch(scope.$index)"/>
</template>
</el-table-column>
<el-table-column prop="hard" label="难度等级" width="110" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.工艺难度等级" size="mini" placeholder="请选择" @change="difficultyLevel(scope.row)">
<el-option v-for="item in hard" :key="item.value" :label="item.label" :value="item.value">
<span style="color: #8492a6; font-size: 13px">{{ item.value }}</span>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="request" label="工艺要求" align="center" min-width="350">
<template slot-scope="scope">
<el-input
v-model="scope.row.工艺要求"
:rows="1"
size="mini"
placeholder="工艺要求"
type="textarea"
@dblclick.native="tableSearch(scope.$index)"/>
</template>
</el-table-column>
<el-table-column prop="name" label="单件" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.单件定额工时" style="width:50px" placeholder="单件定额工时"/>
</template>
</el-table-column>
<el-table-column prop="name" label="准结" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.准结定额工时" style="width:50px" placeholder="准结定额工时"/>
</template>
</el-table-column>
<el-table-column label="操作" width="300" align="center" fixed="right">
<template slot-scope="scope">
<div>
<el-button
size="mini"
icon="el-icon-arrow-up"
type="primary"
@click="upMove(scope.row)"/>
<el-button
size="mini"
icon="el-icon-arrow-down"
type="primary"
@click="downMove(scope.row)"/>
<el-button
size="mini"
icon="el-icon-circle-plus-outline"
type="primary"
@click="insertRow(scope.row)"/>
<el-button
size="mini"
icon="el-icon-delete"
type="danger"
@click="delRow(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogFormVisible" title="工艺名称、工艺要求选择" center width="400px">
<el-form ref="form" :model="form" label-position="left" label-width="125px" class="demo-ruleForm">
<el-form-item label="工艺名称分类">
<el-select v-model="form.processNameClassValue" placeholder="分类" size="small" @change="classificationChange()">
<el-option
v-for="item in processNameClass"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="工艺名称">
<el-select v-model="form.processNameValue" placeholder="名称" size="small" @change="nameChange()">
<el-option
v-for="item in processName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="工艺要求">
<el-select v-model="form.processRequestValue" placeholder="要求" size="small">
<el-option
v-for="item in processRequest"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="confirmSelect()">确定选择</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getPartsCategories, getPartsName, getTableData, upMove, downMove, deleRow, editConfirm, processNameSelect, processRequestSelect, processNameClick, insertRow, difficultyLevel, isAddOrEdit, addProcess } from '@/api/ManufacturingCenter/TypicalProcessMaintenance'
export default {
data() {
return {
partsCategories: [],
partsCategoriesCheck: null,
partsCategoriesValue: '',
partsName: [],
partsNameCheck: null,
partsNameValue: '',
typicalNumValue: '',
tableData: [],
loading: false,
hard: [{ value: 'A' }, { value: 'B' }, { value: 'C' }],
dialogFormVisible: false,
form: {
processNameClassValue: '',
processNameValue: '',
processRequestValue: ''
},
processNameClass: [],
processName: [],
processRequest: [],
index: null
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(getPartsCategories, ['典型工艺名称分类', '典型工艺名称分类流水号'], 'partsCategories')
},
getPartsName() {
this.typicalNumValue = ''
this.partsName = []
this.partsNameValue = ''
getPartsName(this.partsCategoriesValue).then(res => {
const data = res.data
data.length > 0 ? this.partsNameValue = data[0].典型工艺流水号 : this.partsNameValue = ''
this.typicalNumValue = data[0].典型工艺号
data.map(item => {
this.partsName.push({
label: item.典型工艺名称,
value: item.典型工艺流水号
})
})
})
},
getTableData() {
this.partsCategoriesValue ? this.partsCategoriesCheck = 1 : this.partsCategoriesCheck = 0
this.partsNameValue ? this.partsNameCheck = 1 : this.partsNameCheck = 0
this.loading = true
getTableData(this.partsCategoriesCheck, this.partsCategoriesValue, this.partsNameCheck, this.partsNameValue).then(res => {
this.loading = false
this.tableData = res.data
})
},
upMove(row) {
upMove(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
if (res.data[0].result === '1') {
this.getTableData()
}
})
},
downMove(row) {
downMove(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
if (res.data[0].result === '1') {
this.getTableData()
}
})
},
insertRow(row) {
insertRow(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
if (res.data[0].result === '1') {
this.getTableData()
}
})
},
delRow(row) {
deleRow(row.典型工艺流水号, row.典型工艺工序流水号).then(res => {
if (res.data[0].result === '1') {
this.getTableData()
}
})
},
editConfirm() {
let index = 0
this.tableData.map(row => {
editConfirm(row.典型工艺流水号, row.典型工艺工序流水号, row.工艺序号, row.工艺编号, row.工艺要求, row.单件定额工时, row.准结定额工时, row.备注).then(res => {
if (res.data[0].result === '1') {
index++
} else {
this.$message.error('零件保存失败')
}
if (index === this.tableData.length) {
this.$message.success('保存修改成功')
this.getTableData()
}
})
})
},
tableSearch(index) {
this.index = index
this.dialogFormVisible = true
this.processNameClass = []
this.processName = []
this.form.processNameClassValue = ''
this.form.processNameValue = ''
this.form.processRequestValue = ''
this.getSelect(processNameClick, ['工艺分类名称', '工艺分类流水号'], 'processNameClass')
},
classificationChange() {
this.processName = []
this.processRequest = []
this.form.processNameValue = ''
this.form.processRequestValue = ''
this.getSelect(processNameSelect, ['工艺名称', '工艺编号'], 'processName', this.form.processNameClassValue)
},
nameChange() {
this.form.processRequestValue = ''
this.processRequest = []
this.getSelect(processRequestSelect, ['工艺要求'], 'processRequest', this.form.processNameValue)
},
confirmSelect() {
this.dialogFormVisible = false
for (let i = 0, len = this.processName.length; i < len; i++) {
if (this.processName[i].value === this.form.processNameValue) {
this.tableData[this.index].工艺名称 = this.processName[i].label
break
}
}
this.tableData[this.index].工艺编号 = this.form.processNameValue
this.tableData[this.index].工艺要求 = this.form.processRequestValue
},
difficultyLevel(row) {
difficultyLevel(row.工艺难度等级, row.典型工艺工序流水号)
},
async addTableData() {
if (this.partsNameValue) {
const result = await isAddOrEdit(this.partsNameValue)
if (result.data.length === 0) {
for (let i = 1; i < 21; i++) {
await addProcess(this.partsNameValue, i, 0)
}
this.getTableData()
} else {
this.$message.warning(`改工艺已存在!请修改工艺`)
}
} else {
this.$message.warning('请选择零件名称')
}
}
}
}
</script>
<style scoped>
span{
margin: 20px;
}
</style>

View File

@@ -0,0 +1,344 @@
<template>
<div class="app-container">
<el-card>
<span>设备名称:</span>
<el-input v-model="equipmentName" placeholder="设备名称" size="small" clearable style="width:200px;margin-left: 10px"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:30px" @click="pageCurrent = 1;fetchData()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd()">增加</el-button>
</el-card>
<el-card>
<el-table :data="List" highlight-current-row border>
<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" >
<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="200px" fixed="right" >
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="120px" class="demo-ruleForm">
<el-row>
<el-col :span = "12">
<el-form-item label="设备名称" prop="设备名称" >
<el-input v-model="form.设备名称" placeholder="设备名称" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="设备编号" prop="设备编号" >
<el-input v-model="form.设备编号" placeholder="设备编号" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span = "12">
<el-form-item label="设备型号" prop="设备型号" >
<el-input v-model="form.设备型号" placeholder="设备型号" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="设备性能指标" prop="设备性能指标" >
<el-input v-model="form.设备性能指标" placeholder="设备性能指标" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span = "12">
<el-form-item label="设备加工能力" prop="设备加工能力" >
<el-input v-model="form.设备加工能力" placeholder="设备加工能力" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="设备加工工艺" prop="设备加工工艺" >
<el-select v-model="form.设备加工工艺" placeholder="设备加工工艺" size="small" style="width:200px" clearable >
<el-option
v-for="item in processingName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span = "12">
<el-form-item label="班次类型" prop="班次类型" >
<el-select v-model="form.班次类型" placeholder="班次类型" size="small" style="width:200px" clearable >
<el-option
v-for="item in typeOfShift"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="设备工时系数" prop="设备工时系数" >
<el-input v-model="form.设备工时系数" placeholder="设备工时系数" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span = "12">
<el-form-item label="整改工时系数" prop="整改工时系数" >
<el-input v-model="form.整改工时系数" placeholder="整改工时系数" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="预留工时系数" prop="预留工时系数" >
<el-input v-model="form.预留工时系数" placeholder="预留工时系数" size="small" style="width:200px" clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="submit('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getData, initProcessing, addTable, editTable, deleteTable } from '@/api/ManufacturingCenter/WorkshopEquipmentManagement'
export default {
data() {
return {
equipmentName: '', // 设备名称
List: [],
check: 0,
pageCurrent: 1,
pageSize: 10,
total: null,
title: '',
dialogFormVisible: false,
processingName: [],
processing1: '', // 工艺名称简称
equipmentSerialNumber: '', // 设备流水号
typeOfShift: [
{ value: '0', label: 0 },
{ value: '1', label: 1 },
{ value: '2', label: 2 },
{ value: '3', label: 3 },
{ value: '4', label: 4 }],
form: {
设备名称: '',
设备编号: '',
设备型号: '',
设备性能指标: '',
设备加工能力: '',
设备加工工艺: '',
班次类型: '',
设备工时系数: '',
整改工时系数: '',
预留工时系数: ''
},
rules: {
设备名称: [{ required: true, message: '请选择设备名称', change: 'blur' }],
设备编号: [{ required: true, message: '请选择设备编号', change: 'blur' }],
设备型号: [{ required: true, message: '请选择设备型号', change: 'blur' }],
设备加工能力: [{ required: true, message: '请选择设备加工能力', change: 'blur' }],
设备加工工艺: [{ required: true, message: '请选择设备加工工艺', trigger: 'blur' }],
班次类型: [{ required: true, message: '请选择班次类型', trigger: 'blur' }],
设备工时系数: [{ required: true, message: '请选择设备工时系数', change: 'blur' }],
整改工时系数: [{ required: true, message: '请选择整改工时系数', change: 'blur' }],
预留工时系数: [{ required: true, message: '请选择预留工时系数', change: 'blur' }]
}
}
},
created() {
this.initialization()
},
methods: {
fetchData() {
if (this.equipmentName !== '') {
this.check = 1
} else {
this.check = 0
}
getData(this.check, this.equipmentName, this.pageCurrent, this.pageSize).then(response => {
this.List = response.data.rows
this.total = response.data.total
})
},
initialization() {
initProcessing().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.processingName.push({
label: response.data[i].工艺名称,
value: response.data[i].工艺编号,
processing: response.data[i].工艺名称简称
})
}
})
},
handleAdd() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.dialogFormVisible = true
this.title = '增加'
this.form = {}
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑'
this.dialogFormVisible = true
this.form.设备名称 = row.设备名称
this.form.设备编号 = row.设备编号
this.form.设备型号 = row.设备型号
this.form.设备性能指标 = row.设备性能指标
this.form.设备加工能力 = row.设备加工能力工时
this.form.班次类型 = row.班次类型
this.form.设备工时系数 = row.设备工时系数
this.form.整改工时系数 = row.整改工时比例
this.form.预留工时系数 = row.设备预留工时系数
this.equipmentSerialNumber = row.设备流水号
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.title === '增加') {
this.submitAdd()
this.title = ''
} else if (this.title === '编辑') {
this.submitEdit()
this.title = ''
}
}
})
},
submitAdd() {
for (let i = 0; i < this.processingName.length; i++) {
if (this.form.设备加工工艺 === this.processingName[i].value) {
this.processing1 = this.processingName[i].processing
}
}
addTable(this.form.设备名称, this.form.设备型号, this.form.设备性能指标, this.form.设备加工能力, this.form.设备工时系数, this.processing1, this.form.设备加工工艺, this.form.班次类型, this.form.整改工时系数, this.form.设备编号, this.form.预留工时系数).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息添加成功',
type: 'success'
})
this.dialogFormVisible = false
this.fetchData()
} else {
this.$message.error('信息添加失败')
}
})
},
submitEdit() {
editTable(this.equipmentSerialNumber, this.form.设备名称, this.form.设备型号, this.form.设备性能指标, this.form.设备加工能力, this.form.设备工时系数, this.form.班次类型, this.form.设备加工工艺, this.form.整改工时系数, this.form.设备编号, this.form.预留工时系数).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息编辑成功',
type: 'success'
})
this.dialogFormVisible = false
this.fetchData()
} else {
this.$message.error('信息编辑失败')
}
})
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteTable(row.设备流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.fetchData()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.fetchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.fetchData()
}
}
}
</script>