Browse Source

feat:[模板管理][update]

lkf
luojie 3 months ago
parent
commit
838a0ab0d8
11 changed files with 96 additions and 84 deletions
  1. +7
    -7
      src/components/Template/BaseInfoFormPcakge.vue
  2. +8
    -8
      src/components/Template/CustomTable.vue
  3. +28
    -26
      src/components/Template/HandleFormItem.vue
  4. +1
    -1
      src/components/Template/LineLabel.vue
  5. +2
    -1
      src/components/Template/Step.vue
  6. +1
    -1
      src/components/Template/Table.vue
  7. +4
    -1
      src/lang/en/template/commonTemplate.js
  8. +4
    -1
      src/lang/zh/template/commonTemplate.js
  9. +37
    -37
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
  10. +1
    -0
      src/views/business/comps/template/mixins/templateMixin.js
  11. +3
    -1
      src/views/business/study/comp/ytbd/Bj.vue

+ 7
- 7
src/components/Template/BaseInfoFormPcakge.vue View File

@ -7,14 +7,14 @@
<div v-for="(sItem, key) in item.config" class="form-item" <div v-for="(sItem, key) in item.config" class="form-item"
:class="sItem.span == 1 ? 'full-row' : ''" :key="key"> :class="sItem.span == 1 ? 'full-row' : ''" :key="key">
<template v-if="sItem.type === 'input'"> <template v-if="sItem.type === 'input'">
<div class="form-title">{{ sItem.label }}</div>
<div class="form-title">{{ $t( sItem.label) }}</div>
<HandleFormItem :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]" <HandleFormItem :field-item-label="fieldItemLabel" @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
:field-key="prefixKey+'_'+key" :field-key="prefixKey+'_'+key"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'inputNumber'"> <template v-else-if="sItem.type === 'inputNumber'">
<div class="form-title">{{ sItem.label }}</div>
<div class="form-title">{{ $t( sItem.label) }}</div>
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="inputNumber" @blur="onBlur(key, $event)" :item="sItem" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="inputNumber" @blur="onBlur(key, $event)" :item="sItem"
@input="onInputNumberChange(key, $event)" v-model="formFields[key]" @input="onInputNumberChange(key, $event)" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
@ -25,10 +25,10 @@
</template> </template>
<template v-else-if="item.type === 'conditionItem'"> <template v-else-if="item.type === 'conditionItem'">
<div class="form-item "> <div class="form-item ">
<div class="form-title fs-16" v-if="item.label">{{ item.label }}</div>
<div class="form-title fs-16" v-if="item.label">{{ $t( item.label) }}</div>
<div v-for="(sItem, key) in item.config" class="c-Item grid-container"> <div v-for="(sItem, key) in item.config" class="c-Item grid-container">
<div class="p-r-20"> <div class="p-r-20">
<div class="form-title">{{ sItem.label }}</div>
<div class="form-title">{{ $t( sItem.label) }}</div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="select" :item="sItem" v-model="formFields[key]" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="select" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="onSelectChange(key, $event)" @copy="onCopy(sItem, key)" @change="onSelectChange(key, $event)"
@ -55,10 +55,10 @@
</template> </template>
<template v-else-if="item.type === 'cellItem'"> <template v-else-if="item.type === 'cellItem'">
<div class="form-item "> <div class="form-item ">
<div class="form-title fs-16" v-if="item.label">{{ item.label }}</div>
<div class="form-title fs-16" v-if="item.label">{{ $t( item.label) }}</div>
<div class="grid-container gap2"> <div class="grid-container gap2">
<div v-for="(sItem, key) in item.config" class="c-Item" :class="getSpanClass(sItem)" :key="key"> <div v-for="(sItem, key) in item.config" class="c-Item" :class="getSpanClass(sItem)" :key="key">
<div class="form-title" v-if="sItem.label">{{ sItem.label }}</div>
<div class="form-title" v-if="sItem.label">{{ $t( sItem.label) }}</div>
<div v-if="sItem.type === 'dateTime'" class="flex1"> <div v-if="sItem.type === 'dateTime'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="dateTime" :item="sItem" v-model="formFields[key]" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="dateTime" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
@ -94,7 +94,7 @@
<div class="grid-container gap2"> <div class="grid-container gap2">
<div v-for="(sItem, key) in item.config" class="c-Item flex item-center" <div v-for="(sItem, key) in item.config" class="c-Item flex item-center"
:class="getSpanClass(sItem)" :key="key"> :class="getSpanClass(sItem)" :key="key">
<div class="step-form-title" v-if="sItem.label">{{ sItem.label }}</div>
<div class="step-form-title" v-if="sItem.label">{{ $t( sItem.label) }}</div>
<div v-if="sItem.type === 'dateTime'" class="flex1"> <div v-if="sItem.type === 'dateTime'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="dateTime" :item="sItem" v-model="formFields[key]" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="dateTime" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" @copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"

