Commit 4e94662b by wusiyi

fix:质检bug修复

parent d7baf909
......@@ -311,7 +311,7 @@ export interface OrderInventoryData {
export interface QualityParams {
updateParams: { id: number; version?: number }[]
qualityIssues: string
qualify_problem_type: number | string
qualifyProblemType: number | string
qualityPassed: boolean
source?: number // 0 列表页,1 快捷质检
}
......
......@@ -832,12 +832,11 @@ const setData = async (
const res = await qualityPodOrderOperationApi({
updateParams: [{ id, version: detail.value.version }],
qualityIssues: '',
qualify_problem_type: '',
qualifyProblemType: '',
qualityPassed: true,
source: 1,
})
if (res.code !== 200) return
emit('onSuccess', [{ id, status: true }])
} else {
const res = (await props.completeApi(
[id],
......@@ -1131,6 +1130,9 @@ const trackCodeInput = async () => {
if (props.fastKey === 'productionScan') {
await setData(detail.value.id.toString(), 'auto')
}
if (props.fastKey === 'qualityScan') {
emit('onSuccess', [{ id: detail.value.id, status: true }])
}
playAudio('weight_search_success')
trackingNumberRef.value && trackingNumberRef.value.focus()
......
......@@ -3,6 +3,7 @@
v-model="visible"
:title="qualityPassed ? '质检通过' : '质检不通过'"
width="450px"
top="30vh"
:close-on-click-modal="false"
:destroy-on-close="true"
@close="handleClose"
......@@ -18,10 +19,10 @@
<ElFormItem
v-if="!qualityPassed"
label="原因"
prop="qualify_problem_type"
prop="qualifyProblemType"
>
<ElSelect
v-model="form.qualify_problem_type"
v-model="form.qualifyProblemType"
placeholder="请选择不通过原因"
style="width: 100%"
clearable
......@@ -37,7 +38,7 @@
</ElSelect>
</ElFormItem>
<ElFormItem
v-if="!qualityPassed && form.qualify_problem_type === 5"
v-if="!qualityPassed && form.qualifyProblemType === 5"
label="具体原因"
prop="qualityIssues"
>
......@@ -84,22 +85,22 @@ const updateParams = ref<{ id: number; version?: number }[]>([])
const reasonOptions = ref<QualityTypeItem[]>([])
const form = reactive<{
qualify_problem_type: number | string
qualifyProblemType: number | string
qualityIssues: string
}>({
qualify_problem_type: '',
qualifyProblemType: '',
qualityIssues: '',
})
const rules = computed<FormRules>(() => {
if (qualityPassed.value) return {}
const result: FormRules = {
qualify_problem_type: [
qualifyProblemType: [
{ required: true, message: '请选择不通过原因', trigger: 'change' },
],
}
if (form.qualify_problem_type && form.qualify_problem_type === 5) {
result.qualify_problem_type = [
if (form.qualifyProblemType && form.qualifyProblemType === 5) {
result.qualifyProblemType = [
{ required: true, message: '请输入不通过原因', trigger: 'blur' },
]
}
......@@ -118,11 +119,10 @@ const loadReasons = async () => {
const handleReasonChange = () => {
form.qualityIssues =
form.qualify_problem_type === 5
form.qualifyProblemType === 5
? ''
: reasonOptions.value.find(
(item) => item.key === form.qualify_problem_type,
)?.value || ''
: reasonOptions.value.find((item) => item.key === form.qualifyProblemType)
?.value || ''
formRef.value?.clearValidate('qualityIssues')
}
......@@ -138,7 +138,7 @@ const open = (
}))
qualityPassed.value = passed
source.value = sourceType
form.qualify_problem_type = ''
form.qualifyProblemType = ''
form.qualityIssues = ''
visible.value = true
if (!passed) void loadReasons()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment