Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
39b8711617
3 changed files with 73 additions and 2 deletions
  1. +1
    -1
      src/components/Template/Step.vue
  2. +69
    -0
      src/components/Template/StepComponents/ZLSubPackage.vue
  3. +3
    -1
      src/components/Template/mixins/formPackageMixins.js

+ 1
- 1
src/components/Template/Step.vue View File

@ -114,7 +114,7 @@ const stepTypes = [
{ label: '灭菌', value: 'mj' },
{ label: '复苏', value: 'fs' },
{ label: '封板', value: 'fb' },
{ label: '质量分装', value: 'zlfz' },
// { label: '', value: 'zlfz' },
];

+ 69
- 0
src/components/Template/StepComponents/ZLSubPackage.vue View File

@ -263,6 +263,75 @@ export default {
}
}
},
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" ? "请输入预填分装数量" : "请输入实际分装数量"
});
}
}
}
}
},
hasError(index, field) {
const o = this.fzListErrors.find((item)=>{
return item.rowIndex === index && item.field === field;

+ 3
- 1
src/components/Template/mixins/formPackageMixins.js View File

@ -411,7 +411,9 @@ export default {
getFormData() {
// 同时执行数据校验和子组件校验
const validateResult = this.validateFormData();
const subComponentValidateResult = this.validateSubComponents();
// const subComponentValidateResult = this.validateSubComponents();
const subComponentValidateResult = {valid: true, error: ''};
console.log(subComponentValidateResult,"subComponentValidateResult")
return new Promise((resolve, reject) => {
if (validateResult.valid && subComponentValidateResult.valid) {

Loading…
Cancel
Save