Browse Source

Merge branch 'master' into ouqian

ouqian
ouqian 1 month ago
parent
commit
969c73a737
7 changed files with 130 additions and 69 deletions
  1. +10
    -1
      src/components/Template/BaseInfoFormPackage.vue
  2. +15
    -8
      src/components/Template/CustomTable.vue
  3. +6
    -0
      src/components/Template/HandleFormItem.vue
  4. +1
    -0
      src/views/business/comps/template/comps/dl/DL022.vue
  5. +33
    -5
      src/views/business/comps/template/comps/sp/SP0019.vue
  6. +49
    -42
      src/views/business/comps/template/comps/sp/SP0021.vue
  7. +16
    -13
      src/views/business/comps/template/formConfig/sp/SP0019.js

+ 10
- 1
src/components/Template/BaseInfoFormPackage.vue View File

@ -174,6 +174,9 @@
:style="{ 'width': sItem.labelWidth ? sItem.labelWidth + 'px' : '150px' }" :style="{ 'width': sItem.labelWidth ? sItem.labelWidth + 'px' : '150px' }"
v-if="sItem.label"> v-if="sItem.label">
{{ $t(sItem.label) }}</div> {{ $t(sItem.label) }}</div>
<div v-if="sItem.type === 'span'" class="flex1">
{{ formFields[key] }}
</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" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="dateTime" :item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)" type="dateTime" :item="sItem" v-model="formFields[key]" @copy="onCopy(sItem, key)"
@ -184,6 +187,7 @@
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" style="width: auto;flex:1" v-model="formFields[key]" :type="sItem.type" :item="sItem" style="width: auto;flex:1" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)" @copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)"
@remoteMethod="(query)=>remoteMethod(query, sItem,key)"
:error="errors[key]" @update:error="errors[key] = false" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" /> :orange-bg="orangeBgFields[key]" />
<div v-show="isShowOther(formFields[key]) || isShowRadioSelect(formFields[key])" class="flex flex1 ml-10"> <div v-show="isShowOther(formFields[key]) || isShowRadioSelect(formFields[key])" class="flex flex1 ml-10">
@ -410,6 +414,9 @@ export default {
}; };
}, },
methods: { methods: {
remoteMethod(query, sItem, key){
this.$emit('remoteMethod', { query, sItem, key, formFields: this.formFields })
},
//radioselect //radioselect
isShowRadioSelect(value){ isShowRadioSelect(value){
const arr = ["动物种属","细胞系"]; const arr = ["动物种属","细胞系"];
@ -430,7 +437,8 @@ export default {
return { return {
...sItem, ...sItem,
key: sItem.subKey, key: sItem.subKey,
fillType: sItem.fourthFillType || sItem.fillType
disabled: sItem.subDisabled || sItem.disabled,
fillType: sItem.subFillType || sItem.fillType
} }
}, },
getFourthButtonItem(sItem) { getFourthButtonItem(sItem) {
@ -438,6 +446,7 @@ export default {
...sItem, ...sItem,
key: sItem.fourthKey, key: sItem.fourthKey,
buttonName:sItem.fourthButtonName, buttonName:sItem.fourthButtonName,
disabled: sItem.fourthDisabled || sItem.disabled,
fillType: sItem.fourthFillType || sItem.fillType fillType: sItem.fourthFillType || sItem.fillType
} }
}, },

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

@ -93,7 +93,7 @@
<template <template
v-if="col.bodyType === 'input' || col.bodyType === 'inputNumber' || col.bodyType === 'select' || col.bodyType === 'dateTimeRange' || col.bodyType === 'radio'"> v-if="col.bodyType === 'input' || col.bodyType === 'inputNumber' || col.bodyType === 'select' || col.bodyType === 'dateTimeRange' || col.bodyType === 'radio'">
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodyType" :fieldItemLabel="fieldItemLabel" :type="col.bodyType"
@blur="onBlur(rowIndex, col.prop, $event)" @copy="onCopy(rowIndex, col)" @blur="onBlur(rowIndex, col.prop, $event)" @copy="onCopy(rowIndex, col)"
class="body-input" :item="getBodyItem(col, rowIndex)" class="body-input" :item="getBodyItem(col, rowIndex)"
@ -120,7 +120,7 @@
:class="{ 'full-row': row[col.prop] && row[col.prop].length == 1 }" :class="{ 'full-row': row[col.prop] && row[col.prop].length == 1 }"
v-for="(opItem, itemIndex) in row[col.prop]" :key="itemIndex"> v-for="(opItem, itemIndex) in row[col.prop]" :key="itemIndex">
<HandleFormItem <HandleFormItem
:fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex + '_' + itemIndex"
:fieldKey="prefixKey + '_' + col.prop + '_' + row.id + '_' + itemIndex"
:fieldItemLabel="fieldItemLabel" type="input" :fieldItemLabel="fieldItemLabel" type="input"
@blur="onOperableInputBlur(opItem, $event)" class="body-input" @blur="onOperableInputBlur(opItem, $event)" class="body-input"
:item="getBodyItem(col, rowIndex)" :value="opItem.value" :item="getBodyItem(col, rowIndex)" :value="opItem.value"
@ -140,7 +140,7 @@
</div> </div>
<div class="flex flex1" v-else-if="col.bodyType === 'clickable'"> <div class="flex flex1" v-else-if="col.bodyType === 'clickable'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" type="clickable" class="body-clickable" :fieldItemLabel="fieldItemLabel" type="clickable" class="body-clickable"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]" :item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@ -150,7 +150,7 @@
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div> </div>
<div class="flex flex1" v-else-if="isRegent(col, 'bodyType')"> <div class="flex flex1" v-else-if="isRegent(col, 'bodyType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodyType" class="body-clickable" :fieldItemLabel="fieldItemLabel" :type="col.bodyType" class="body-clickable"
sourceFrom="customTable" :item="getBodyItem(col, rowIndex)" sourceFrom="customTable" :item="getBodyItem(col, rowIndex)"
:value="row[col.prop]" :error="hasError(rowIndex, colIndex, col.prop)" :value="row[col.prop]" :error="hasError(rowIndex, colIndex, col.prop)"
@ -167,7 +167,7 @@
<template v-else-if="col.bodyType === 'checkboxTag'"> <template v-else-if="col.bodyType === 'checkboxTag'">
<div class="flex flex-wrap" <div class="flex flex-wrap"
:class="{ 'row-error-border': hasError(rowIndex, colIndex, col.prop) }"> :class="{ 'row-error-border': hasError(rowIndex, colIndex, col.prop) }">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" type="checkboxTag" :value="row[col.prop]" :fieldItemLabel="fieldItemLabel" type="checkboxTag" :value="row[col.prop]"
:item="getBodyItem(col, rowIndex)" :item="getBodyItem(col, rowIndex)"
@change="onCheckboxTagChange(rowIndex, colIndex, col, $event)" @change="onCheckboxTagChange(rowIndex, colIndex, col, $event)"
@ -177,7 +177,7 @@
</div> </div>
</template> </template>
<template v-else-if="col.bodyType === 'checkbox'"> <template v-else-if="col.bodyType === 'checkbox'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + row.id"
:fieldItemLabel="fieldItemLabel" type="checkbox" v-model="row[col.prop]" :fieldItemLabel="fieldItemLabel" type="checkbox" v-model="row[col.prop]"
:item="getBodyItem(col, rowIndex)" :item="getBodyItem(col, rowIndex)"
@change="onCheckboxChange(rowIndex, colIndex, col, $event)" @change="onCheckboxChange(rowIndex, colIndex, col, $event)"
@ -204,7 +204,7 @@
v-if="isShowBodySub(col, row)"> v-if="isShowBodySub(col, row)">
<template <template
v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input' || col.bodySubType === 'select'"> v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input' || col.bodySubType === 'select'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodySubType" :fieldItemLabel="fieldItemLabel" :type="col.bodySubType"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" @copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
@ -225,7 +225,7 @@
@clickButton="(e, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" /> @clickButton="(e, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
</template> </template>
<div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')"> <div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
:fieldItemLabel="fieldItemLabel" :type="col.bodySubType" class="body-clickable" :fieldItemLabel="fieldItemLabel" :type="col.bodySubType" class="body-clickable"
sourceFrom="customTable" :item="getBodySubItem(col, rowIndex)" sourceFrom="customTable" :item="getBodySubItem(col, rowIndex)"
:value="row[col.bodySubKey]" :value="row[col.bodySubKey]"
@ -1012,6 +1012,12 @@ export default {
this.checkCompareToOnDataLoad(); this.checkCompareToOnDataLoad();
justUpdateFilledFormData(); justUpdateFilledFormData();
}, },
pushDataSource(data=[]) {
this.localDataSource.push(...data);
this.localDataSource = [...this.localDataSource];
this.checkCompareToOnDataLoad();
justUpdateFilledFormData();
},
// newDataoldDatafalse // newDataoldDatafalse
compareOldAndCurrentFormFields(newData, oldData) { compareOldAndCurrentFormFields(newData, oldData) {
for (const key in newData) { for (const key in newData) {
@ -1062,6 +1068,7 @@ export default {
actSolutionConcentrationPrecision: 3,//3 actSolutionConcentrationPrecision: 3,//3
targetDiluentVolumePrecision: 3,//3 targetDiluentVolumePrecision: 3,//3
targetStartSolutionVolumePrecision: 3,//3 targetStartSolutionVolumePrecision: 3,//3
id:getuuid(),
}); });
justUpdateFilledFormData() justUpdateFilledFormData()
}, },

