Browse Source

feat:[模板管理][组件抽离ing]

master
luojie 1 week ago
parent
commit
e2d672c220
18 changed files with 1161 additions and 290 deletions
  1. +43
    -30
      src/components/Template/BaseInfoFormPcakge.vue
  2. +12
    -2
      src/components/Template/HandleFormItem.vue
  3. +51
    -37
      src/components/Template/Step.vue
  4. +28
    -22
      src/components/Template/Table.vue
  5. +5
    -0
      src/lang/en.js
  6. +56
    -0
      src/lang/en/template/commonTemplate.js
  7. +5
    -0
      src/lang/zh.js
  8. +56
    -0
      src/lang/zh/template/commonTemplate.js
  9. +40
    -3
      src/store/modules/template.js
  10. +15
    -4
      src/views/business/comps/template/TemplateTable.vue
  11. +9
    -6
      src/views/business/comps/template/comps/sp/Demo.vue
  12. +299
    -0
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  13. +288
    -0
      src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue
  14. +207
    -180
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
  15. +42
    -3
      src/views/business/comps/template/mixins/templateMixin.js
  16. +1
    -1
      src/views/business/study/comp/tbbd/Xq.vue
  17. +3
    -1
      src/views/business/study/comp/ytbd/Bj.vue
  18. +1
    -1
      src/views/business/study/comp/ytbd/Xq.vue

+ 43
- 30
src/components/Template/BaseInfoFormPcakge.vue View File