+ 8
- 8
src/components/Template/CustomTable.vue View File

@ -6,7 +6,7 @@
<div v-for="(col, index) in columns" :key="index" class="custom-table-cell header-cell" <div v-for="(col, index) in columns" :key="index" class="custom-table-cell header-cell"
:style="{ width: col.width ? col.width + 'px' : 'auto' }"> :style="{ width: col.width ? col.width + 'px' : 'auto' }">
<div class="header-cell-content"> <div class="header-cell-content">
<div>{{ col.label }}</div>
<div>{{ $t(col.label) }}</div>
<template <template
v-if="col.headerSelectKey && col.headerOptions && (showHeaderSelect || templateFillType === 'preFill')"> v-if="col.headerSelectKey && col.headerOptions && (showHeaderSelect || templateFillType === 'preFill')">
<HandleFormItem :fieldKey="prefixKey+'_'+col.headerSelectKey+'_'+rowIndex" :fieldItemLabel="fieldItemLabel" type="select" class="header-select" :item="getHeaderItem(col)" <HandleFormItem :fieldKey="prefixKey+'_'+col.headerSelectKey+'_'+rowIndex" :fieldItemLabel="fieldItemLabel" type="select" class="header-select" :item="getHeaderItem(col)"
@ -243,8 +243,8 @@ export default {
rowIndex: -1, // rowIndex: -1, //
colIndex, colIndex,
field: col.headerSelectKey, field: col.headerSelectKey,
label: col.label,
error: `请选择${col.label}`
label: this.$t(col.label),
error: `请选择${this.$t(col.label)}`
}; };
errors.push(errorItem); errors.push(errorItem);
this.formErrors.push(errorItem); this.formErrors.push(errorItem);
@ -265,8 +265,8 @@ export default {
rowIndex, rowIndex,
colIndex, colIndex,
field: col.prop, field: col.prop,
label: col.label,
error: `请填写${col.label}`
label: this.$t(col.label),
error: `请填写${this.$t(col.label)}`
}; };
errors.push(errorItem); errors.push(errorItem);
this.formErrors.push(errorItem); this.formErrors.push(errorItem);
@ -281,8 +281,8 @@ export default {
rowIndex, rowIndex,
colIndex, colIndex,
field: col.bodySubKey, field: col.bodySubKey,
label: `${col.label}单位`,
error: `请填写${col.label}单位`
label: `${this.$t(col.label)}单位`,
error: `请填写${this.$t(col.label)}单位`
}; };
errors.push(errorItem); errors.push(errorItem);
this.formErrors.push(errorItem); this.formErrors.push(errorItem);
@ -356,7 +356,7 @@ export default {
fillType: col.bodyFillType, fillType: col.bodyFillType,
options: col.bodyOptions, options: col.bodyOptions,
maxlength: col.bodyMaxlength, maxlength: col.bodyMaxlength,
label: col.label,
label: this.$t(col.label),
precision: currentItem[col.bodyPrecisionKey] || col.precision || 0, precision: currentItem[col.bodyPrecisionKey] || col.precision || 0,
copyFrom: col.copyFrom || "", copyFrom: col.copyFrom || "",
compareTo: col.bodyCompareTo, // compareTo compareTo: col.bodyCompareTo, // compareTo

+ 28
- 26
src/components/Template/HandleFormItem.vue View File

@ -15,8 +15,8 @@
:placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" /> :placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" />
<el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple" <el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
:disabled="getDisabled()" :placeholder="getPlaceholder()" @remove-tag = "onRemoveTag" @visible-change="onSelectBlur"
@change="onInputChange">
:disabled="getDisabled()" :placeholder="getPlaceholder()" @remove-tag="onRemoveTag"
@visible-change="onSelectBlur" @change="onInputChange">
<el-option v-for="op in item.options" :key="op.value" :label="op.label" :value="op.value"> <el-option v-for="op in item.options" :key="op.value" :label="op.label" :value="op.value">
</el-option> </el-option>
</el-select> </el-select>
@ -59,9 +59,9 @@
<span>{{ index + 1 }}.</span> <span>{{ index + 1 }}.</span>
<span> {{ record.userName }} </span> <span> {{ record.userName }} </span>
<span>{{ record.time }} </span> <span>{{ record.time }} </span>
<span>{{ record.title }}</span>
<span>{{ modificationRecords.length-1==index?"填写":"修改记录" }}</span>
</div> </div>
<div v-if="record.oldValue && record.value">
<div v-if = "modificationRecords.length-1!==index">
<div>原值{{ record.oldValue }}</div> <div>原值{{ record.oldValue }}</div>
<div>修改值{{ record.value }}</div> <div>修改值{{ record.value }}</div>
</div> </div>
@ -176,7 +176,7 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
onEditSignSave(data){
onEditSignSave(data) {
this.handleUpdateRecord(data) this.handleUpdateRecord(data)
}, },
getChecked() { getChecked() {
@ -280,13 +280,13 @@ export default {
// this.$emit('input', val); // this.$emit('input', val);
// this.$emit('change', val); // this.$emit('change', val);
}, },
onRemoveTag(e){
onRemoveTag(e) {
this.onCommonHandleSaveRecord(this.inputValue); this.onCommonHandleSaveRecord(this.inputValue);
}, },
// //
onSelectBlur(visible) { onSelectBlur(visible) {
if (!visible) { if (!visible) {
console.log(this.inputValue,"onSelectBlur")
console.log(this.inputValue, "onSelectBlur")
this.onCommonHandleSaveRecord(this.inputValue); this.onCommonHandleSaveRecord(this.inputValue);
} }
}, },
@ -310,7 +310,7 @@ export default {
}, },
// question // question
onClickQuestion() { onClickQuestion() {
const {templateFillType} = this;
const { templateFillType } = this;
if (templateFillType == 'actFill' || templateFillType == 'qc') { if (templateFillType == 'actFill' || templateFillType == 'qc') {
if (templateFillType == 'qc') { if (templateFillType == 'qc') {
const field = this.getFieldCheckObj()[this.fieldKey]; const field = this.getFieldCheckObj()[this.fieldKey];
@ -328,7 +328,7 @@ export default {
const o = records[0]; const o = records[0];
if (!o.reply && templateFillType == 'qc') {//qc if (!o.reply && templateFillType == 'qc') {//qc
content = o.content; content = o.content;
}else if(!o.content&& templateFillType == 'actFill'){//qc
} else if (!o.content && templateFillType == 'actFill') {//qc
content = o.replay; content = o.replay;
} }
} }
@ -350,12 +350,10 @@ export default {
const isSame = this.isEqual(this.oldValue, this.inputValue); const isSame = this.isEqual(this.oldValue, this.inputValue);
if (this.oldValue && !isSame) { if (this.oldValue && !isSame) {
this.$refs.editSignRef.show() this.$refs.editSignRef.show()
}
if(!this.oldValue){//
}else if (!this.oldValue) {//
this.handleUpdateRecord() this.handleUpdateRecord()
} }
} else { } else {
// blurchange // blurchange
this.$emit("blur", val) this.$emit("blur", val)
@ -365,8 +363,8 @@ export default {
}, },
//退 //退
resetRecord(){
//
resetRecord() {
//
this.inputValue = this.oldValue; this.inputValue = this.oldValue;
this.$emit('input', this.inputValue); // v-model this.$emit('input', this.inputValue); // v-model
this.$emit("blur", this.oldValue); this.$emit("blur", this.oldValue);
@ -374,7 +372,7 @@ export default {
}, },
// //
handleUpdateRecord(data){
handleUpdateRecord(data) {
const baseInfo = this.getCommonRecordInfo(); const baseInfo = this.getCommonRecordInfo();
const record = { const record = {
...baseInfo, ...baseInfo,
@ -383,7 +381,7 @@ export default {
title: this.oldValue ? "修改记录" : "填写", title: this.oldValue ? "修改记录" : "填写",
time: moment().format("YYYY-MM-DD HH:mm:ss"), time: moment().format("YYYY-MM-DD HH:mm:ss"),
} }
if(data){
if (data) {
record.reason = data.remark record.reason = data.remark
} }
const params = { const params = {
@ -391,6 +389,7 @@ export default {
newRecord: record, newRecord: record,
resourceList: deepClone(this.getZdxgjl()), resourceList: deepClone(this.getZdxgjl()),
} }
console.log(params,"params")
EventBus.$emit('onModifyRecord', params,) EventBus.$emit('onModifyRecord', params,)
this.updateZdxgjl(record); this.updateZdxgjl(record);
// //
@ -401,7 +400,7 @@ export default {
}, },
// //
isEqual(oldValue, nowValue){
isEqual(oldValue, nowValue) {
if (oldValue === null || nowValue === null) { if (oldValue === null || nowValue === null) {
return oldValue === nowValue; return oldValue === nowValue;
} }
@ -415,19 +414,22 @@ export default {
getCommonRecordInfo() { getCommonRecordInfo() {
const { nickName, name } = this.$store.getters; const { nickName, name } = this.$store.getters;
//locale:zh-CN en-US //locale:zh-CN en-US
const lang = this.$i18n.locale === "zh-CN" ? "cn" : "en";
const lang = this.$i18n.locale === "zh_CN" ? "cn" : "en";
const { label, parentLabel } = this.item; const { label, parentLabel } = this.item;
let fieldLabel = label;
if (label === "其他") {
fieldLabel = parentLabel + "其他信息";
} else if (!label) {
fieldLabel = parentLabel + "单位";
let fieldLabelCn = this.$i18n.t(label,"zh_CN"),fieldLabelEn = this.$i18n.t(label,"en_US");
if (label === "template.common.other") {
fieldLabelCn = this.$i18n.t(parentLabel,"zh_CN")+this.$i18n.t("template.common.otherInfo","zh_CN");
fieldLabelEn = this.$i18n.t(parentLabel,"en_US")+this.$i18n.t("template.common.otherInfo","en_US");
} else if (!label && parentLabel == "template.common.remark") {
fieldLabelCn = this.$i18n.t(parentLabel,"zh_CN")+this.$i18n.t("template.common.unit","zh_CN");
fieldLabelEn = this.$i18n.t(parentLabel,"en_US")+this.$i18n.t("template.common.unit","en_US");
} }
const commonInfo = { const commonInfo = {
userNameCn: nickName, userNameCn: nickName,
userNameEn: name, userNameEn: name,
key: this.fieldKey, key: this.fieldKey,
field: `${this.fieldItemLabel}-${fieldLabel}`,
fieldCn: `${this.$i18n.t(this.fieldItemLabel,"zh_CN")}`+(fieldLabelCn?("-"+fieldLabelCn):""),
fieldEn: `${this.$i18n.t(this.fieldItemLabel,"en_US")}`+(fieldLabelEn?("-"+fieldLabelEn):""),
} }
return commonInfo; return commonInfo;
}, },
@ -490,7 +492,7 @@ export default {
if (type === "select" || type === "dateTime") { if (type === "select" || type === "dateTime") {
prex = "请选择" prex = "请选择"
} }
return placeholder ? placeholder : (prex + label)
return placeholder ? this.$t(placeholder) : (prex + this.$t(label))
}, },
onCopy() { onCopy() {

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

@ -1,7 +1,7 @@
<template> <template>
<div class="content-title"> <div class="content-title">
<div class="line"></div> <div class="line"></div>
<div class="subtitle"> {{$attrs.label}}</div>
<div class="subtitle"> {{$t($attrs.label)}}</div>
</div> </div>
</template> </template>

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

@ -255,10 +255,11 @@ export default {
// //
getFilledFormData() { getFilledFormData() {
return this.steps.map(step => ({
const stepData = this.steps.map(step => ({
type: step.type, type: step.type,
...step.formData ...step.formData
})) }))
return {stepData}
}, },
// //

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

@ -3,7 +3,7 @@
<LineLabel v-if = "label" :label="label"></LineLabel> <LineLabel v-if = "label" :label="label"></LineLabel>
<div class="mt-20"> <div class="mt-20">
<el-table :data="dataSource"> <el-table :data="dataSource">
<el-table-column v-for="(item) in columns" :prop="item.prop" :key="item.prop" :label="item.label">
<el-table-column v-for="(item) in columns" :prop="item.prop" :key="item.prop" :label="$t(item.label)">
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>

+ 4
- 1
src/lang/en/template/commonTemplate.js View File

@ -57,5 +57,8 @@ export default {
// 试验物质配制计划列 // 试验物质配制计划列
administrationDoseOrGroup: 'Administration Dose or Group', administrationDoseOrGroup: 'Administration Dose or Group',
preparationConcentration: 'Preparation Concentration', preparationConcentration: 'Preparation Concentration',
preparationVolume: 'Preparation Volume'
preparationVolume: 'Preparation Volume',
other: 'Other',
otherInfo: 'Other Information',
unit: 'unit',
} }

+ 4
- 1
src/lang/zh/template/commonTemplate.js View File

@ -57,5 +57,8 @@ export default {
// 试验物质配制计划列 // 试验物质配制计划列
administrationDoseOrGroup: '给药剂量或组别', administrationDoseOrGroup: '给药剂量或组别',
preparationConcentration: '配制浓度', preparationConcentration: '配制浓度',
preparationVolume: '配制体积'
preparationVolume: '配制体积',
other: '其他',
otherInfo: '其他信息',
unit: '单位',
} }

+ 37
- 37
src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue View File

@ -6,21 +6,21 @@
$t('template.common.pageTitle') }}<img src="@/assets/images/detail-title.png" /></div> $t('template.common.pageTitle') }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPcakge :fieldItemLabel="$t('template.common.baseInfo')" :label="$t('template.common.baseInfo')" ref="baseInfoRef"
<BaseInfoFormPcakge fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef"
:formConfig="baseInfoFormConfig" :formData="formData" /> :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList :label="$t('template.common.reagentInfo')" :columns="sysjColumns"
<TableList label="template.common.reagentInfo" :columns="sysjColumns"
:dataSource="resource" /> :dataSource="resource" />
<TableList :label="$t('template.common.instrumentInfo')" :columns="yqsColumns"
<TableList label="template.common.instrumentInfo" :columns="yqsColumns"
:dataSource="resource" /> :dataSource="resource" />
<BaseInfoFormPcakge :fieldItemLabel="$t('template.common.storageCondition')" :label="$t('template.common.storageCondition')" ref="storageConditionRef"
<BaseInfoFormPcakge fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" /> :formConfig="storageFormConfig" :formData="formData" />
<LineLabel :label="$t('template.common.operationSteps')" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPcakge :fieldItemLabel="$t('template.common.operationSteps')" ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur"
<BaseInfoFormPcakge fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" /> :formData="formData" />
</div> </div>
<Step ref="stepRef" :formData="formData.stepData"></Step> <Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPcakge :fieldItemLabel="$t('template.common.remark')" :label="$t('template.common.remark')" ref="remarkRef" :formConfig="remarkConig"
<BaseInfoFormPcakge fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig"
:formData="formData" /> :formData="formData" />
</div> </div>
@ -56,7 +56,7 @@ export default {
type: "conditionItem", type: "conditionItem",
config: { config: {
storageCondition: { storageCondition: {
label: this.$t('template.common.storageConditionLabel'),
label: 'template.common.storageConditionLabel',
type: "select", type: "select",
fillType: "preFill", fillType: "preFill",
options: this.getDictOptions("business_cctj"), options: this.getDictOptions("business_cctj"),
@ -77,7 +77,7 @@ export default {
type: "textarea", type: "textarea",
fillType: "actFill", fillType: "actFill",
span: 1, span: 1,
placeholder: this.$t('template.common.remarkPlaceholder'),
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000, maxlength: 1000,
rows: 5 rows: 5
} }
@ -92,23 +92,23 @@ export default {
type: "cardItem", type: "cardItem",
config: { config: {
studyMc: { studyMc: {
label: this.$t('template.common.testName'),
label: 'template.common.testName',
type: "input", type: "input",
disabled: true, disabled: true,
}, },
studySn: { studySn: {
label: this.$t('template.common.testNumber'),
label: 'template.common.testNumber',
type: "input", type: "input",
disabled: true, disabled: true,
}, },
methodCode: { methodCode: {
label: this.$t('template.common.methodCode'),
label: 'template.common.methodCode',
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
maxlength: 50 maxlength: 50
}, },
versionNum: { versionNum: {
label: this.$t('template.common.versionNumber'),
label: 'template.common.versionNumber',
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
maxlength: 50 maxlength: 50
@ -118,10 +118,10 @@ export default {
}, },
{ {
type: "conditionItem", type: "conditionItem",
label: this.$t('template.common.testConfigurationConditions'),
label: 'template.common.testConfigurationConditions',
config: { config: {
pre: { pre: {
label: this.$t('template.common.preFill'),
label: 'template.common.preFill',
type: "select", type: "select",
multiple: true, multiple: true,
fillType: "preFill", fillType: "preFill",
@ -129,7 +129,7 @@ export default {
otherCode: "preOther", otherCode: "preOther",
}, },
act: { act: {
label: this.$t('template.common.actualFill'),
label: 'template.common.actualFill',
type: "select", type: "select",
fillType: "actFill", fillType: "actFill",
otherCode: "actOther", otherCode: "actOther",
@ -140,14 +140,14 @@ export default {
}, },
{ {
type: "cellItem", type: "cellItem",
label: this.$t('template.common.configurationTime'),
label: 'template.common.configurationTime',
config: { config: {
startDate: { startDate: {
label: this.$t('template.common.startTime'),
label: 'template.common.startTime',
type: "input", type: "input",
}, },
endDate: { endDate: {
label: this.$t('template.common.endTime'),
label: 'template.common.endTime',
type: "input", type: "input",
}, },
} }
@ -160,13 +160,13 @@ export default {
type: "step", type: "step",
config: { config: {
targetName: { targetName: {
label: this.$t('template.common.targetSolutionName'),
label: 'template.common.targetSolutionName',
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
maxlength: 50 maxlength: 50
}, },
targetCode: { targetCode: {
label: this.$t('template.common.targetSolutionCode'),
label: 'template.common.targetSolutionCode',
type: "input", type: "input",
subType: "span", subType: "span",
fillType: "preFill", fillType: "preFill",
@ -174,7 +174,7 @@ export default {
maxlength: 20 maxlength: 20
}, },
targetPreConcentration: { targetPreConcentration: {
label: this.$t('template.common.targetPreConcentration'),
label: 'template.common.targetPreConcentration',
type: "inputNumber", type: "inputNumber",
subType: "select", subType: "select",
subKey: "targetPreConcentrationUnit", subKey: "targetPreConcentrationUnit",
@ -183,7 +183,7 @@ export default {
maxlength: 10 maxlength: 10
}, },
targetActConcentration: { targetActConcentration: {
label: this.$t('template.common.targetActConcentration'),
label: 'template.common.targetActConcentration',
type: "inputNumber", type: "inputNumber",
subType: "select", subType: "select",
subKey: "targetActConcentrationUnit", subKey: "targetActConcentrationUnit",
@ -195,7 +195,7 @@ export default {
maxlength: 10 maxlength: 10
}, },
targetPreVolume: { targetPreVolume: {
label: this.$t('template.common.targetPreVolume'),
label: 'template.common.targetPreVolume',
type: "inputNumber", type: "inputNumber",
subType: "select", subType: "select",
subKey: "targetPreVolumeUnit", subKey: "targetPreVolumeUnit",
@ -204,7 +204,7 @@ export default {
maxlength: 10 maxlength: 10
}, },
targetActVolume: { targetActVolume: {
label: this.$t('template.common.targetActVolume'),
label: 'template.common.targetActVolume',
type: "inputNumber", type: "inputNumber",
subType: "select", subType: "select",
subKey: "targetActVolumeUnit", subKey: "targetActVolumeUnit",
@ -216,7 +216,7 @@ export default {
maxlength: 10 maxlength: 10
}, },
effectivePeriod: { effectivePeriod: {
label: this.$t('template.common.effectivePeriod'),
label: 'template.common.effectivePeriod',
type: "inputNumber", type: "inputNumber",
subType: "select", subType: "select",
subKey: "effectivePeriodUnit", subKey: "effectivePeriodUnit",
@ -225,7 +225,7 @@ export default {
maxlength: 10 maxlength: 10
}, },
expireDate: { expireDate: {
label: this.$t('template.common.expireDate'),
label: 'template.common.expireDate',
type: "input", type: "input",
}, },
} }
@ -238,18 +238,18 @@ export default {
resource: [], resource: [],
resourceData1: [], resourceData1: [],
sysjColumns: [ sysjColumns: [
{ label: this.$t('template.common.reagentName'), prop: "mc" },//
{ label: this.$t('template.common.reagentCode'), prop: "bh" },//
{ label: this.$t('template.common.reagentNo'), prop: "ph" },//
{ label: this.$t('template.common.concentration'), prop: "nd" },//
{ label: this.$t('template.common.source'), prop: "source" },//
{ label: this.$t('template.common.reagentExpireDate'), prop: "sxrq" },//
{ label: 'template.common.reagentName', prop: "mc" },//
{ label: 'template.common.reagentCode', prop: "bh" },//
{ label: 'template.common.reagentNo', prop: "ph" },//
{ label: 'template.common.concentration', prop: "nd" },//
{ label: 'template.common.source', prop: "source" },//
{ label: 'template.common.reagentExpireDate', prop: "sxrq" },//
], ],
yqsColumns: [ yqsColumns: [
{ label: this.$t('template.common.instrumentName'), prop: "instrumentName" },
{ label: this.$t('template.common.instrumentModel'), prop: "instrumentModel" },
{ label: this.$t('template.common.instrumentCode'), prop: "instrumentCode" },
{ label: this.$t('template.common.nextTestDate'), prop: "nextTestDate" },
{ label: 'template.common.instrumentName', prop: "instrumentName" },
{ label: 'template.common.instrumentModel', prop: "instrumentModel" },
{ label: 'template.common.instrumentCode', prop: "instrumentCode" },
{ label: 'template.common.nextTestDate', prop: "nextTestDate" },
], ],
formData: {} formData: {}
}; };

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

@ -102,6 +102,7 @@ export default {
const { key, effectivePeriodUnit, effectivePeriod, codeSTD, targetStartSolution } = fields; const { key, effectivePeriodUnit, effectivePeriod, codeSTD, targetStartSolution } = fields;
const { startDate } = this.formData; const { startDate } = this.formData;
if (key === "effectivePeriod") {//统一处理有效周期失焦,计算失效事件,保证字段名不能变 if (key === "effectivePeriod") {//统一处理有效周期失焦,计算失效事件,保证字段名不能变
if(!startDate) return;
const start = moment(startDate); const start = moment(startDate);
const end = start.add(Number(effectivePeriod), effectivePeriodUnit).format("YYYY-MM-DD HH:mm:ss"); const end = start.add(Number(effectivePeriod), effectivePeriodUnit).format("YYYY-MM-DD HH:mm:ss");
this.$refs.stepFormPackageRef.updateFormData("expireDate", end); this.$refs.stepFormPackageRef.updateFormData("expireDate", end);

+ 3
- 1
src/views/business/study/comp/ytbd/Bj.vue View File

@ -138,6 +138,7 @@ import { mapGetters } from 'vuex'
import SelectTemplate from "@/views/business/comps/select/SelectTemplate"; import SelectTemplate from "@/views/business/comps/select/SelectTemplate";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import TemplateTable from '@/views/business/comps/template/TemplateTable'; import TemplateTable from '@/views/business/comps/template/TemplateTable';
import { deepClone } from "@/utils/index";
export default { export default {
name: "Bj", name: "Bj",
@ -234,6 +235,8 @@ export default {
this.$modal.loading() this.$modal.loading()
studyFormPre_info({ id: row.id }).then(response => { studyFormPre_info({ id: row.id }).then(response => {
this.form = response.data this.form = response.data
this.templateData = deepClone(this.form)
this.form.qmyy = '制作提交预制表单' this.form.qmyy = '制作提交预制表单'
this.$modal.closeLoading() this.$modal.closeLoading()
}).finally(() => { }).finally(() => {
@ -243,7 +246,6 @@ export default {
this.showIndex = 1 this.showIndex = 1
this.form = _.merge({}, this.form, row) this.form = _.merge({}, this.form, row)
} }
this.templateData = deepClone(this.form)
}, },
save() { save() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {

Loading…
Cancel
Save