3 Commits

Author SHA1 Message Date
  ouqian c4628575f4 Merge branch 'master' into ouqian 1 month ago
  luojie e55377399f feat:[模板管理][sp021] 1 month ago
  ouqian d660595881 fix:[模板管理][DL007~DL015流程校验] 1 month ago
19 changed files with 500 additions and 206 deletions
Split View
  1. +2
    -2
      src/components/Template/HandleFormItem.vue
  2. +2
    -3
      src/components/Template/mixins/formPackageMixins.js
  3. +5
    -2
      src/lang/zh/template/dl.js
  4. +1
    -0
      src/views/business/comps/template/TemplateTable.vue
  5. +8
    -1
      src/views/business/comps/template/comps/dl/DL009.vue
  6. +58
    -4
      src/views/business/comps/template/comps/dl/DL010.vue
  7. +49
    -3
      src/views/business/comps/template/comps/dl/DL011.vue
  8. +39
    -3
      src/views/business/comps/template/comps/dl/DL012.vue
  9. +33
    -5
      src/views/business/comps/template/comps/dl/DL013.vue
  10. +85
    -8
      src/views/business/comps/template/comps/dl/DL014.vue
  11. +35
    -14
      src/views/business/comps/template/comps/dl/DL015.vue
  12. +10
    -3
      src/views/business/comps/template/comps/sp/SP0020.vue
  13. +41
    -29
      src/views/business/comps/template/comps/sp/SP0021.vue
  14. +6
    -4
      src/views/business/comps/template/comps/sp/SP00456.vue
  15. +116
    -119
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  16. +5
    -4
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  17. +1
    -1
      src/views/business/comps/template/formConfig/sp/SP0019.js
  18. +3
    -1
      src/views/business/comps/template/formConfig/sp/SP0021.js
  19. +1
    -0
      src/views/business/comps/template/mixins/templateMixin.js

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

