<!-- 生物样品标曲工作液制备表 -->
<template>
	<div>
		<div class="detail-container">
			<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
					src="@/assets/images/detail-title.png" /></div>
			<div class="detail-content">
				<div class="content">
					<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
						ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
					<TableList label="template.common.sjInfo" :columns="sjColumns" :dataSource="resourceSj" />
					<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
					<!-- <BaseInfoFormPackage label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
						:formData="formData" /> -->
					<LineLabel label="template.common.operationSteps" />
					<div class="template-form-item">
						<BaseInfoFormPackage ref="stepFormPackageRef" fieldItemLabel="template.common.operationSteps"
							@onRegentSubmit="onRegentSubmit" 
							@beforeReagentSubmit="onBeforeReagentSubmit"
							@select = "onFormSelect"
							:formConfig="stepFormConfig" @blur="onHandleBlur"
							:formData="formData" />
						<CustomTable 
							@headerSelectChange="onHeaderSelectChange"
							fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
							@beforeSaveRecord = "beforeSaveRecord"
							:showAddRow="false" :showOperation="fillType === 'actFill'"
							ref="stepTableRef" :columns="stepColumns" :formData="formData">
							<template slot="operation" slot-scope="{ row, rowIndex, columns }">
								<TableOpertaion @startConfig="startConfig" @configComplete="configComplete"
									@printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType"
									:row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow">
								</TableOpertaion>
							</template>
						</CustomTable>
					</div>
					<Step ref="stepRef" fieldItemLabel="template.common.step" :formData="formData.stepData"></Step>
					<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
						ref="remarkRef" :formConfig="remarkConig" :formData="formData" />

				</div>
			</div>
		</div>
	</div>
</template>

