|
|
@ -22,11 +22,14 @@ |
|
|
$t('form.delete') }}</el-button> |
|
|
$t('form.delete') }}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-button v-if="fillType == 'qc'" type="primary" @click="downloadTableData">{{ |
|
|
|
|
|
$t('template.common.downloadTableData') }}</el-button> |
|
|
|
|
|
|
|
|
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" |
|
|
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" |
|
|
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" |
|
|
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" |
|
|
:showCheckAll="true" @selectionChange="handleSelectionChange" |
|
|
:showCheckAll="true" @selectionChange="handleSelectionChange" |
|
|
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps" |
|
|
:showOperation="fillType === 'preFill'" fieldItemLabel="template.common.operationSteps" |
|
|
@clickButton="handleClickButton"> |
|
|
|
|
|
|
|
|
@clickButton="handleClickButton"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> |
|
|
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion> |
|
|
@ -59,7 +62,7 @@ import { convertConcentration } from "@/utils/conConverter";//浓度单位转换 |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import { getPCR008Config } from "../../formConfig/PCRTableConfig.js"; |
|
|
import { getPCR008Config } from "../../formConfig/PCRTableConfig.js"; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" |
|
|
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals,uniqeYqOne } from "@/utils/calUnitTools"; |
|
|
|
|
|
|
|
|
import { addTj, subTj, uniqeResource, uniqeResourceOne, addDecimals, uniqeYqOne } from "@/utils/calUnitTools"; |
|
|
import ImportExcelDialog from '../../dialog/ImportExcelDialog' |
|
|
import ImportExcelDialog from '../../dialog/ImportExcelDialog' |
|
|
import { getBalance } from '@/utils/tpph.js'; |
|
|
import { getBalance } from '@/utils/tpph.js'; |
|
|
export default { |
|
|
export default { |
|
|
@ -160,7 +163,7 @@ export default { |
|
|
label: 'template.common.actualFill', |
|
|
label: 'template.common.actualFill', |
|
|
type: "select", |
|
|
type: "select", |
|
|
fillType: "actFill", |
|
|
fillType: "actFill", |
|
|
otherCode: "actOther",otherCodeCompareTo: "preOther", |
|
|
|
|
|
|
|
|
otherCode: "actOther", otherCodeCompareTo: "preOther", |
|
|
multiple: true, |
|
|
multiple: true, |
|
|
compareTo: "pre", |
|
|
compareTo: "pre", |
|
|
options: this.getDictOptions('business_pztj') |
|
|
options: this.getDictOptions('business_pztj') |
|
|
@ -247,6 +250,54 @@ export default { |
|
|
this.onHandleTableBlur() |
|
|
this.onHandleTableBlur() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
downloadTableData() { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
let content = this.getFilledFormData(); |
|
|
|
|
|
var tabelStr = |
|
|
|
|
|
'<table border="1" class="html-tabel">' + |
|
|
|
|
|
'<tr style="background:#eee;">' + |
|
|
|
|
|
'<th style="text-align: center;">' + '样品名称' + '</th>' + |
|
|
|
|
|
'<th style="text-align: center;">' + '组织重量' + '</th>' + |
|
|
|
|
|
'<th style="text-align: center;">' + '实际匀浆溶液补加入量' + '</th>' + |
|
|
|
|
|
' </tr>' |
|
|
|
|
|
let _datastr = '' |
|
|
|
|
|
_.forEach(content.stepTableFormData, function (value) { |
|
|
|
|
|
_datastr = |
|
|
|
|
|
_datastr + |
|
|
|
|
|
'<tr style="text-align: center;">' + |
|
|
|
|
|
' <td>' + |
|
|
|
|
|
value.ypmc + |
|
|
|
|
|
'</td>' + |
|
|
|
|
|
' <td>' + |
|
|
|
|
|
value.zzzl + |
|
|
|
|
|
'</td>' + |
|
|
|
|
|
' <td>' + |
|
|
|
|
|
value.sjyjrybjrl + |
|
|
|
|
|
'</td>' + |
|
|
|
|
|
'</tr>' |
|
|
|
|
|
}) |
|
|
|
|
|
tabelStr = tabelStr + _datastr + ' <table>' |
|
|
|
|
|
// Worksheet名 |
|
|
|
|
|
var worksheet = this.formData.bdmc |
|
|
|
|
|
var uri = 'data:application/vnd.ms-excel;base64,' |
|
|
|
|
|
// 真正要导出(下载)的HTML模板 |
|
|
|
|
|
var exportTemplate = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" |
|
|
|
|
|
xmlns="http://www.w3.org/TR/REC-html40"> |
|
|
|
|
|
<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet> |
|
|
|
|
|
<x:Name>${worksheet}</x:Name> |
|
|
|
|
|
<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet> |
|
|
|
|
|
</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--> |
|
|
|
|
|
</head> |
|
|
|
|
|
<body> |
|
|
|
|
|
${tabelStr} |
|
|
|
|
|
</body> |
|
|
|
|
|
</html>` |
|
|
|
|
|
var a = document.createElement('a') |
|
|
|
|
|
a.download = worksheet + '.xls' |
|
|
|
|
|
a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate))) |
|
|
|
|
|
a.click() |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}, |
|
|
onBeforeReagentSubmit(data) { |
|
|
onBeforeReagentSubmit(data) { |
|
|
const { selectData, callback } = data; |
|
|
const { selectData, callback } = data; |
|
|
|
|
|
|
|
|
@ -339,7 +390,7 @@ export default { |
|
|
let cjgz = item.cjgz |
|
|
let cjgz = item.cjgz |
|
|
let tabZzzl; |
|
|
let tabZzzl; |
|
|
// 组织重量 = 连组织称重 减去 采集管重 |
|
|
// 组织重量 = 连组织称重 减去 采集管重 |
|
|
if(lzzgz && cjgz) { |
|
|
|
|
|
|
|
|
if (lzzgz && cjgz) { |
|
|
let temp = subTj([lzzgz, cjgz], [content.headerSelectFields.lzzgzUnit, content.headerSelectFields.cjgzUnit]) |
|
|
let temp = subTj([lzzgz, cjgz], [content.headerSelectFields.lzzgzUnit, content.headerSelectFields.cjgzUnit]) |
|
|
let zzzl = temp.total |
|
|
let zzzl = temp.total |
|
|
let zzzlUnit = temp.unit |
|
|
let zzzlUnit = temp.unit |
|
|
@ -348,7 +399,7 @@ export default { |
|
|
} |
|
|
} |
|
|
// 预设匀浆溶液补加入量 = (组织重量 乘以 倍数 )减去 已加匀浆溶液 |
|
|
// 预设匀浆溶液补加入量 = (组织重量 乘以 倍数 )减去 已加匀浆溶液 |
|
|
|
|
|
|
|
|
if(tabZzzl && bs && yjyjry) { |
|
|
|
|
|
|
|
|
if (tabZzzl && bs && yjyjry) { |
|
|
let temp = subTj([tabZzzl * bs, yjyjry], [content.headerSelectFields.zzzlUnit, yjyjryUnit]) |
|
|
let temp = subTj([tabZzzl * bs, yjyjry], [content.headerSelectFields.zzzlUnit, yjyjryUnit]) |
|
|
let ysyjrybjrl = temp.total |
|
|
let ysyjrybjrl = temp.total |
|
|
let ysyjrybjrlUnit = temp.unit |
|
|
let ysyjrybjrlUnit = temp.unit |
|
|
@ -408,7 +459,7 @@ export default { |
|
|
//使用的试剂、仪器 |
|
|
//使用的试剂、仪器 |
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) |
|
|
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) |
|
|
this.yqResourceTmp = uniqeYqOne([...stepResource.yqResource || [],...tmpYq]) |
|
|
|
|
|
|
|
|
this.yqResourceTmp = uniqeYqOne([...stepResource.yqResource || [], ...tmpYq]) |
|
|
return this.resourceTmp; |
|
|
return this.resourceTmp; |
|
|
}, |
|
|
}, |
|
|
//保存 |
|
|
//保存 |
|
|
@ -425,19 +476,19 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//第五步表格按钮点击 |
|
|
//第五步表格按钮点击 |
|
|
async handleClickButton(e, rowIndex,colIndex,ee,data) { |
|
|
|
|
|
|
|
|
async handleClickButton(e, rowIndex, colIndex, ee, data) { |
|
|
debugger |
|
|
debugger |
|
|
if(e==='lzzgzBtn'){ |
|
|
|
|
|
|
|
|
if (e === 'lzzgzBtn') { |
|
|
const content = this.getFilledFormData() |
|
|
const content = this.getFilledFormData() |
|
|
let formData = this.formData; |
|
|
|
|
|
|
|
|
let formData = this.formData; |
|
|
|
|
|
|
|
|
let qy = content.yqInfo_dztpbh || formData.yqInfo_dztpbh |
|
|
let qy = content.yqInfo_dztpbh || formData.yqInfo_dztpbh |
|
|
let dw = content.headerSelectFields.lzzgzUnit |
|
|
let dw = content.headerSelectFields.lzzgzUnit |
|
|
|
|
|
|
|
|
let x = await getBalance({yq:qy,dw:dw}) |
|
|
|
|
|
if(x && x.success){ |
|
|
|
|
|
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { lzzgz: x.value },{signData:data,updateFields:['lzzgz']}); |
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
let x = await getBalance({ yq: qy, dw: dw }) |
|
|
|
|
|
if (x && x.success) { |
|
|
|
|
|
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { lzzgz: x.value }, { signData: data, updateFields: ['lzzgz'] }); |
|
|
|
|
|
} else { |
|
|
this.$message.error(x.message || '称量失败') |
|
|
this.$message.error(x.message || '称量失败') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|