|
|
@ -56,9 +56,9 @@ |
|
|
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy" |
|
|
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)" |
|
|
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)" |
|
|
@beforeReagentSubmit="(e) => beforeReagentSubmit(e, index)" |
|
|
|
|
|
@onRegentSubmit="(e) => onRegentSubmit(e, index)" |
|
|
|
|
|
fieldItemLabel="取样进样信息" :formData="item"> |
|
|
|
|
|
|
|
|
@beforeReagentSubmit="(e) => beforeReagentSubmit(e, index, 'ybsm')" |
|
|
|
|
|
@onRegentSubmit="(e) => onRegentSubmit(e, index, 'ybsm')" fieldItemLabel="取样进样信息" |
|
|
|
|
|
:formData="item"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
@configComplete="(e) => onConfigComplete(e, 'qy')" |
|
|
@configComplete="(e) => onConfigComplete(e, 'qy')" |
|
|
@ -122,9 +122,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
<BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`" |
|
|
<BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`" |
|
|
:formConfig="ecFormConfig" :formData="item" /> |
|
|
:formConfig="ecFormConfig" :formData="item" /> |
|
|
<CustomTable :ref="`ecTableRef${index}`" :columns="yjColumns" prefix="ec" |
|
|
|
|
|
|
|
|
<CustomTable :ref="`ecTableRef${index}`" :columns="ecxsColumns" prefix="ec" |
|
|
fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')" |
|
|
fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')" |
|
|
:showOperation="fillType === 'preFill' || fillType === 'actFill'" |
|
|
:showOperation="fillType === 'preFill' || fillType === 'actFill'" |
|
|
|
|
|
@beforeReagentSubmit="(e) => beforeReagentSubmit(e, index, 'ecxs')" |
|
|
|
|
|
@onRegentSubmit="(e) => onRegentSubmit(e, index, 'ecxs')" |
|
|
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item"> |
|
|
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
@ -212,6 +214,10 @@ export default { |
|
|
ecFormConfig() { |
|
|
ecFormConfig() { |
|
|
return getEcFormConfig(this) |
|
|
return getEcFormConfig(this) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 二次稀释格列 |
|
|
|
|
|
ecxsColumns() { |
|
|
|
|
|
return getJyTableColumns(this, 'ec') |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
@ -233,95 +239,109 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
beforeReagentSubmit(data, index) { |
|
|
beforeReagentSubmit(data, index) { |
|
|
const { selectData, callback, key, headerSelectFields } = data; |
|
|
const { selectData, callback, key, headerSelectFields } = data; |
|
|
const {selectInfo = {}} = selectData; |
|
|
|
|
|
const {nddw} = selectInfo; |
|
|
|
|
|
const {sjzjnddw} = headerSelectFields; |
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
|
const { selectInfo = {} } = selectData; |
|
|
|
|
|
const { nddw } = selectInfo; |
|
|
|
|
|
const { sjzjnddw, qynddw } = headerSelectFields; |
|
|
|
|
|
if ( |
|
|
key === 'zjbh' && |
|
|
key === 'zjbh' && |
|
|
!isCommonUnit(nddw, [sjzjnddw]) |
|
|
!isCommonUnit(nddw, [sjzjnddw]) |
|
|
) { |
|
|
) { |
|
|
//选择起始源溶液需要同步更新table的变更记录。 |
|
|
//选择起始源溶液需要同步更新table的变更记录。 |
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。') |
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。') |
|
|
} |
|
|
} |
|
|
|
|
|
if ( |
|
|
|
|
|
key === 'qybh' && |
|
|
|
|
|
!isCommonUnit(nddw, [qynddw]) |
|
|
|
|
|
) { |
|
|
|
|
|
//选择起始源溶液需要同步更新table的变更记录。 |
|
|
|
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。') |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
onRegentSubmit(e, index) { |
|
|
|
|
|
const {selectInfo,headerSelectFields} = e; |
|
|
|
|
|
const {nd,nddw} = selectInfo.selectInfo; |
|
|
|
|
|
const {sjzjnddw} = headerSelectFields; |
|
|
|
|
|
const jyTableInfo = this.$refs[`jyTableRef${index}`][0].getFilledFormData(); |
|
|
|
|
|
const jyHeaderSelectFields = jyTableInfo.headerSelectFields; |
|
|
|
|
|
const {qynddw} = jyHeaderSelectFields; |
|
|
|
|
|
const sjnd = convertConcentration.convert(nd + nddw, sjzjnddw);//转换后的取样浓度 |
|
|
|
|
|
const transQynd = convertConcentration.convert(nd + nddw, qynddw);//转换后的取样浓度 |
|
|
|
|
|
const parseSjnd = parseFloat(sjnd.toFixed(4)); |
|
|
|
|
|
const parseQynd = parseFloat(transQynd.toFixed(4)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onRegentSubmit(e, index, type) { |
|
|
|
|
|
const { selectInfo, headerSelectFields } = e; |
|
|
|
|
|
const { nd, nddw } = selectInfo.selectInfo; |
|
|
|
|
|
const { sjzjnddw } = headerSelectFields; |
|
|
|
|
|
if (type === 'ybsm') { |
|
|
|
|
|
const jyTableInfo = this.$refs[`jyTableRef${index}`][0].getFilledFormData(); |
|
|
|
|
|
const jyHeaderSelectFields = jyTableInfo.headerSelectFields; |
|
|
|
|
|
const { qynddw } = jyHeaderSelectFields; |
|
|
|
|
|
const sjnd = convertConcentration.convert(nd + nddw, sjzjnddw);//转换后的取样浓度 |
|
|
|
|
|
const transQynd = convertConcentration.convert(nd + nddw, qynddw);//转换后的取样浓度 |
|
|
|
|
|
const parseSjnd = parseFloat(sjnd.toFixed(4)); |
|
|
|
|
|
const parseQynd = parseFloat(transQynd.toFixed(4)); |
|
|
|
|
|
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex, { sjzjnd: parseSjnd }) |
|
|
|
|
|
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex, { qynd: parseQynd }) |
|
|
|
|
|
} |
|
|
|
|
|
if(type === "ecxs"){ |
|
|
|
|
|
|
|
|
|
|
|
const { qynddw } = headerSelectFields; |
|
|
|
|
|
const qynd = convertConcentration.convert(nd + nddw, qynddw);//转换后的取样浓度 |
|
|
|
|
|
this.$refs[`ecTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex, { qynd: parseFloat(qynd.toFixed(4)) }) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex,{sjzjnd:parseSjnd}) |
|
|
|
|
|
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex,{qynd:parseQynd}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
async handleUpdateCode(){ |
|
|
|
|
|
const {ecDataList = [],ybsmDataList= []} = this.formData; |
|
|
|
|
|
|
|
|
async handleUpdateCode() { |
|
|
|
|
|
const { ecDataList = [], ybsmDataList = [] } = this.formData; |
|
|
const codes = []; |
|
|
const codes = []; |
|
|
let flag = false; |
|
|
let flag = false; |
|
|
ybsmDataList.map((item,index) => { |
|
|
|
|
|
const {stepTableFormData = [],jyStepTableFormData = []} = item; |
|
|
|
|
|
stepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
if(step.qybhCode){ |
|
|
|
|
|
|
|
|
ybsmDataList.map((item, index) => { |
|
|
|
|
|
const { stepTableFormData = [], jyStepTableFormData = [] } = item; |
|
|
|
|
|
stepTableFormData.map((step, sIndex) => { |
|
|
|
|
|
if (step.qybhCode) { |
|
|
flag = true; |
|
|
flag = true; |
|
|
} |
|
|
} |
|
|
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{qybh:step.qybh}) |
|
|
|
|
|
codes.push({ pre: step.qybh, type: 1 ,id:`stepTableFormData_${step.qybh}_${index}_${sIndex}`,}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(sIndex, { qybh: step.qybh }) |
|
|
|
|
|
codes.push({ pre: step.qybh, type: 1, id: `stepTableFormData_${step.qybh}_${index}_${sIndex}`, }); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
jyStepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
if(step.jybhCode){ |
|
|
|
|
|
|
|
|
jyStepTableFormData.map((step, sIndex) => { |
|
|
|
|
|
if (step.jybhCode) { |
|
|
flag = true; |
|
|
flag = true; |
|
|
} |
|
|
} |
|
|
codes.push({ pre: step.jybh, type: 1 ,id:`jyStepTableFormData_${step.jybh}_${index}_${sIndex}`,}); |
|
|
|
|
|
|
|
|
codes.push({ pre: step.jybh, type: 1, id: `jyStepTableFormData_${step.jybh}_${index}_${sIndex}`, }); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
ecDataList.map((item,index) => { |
|
|
|
|
|
const {stepTableFormData} = item; |
|
|
|
|
|
stepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
if(step.jybhCode){ |
|
|
|
|
|
|
|
|
ecDataList.map((item, index) => { |
|
|
|
|
|
const { stepTableFormData } = item; |
|
|
|
|
|
stepTableFormData.map((step, sIndex) => { |
|
|
|
|
|
if (step.jybhCode) { |
|
|
flag = true; |
|
|
flag = true; |
|
|
} |
|
|
} |
|
|
codes.push({ pre: step.jybh, type: 1 ,id:`ecStepTableFormData_${step.jybh}_${index}_${sIndex}`,}); |
|
|
|
|
|
|
|
|
codes.push({ pre: step.jybh, type: 1, id: `ecStepTableFormData_${step.jybh}_${index}_${sIndex}`, }); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
if(flag){ |
|
|
|
|
|
|
|
|
if (flag) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const result = await this.getLatestSnArr(codes) |
|
|
const result = await this.getLatestSnArr(codes) |
|
|
codes.map((item,index)=>{ |
|
|
|
|
|
|
|
|
codes.map((item, index) => { |
|
|
item.sn = result[index] |
|
|
item.sn = result[index] |
|
|
}) |
|
|
}) |
|
|
ybsmDataList.map((item,index)=>{ |
|
|
|
|
|
const {stepTableFormData = [],jyStepTableFormData = []} = item; |
|
|
|
|
|
stepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
|
|
|
ybsmDataList.map((item, index) => { |
|
|
|
|
|
const { stepTableFormData = [], jyStepTableFormData = [] } = item; |
|
|
|
|
|
stepTableFormData.map((step, sIndex) => { |
|
|
const id = `stepTableFormData_${step.qybh}_${index}_${sIndex}`; |
|
|
const id = `stepTableFormData_${step.qybh}_${index}_${sIndex}`; |
|
|
const o = codes.find((item) => item.id === id) ||{}; |
|
|
|
|
|
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{qybhCode:o.sn}) |
|
|
|
|
|
|
|
|
const o = codes.find((item) => item.id === id) || {}; |
|
|
|
|
|
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(sIndex, { qybhCode: o.sn }) |
|
|
}); |
|
|
}); |
|
|
jyStepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
|
|
|
jyStepTableFormData.map((step, sIndex) => { |
|
|
const id = `jyStepTableFormData_${step.jybh}_${index}_${sIndex}`; |
|
|
const id = `jyStepTableFormData_${step.jybh}_${index}_${sIndex}`; |
|
|
const o = codes.find((item) => item.id === id) ||{}; |
|
|
|
|
|
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{jybhCode:o.sn}) |
|
|
|
|
|
|
|
|
const o = codes.find((item) => item.id === id) || {}; |
|
|
|
|
|
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(sIndex, { jybhCode: o.sn }) |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
ecDataList.map((item,index) => { |
|
|
|
|
|
const {stepTableFormData} = item; |
|
|
|
|
|
stepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
|
|
|
ecDataList.map((item, index) => { |
|
|
|
|
|
const { stepTableFormData } = item; |
|
|
|
|
|
stepTableFormData.map((step, sIndex) => { |
|
|
const id = `ecStepTableFormData_${step.jybh}_${index}_${sIndex}`; |
|
|
const id = `ecStepTableFormData_${step.jybh}_${index}_${sIndex}`; |
|
|
const o = codes.find((item) => item.id === id) ||{}; |
|
|
|
|
|
this.$refs[`ecTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{jybhCode:o.sn}) |
|
|
|
|
|
|
|
|
const o = codes.find((item) => item.id === id) || {}; |
|
|
|
|
|
this.$refs[`ecTableRef${index}`][0].updateDataSourceByRowIndex(sIndex, { jybhCode: o.sn }) |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
this.justUpdateFilledFormData(); |
|
|
this.justUpdateFilledFormData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//获取文件blog |
|
|
//获取文件blog |
|
|
async handleBeforeDownload({ html2pdf, options, pdfContent }) { |
|
|
async handleBeforeDownload({ html2pdf, options, pdfContent }) { |
|
|
@ -344,7 +364,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
//上传到服务器 |
|
|
//上传到服务器 |
|
|
async uploadPdfToServer(blob) { |
|
|
async uploadPdfToServer(blob) { |
|
|
let that=this |
|
|
|
|
|
|
|
|
let that = this |
|
|
const formData = new FormData(); |
|
|
const formData = new FormData(); |
|
|
formData.append('file', blob, 'hxhq-export-form.pdf'); |
|
|
formData.append('file', blob, 'hxhq-export-form.pdf'); |
|
|
try { |
|
|
try { |
|
|
@ -368,7 +388,7 @@ export default { |
|
|
studyFormFill_exportTbByFileUrl( |
|
|
studyFormFill_exportTbByFileUrl( |
|
|
{ |
|
|
{ |
|
|
url: data.data.url, |
|
|
url: data.data.url, |
|
|
studyFormFillId:that.formData.id, |
|
|
|
|
|
|
|
|
studyFormFillId: that.formData.id, |
|
|
version: that.appTitle, |
|
|
version: that.appTitle, |
|
|
lang: that.$store.getters.language.split("_")[0] |
|
|
lang: that.$store.getters.language.split("_")[0] |
|
|
} |
|
|
} |
|
|
@ -529,7 +549,7 @@ export default { |
|
|
deleteConfig(item, type = "ybsmDataList") { |
|
|
deleteConfig(item, type = "ybsmDataList") { |
|
|
if (this.formData[type].length > 1) { |
|
|
if (this.formData[type].length > 1) { |
|
|
const configIndex = this.formData[type].findIndex(config => config.id === item.id); |
|
|
const configIndex = this.formData[type].findIndex(config => config.id === item.id); |
|
|
console.log(configIndex,item,"configIndex") |
|
|
|
|
|
|
|
|
console.log(configIndex, item, "configIndex") |
|
|
if (configIndex > -1) { |
|
|
if (configIndex > -1) { |
|
|
const newList = [...this.formData[type]] |
|
|
const newList = [...this.formData[type]] |
|
|
newList.splice(configIndex, 1); |
|
|
newList.splice(configIndex, 1); |
|
|
|