Browse Source

feat:[模板管理][update]

luojie
luojie 3 weeks ago
parent
commit
4b95f0c984
2 changed files with 45 additions and 80 deletions
  1. +35
    -79
      src/components/Template/StepComponents/ZLSubPackage.vue
  2. +10
    -1
      src/components/Template/StepComponents/ry/zlfz.vue

+ 35
- 79
src/components/Template/StepComponents/ZLSubPackage.vue View File

@ -285,6 +285,9 @@ export default {
}
});
//
this.fzListErrors = [];
// - fillTypetemplateFillType
if (this.fzList && this.fzList.length > 0) {
for (let i = 0; i < this.fzList.length; i++) {
@ -299,7 +302,7 @@ export default {
isValid = false;
}
}
//
if (this.inputNumberItem.fillType === this.templateFillType) {
if (isValueEmpty(this.fzList[i].actnum)) {
@ -322,9 +325,7 @@ export default {
});
//
this.fzListErrors.forEach((_, index) => {
this.fzListErrors = []
});
this.fzListErrors = [];
},
//
async onBlurFzsl(e) {
@ -361,91 +362,46 @@ export default {
},
onBlurFzNum(index, field) {
if (this.fzList[index]) {
// fzListErrors
if (this.fzListErrors.length <= index) {
this.$set(this.fzListErrors, index, false);
}
if (this.fzList[index][field]) {
//
this.$set(this.fzListErrors, index, false);
//
this.removeFzListError(index, field);
} else {
//
this.$set(this.fzListErrors, index, true);
//
this.addFzListError(index, field);
}
}
},
verifyFzListError(index, field) {
// indexfield
if (index === undefined && field === undefined) {
if (this.fzList && this.fzList.length > 0) {
//
this.fzListErrors = [];
// fzListfzListErrors
for (let i = 0; i < this.fzList.length; i++) {
const item = this.fzList[i];
if (isValueEmpty(item.prenum)) {
this.fzListErrors.push({
rowIndex: i,
field: "prenum",
error: "请输入预填分装数量"
});
}
if (isValueEmpty(item.actnum)) {
this.fzListErrors.push({
rowIndex: i,
field: "actnum",
error: "请输入实际分装数量"
});
}
}
}
} else if (index !== undefined) {
// index
if (this.fzList[index]) {
const item = this.fzList[index];
if (field === undefined) {
// fieldprenumactnum
//
this.fzListErrors = this.fzListErrors.filter(err => err.rowIndex !== index);
// fzListErrors
if (isValueEmpty(item.prenum)) {
this.fzListErrors.push({
rowIndex: index,
field: "prenum",
error: "请输入预填分装数量"
});
}
if (isValueEmpty(item.actnum)) {
this.fzListErrors.push({
rowIndex: index,
field: "actnum",
error: "请输入实际分装数量"
});
}
} else {
// field
//
this.fzListErrors = this.fzListErrors.filter(err => !(err.rowIndex === index && err.field === field));
// fzListErrors
if (isValueEmpty(item[field])) {
this.fzListErrors.push({
rowIndex: index,
field: field,
error: field === "prenum" ? "请输入预填分装数量" : "请输入实际分装数量"
});
}
}
}
//
addFzListError(index, field) {
const errorObj = {
rowIndex: index,
field: field,
error: field === 'prenum' ? '请输入预填分装数量' : '请输入实际分装数量'
};
//
const exists = this.fzListErrors.some(item =>
item.rowIndex === index && item.field === field
);
if (!exists) {
this.fzListErrors.push(errorObj);
}
},
//
removeFzListError(index, field) {
this.fzListErrors = this.fzListErrors.filter(item =>
!(item.rowIndex === index && item.field === field)
);
},
hasError(index, field) {
const o = this.fzListErrors.find((item)=>{
// item
if (!item || typeof item !== 'object') {
return false; // nullundefined
}
// item
return item.rowIndex === index && item.field === field;
})
return o !== undefined;

+ 10
- 1
src/components/Template/StepComponents/ry/zlfz.vue View File

@ -63,7 +63,16 @@ export default {
const {key} = data;
if(key === 'zlfz'){
const formData = await this.$refs.stepFormPackageRef.getFormData();
console.log(formData,"formData")
if(formData){
const {zlfz} = formData;
const fzInfo = {
...zlfz.formData,
fzList:zlfz.fzList,
};
this.$refs.stepFormPackageRef.updateFormData("fzInfo",fzInfo);
this.$message.success("质量分装成功");
this.justUpdateFilledFormData();
}
}
}

Loading…
Cancel
Save