Browse Source

fix[模板管理]DL006优化

ouqian
ZHANGTENG\张腾 1 month ago
parent
commit
9006d49ae9
3 changed files with 202 additions and 77 deletions
  1. +3
    -0
      src/lang/en/template/dl.js
  2. +5
    -0
      src/lang/zh/template/dl.js
  3. +194
    -77
      src/views/business/comps/template/comps/dl/DL006.vue

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

@ -68,6 +68,9 @@ export default {
jymc: '加液名称',
jybh: '加液编号',
ysjytj: '预设加液体积',
jlzb: '剂量组别',
jzbh: '菌种编号',
gspcdqk: '供试品沉淀情况'
},
dl007: {
...common,

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

@ -69,6 +69,11 @@ export default {
jymc: '加液名称',
jybh: '加液编号',
ysjytj: '预设加液体积',
jlzb: '剂量组别',
jzbh: '菌种编号',
gspcdqk: '供试品沉淀情况',
czxx: '操作信息',
pyxbh:"培养箱编号"
},
dl007: {
...common,

+ 194
- 77
src/views/business/comps/template/comps/dl/DL006.vue View File

@ -42,27 +42,36 @@
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:{}}"
:formData="formData"
:showHeaderSelect="fillType === 'preFill'"
:prefixKey="`jlzpzxxTable`"
>
</CustomTable>
<el-button v-if="fillType === 'preFill'" type="primary" style="display: block; margin: 20px auto 0;" @click="clickFinish">{{ $t('template.dl.dl006.wcButton') }}</el-button>
</div>
<LineLabel label="操作信息" />
<CustomTable
fieldItemLabel="操作信息"
:columns="czxxColumns"
:ref="'czxxTableRef'"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:{},headerFields:formData.headerFields}"
:showHeaderSelect="fillType === 'preFill'"
:prefixKey="`czxxTable`"
>
<LineLabel label="template.dl.dl006.czxx" />
<div class="template-form-item">
<CustomTable
fieldItemLabel="template.dl.dl006.czxx"
:columns="czxxColumns"
:ref="'czxxTableRef'"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="false"
:showAddRow="false"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:{},headerFields:formData.headerFields}"
:showHeaderSelect="fillType === 'preFill'"
:prefixKey="`czxxTable`"
>
</CustomTable>
<BaseInfoFormPackage
class="mt20"
fieldItemLabel="template.dl.dl006.czxx"
ref="czFormRef"
:formConfig="czFormConfig"
:formData="formData"
/>
</div>
<BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz"
@ -86,7 +95,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'
import { Checkbox } from 'element-ui'
const refConf = {
base: 'baseInfoRef',
@ -94,7 +103,8 @@ const refConf = {
remark: 'remarkRef',
jzjz: 'jlzpzxxTableRef',
bz: 'stepRef',
czxx: 'czxxTableRef'
czxx: 'czxxTableRef',
czForm: 'czFormRef'
}
const refNames = Object.values(refConf)
@ -115,47 +125,33 @@ export default {
default: 'preFill'
}
},
mounted() {
let { sftjs9,stepTableFormData_1=[] } = this.getFilledFormData()
const obj = { sftjs9, key:'sftjs9' }
this.onCzChange(obj)
const dataObj = this.$refs?.jlzpzxxTableRef?.formData
this.$refs.czInfoRef.updateFormData('s9hhybh', dataObj?.s9hhybh)
this.$refs.czInfoRef.updateFormData('s9hhyyjjrl', dataObj?.s9hhyyjjrl)
this.$refs.czInfoRef.updateFormData('s9hhyyjjrldw', dataObj?.s9hhyyjjrldw)
this.$refs.czInfoRef.updateFormData('pbsbh', dataObj?.pbsbh)
this.$refs.czInfoRef.updateFormData('s9hhyyjjrl', dataObj?.s9hhyyjjrl)
this.$refs.czInfoRef.updateFormData('s9hhyyjjrldw', dataObj?.s9hhyyjjrldw)
this.$refs.czFormRef.updateFormData('pytjcz', '37℃±2℃')
if(stepTableFormData_1.length>0){
this.clickFinish()
}
},
computed: {
czxxColumns() {
return [
{
prop: 'jlzb',
label: '剂量组别',
bodyType: 'input',
bodyTypeFillType: 'preFill',
placeholder: '请输入剂量组别'
},
{
prop: 'czrxm',
label: '菌种编号',
bodyType: 'checkbox',
width: 300,
headerColumns:[
{
label: '菌种编号',
type:"span",
},
{
type:"sj",
fillType: 'preFill',
key:"bh",
},
{
type: 'input',
fillType:"preFill",
key:"srbh"
},
{
type:"select",
fillType:"preFill",
key:"dw",
options: [
{label:"mg/皿",value:"mg/皿"},
],
},
]
}
]
czxxColumns: {
get() {
return this.rawCzxxColumns.map(col => ({
...col,
}));
},
set(newColumns) {
//
this.rawCzxxColumns = newColumns;
}
},
//
remarkConig() {
@ -213,7 +209,9 @@ export default {
type: 'select',
options: this.getDictOptions('business_pytj'),
fillType: 'actFill',
otherCode: 'syddOther'
otherCode: 'syddOther',
compareTo:"pytjyt",
copyFrom:"pytjyt",
}
}
},
@ -250,7 +248,7 @@ export default {
]
},
//
//
czInfoFormConfig() {
return [
{
@ -290,7 +288,7 @@ export default {
subType: 'button',
isClearForm: true,
subKey: 'jlzsl',
buttonName: 'template.dl.dl006.wcButton',
buttonName: 'form.saveConfirm',
maxlength: 2,
},
// pykssj: {
@ -306,6 +304,34 @@ export default {
}
]
},
//
czFormConfig() {
return [
{
type: 'step',
config: {
pyxbh: {
label: 'template.dl.dl006.pyxbh',
type: 'yq',
fillType: 'actFill',
maxlength: 2,
},
pytjcz: {
label: 'template.dl.dl003.pytj',
type: 'input',
disabled:true,
maxlength: 2,
},
pykssjcz: {
label: 'template.dl.dl007.pykssj',
type: 'dateTime',
fillType: 'actFill',
maxlength: 4,
},
}
}
]
},
//
jlzpzxxColumns() {
return [
@ -358,7 +384,8 @@ export default {
data() {
return {
formData: {},
refConf
refConf,
rawCzxxColumns:[],
}
},
methods: {
@ -374,7 +401,8 @@ export default {
return;
}
const { jlzsl } = formFields;
if (!Number.isInteger(jlzsl) || jlzsl < 0) {
console.log(jlzsl,11)
if (!Number.isInteger(Number(jlzsl)) || Number(jlzsl) < 0) {
console.warn('记录总数 jlzsl 必须是大于等于0的整数,当前值:', jlzsl);
return;
}
@ -451,6 +479,7 @@ export default {
// return this.resourceTmp
},
onRegentSubmit(e) {
console.log(e,909090)
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
@ -544,21 +573,109 @@ export default {
});
}
},
//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)
// }
// },
//
clickFinish() {
//
const { jzs, jlzsl, pxms, qsbh, stepTableFormData = [] } = this.getFilledFormData();
//
let columns = [];
// 1.
columns.push({
prop: 'jlzb',
label: 'template.dl.dl006.jlzb',
bodyType: 'input',
bodyFillType: 'preFill', // bodyTypeFillType
});
// 2. jzs
if (jzs && !isNaN(Number(jzs)) && Number(jzs) > 0) {
for (let i = 0; i < Number(jzs); i++) {
columns.push({
prop: `czrxm_${i}`,
label: 'template.dl.dl006.jzbh',
bodyType: 'checkbox',
bodyFillType: 'actFill', // actFillpreFill
width: 300,
checkboxLabel:'',
headerColumns: [
{
label: '菌种编号',
type: "span",
disabled: true,
editable: false
},
{
type: "xj",
fillType: 'actFill',
key: `bh_${i}`,
required: true,
validator: (value) => {
if (!/^\d+$/.test(value)) {
return '请输入数字';
}
if (value.length > 10) {
return '最多只能输入10个字符';
}
return true;
}
},
{
type: 'input',
fillType: "preFill",
key: `srbh_${i}`
},
{
type: "select",
fillType: "preFill",
key: `dw_${i}`,
required: true,
options: this.getDictOptions('business_tjdw'),
placeholder: '请选择单位'
},
]
});
}
}
// 3.
columns.push({
prop: 'gspcdqk',
label: 'template.dl.dl006.gspcdqk',
bodyType: 'input',
bodyFillType: 'actFill', // bodyTypeFillType
});
// 1
this.rawCzxxColumns = [...columns]; //
this.$nextTick(() => { //
const doseGroupCount = Number(stepTableFormData.length) || 0;
const parallelDishCount = Number(pxms) || 0;
if (doseGroupCount <= 0 || parallelDishCount <= 0) {
this.$message.warning('剂量组数量或平行皿数需为大于0的数字');
return;
}
// 2
const newDataSource = [];
let rowIndexNew = 0;
for (let doseIndex = 0; doseIndex < doseGroupCount; doseIndex++) {
for (let dishIndex = 0; dishIndex < parallelDishCount; dishIndex++) {
const rowData = {
jlzb: stepTableFormData[doseIndex]?.jlzmc || '',
gspcdqk: '',
// undefined
};
newDataSource.push(rowData);
rowIndexNew++;
}
}
// newDataSource
console.log(this.getFilledFormData())
// 3
this.$refs.czxxTableRef.updateDataSource(newDataSource);
});
},
}
}
</script>

Loading…
Cancel
Save