修改bug

This commit is contained in:
‘937886381’
2024-01-16 16:09:52 +08:00
parent d06784c2c3
commit 7ac9b6d35f
7 changed files with 401 additions and 115 deletions

View File

@@ -1,13 +1,13 @@
<!--
* @Author: zhp
* @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-01-09 16:03:22
* @LastEditTime: 2024-01-16 14:59:33
* @LastEditors: zhp
* @Description:
-->
<template>
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
<small-title slot="title" :no-padding="true">
<el-drawer :visible.sync="visible" :show-close="true" :wrapper-closable="false" class="drawer" size="50%">
<small-title slot="title" :no-padding="true" @close="handleClose">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
@@ -90,6 +90,18 @@
</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最小值"
:rules="[{ required: true, message: '最小值', trigger: 'blur' }]">
<el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.minValue"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最大值"
:rules="[{ required: true, message: '最大值', trigger: 'blur' }]">
<el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.maxValue"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
@@ -252,6 +264,10 @@ export default {
this.dataForm.checkValueList[index].isStandard = false
}
},
handleClose() {
this.ingredientList = undefined
console.log(222222222);
},
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
@@ -288,7 +304,9 @@ export default {
Promise.all(array).then(res => {
console.log(res)
this.visible = false;
this.$modal.msgSuccess("修改成功");
this.$emit("refreshDataList");
this.ingredientList = []
}).catch(error => {
// 如果任何一个请求失败,将会进入这个 catch 块
console.log(error)
@@ -326,6 +344,7 @@ export default {
Promise.all(array).then(res => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.ingredientList= []
this.$emit("refreshDataList");
}).catch(error => {
// 如果任何一个请求失败,将会进入这个 catch 块
@@ -434,6 +453,7 @@ export default {
init(id, isdetail) {
this.initData()
this.getDict()
this.ingredientList = []
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
@@ -445,7 +465,6 @@ export default {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
// 获取产品详情
let valueList = []
@@ -459,6 +478,7 @@ export default {
valueList = arr.map((ele) => {
// console.log(ele)
return {
checkDetId:ele.id,
maxValue: ele.maxValue,
minValue: ele.minValue
}
@@ -472,8 +492,8 @@ export default {
id: ele.id,
checkDetId: ele.id,
checkValue: ele.checkValue,
// isStandard: true,
// showIcon: false,
maxValue:null,
minValue: null
}
})
console.log(this.ingredientList);
@@ -487,9 +507,15 @@ export default {
showIcon: false,
}
})
valueList.forEach((ele, index) => {
if (this.ingredientList[index].checkDetId >= ele.checkDetId) {
this.ingredientList[index].minValue = ele.minValue
this.ingredientList[index].maxValue = ele.maxValue
}
})
valueList.forEach((ele,index) => {
console.log(ele);
if (this.dataForm.checkValueList[index].checkValue >= ele.minValue && this.dataForm.checkValueList[index].checkValue <= ele.maxValue) {
if (this.dataForm.checkValueList[index].checkDetId >= ele.checkDetId && this.dataForm.checkValueList[index].checkValue >= ele.minValue && this.dataForm.checkValueList[index].checkValue <= ele.maxValue) {
this.dataForm.checkValueList[index].showIcon = true
this.dataForm.checkValueList[index].isStandard = true
} else {
@@ -512,7 +538,8 @@ export default {
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.visible = false
this.ingredientList = []
// this.initData();
},
goEdit() {