Browse Source

Merge branch 'zhangteng'

ouqian
ZHANGTENG\张腾 1 month ago
parent
commit
1ece3bfe0b
7 changed files with 623 additions and 4 deletions
  1. +6
    -1
      src/components/Template/BaseInfoFormPackage.vue
  2. +2
    -2
      src/components/Template/mixins/formPackageMixins.js
  3. +18
    -0
      src/lang/en/template/dl.js
  4. +18
    -0
      src/lang/zh/template/dl.js
  5. +3
    -0
      src/views/business/comps/template/TemplateTable.vue
  6. +1
    -1
      src/views/business/comps/template/comps/dl/DL003.vue
  7. +575
    -0
      src/views/business/comps/template/comps/dl/DL006.vue

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

@ -253,6 +253,9 @@
:orange-bg="orangeBgFields[sItem.subKey]" /> :orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ <div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div> formFields[sItem.subKey] }}</div>
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" />
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" :field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'" v-else-if="sItem.subType === 'clickable'"
@ -376,7 +379,9 @@ export default {
}, },
// //
handleClickButton(e, item, val, data) { handleClickButton(e, item, val, data) {
this.formFields[item.subKey] = val;
if(!item.isClearForm){
this.formFields[item.subKey] = val;
}
this.$emit("clickButton", item, data) this.$emit("clickButton", item, data)
}, },
// //

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