@ -1165,7 +1165,7 @@ export default {
isOldValueEmpty = isValueEmpty(current.oldValue);
} else if (this.type === "checkboxTree") {
const current = this.getCheckboxTreeInfo();
const { oldValue, newValue } = current;
const { oldValue = {}, newValue } = current;
if (currentHandleType === "checkboxTreeCheckbox") {
isSame = isEqual(oldValue.checked, newValue.checked);
isOldValueEmpty = oldValue.checked === undefined;
@ -1247,7 +1247,7 @@ export default {
// checkboxTree
const current = this.getCheckboxTreeInfo();
if (this.currentHandleType === "checkboxTreeCheckbox") {
const { oldValue, newValue } = current;
const { oldValue = {}, newValue = {} } = current;
recordOldVlaue = `${oldValue.label || ''}:${oldValue.checked ? '勾选' : '未勾选'}`;
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`;
isModify = newValue.checked !== undefined;

+ 2
- 3
src/components/Template/mixins/formPackageMixins.js View File

@ -401,9 +401,8 @@ export default {
const {options = []} = o;
//需要校验第一层是否有选中项
const parentOptions = options.map(item => item.label);
const isChecked = parentOptions.some(option => {
var found = checkedValues.find(item => item.label === option);
return found && found.checked === true;
const isChecked = checkedValues.some(option => {
return option.checked === true;
});
//获取所有选中的选项
const allCheckedOptions = checkedValues.filter(item => item.checked).map(item => item.label);

+ 5
- 2
src/lang/zh/template/dl.js View File

@ -197,7 +197,9 @@ export default {
zxg: '左下格(个)',
yxg: '右下格(个)',
cdxxTime: '第{index}次',
addCdxx: '新增'
addCdxx: '新增',
yqsyxxEmpty: '仪器使用信息不能为空,请添加后再提交',
cdxxEmpty: '测定信息不能为空,请添加后再提交'
},
dl014: {
...common,
@ -224,7 +226,8 @@ export default {
sjgspjrl: '实际供试品加入量',
gyhzqk: '给药后状态情况',
qrButton: '确认',
wcButton: '完成'
wcButton: '完成',
yqsyxxEmpty: '仪器使用信息不能为空,请添加后再提交'
},
dl015: {
...common,

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

@ -277,6 +277,7 @@ export default {
'PCR010': 'PCR010',
'PCR011': 'PCR011',
'PCR012': 'PCR012',
'PCR013': 'SP00456',
//LBA
'LBA001': 'SP001',
'LBA002': 'LBA002',

+ 8
- 1
src/views/business/comps/template/comps/dl/DL009.vue View File

@ -500,7 +500,14 @@ export default {
//
async getFormData() {
//
return await this.validFields()
const validResult = await this.validFields()
// headerSelectFields
if (validResult) {
return this.getFilledFormData()
}
return validResult
},
//
async validFields() {

+ 58
- 4
src/views/business/comps/template/comps/dl/DL010.vue View File

@ -19,7 +19,7 @@
<TableList
label="template.common.reagentInfo"
:columns="sysjColumns"
:dataSource="resource"
:dataSource="resourceSj"
/>
<TableList
label="template.common.instrumentInfo"
@ -280,8 +280,7 @@ export default {
key: 'gs'
},
{ type: 'span', label: 'template.dl.dl010.gusui' }
],
span: 3
]
},
{
label: 'template.dl.dl010.lx',
@ -480,7 +479,62 @@ export default {
// 使
this.resourceTmp = sjxxStepResource.sjResource || []
this.yqResourceTmp = sjxxStepResource.yqResource || []
return this.resourceTmp
//
const sjxxTableData = this.$refs.sjxxTableRef?.getFilledFormData()
const sjxxList = sjxxTableData?.stepTableFormData || []
const headerSelectFields = sjxxTableData?.headerSelectFields || {}
// 0.9%
//
const sjxxResource = []
sjxxList.forEach((item) => {
// 0.9%
if (item.sjlhnzsjyjrl) {
sjxxResource.push({
mc: '0.9%氯化钠注射液', //
bh: null, //
ph: null, //
nd: null, //
nddw: null, //
ndz: null, //
ly: null, //
sxrq: null, //
kc: null, //
kcdw: null, //
type: 1, // 1使
syl: item.sjlhnzsjyjrl, // 使
syldw: headerSelectFields.sjlhnUnit || '', // 使
yxzq: null, //
yxzqdw: null //
})
}
//
if (item.sjjrxq) {
sjxxResource.push({
mc: '血清', //
bh: null, //
ph: null, //
nd: null, //
nddw: null, //
ndz: null, //
ly: null, //
sxrq: null, //
kc: null, //
kcdw: null, //
type: 1, // 1使
syl: item.sjjrxq, // 使
syldw: headerSelectFields.sjjrxqUnit || '', // 使
yxzq: null, //
yxzqdw: null //
})
}
})
//
return [...this.resourceTmp, ...sjxxResource]
},
onRegentSubmit(e) {
//

+ 49
- 3
src/views/business/comps/template/comps/dl/DL011.vue View File

@ -19,7 +19,7 @@
<TableList
label="template.common.reagentInfo"
:columns="sysjColumns"
:dataSource="resource"
:dataSource="resourceSj"
/>
<TableList
label="template.common.instrumentInfo"
@ -56,6 +56,7 @@
:ref="refConf.pyxx"
:formConfig="pyxxConfig"
:formData="formData"
@clickButton="handlePyxxClickButton"
/>
</div>
@ -80,6 +81,7 @@ import LineLabel from '@/components/Template/LineLabel'
import TableList from '@/components/Template/Table'
import Step from '@/components/Template/Step'
import templateMixin from '../../mixins/templateMixin'
import moment from 'moment'
const refConf = {
base: 'baseInfoRef',
@ -270,6 +272,14 @@ export default {
}
},
methods: {
//
handlePyxxClickButton(_item, signData) {
this.$refs.pyxxRef.updateFormData(
'pykssj',
moment().format('YYYY-MM-DD HH:mm:ss'),
{ isUpdateRecord: true, signData }
)
},
//
deleteTableRow(rowIndex, refName) {
this.$refs[refName].deleteRow(rowIndex)
@ -288,9 +298,45 @@ export default {
},
getResource() {
const stepResource = this.$refs.stepRef.getStepResource()
// 使
// 使
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
this.yqResourceTmp = [...(stepResource.yqResource || [])]
//
const xbxxData = this.$refs.xbxxRef?.getFilledFormData() || {}
//
if (xbxxData.xbdcbh) {
const xbInfo = xbxxData.selectInfo_xbdcbh || {}
// type StepFormPackage xb
this.xbxjTmp = [{
value: xbxxData.xbdcbh,
bh: xbInfo.bh || xbxxData.xbdcbh,
mc: xbInfo.mc || '',
xh: xbInfo.xh || '',
jzrq: xbInfo.jzrq || ''
}]
} else {
this.xbxjTmp = []
}
//
const pyxxData = this.$refs.pyxxRef?.getFilledFormData() || {}
//
if (pyxxData.pyxbh) {
const pyxInfo = pyxxData.selectInfo_pyxbh || {}
// type StepFormPackage yq
this.yqResourceTmp.push({
type: 'yq',
value: pyxxData.pyxbh,
bh: pyxInfo.bh || pyxxData.pyxbh,
mc: pyxInfo.mc || '',
xh: pyxInfo.xh || '',
jzrq: pyxInfo.jzrq || ''
})
}
return this.resourceTmp
},
onRegentSubmit(e) {

+ 39
- 3
src/views/business/comps/template/comps/dl/DL012.vue View File

@ -19,7 +19,7 @@
<TableList
label="template.common.reagentInfo"
:columns="sysjColumns"
:dataSource="resource"
:dataSource="resourceSj"
/>
<TableList
label="template.common.instrumentInfo"
@ -336,9 +336,45 @@ export default {
},
getResource() {
const stepResource = this.$refs.stepRef.getStepResource()
// 使
// 使
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
this.yqResourceTmp = [...(stepResource.yqResource || [])]
//
const xbxxData = this.$refs.xbxxRef?.getFilledFormData() || {}
//
if (xbxxData.xbzbqbh) {
const xbInfo = xbxxData.selectInfo_xbzbqbh || {}
// type
this.xbxjTmp = [{
value: xbxxData.xbzbqbh,
bh: xbInfo.bh || xbxxData.xbzbqbh,
mc: xbInfo.mc || '',
xh: xbInfo.xh || '',
jzrq: xbInfo.jzrq || ''
}]
} else {
this.xbxjTmp = []
}
//
const pyxxData = this.$refs.pyxxRef?.getFilledFormData() || {}
//
if (pyxxData.pyxbh) {
const pyxInfo = pyxxData.selectInfo_pyxbh || {}
// type
this.yqResourceTmp.push({
type: 'yq',
value: pyxxData.pyxbh,
bh: pyxInfo.bh || pyxxData.pyxbh,
mc: pyxInfo.mc || '',
xh: pyxInfo.xh || '',
jzrq: pyxInfo.jzrq || ''
})
}
return this.resourceTmp
},
onRegentSubmit(e) {

+ 33
- 5
src/views/business/comps/template/comps/dl/DL013.vue View File

@ -522,7 +522,22 @@ export default {
},
//
async getFormData() {
//
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl013.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl013.yqsyxxEmpty'))
}
// 2.
if (!this.formData.cdxxConfigs || this.formData.cdxxConfigs.length === 0) {
this.$message.warning(this.$t('template.dl.dl013.cdxxEmpty'))
return Promise.reject(this.$t('template.dl.dl013.cdxxEmpty'))
}
// 3.
let refsToValidate = [
refConf.base,
refConf.yqsy,
@ -566,10 +581,23 @@ export default {
return await this.validFormFields(refsToValidate)
},
getResource() {
const stepResource = this.$refs.yqsyTableRef.getStepResource()
// 使
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
// 使
const yqsyData = this.$refs.yqsyTableRef?.getFilledFormData()
const yqsyList = yqsyData?.stepTableFormData || []
// 使
this.yqResourceTmp = yqsyList
.filter((item) => item.yqbh)
.map((item) => ({
type: 'yq',
value: item.yqbh,
bh: item.yqbh,
mc: item.yqmc,
xh: item.yqxh,
jzrq: item.xccsjzjdrq
}))
this.resourceTmp = []
return this.resourceTmp
},
onRegentSubmit(e) {

+ 85
- 8
src/views/business/comps/template/comps/dl/DL014.vue View File

@ -580,6 +580,16 @@ export default {
},
//
async getFormData() {
// 1. 使
const yqsyTableRef = this.$refs[refConf.yqsy]
const yqsyTableData = yqsyTableRef?.getDataSource() || []
if (yqsyTableData.length === 0) {
this.$message.warning(this.$t('template.dl.dl014.yqsyxxEmpty'))
return Promise.reject(this.$t('template.dl.dl014.yqsyxxEmpty'))
}
// 2.
const refsToValidate = [
refConf.base,
refConf.yqsy,
@ -661,27 +671,94 @@ export default {
this.yqResourceTmp = yqsyList
.filter((item) => item.yqbh)
.map((item) => ({
type: 'yq',
bh: item.yqbh,
mc: item.yqmc,
xh: item.yqxh
xh: item.yqxh,
jzrq: item.jzrq
}))
// S9
// S9
const jlzInfoData = this.$refs.jlzInfoRef?.getFilledFormData()
const resourceList = []
// S9S9
if (this.isSftjs9Yes && jlzInfoData?.s9hhybh) {
resourceList.push({
mc: 'S9混合液',
bh: jlzInfoData.s9hhybh,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: null,
syldw: null,
yxzq: null,
yxzqdw: null
})
}
//
const jlzData = this.$refs.jlzTableRef?.getFilledFormData()
const jlzList = jlzData?.stepTableFormData || []
const jlzHeaderSelectFields = jlzData?.headerSelectFields || {}
// Set
const xybhSet = new Set()
const gspbhSet = new Set()
const sjResourceFromJlz = []
jlzList.forEach((item) => {
//
if (item.xybh) {
sjResourceFromJlz.push({
//
if (item.xybh && !xybhSet.has(item.xybh)) {
xybhSet.add(item.xybh)
resourceList.push({
mc: '细胞悬液',
bh: item.xybh,
type: 'cell'
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: item.sjplyjrl || null,
syldw: jlzHeaderSelectFields.ysplyjrlUnit || null,
yxzq: null,
yxzqdw: null
})
}
//
if (item.gspbh && !gspbhSet.has(item.gspbh)) {
gspbhSet.add(item.gspbh)
resourceList.push({
mc: '供试品',
bh: item.gspbh,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: item.sjgspjrl || null,
syldw: jlzHeaderSelectFields.ysgspjrlUnit || null,
yxzq: null,
yxzqdw: null
})
}
})
this.resourceTmp = sjResourceFromJlz
this.resourceTmp = resourceList
return this.resourceTmp
},

+ 35
- 14
src/views/business/comps/template/comps/dl/DL015.vue View File

@ -16,7 +16,7 @@
:formData="formData"
/>
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resourceSj" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.dl.dl015.xbxx" />
@ -103,8 +103,8 @@ export default {
//
hyqkFormData() {
return {
stepTableFormData: this.formData.hyqkTableData || [],
headerSelectFields: {}
stepTableFormData: this.formData.stepTableFormData || [],
headerSelectFields: this.formData.headerSelectFields || {}
}
},
//
@ -291,10 +291,11 @@ export default {
getFilledFormData() {
const baseData = this.getFilledFormDataByRefs(refNames)
//
// stepTableFormData
const hyqkData = this.$refs[refConf.hyqk]?.getFilledFormData()
if (hyqkData) {
baseData.hyqkTableData = hyqkData.stepTableFormData || []
baseData.stepTableFormData = hyqkData.stepTableFormData || []
baseData.headerSelectFields = hyqkData.headerSelectFields || {}
}
return baseData
@ -317,12 +318,32 @@ export default {
this.yqResourceTmp = stepResource.yqResource || []
//
const sjResourceFromHyqk = hyqkList
.filter(item => item.xybh)
.map(item => ({
bh: item.xybh,
type: 'cell'
}))
// Set
const xybhSet = new Set()
const sjResourceFromHyqk = []
hyqkList.forEach((item) => {
if (item.xybh && !xybhSet.has(item.xybh)) {
xybhSet.add(item.xybh)
sjResourceFromHyqk.push({
mc: '细胞悬液',
bh: item.xybh,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: item.pyybrl || null,
syldw: item.pyybrl ? 'mL' : null,
yxzq: null,
yxzqdw: null
})
}
})
this.resourceTmp = [...this.resourceTmp, ...sjResourceFromHyqk]
@ -343,7 +364,7 @@ export default {
if (jlzTableData.length === 0) {
//
this.$set(this.formData, 'hyqkTableData', [])
this.$set(this.formData, 'stepTableFormData', [])
this.$message.warning('前序表单中没有剂量组数据')
return
}
@ -361,13 +382,13 @@ export default {
}))
// 使 $set formData CustomTable
this.$set(this.formData, 'hyqkTableData', hyqkData)
this.$set(this.formData, 'stepTableFormData', hyqkData)
this.$message.success(`已从前序表单加载 ${hyqkData.length} 条剂量组数据`)
} catch (error) {
console.error('解析前序表单数据失败:', error)
//
this.$set(this.formData, 'hyqkTableData', [])
this.$set(this.formData, 'stepTableFormData', [])
this.$message.error('解析前序表单数据失败')
}
}

+ 10
- 3
src/views/business/comps/template/comps/sp/SP0020.vue View File

@ -13,7 +13,7 @@
<BaseInfoFormPackage fieldItemLabel="仪器结果" label="仪器结果"
:ref="refConfig.yqjgRef" :formConfig="yqjgFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="采集日期" label="采集日期"
v-if="sn ==='SP0020'"
v-if="sn ==='SP020'"
:ref="refConfig.cjrqRef" :formConfig="cjrqFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="分析批数据文件" label="分析批数据文件"
:ref="refConfig.fxpsjwjRef" :formConfig="fxpsjwjFormConfig" :formData="formData" />
@ -33,7 +33,8 @@ 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 TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue";
import moment from "moment";
import { getBaseInfoFormConfig} from "../../formConfig/sp/SP0019";
import { getSynrFormConfig, getYqjgFormConfig, getCjrqFormConfig, getFxpsjwjFormConfig} from "../../formConfig/sp/SP0020";
@ -135,7 +136,13 @@ export default {
//
async getFormData() {
let content = await this.validFormFields(compRefs);
console.log(content)
if(this.sn === 'SP020' &&!!content){
const {cjjsrq,cjksrq} = content;
if(moment(cjjsrq).isBefore(moment(cjksrq))){
this.$message.error("采集结束时间不能早于采集开始时间");
return;
}
}
return content;
},
//

+ 41
- 29
src/views/business/comps/template/comps/sp/SP0021.vue View File

@ -15,12 +15,14 @@
:formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="样本说明" />
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary" @click="onAdd">新增</el-button>
<div v-for="(item, index) in formData.ybsmDataList" :key="index" class="template-form-item">
<div v-for="(item, index) in formData.ybsmDataList" :key="item.id" class="template-form-item">
<div class="config-header">
<div></div>
<el-button v-if="fillType === 'actFill'" type="text" icon="el-icon-delete"
@click="deleteConfig(index)">{{ $t('template.common.deleteBtn')
}}</el-button>
<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-popconfirm>
</div>
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`"
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" />
@ -30,7 +32,7 @@
:columns="ybsmColumns"
:showOperation="fillType === 'actFill'"
:showAddRow="fillType === 'actFill'"
:dataSource="item.ybsmData || []" >
:formData = "item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete
:row="row"
@ -40,7 +42,7 @@
></TableOpertaionDelete>
</template>
</CustomTable>
<Step :ref="`stepRef${index}`" :formData="item.stepData"></Step>
<Step :ref="`stepRef${index}`" :formData="item.stepData ||[]"></Step>
</div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" />
@ -63,7 +65,7 @@ import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { uniqeResource } from "@/utils/calUnitTools";
import {getuuid} from "@/utils/index";
import {getuuid,justUpdateFilledFormData} from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig,getTableColumns } from "../../formConfig/sp/SP0021";
const refConfig = {
baseInfoRef: "baseInfoRef",
@ -116,42 +118,52 @@ export default {
};
},
mounted() {
if(this.fillType === 'preFill'){//
if(this.fillType === 'preFill' &&!this.formData.ybsmDataList){//
this.onAdd()
}
},
methods: {
//
deleteConfig(index){
deleteConfig(item){
// ybsmDataList
if (!this.formData.ybsmDataList) {
this.formData.ybsmDataList = [{}];
return;
}
if (this.formData.ybsmDataList.length > 1) {
this.formData.ybsmDataList.splice(index, 1);
const configIndex = this.formData.ybsmDataList.findIndex(config => config.id === item.id);
console.log(configIndex,"configIndex")
if(configIndex>-1){
const newList = [...this.formData.ybsmDataList]
newList.splice(configIndex, 1);
this.$set(this.formData, 'ybsmDataList', newList);
this.$nextTick(() => {
//
justUpdateFilledFormData();
})
}
} else {
this.$message.warning('至少需要保留一个样本说明项');
this.$message.warning('至少保留一个样本说明项');
}
},
//
onAdd(){
if (!this.formData.ybsmDataList) {
this.$set(this.formData, 'ybsmDataList', []);
}
//
this.formData.ybsmDataList.push({
let defaultInfo = {
id: getuuid(),
ybsmFormData: {},
stepData: [],
});
}
if(this.fillType === "actFill"){
const {ybsmDataList} = this.formData
defaultInfo.stepData = ybsmDataList[0]?.stepData || []
}
//
this.formData.ybsmDataList.push(defaultInfo);
},
onLoadExcelData(excelData) {
const data = excelData.splice(1);
console.log(data,"ddd")
this.$refs.ImportExcelDialog.cancel()
setTimeout(() => {
this.justUpdateFilledFormData();
justUpdateFilledFormData();
}, 100);
},
downloadExcelTemplate(arr){
@ -171,13 +183,13 @@ export default {
const baseData = this.getFilledFormDataByRefs(compRefs);
//
const ybsmDataList = this.formData.ybsmDataList.map((item, index) => {
const ybsmFormData = this.$refs[`ybsmFormPackageRef${index}`]?.getFilledFormData() || {};
const ybsmTableData = this.$refs[`ybsmTableRef${index}`]?.getFilledFormData() || [];
const stepData = this.$refs[`stepRef${index}`]?.getFilledFormData() || {};
const ybsmFormData = this.$refs[`ybsmFormPackageRef${index}`][0]?.getFilledFormData() || {};
const ybsmTableData = this.$refs[`ybsmTableRef${index}`][0]?.getFilledFormData() || [];
const stepData = this.$refs[`stepRef${index}`][0]?.getFilledFormData() || [];
return {
...ybsmFormData,
ybsmData: ybsmTableData,
stepData: stepData
...ybsmTableData,
stepData: stepData.stepData || []
};
});
return {
@ -194,11 +206,11 @@ export default {
//
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
//
const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`]?.validFormFields() || true;
const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true;
if (!ybsmFormValid) return null;
//
const stepValid = await this.$refs[`stepRef${index}`]?.getFormData() || true;
const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true;
if (!stepValid) return null;
}
@ -235,7 +247,7 @@ export default {
let allYqResource = [];
//
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
const stepResource = this.$refs[`stepRef${index}`]?.getStepResource() || { sjResource: [], yqResource: [] };
const stepResource = this.$refs[`stepRef${index}`][0]?.getStepResource() || { sjResource: [], yqResource: [] };
allSjResource = [...allSjResource, ...(stepResource.sjResource || [])];
allYqResource = [...allYqResource, ...(stepResource.yqResource || [])];
}

+ 6
- 4
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -10,7 +10,7 @@
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 v-if="!isLba" fieldItemLabel="template.common.storageCondition"
<BaseInfoFormPackage v-if="isSp" fieldItemLabel="template.common.storageCondition"
label="template.common.storageCondition" ref="storageConditionRef"
:formConfig="storageFormConfig" :formData="formData" />
<div v-if="isLba">
@ -193,6 +193,7 @@ export default {
},
data() {
const labArr = ["LBA005", "LBA007"];
const sn = this.sn || '';
return {
subSolutionVisible: false,
currentSubKey: "",//key
@ -204,6 +205,7 @@ export default {
targetAcSolutionFromTable: true,//
currentRowData: {},//
isLba: labArr.includes(this.sn),
isSp: sn.includes('SP'),//
};
},
mounted() {
@ -349,9 +351,9 @@ export default {
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
let conditionData = {}, jcbData = [];
if (!this.isLba) {
conditionData = this.$refs.storageConditionRef.getFilledFormData();
} else {
if (this.isSp) {
conditionData = this.$refs.storageConditionRef?.getFilledFormData();
} else if(this.isLba) {
jcbData = this.$refs.jcbRef.getFilledFormData();
}
const remarkData = this.$refs.remarkRef.getFilledFormData();

+ 116
- 119
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -1,40 +1,37 @@
<template>
<div class="template-form-item">
<div class="config-header">
<div>{{ $t(fieldItemLabel) }}</div>
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete"
@click="deleteConfig">{{
$t('template.common.deleteBtn')
}}</el-button>
</div>
<BaseInfoFormPackage @onRegentSubmit="(e) => onRegentSubmit(e)"
@beforeReagentSubmit="(data) => onBeforeReagentSubmit(data)"
ref="formPackageRef" :formConfig="currentFormConfig" :formData="currentFormData"
:fieldItemLabel="fieldItemLabel" @blur="(e) => onHandleBlur(e)"
@select="(e) => onHandleBlur(e)" :prefixKey="prefixKey" />
<CustomTable @blur="(e) => onHandleTableBlur(e)"
ref="tableRef" :showOperation="showOperation"
:columns="tableColumns" :formData="currentFormData"
@bodySelectChange="bodySelectChange"
@beforeSaveRecord="(data) => onBeforeSaveRecord(data )"
@headerSelectChange="(data) => onHeaderSelectChange(data)"
<div class="template-form-item">
<div class="config-header">
<div>{{ $t(fieldItemLabel) }}</div>
<el-popconfirm title="确认删除当前配置?" @confirm="deleteConfig">
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" >{{
$t('template.common.deleteBtn')
}}</el-button>
</el-popconfirm>
</div>
<BaseInfoFormPackage @onRegentSubmit="(e) => onRegentSubmit(e)"
@beforeReagentSubmit="(data) => onBeforeReagentSubmit(data)" ref="formPackageRef"
:formConfig="currentFormConfig" :formData="currentFormData" :fieldItemLabel="fieldItemLabel"
@blur="(e) => onHandleBlur(e)" @select="(e) => onHandleBlur(e)" :prefixKey="prefixKey" />
<CustomTable @blur="(e) => onHandleTableBlur(e)" ref="tableRef" :showOperation="showOperation"
:columns="tableColumns" :formData="currentFormData" @bodySelectChange="bodySelectChange"
@beforeSaveRecord="(data) => onBeforeSaveRecord(data)"
@headerSelectChange="(data) => onHeaderSelectChange(data)"
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data)"
@onRegentSubmit="(data) => onTableRegentSubmit( data)"
:prefixKey="prefixKey" :fieldItemLabel="fieldItemLabel">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e)"
@startConfig="(val) => startConfig(val )"
@configComplete="(val) => configComplete(val)"
@subPackageSubmit="(val) => subPackageSubmit(val)"
:fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)">
</TableOpertaion>
</template>
</CustomTable>
@onRegentSubmit="(data) => onTableRegentSubmit(data)" :prefixKey="prefixKey"
:fieldItemLabel="fieldItemLabel">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e)" @startConfig="(val) => startConfig(val)"
@configComplete="(val) => configComplete(val)" @subPackageSubmit="(val) => subPackageSubmit(val)"
:fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)">
</TableOpertaion>
</template>
</CustomTable>
<Step class="mt-0 s-container" ref="stepRef" :formData="currentFormData.stepData"
:fieldItemLabel="fieldItemLabel" :prefixKey="prefixKey"></Step>
</div>
<Step class="mt-0 s-container" ref="stepRef" :formData="currentFormData.stepData"
:fieldItemLabel="fieldItemLabel" :prefixKey="prefixKey"></Step>
</div>
</template>
<script>
@ -47,73 +44,73 @@ import { addTj } from "@/utils/calUnitTools";
import { isCommonUnit } from "@/utils/conTools";
export default {
components: {
Step,
CustomTable,
TableOpertaion,
BaseInfoFormPackage,
},
name: "LadderConfig",
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: '',
},
currentFormConfig: {
type: Array,
default: () => [],
},
prefixKey: {
type: String,
default: '',
},
fieldItemLabel: {
type: String,
default: '',
},
currentFormData: {
type: Object,
default: () => {},
},
showOperation: {
type: Boolean,
default: false,
},
tableColumns: {
type: Array,
default: () => [],
},
configType:{
type: String,
default: 'ladder',
}
},
methods: {
deleteConfig(){
components: {
Step,
CustomTable,
TableOpertaion,
BaseInfoFormPackage,
},
name: "LadderConfig",
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: '',
},
currentFormConfig: {
type: Array,
default: () => [],
},
prefixKey: {
type: String,
default: '',
},
fieldItemLabel: {
type: String,
default: '',
},
currentFormData: {
type: Object,
default: () => { },
},
showOperation: {
type: Boolean,
default: false,
},
tableColumns: {
type: Array,
default: () => [],
},
configType: {
type: String,
default: 'ladder',
}
},
methods: {
deleteConfig() {
this.$emit('deleteConfig', this.configType);
},
getStepResource(){
return this.$refs.stepRef?.getStepResource();
},
getFilledFormData() {
const baseFormData = this.$refs.formPackageRef?.getFilledFormData();
const tableData = this.$refs.tableRef?.getFilledFormData();
const stepData = this.$refs.stepRef?.getFilledFormData();
return {
baseFormData,
tableData,
stepData:stepData?.stepData || [],
}
},
// getFormData
async getFormData() {
getStepResource() {
return this.$refs.stepRef?.getStepResource();
},
getFilledFormData() {
const baseFormData = this.$refs.formPackageRef?.getFilledFormData();
const tableData = this.$refs.tableRef?.getFilledFormData();
const stepData = this.$refs.stepRef?.getFilledFormData();
return {
baseFormData,
tableData,
stepData: stepData?.stepData || [],
}
},
// getFormData
async getFormData() {
const refs = ['formPackageRef', 'tableRef', 'stepRef']
const pros = refs.map((ref)=>this.$refs[ref]?.getFormData())
const result = await Promise.all(pros);
const pros = refs.map((ref) => this.$refs[ref]?.getFormData())
const result = await Promise.all(pros);
return result;
},
//
},
//
onRegentSubmit(data) {
const { selectInfo, key } = data;
const { row } = selectInfo;
@ -129,7 +126,7 @@ export default {
}
},
//table
//table
updateTableNd(row) {
const { stepTableFormData = [], headerSelectFields = [] } = this.$refs.tableRef?.getFilledFormData();
const newData = JSON.parse(JSON.stringify(stepTableFormData));
@ -153,7 +150,7 @@ export default {
})
this.$refs.tableRef?.updateDataSource(newData);
},
getLadderNdParamsByIndex() {
getLadderNdParamsByIndex() {
const { headerSelectFields = [] } = this.$refs.tableRef?.getFilledFormData();
const subTargetAcSolutionUnit = this.$refs.formPackageRef?.getFormDataByKey("subTargetAcSolutionUnit");//
return {
@ -161,7 +158,7 @@ export default {
headerSelectFields
}
},
onHandleBlur(e) {
onHandleBlur(e) {
const { targetStartSolution, subTargetStartSolution } = e;
const { stepTableFormData, headerSelectFields } = this.$refs.tableRef?.getFilledFormData();
const params = {
@ -170,10 +167,10 @@ export default {
}
this.batchUpdateTargetStartSolutionVolume(stepTableFormData, targetStartSolution, params)
},
//
//
onHandleTableBlur(e) {
const { configType } = this;
const { colKey = "", item, rowIndex, headerSelectFields,dataSource } = e;
const { configType } = this;
const { colKey = "", item, rowIndex, headerSelectFields, dataSource } = e;
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
if (configType === "ladder") {
const { targetStartSolution, subTargetStartSolution } = this.$refs.formPackageRef?.getFilledFormData();
@ -191,9 +188,9 @@ export default {
if (configType === "ladder") {
const targetAcSolution = this.$refs.formPackageRef?.getFormDataByKey("targetAcSolution");//
let initNd = 0;
if(rowIndex === 0){
if (rowIndex === 0) {
initNd = targetAcSolution;
}else{
} else {
initNd = dataSource[rowIndex - 1].actSolutionConcentration;
}
const params = this.getLadderNdParamsByIndex();
@ -232,10 +229,10 @@ export default {
headerSelectFields
}
},
bodySelectChange(data) {
bodySelectChange(data) {
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields);
},
//
//
paralleUpdateTargetStartSolutionVolume(item, headerSelectFields) {
const volumne = item.targetStartSolutionConcentration;
const subTargetStartSolution = item.targetStartSolutionConcentrationPrecision;
@ -247,13 +244,13 @@ export default {
this.updateTargetStartSolutionVolume(item, volumne, params);
}
},
onBeforeSaveRecord(data) {
onBeforeSaveRecord(data) {
if (this.configType === "ladder") {
const formFields = this.$refs.formPackageRef?.getFilledFormData();
this.onCommonVerifyNdException(formFields, data);
}
},
//table header
//table header
onHeaderSelectChange(data) {
const { key, headerSelectFields, dataSource = [] } = data;
const keys = [
@ -278,11 +275,11 @@ export default {
}
},
//
//
printTag(e) {
const { nickName, name } = this.$store.getters;
const { printCode, row, type } = e;
const currentForm = this.$refs.formPackageRef?.getFilledFormData();
const currentForm = this.$refs.formPackageRef?.getFilledFormData();
const { stepStorageCondition, startDate, expireDate, paralleStepStorageCondition } = currentForm;
const targetSolutionExpirationDate = row.targetSolutionExpirationDate;
const lang = this.$i18n.locale;
@ -299,8 +296,8 @@ export default {
console.log(printConfig, "printConfig")
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
startConfig(val) {
//
startConfig(val) {
const { rowData } = val;
let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
@ -310,8 +307,8 @@ export default {
}
this.startConfigRequest(postData);
},
//
configComplete(val) {
//
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
@ -328,7 +325,7 @@ export default {
}
this.configCompleteRequest(postData);
},
//
//
subPackageSubmit(data) {
const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj;
@ -354,9 +351,9 @@ export default {
this.subPackageRequest(postData);
}
},
//
//
deleteRow(rowIndex) {
this.$refs.tableRef.deleteRow(rowIndex);
this.$refs.tableRef.deleteRow(rowIndex);
},
onTableBeforeReagentSubmit(data) {
const { selectData, callback, key, rowData } = data;
@ -392,7 +389,7 @@ export default {
updateDataSourceByRowIndex(rowIndex, data) {
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, data);
},
}
}
}
</script>

+ 5
- 4
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -521,6 +521,7 @@ export const getBaseInfoFormConfig = ($this) => {
const sn = $this.sn
const labArr = ['LBA005', 'LBA007']
const isLba = labArr.includes(sn)
const isSp = sn.includes('SP')//是否是色谱
return [
{
type: 'cardItem',
@ -575,9 +576,8 @@ export const getBaseInfoFormConfig = ($this) => {
}
}
},
isLba
? {}
: {
isSp
?{
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
@ -590,7 +590,8 @@ export const getBaseInfoFormConfig = ($this) => {
otherCode: 'containerMaterialOther'
}
}
},
}
:{} ,
{
type: 'cellItem',
label: isLba

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

@ -22,7 +22,7 @@ export const getBaseInfoFormConfig = (formType) => {
versionNum: {
label: 'template.common.versionNumber',
type: 'inputNumber',
fillType: 'actFill',
fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
prepend: 'V',
maxlength: 50
},

+ 3
- 1
src/views/business/comps/template/formConfig/sp/SP0021.js View File

@ -174,7 +174,9 @@ export const getTableColumns = ($this) => {
prop: 'sjjrl',
width: 280,
bodyType: 'inputNumber',
bodyFillType: 'actFill'
bodyFillType: 'actFill',
copyFrom: 'lljrl',
compareTo: 'lljrl',
}
]
}

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

@ -58,6 +58,7 @@ export default {
'business_dwzs', // 动物种属
'business_cjdd', // 采集地点
'business_zpdd', // 制片地点
'business_cjbw', // 制片部位
],
props: {
templateData: {

Loading…
Cancel
Save