|
|
@ -56,6 +56,8 @@ |
|
|
<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"> |
|
|
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" |
|
|
@ -229,11 +231,97 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
handleUpdateCode(){ |
|
|
|
|
|
const refs = ["jyTableRef"] |
|
|
|
|
|
const {ecDataList = [],ybsmDataList= []} = this.fromData; |
|
|
|
|
|
|
|
|
beforeReagentSubmit(data, index) { |
|
|
|
|
|
const { selectData, callback, key, headerSelectFields } = data; |
|
|
|
|
|
const {selectInfo = {}} = selectData; |
|
|
|
|
|
const {nddw} = selectInfo; |
|
|
|
|
|
const {sjzjnddw} = headerSelectFields; |
|
|
|
|
|
if ( |
|
|
|
|
|
key === 'zjbh' && |
|
|
|
|
|
!isCommonUnit(nddw, [sjzjnddw]) |
|
|
|
|
|
) { |
|
|
|
|
|
//选择起始源溶液需要同步更新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)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
const codes = []; |
|
|
|
|
|
let flag = false; |
|
|
|
|
|
ybsmDataList.map((item,index) => { |
|
|
|
|
|
const {stepTableFormData = [],jyStepTableFormData = []} = item; |
|
|
|
|
|
stepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
if(step.qybhCode){ |
|
|
|
|
|
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}`,}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
jyStepTableFormData.map((step,sIndex) => { |
|
|
|
|
|
if(step.jybhCode){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
} |
|
|
|
|
|
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){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
} |
|
|
|
|
|
codes.push({ pre: step.jybh, type: 1 ,id:`ecStepTableFormData_${step.jybh}_${index}_${sIndex}`,}); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
if(flag){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
console.log(this.formData,"fff") |
|
|
|
|
|
|
|
|
const result = await this.getLatestSnArr(codes) |
|
|
|
|
|
codes.map((item,index)=>{ |
|
|
|
|
|
item.sn = result[index] |
|
|
|
|
|
}) |
|
|
|
|
|
ybsmDataList.map((item,index)=>{ |
|
|
|
|
|
const {stepTableFormData = [],jyStepTableFormData = []} = item; |
|
|
|
|
|
stepTableFormData.map((step,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}) |
|
|
|
|
|
}); |
|
|
|
|
|
jyStepTableFormData.map((step,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}) |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
ecDataList.map((item,index) => { |
|
|
|
|
|
const {stepTableFormData} = item; |
|
|
|
|
|
stepTableFormData.map((step,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}) |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
this.justUpdateFilledFormData(); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//获取文件blog |
|
|
//获取文件blog |
|
|
async handleBeforeDownload({ html2pdf, options, pdfContent }) { |
|
|
async handleBeforeDownload({ html2pdf, options, pdfContent }) { |
|
|
|