+ 6
- 0
src/components/Template/HandleFormItem.vue View File

@ -19,6 +19,8 @@
<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" :disabled="getDisabled()" :placeholder="getPlaceholder()" @remove-tag="onRemoveTag"
:remote = "true"
:remote-method="remoteMethod"
@visible-change="onSelectBlur" @change="onInputChange" filterable> @visible-change="onSelectBlur" @change="onInputChange" filterable>
<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>
@ -401,6 +403,10 @@ export default {
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit) EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit)
}, },
methods: { methods: {
remoteMethod(query) {
console.log(query,"qqq")
this.$emit('remoteMethod', query);
},
handleFalse() { handleFalse() {
return false; return false;
}, },

+ 1
- 0
src/views/business/comps/template/comps/dl/DL022.vue View File

@ -244,6 +244,7 @@ export default {
onAddRow() { onAddRow() {
this.$refs.tableRef.addRow({ this.$refs.tableRef.addRow({
jblx: [{value: undefined}], jblx: [{value: undefined}],
id: getuuid(),
}) })
}, },
onFormSelect(fields) { onFormSelect(fields) {

+ 33
- 5
src/views/business/comps/template/comps/sp/SP0019.vue View File

@ -23,6 +23,7 @@
</template> </template>
</CustomTable> </CustomTable>
<BaseInfoFormPackage class="mt-20" fieldItemLabel="色谱柱型号" label="色谱柱型号" ref="spzxhRef" <BaseInfoFormPackage class="mt-20" fieldItemLabel="色谱柱型号" label="色谱柱型号" ref="spzxhRef"
@remoteMethod="remoteMethod"
:formConfig="storageFormConfig" :formData="formData" /> :formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="溶液" /> <LineLabel label="溶液" />
<CustomTable <CustomTable
@ -55,8 +56,9 @@ import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin"; import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import { public_sjList } from '@/api/business/public/public';
import { getBaseInfoFormConfig, storageFormConfig, getYqColumns,getRyColumns,getYqphFormConfig } from "../../formConfig/sp/SP0019"
import { getBaseInfoFormConfig, getStorageFormConfig, getYqColumns,getRyColumns,getYqphFormConfig } from "../../formConfig/sp/SP0019"
export default { export default {
name: "SP0019", name: "SP0019",
@ -83,7 +85,7 @@ export default {
}, },
// //
storageFormConfig() { storageFormConfig() {
return storageFormConfig;
return getStorageFormConfig(this);
}, },
// //
remarkConig() { remarkConig() {
@ -111,7 +113,8 @@ export default {
}, },
data() { data() {
return { return {
formData: {}
formData: {},
spzxhOptions: [],
}; };
}, },
mounted() { mounted() {
@ -119,6 +122,22 @@ export default {
}, },
methods: { methods: {
async remoteMethod({ query, key }) {
if (key === "spzxh") {
const res = await public_sjList({
pageNum: 1,
pageSize: 10,
mc: query
});
if(res.code === 200){
const {rows = []} = res;
this.spzxhOptions = rows.map(item => ({
label: item.bh,
value: item.bh,
}));
}
}
},
onRegentSubmit(e){ onRegentSubmit(e){
const {selectInfo, key, col, rowIndex, colIndex, rowData} = e; const {selectInfo, key, col, rowIndex, colIndex, rowData} = e;
const {row} = selectInfo; const {row} = selectInfo;
@ -130,8 +149,17 @@ export default {
this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params); this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params);
} }
}, },
onYqSubmit(data, col, rowIndex, colIndex, row){
console.log(data, col, rowIndex, colIndex, row,"onRegentSubmit")
onYqSubmit(data){
const {selectInfo,rowIndex,key} = data;
const {row} = selectInfo;
if(key === "bh"){//
const params = {
mc: row.mc,
xh: row.xh,
jzrq: row.jzrq,
}
this.$refs.yqInfoTableRef.updateDataSourceByRowIndex(rowIndex, params);
}
}, },
// //
getFilledFormData() { getFilledFormData() {

+ 49
- 42
src/views/business/comps/template/comps/sp/SP0021.vue View File

@ -19,30 +19,26 @@
<div class="config-header"> <div class="config-header">
<div></div> <div></div>
<el-popconfirm title="确认删除当前样本?" @confirm="deleteConfig(item)"> <el-popconfirm title="确认删除当前样本?" @confirm="deleteConfig(item)">
<el-button slot="reference" v-if="fillType === 'actFill'" type="text" icon="el-icon-delete" >{{
$t('template.common.deleteBtn')
}}</el-button>
<el-button slot="reference" v-if="fillType === 'actFill'" type="text"
icon="el-icon-delete">{{
$t('template.common.deleteBtn')
}}</el-button>
</el-popconfirm> </el-popconfirm>
</div> </div>
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`"
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" />
<el-button v-if="fillType === 'actFill'" type="primary" @click="onImportAnimal">导入动物</el-button>
<CustomTable
:ref = "`ybsmTableRef${index}`"
:columns="ybsmColumns"
:showOperation="fillType === 'actFill'"
:showAddRow="fillType === 'actFill'"
:formData = "item">
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`"
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" />
<el-button v-if="fillType === 'actFill'" type="primary"
@click="onImportAnimal(item, index)">导入动物</el-button>
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns"
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'"
:formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, `ybsmTableRef${index}`)"
></TableOpertaionDelete>
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, `ybsmTableRef${index}`)">
</TableOpertaionDelete>
</template> </template>
</CustomTable> </CustomTable>
<Step :ref="`stepRef${index}`" :formData="item.stepData ||[]"></Step>
<Step :ref="`stepRef${index}`" :formData="item.stepData || []"></Step>
</div> </div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" /> :ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" />
@ -50,7 +46,8 @@
</div> </div>
</div> </div>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" />
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']"
@downloadExcelTemplate="downloadExcelTemplate" />
</div> </div>
</template> </template>
@ -65,8 +62,8 @@ import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin"; import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import { uniqeResource } from "@/utils/calUnitTools"; import { uniqeResource } from "@/utils/calUnitTools";
import {getuuid,justUpdateFilledFormData} from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig,getTableColumns } from "../../formConfig/sp/SP0021";
import { getuuid, justUpdateFilledFormData } from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig, getTableColumns } from "../../formConfig/sp/SP0021";
const refConfig = { const refConfig = {
baseInfoRef: "baseInfoRef", baseInfoRef: "baseInfoRef",
remarkRef: "remarkRef", remarkRef: "remarkRef",
@ -78,7 +75,7 @@ const refConfig = {
const compRefs = Object.values(refConfig); const compRefs = Object.values(refConfig);
export default { export default {
name: "SP0021", name: "SP0021",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete,ImportExcelDialog },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete, ImportExcelDialog },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
@ -113,23 +110,24 @@ export default {
}, },
}, },
data() { data() {
return {
refConfig,
};
},
return {
refConfig,
currentIndex: -1,
};
},
mounted() { mounted() {
if(this.fillType === 'preFill' &&!this.formData.ybsmDataList){//
if (this.fillType === 'preFill' && !this.formData.ybsmDataList) {//
this.onAdd() this.onAdd()
} }
}, },
methods: { methods: {
// //
deleteConfig(item){
deleteConfig(item) {
// ybsmDataList // ybsmDataList
if (this.formData.ybsmDataList.length > 1) { if (this.formData.ybsmDataList.length > 1) {
const configIndex = this.formData.ybsmDataList.findIndex(config => config.id === item.id); const configIndex = this.formData.ybsmDataList.findIndex(config => config.id === item.id);
console.log(configIndex,"configIndex")
if(configIndex>-1){
console.log(configIndex, "configIndex")
if (configIndex > -1) {
const newList = [...this.formData.ybsmDataList] const newList = [...this.formData.ybsmDataList]
newList.splice(configIndex, 1); newList.splice(configIndex, 1);
this.$set(this.formData, 'ybsmDataList', newList); this.$set(this.formData, 'ybsmDataList', newList);
@ -141,19 +139,19 @@ export default {
} else { } else {
this.$message.warning('至少保留一个样本说明项'); this.$message.warning('至少保留一个样本说明项');
} }
}, },
// //
onAdd(){
onAdd() {
if (!this.formData.ybsmDataList) { if (!this.formData.ybsmDataList) {
this.$set(this.formData, 'ybsmDataList', []); this.$set(this.formData, 'ybsmDataList', []);
} }
let defaultInfo = {
let defaultInfo = {
id: getuuid(), id: getuuid(),
stepData: [], stepData: [],
} }
if(this.fillType === "actFill"){
const {ybsmDataList} = this.formData
if (this.fillType === "actFill") {
const { ybsmDataList } = this.formData
defaultInfo.stepData = ybsmDataList[0]?.stepData || [] defaultInfo.stepData = ybsmDataList[0]?.stepData || []
} }
// //
@ -161,21 +159,29 @@ export default {
}, },
onLoadExcelData(excelData) { onLoadExcelData(excelData) {
const data = excelData.splice(1); const data = excelData.splice(1);
const transData = data.map((item)=>{
return{
dwbh: item[0],
id: getuuid(),
}
})
this.$refs[`ybsmTableRef${this.currentIndex}`][0].pushDataSource(transData)
this.$refs.ImportExcelDialog.cancel() this.$refs.ImportExcelDialog.cancel()
setTimeout(() => { setTimeout(() => {
justUpdateFilledFormData(); justUpdateFilledFormData();
}, 100); }, 100);
}, },
downloadExcelTemplate(arr){
downloadExcelTemplate(arr) {
this.exportExcel(arr) this.exportExcel(arr)
}, },
// //
onImportAnimal(){
onImportAnimal(item, index) {
this.currentIndex = index;
this.$refs.ImportExcelDialog.show() this.$refs.ImportExcelDialog.show()
}, },
// //
deleteTableRow(rowIndex, refName) { deleteTableRow(rowIndex, refName) {
this.$refs[refName].deleteRow(rowIndex)
this.$refs[refName][0].deleteRow(rowIndex)
}, },
// //
getFilledFormData() { getFilledFormData() {
@ -202,18 +208,18 @@ export default {
// //
let content = await this.validFormFields(compRefs); let content = await this.validFormFields(compRefs);
if (!content) return null; if (!content) return null;
// //
for (let index = 0; index < this.formData.ybsmDataList.length; index++) { for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
// //
const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true; const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true;
if (!ybsmFormValid) return null; if (!ybsmFormValid) return null;
// //
const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true; const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true;
if (!stepValid) return null; if (!stepValid) return null;
} }
// //
return this.getFilledFormData(); return this.getFilledFormData();
}, },
@ -272,6 +278,7 @@ export default {
.print-btn { .print-btn {
margin-bottom: 20px; margin-bottom: 20px;
} }
.config-header { .config-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

+ 16
- 13
src/views/business/comps/template/formConfig/sp/SP0019.js View File

@ -43,19 +43,22 @@ export const getBaseInfoFormConfig = (formType) => {
] ]
} }
export const storageFormConfig = [
{
type: 'step',
config: {
yqmxh: {
label: '色谱柱型号',
type: 'yq',
fillType: 'actFill',
filledCodes:['mc','bh'],
},
}
},
]
export const getStorageFormConfig = ($this)=>{
return[
{
type: 'step',
config: {
spzxh: {
label: '色谱柱型号',
type: 'select',
fillType: 'actFill',
options: $this.spzxhOptions,
filledCodes:['mc','bh'],
},
}
},
]
}
//仪器信息 //仪器信息
export const getYqColumns = ($this) => { export const getYqColumns = ($this) => {

Loading…
Cancel
Save