报废及制造采购导出
This commit is contained in:
@@ -29,8 +29,8 @@
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-row>
|
||||
<el-col style="width: 690px">
|
||||
<el-card style="width: 690px">
|
||||
<el-col style="width: 850px">
|
||||
<el-card style="width: 850px">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
@@ -41,7 +41,7 @@
|
||||
highlight-current-row
|
||||
border
|
||||
stripe
|
||||
style="width: 810px; text-align: center"
|
||||
style="width: 850px; text-align: center"
|
||||
@current-change="fetchTableData2">
|
||||
<el-table-column
|
||||
align="center"
|
||||
@@ -70,6 +70,24 @@
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.批次数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="province4"
|
||||
label="报废数量"
|
||||
width="80px"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.报废数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="province4"
|
||||
label="补投数量"
|
||||
width="80px"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.补投数量 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="province5"
|
||||
@@ -198,21 +216,21 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card>
|
||||
<div style="margin-top: 10px">报废后,将重新补投两种零件,一种是接着加工(执行原来的加工计划),另一种是从第一序重新加工(重新制定零件的加工计划),补投的零件号后加B</div>
|
||||
<div style="margin-top: 10px; display: block">
|
||||
<span>补投接着加工零件数量</span>
|
||||
<el-input v-model="inputA" auto-complete="off" style="width: 100px" size="small"/>
|
||||
<span>开始工序</span>
|
||||
<el-input v-model="inputB" :disabled="true" auto-complete="off" style="width: 100px" size="small"/>
|
||||
<el-button type="primary" plain size="small" @click="editA">补投接着生产零件</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 10px">报废后,补投的零件号后加B+报废次数</div>
|
||||
<!--<div style="margin-top: 10px; display: block">-->
|
||||
<!--<span>补投接着加工零件数量</span>-->
|
||||
<!--<el-input v-model="inputA" auto-complete="off" style="width: 100px" size="small"/>-->
|
||||
<!--<span>开始工序</span>-->
|
||||
<!--<el-input v-model="inputB" :disabled="true" auto-complete="off" style="width: 100px" size="small"/>-->
|
||||
<!--<el-button type="primary" plain 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: 10px; display: block">
|
||||
<span>补投重新加工零件数量</span>
|
||||
<el-input v-model="inputC" auto-complete="off" style="width: 100px" size="small" />
|
||||
<el-input-number v-model="inputC" :step="1" :min="0" :max="spareNumber-SupplementationNumber" style="width: 100px" size="small" />
|
||||
<span>开始工序</span>
|
||||
<el-input v-model="inputD" :disabled="true" auto-complete="off" style="width: 100px" size="small"/>
|
||||
<el-button type="primary" size="small" plain @click="editB">补投重新生产零件</el-button>
|
||||
<el-button :disabled="spareNumber-SupplementationNumber===0" type="primary" size="small" plain @click="editB">补投重新生产零件</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-show="false">
|
||||
@@ -249,59 +267,41 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogeditVisible" :title="title" width="400px" 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-dialog v-el-drag-dialog :visible.sync="dialogeditVisible" :title="title" :close-on-click-modal="false" width="400px" center >
|
||||
<el-form ref="form2" :model="form2" :rules="rules" label-position="left">
|
||||
<el-form-item label="零件号" label-width="80px" style="width: 299px ; display: inline-block; text-align: left;margin-left: 20px" size="small">
|
||||
<el-input v-model="form.input1" :disabled="true" auto-complete="off" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="停产原因" label-width="100px" prop="reason" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-input v-model="form2.reason" auto-complete="off" style="margin-left: 20px"/>
|
||||
<el-form-item label="报废数量" prop="报废数量" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-input-number v-model="form2.报废数量" :step="1" :min="0" :max="PCNumber" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="停产时间" label-width="120px" prop="time" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-form-item label="报废原因" prop="报废原因" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-input v-model="form2.报废原因" auto-complete="off" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报废时间" prop="报废时间" 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-item v-show="false" 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 v-show="false" 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 v-show="false" label="结束时间" label-width="120px" style="margin-bottom: 18px; display: inline-block">
|
||||
<el-date-picker
|
||||
v-model="input4"
|
||||
v-model="form2.报废时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
style="width: 200px"
|
||||
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>
|
||||
<el-button style="margin-left: 35%" @click="callOff('form2')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form2')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogeditVisible1" title="停产记录" width="400px" 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 label="报废原因" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-input v-model="form2.报废原因" 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-form-item label="报废时间" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
|
||||
<el-date-picker
|
||||
v-model="form2.time"
|
||||
v-model="form2.报废时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
@@ -317,7 +317,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MachineDrawingSelect, TeamSelect, TableDataSelect, editTime, editStop, TableDta2Select, editA, editchar } from '@/api/ManufacturingCenter/SparePartsForScrap'
|
||||
import { MachineDrawingSelect, TeamSelect, TableDataSelect, editSpare, TableDta2Select, editA } from '@/api/ManufacturingCenter/SparePartsForScrap'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -331,6 +331,9 @@ export default {
|
||||
TeamValue: '', // 组号
|
||||
Team: [], // 组号下拉框
|
||||
title: '',
|
||||
PCNumber: '', // 批次数量
|
||||
spareNumber: '', // 报废数量
|
||||
SupplementationNumber: '', // 补投数量
|
||||
currentPage1: 1,
|
||||
pageSize1: 40,
|
||||
total1: null,
|
||||
@@ -364,8 +367,14 @@ export default {
|
||||
input2: ''
|
||||
},
|
||||
form2: {
|
||||
reason: '',
|
||||
time: ''
|
||||
报废数量: '',
|
||||
报废原因: '',
|
||||
报废时间: ''
|
||||
},
|
||||
rules: {
|
||||
报废时间: [{ required: true, message: '请选择报废时间', trigger: 'change' }],
|
||||
报废数量: [{ required: true, message: '请输入报废数量', trigger: 'blur' }],
|
||||
报废原因: [{ required: true, message: '请输入报废原因', trigger: 'blur' }]
|
||||
},
|
||||
radio: '',
|
||||
input3: '', // 开始时间
|
||||
@@ -407,7 +416,11 @@ export default {
|
||||
if (row) {
|
||||
this.disabled = false
|
||||
this.judge = row.批次零件状态
|
||||
this.spareNumber = row.报废数量
|
||||
this.inputC = 0
|
||||
this.SupplementationNumber = row.补投数量
|
||||
this.CutCodeBefore = row.工艺计划流水号
|
||||
console.log(this.CutCodeBefore, 222)
|
||||
TableDta2Select(row.工艺计划流水号, this.currentPage2, this.pageSize2).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
@@ -451,46 +464,36 @@ export default {
|
||||
this.pageSize2 = 10
|
||||
},
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.remark1 = ''
|
||||
this.remark2 = ''
|
||||
this.form2.reason = ''
|
||||
this.PCNumber = parseInt(row.批次数量)
|
||||
console.log(this.Number, 111)
|
||||
this.title = row.零件名称
|
||||
this.form2.time = new Date()
|
||||
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, 2)
|
||||
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()
|
||||
editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('报废成功')
|
||||
this.dialogeditVisible = false
|
||||
this.fetchTableData()
|
||||
} else {
|
||||
this.$message.success('报废失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
this.form = {}
|
||||
this.dialogeditVisible = false
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
@@ -507,8 +510,8 @@ export default {
|
||||
} else { this.$message.warning('请选择停产零件') }
|
||||
},
|
||||
editB() {
|
||||
if (this.judge === '2') {
|
||||
editA(this.CutCodeBefore, this.inputC, this.inputD).then(response => {
|
||||
if (this.spareNumber - this.SupplementationNumber > 0) {
|
||||
editA(this.CutCodeBefore, this.inputC).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('补投成功')
|
||||
this.fetchTableData()
|
||||
|
||||
Reference in New Issue
Block a user