Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
ef60829162
4 changed files with 60 additions and 22 deletions
  1. +16
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +13
    -0
      src/components/Template/mixins/formPackageMixins.js
  3. +29
    -22
      src/views/business/comps/template/comps/dl/DL023.vue
  4. +2
    -0
      src/views/business/comps/template/mixins/templateMixin.js

+ 16
- 0
src/components/Template/BaseInfoFormPackage.vue View File

@ -198,6 +198,7 @@
<div class="other-title" v-if="isShowOtherLabel(sItem) && isShowOther(formFields[key])">
{{ sItem.otherLabel ? $t(sItem.otherLabel) :
$t("template.common.other") }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.otherCode" @blur="onBlur(key, $event)"
@ -208,6 +209,21 @@
:orange-bg="orangeBgFields[sItem.otherCode]" />
</div>
</div>
<div v-show="sItem.thirdOtherCode && isShowOther(formFields[sItem.otherCode])"
class="flex flex1 ml-10">
<div class="other-title">
{{$t("template.common.other") }}</div>
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.thirdOtherCode" @blur="onBlur(key, $event)"
:item="getOtherItem(sItem)" v-model="formFields[sItem.thirdOtherCode]"
type="input"
@copy="onCopy(sItem, key)" :error="errors[sItem.thirdOtherCode]"
@update:error="errors[sItem.thirdOtherCode] = false"
:orange-bg="orangeBgFields[sItem.thirdOtherCode]" />
</div>
</div>
</div>
<div v-else-if="sItem.type === 'input' || sItem.type === 'inputNumber'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"

+ 13
- 0
src/components/Template/mixins/formPackageMixins.js View File

@ -241,6 +241,16 @@ export default {
}
config[otherCode] = { label: "template.common.other", parentType: type, parentKey: key, type: "input", fillType: currentConfig.fillType }
}
if (currentConfig.thirdOtherCode) {
const { thirdOtherCode, type } = currentConfig;
//如果是更新的话,优先使用formFields中的值
if (update) {
result[thirdOtherCode] = formFields[thirdOtherCode] || formData[thirdOtherCode] || '';
} else {
result[thirdOtherCode] = formData[thirdOtherCode] || formFields[thirdOtherCode] || '';
}
config[thirdOtherCode] = { label: "template.common.other", parentType: type, parentKey: key, type: "input", fillType: currentConfig.fillType }
}
if (currentConfig.subKey) {
const { subKey } = currentConfig;
if (update) {
@ -289,6 +299,9 @@ export default {
if (item.config?.otherCode) {
config[item.config?.otherCode] = item.config?.otherCode;
}
if (item.config?.thirdOtherCode) {
config[item.config?.thirdOtherCode] = item.config?.thirdOtherCode;
}
}
});
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段

+ 29
- 22
src/views/business/comps/template/comps/dl/DL023.vue View File

@ -22,7 +22,8 @@
<LineLabel label="template.dl.dl023.czjl" />
<!-- 操作记录 -->
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
@select="onSelect" @clickButton="handleClickButton" :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
@select="onSelect" @clickButton="handleClickButton" :formConfig="stepFormConfig"
@blur="onHandleBlur" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
@ -98,11 +99,11 @@ export default {
//yqsyxxColumns使
yqsyxxColumns() {
return [{
label: 'template.dl.dl023.yqbh',
prop: 'yqbh',
bodyType: 'yq',
bodyFillType: 'actFill'
}, {
label: 'template.dl.dl023.yqbh',
prop: 'yqbh',
bodyType: 'yq',
bodyFillType: 'actFill'
}, {
label: 'template.dl.dl023.yqmc',
prop: 'yqmc',
bodyType: 'input',
@ -142,6 +143,7 @@ export default {
{ label: "细胞系", value: "细胞系" }
],
otherCode: 'dwzshxbxOther',
thirdOtherCode: 'dwzshxbxThirdOther',
showOtherLabel: false,
otherOptions: this.otherOptions
},
@ -185,8 +187,8 @@ export default {
subType: 'button',
subKey: 'zskssj',
buttonName: 'template.dl.dl023.ksButton',
disabled:true,
subDisabled:false
disabled: true,
subDisabled: false
},
zsjssj: {
label: 'template.dl.dl023.zsjssj',
@ -196,8 +198,8 @@ export default {
subType: 'button',
subKey: 'zsjssj',
buttonName: 'template.dl.dl023.jsButton',
disabled:true,
subDisabled:false
disabled: true,
subDisabled: false
},
}
}
@ -211,19 +213,24 @@ export default {
};
},
mounted() {
const {dwzshxbx} = this.formData;
this.setOtherOptions(dwzshxbx);
},
methods: {
//
handleClickButton(item,signData) {
methods: {
setOtherOptions(value){
this.otherOptions = value === '动物种属' ? this.getDictOptions('business_dl_dwzs') : this.getDictOptions('business_dl_xbx')
},
//
handleClickButton(item, signData) {
const arrStr = item.subKey;
const value = moment().format('YYYY/MM/DD HH:mm');
this.$refs.swypyjInfoRef.updateFormData(arrStr, value,{isUpdateRecord:true,signData});
const value = moment().format('YYYY/MM/DD HH:mm');
this.$refs.swypyjInfoRef.updateFormData(arrStr, value, { isUpdateRecord: true, signData });
// console.log(this.getFilledFormData())
},
onSelect(e) {
const { key, value } = e
if (key === "dwzshxbx") {//
this.otherOptions = value === '动物种属' ? this.getDictOptions('business_dl_dwzs') : this.getDictOptions('business_dl_xbx')
this.setOtherOptions(value);
}
},
@ -232,12 +239,12 @@ export default {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
if (key === 'yqbh' && this.$refs.tableRef) {
const params = {
yqmc: row.mc,
yqxh: row.xh,
xcrq: row.jzrq,
}
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, params)
const params = {
yqmc: row.mc,
yqxh: row.xh,
xcrq: row.jzrq,
}
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, params)
}
},
onFormSelect(fields) {

+ 2
- 0
src/views/business/comps/template/mixins/templateMixin.js View File

@ -68,6 +68,8 @@ export default {
'business_ada_kyktffxyp', // ADA-编号-抗药抗体方法学样品制备表ADA007
'business_dl_uav', // 毒理-紫外照射操作记录表-UVA-DL023
'business_pcr_fxffypzbb', //PCR-编号-分析方法学样品制备表
'business_dl_dwzs', //DL023动物种属
'business_dl_xbx', //DL023细胞系
],
props: {
templateData: {

Loading…
Cancel
Save