Browse Source

feat:[模板管理][update]

luojie
luojie 2 weeks ago
parent
commit
71bb727f27
4 changed files with 39 additions and 18 deletions
  1. +4
    -0
      src/App.vue
  2. +2
    -2
      src/components/Template/HandleFormItem.vue
  3. +26
    -16
      src/components/Template/StepComponents/CdmdComp.vue
  4. +7
    -0
      src/components/Template/StepFormPackage.vue

+ 4
- 0
src/App.vue View File

@ -123,6 +123,10 @@ export default {
#app .theme-picker { #app .theme-picker {
display: none; display: none;
} }
html{
color:#606266;
font-size: 14px;
}
.el-dialog__header { .el-dialog__header {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1) !important; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1) !important;

+ 2
- 2
src/components/Template/HandleFormItem.vue View File

@ -1198,8 +1198,7 @@ export default {
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh") && this.type !== "attachment") { if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh") && this.type !== "attachment") {
console.log("需要电子签名") console.log("需要电子签名")
// EventBus // EventBus
// EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
this.handleUpdateRecord()
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {// } else {//
this.handleUpdateRecord() this.handleUpdateRecord()
} }
@ -1370,6 +1369,7 @@ export default {
fieldLabelEn = this.$i18n.t(parentLabel, "en_US") + this.$i18n.t("template.common.unit", "en_US"); fieldLabelEn = this.$i18n.t(parentLabel, "en_US") + this.$i18n.t("template.common.unit", "en_US");
} }
const commonInfo = { const commonInfo = {
type:this.type,
userNameCn: nickName, userNameCn: nickName,
userNameEn: name, userNameEn: name,
key: this.fieldKey, key: this.fieldKey,

+ 26
- 16
src/components/Template/StepComponents/CdmdComp.vue View File

@ -11,6 +11,8 @@
<td class="fixed-text">稀释倍数</td> <td class="fixed-text">稀释倍数</td>
<td class="fixed-text"> <td class="fixed-text">
<HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'xsbs' + index" <HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'xsbs' + index"
:error = "errorFields['xsbs'+index]"
@update:error="(v)=>errorFields['xsbs'+index] = v"
@blur="(v)=>handleBlur(v,index,'xsbs')" :item="inputItem" :value="item.xsbs" :index="index" /> @blur="(v)=>handleBlur(v,index,'xsbs')" :item="inputItem" :value="item.xsbs" :index="index" />
</td> </td>
<td class="fixed-text">细胞密度/mL</td> <td class="fixed-text">细胞密度/mL</td>
@ -29,18 +31,26 @@
<tr> <tr>
<td> <td>
<HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'zsg' + index" <HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'zsg' + index"
:error = "errorFields['zsg'+index]"
@update:error="(v)=>errorFields['zsg'+index] = v"
:value="item.zsg" :item="inputItem" @blur="(v)=>handleBlur(v,index,'zsg')" :index="index" /> :value="item.zsg" :item="inputItem" @blur="(v)=>handleBlur(v,index,'zsg')" :index="index" />
</td> </td>
<td> <td>
<HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'ysg' + index" <HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'ysg' + index"
:error = "errorFields['ysg'+index]"
@update:error="(v)=>errorFields['ysg'+index] = v"
@blur="(v)=>handleBlur(v,index,'ysg')" :item="inputItem" :value="item.ysg" :index="index" /> @blur="(v)=>handleBlur(v,index,'ysg')" :item="inputItem" :value="item.ysg" :index="index" />
</td> </td>
<td> <td>
<HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'zxg' + index" <HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'zxg' + index"
:error = "errorFields['zxg'+index]"
@update:error="(v)=>errorFields['zxg'+index] = v"
:value="item.zxg" :item="inputItem" @blur="(v)=>handleBlur(v,index,'zxg')" :index="index" /> :value="item.zxg" :item="inputItem" @blur="(v)=>handleBlur(v,index,'zxg')" :index="index" />
</td> </td>
<td> <td>
<HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'yxg' + index" <HandleFormItem :fieldItemLabel="fieldItemLabel" :fieldKey="prefixKey + 'yxg' + index"
:error = "errorFields['yxg'+index]"
@update:error="(v)=>errorFields['yxg'+index] = v"
:value="item.yxg" :item="inputItem" @blur="(v)=>handleBlur(v,index,'yxg')" :index="index" /> :value="item.yxg" :item="inputItem" @blur="(v)=>handleBlur(v,index,'yxg')" :index="index" />
</td> </td>
</tr> </tr>
@ -86,7 +96,8 @@ export default {
type: 'inputNumber', type: 'inputNumber',
fillType: 'actFill', fillType: 'actFill',
precision: 0, precision: 0,
}
},
errorFields: {}
} }
}, },
@ -113,20 +124,19 @@ export default {
}, },
// validateFormData // validateFormData
validateFormData() { validateFormData() {
// CustomTable
const validateResult = this.$refs.tableRef.validateFormData();
//
if (validateResult.valid) {
const filledData = this.$refs.tableRef.getFilledFormData();
const { stepTableFormData = [] } = filledData;
if (stepTableFormData.length === 0) {
return { valid: false, error: '请添加取板数据' };
}
}
console.log("validateResult",validateResult);
return validateResult;
let isValid = true;
const errorFields = {};
const requiredFields = ['xsbs', 'zsg', 'zxg', 'ysg', 'yxg'];
this.tableData.map((item,index)=>{
requiredFields.forEach(field=>{
if(!item[field]) {
errorFields[field+index] = true;
isValid = false;
}
})
})
this.errorFields = errorFields;
return { valid: isValid, error: isValid? '' : '请填写细胞密度信息' };
}, },
onDataChange() { onDataChange() {
// //
@ -208,7 +218,7 @@ export default {
} }
.fixed-text { .fixed-text {
color: #595959;
// color: #595959;
font-size: 14px; font-size: 14px;
} }

+ 7
- 0
src/components/Template/StepFormPackage.vue View File

@ -206,6 +206,13 @@ export default {
if (jcbCompRef) { if (jcbCompRef) {
refs.push(jcbCompRef); refs.push(jcbCompRef);
} }
}else if(sItem.type === 'cdmd'){
const refName = `cdmdComp_${key}`;
const cdmdCompRef = this.$refs[refName];
// ZLSubPackage
if (cdmdCompRef) {
refs.push(cdmdCompRef);
}
} }
} }
} }

Loading…
Cancel
Save