Browse Source

24-05-16 标签记录

master
qiezi 1 year ago
parent
commit
da5be0285d
  1. 49
      src/views/modules/production/reworkRecord.vue

49
src/views/modules/production/reworkRecord.vue

@ -96,7 +96,6 @@ export default {
this.numberOrWeight = undefined; this.numberOrWeight = undefined;
}, },
startRework(){ startRework(){
this.saveRework.createTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
this.saveRework.createBy = this.$store.state.user.name this.saveRework.createBy = this.$store.state.user.name
startRework(this.saveRework).then(({data})=>{ startRework(this.saveRework).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
@ -104,13 +103,17 @@ export default {
this.startReworkRecordDialog = false; this.startReworkRecordDialog = false;
this.selectRework(); this.selectRework();
}else { }else {
this.$alert(data.msg, '错误信息', {
this.$confirm(data.msg, '错误信息', {
confirmButtonText: '确定' confirmButtonText: '确定'
}).then(()=>{
this.$refs.seqNo.focus();
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
this.$alert(error, '错误信息', {
this.$confirm(error, '错误信息', {
confirmButtonText: '确定' confirmButtonText: '确定'
}).then(()=>{
this.$refs.seqNo.focus();
}) })
}) })
}, },
@ -216,12 +219,14 @@ export default {
getRework(params).then(({data})=>{ getRework(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.seqNoReworkRecordDialog = false; this.seqNoReworkRecordDialog = false;
this.reportWorkDialog = true
this.$nextTick(()=>{ this.$nextTick(()=>{
this.saveRework = data.row; this.saveRework = data.row;
this.saveRework.reworkStartDate = new Date() this.saveRework.reworkStartDate = new Date()
this.saveRework.reworkEndDate = new Date() this.saveRework.reworkEndDate = new Date()
this.saveRework.productionTime = new Decimal(dayjs(new Date()).diff(this.saveRework.createTime,'hour',true)).toFixed(2, Decimal.ROUND_HALF_UP)
this.saveRework.productionTime = new Decimal(this.saveRework.productionTime).toSignificantDigits()
}) })
this.reportWorkDialog = true
}else { }else {
this.$alert(data.msg, '错误信息', { this.$alert(data.msg, '错误信息', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -238,6 +243,8 @@ export default {
seqNo: undefined, seqNo: undefined,
site:this.$store.state.user.site, site:this.$store.state.user.site,
type:"修边返工", type:"修边返工",
operatorId:undefined,
operatorName:undefined,
} }
if (this.startReworkRecordDialog === true){ if (this.startReworkRecordDialog === true){
this.$nextTick(()=>{ this.$nextTick(()=>{
@ -251,6 +258,13 @@ export default {
} }
} }
}, },
watch:{
'saveRework.operatorId'(newVal, oldVal){
if (!newVal){
this.saveRework.operatorName = undefined;
}
}
},
created () { created () {
this.selectRework(); this.selectRework();
}, },
@ -260,7 +274,7 @@ export default {
<template> <template>
<div> <div>
<choose-list ref="baseList" @getBaseData="getBaseData"></choose-list> <choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
<el-dialog title="返工返修" @close="closeStartReworkRecordDialog" @open="openDialog" :visible.sync="startReworkRecordDialog" :close-on-click-modal="false" width="13%">
<el-dialog title="返工返修" @close="closeStartReworkRecordDialog" @open="openDialog" :visible.sync="startReworkRecordDialog" :close-on-click-modal="false" width="300px">
<el-form :model="saveRework" label-position="top" @submit.native.prevent> <el-form :model="saveRework" label-position="top" @submit.native.prevent>
<el-form-item label="派工单号" prop="seqNo"> <el-form-item label="派工单号" prop="seqNo">
<el-input ref="seqNo" type="number" v-model="saveRework.seqNo" @keydown.native.enter="startRework"></el-input> <el-input ref="seqNo" type="number" v-model="saveRework.seqNo" @keydown.native.enter="startRework"></el-input>
@ -274,6 +288,19 @@ export default {
<el-option value="加工返工" label="加工返工"></el-option> <el-option value="加工返工" label="加工返工"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-row :gutter="10">
<el-col :span="10">
<el-form-item label="操作员" prop="operator">
<span slot="label" @click="getBaseList(26,1)"><a>操作员</a></span>
<el-input v-model="saveRework.operatorId"></el-input>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="操作员姓名">
<el-input disabled v-model="saveRework.operatorName"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="startRework">确定</el-button> <el-button type="primary" @click="startRework">确定</el-button>
@ -331,8 +358,7 @@ export default {
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="操作员"> <el-form-item label="操作员">
<span slot="label" v-if="saveType !== 0" @click="getBaseList(26,1)"><a>操作员</a></span>
<el-input :disabled="saveType === 0" v-model="saveRework.operatorId"></el-input>
<el-input disabled v-model="saveRework.operatorId"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -677,7 +703,14 @@ export default {
<el-table-column <el-table-column
header-align="center" header-align="center"
align="left" align="left"
min-width="80"
min-width="100"
prop="originOperatorName"
label="原操作员">
</el-table-column>
<el-table-column
header-align="center"
align="left"
min-width="60"
prop="productionTime" prop="productionTime"
label="制造时间(h)"> label="制造时间(h)">
</el-table-column> </el-table-column>

Loading…
Cancel
Save