|
@ -7,37 +7,36 @@ |
|
|
width="600px" |
|
|
width="600px" |
|
|
> |
|
|
> |
|
|
<template #title>{{ dialogTitle }} </template> |
|
|
<template #title>{{ dialogTitle }} </template> |
|
|
<el-form :model="form"> |
|
|
<el-form :model="baseform" ref="baseformRef"> |
|
|
<el-form-item label="工序"> |
|
|
<el-form-item label="工序" prop="processCode"> |
|
|
<el-input v-model="form.processCode" disabled /> |
|
|
<el-input v-model="baseform.processCode" disabled /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="生产人员" required="true"> |
|
|
<el-form-item label="生产人员" prop="personSelected" :rules="[{ required: true, message: '请选择报工人', trigger: 'blur' }]"> |
|
|
<el-select v-model="form.personSelected" multiple> |
|
|
<el-select v-model="baseform.personSelected" multiple > |
|
|
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" /> |
|
|
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="质检人员" required="true" > |
|
|
<el-form-item label="质检人员" prop="checkPerson" :rules="[{ required: true, message: '请填写质检人登录名', trigger: 'blur' }]"> |
|
|
<el-input v-model="form.checkPerson"/> |
|
|
<el-input v-model="baseform.checkPerson" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="合格数量" @change="handleCount" :key="qcount" required="true"> |
|
|
<el-form-item label="合格数量" prop="qualified" :rules="[{ required: true, message: '请填写合格数量', trigger: 'blur' }]"> |
|
|
<el-input-number |
|
|
<el-input-number |
|
|
v-model="form.qualified" |
|
|
v-model="baseform.qualified" |
|
|
@change="handleCount" |
|
|
@change="handleCount" :key="qcount" |
|
|
></el-input-number> |
|
|
></el-input-number> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="不合格数量" > |
|
|
<el-form-item label="不合格数量" prop="unqualified" :rules="[{ required: true, message: '请填写不合格数量', trigger: 'blur' }]"> |
|
|
<el-input-number v-model="form.unqualified" @change="handleCount" :key="qcount"></el-input-number> |
|
|
<el-input-number v-model="baseform.unqualified" @change="handleCount" :key="qcount"></el-input-number > |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="不合格原因"> |
|
|
<el-form-item label="不合格原因" prop="remark" :rules="[{ required: true, message: '请填写不合格原因', trigger: 'blur' }]"> |
|
|
<el-input v-model="form.remark"></el-input> |
|
|
<el-input v-model="baseform.remark"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<el-button @click="dialogVisible = false">关闭</el-button> |
|
|
<el-button @click="dialogVisible = false">关闭</el-button> |
|
|
<el-button type="primary" :disabled="saveFlag" @click="saveReport">保存</el-button> |
|
|
<el-button type="primary" :disabled="saveFlag" @click="saveReport">保存</el-button> |
|
|
</template> </Dialog |
|
|
</template> |
|
|
> |
|
|
</Dialog> |
|
|
</template> |
|
|
</template> |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { Dialog } from '@/components/Dialog' |
|
|
import { Dialog } from '@/components/Dialog' |
|
@ -51,7 +50,8 @@ const formLoading = ref(false) |
|
|
const personOption=ref([]) |
|
|
const personOption=ref([]) |
|
|
const saveFlag=ref(false) |
|
|
const saveFlag=ref(false) |
|
|
const planDayCode=ref() |
|
|
const planDayCode=ref() |
|
|
const form = reactive({ |
|
|
const baseformRef=ref() |
|
|
|
|
|
const baseform = reactive({ |
|
|
id:0, |
|
|
id:0, |
|
|
planDayCode: "", |
|
|
planDayCode: "", |
|
|
processCode:"", |
|
|
processCode:"", |
|
@ -66,16 +66,17 @@ const openDetail = async (row: any, titleName: any,code:string) => { |
|
|
//console.log('row-68',row) |
|
|
//console.log('row-68',row) |
|
|
dialogVisible.value = true |
|
|
dialogVisible.value = true |
|
|
dialogTitle.value = titleName |
|
|
dialogTitle.value = titleName |
|
|
form.processCode=row.nodeCode |
|
|
baseform.processCode=row.nodeCode |
|
|
form.personSelected=[] |
|
|
baseform.personSelected=[] |
|
|
form.planDayCode=code |
|
|
baseform.planDayCode=code |
|
|
form.personSelected=[] |
|
|
baseform.personSelected=[] |
|
|
form.qualified=0 |
|
|
baseform.qualified=0 |
|
|
form.unqualified=0 |
|
|
baseform.unqualified=0 |
|
|
form.id=row.id |
|
|
baseform.id=row.id |
|
|
planDayCode.value=code |
|
|
planDayCode.value=code |
|
|
getCurrentWorkerList(row.nodeCode) |
|
|
getCurrentWorkerList(row.nodeCode) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//获取工序人员 |
|
|
//获取工序人员 |
|
@ -87,52 +88,52 @@ const getCurrentWorkerList = async (val) => { |
|
|
} |
|
|
} |
|
|
personOption.value = await workschedulingApi.getCurrentWorkerList(params) |
|
|
personOption.value = await workschedulingApi.getCurrentWorkerList(params) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
const qcount=ref(0) |
|
|
const qcount=ref(0) |
|
|
//数量处理 |
|
|
//数量处理 |
|
|
const handleCount = () => { |
|
|
const handleCount = () => { |
|
|
qcount.value++ |
|
|
qcount.value++ |
|
|
if (form.qualified> rowData.value.planCount - form.unqualified) { |
|
|
if (baseform.qualified> rowData.value.planCount - baseform.unqualified) { |
|
|
message.alert('合格数量超限!计划总数【'+rowData.value.planCount+'】') |
|
|
message.alert('合格数量超限!计划总数【'+rowData.value.planCount+'】') |
|
|
form.qualified =rowData.value.planCount - form.unqualified |
|
|
baseform.qualified =rowData.value.planCount - baseform.unqualified |
|
|
|
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (form.unqualified> rowData.value.planCount -form.qualified ) { |
|
|
if (baseform.unqualified> rowData.value.planCount -baseform.qualified ) { |
|
|
message.alert('不合格数量超限!') |
|
|
message.alert('不合格数量超限!') |
|
|
form.unqualified =rowData.value.planCount-form.qualified |
|
|
baseform.unqualified =rowData.value.planCount-baseform.qualified |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//提交质检 |
|
|
//提交质检 |
|
|
const saveReport = async() => { |
|
|
const saveReport = () => { |
|
|
if(form.personSelected.length<1){ |
|
|
if (!baseformRef) return |
|
|
message.alert('生产人员不能为空') |
|
|
baseformRef.value.validate((valid) => { |
|
|
return |
|
|
if (valid) { |
|
|
} |
|
|
|
|
|
if(form.checkPerson==''||form.checkPerson.trim()==''){ |
|
|
|
|
|
message.alert('质检人员不能为空') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if(form.qualified<1){ |
|
|
|
|
|
message.alert('合格数量不能小于1!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
saveFlag.value = true |
|
|
saveFlag.value = true |
|
|
try { |
|
|
try { |
|
|
await workschedulingApi.processQualified(form) |
|
|
workschedulingApi.processQualified(baseform) |
|
|
}finally{ |
|
|
}finally{ |
|
|
saveFlag.value = false |
|
|
saveFlag.value = false |
|
|
dialogVisible.value = false |
|
|
dialogVisible.value = false |
|
|
emit('close') |
|
|
emit('close') |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log('请确认数据的正确!') |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
//console.log("report-saveReport-82",data) |
|
|
//console.log("report-saveReport-82",data) |
|
|
//await workschedulingApi.reportWorkByProcess(data) |
|
|
//await workschedulingApi.reportWorkByProcess(data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 传递给父类 |
|
|
// 传递给父类 |
|
|
const emit = defineEmits(['success', 'close']) |
|
|
const emit = defineEmits(['success', 'close']) |
|
|
defineOptions({ name: 'qualifiedCheck' }) |
|
|
defineOptions({ name: 'qualifiedCheck' }) |
|
|
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|