Browse Source

fix:工艺加液步骤6 提示判断失误; 动态删除

master
guoapeng 2 months ago
parent
commit
9d12af671a
  1. 20
      src/components/craft/AddCraft/index.vue

20
src/components/craft/AddCraft/index.vue

@ -32,12 +32,12 @@ onMounted(async () => {
form.value = { ...props.sourceData, stepList: JSON.parse(props.sourceData.steps || '[]') } form.value = { ...props.sourceData, stepList: JSON.parse(props.sourceData.steps || '[]') }
form.value.stepList?.forEach((step: CraftTypes.StepItem) => { form.value.stepList?.forEach((step: CraftTypes.StepItem) => {
if (step.params.second) { if (step.params.second) {
step.params.minutes = Math.floor(step.params.second / 60)
step.params.seconds = step.params.second % 60
step.params.minutes = Math.floor(step.params.second / 60) || undefined
step.params.seconds = step.params.second % 60 || undefined
} }
if (step.params.coolingSecond) { if (step.params.coolingSecond) {
step.params.coolingMinutes = Math.floor(step.params.coolingSecond / 60)
step.params.coolingSeconds = step.params.coolingSecond % 60
step.params.coolingMinutes = Math.floor(step.params.coolingSecond / 60) || undefined
step.params.coolingSeconds = step.params.coolingSecond % 60 || undefined
} }
}) })
} }
@ -106,11 +106,11 @@ const okHandle = async () => {
step.params.description = `拍照` step.params.description = `拍照`
break break
} }
return !allPropertiesDefined(step.params, ['minutes', 'seconds', 'description', 'inTemperature'])
return !allPropertiesDefined(step.params, ['minutes', 'seconds', 'coolingMinutes', 'coolingSeconds', 'description', 'inTemperature'])
}, },
) )
console.log(form.value)
if (invalidStepIndex !== -1) { if (invalidStepIndex !== -1) {
FtMessage.error(`步骤${(invalidStepIndex || 0) + 1}: 请填写完整参数`) FtMessage.error(`步骤${(invalidStepIndex || 0) + 1}: 请填写完整参数`)
return return
@ -374,6 +374,9 @@ const addHandle = async () => {
mL mL
</template> </template>
</el-input> </el-input>
<el-icon v-if="liquid.solutionList.length > 1" color="red" @click="liquid.solutionList.splice(sIndex, 1)">
<RemoveFilled />
</el-icon>
</div> </div>
</div> </div>
</div> </div>
@ -588,6 +591,11 @@ const addHandle = async () => {
} }
.step-solution-item { .step-solution-item {
display: flex; display: flex;
align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
.el-icon {
font-size: 18px;
line-height: 100%;
}
} }
</style> </style>
Loading…
Cancel
Save