|
|
|
@ -11,15 +11,15 @@ |
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="template.common.baseInfo" |
|
|
|
label="template.common.baseInfo" |
|
|
|
ref="baseInfoRef" |
|
|
|
:ref="refConf.base" |
|
|
|
:formConfig="baseInfoFormConfig" |
|
|
|
:formData="formData" |
|
|
|
/> |
|
|
|
|
|
|
|
<LineLabel label="仪器使用信息" /> |
|
|
|
<LineLabel label="template.dl.dl007.yqsyxx" /> |
|
|
|
<CustomTable |
|
|
|
:columns="yqsyColumns" |
|
|
|
ref="yqsyTableRef" |
|
|
|
:ref="refConf.yqsy" |
|
|
|
@onRegentSubmit="(e) => onRegentSubmit(e)" |
|
|
|
:showOperation="fillType === 'actFill'" |
|
|
|
:showAddRow="fillType === 'actFill'" |
|
|
|
@ -37,18 +37,19 @@ |
|
|
|
</CustomTable> |
|
|
|
|
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="操作信息" |
|
|
|
label="操作信息" |
|
|
|
ref="czInfoRef" |
|
|
|
fieldItemLabel="template.dl.dl007.czxx" |
|
|
|
label="template.dl.dl007.czxx" |
|
|
|
:ref="refConf.czInfo" |
|
|
|
:formConfig="czInfoFormConfig" |
|
|
|
:formData="formData" |
|
|
|
@clickButton="handleClickButton" |
|
|
|
@onRegentSubmit="onRegentSubmit" |
|
|
|
/> |
|
|
|
|
|
|
|
<BaseInfoFormPackage |
|
|
|
fieldItemLabel="template.yp.yp002.jsbz" |
|
|
|
label="template.yp.yp002.jsbz" |
|
|
|
ref="remarkRef" |
|
|
|
fieldItemLabel="template.dl.dl007.bz" |
|
|
|
label="template.dl.dl007.bz" |
|
|
|
:ref="refConf.remark" |
|
|
|
:formConfig="remarkConig" |
|
|
|
:formData="formData" |
|
|
|
/> |
|
|
|
@ -68,6 +69,14 @@ import Step from '@/components/Template/Step' |
|
|
|
import templateMixin from '../../mixins/templateMixin' |
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
const refConf = { |
|
|
|
base: 'baseInfoRef', |
|
|
|
yqsy: 'yqsyTableRef', |
|
|
|
czInfo: 'czInfoRef', |
|
|
|
remark: 'remarkRef' |
|
|
|
} |
|
|
|
const refNames = Object.values(refConf) |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'DL007', |
|
|
|
components: { |
|
|
|
@ -125,13 +134,13 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'conditionItem', |
|
|
|
label: '试验地点', |
|
|
|
label: 'template.dl.dl007.sydd', |
|
|
|
config: { |
|
|
|
sydd: { |
|
|
|
span: 1, |
|
|
|
label: '试验地点', |
|
|
|
label: 'template.dl.dl007.sydd', |
|
|
|
type: 'select', |
|
|
|
options: this.getDictOptions('business_cctj'), |
|
|
|
options: this.getDictOptions('business_sydd'), |
|
|
|
fillType: 'actFill', |
|
|
|
otherCode: 'syddOther' |
|
|
|
} |
|
|
|
@ -139,15 +148,15 @@ export default { |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'cellItem', |
|
|
|
label: '操作时间', |
|
|
|
label: 'template.common.configurationTime', |
|
|
|
config: { |
|
|
|
kssj: { |
|
|
|
label: '开始时间', |
|
|
|
startDate: { |
|
|
|
label: 'template.common.startTime', |
|
|
|
type: 'input', |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
jssj: { |
|
|
|
label: '结束时间', |
|
|
|
endDate: { |
|
|
|
label: 'template.common.endTime', |
|
|
|
type: 'input', |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
@ -159,13 +168,13 @@ export default { |
|
|
|
yqsyColumns() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
label: '仪器编号', |
|
|
|
label: 'template.dl.dl007.yqbh', |
|
|
|
prop: 'yqbh', |
|
|
|
bodyType: 'yq', |
|
|
|
bodyFillType: 'actFill' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '仪器名称', |
|
|
|
label: 'template.dl.dl007.yqmc', |
|
|
|
prop: 'yqmc', |
|
|
|
bodyType: 'input', |
|
|
|
bodyDisabled: true, |
|
|
|
@ -173,7 +182,7 @@ export default { |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '仪器型号', |
|
|
|
label: 'template.dl.dl007.yqxh', |
|
|
|
prop: 'yqxh', |
|
|
|
bodyType: 'input', |
|
|
|
bodyDisabled: true, |
|
|
|
@ -181,7 +190,7 @@ export default { |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '下次测试/检准/检定日期', |
|
|
|
label: 'template.dl.dl007.xccsjzjdrq', |
|
|
|
prop: 'jzrq', |
|
|
|
bodyType: 'input', |
|
|
|
bodyDisabled: true, |
|
|
|
@ -198,23 +207,25 @@ export default { |
|
|
|
type: 'cellItem', |
|
|
|
config: { |
|
|
|
qxbd: { |
|
|
|
label: 'template.yp.yp002.qxbd', |
|
|
|
label: 'template.dl.dl007.qxbd', |
|
|
|
type: 'qxbd', |
|
|
|
fillType: 'actFill', |
|
|
|
filledCodes: ['bdmc', 'bdbh'] |
|
|
|
}, |
|
|
|
pykssj: { |
|
|
|
label: '培养开始时间', |
|
|
|
label: 'template.dl.dl007.pykssj', |
|
|
|
fillType: 'actFill', |
|
|
|
type: 'input', |
|
|
|
disabled: true |
|
|
|
}, |
|
|
|
pyjssj: { |
|
|
|
label: 'template.dl.dl007.pyjssj', |
|
|
|
type: 'input', |
|
|
|
fillType: 'actFill', |
|
|
|
maxlength: 200, |
|
|
|
subType: 'button', |
|
|
|
subKey: 'pyjssjButton', |
|
|
|
buttonName: '获取时间' |
|
|
|
buttonName: 'template.dl.dl007.jsButton' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -223,68 +234,46 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formData: {} |
|
|
|
formData: {}, |
|
|
|
refConf |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
methods: { |
|
|
|
// 删除表格行 |
|
|
|
deleteTableRow(rowIndex, refName) { |
|
|
|
this.$refs[refName].deleteRow(rowIndex) |
|
|
|
}, |
|
|
|
// 点击按钮 |
|
|
|
handleClickButton(item, signData) { |
|
|
|
handleClickButton(_item, signData) { |
|
|
|
this.$refs.czInfoRef.updateFormData( |
|
|
|
'pyjssj', |
|
|
|
moment().format('YYYY/MM/DD HH:mm'), |
|
|
|
{ isUpdateRecord: true, signData } |
|
|
|
) |
|
|
|
}, |
|
|
|
//获取已填写的表单数据 |
|
|
|
// 获取已填写的表单数据 |
|
|
|
getFilledFormData() { |
|
|
|
const baseData = this.$refs.baseInfoRef.getFilledFormData() |
|
|
|
const swypyjData = this.$refs.swypyjInfoRef.getFilledFormData() |
|
|
|
const ypjsData = this.$refs.ypjsInfoRef.getFilledFormData() |
|
|
|
const remarkData = this.$refs.remarkRef.getFilledFormData() |
|
|
|
|
|
|
|
return { |
|
|
|
...baseData, |
|
|
|
...swypyjData, |
|
|
|
...ypjsData, |
|
|
|
...remarkData |
|
|
|
} |
|
|
|
return this.getFilledFormDataByRefs(refNames) |
|
|
|
}, |
|
|
|
//获取填写完成的表单数据 |
|
|
|
// 获取填写完成的表单数据 |
|
|
|
async getFormData() { |
|
|
|
//先校验再获取值 |
|
|
|
const validFlag = await this.validFields() |
|
|
|
if (!validFlag) { |
|
|
|
return false |
|
|
|
} |
|
|
|
let content = this.getFilledFormData() |
|
|
|
return content |
|
|
|
return await this.validFormFields(refNames) |
|
|
|
}, |
|
|
|
//只做校验 |
|
|
|
// 只做校验 |
|
|
|
async validFields() { |
|
|
|
// 构建需要验证的引用数组 |
|
|
|
let refsToValidate = [ |
|
|
|
'baseInfoRef', |
|
|
|
'yqsyTableRef', |
|
|
|
'czInfoRef', |
|
|
|
'remarkRef' |
|
|
|
] |
|
|
|
return await this.validFormFields(refsToValidate) |
|
|
|
return await this.validFormFields(refNames) |
|
|
|
}, |
|
|
|
getResource() { |
|
|
|
let content = this.getFilledFormData() |
|
|
|
//使用的试剂、仪器 |
|
|
|
this.resourceTmp = [] |
|
|
|
this.yqResourceTmp = [] |
|
|
|
const stepResource = this.$refs.yqsyTableRef.getStepResource() |
|
|
|
// 使用的试剂、仪器 |
|
|
|
this.resourceTmp = stepResource.sjResource || [] |
|
|
|
this.yqResourceTmp = stepResource.yqResource || [] |
|
|
|
return this.resourceTmp |
|
|
|
}, |
|
|
|
onRegentSubmit(e) { |
|
|
|
const { selectInfo, key, col, rowIndex, colIndex, rowData } = e |
|
|
|
const { selectInfo, key, rowIndex } = e |
|
|
|
const { row } = selectInfo |
|
|
|
|
|
|
|
if (key === 'yqbh') { |
|
|
|
const params = { |
|
|
|
yqmc: row.mc, |
|
|
|
@ -293,11 +282,11 @@ export default { |
|
|
|
} |
|
|
|
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) |
|
|
|
} |
|
|
|
if (key === 'qxbd') { |
|
|
|
this.$refs.czInfoRef.updateFormData('pykssj', row.startDate) |
|
|
|
} |
|
|
|
}, |
|
|
|
// beforeReagentSubmit(val,val1,val2){ |
|
|
|
// debugger |
|
|
|
// }, |
|
|
|
//保存 |
|
|
|
// 保存 |
|
|
|
async onSave() { |
|
|
|
const formData = this.getStepResource() |
|
|
|
console.log(formData, 'formData') |
|
|
|
|