<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
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';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { EventBus } from "@/utils/eventBus";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { isCommonUnit } from "@/utils/conTools";
import { isValueEmpty } from "@/utils/index";
export default {
	name: "SP003",
	components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
	mixins: [templateMixin],
	props: {
		fillType: {
			type: String,
			default: 'preFill',
		},
	},

	computed: {
		// 存储条件表单配置
		storageFormConfig() {
			return [
				{
					type: "conditionItem",
					config: {
						storageCondition: {
							label: "template.sp.sp003.cctj",
							type: "select",
							fillType: "preFill",
							options: this.getDictOptions('business_cctj'),
							otherCode: "storageConditionOther",
						},

					}
				}
			];
		},
		// 备注表单配置
		remarkConig() {
			return [
				{
					type: "cellItem",
					config: {
						remark: {
							label: "",
							type: "textarea",
							fillType: "actFill",
							span: 1,
							placeholder: "template.common.remarkPlaceholder",
							maxlength: 1000,
							rows: 5
						}
					}
				}
			]
		},
		// 试验基本信息表单配置
		baseInfoFormConfig() {
			return [
				{
					type: "cardItem",
					config: {
						studyMc: {
							label: "template.common.testName",
							type: "input",
							disabled: true,
						},
						studySn: {
							label: "template.common.testNumber",
							type: "input",
							disabled: true,
						},
						methodCode: {
							label: "template.common.methodCode",
							type: "input",
							fillType: "preFill",
							maxlength: 50,
						},
						versionNum: {
							label: "template.common.versionNumber",
							type: "inputNumber",
							fillType: "actFill",
							prepend: "V",
							maxlength: 50,
						},

					}
				},
				{
					type: "conditionItem",
					label: "template.common.testConfigurationConditions",
					config: {
						pre: {
							label: "template.common.preFill",
							type: "select",
							multiple: true,
							fillType: "preFill",
							options: this.getDictOptions('business_pztj'),
							otherCode: "preOther",
						},
						act: {
							label: "template.common.actualFill",
							type: "select",
							fillType: "actFill",
							otherCode: "actOther",
							multiple: true,
							options: this.getDictOptions('business_pztj'),
							compareTo: "pre"
						}
					}
				},
				{
					type: "cellItem",
					config: {
						containerMaterial: {
							label: "template.sp.sp003.rqcz",
							type: "select",
							options: this.getDictOptions('business_rqcz'),
							fillType: "actFill",
							otherCode: "containerMaterialOther",
						}
					}
				},
				{
					type: "cellItem",
					label: "template.common.configurationTime",
					config: {
						startDate: {
							label: "template.common.startTime",
							type: "input",
						},
						endDate: {
							label: "template.common.endTime",
							type: "input",
						},
					}
				}
			]
		},
		// 操作步骤表单配置
		stepFormConfig() {
			return [
				{
					type: "step",
					config: {
						startSolution: {
							label: "template.sp.sp003.qsyry",
							type: "input",
							fillType: "preFill",
							subType: "sj",
							subKey: "subStartSolution",
							subFillType: "actFill",
							maxlength: 20,
						},
						targetStartSolution: {
							label: "template.sp.sp003.ysqsyrynd",
							type: "inputNumber",
							subType: "select",
							fillType: "preFill",
							subOptions: this.getDictOptions('business_nddw'),
							subKey: "subTargetStartSolution",
							maxlength: 10,
						},
						targetAcSolution: {
							label: "template.sp.sp003.sjqsyrynd",
							type: "input",
							fillType: "actFill",
							disabled: true,
							maxlength: 10,
							compareTo: "targetStartSolution",
							subKey: "subTargetAcSolutionUnit",
							subType:"input",
							subDisabled:true,
							subCompareTo:"subTargetStartSolution",      
						},
						solution: {
							label: "template.sp.sp003.xsy",
							type: "input",
							fillType: "preFill",
							subType: "sj",
							subKey: "subSolution",
							subFillType: "actFill",
							maxlength: 20,
						},
						codeSTD: {
							label: "template.sp.sp003.qsbhstd",
							type: "input",
							maxlength: 10,
							fillType: "preFill",
						},
						stepStorageCondition: {
							label: "template.sp.sp003.cctj",
							type: "select",
							fillType: "preFill",
							options: this.getDictOptions('business_cctj'),
							otherCode: "stepStorageConditionOther",
						},

						effectivePeriod: {
							label: "template.sp.sp003.mbryyxzq",
							type: "input",
							subType: "select",
							subKey: "effectivePeriodUnit",
							fillType: "preFill",
							subOptions: this.getDictOptions('business_yxqdw'),
						},
						expireDate: {
							label: "template.sp.sp003.mbrysxr",
							type: "input",
						},
					}
				}
			]
		},
		// 步骤表格列配置
		stepColumns() {
			return [
				{
					label: "template.sp.sp003.mbrybh",
					prop: "targetSolutionCode",
					bodyType: "input",
					bodySubType: "span",
					bodySubKey: "subTargetSolutionCode",
					bodyFillType: "preFill",
					width: 140,
					myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],//分装的母液编号字段
					maxVolumeField: "actSolutionVolume",//分装的最大量字段
					maxVolumeFieldUnit: "actSolutionVolumeUnit",//分装的最大量单位字段
					// maxVolumeField: "targetSolutionVolume,targetDiluentVolume",//分装的最大量字段
					// maxVolumeFieldUnit: "targetSolutionVolumeUnit,targetDiluentVolumeUnit",//分装的最大量单位字段
				},
				{
					label: "template.sp.sp003.qsrybh",
					prop: "startSolutionCode",
					width: 180,
					bodyType: "input",
					bodyFillType: "actFill",
					bodyMaxlength: 10,
					bodyDisabled: true,
				},
				{
					label: "template.sp.sp003.ysqsrytj",
					prop: "targetStartSolutionVolume",
					width: 180,
					showWidth: 90,
					headerSelectKey: "targetStartSolutionVolumeUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_tjdw'),
					bodyType: "inputNumber",
					bodySubType: "inputNumber",
					bodySubKey: "targetStartSolutionVolumePrecision",
					bodyFillType: "preFill",
					bodySubFillType: "preFill",
					showBodySub: this.fillType === "preFill",
					bodyDisabled: true,
					bodyPrecisionKey: "targetStartSolutionVolumePrecision",
					subPrecision:0,
					bodyMaxlength: 10,
					bodySubPlaceholder: "template.common.xswsPlaceholder",
					headerSelectTo: "actStartSolutionVolumeUnit",
				},
				{
					label: "template.sp.sp003.sjqsrytj",
					prop: "actStartSolutionVolume",
					width: 180,
					showWidth: 90,
					headerSelectKey: "actStartSolutionVolumeUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_tjdw'),
					bodyType: "inputNumber",
					bodyFillType: "actFill",
					bodyMaxlength: 10,
					compareTo: "targetStartSolutionVolume",//与哪个字段比较
					copyFrom: "targetStartSolutionVolume",//复制哪个字段
				},
				{
					label: "template.sp.sp003.ysxsytj",
					prop: "targetDiluentVolume",
					width: 180,
					showWidth: 90,
					headerSelectKey: "targetDiluentVolumeUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_tjdw'),
					bodyType: "inputNumber",
					bodySubType: "inputNumber",
					bodySubKey: "targetDiluentVolumePrecision",
					bodyFillType: "preFill",
					bodySubFillType: "preFill",
					showBodySub: this.fillType === "preFill",
					bodyDisabled: true,
					bodyPrecisionKey: "targetDiluentVolumePrecision",
					subPrecision:0,
					bodyMaxlength: 10,
					bodySubPlaceholder: "请输入保留小数位数",
					headerSelectTo: "actDiluentVolumeUnit",
				},
				{
					label: "template.sp.sp003.sjxsytj",
					prop: "actDiluentVolume",
					width: 180,
					showWidth: 90,
					headerSelectKey: "actDiluentVolumeUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_tjdw'),
					bodyType: "inputNumber",
					bodyFillType: "actFill",
					bodyMaxlength: 10,
					compareTo: "targetDiluentVolume",//与哪个字段比较
					copyFrom: "targetDiluentVolume",//复制哪个字段
				},
				{
					label: "template.sp.sp003.ysmbrynd",
					prop: "targetSolutionConcentration",
					width: 210,
					showWidth: 120,
					headerSelectKey: "targetSolutionConcentrationUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_nddw'),
					bodyType: "inputNumber",
					bodyFillType: "preFill",
					bodyMaxlength: 10,
					headerSelectTo:"actSolutionConcentrationUnit",
				},
				{
					label: "template.sp.sp003.sjmbrynd",
					prop: "actSolutionConcentration",
					width: 210,
					showWidth: 120,
					headerSelectKey: "actSolutionConcentrationUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_nddw'),
					bodyType: "inputNumber",
					bodySubType: "inputNumber",
					bodySubKey: "actSolutionConcentrationPrecision",
					bodyFillType: "actFill",
					bodySubFillType: "preFill",
					showBodySub: this.fillType === "preFill",
					bodyDisabled: true,
					bodyPrecisionKey: "actSolutionConcentrationPrecision",
					subPrecision:0,
					bodyMaxlength: 10,
					bodySubPlaceholder: "请输入保留小数位数",
					compareTo: "targetSolutionConcentration",//与哪个字段比较
				},
				{
					label: "template.sp.sp003.ysmbrytj",
					prop: "targetSolutionVolume",
					width: 200,
					showWidth: 120,
					headerSelectKey: "targetSolutionVolumeUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_tjdw'),
					bodyType: "inputNumber",
					bodyFillType: "preFill",
					bodyMaxlength: 10,
					headerSelectTo:"actSolutionVolumeUnit",
				},
				{
					label: "template.sp.sp003.sjmbrytj",
					prop: "actSolutionVolume",
					width: 200,
					showWidth: 120,
					headerSelectKey: "actSolutionVolumeUnit",
					fillType: "preFill",
					headerOptions: this.getDictOptions('business_tjdw'),
					bodyType: "inputNumber",
					bodySubType: "inputNumber",
					bodySubKey: "actSolutionVolumePrecision",
					bodyFillType: "actFill",
					bodySubFillType: "preFill",
					showBodySub: this.fillType === "preFill",
					bodyDisabled: true,
					bodyPrecisionKey: "actSolutionVolumePrecision",
					subPrecision:0,
					bodyMaxlength: 10,
					bodySubPlaceholder: "请输入保留小数位数",
					compareTo: "targetSolutionVolume",//与哪个字段比较
				},
			]
		},
	},
	data() {
		return {
			subSolutionVisible: false,
			currentSubKey: "",//当前点击的子项key
			stepTableDataSource: [],
		};
	},
	mounted() {
		const formData = this.getFormDataByTemplateData();
		if (this.fillType === "actFill") {
			this.handleUpdateCode(formData);
		}
		// const re = convertConcentration.convert('100mg/mL',"ng/mL")
	},
	methods: {
		beforeSaveRecord(data){
			const formFields = this.$refs.stepFormPackageRef?.getFilledFormData();
			this.onCommonVerifyNdException(formFields,data);
		},
		onFormSelect(fields){
			this.onHandleBlur(fields)
		},
		//选择table header下拉框也要更新体积
		onHeaderSelectChange(data){
			const {key, headerSelectFields,dataSource=[]} = data;
			const keys = [
				'targetStartSolutionVolumeUnit',
				'targetDiluentVolumeUnit',
				'targetSolutionConcentrationUnit',
				'targetSolutionVolumeUnit',
			]
			if(keys.includes(key)){
				const {targetStartSolution,subTargetStartSolution} = this.$refs.stepFormPackageRef?.getFilledFormData();
				const params = {
					subTargetStartSolution,
					headerSelectFields
				}
				this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
			}
		},
		//更新记录
		onRegentSubmit(data) {
			const { selectInfo, key } = data;
			const { row } = selectInfo;
			if (key === "subStartSolution") {//选择起始源溶液需要同步更新table的变更记录。
				this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
				this.$refs.stepFormPackageRef.updateFormData("subTargetAcSolutionUnit", row.nddw);
				const {headerSelectFields} = this.$refs.stepTableRef.getFilledFormData();
				const params = {
					targetStartSolutionUnit: row.nddw,
					headerSelectFields
				}
				this.updateStepTableData(row,params);
			}
		},
		startConfig(val) {
			const { rowData } = val;
			let postData = {
				bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
				studySubjectId: this.formData.studySubjectId,
				studyId:this.formData.studyId,
				studyFormId:this.formData.id,
			}
			this.startConfigRequest(postData);
		},
		configComplete(val) {
			const { rowData, headerSelectFields } = val;
			//计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积)
			const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
			let postData = {
				mc: null,
				bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
				nd: rowData.actSolutionConcentration,//实际目标溶液浓度
				nddw: headerSelectFields.actSolutionConcentrationUnit,
				studySubjectId: this.formData.studySubjectId,
				studyFormId:this.formData.id,
				studyId:this.formData.studyId,
				kc: total,
				kcdw: unit,
			}
			this.configCompleteRequest(postData);
		},
		//打印标签回调
		printTag(data) {
			const printConfig = this.getBasePrintConfig(data);
			EventBus.$emit('showTagPrintDialog', { printConfig })
		},
		//分装回调
		subPackageSubmit(data) {
			const { fzsj, rowData, headerSelectFields } = data;
			const { fzList = [], dw = "", mybh } = fzsj;
			if (fzList && fzList.length > 0) {
				const list = fzList.map((item) => {
					return {
						bh: mybh + item.preCode + item.subCode,
						kc: item.num,
						kcdw: dw,
					}
				})
				let postData = {
					studyId: this.formData.studyId,
					studyFormId: this.formData.id,
					bh: mybh,
					nd: rowData.actSolutionConcentration || 0,
					nddw: headerSelectFields.actSolutionConcentrationUnit,
					studySubjectId: this.formData.studySubjectId,
			     	studyFormId:this.formData.id,
					list: list
				}
				this.subPackageRequest(postData);
			}
		},
		//更新代码
		async handleUpdateCode(v) {
			const { stepTableFormData = [] } = v;
			if (stepTableFormData.length === 0) {
				return;
			}
			const hasAnyWithValue = stepTableFormData.some(row =>
				row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== '');
			if (hasAnyWithValue) {
				return;
			}
			const codes = stepTableFormData.map((item) => ({ pre: item.targetSolutionCode, type: 1 }));
			const snList = await this.getLatestSnArr(codes);
			stepTableFormData.forEach((item, index) => {
				this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: snList[index] });
			})
			this.$nextTick(() => {
				//通知后端保存数据
				const params = {
					type: "fieldChanged",
					newRecord: null,
					resourceList: null,
				}
				EventBus.$emit('onModifyRecord', params,)
			})
		},
		getStepResource() {
			return this.$refs.stepRef.getStepResource()
		},
		//获取已填写的表单数据
		getFilledFormData() {
			return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"])
		},
		//更新table数据
		updateStepTableData(row,params) {
			const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();

			// 创建新的表格数据副本
			const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));

			// 遍历数据，按要求更新起始溶液编号
			for (let i = 0; i < newStepTableData.length; i++) {
				const item = newStepTableData[i];
				let initNd = row.nd;//起始浓度是上一条记录的实际目标溶液浓度
				if (i === 0) {
					// 第一条记录的起始溶液编号是确认弹框带出来的，也就是row.code字段
					newStepTableData[i].startSolutionCode = row.bh;
				} else {
					// 第二条的起始溶液编号是第一条数据里面的targetSolutionCode字段，
					// 第三条的起始溶液编号是第二条数据里面的targetSolutionCode字段，以此类推
					newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode;
					initNd = newStepTableData[i - 1].actSolutionConcentration;
				}
				const volResult = this.updateSjmbrynd(item, initNd,params);
				if (!volResult) {
					continue
				}
				item.actSolutionVolume = volResult.actVol;
				item.actSolutionConcentration = volResult.actNd;
				item.actSolutionExpire = row.sxr;
			}
			this.$refs.stepTableRef.updateDataSource(newStepTableData);
			// 更新stepTableRef组件的数据
		},
		async getFormData() {
			let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
			if(content){
				const {headerSelectFields = {},subTargetStartSolution} = content;
				const {targetSolutionConcentrationUnit,actSolutionConcentrationUnit} = headerSelectFields;
				if(!isCommonUnit(subTargetStartSolution,[targetSolutionConcentrationUnit,actSolutionConcentrationUnit])){
					this.$message.error("起始浓度单位与目标浓度单位不符，请重新选择！");
					return false;
				}
			}
			return content;
		},
		getResource() {
			let content = this.getFilledFormData();
			let tmpResource = []
			if (this.fillType === "actFill") {
				let tableList = content.stepTableFormData
				if (tableList && tableList.length > 0) {
					for (let i = 0; i < tableList.length; i++) {
						let item = tableList[i]
						//分装
						let fzTotal = 0 //分装总量
						if (item.fzsj && item.fzsj.fzList && item.fzsj.fzList) {
							for (let j = 0; j < item.fzsj.fzList.length; j++) {
								let fzItem = item.fzsj.fzList[j]
								tmpResource.push({
									mc: null,
									bh: item.fzsj.mybh + fzItem.preCode + fzItem.subCode,
									ph: null,
									nd: item.actSolutionConcentration,
									nddw: content.headerSelectFields.actSolutionConcentrationUnit,
									ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
									ly: 'ELN配制',
									sxrq: content.expireDate,
									kc: fzItem.num,
									kcdw: item.fzsj.dw,
									type: null,
									elnType: this.product,
									syl: null,
									syldw: item.fzsj.dw,
									yxzq: content.effectivePeriod,
									yxzqdw: content.effectivePeriodUnit,
								})
								fzTotal = addDecimals(fzTotal, fzItem.num)
							}
						}
						//生成
						//计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积)
						const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
						tmpResource.push({
							mc: null,
							bh: item.targetSolutionCode + item.subTargetSolutionCode,
							ph: null,
							nd: item.actSolutionConcentration,
							nddw: content.headerSelectFields.actSolutionConcentrationUnit,
							ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
							ly: 'ELN配制',
							sxrq: content.expireDate,
							kc: total,
							kcdw: unit,
							type: null,
							elnType: this.product,
							syl: fzTotal > 0 ? fzTotal : null,
							syldw: fzTotal > 0 ? item.fzsj.dw : unit,
							yxzq: content.effectivePeriod,
							yxzqdw: content.effectivePeriodUnit,
						})
						//起始源溶液 
						tmpResource.push({
							mc: null,
							bh: content.subStartSolution,
							ph: null,
							nd: null,
							nddw: null,
							ndz: null,
							ly: null,
							sxrq: null,
							kc: null,
							kcdw: null,
							type: 1,
							syl: item.actStartSolutionVolume,
							syldw: content.headerSelectFields.actStartSolutionVolumeUnit,
							yxzq: null,
							yxzqdw: null,
						})
						//稀释液 
						tmpResource.push({
							mc: null,
							bh: content.subSolution,
							ph: null,
							nd: null,
							nddw: null,
							ndz: null,
							ly: null,
							sxrq: null,
							kc: null,
							kcdw: null,
							type: 1,
							syl: item.actDiluentVolume,
							syldw: content.headerSelectFields.actDiluentVolumeUnit,
							yxzq: null,
							yxzqdw: null,
						})
					}
				}

			}
			if (tmpResource.length > 0) {
				tmpResource = uniqeResourceOne(tmpResource)
			}
			//使用的试剂、仪器
			const stepResource = this.$refs.stepRef.getStepResource()
			this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
			this.yqResourceTmp = stepResource.yqResource || []
			return this.resourceTmp;
		},
		async onSave() {
			// const formData = await this.getFormData();
			const formData = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);

			console.log(formData, "formData")
		}
	}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
	margin-top: 20px;
}
</style>