+
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
@@ -90,6 +90,18 @@
+
+
+
+
+
+
+
+
+
+
@@ -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() {