@ -48,8 +48,8 @@ export default {
onSelectChange(key, val, type) { onSelectChange(key, val, type) {
// 获取对应的配置 // 获取对应的配置
const currentConfig = this.allFieldsConfig[key]; const currentConfig = this.allFieldsConfig[key];
if (currentConfig.selectTo) {
this.formFields[currentConfig.selectTo] = val;
if (currentConfig?.selectTo) {
this.formFields[currentConfig?.selectTo] = val;
} }
this.onValueChangeCompareTo(key, val); this.onValueChangeCompareTo(key, val);
this.formFields[key] = val; this.formFields[key] = val;

+ 18
- 0
src/lang/en/template/dl.js View File

@ -45,6 +45,24 @@ export default {
ksButton: 'Start', ksButton: 'Start',
jsButton: 'End' jsButton: 'End'
}, },
dl006: {
...common,
jlzpzxx: '剂量组配制信息',
jzs: '菌种数',
pxms: '平行皿数',
qsbh: '起始编号',
sftjs9: '是否添加s9',
s9hhybh: 'S9混合液编号',
s9hhyyjjrl: 'S9混合液预计加入量',
pbsbh: 'PBS编号',
pbsryyjjrl: '0.2mol PBS溶液预计加入量',
jlzsl: '剂量组数量',
wcButton: 'Finsh',
jlzmc: '剂量组名称 ',
jymc: '加液名称',
jybh: '加液编号',
ysjytj: '预设加液体积',
},
dl007: { dl007: {
...common, ...common,
czxx: 'Operation Information', czxx: 'Operation Information',

+ 18
- 0
src/lang/zh/template/dl.js View File

@ -46,6 +46,24 @@ export default {
ksButton: '开始', ksButton: '开始',
jsButton: '结束' jsButton: '结束'
}, },
dl006: {
...common,
jlzpzxx: '剂量组配制信息',
jzs: '菌种数',
pxms: '平行皿数',
qsbh: '起始编号',
sftjs9: '是否添加s9',
s9hhybh: 'S9混合液编号',
s9hhyyjjrl: 'S9混合液预计加入量',
pbsbh: 'PBS编号',
pbsryyjjrl: '0.2mol PBS溶液预计加入量',
jlzsl: '剂量组数量',
wcButton: '完成',
jlzmc: '剂量组名称 ',
jymc: '加液名称',
jybh: '加液编号',
ysjytj: '预设加液体积',
},
dl007: { dl007: {
...common, ...common,
czxx: '操作信息', czxx: '操作信息',

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

@ -92,6 +92,7 @@ import DJ001 from "./comps/dj/DJ001.vue";
// DL001-SYWZPZJHB // DL001-SYWZPZJHB
// DL002-使SP001 // DL002-使SP001
import DL003 from './comps/dl/DL003.vue' import DL003 from './comps/dl/DL003.vue'
import DL006 from './comps/dl/DL006.vue'
import DL007 from './comps/dl/DL007.vue' import DL007 from './comps/dl/DL007.vue'
import DL008 from './comps/dl/DL008.vue' import DL008 from './comps/dl/DL008.vue'
import DL009 from './comps/dl/DL009.vue' import DL009 from './comps/dl/DL009.vue'
@ -139,6 +140,7 @@ export default {
YP005, YP005,
// //
DL003, DL003,
DL006,
DL007, DL007,
DL008, DL008,
DL009, DL009,
@ -279,6 +281,7 @@ export default {
//DL001-SYWZPZJHB //DL001-SYWZPZJHB
'DL002': 'SP001', 'DL002': 'SP001',
'DL003': 'DL003', 'DL003': 'DL003',
'DL006': 'DL006',
'DL007': 'DL007', 'DL007': 'DL007',
'DL008': 'DL008', 'DL008': 'DL008',
'DL009': 'DL009', 'DL009': 'DL009',

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

@ -1,4 +1,4 @@
<!-- Ames实验掺入法平皿培养记录表 -->
<!-- 菌种复苏/增菌记录表 -->
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">

+ 575
- 0
src/views/business/comps/template/comps/dl/DL006.vue View File

@ -0,0 +1,575 @@
<!-- Ames实验掺入法平皿培养记录表 -->
<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="refConf.base"
:formConfig="baseInfoFormConfig"
:formData="formData"
/>
<TableList label="template.common.gyzjInfo" :columns="gyzjColumns" :dataSource="resourceGyzj" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<Step :ref="refConf.bz" :formData="formData.stepData"></Step>
<LineLabel label="template.dl.dl006.jlzpzxx" />
<div class="template-form-item">
<BaseInfoFormPackage
fieldItemLabel="template.common.operationSteps"
:ref="refConf.czInfo"
@select="(e) => onCzChange(e)"
:formConfig="czInfoFormConfig"
:formData="formData"
@clickButton="handleClickButton"
@onRegentSubmit="onRegentSubmit"
/>
<CustomTable
fieldItemLabel="template.common.operationSteps"
:columns="jlzpzxxColumns"
@blur="operateBlur"
:ref="'jlzpzxxTableRef'"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:{}}"
:showHeaderSelect="fillType === 'preFill'"
:prefixKey="`jlzpzxxTable`"
>
</CustomTable>
</div>
<BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz"
label="template.dl.dl007.bz"
:ref="refConf.remark"
:formConfig="remarkConig"
:formData="formData"
/>
</div>
</div>
</div>
</div>
</template>
<script>
import BaseInfoFormPackage from '@/components/Template/BaseInfoFormPackage'
import TableOpertaionDelete from '@/components/Template/operation/TableOpertaionDelete.vue'
import CustomTable from '@/components/Template/CustomTable.vue'
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',
czInfo: 'czInfoRef',
gyzj: 'gyzjTableRef',
remark: 'remarkRef',
jzjz: 'jlzpzxxTableRef',
bz: 'stepRef'
}
const refNames = Object.values(refConf)
export default {
name: 'DL006',
components: {
BaseInfoFormPackage,
LineLabel,
TableList,
Step,
CustomTable,
TableOpertaionDelete
},
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill'
}
},
computed: {
//
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
}
}
},
{
type: 'conditionItem',
label: 'template.dl.dl003.pytj',
config: {
pytjyt: {
span: 1,
label: 'template.common.preFill',
type: 'select',
options: this.getDictOptions('business_pytj'),
fillType: 'preFill',
otherCode: 'pytjOther'
},
pytjsj: {
span: 1,
label: 'template.common.actualFill',
type: 'select',
options: this.getDictOptions('business_pytj'),
fillType: 'actFill',
otherCode: 'syddOther'
}
}
},
{
type: 'conditionItem',
label: 'template.dl.dl003.sydd',
config: {
sydd: {
span: 1,
label: 'template.dl.dl007.sydd',
type: 'select',
options: this.getDictOptions('business_sydd'),
fillType: 'actFill',
otherCode: 'syddOther'
}
}
},
{
type: 'cellItem',
label: 'template.dl.dl003.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: 'input',
disabled: true
},
endDate: {
label: 'template.common.endTime',
type: 'input',
disabled: true
}
}
}
]
},
//
czInfoFormConfig() {
return [
{
type: 'step',
config: {
jzs: {
label: 'template.dl.dl006.jzs',
type: 'inputNumber',
fillType: 'preFill',
maxlength: 2,
},
pxms: {
label: 'template.dl.dl006.pxms',
type: 'inputNumber',
fillType: 'preFill',
maxlength: 2,
},
qsbh: {
label: 'template.dl.dl006.qsbh',
type: 'inputNumber',
fillType: 'preFill',
maxlength: 4,
},
sftjs9: {
label: 'template.dl.dl006.sftjs9',
type: 'select',
options: [
{value:1,label:'是'},
{value:0,label:'否'},
],
fillType: 'preFill',
},
jlzsl: {
label: 'template.dl.dl006.jlzsl',
type: 'inputNumber',
fillType: 'preFill',
subType: 'button',
isClearForm: true,
subKey: 'jlzsl',
buttonName: 'template.dl.dl006.wcButton',
maxlength: 2,
},
// pykssj: {
// label: 'template.dl.dl007.pykssj',
// fillType: 'actFill',
// type: 'input',
// subType: 'button',
// subKey: 'pykssj',
// buttonName: 'template.dl.dl003.ksButton',
// },
}
}
]
},
//
jlzpzxxColumns() {
return [
{
label: 'template.dl.dl006.jlzmc',
prop: "jlzmc",
bodyType: 'input',
bodyMaxlength: 20,
bodyFillType: 'preFill'
},
{
label: 'template.dl.dl006.jymc',
prop: 'jymc',
bodyType: 'input',
bodyMaxlength: 20,
bodyFillType: 'preFill',
},
{
label: 'template.dl.dl006.jybh',
prop: 'jybh',
bodyType: 'sj',
bodyFillType: 'actFill',
},
{
label: 'template.dl.dl006.ysjytj',
prop: 'ysjytj',
headerSelectKey: "ysjytjDw",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyMaxlength: 10,
bodyFillType: 'preFill',
fillType: 'preFill',
}
// {
// 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",
// },
]
},
},
data() {
return {
formData: {},
refConf
}
},
methods: {
//
async deleteTableRow(rowIndex, refName) {
this.$refs[refName].deleteRow(rowIndex)
},
handleClickButton(_item, signData) {
// 1. +
const formFields = this.$refs?.czInfoRef?.formFields;
if (!formFields) {
console.warn('未找到表单字段引用 czInfoRef');
return;
}
const { jlzsl } = formFields;
if (!Number.isInteger(jlzsl) || jlzsl < 0) {
console.warn('记录总数 jlzsl 必须是大于等于0的整数,当前值:', jlzsl);
return;
}
// 2.
const formData = this.getFilledFormData();
// 3. 1jlzsl
const newStepTableData = [];
for (let i = 0; i < jlzsl; i++) {
const row = {
index: i + 1, //
//
name: '',
amount: '',
date: '',
status: 'normal'
};
newStepTableData.push(row);
}
// 4.
formData.stepTableFormData = newStepTableData;
// 5. 2/
const tableRef = this.$refs.jlzpzxxTableRef;
if (tableRef) {
// ===== 1=====
if (tableRef.setDataSource) {
tableRef.setDataSource(newStepTableData); //
}
// ===== 2/=====
else if (tableRef.updateDataSourceByRowIndex && tableRef.deleteRow) {
// 1jlzsl
newStepTableData.forEach((row, i) => {
tableRef.updateDataSourceByRowIndex(i, row);
});
// 2jlzsl31
//
const currentRowCount = tableRef.getDataSource?.()?.length || 0;
//
for (let i = currentRowCount - 1; i >= jlzsl; i--) {
tableRef.deleteRow(i); // i
}
}
// ===== 3/=====
else {
//
tableRef.refresh?.();
//
this.$nextTick(() => {
tableRef.updateDataSourceByRowIndex(0, newStepTableData[0] || {});
});
}
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(refNames)
},
//
async getFormData() {
return await this.validFormFields(refNames)
},
//
async validFields() {
return await this.validFormFields(refNames)
},
getResource() {
// const stepResource = this.$refs.yqsyTableRef.getStepResource()
// 使
// this.resourceTmp = stepResource.sjResource || []
// this.yqResourceTmp = stepResource.yqResource || []
// return this.resourceTmp
},
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
if (key === 'qxbd') {
this.$refs.czInfoRef.updateFormData('pykssj', row.startDate)
}
},
//
async onSave() {
const formData = this.getStepResource()
console.log(formData, 'formData')
},
//table
async operateBlur(params) {
let isGeneratingSubCode = false;
const { dataSource = [], rowIndex } = params; // rowIndex
// 1. /
if (dataSource.length === 0 || isGeneratingSubCode) {
return;
}
// 2.
const currentItem = dataSource[rowIndex];
if (!currentItem) {
return;
}
// 3. targetSolutionCode subTargetSolutionCode
const hasTargetCode = !!currentItem.targetSolutionCode;
const noSubTargetCode = !currentItem.subTargetSolutionCode;
if (!hasTargetCode || !noSubTargetCode) {
return; //
}
try {
// 4.
isGeneratingSubCode = true;
// 5.
const subCode = await this.getLatestSnArr([{
pre: currentItem.targetSolutionCode,
type: 1
}]);
// 6.
currentItem.subTargetSolutionCode = subCode[0] || '';
// 7.
if (this.$refs.jlzpzxxTableRef) {
this.$refs.jlzpzxxTableRef.updateDataSourceByRowIndex(rowIndex, { ...currentItem });
}
} catch (error) {
// 8.
this.$message.error('子码生成失败,请重试');
} finally {
// 9.
isGeneratingSubCode = false;
}
},
//S9
onCzChange(e) {
const { sftjs9 , key } = e;
if(key == 'sftjs9'){
//
const configMap = {
1: {
s9hhybh: {
label: 'template.dl.dl006.s9hhybh',
type: 'input',
fillType: 'actFill',
maxlength: 4,
},
s9hhyyjjrl: {
label: 'template.dl.dl006.s9hhyyjjrl',
type: 'inputNumber',
fillType: 'preFill',
subType: 'select',
subKey: "s9hhyyjjrldw",
subOptions: this.getDictOptions('business_tjdw'),
maxlength: 10,
}
},
other: {
pbsbh: {
label: 'template.dl.dl006.pbsbh',
type: 'input',
fillType: 'actFill',
maxlength: 4,
},
pbsryyjrl: {
label: 'template.dl.dl006.pbsryyjjrl',
type: 'inputNumber',
fillType: 'preFill',
subType: 'select',
subKey: "pbsryyjjrldw",
subOptions: this.getDictOptions('business_tjdw'),
maxlength: 10,
}
}
};
//
let addConfig, removeKeys;
if (sftjs9 === 1) {
addConfig = configMap[1];
removeKeys = ['pbsbh', 'pbsryyjrl'];
} else {
addConfig = configMap.other;
removeKeys = ['s9hhybh', 's9hhyyjjrl'];
}
this.czInfoFormConfig.forEach(item => {
// 1. config
let newConfig = { ...item.config };
removeKeys.forEach(key => delete newConfig[key]);
// 2. config
const keys = Object.keys(newConfig); // config
const lastKey = keys.pop(); //
const frontConfig = {};
//
keys.forEach(key => {
frontConfig[key] = newConfig[key];
});
//
const lastConfig = lastKey ? { [lastKey]: newConfig[lastKey] } : {};
// 3.
newConfig = {
...frontConfig, //
...addConfig, //
...lastConfig //
};
// 4. item.config
item.config = newConfig;
});
}
},
//table header
// onHeaderSelectChange(data){
// const {key, headerSelectFields,dataSource=[]} = data;
// const keys = [
// 'targetDiluentVolumeUnit',
// ]
// if(keys.includes(key)){
// const {targetStartSolution,subTargetStartSolution} = this.$refs.stepFormPackageRef?.getFilledFormData();
// const params = {
// subTargetStartSolution,
// headerSelectFields
// }
// this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
// }
// },
}
}
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
.config-header-end {
display: flex;
justify-content: flex-end;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
}
</style>

Loading…
Cancel
Save