This commit is contained in:
Vergil
2020-02-03 15:46:37 +08:00
parent 9bdbacdfc4
commit 83b7a28113
24 changed files with 608 additions and 261 deletions

View File

@@ -321,7 +321,7 @@ export default {
this.dialogFormVisible2 = true
},
deleteProcess() {
this.$confirm('确定删除该合同?', '提示', {
this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<span>项目名称</span>
<el-select v-model="projectValue" filterable clearable size="small" style="margin-top:10px;width: 220px" placeholder="项目名称" @change="typeChange()">
<el-select v-model="projectValue" filterable clearable size="small" style="margin-right:10px;width: 180px" placeholder="项目名称" @change="typeChange">
<el-option
v-for="item in project"
:key="item.value"
@@ -10,13 +10,107 @@
:value="item.value"/>
</el-select>
<span>机床名称</span>
<el-select v-model="machineValue" clearable filterable size="small" style="margin-bottom:10px;width: 220px" placeholder="机床名称">
<el-select v-model="machineValue" clearable filterable size="small" style="margin-right:10px;width: 150px" placeholder="机床名称">
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>分组</span>
<el-select v-model="partValue" clearable filterable size="small" style="margin-right:10px;width: 80px" placeholder="分组">
<el-option
v-for="item in part"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>规格及型号</span>
<el-input v-model="specificationValue" clearable size="small" style="margin-right:10px;width: 150px" placeholder="规格型号"/>
<span>加工总工时小时:</span>
<el-input v-model="totalProcessingHours" clearable size="small" style="margin-right:10px;width: 100px"/>
<span>计划总工时小时:</span>
<el-input v-model="totalPlannedHours" clearable size="small" style="margin-right:10px;width: 100px"/>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchTable()">查询</el-button>
</el-card>
<el-card>
<el-table :data="tableData" highlight-current-row border style="width: 100%;" size="mini" height="300">
<el-table-column label="跟单号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.跟单号 }}
</template>
</el-table-column>
<el-table-column label="序号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.序号 }}
</template>
</el-table-column>
<el-table-column label="工序名" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.工序名 }}
</template>
</el-table-column>
<el-table-column label="计划数量" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.计划数量 }}
</template>
</el-table-column>
<el-table-column label="计划准备工时" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.计划准备工时 }}
</template>
</el-table-column>
<el-table-column label="单件计划工时" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.单件计划工时 }}
</template>
</el-table-column>
<el-table-column label="计划工时(分)" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.计划工时 }}
</template>
</el-table-column>
<el-table-column label="计划加工日期" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.计划加工日期 }}
</template>
</el-table-column>
<el-table-column label="加工数量" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.加工数量 }}
</template>
</el-table-column>
<el-table-column label="加工准备工时" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.加工准备工时 }}
</template>
</el-table-column>
<el-table-column label="单件加工工时" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.单件加工工时 }}
</template>
</el-table-column>
<el-table-column label="加工工时(分)" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.加工工时 }}
</template>
</el-table-column>
<el-table-column label="加工日期" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.加工日期 }}
</template>
</el-table-column>
<el-table-column label="图号及规格" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.图号及规格 }}
</template>
</el-table-column>
<el-table-column label="制品名称" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.制品名称 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
@@ -29,7 +123,13 @@ export default {
project: [],
projectValue: '', // 项目名称
machineValue: '', // 机床名称
machine: []
machine: [],
part: [], // 分組
partValue: '',
specificationValue: '', // 规格型号
totalProcessingHours: '', // 加工总工时
totalPlannedHours: '', // 计划总工时
tableData: [] // 详情表
}
},
created() {

View File

@@ -18,47 +18,51 @@
<el-tooltip :open-delay="1200" effect="dark" content="打印备料单" placement="top">
<el-button type="primary" size="small" icon="el-icon-printer" style="margin-left:10px" @click="exportTable('BL')">打印自家备料单</el-button>
</el-tooltip>
<el-tooltip :open-delay="1000" effect="dark" content="导出备料分配单" placement="top">
<el-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
</el-tooltip>
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="760" style="width: 100%;margin: 3px 0" size="mini" border stripe highlight-current-row element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="tableData" height="760" style="width: 1126px; margin: 3px 0" size="mini" border stripe highlight-current-row element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
width="50"
align="center"/>
<el-table-column label="打印状态" prop="备料打印" align="center">
<el-table-column label="备料分配" prop="备料分配" align="center" width="90">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="mini">已导出</el-tag>
<el-tag v-else type="warning" size="mini">未导出</el-tag>
<el-tag v-if="scope.row.备料打印 ==='1' && scope.row.是否外购备料==='0'" type="success" size="mini">自家</el-tag>
<el-tag v-if="scope.row.备料打印 ==='0' && scope.row.是否外购备料==='1'" type="success" size="mini">外购</el-tag>
<el-tag v-if="scope.row.备料打印 ==='0' && scope.row.是否外购备料==='0'" type="warning" size="mini">未分配</el-tag>
</template>
</el-table-column>
<el-table-column label="零件名称" prop="零件名称" align="center" >
<el-table-column label="零件名称" prop="零件名称" align="center" width="250" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" prop="零件图号" align="center" >
<el-table-column label="零件图号" prop="零件图号" align="center" width="180" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" >
<el-table-column label="数量" align="center" width="60">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="材料" align="center" >
<el-table-column label="材料" align="center" width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="重量" align="center" >
<el-table-column label="重量" align="center" width="60" >
<template slot-scope="scope">
{{ scope.row.重量 }}
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<el-table-column label="工艺要求" align="center" width="300" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
@@ -114,7 +118,7 @@
</template>
<script>
import { searchtable, searchtable2, edit, edit2 } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { searchtable, searchtable2, edit, edit2, getExport } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { exportExcelMethod } from './exportExcel'
import $ from 'jquery'
export default {
@@ -161,6 +165,7 @@ export default {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, 0, this.pageCurrent, this.pageSize).then(response => {
console.log(response)
if (response.data.total === 0) {
this.loading = false
} else {
@@ -178,6 +183,7 @@ export default {
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料打印: this.Data[i].备料打印,
是否外购备料: this.Data[i].是否外购备料,
工艺要求: response.data[0].工艺要求,
材料: this.Data[i].材料,
重量: this.Data[i].重量,
@@ -242,9 +248,38 @@ export default {
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
},
exportExcel() {
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
getExport(this.partNamecheck, this.partName, !this.all, 0).then(res => {
console.log(res.data)
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['备料分配', '零件名称', '零件图号', '数量', '材料', '重量', '工艺要求']
const filterVal = ['分配状态', '零件名称', '零件图号', '批次数量', '材料', '重量', '工艺要求']
const list = res.data
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '备料分配表',
autoWidth: true,
bookType: 'xlsx'
})
})
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
}
}
}
</script>
<style scoped>

View File

@@ -2,16 +2,6 @@
<div class="app-container">
<el-card>
<el-row>
<el-date-picker
v-model="time"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="加工日期"
style="width: 140px;margin-top: 10px"
clearable
@change="change"/>
<el-select v-model="Person" style="width:100px" placeholder="操作工" size="small" filterable clearable>
<el-option
v-for="item in Persons"
@@ -19,27 +9,12 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partNumber" size="small" placeholder="零件图号" style="width: 150px" clearable/>
<el-input v-model="partName" size="small" placeholder="零件名称" style="width: 140px" clearable/>
<el-input v-model="partNumber" size="small" placeholder="零件图号及名称" style="width: 200px" clearable/>
<el-input v-model="procedureName" size="small" placeholder="工序名称" style="width: 100px" clearable/>
<span>数量</span>
<el-input-number v-model="number" :min="0" :step="1" size="small" placeholder="数量" style="width: 120px" clearable/>
<span>单件工时</span>
<el-input-number v-model="workTime" :min="0" :step="1" size="small" placeholder="单件工时" style="width: 120px" clearable/>
<el-select v-model="PersonLiable" style="width:100px" placeholder="责任人" size="small" filterable clearable>
<el-option
v-for="item in Persons"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="ConfirmingPerson" style="width:100px" placeholder="确认人" size="small" filterable clearable>
<el-option
v-for="item in Persons"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="saveDate">保存</el-button>
@@ -66,16 +41,11 @@
{{ scope.row.操作工姓名 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="150">
<el-table-column label="零件图号及名称" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="工序名称" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.工序 }}
@@ -91,16 +61,6 @@
{{ 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="100">
<template slot-scope="scope">
{{ scope.row.确认人姓名 }}
</template>
</el-table-column>
<el-table-column label="录入人" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.录入人姓名 }}
@@ -116,7 +76,6 @@ import { mapGetters } from 'vuex'
export default {
data() {
return {
time: '',
Person: '',
Persons: [],
partNumber: '',
@@ -124,10 +83,8 @@ export default {
procedureName: '',
number: '',
workTime: '',
PersonLiable: '',
ConfirmingPerson: '',
tableData: [],
monthValue: ''
monthValue: new Date()
}
},
computed: {
@@ -141,11 +98,9 @@ export default {
},
created() {
this.searchPerson()
this.getNowFormatDate()
},
methods: {
change() {
console.log(this.time.slice(0, 7))
},
searchPerson() {
searchPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -156,6 +111,14 @@ export default {
}
})
},
getNowFormatDate() {
var year = this.monthValue.getFullYear()
var month = this.monthValue.getMonth() + 1
if (month >= 1 && month <= 9) {
month = '0' + month
}
this.monthValue = year + '-' + month
},
fetchDate() {
if (this.monthValue) {
fetchDate(this.monthValue).then(response => {
@@ -166,11 +129,10 @@ export default {
}
},
saveDate() {
if (this.time && this.Person && this.partNumber && this.partName && this.procedureName && this.number && this.workTime) {
saveDate(this.time, this.Person, this.partNumber, this.partName, this.procedureName, this.PersonLiable, this.ConfirmingPerson, this.id, this.number, this.workTime).then(response => {
if (this.Person && this.partNumber && this.procedureName && this.number && this.workTime) {
saveDate(this.Person, this.partNumber, this.procedureName, this.id, this.number, this.workTime).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.monthValue = this.time.slice(0, 7)
this.RemoveDate()
this.fetchDate()
} else {
@@ -182,11 +144,10 @@ export default {
}
},
editDate() {
if (this.time && this.Person && this.partNumber && this.partName && this.procedureName && this.number && this.workTime) {
editDate(this.ID, this.time, this.Person, this.partNumber, this.partName, this.procedureName, this.PersonLiable, this.ConfirmingPerson, this.id, this.number, this.workTime).then(response => {
if (this.Person && this.partNumber && this.procedureName && this.number && this.workTime) {
editDate(this.ID, this.Person, this.partNumber, this.procedureName, this.id, this.number, this.workTime).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.monthValue = this.time.slice(0, 7)
this.RemoveDate()
this.fetchDate()
} else {
@@ -218,26 +179,18 @@ export default {
})
},
RemoveDate() {
this.time = ''
this.Person = ''
this.partNumber = ''
this.partName = ''
this.number = 0
this.workTime = 0
this.procedureName = ''
this.PersonLiable = ''
this.ConfirmingPerson = ''
},
searchTable(row) {
this.time = row.加工日期
this.Person = row.操作工流水号
this.partNumber = row.零件图号
this.partName = row.名称
this.procedureName = row.工序
this.number = row.数量
this.workTime = row.单件工时
this.PersonLiable = row.责任人流水号
this.ConfirmingPerson = row.确认人流水号
this.ID = row.ID
}
}

View File

@@ -20,7 +20,7 @@
</el-select>
<el-input v-model="Partpaint" placeholder="零件号" clearable size="small" style="width: 180px;margin:0px 10px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 0px 10px;" @click="pageCurrent = 1;pageSize = 50;getTableData()">查询</el-button>
<el-button :disabled="Name===1" type="success" class="el-icon-search" size="small" style="margin-left: 220px;" @click="submit">完成</el-button>
<el-button :disabled="Name===1" type="success" class="el-icon-finished" size="small" style="margin-left: 220px;background-color: green" @click="submit">完成</el-button>
</el-card>
<el-row>
<el-card style="width: 50%; float: left">

View File

@@ -47,7 +47,7 @@
{{ scope.row.修补准结工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="实际工时" width="80px">
<el-table-column align="center" label="加工工时" width="80px">
<template slot-scope="scope">
{{ scope.row.设备工时 }}
</template>
@@ -67,7 +67,7 @@
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="日期" width="100px">
<el-table-column align="center" label="加工日期" width="100px">
<template slot-scope="scope">
{{ scope.row.操作时间 }}
</template>
@@ -132,8 +132,8 @@ export default {
return
}
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['姓名', '图号', '跟单号', '序号', '工序名称', '录入准结工时', '实际工时', '合格数', '不合格数', '备注', '日期', '计划准结工时', '计划定额工时', '项目名称', '机床图号', '组号', '设计', '材料']
const filterVal = ['姓名', '零件图号_短', '跟单号', '工序顺序', '工艺名称', '修补准结工时', '设备工时', '合格数', '不合格数', '备注', '操作时间', '准结定额工时', '单件定额工时', '项目名称', '机床图号', '组号', '设计者', '材料']
const tHeader = ['日期', '姓名', '图号', '跟单号', '序号', '工序名称', '录入准结工时', '实际工时', '合格数', '不合格数', '备注', '计划准结工时', '计划定额工时', '项目名称', '机床图号', '组号', '设计', '材料']
const filterVal = ['操作时间', '姓名', '零件图号_短', '跟单号', '工序顺序', '工艺名称', '修补准结工时', '设备工时', '合格数', '不合格数', '备注', '准结定额工时', '单件定额工时', '项目名称', '机床图号', '组号', '设计者', '材料']
const list = this.tableData
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({

View File

@@ -95,6 +95,16 @@
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="零件总数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="投产总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.投产总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.零件备注 }}
@@ -140,6 +150,16 @@
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="零件总数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.备注 }}
@@ -180,6 +200,16 @@
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="零件总数量" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.备注 }}
@@ -601,6 +631,7 @@ export default {
MaterialSpecification: [],
MaterialModel: [],
NumberOfParts: [],
multipleSelection: [],
ReMarks: [],
projectName: '',
MachineToolNumber: '',
@@ -1113,67 +1144,29 @@ export default {
})
},
handleSelectionChange(val) {
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
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.PartToolNumber[i] = val[i].零件图号
this.Material[i] = val[i].材料
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].零件备注
}
console.log(this.NumberOfParts, 1111)
} else if (this.PartType === '外购件') {
this.MaterialNum = []
this.MaterialCode = []
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.MaterialCode[i] = val[i].物料代码
this.MaterialName[i] = val[i].物料名称
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
} else if (this.PartType === '标准件') {
this.MaterialNum = []
this.MaterialCode = []
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.MaterialCode[i] = val[i].物料代码
this.MaterialName[i] = val[i].物料名称
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
}
this.multipleSelection = val
},
purchaseRequisition() {
if (this.RequisitionList !== '') {
if (this.time !== '' && this.time !== null) {
if (this.BasicPartsNumber.length !== 0 || this.StandardPartsAndOutsourcing.length !== 0) {
if (this.multipleSelection.length !== 0) {
this.result = 0
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.BasicPartsNumber[i] = this.multipleSelection[i].基本件流水号
this.MaterialName[i] = this.multipleSelection[i].零件名称
this.PartToolNumber[i] = this.multipleSelection[i].零件图号
this.Material[i] = this.multipleSelection[i].材料
this.NumberOfParts[i] = this.multipleSelection[i].投产总数量
this.ReMarks[i] = this.multipleSelection[i].零件备注
}
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.PartToolNumber[i], this.Material[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
this.result += parseInt(response.data[0].result)
@@ -1204,6 +1197,23 @@ export default {
})
}
} else if (this.PartType === '外购件') {
this.MaterialNum = []
this.MaterialCode = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.StandardPartsAndOutsourcing[i] = this.multipleSelection[i].标准件和外购件流水号
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.MaterialCode[i] = this.multipleSelection[i].物料代码
this.MaterialName[i] = this.multipleSelection[i].物料名称
this.MaterialSpecification[i] = this.multipleSelection[i].物料规格
this.MaterialModel[i] = this.multipleSelection[i].物料型号
this.NumberOfParts[i] = this.multipleSelection[i].采购总数量
this.ReMarks[i] = this.multipleSelection[i].备注
}
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.MaterialCode[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 2, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
this.result += parseInt(response.data[0].result)
@@ -1234,6 +1244,23 @@ export default {
})
}
} else if (this.PartType === '标准件') {
this.MaterialNum = []
this.MaterialCode = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.StandardPartsAndOutsourcing[i] = this.multipleSelection[i].标准件和外购件流水号
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.MaterialCode[i] = this.multipleSelection[i].物料代码
this.MaterialName[i] = this.multipleSelection[i].物料名称
this.MaterialSpecification[i] = this.multipleSelection[i].物料规格
this.MaterialModel[i] = this.multipleSelection[i].物料型号
this.NumberOfParts[i] = this.multipleSelection[i].采购总数量
this.ReMarks[i] = this.multipleSelection[i].备注
}
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.MaterialCode[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 1, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
this.result += parseInt(response.data[0].result)
@@ -1276,8 +1303,23 @@ export default {
},
PurchasingDepartment() {
if (this.time !== '' && this.time !== null) {
if (this.BasicPartsNumber.length !== 0 || this.StandardPartsAndOutsourcing.length !== 0) {
if (this.multipleSelection.length !== 0) {
if (this.PartType === '基本件') {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.BasicPartsNumber[i] = this.multipleSelection[i].基本件流水号
this.MaterialName[i] = this.multipleSelection[i].零件名称
this.PartToolNumber[i] = this.multipleSelection[i].零件图号
this.Material[i] = this.multipleSelection[i].材料
this.NumberOfParts[i] = this.multipleSelection[i].投产总数量
this.ReMarks[i] = this.multipleSelection[i].零件备注
}
purchaseRequisition2(this.projectFloatValue, this.machineFloatValue, this.groupFloatValue, this.BasicPartsNumber, this.NumberOfParts, this.time).then(response => {
if (response.data[0].result !== '0') {
console.log(response.data[0].result)
@@ -1290,6 +1332,23 @@ export default {
}
})
} else {
this.MaterialNum = []
this.MaterialCode = []
this.StandardPartsAndOutsourcing = []
this.MaterialName = []
this.MaterialSpecification = []
this.MaterialModel = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.StandardPartsAndOutsourcing[i] = this.multipleSelection[i].标准件和外购件流水号
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.MaterialCode[i] = this.multipleSelection[i].物料代码
this.MaterialName[i] = this.multipleSelection[i].物料名称
this.MaterialSpecification[i] = this.multipleSelection[i].物料规格
this.MaterialModel[i] = this.multipleSelection[i].物料型号
this.NumberOfParts[i] = this.multipleSelection[i].采购总数量
this.ReMarks[i] = this.multipleSelection[i].备注
}
PurchasingDepartment(this.groupFloatValue, this.StandardPartsAndOutsourcing, this.time, this.MaterialNum, this.NumberOfParts, this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result !== '0') {
this.$message.success('请购成功')
@@ -1315,7 +1374,22 @@ export default {
}
},
Production() {
if (this.PartType === '基本件' && this.BasicPartsNumber.length !== 0) {
if (this.PartType === '基本件' && this.multipleSelection.length !== 0) {
this.MaterialNum = []
this.BasicPartsNumber = []
this.MaterialName = []
this.PartToolNumber = []
this.Material = []
this.NumberOfParts = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.MaterialNum[i] = this.multipleSelection[i].物料流水号
this.BasicPartsNumber[i] = this.multipleSelection[i].基本件流水号
this.MaterialName[i] = this.multipleSelection[i].零件名称
this.PartToolNumber[i] = this.multipleSelection[i].零件图号
this.Material[i] = this.multipleSelection[i].材料
this.NumberOfParts[i] = this.multipleSelection[i].投产总数量
this.ReMarks[i] = this.multipleSelection[i].零件备注
}
Production(this.groupFloatValue, this.BasicPartsNumber, this.NumberOfParts, this.projectFloatValue, this.machineFloatValue).then(response => {
if (response.data[0].result !== '0') {
this.$message.success('投产成功')

View File

@@ -532,6 +532,7 @@ import {
getPartnames3,
getPartnames4,
modifyRemark,
insertOne1,
detailInfo
} from '@/api/ManufacturingCenter/ProcessPlanningNew'
import elInput from 'element-ui/packages/input'
@@ -697,6 +698,7 @@ export default {
result: 0,
oldNum: '',
newNum: '',
工艺是否更改: '',
// tableRecord: [],
materialName2: '',
material2: ''
@@ -1130,7 +1132,8 @@ export default {
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号,
machine: response.data[i].机床图号,
group: response.data[i].组号
group: response.data[i].组号,
update: response.data[i].工艺是否更改
})
}
})
@@ -1203,6 +1206,7 @@ export default {
this.material = response.data[0].材料流水号
this.materialName = response.data[0].材料
this.spec = response.data[0].原材料规格
this.工艺是否更改 = response.data[0].工艺是否更改
if (response.data[0].重量 === null) {
this.weight = ''
} else {
@@ -1509,13 +1513,13 @@ export default {
let 零件图号
let flag = 0
for (let i = 0; i < this.tableData.length; i++) {
saveApprove(this.tableData[i].工艺计划流水号, this.tableData[i].工艺编号, this.tableData[i].工艺要求, this.spec, this.tableData[i].工序顺序, this.tableData[i].工序间是否外协, this.tableData[i].工序流水号, this.material, '', '', this.CraftmenValue, this.tableData[i].工艺难度等级).then(() => {
saveApprove(this.tableData[i].工艺计划流水号, this.tableData[i].工艺编号, this.tableData[i].工艺要求, this.spec, this.tableData[i].工序顺序, this.tableData[i].工序间是否外协, this.tableData[i].工序流水号, this.material, '', '', this.CraftmenValue, this.tableData[i].工艺难度等级, this.工艺是否更改).then(() => {
for (let j = 0; j < this.partNum.length; j++) {
if (this.partNum[j].value === this.partNumValue) {
零件图号 = this.partNum[j].label
}
}
TableAddLi(this.tableData[i].单件定额工时, this.tableData[i].准结定额工时, 零件图号, this.tableData[i].工序流水号, this.tableData[i].工艺计划流水号).then(() => {
TableAddLi(this.tableData[i].单件定额工时, this.tableData[i].准结定额工时, 零件图号, this.tableData[i].工序流水号, this.tableData[i].工艺计划流水号, this.tableData[i].是否加序).then(() => {
flag++
if (flag === this.tableData.length) {
TableAddLi1(this.partNumValue, this.CraftmenValue).then(() => {
@@ -1544,9 +1548,15 @@ export default {
if (this.partNumValue === '') {
this.$message.error('请先选择一个零件')
} else {
insertOne(this.partNumValue, row.工序流水号).then(response => {
this.searchDetail()
})
if (this.工艺是否更改 === 1) {
insertOne1(this.partNumValue, row.工序流水号).then(response => {
this.searchDetail()
})
} else {
insertOne(this.partNumValue, row.工序流水号).then(response => {
this.searchDetail()
})
}
}
},
deleteOne(row) { // 删除行