Browse Source

检验任务执行时,系统判定在不合格时(定性的选择了拒绝。定量的超出检验方案范围),需要有个明显的并且带有特殊颜色的标记标识

hella_online_20240829
zhang_li 5 months ago
parent
commit
9d0f52c167
  1. 630
      src/views/qms/inspectionJob/addForm.vue

630
src/views/qms/inspectionJob/addForm.vue

@ -1,30 +1,93 @@
<template> <template>
<div> <div>
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="dialogWidth" :close-on-click-modal="false" <Dialog
:vLoading="formLoading"> :title="dialogTitle"
<div class="box" style="max-height: 80vh; overflow-y: auto; padding: 0px 20px" ref="mianscroll"> v-model="dialogVisible"
<el-backtop :right="40" :bottom="100" target='.box' @click="topScrollClick"/> :width="dialogWidth"
<Form ref="formMainRef" :rules="rules" :schema="formSchema" :is-col="true" @opensearchTable="opensearchTable" /> :close-on-click-modal="false"
:vLoading="formLoading"
>
<div
class="box"
style="max-height: 80vh; overflow-y: auto; padding: 0px 20px"
ref="mianscroll"
>
<el-backtop :right="40" :bottom="100" target=".box" @click="topScrollClick" />
<Form
ref="formMainRef"
:rules="rules"
:schema="formSchema"
:is-col="true"
@opensearchTable="opensearchTable"
/>
<div ref="boxList">
<div class="small-title">包装列表</div> <div class="small-title">包装列表</div>
<div style="border:1px solid #dedede;margin-bottom:20px;display: flex;"> <div style="border: 1px solid #dedede; margin-bottom: 20px; display: flex">
<TableForm ref="tableFormRef" style="width:100%;" :maxHeight="490" <TableForm
:tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules" ref="tableFormRef"
:tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" /> style="width: 100%"
:maxHeight="490"
:tableFields="tableAllSchemas.tableFormColumns"
:tableFormRules="tableFormRules"
:tableData="data.packageList"
:isShowButton="false"
:isShowReduceButton="false"
/>
</div> </div>
<el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card" </div>
tab-position="left" :stretch="false"> <el-tabs
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name" v-next-focus> v-model="editableTabsValue"
class="demo-tabs"
@edit="handleTabsEdit"
type="border-card"
tab-position="left"
:stretch="false"
>
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processDescribe"
:name="item.name"
v-next-focus
>
<template #label>
<span class="custom-tabs-label" style="display: flex; align-items: center">
<Icon
class="mr-5px"
icon="ep:circle-check-filled"
v-if="item.isPass === true"
color="#67C23A"
style="margin-top: 4px"
/>
<Icon
class="mr-5px"
icon="ep:circle-close-filled"
v-if="item.isPass === false"
color="#ff0000"
style="margin-top: 4px"
/>
<span>{{ item.processDescribe }}</span>
</span>
</template>
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> <el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="processCode"> <el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" /> <el-input
v-model="item.processCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验特性编号"> <el-form-item label="检验特性编号">
<el-input v-model="item.inspectionFeatureCode" placeholder="根据系统生成" :disabled="true" /> <el-input
v-model="item.inspectionFeatureCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -44,172 +107,349 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码"> <el-form-item label="编码">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.number" placeholder="根据系统生成" <el-input
:disabled="true" /> v-model="item.inspectionJobCharacteristicsUpdateReqVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsUpdateReqVO.description"> <el-form-item
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.description" :disabled="true" /> label="描述"
prop="inspectionJobCharacteristicsUpdateReqVO.description"
>
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.description"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"> <el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName" disabled <el-input
placeholder="请选择检验方法" /> v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsUpdateReqVO.samplingProcessCode"> <el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsUpdateReqVO.samplingProcessCode"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName" disabled <el-input
placeholder="请选择采样过程编码" /> v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName"
disabled
placeholder="请选择采样过程编码"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty"> <el-form-item
label="样品份数"
prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled <el-input
placeholder="请输入样品份数" /> v-model="item.inspectionJobCharacteristicsUpdateReqVO.sampleQty"
disabled
placeholder="请输入样品份数"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsUpdateReqVO.samplePieceSize"> <el-form-item
label="每份样品量"
prop="inspectionJobCharacteristicsUpdateReqVO.samplePieceSize"
>
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize" disabled <el-input
placeholder="请输入样品份数" /> v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize"
disabled
placeholder="请输入样品份数"
/>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"> <el-form-item
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.isCanUpdate" disabled /> label="是否允许修改特征值"
prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
disabled
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"> <el-form-item
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod" label="结果录入方式"
placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event, item)" disabled> prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" >
:key="dict.value" :label="dict.label" :value="dict.value" /> <el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event, item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType"> <el-form-item
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType" placeholder="请选择特征类型" label="特征类型"
@change="changeFeatureType" disabled> prop="inspectionJobCharacteristicsUpdateReqVO.featureType"
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE)" >
:key="dict.value" :label="dict.label" :value="dict.value" /> <el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"> :span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
>
<el-form-item <el-form-item
label="是否设定上限" label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping" :disabled="true" /> <el-switch
v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping"> <el-col
:span="12"
v-if="
item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping
"
>
<el-form-item <el-form-item
label="上限值" label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping" prop="inspectionCharacteristicsBaseVO.quantifyCapping"
> >
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping" :disabled="true" /> <el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
>
<el-form-item <el-form-item
label="是否设定下限" label="是否设定下限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit" :disabled="true" /> <el-switch
v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit"> <el-col
:span="12"
v-if="
item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit
"
>
<el-form-item <el-form-item
label="下限值" label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping" prop="inspectionCharacteristicsBaseVO.quantifyCapping"
> >
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit" :disabled="true" /> <el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
>
<el-form-item <el-form-item
label="是否设定目标值" label="是否设定目标值"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-switch v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget" :disabled="true" /> <el-switch
v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget"> <el-col
:span="12"
v-if="
item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0 &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget
"
>
<el-form-item <el-form-item
label="目标值" label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping" prop="inspectionCharacteristicsBaseVO.quantifyCapping"
> >
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget" :disabled="true" /> <el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget"
:disabled="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"> <el-form-item
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime" label="开始时间"
type="datetime" placeholder="请选择开始时间" style="width: 100%" value-format="x" /> prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
>
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"> <el-form-item
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime" label="结束时间"
type="datetime" placeholder="请选择结束时间" style="width: 100%" value-format="x" /> prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
>
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 手动评估的时候显示 --> <!-- 手动评估的时候显示 -->
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1"> <el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="评估代码" required prop="inspectionJobCharacteristicsUpdateReqVO.estimateCode"> <el-form-item
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.estimateCode" placeholder="请选择评估代码" label="评估代码"
@change="changeFeatureType"> required
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value" prop="inspectionJobCharacteristicsUpdateReqVO.estimateCode"
:label="dict.label" :value="dict.value" /> >
<el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.estimateCode"
placeholder="请选择评估代码"
@change="changeFeatureType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" <el-col
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i" :span="24"
style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;"> v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO
.recordInspectionQuantifyList"
:key="i"
style="
border: 1px solid #dedede;
border-radius: 4px;
padding-top: 16px;
margin-bottom: 10px;
"
>
<el-row> <el-row>
<!-- 汇总录入的时候显示 --> <!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量" required> <el-form-item label="合格数量" required>
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number" /> <el-input
v-model="cur.qualifiedQuantity"
placeholder="请输入合格数量"
type="number"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量" required> <el-form-item label="不合格数量" required>
<el-input v-model="cur.unqualifiedQuantity" type="number" placeholder="请输入不合格数量"/> <el-input
v-model="cur.unqualifiedQuantity"
type="number"
placeholder="请输入不合格数量"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '0'"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '0'"
>
<el-form-item label="检验值" required> <el-form-item label="检验值" required>
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number" /> <el-input
v-model="cur.inspectionValue"
placeholder="请输入检验值"
type="number"
@blur="inspectionValueInput(item, cur)"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '1'"> <el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '1'"
>
<el-form-item label="选定集" required> <el-form-item label="选定集" required>
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集" <el-select
@change="changeQualitativeCode($event, item, cur)"> v-model="cur.qualitativeCode"
<el-option v-for="dict in item.selectedProjectRespVOList" :key="dict.dictionaryValue" placeholder="请选择选定集"
:label="dict.dictionaryLabel" :value="dict.dictionaryValue" /> @change="changeQualitativeCode($event, item, cur)"
>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -231,10 +471,18 @@
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> <ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template> </template>
</Dialog> </Dialog>
<Dialog title="修改名称" v-model="dialogVisibleName" width="500px" :close-on-click-modal="false"> <Dialog
title="修改名称"
v-model="dialogVisibleName"
width="500px"
:close-on-click-modal="false"
>
<div style="padding: 0px 20px"> <div style="padding: 0px 20px">
<el-form ref="nameRef" :model="nameForm"> <el-form ref="nameRef" :model="nameForm">
<el-form-item :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]" prop="name"> <el-form-item
:rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"
prop="name"
>
<el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" /> <el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -311,7 +559,7 @@
type: Array, type: Array,
required: true, required: true,
default: null default: null
}, }
}) })
const { t } = useI18n() // const { t } = useI18n() //
@ -419,16 +667,25 @@
// editableTabsValue.value = index + 1 // editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
item.isPass = '' //
// //
allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(6)) allSamplePieceSize.value += parseFloat(
(
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) *
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)
).toFixed(6)
)
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (!item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList) { if (!item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList) {
// //
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 2) { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 2) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
for (let i = 0; i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty); i++) { for (
let i = 0;
i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty);
i++
) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
@ -445,10 +702,14 @@
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
defectLevel: '', // defectLevel: '', //
qualifiedQuantity: parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(6)), // qualifiedQuantity: parseFloat(
(
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) *
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)
).toFixed(6)
), //
unqualifiedQuantity: '0' // unqualifiedQuantity: '0' //
} })
)
} }
} }
@ -474,7 +735,7 @@
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false
} }
}) })
list.forEach(item => { list.forEach((item) => {
item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime = new Date() item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime = new Date()
}) })
data.value.subList = list data.value.subList = list
@ -483,11 +744,13 @@
第一个包装采样数量>总数量 则显示总数量 第一个包装采样数量>总数量 则显示总数量
*/ */
for (let i = 0; i < data.value.packageList.length; i++) { for (let i = 0; i < data.value?.packageList?.length; i++) {
if (data.value.packageList[i].sampleAmount == null) { if (data.value.packageList[i].sampleAmount == null) {
if (allSamplePieceSize.value > data.value.packageList[i].amount) { if (allSamplePieceSize.value > data.value.packageList[i].amount) {
data.value.packageList[i].sampleAmount = data.value.packageList[i].amount data.value.packageList[i].sampleAmount = data.value.packageList[i].amount
allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(6)) allSamplePieceSize.value = parseFloat(
(allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(6)
)
} else { } else {
data.value.packageList[i].sampleAmount = allSamplePieceSize.value data.value.packageList[i].sampleAmount = allSamplePieceSize.value
allSamplePieceSize.value = 0 allSamplePieceSize.value = 0
@ -634,7 +897,9 @@
if (data.value.packageList?.length > 0) { if (data.value.packageList?.length > 0) {
const validateForm1 = await tableFormRef.value.validateForm() const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return if (!validateForm1) return
let isPass = data.value.packageList.some(cur => parseFloat(cur.sampleAmount) > parseFloat(cur.amount)) let isPass = data.value.packageList.some(
(cur) => parseFloat(cur.sampleAmount) > parseFloat(cur.amount)
)
if (isPass) { if (isPass) {
message.error(`采样数量不能大于数量`) message.error(`采样数量不能大于数量`)
return return
@ -689,7 +954,10 @@
) )
} }
// //
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime > item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { if (
item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >
item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime
) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
} }
// //
@ -697,7 +965,10 @@
parseFloatList.push( parseFloatList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return String(cur.qualifiedQuantity).indexOf('.') > -1 || String(cur.unqualifiedQuantity).indexOf('.') > -1 return (
String(cur.qualifiedQuantity).indexOf('.') > -1 ||
String(cur.unqualifiedQuantity).indexOf('.') > -1
)
} }
) )
) )
@ -705,30 +976,33 @@
numberList.push( numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) return (
parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) !=
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty)
)
} }
) )
) )
} }
}) })
let isEmpty1 = arrBol.some(item => item == true) let isEmpty1 = arrBol.some((item) => item == true)
let isEmptyNumberList = numberList.some(item => item == true) let isEmptyNumberList = numberList.some((item) => item == true)
let isParseFloat = parseFloatList.some(item => item == true) let isParseFloat = parseFloatList.some((item) => item == true)
if (isEmpty1) { if (isEmpty1) {
message.error('检验工序和检验特性有字段未填写完全') message.error('检验工序和检验特性有字段未填写完全')
return; return
} }
if (isOutweigh?.length > 0) { if (isOutweigh?.length > 0) {
message.error('检验特性中有开始时间大于结束时间') message.error('检验特性中有开始时间大于结束时间')
return; return
} }
if (isParseFloat) { if (isParseFloat) {
message.error('合格数量和不合格数量之和不可以是小数') message.error('合格数量和不合格数量之和不可以是小数')
return; return
} }
if (isEmptyNumberList) { if (isEmptyNumberList) {
message.error('合格数量和不合格数量之和必须等于样品份数') message.error('合格数量和不合格数量之和必须等于样品份数')
return; return
} }
if (formType.value == 'create') { if (formType.value == 'create') {
// //
@ -737,8 +1011,7 @@
// / // /
emit('submitForm', formType.value, data.value) emit('submitForm', formType.value, data.value)
} }
} catch { } catch {}
}
} }
const staging = async () => { const staging = async () => {
@ -753,7 +1026,9 @@
if (data.value.packageList?.length > 0) { if (data.value.packageList?.length > 0) {
const validateForm1 = await tableFormRef.value.validateForm() const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return if (!validateForm1) return
let isPass = data.value.packageList.some(cur => parseFloat(cur.sampleAmount) > parseFloat(cur.amount)) let isPass = data.value.packageList.some(
(cur) => parseFloat(cur.sampleAmount) > parseFloat(cur.amount)
)
if (isPass) { if (isPass) {
message.error(`采样数量不能大于数量`) message.error(`采样数量不能大于数量`)
return return
@ -808,7 +1083,10 @@
) )
} }
// //
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime > item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { if (
item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >
item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime
) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
} }
// //
@ -816,7 +1094,10 @@
parseFloatList.push( parseFloatList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return String(cur.qualifiedQuantity).indexOf('.') > -1 || String(cur.unqualifiedQuantity).indexOf('.') > -1 return (
String(cur.qualifiedQuantity).indexOf('.') > -1 ||
String(cur.unqualifiedQuantity).indexOf('.') > -1
)
} }
) )
) )
@ -824,35 +1105,37 @@
numberList.push( numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) return (
parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) !=
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty)
)
} }
) )
) )
} }
}) })
let isEmpty1 = arrBol.some(item => item == true) let isEmpty1 = arrBol.some((item) => item == true)
let isEmptyNumberList = numberList.some(item => item == true) let isEmptyNumberList = numberList.some((item) => item == true)
let isParseFloat = parseFloatList.some(item => item == true) let isParseFloat = parseFloatList.some((item) => item == true)
if (isEmpty1) { if (isEmpty1) {
message.error('检验工序和检验特性有字段未填写完全') message.error('检验工序和检验特性有字段未填写完全')
return; return
} }
if (isOutweigh?.length > 0) { if (isOutweigh?.length > 0) {
message.error('检验特性中有开始时间大于结束时间') message.error('检验特性中有开始时间大于结束时间')
return; return
} }
if (isParseFloat) { if (isParseFloat) {
message.error('合格数量和不合格数量之和不可以是小数') message.error('合格数量和不合格数量之和不可以是小数')
return; return
} }
if (isEmptyNumberList) { if (isEmptyNumberList) {
message.error('合格数量和不合格数量之和必须等于样品份数') message.error('合格数量和不合格数量之和必须等于样品份数')
return; return
}
await InspectionJobMainApi.stagingInspectionJobMain(data.value);
message.success("暂存成功")
} catch {
} }
await InspectionJobMainApi.stagingInspectionJobMain(data.value)
message.success('暂存成功')
} catch {}
} }
/** 弹窗按钮 */ /** 弹窗按钮 */
@ -1031,13 +1314,115 @@
let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e) let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e)
cur.defectLevel = obj.defectLevel cur.defectLevel = obj.defectLevel
cur.estimateCode = obj.estimateCode cur.estimateCode = obj.estimateCode
//
for (
let i = 0;
i < item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList?.length;
i++
) {
item.isPass = true
if (
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].estimateCode ==
'2'
) {
item.isPass = false
return
}
}
} }
const mianscroll = ref() const mianscroll = ref()
const boxList = ref()
const topScrollClick = () => { const topScrollClick = () => {
nextTick(() => { nextTick(() => {
mianscroll.value.scrollTo({ top: 550, behavior: 'smooth' }); mianscroll.value.scrollTo({ top: boxList.value.clientHeight + 550, behavior: 'smooth' })
}) })
} }
const inspectionValueInput = (item, cur) => {
for ( let i = 0;i < item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.length;i++) {
item.isPass = true
// ,
if (
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping)
) {
item.isPass = false
return
}
// ,
if (
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)
) {
item.isPass = false
return
}
// ,
if (
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)
) {
item.isPass = false
return
}
// ,
if (
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
( parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
item.isPass = false
return
}
// ,
if (
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
(parseFloat(cur.inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping)||
parseFloat(cur.inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget))
) {
item.isPass = false
return
}
// ,
if (
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
(parseFloat(cur.inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)||
parseFloat(cur.inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
item.isPass = false
return
}
// ,
if (
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
(parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
item.isPass = false
return
}
}
}
</script> </script>
<style scoped> <style scoped>
.small-title { .small-title {
@ -1060,4 +1445,7 @@
.el-backtop { .el-backtop {
position: absolute !important; position: absolute !important;
} }
.red .el-input__inner {
color: red !important;
}
</style> </style>

Loading…
Cancel
Save