@ -8,7 +8,7 @@
:key="key">
<template v-if="sItem.type === 'input'">
<div class="form-title">{{ sItem.label }}</div>
<HandleFormItem :item="sItem" v-model="formFields[key]"
<HandleFormItem @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" />
</template>
</div>
@ -30,7 +30,7 @@
<div v-show="isShowOther(formFields[key])">
<div class="form-title">其他</div>
<div class="flex">
<HandleFormItem :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
<HandleFormItem @blur="onBlur(key, $event)" :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
@copy="onCopy(sItem, key)" />
</div>
</div>
@ -56,11 +56,11 @@
@copy="onCopy(sItem, key)" @change="onSelectChange(key, $event)" />
</div>
<div v-else-if="sItem.type === 'input'">
<HandleFormItem :item="sItem" v-model="formFields[key]"
<HandleFormItem @blur="onBlur(key, $event)" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" />
</div>
<div v-else-if="sItem.type === 'textarea'">
<HandleFormItem type="textarea" :item="sItem" v-model="formFields[key]"
<HandleFormItem @blur="onBlur(key, $event)" type="textarea" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" />
</div>
</div>
@ -83,13 +83,21 @@
<div v-show="isShowOther(formFields[key])" class="flex flex1">
<div class="other-title">其他</div>
<div class="flex">
<HandleFormItem class="sub-select" :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
<HandleFormItem @blur="onBlur(key, $event)" class="sub-select" :item="getOtherItem(sItem)" v-model="formFields[sItem.otherCode]"
@copy="onCopy(sItem, key)" />
</div>
</div>
</div>
<div v-else-if="sItem.type === 'input'" class="flex flex1">
<HandleFormItem class="flex1" :item="sItem" v-model="formFields[key]"
<HandleFormItem @blur="onBlur(key, $event)" class="flex1" :item="sItem" v-model="formFields[key]"
@copy="onCopy(sItem, key)" />
<HandleFormItem v-if="sItem.subType === 'select'" type="select" class="sub-select" :item="getSubItem(sItem)" v-model="formFields[sItem.subKey]"
@copy="onCopy(sItem, key)" @change="onSelectChange(sItem.subKey, $event)" />
<div v-else-if="sItem.subType === 'span'">{{ formFields[sItem.subKey] }}</div>
<div class="clickable" v-else-if = "sItem.subType ==='clickable'" @click="handleClickable(sItem)">{{ formFields[sItem.subKey] }}</div>
</div>
<div v-else-if="sItem.type === 'inputNumber'" class="flex flex1">
<HandleFormItem type = "inputNumber" @blur="onBlur(key, $event)" class="flex1" :item="sItem" @input = "onInputNumberChange(key, $event)" :value = "formFields[key]"
@copy="onCopy(sItem, key)" />
<HandleFormItem v-if="sItem.subType === 'select'" type="select" class="sub-select" :item="getSubItem(sItem)" v-model="formFields[sItem.subKey]"
@copy="onCopy(sItem, key)" @change="onSelectChange(sItem.subKey, $event)" />
@ -136,6 +144,15 @@ export default {
immediate: true,
deep: true, // 便
handler(v) {
if(v){
this.handleFormField();
}
}
},
formConfig: {
immediate: true,
deep: true, // 便
handler(v) {
this.handleFormField();
}
}
@ -146,6 +163,21 @@ export default {
},
methods: {
onInputNumberChange(key, val){
if(val === 0){
this.formFields[key] = null;
return;
}
this.formFields[key] = val;
},
updateFormField(key, value){
this.formFields[key] = value;
},
batchUpdateFormFields(data){
Object.keys(data).forEach(key => {
this.formFields[key] = data[key];
})
},
handleClickable(sItem){
console.log(sItem)
this.$emit("clickable",sItem)
@ -163,11 +195,12 @@ export default {
return {
label:"其他",
fillType: sItem.fillType,
maxlength: sItem.otherMaxlength || 50,
}
},
getSubItem(sItem){
return {
label: sItem.label,
label: "",
options: sItem.subOptions || [],
fillType: sItem.subFillType || sItem.fillType,
}
@ -182,7 +215,6 @@ export default {
const result = {};
let config = {};
const { formConfig, formData, formFields } = this;
//
formConfig.forEach((item) => {
if (item.config) {
@ -194,30 +226,13 @@ export default {
const currentConfig = item.config[key];
let value = formData[key];
//
// if (currentConfig.type === 'select' && currentConfig.multiple) {
// if (!Array.isArray(value)) {
// //
// value = value ? [value] : [];
// }
// }
// // null/undefined
// if (value === null || value === undefined) {
// //
// if (currentConfig.type === 'select' && currentConfig.multiple) {
// value = [];
// } else {
// value = '';
// }
// }
// formFields
if (formFields[key] !== null &&
formFields[key] !== undefined &&
formFields[key] !== ''&&
typeof formFields[key] !== 'object'
) {
console.log(key,formData,formFields[key],"kkk")
// 使formData
result[key] = formFields[key];
} else {
@ -276,9 +291,8 @@ export default {
})
},
onInput(key, val) {
this.formFields[key] = val;
this.$emit("input", { key, value: val });
onBlur(key, val) {
this.$emit("blur", { key, value: val ,...this.formFields});
},
onSelectChange(key, val) {
//
@ -292,7 +306,6 @@ export default {
//
this.formFields[key] = val;
// }
this.$emit("select", { key, value: val });
},
//

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

@ -3,6 +3,7 @@
<div class="flex1 flex">
<el-input v-if="type === 'input'" :maxlength="item.maxlength || 30" :disabled="getDisabled()"
:class="item.fillType | getFillType"
@blur="onBlur"
:placeholder="item.placeholder ? item.placeholder : ('请输入' + item.label)"
v-model="inputValue" @input="onInputChange" @change="onInputChange" />
<el-input v-else-if="type === 'textarea'" :maxlength="item.maxlength || 30" :disabled="getDisabled()"
@ -10,18 +11,21 @@
type = "textarea"
show-word-limit
resize = "none"
@blur="onBlur"
:rows="item.rows || 3"
:placeholder="item.placeholder ? item.placeholder : ('请输入' + item.label)"
v-model="inputValue" @input="onInputChange" @change="onInputChange" />
<el-input-number v-else-if="type === 'inputNumber'"
@blur="onBlur"
:maxlength="item.maxlength || 30"
class="flex1"
:disabled="getDisabled()"
:controls = "item.controls || false"
:min = "item.min || 0"
:precision="item.precision"
:class="item.fillType | getFillType"
:placeholder="item.placeholder ? item.placeholder : ('请输入' + item.label)"
v-model="inputValue" @change="onInputChange" />
v-model="inputValue" @input="onInputChange" @change="onInputChange" />
<el-select v-else-if="type === 'select'" class="flex1"
:multiple = "item.multiple"
:class="item.fillType | getFillType"
@ -48,7 +52,7 @@
<div class="handle-row" v-if="isShowHandle()">
<el-checkbox class = "ml-5"></el-checkbox>
<Question class="handle-icon" :class = "getQuestionColor()"/>
<img @click="onCopy" src="@/assets/images/copy-icon.svg" class="handle-icon" alt=""/>
<img v-if="getIsShowCopyIcon()" @click="onCopy" src="@/assets/images/copy-icon.svg" class="handle-icon" alt=""/>
<img src="@/assets/images/record-icon.svg" class="handle-icon" alt=""/>
</div>
</div>
@ -115,6 +119,12 @@ export default {
this.$emit('input', value);
this.$emit('change', value);
},
//
getIsShowCopyIcon(){
const {copyFrom} = this.item;
const {templateStatus} = this.$store.state.template;
return copyFrom && templateStatus=== "actFill";
},
//
isShowHandle(){
const {fillType} = this.item;

+ 51
- 37
src/components/Template/Step.vue View File

@ -11,19 +11,14 @@
<div class="step-content">
<span class="step-title">步骤{{ index + 1 }}</span>
<el-select
class = "step-type-select"
<HandleFormItem
type = "select"
placeholder="请选择"
class="step-type-select"
:item = "stepSelectConfig"
v-model="step.type"
@change="onTypeChange(index)"
placeholder="请选择"
>
<el-option
v-for="option in stepTypes"
:key="option.value"
:label="option.label"
:value="option.value"
></el-option>
</el-select>
/>
<!-- 根据步骤类型显示对应的表单 -->
<component :is="getStepComponent(step.type)"
@ -61,18 +56,9 @@ import CoatStep from './StepComponents/CoatStep.vue'
import StaticStartStep from './StepComponents/StaticStartStep.vue'
import StaticEndStep from './StepComponents/StaticEndStep.vue'
import TakePlateStep from './StepComponents/TakePlateStep.vue'
import HandleFormItem from './HandleFormItem.vue'
export default {
name: 'Step',
props: {
value: {
type: Array,
default: () => []
}
},
data() {
return {
stepTypes: [
const stepTypes = [
{ label: '容器选择', value: 'container' },
// { label: '', value: 'centrifuge' },
// { label: '', value: 'autoWeigh' },
@ -89,7 +75,23 @@ export default {
// { label: '', value: 'staticStart' },
// { label: '', value: 'staticEnd' },
// { label: '', value: 'takePlate' }
],
];
export default {
name: 'Step',
props: {
formData: {
type: Object,
default: () => ({stepData:[]})
}
},
data() {
return {
stepSelectConfig:{
options: stepTypes,
fillType:"preFill",
placeholder:"请选择步骤类型"
},
steps: [],
stepId: 1,
componentMap: null
@ -121,6 +123,7 @@ export default {
}
},
components: {
HandleFormItem,
ContainerStep,
CentrifugeStep,
AutoWeighStep,
@ -139,17 +142,17 @@ export default {
TakePlateStep
},
created() {
//
if (this.value && this.value.length > 0) {
this.steps = this.value.map((step) => ({
id: this.stepId++,
type: step.type || '',
formData: step.formData || {}
}))
} else {
//
this.addStep()
}
// //
// if (this.value && this.value.length > 0) {
// this.steps = this.value.map((step) => ({
// id: this.stepId++,
// type: step.type || '',
// formData: step.formData || {}
// }))
// } else {
// //
// this.addStep()
// }
},
watch: {
steps: {
@ -160,6 +163,18 @@ export default {
})))
},
deep: true
},
'formData.stepData': {
handler(newVal) {
console.log('newVal', newVal)
if(!newVal || newVal.length === 0) return
this.steps = newVal.map((step) => ({
id: this.stepId++,
type: step.type || '',
formData: step.formData || {}
}))
},
deep: true
}
},
methods: {
@ -218,7 +233,7 @@ export default {
type: step.type,
...step.formData
}))
resolve(stepData)
resolve({stepData})
})
},
@ -323,7 +338,7 @@ export default {
.step-list {
.step-item {
margin-bottom: 20px;
margin-top: 20px;
border-radius: 6px;
overflow: hidden;
@ -347,7 +362,6 @@ export default {
}
.step-content {
padding: 20px;
display: flex;
align-items: center;
}

+ 28
- 22
src/components/Template/Table.vue View File

@ -1,33 +1,39 @@
<template>
<div class="mt-20">
<el-table
:data="dataSource"
>
<el-table-column
v-for="(item) in columns"
:prop="item.prop"
:key = "item.prop"
:label="item.label">
</el-table-column>
<div>
<LineLabel v-if = "label" :label="label"></LineLabel>
<div class="mt-20">
<el-table :data="dataSource">
<el-table-column v-for="(item) in columns" :prop="item.prop" :key="item.prop" :label="item.label">
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
export default {
props:{
//[{label:"",prop:"name"}]
columns:{
type:Array,
default:[],
},
dataSource:{
type:Array,
default:[],
}
import LineLabel from "./LineLabel.vue";
export default {
components: {
LineLabel,
},
props: {
//[{label:"",prop:"name"}]
columns: {
type: Array,
default: [],
},
dataSource: {
type: Array,
default: [],
},
label: {
type: String,
default: "",
}
}
}
</script>
<style lang="scss" scoped>

+ 5
- 0
src/lang/en.js View File

@ -9,6 +9,8 @@ import dept from './en/system/dept'
import user from './en/system/user'
// 模板管理
import template from './en/system/template'
// 公共模板语言配置
import commonTemplate from './en/template/commonTemplate'
// 试验管理
import study from './en/business/study/study'
@ -134,5 +136,8 @@ export default {
},
form: form
}
},
template: {
common: commonTemplate
}
}

+ 56
- 0
src/lang/en/template/commonTemplate.js View File

@ -0,0 +1,56 @@
export default {
// 页面标题
pageTitle: 'Biological Sample Analysis Solution Preparation Table',
// 标签
baseInfo: 'Test Basic Information',
reagentInfo: 'Test Reagent Information',
instrumentInfo: 'Instrument Usage Information',
storageCondition: 'Storage Conditions',
operationSteps: 'Operation Steps',
remark: 'Remarks',
// 字段标签
storageConditionLabel: 'Storage Conditions',
testName: 'Test Name',
testNumber: 'Test Number',
methodCode: 'Method Code',
versionNumber: 'Version Number',
testConfigurationConditions: 'Test Configuration Conditions',
preFill: 'Pre-Fill',
actualFill: 'Actual',
configurationTime: 'Configuration Time',
startTime: 'Start Time',
endTime: 'End Time',
targetSolutionName: 'Target Solution Name',
targetSolutionCode: 'Target Solution Code',
targetPreConcentration: 'Target Solution Expected Concentration',
targetActConcentration: 'Target Solution Actual Concentration',
targetPreVolume: 'Target Solution Expected Volume',
targetActVolume: 'Target Solution Actual Volume',
effectivePeriod: 'Effective Period',
expireDate: 'Expiry Date',
// 占位符
remarkPlaceholder: 'Please enter remarks',
// 按钮
saveBtn: 'Save',
// 错误提示
addStepError: 'Please add steps',
// 试剂信息列
reagentName: 'Reagent Name',
reagentCode: 'Code',
reagentNo: 'Batch Number',
concentration: 'Concentration/Content/Purity',
source: 'Source',
reagentExpireDate: 'Expiry Date',
// 仪器使用信息列
instrumentName: 'Instrument Name',
instrumentModel: 'Instrument Model',
instrumentCode: 'Instrument Number',
nextTestDate: 'Next Test/Calibration/Verification Date'
}

+ 5
- 0
src/lang/zh.js View File

@ -9,6 +9,8 @@ import dept from './zh/system/dept'
import user from './zh/system/user'
// 模板管理
import template from './zh/system/template'
// 公共模板语言配置
import commonTemplate from './zh/template/commonTemplate'
// 试验管理
import study from './zh/business/study/study'
@ -131,5 +133,8 @@ export default {
},
form: form
}
},
template: {
common: commonTemplate
}
}

+ 56
- 0
src/lang/zh/template/commonTemplate.js View File

@ -0,0 +1,56 @@
export default {
// 页面标题
pageTitle: '生物样品分析溶液配制表',
// 标签
baseInfo: '试验基本信息',
reagentInfo: '试验试剂信息',
instrumentInfo: '仪器使用信息',
storageCondition: '存储条件',
operationSteps: '操作步骤',
remark: '备注',
// 字段标签
storageConditionLabel: '存储条件',
testName: '试验名称',
testNumber: '试验编号',
methodCode: '方法编号',
versionNumber: '版本号',
testConfigurationConditions: '试验配制条件',
preFill: '预填',
actualFill: '实际',
configurationTime: '配置时间',
startTime: '开始时间',
endTime: '结束时间',
targetSolutionName: '目标溶液名称',
targetSolutionCode: '目标溶液编号',
targetPreConcentration: '目标溶液预计浓度',
targetActConcentration: '目标溶液实际浓度',
targetPreVolume: '目标溶液预计体积',
targetActVolume: '目标溶液实际体积',
effectivePeriod: '有效周期',
expireDate: '失效日',
// 占位符
remarkPlaceholder: '请输入备注',
// 按钮
saveBtn: '保存',
// 错误提示
addStepError: '请添加步骤',
// 试剂信息列
reagentName: '试剂名称',
reagentCode: '编号',
reagentNo: '批号',
concentration: '浓度/含量/纯度',
source: '来源',
reagentExpireDate: '失效日',
// 仪器使用信息列
instrumentName: '仪器名称',
instrumentModel: '仪器型号',
instrumentCode: '仪器编号',
nextTestDate: '下次测试/校准/检定日期'
}

+ 40
- 3
src/store/modules/template.js View File

@ -1,17 +1,54 @@
const template = {
namespaced: true,
state: {
templateStatus:"",//模板状态 "actFill"(实际填报) "preFill"(预填) ”qc“(qc) "detail"(详情)
templateStatus: "",//模板状态 "actFill"(实际填报) "preFill"(预填) ”qc“(qc) "detail"(详情)
templateData: {},//模板数据
//浓度单位
mgOptions: [
{ label: "mg", value: "mg" },
{ label: "ng", value: "ng" },
],
//体积单位
volumeOptions: [
{ label: "ul", value: "ul" },
{ label: "ml", value: "ml" },
{ label: "l", value: "l" },
],
//试验配制条件
conditionOptions: [
{ label: "条件1", value: "1" },
{ label: "条件2", value: "2" },
{ label: "条件3", value: "3" },
{ label: "其他", value: "-1" },
],
//有效周期单位
effectivePeriodOptions: [
{ label: "小时", value: "hours" },
{ label: "天", value: "days" },
],
},
mutations: {
SET_TEMPLATE_STATUS: (state, status) => {
state.templateStatus = status
}
},
SET_CONDITION_OPTIONS: (state, options) => {
console.log(options,"setOptions")
state.conditionOptions = options
},
SET_TEMPLATE_DATA: (state, data) => {
state.templateData = data
},
},
actions: {
setTemplateStatus({ commit }, status) {
commit('SET_TEMPLATE_STATUS', status)
}
},
setConditionOptions({ commit }, status) {
commit('SET_CONDITION_OPTIONS', status)
},
setTemplateData({ commit }, data) {
commit('SET_TEMPLATE_DATA', data)
},
}
}
export default template

+ 15
- 4
src/views/business/comps/template/TemplateTable.vue View File

@ -2,7 +2,7 @@
<div class="template-table">
<!-- <SP001 v-if="sn == 'SP0012'" />
<SWYPFXRYPZB v-if="sn == 'SP001'" /> -->
<component ref="templateComponent" :is="getTemplateComponent()" :fillType="fillType">
<component ref="templateComponent" :is="getTemplateComponent()" :templateData="templateData" :fillType="fillType">
</component>
</div>
</template>
@ -11,11 +11,13 @@
//
import SP001 from './comps/sp/SP001';
import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue";
import SWYPFXCBYPZB from "./comps/sp/SWYPFXCBYPZB.vue";
import SWYPBQGZYZBB from "./comps/sp/SWYPBQGZYZBB.vue";
import Demo from "./comps/sp/Demo.vue";
export default {
name: "TemplateTable",
components: {
SP001,SWYPFXRYPZB ,Demo
SP001,SWYPFXRYPZB ,Demo,SWYPFXCBYPZB,SWYPBQGZYZBB,
},
props: {
sn: {
@ -25,7 +27,11 @@ export default {
fillType: {
type: String,
default: 'preFill',
}
},
templateData: {
type: Object,
default: () => {},
},
},
computed: {
@ -33,16 +39,20 @@ export default {
if (!this.componentMap) {
this.componentMap = {
'SP001': 'SWYPFXRYPZB',
// 'SP002': 'SWYPFXCBYPZB',
'SP002': 'SWYPBQGZYZBB',
'SP003': 'SWYPBQGZYZBB',
// 'SP001': 'Demo',
}
}
return this.componentMap
return this.componentMap || "Demo"
}
},
watch: {
sn: {
immediate: true,
handler(v) {
console.log(v,"sn")
}
}
},
@ -52,6 +62,7 @@ export default {
};
},
mounted() {
console.log(this.fillType,"fillType")
},
methods: {
async getFormData() {

+ 9
- 6
src/views/business/comps/template/comps/sp/Demo.vue View File

@ -17,7 +17,7 @@
<BaseInfoFormPcakge ref = "stepFormPackage" :formConfig = "stepFormConfig" :formData = "formData"/>
<CustomTable ref = "stepTable" :columns = "stepColumns" :dataSource = "stepDataSource"/>
</div>
<Step ref = "stepRef"></Step>
<Step ref = "stepRef" :formData = "formData"></Step>
</div>
</div>
<button @click = "onSave">保存</button>
@ -126,7 +126,7 @@ export default {
label:"存储条件",
type:"select",
fillType:"preFill",
options:[],
options:this.$store.state.template.conditionOptions,
otherCode:"other1",
},
@ -245,7 +245,10 @@ export default {
mounted() {
setTimeout(()=>{
this.formData = {
code:"code1",name:"name1",act:["1","-1"],taget1:"mg",targetCode1:"123456",taget1c:"可点击"
code:"code1",name:"name1",act:["1","-1"],taget1:"mg",targetCode1:"123456",taget1c:"可点击",
stepData:[
{type: 'container', containerType: ''}
]
}
},300)
@ -261,10 +264,10 @@ export default {
async onSave(){
// const result1 = await this.$refs.baseInfo.getFormData();
// const result2 = await this.$refs.storageCondition.getFormData();
// const result3 = await this.$refs.stepRef.getFormData();
const result3 = await this.$refs.stepRef.getFormData();
// const result = await this.$refs.stepFormPackage.getFormData();
const result1 = await this.$refs.stepTable.getFormData();
console.log(result1,"reee")
// const result1 = await this.$refs.stepTable.getFormData();
console.log(...result3,"reee")
}
}
};

+ 299
- 0
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -0,0 +1,299 @@
<!-- 生物样品标曲工作液制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品标曲工作液制备表<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
:formData="formData" />
<TableList label="试验试剂信息" :columns="sysjColumns" :dataSource="dataSource" />
<TableList label="仪器使用信息" :columns="yqsColumns" :dataSource="dataSource" />
<BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" />
<LineLabel label="操作步骤" />
<div class="template-form-item">
<BaseInfoFormPcakge ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
</div>
<Step ref="stepRef" :formData="formData"></Step>
<BaseInfoFormPcakge label="备注" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</div>
</template>
<script>
import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
export default {
name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable },
mixins: [templateMixin],
props: {
value: {
type: {},
default: () => { },
},
fillType: {
type: String,
default: 'preFill',
},
},
watch: {
value: {
immediate: true,
handler(v) {
}
}
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition1: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
otherCode: "other1",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: "请输入备注",
maxlength: 500,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
bdmc: {
label: "试验名称",
type: "input",
disabled: true,
},
bdbh: {
label: "试验编号",
type: "input",
disabled: true,
},
methodCode: {
label: "方法编号",
type: "input",
fillType: "preFill",
},
versionNum: {
label: "版本号",
type: "input",
fillType: "actFill"
},
}
},
{
type: "conditionItem",
label: "试验配制条件",
config: {
pre: {
label: "预填",
type: "select",
multiple: true,
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
otherCode: "other1",
},
act: {
label: "实际",
type: "select",
fillType: "actFill",
otherCode: "other2",
multiple: true,
options: this.$store.state.template.conditionOptions
}
}
},
{
type: "cellItem",
config: {
remark: {
label: "容器材质",
type: "input",
fillType: "actFill",
placeholder: "请输入备注",
}
}
},
{
type: "cellItem",
label: "处理时间",
config: {
createTime: {
label: "开始时间",
type: "input",
},
endTime: {
label: "结束时间",
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
targetName: {
label: "目标溶液名称",
type: "input",
fillType: "preFill",
},
targetCode: {
label: "目标溶液编号",
type: "input",
subType: "span",
fillType: "preFill",
subKey: "targetCode1",
},
targetPreConcentration: {
label: "目标溶液预计浓度",
type: "input",
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
},
targetActConcentration: {
label: "目标溶液实际浓度",
type: "input",
subType: "select",
subKey: "targetActConcentrationUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
copyFrom: "targetPreConcentration",//
},
targetPreVolume: {
label: "目标溶液预计体积",
type: "input",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.$store.state.template.volumeOptions,
fillType: "preFill",
},
targetActVolume: {
label: "目标溶液实际体积",
type: "input",
subType: "select",
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.volumeOptions,
copyFrom: "targetPreVolume",//
},
effectivePeriod: {
label: "有效周期",
type: "input",
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.$store.state.template.effectivePeriodOptions,
},
expireDate: {
label: "失效日",
type: "input",
},
}
}
]
},
},
data() {
return {
dataSource: [],
sysjColumns: [
{ label: "试剂名称", prop: "reagentName" },
{ label: "编号", prop: "reagentCode" },
{ label: "批号", prop: "reagentNo" },
{ label: "浓度/含量/纯度", prop: "concentration" },
{ label: "来源", prop: "source" },
{ label: "失效日", prop: "expireDate" },
],
yqsColumns: [
{ label: "仪器名称", prop: "instrumentName" },
{ label: "仪器型号", prop: "instrumentModel" },
{ label: "仪器编号", prop: "instrumentCode" },
{ label: "下次测试/校准/检定日期", prop: "nextTestDate" },
],
formData: {}
};
},
mounted() {
},
methods: {
async getFormData() {
const baseData = await this.$refs.baseInfoRef.getFormData();
const conditionData = await this.$refs.storageConditionRef.getFormData();
const stepFormData = await this.$refs.stepFormPackageRef.getFormData();
const stepData = await this.$refs.stepRef.getFormData();
if (!stepData.length) {
this.$message.error("请添加步骤");
return;
}
const remarkData = await this.$refs.remarkRef.getFormData();
return {
...baseData,
...conditionData,
...stepData,
stepData: stepFormData,
...remarkData
}
},
async onSave() {
const formData = await this.getFormData();
console.log(formData, "formData")
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

+ 288
- 0
src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue View File

@ -0,0 +1,288 @@
<!-- 生物样品分析储备液配制表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品分析储备液配制表<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
:formData="formData" />
<TableList label="试验试剂信息" :columns="sysjColumns" :dataSource="dataSource" />
<TableList label="仪器使用信息" :columns="yqsColumns" :dataSource="dataSource" />
<BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" />
<LineLabel label="操作步骤" />
<div class="template-form-item">
<BaseInfoFormPcakge ref="stepFormPackageRef" :formConfig="stepFormConfig"
:formData="formData" />
</div>
<Step ref="stepRef" :formData="formData"></Step>
<BaseInfoFormPcakge label="备注" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
</div>
</div>
</template>
<script>
import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
export default {
name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable },
mixins: [templateMixin],
props: {
value: {
type: {},
default: () => { },
},
fillType: {
type: String,
default: 'preFill',
},
},
watch: {
value: {
immediate: true,
handler(v) {
}
}
},
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition1: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
otherCode: "other1",
},
}
}
];
},
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: "请输入备注",
maxlength: 500,
rows: 5
}
}
}
]
},
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
bdmc: {
label: "试验名称",
type: "input",
disabled: true,
},
bdbh: {
label: "试验编号",
type: "input",
disabled: true,
},
methodCode: {
label: "方法编号",
type: "input",
fillType: "preFill",
},
versionNum: {
label: "版本号",
type: "input",
fillType: "actFill"
},
}
},
{
type: "conditionItem",
label: "试验配制条件",
config: {
pre: {
label: "预填",
type: "select",
multiple: true,
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
otherCode: "other1",
},
act: {
label: "实际",
type: "select",
fillType: "actFill",
otherCode: "other2",
multiple: true,
options: this.$store.state.template.conditionOptions
}
}
},
{
type: "cellItem",
label: "配置时间",
config: {
createTime: {
label: "开始时间",
type: "input",
},
endTime: {
label: "结束时间",
type: "input",
},
}
}
]
},
stepFormConfig() {
return [
{
type: "step",
config: {
targetName: {
label: "目标溶液名称",
type: "input",
fillType: "preFill",
},
targetCode: {
label: "目标溶液编号",
type: "input",
subType: "span",
fillType: "preFill",
subKey: "targetCode1",
},
targetPreConcentration: {
label: "目标溶液预计浓度",
type: "input",
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
},
targetActConcentration: {
label: "目标溶液实际浓度",
type: "input",
subType: "select",
subKey: "targetActConcentrationUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
copyFrom: "targetPreConcentration",//
},
targetPreVolume: {
label: "目标溶液预计体积",
type: "input",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.$store.state.template.volumeOptions,
fillType: "preFill",
},
targetActVolume: {
label: "目标溶液实际体积",
type: "input",
subType: "select",
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.volumeOptions,
copyFrom: "targetPreVolume",//
},
effectivePeriod: {
label: "有效周期",
type: "input",
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.$store.state.template.effectivePeriodOptions,
},
expireDate: {
label: "失效日",
type: "input",
},
}
}
]
},
},
data() {
return {
dataSource: [],
sysjColumns: [
{ label: "试剂名称", prop: "reagentName" },
{ label: "编号", prop: "reagentCode" },
{ label: "批号", prop: "reagentNo" },
{ label: "浓度/含量/纯度", prop: "concentration" },
{ label: "来源", prop: "source" },
{ label: "失效日", prop: "expireDate" },
],
yqsColumns: [
{ label: "仪器名称", prop: "instrumentName" },
{ label: "仪器型号", prop: "instrumentModel" },
{ label: "仪器编号", prop: "instrumentCode" },
{ label: "下次测试/校准/检定日期", prop: "nextTestDate" },
],
formData: {}
};
},
mounted() {
},
methods: {
async getFormData() {
const baseData = await this.$refs.baseInfoRef.getFormData();
const conditionData = await this.$refs.storageConditionRef.getFormData();
const stepFormData = await this.$refs.stepFormPackageRef.getFormData();
const stepData = await this.$refs.stepRef.getFormData();
if (!stepData.length) {
this.$message.error("请添加步骤");
return;
}
const remarkData = await this.$refs.remarkRef.getFormData();
return {
...baseData,
...conditionData,
...stepData,
stepData: stepFormData,
...remarkData
}
},
async onSave() {
const formData = await this.getFormData();
console.log(formData, "formData")
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

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

@ -2,30 +2,32 @@
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品分析溶液配制表<img
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ $t('template.common.pageTitle') }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPcakge label = "试验基本信息" ref = "baseInfo" :formConfig = "formConfig" :formData = "formData"/>
<LineLabel label = "试验试剂信息"/>
<TableList :columns = "sysjColumns" :dataSource = "dataSource"/>
<LineLabel label = "仪器使用信息"/>
<TableList :columns = "yqsColumns" :dataSource = "dataSource"/>
<BaseInfoFormPcakge label = "存储条件" ref = "storageConditionRef" :formConfig = "storageFormConfig" :formData = "formData"/>
<LineLabel label = "操作步骤"/>
<BaseInfoFormPcakge :label="$t('template.common.baseInfo')" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
:formData="formData" />
<TableList :label="$t('template.common.reagentInfo')" :columns="sysjColumns" :dataSource="dataSource" />
<TableList :label="$t('template.common.instrumentInfo')" :columns="yqsColumns" :dataSource="dataSource" />
<BaseInfoFormPcakge :label="$t('template.common.storageCondition')" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" />
<LineLabel :label="$t('template.common.operationSteps')" />
<div class="template-form-item">
<BaseInfoFormPcakge ref = "stepFormPackage" :formConfig = "stepFormConfig" :formData = "formData"/>
<BaseInfoFormPcakge ref="stepFormPackageRef" :formConfig="stepFormConfig"
@blur = "onHandleBlur"
:formData="formData" />
</div>
<Step ref = "stepRef"></Step>
<BaseInfoFormPcakge label = "备注" ref = "remarkRef" :formConfig = "remarkConig" :formData = "formData"/>
<Step ref="stepRef" :formData="formData"></Step>
<BaseInfoFormPcakge :label="$t('template.common.remark')" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
<!-- <button @click = "onSave">{{ $t('template.SWYPFXRYPZB.saveBtn') }}</button> -->
</div>
</div>
</template>
<script>
import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge";
import LineLabel from "@/components/Template/LineLabel";
@ -33,19 +35,11 @@ import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
const mgOptions = [
{label:"mg",value:"mg"},
{label:"ng",value:"ng"},
];
const conditionOptions = [
{label:"条件1",value:"1"},
{label:"条件2",value:"2"},
{label:"条件3",value:"3"},
{label:"其他",value:"-1"},
];
import moment from 'moment';
export default {
name: "SWYPFXRYPZB",
components: { BaseInfoFormPcakge,LineLabel,TableList,Step,CustomTable },
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable },
mixins: [templateMixin],
props: {
value: {
@ -65,220 +59,253 @@ export default {
}
}
},
data() {
return {
dataSource:[{name:"名称1"}],
sysjColumns:[
{label:"试剂名称",prop:"reagentName"},
{label:"编号",prop:"reagentCode"},
{label:"批号",prop:"reagentNo"},
{label:"浓度/含量/纯度",prop:"concentration"},
{label:"来源",prop:"source"},
{label:"失效日",prop:"expireDate"},
],
yqsColumns:[
{label:"仪器名称",prop:"instrumentName"},
{label:"仪器型号",prop:"instrumentModel"},
{label:"仪器编号",prop:"instrumentCode"},
{label:"下次测试/校准/检定日期",prop:"nextTestDate"},
],
storageFormConfig:[
{
type:"conditionItem",
config:{
storageCondition1:{
label:"存储条件",
type:"select",
fillType:"preFill",
options:conditionOptions,
otherCode:"other1",
computed: {
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition1: {
label: this.$t('template.common.storageConditionLabel'),
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
otherCode: "other1",
},
}
}
],
remarkConig:[
];
},
remarkConig() {
return [
{
type:"cellItem",
config:{
remark:{
label:"",
type:"textarea",
fillType:"actFill",
span:1,
placeholder:"请输入备注",
maxlength:500,
rows:5
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: this.$t('template.common.remarkPlaceholder'),
maxlength: 500,
rows: 5
}
}
}
],
formConfig: [
]
},
baseInfoFormConfig() {
return [
{
type:"cardItem",
config:{
name:{
label:"试验名称",
type:"input",
disabled:true,
type: "cardItem",
config: {
bdmc: {
label: this.$t('template.common.testName'),
type: "input",
disabled: true,
},
code:{
label:"试验编号",
type:"input",
disabled:true,
bdbh: {
label: this.$t('template.common.testNumber'),
type: "input",
disabled: true,
},
methodCode:{
label:"方法编号",
type:"input",
fillType:"preFill",
copyFrom:"name",//
methodCode: {
label: this.$t('template.common.methodCode'),
type: "input",
fillType: "preFill",
maxlength:50
},
versionNum:{
label:"版本号",
type:"input",
fillType:"actFill"
versionNum: {
label: this.$t('template.common.versionNumber'),
type: "input",
fillType: "actFill"
},
}
},
{
type:"conditionItem",
label:"试验配制条件",
config:{
pre:{
label:"预填",
type:"select",
multiple:true,
fillType:"preFill",
options:conditionOptions,
otherCode:"other1",
type: "conditionItem",
label: this.$t('template.common.testConfigurationConditions'),
config: {
pre: {
label: this.$t('template.common.preFill'),
type: "select",
multiple: true,
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
otherCode: "other1",
},
act:{
label:"实际",
type:"select",
fillType:"actFill",
otherCode:"other2",
multiple:true,
options:conditionOptions
act: {
label: this.$t('template.common.actualFill'),
type: "select",
fillType: "actFill",
otherCode: "other2",
multiple: true,
options: this.$store.state.template.conditionOptions
}
}
},
{
type:"cellItem",
label:"配置时间",
config:{
startDate:{
label:"开始时间",
type:"input",
type: "cellItem",
label: this.$t('template.common.configurationTime'),
config: {
createTime: {
label: this.$t('template.common.startTime'),
type: "input",
},
endDate:{
label:"结束时间",
type:"input",
endTime: {
label: this.$t('template.common.endTime'),
type: "input",
},
}
}
],
stepFormConfig:[
]
},
stepFormConfig() {
return [
{
type:"step",
config:{
targetName:{
label:"目标溶液名称",
type:"input",
fillType:"preFill",
type: "step",
config: {
targetName: {
label: this.$t('template.common.targetSolutionName'),
type: "input",
fillType: "preFill",
maxlength:50
},
targetCode:{
label:"目标溶液编号",
type:"input",
subType:"span",
fillType:"preFill",
subKey:"targetCode1",
targetCode: {
label: this.$t('template.common.targetSolutionCode'),
type: "input",
subType: "span",
fillType: "preFill",
subKey: "targetCode1",
maxlength:20
},
targetPreConcentration:{
label:"目标溶液预计浓度",
type:"input",
subType:"select",
subKey:"targetPreConcentrationUnit",
fillType:"preFill",
subOptions:mgOptions,
targetPreConcentration: {
label: this.$t('template.common.targetPreConcentration'),
type: "inputNumber",
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
maxlength:10
},
targetActConcentration:{
label:"目标溶液实际浓度",
type:"input",
subType:"select",
subKey:"targetActConcentrationUnit",
fillType:"actFill",
subFillType:"preFill",
subOptions:mgOptions,
targetActConcentration: {
label: this.$t('template.common.targetActConcentration'),
type: "inputNumber",
subType: "select",
subKey: "targetActConcentrationUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
copyFrom: "targetPreConcentration",//
maxlength:10
},
targetPreVolume:{
label:"目标溶液预计体积",
type:"input",
subType:"select",
subKey:"targetPreVolumeUnit",
subOptions:mgOptions,
fillType:"preFill",
targetPreVolume: {
label: this.$t('template.common.targetPreVolume'),
type: "inputNumber",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.$store.state.template.volumeOptions,
fillType: "preFill",
maxlength:10
},
targetActVolume:{
label:"目标溶液实际体积",
type:"input",
subType:"select",
subKey:"targetActVolumeUnit",
fillType:"actFill",
subFillType:"preFill",
subOptions:mgOptions,
targetActVolume: {
label: this.$t('template.common.targetActVolume'),
type: "inputNumber",
subType: "select",
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.volumeOptions,
copyFrom: "targetPreVolume",//
maxlength:10
},
effectivePeriod:{
label:"有效周期",
type:"input",
subType:"select",
subKey:"effectivePeriodUnit",
fillType:"preFill",
subOptions:[
{label:"小时",value:"hour"},
{label:"天",value:"day"},
],
effectivePeriod: {
label: this.$t('template.common.effectivePeriod'),
type: "inputNumber",
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.$store.state.template.effectivePeriodOptions,
maxlength:10
},
expireDate:{
label:"失效日",
type:"input",
expireDate: {
label: this.$t('template.common.expireDate'),
type: "input",
},
}
}
]
},
},
data() {
return {
dataSource: [],
sysjColumns: [
{ label: this.$t('template.common.reagentName'), prop: "reagentName" },
{ label: this.$t('template.common.reagentCode'), prop: "reagentCode" },
{ label: this.$t('template.common.reagentNo'), prop: "reagentNo" },
{ label: this.$t('template.common.concentration'), prop: "concentration" },
{ label: this.$t('template.common.source'), prop: "source" },
{ label: this.$t('template.common.reagentExpireDate'), prop: "expireDate" },
],
formData:{}
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" },
],
formData: {}
};
},
mounted() {
setTimeout(()=>{
if(this.fillType === "preFill"){
this.formData = {
// code:"code1",name:"name1",act:["1","-1"],taget1:"mg",targetCode1:"123456",taget1c:""
effectivePeriodUnit:"days",//
createTime: "2026-01-02 18:05:36",//
targetPreConcentration:2,
}
},3000)
}
},
methods: {
async getFormData(){
const baseData = await this.$refs.baseInfo.getFormData();
async getFormData() {
const baseData = await this.$refs.baseInfoRef.getFormData();
const conditionData = await this.$refs.storageConditionRef.getFormData();
const stepFormData = await this.$refs.stepFormPackageRef.getFormData();
const stepData = await this.$refs.stepRef.getFormData();
const stepFormData = await this.$refs.stepFormPackage.getFormData();
if (!stepData.length) {
this.$message.error(this.$t('template.common.addStepError'));
return;
}
const remarkData = await this.$refs.remarkRef.getFormData();
return {
...baseData,
...conditionData,
...stepData,
...stepFormData,
stepData: stepFormData,
...remarkData
}
},
async onSave(){
async onSave() {
const formData = await this.getFormData();
console.log(formData,"formData")
console.log(formData, "formData")
},
onHandleBlur(fields){
const {key ,effectivePeriodUnit,effectivePeriod} = fields;
const {createTime} = this.formData;
console.log(fields)
if(key ==="effectivePeriod"){//
const start = moment(createTime);
const end = start.add(Number(effectivePeriod), effectivePeriodUnit).format("YYYY-MM-DD HH:mm:ss");
this.$refs.stepFormPackageRef.updateFormField("expireDate", end);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20{
.mt-20 {
margin-top: 20px;
}
</style>

+ 42
- 3
src/views/business/comps/template/mixins/templateMixin.js View File

@ -1,17 +1,56 @@
export default {
props: {
templateData: {
type: Object,
default: () => {},
},
},
watch: {
templateData: {
immediate: true,
handler(v) {
if(v){
let n = {...v};
if(v.bdnr){
n = {...n,...JSON.parse(v.bdnr)};
}
this.formData = n;
this.setTemplateData(n);
}
}
}
},
data() {
},
mounted() {
this.setTemplateStatus("preFill")
setTimeout(() => {
this.setConditionOptions(
[
{ label: "条件5", value: "1" },
{ label: "条件6", value: "2" },
{ label: "条件7", value: "3" },
{ label: "其他", value: "-1" },
]
)
}, 1000);
this.setTemplateStatus("preFill");
// this.setTemplateStatus(this.fillType)
},
unmounted() {
this.setTemplateStatus("");
this.setTemplateData({});
},
methods: {
setTemplateStatus(status) {
this.$store.commit('template/SET_TEMPLATE_STATUS', status)
}
},
setConditionOptions(options) {
this.$store.commit('template/SET_CONDITION_OPTIONS', options)
},
},
}

+ 1
- 1
src/views/business/study/comp/tbbd/Xq.vue View File

@ -28,7 +28,7 @@ G