|
|
@ -15,84 +15,126 @@ |
|
|
<el-button class="mt-20" v-if="fillType === 'preFill'" type="primary" |
|
|
<el-button class="mt-20" v-if="fillType === 'preFill'" type="primary" |
|
|
@click="onAdd('ybsmDataList')">新增</el-button> |
|
|
@click="onAdd('ybsmDataList')">新增</el-button> |
|
|
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary" |
|
|
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary" |
|
|
@click="onExport">导出</el-button> |
|
|
|
|
|
<div v-for="(item, index) in formData.ybsmDataList" :key="item.id" class="template-form-item"> |
|
|
|
|
|
<div class="config-header"> |
|
|
|
|
|
<div></div> |
|
|
|
|
|
<el-popconfirm title="确认删除当前数据?" @confirm="deleteConfig(item, 'ybsmDataList')"> |
|
|
|
|
|
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" |
|
|
|
|
|
icon="el-icon-delete">{{ |
|
|
|
|
|
$t('template.common.deleteBtn') |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</el-popconfirm> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="取样进样信息" :ref="`ybsmFormPackageRef${index}`" |
|
|
|
|
|
@clickButton="(e,d,key,formFields) => handleClickButton(e,d,key,formFields,index)" |
|
|
|
|
|
:formConfig="ybsmFormConfig" :formData="item" /> |
|
|
|
|
|
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy" |
|
|
|
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
|
|
|
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)" |
|
|
|
|
|
fieldItemLabel="取样进样信息" :formData="item"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@configComplete="(e)=>onConfigComplete(e,'qy')" |
|
|
|
|
|
@printTag="(e)=>onPrintTag(e,index)" |
|
|
|
|
|
:fillType="fillType" |
|
|
|
|
|
:showFz="false" |
|
|
|
|
|
:showKspz="false" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, index)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
<CustomTable :ref="`jyTableRef${index}`" :columns="yjColumns" prefix="jy" |
|
|
|
|
|
fieldItemLabel="取样进样信息" @blur="(e) => onHandleTableBlur(e, index, 'jyTableRef')" |
|
|
|
|
|
:showOperation="fillType === 'actFill'" :showAddRow="false" |
|
|
|
|
|
:formData="{ stepTableFormData: item.jyStepTableFormData || [], headerSelectFields: item.jyHeaderSelectFields || {} }"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@configComplete="(e)=>onConfigComplete(e,'jy')" |
|
|
|
|
|
@printTag="(e)=>onPrintTag(e,index)" |
|
|
|
|
|
:fillType="fillType" |
|
|
|
|
|
:showFz="false" |
|
|
|
|
|
:showKspz="false" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, index)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@click="onExportXqjyxx">导出</el-button> |
|
|
|
|
|
<vue-html2pdf :show-layout="true" pdf-content-width="100%" pdf-format="a2" :pdf-quality="2" |
|
|
|
|
|
:float-layout="false" pdf-orientation="landscape" :paginate-elements-by-height="0" |
|
|
|
|
|
:enable-download="false" :preview-modal="false" filename="取样进样信息" :html-to-pdf-options="{ |
|
|
|
|
|
margin: [10, 5, 10, 5], // 格式: [上, 右, 下, 左] (单位: mm) |
|
|
|
|
|
// 或者使用对象格式 |
|
|
|
|
|
// margin: { top: 20, right: 15, bottom: 20, left: 15 }, |
|
|
|
|
|
filename: 'document.pdf', |
|
|
|
|
|
image: { |
|
|
|
|
|
type: 'jpeg', |
|
|
|
|
|
quality: 2 |
|
|
|
|
|
}, |
|
|
|
|
|
enableLinks: false, |
|
|
|
|
|
html2canvas: { |
|
|
|
|
|
scale: 2, |
|
|
|
|
|
useCORS: true |
|
|
|
|
|
}, |
|
|
|
|
|
jsPDF: { |
|
|
|
|
|
unit: 'mm', // 单位: mm |
|
|
|
|
|
format: 'a2', // 纸张大小 |
|
|
|
|
|
orientation: 'landscape' // 方向 |
|
|
|
|
|
} |
|
|
|
|
|
}" ref="html2PdfXqjyxx" @beforeDownload="handleBeforeDownload" @progress="onProgressXqjyxx"> |
|
|
|
|
|
<section slot="pdf-content"> |
|
|
|
|
|
<div v-for="(item, index) in formData.ybsmDataList" :key="item.id" |
|
|
|
|
|
class="template-form-item"> |
|
|
|
|
|
<div class="config-header"> |
|
|
|
|
|
<div></div> |
|
|
|
|
|
<el-popconfirm title="确认删除当前数据?" @confirm="deleteConfig(item, 'ybsmDataList')"> |
|
|
|
|
|
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" |
|
|
|
|
|
icon="el-icon-delete">{{ |
|
|
|
|
|
$t('template.common.deleteBtn') |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</el-popconfirm> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="取样进样信息" :ref="`ybsmFormPackageRef${index}`" |
|
|
|
|
|
@clickButton="(e, d, key, formFields) => handleClickButton(e, d, key, formFields, index)" |
|
|
|
|
|
:formConfig="ybsmFormConfig" :formData="item" /> |
|
|
|
|
|
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy" |
|
|
|
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
|
|
|
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)" |
|
|
|
|
|
fieldItemLabel="取样进样信息" :formData="item"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@configComplete="(e) => onConfigComplete(e, 'qy')" |
|
|
|
|
|
@printTag="(e) => onPrintTag(e, index)" :fillType="fillType" :showFz="false" |
|
|
|
|
|
:showKspz="false" @deleteRow="() => deleteTableRow(rowIndex, index)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
<CustomTable :ref="`jyTableRef${index}`" :columns="yjColumns" prefix="jy" |
|
|
|
|
|
fieldItemLabel="取样进样信息" @blur="(e) => onHandleTableBlur(e, index, 'jyTableRef')" |
|
|
|
|
|
:showOperation="fillType === 'actFill'" :showAddRow="false" |
|
|
|
|
|
:formData="{ stepTableFormData: item.jyStepTableFormData || [], headerSelectFields: item.jyHeaderSelectFields || {} }"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@configComplete="(e) => onConfigComplete(e, 'jy')" |
|
|
|
|
|
@printTag="(e) => onPrintTag(e, index)" :fillType="fillType" :showFz="false" |
|
|
|
|
|
:showKspz="false" @deleteRow="() => deleteTableRow(rowIndex, index)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
</div> |
|
|
|
|
|
</section> |
|
|
|
|
|
</vue-html2pdf> |
|
|
<LineLabel label="二次稀释信息" /> |
|
|
<LineLabel label="二次稀释信息" /> |
|
|
<el-button class="mt-20" v-if="fillType === 'preFill'" type="primary" |
|
|
<el-button class="mt-20" v-if="fillType === 'preFill'" type="primary" |
|
|
@click="onAdd('ecDataList')">新增</el-button> |
|
|
@click="onAdd('ecDataList')">新增</el-button> |
|
|
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary" |
|
|
<el-button class="mt-20" v-if="fillType === 'actFill'" type="primary" |
|
|
@click="onExport('ec')">导出</el-button> |
|
|
|
|
|
<div v-for="(item, index) in formData.ecDataList" :key="item.id" class="template-form-item"> |
|
|
|
|
|
<div class="config-header"> |
|
|
|
|
|
<div></div> |
|
|
|
|
|
<el-popconfirm title="确认删除当前数据?" @confirm="deleteConfig(item, 'ecDataList')"> |
|
|
|
|
|
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" |
|
|
|
|
|
icon="el-icon-delete">{{ |
|
|
|
|
|
$t('template.common.deleteBtn') |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</el-popconfirm> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`" |
|
|
|
|
|
:formConfig="ecFormConfig" :formData="item" /> |
|
|
|
|
|
<CustomTable :ref="`ecTableRef${index}`" :columns="yjColumns" prefix="ec" |
|
|
|
|
|
fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')" |
|
|
|
|
|
:showOperation="fillType === 'preFill' || fillType === 'actFill'" |
|
|
|
|
|
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@configComplete="(e)=>onConfigComplete(e,'jy')" |
|
|
|
|
|
@printTag="(e)=>onPrintTag(e,index)" |
|
|
|
|
|
:fillType="fillType" |
|
|
|
|
|
:showFz="false" |
|
|
|
|
|
:showKspz="false" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, index)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@click="onExportEcxsxx()">导出</el-button> |
|
|
|
|
|
<vue-html2pdf :show-layout="true" pdf-content-width="100%" pdf-format="a2" :pdf-quality="2" |
|
|
|
|
|
:float-layout="false" pdf-orientation="landscape" :paginate-elements-by-height="0" |
|
|
|
|
|
:enable-download="false" :preview-modal="false" filename="二次稀释信息" :html-to-pdf-options="{ |
|
|
|
|
|
margin: [10, 5, 10, 5], // 格式: [上, 右, 下, 左] (单位: mm) |
|
|
|
|
|
// 或者使用对象格式 |
|
|
|
|
|
// margin: { top: 20, right: 15, bottom: 20, left: 15 }, |
|
|
|
|
|
filename: 'document.pdf', |
|
|
|
|
|
image: { |
|
|
|
|
|
type: 'jpeg', |
|
|
|
|
|
quality: 2 |
|
|
|
|
|
}, |
|
|
|
|
|
enableLinks: false, |
|
|
|
|
|
html2canvas: { |
|
|
|
|
|
scale: 2, |
|
|
|
|
|
useCORS: true |
|
|
|
|
|
}, |
|
|
|
|
|
jsPDF: { |
|
|
|
|
|
unit: 'mm', // 单位: mm |
|
|
|
|
|
format: 'a2', // 纸张大小 |
|
|
|
|
|
orientation: 'landscape' // 方向 |
|
|
|
|
|
} |
|
|
|
|
|
}" ref="html2PdfEcxsxx" @beforeDownload="handleBeforeDownload" @progress="onProgressEcxsxx"> |
|
|
|
|
|
<section slot="pdf-content"> |
|
|
|
|
|
<div v-for="(item, index) in formData.ecDataList" :key="item.id" class="template-form-item"> |
|
|
|
|
|
<div class="config-header"> |
|
|
|
|
|
<div></div> |
|
|
|
|
|
<el-popconfirm title="确认删除当前数据?" @confirm="deleteConfig(item, 'ecDataList')"> |
|
|
|
|
|
<el-button slot="reference" v-if="fillType === 'preFill'" type="text" |
|
|
|
|
|
icon="el-icon-delete">{{ |
|
|
|
|
|
$t('template.common.deleteBtn') |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</el-popconfirm> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`" |
|
|
|
|
|
:formConfig="ecFormConfig" :formData="item" /> |
|
|
|
|
|
<CustomTable :ref="`ecTableRef${index}`" :columns="yjColumns" prefix="ec" |
|
|
|
|
|
fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')" |
|
|
|
|
|
:showOperation="fillType === 'preFill' || fillType === 'actFill'" |
|
|
|
|
|
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@configComplete="(e) => onConfigComplete(e, 'jy')" |
|
|
|
|
|
@printTag="(e) => onPrintTag(e, index)" :fillType="fillType" :showFz="false" |
|
|
|
|
|
:showKspz="false" @deleteRow="() => deleteTableRow(rowIndex, index)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
</div> |
|
|
|
|
|
</section> |
|
|
|
|
|
</vue-html2pdf> |
|
|
<Step :ref="`stepRef`" :formData="formData.stepData || []"></Step> |
|
|
<Step :ref="`stepRef`" :formData="formData.stepData || []"></Step> |
|
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
@ -108,6 +150,7 @@ |
|
|
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; |
|
|
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion"; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion"; |
|
|
|
|
|
|
|
|
|
|
|
import VueHtml2pdf from 'vue-html2pdf' |
|
|
import LineLabel from "@/components/Template/LineLabel"; |
|
|
import LineLabel from "@/components/Template/LineLabel"; |
|
|
import TableList from "@/components/Template/Table"; |
|
|
import TableList from "@/components/Template/Table"; |
|
|
import Step from "@/components/Template/Step"; |
|
|
import Step from "@/components/Template/Step"; |
|
|
@ -118,7 +161,9 @@ import { getuuid, justUpdateFilledFormData } from "@/utils/index"; |
|
|
import { isCommonUnit } from "@/utils/conTools"; |
|
|
import { isCommonUnit } from "@/utils/conTools"; |
|
|
import { convertConcentration } from "@/utils/conConverter";//浓度单位转换 |
|
|
import { convertConcentration } from "@/utils/conConverter";//浓度单位转换 |
|
|
import { volumeConverter } from "@/utils/volConverter";//体积单位转换 |
|
|
import { volumeConverter } from "@/utils/volConverter";//体积单位转换 |
|
|
|
|
|
import { getToken } from "@/utils/auth" |
|
|
import moment from "moment";//时间处理 |
|
|
import moment from "moment";//时间处理 |
|
|
|
|
|
import { studyFormFill_exportTbByFileUrl } from "@/api/business/study/studyFormFill" |
|
|
import { getBaseInfoFormConfig, getRemarkFormConfig, getYbsmFormConfig, getQyTableColumns, getJyTableColumns, getEcFormConfig } from "../../formConfig/gsp/gsp015"; |
|
|
import { getBaseInfoFormConfig, getRemarkFormConfig, getYbsmFormConfig, getQyTableColumns, getJyTableColumns, getEcFormConfig } from "../../formConfig/gsp/gsp015"; |
|
|
const refConfig = { |
|
|
const refConfig = { |
|
|
baseInfoRef: "baseInfoRef", |
|
|
baseInfoRef: "baseInfoRef", |
|
|
@ -128,7 +173,7 @@ const refConfig = { |
|
|
const compRefs = Object.values(refConfig); |
|
|
const compRefs = Object.values(refConfig); |
|
|
export default { |
|
|
export default { |
|
|
name: "SP0021", |
|
|
name: "SP0021", |
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion }, |
|
|
|
|
|
|
|
|
components: { BaseInfoFormPackage, LineLabel, VueHtml2pdf, TableList, Step, CustomTable, TableOpertaion }, |
|
|
mixins: [templateMixin], |
|
|
mixins: [templateMixin], |
|
|
props: { |
|
|
props: { |
|
|
fillType: { |
|
|
fillType: { |
|
|
@ -170,56 +215,122 @@ export default { |
|
|
return { |
|
|
return { |
|
|
refConfig, |
|
|
refConfig, |
|
|
currentIndex: -1, |
|
|
currentIndex: -1, |
|
|
|
|
|
appTitle: process.env.VUE_APP_TITLE, |
|
|
|
|
|
baseUrl: process.env.VUE_APP_FILE_DOMAIN, |
|
|
|
|
|
uploadFileUrl: process.env.VUE_APP_BASE_API + '/file/upload', // 上传文件服务器地址 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
onConfigComplete(e,type){ |
|
|
|
|
|
const {rowData,headerSelectFields} = e; |
|
|
|
|
|
|
|
|
//获取文件blog |
|
|
|
|
|
async handleBeforeDownload({ html2pdf, options, pdfContent }) { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
// 1. 使用 html2pdf 手动构建 PDF,并获取底层的 jsPDF 实例 |
|
|
|
|
|
const pdf = await html2pdf() |
|
|
|
|
|
.set(options) // 应用你的配制选项 |
|
|
|
|
|
.from(pdfContent) // 指定 PDF 内容 |
|
|
|
|
|
.toPdf() // 转换为 PDF |
|
|
|
|
|
.get('pdf'); // 获取 jsPDF 实例 |
|
|
|
|
|
|
|
|
|
|
|
// 2. 从 jsPDF 实例中输出 Blob 对象 |
|
|
|
|
|
const blob = pdf.output('blob'); |
|
|
|
|
|
|
|
|
|
|
|
// 3. 将 Blob 上传到你的服务器 |
|
|
|
|
|
await this.uploadPdfToServer(blob); |
|
|
|
|
|
|
|
|
|
|
|
// 注意:如果你还想让文件自动下载,可以在这里调用 .save() |
|
|
|
|
|
// pdf.save('my-document.pdf'); |
|
|
|
|
|
}, |
|
|
|
|
|
//上传到服务器 |
|
|
|
|
|
async uploadPdfToServer(blob) { |
|
|
|
|
|
let that=this |
|
|
|
|
|
const formData = new FormData(); |
|
|
|
|
|
formData.append('file', blob, 'hxhq-export-form.pdf'); |
|
|
|
|
|
try { |
|
|
|
|
|
const response = await fetch(this.uploadFileUrl, { |
|
|
|
|
|
method: 'POST', |
|
|
|
|
|
headers: { |
|
|
|
|
|
Authorization: "Bearer " + getToken(), |
|
|
|
|
|
}, |
|
|
|
|
|
body: formData |
|
|
|
|
|
}); |
|
|
|
|
|
// 检查响应状态 |
|
|
|
|
|
if (!response.ok) { |
|
|
|
|
|
// 如果响应不成功,可以尝试获取错误信息 |
|
|
|
|
|
const errorData = await response.json().catch(() => ({})); |
|
|
|
|
|
throw new Error(errorData.message || `HTTP error! status: ${response.status}`); |
|
|
|
|
|
} |
|
|
|
|
|
// 获取 JSON 数据 |
|
|
|
|
|
const data = await response.json(); |
|
|
|
|
|
// console.log('返回的JSON数据:', data); |
|
|
|
|
|
if (data.code == 200) { |
|
|
|
|
|
studyFormFill_exportTbByFileUrl( |
|
|
|
|
|
{ |
|
|
|
|
|
url: data.data.url, |
|
|
|
|
|
studyFormFillId:that.formData.id, |
|
|
|
|
|
version: that.appTitle, |
|
|
|
|
|
lang: that.$store.getters.language.split("_")[0] |
|
|
|
|
|
} |
|
|
|
|
|
).then(response => { |
|
|
|
|
|
window.open(that.baseUrl + response.msg) |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$modal.msgError(data.msg) |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$modal.msgError("导出失败,稍后再试") |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onConfigComplete(e, type) { |
|
|
|
|
|
const { rowData, headerSelectFields } = e; |
|
|
let params = { |
|
|
let params = { |
|
|
studySubjectId: this.formData.studySubjectId, |
|
|
studySubjectId: this.formData.studySubjectId, |
|
|
studyId: this.formData.studyId, |
|
|
studyId: this.formData.studyId, |
|
|
studyFormId: this.formData.id, |
|
|
studyFormId: this.formData.id, |
|
|
}; |
|
|
}; |
|
|
if(type === 'qy'){ |
|
|
|
|
|
params = { |
|
|
|
|
|
|
|
|
if (type === 'qy') { |
|
|
|
|
|
params = { |
|
|
...params, |
|
|
...params, |
|
|
bh:rowData.qybh,//编号 |
|
|
|
|
|
nd:rowData.sjzjnd,//浓度 |
|
|
|
|
|
nddw:headerSelectFields.sjzjnddw,//浓度单位 |
|
|
|
|
|
kc:rowData.sjqyl,//库存 |
|
|
|
|
|
kcdw:headerSelectFields.sjqydw,//库存单位 |
|
|
|
|
|
|
|
|
bh: rowData.qybh,//编号 |
|
|
|
|
|
nd: rowData.sjzjnd,//浓度 |
|
|
|
|
|
nddw: headerSelectFields.sjzjnddw,//浓度单位 |
|
|
|
|
|
kc: rowData.sjqyl,//库存 |
|
|
|
|
|
kcdw: headerSelectFields.sjqydw,//库存单位 |
|
|
} |
|
|
} |
|
|
}else if(type === 'jy'){ |
|
|
|
|
|
params = { |
|
|
|
|
|
|
|
|
} else if (type === 'jy') { |
|
|
|
|
|
params = { |
|
|
...params, |
|
|
...params, |
|
|
bh:rowData.jybh,//编号 |
|
|
|
|
|
nd:rowData.sjjynd,//浓度 |
|
|
|
|
|
nddw:headerSelectFields.sjjynddw,//浓度单位 |
|
|
|
|
|
kc:rowData.ztj,//库存 |
|
|
|
|
|
kcdw:headerSelectFields.ztjdw,//库存单位 |
|
|
|
|
|
|
|
|
bh: rowData.jybh,//编号 |
|
|
|
|
|
nd: rowData.sjjynd,//浓度 |
|
|
|
|
|
nddw: headerSelectFields.sjjynddw,//浓度单位 |
|
|
|
|
|
kc: rowData.ztj,//库存 |
|
|
|
|
|
kcdw: headerSelectFields.ztjdw,//库存单位 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.configCompleteRequest(params) |
|
|
this.configCompleteRequest(params) |
|
|
}, |
|
|
}, |
|
|
onPrintTag(e,index){ |
|
|
|
|
|
console.log(e,index,"onPrintTag") |
|
|
|
|
|
|
|
|
onPrintTag(e, index) { |
|
|
|
|
|
console.log(e, index, "onPrintTag") |
|
|
}, |
|
|
}, |
|
|
handleClickButton(item,signData,key,formFields,index){ |
|
|
|
|
|
|
|
|
handleClickButton(item, signData, key, formFields, index) { |
|
|
const ref = this.$refs[`ybsmFormPackageRef${index}`][0]; |
|
|
const ref = this.$refs[`ybsmFormPackageRef${index}`][0]; |
|
|
if(key === "startButton"){ |
|
|
|
|
|
ref.updateFormData("qysj",moment().format("YYYY/MM/DD HH:mm:ss"),{ isUpdateRecord: true, signData }) |
|
|
|
|
|
}else if(key === "endButton"){ |
|
|
|
|
|
|
|
|
if (key === "startButton") { |
|
|
|
|
|
ref.updateFormData("qysj", moment().format("YYYY/MM/DD HH:mm:ss"), { isUpdateRecord: true, signData }) |
|
|
|
|
|
} else if (key === "endButton") { |
|
|
const qysj = formFields.qysj; |
|
|
const qysj = formFields.qysj; |
|
|
if(!qysj){ |
|
|
|
|
|
|
|
|
if (!qysj) { |
|
|
this.$message.error("请先记录开始时间"); |
|
|
this.$message.error("请先记录开始时间"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const subQysj = qysj.substr(0,19) |
|
|
|
|
|
|
|
|
const subQysj = qysj.substr(0, 19) |
|
|
const endTime = moment().format("YYYY/MM/DD HH:mm:ss"); |
|
|
const endTime = moment().format("YYYY/MM/DD HH:mm:ss"); |
|
|
ref.updateFormData("qysj",`${subQysj} ~ ${endTime}`,{ isUpdateRecord: true, signData }) |
|
|
|
|
|
|
|
|
ref.updateFormData("qysj", `${subQysj} ~ ${endTime}`, { isUpdateRecord: true, signData }) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onHandleTableBlur(e, index, refName) { |
|
|
onHandleTableBlur(e, index, refName) { |
|
|
@ -234,7 +345,7 @@ export default { |
|
|
const { bdtjdw, qytjdw, jytjdw, qynddw, ztjdw, sjjynddw } = headerSelectFields || {}; |
|
|
const { bdtjdw, qytjdw, jytjdw, qynddw, ztjdw, sjjynddw } = headerSelectFields || {}; |
|
|
|
|
|
|
|
|
//将标定体积的单位转换成和终体积单位一致再计算; |
|
|
//将标定体积的单位转换成和终体积单位一致再计算; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!!bdtj && !!qytj) { |
|
|
if (!!bdtj && !!qytj) { |
|
|
const transBdtj = volumeConverter.convert(bdtj + bdtjdw, ztjdw);//转换后的标定体积 |
|
|
const transBdtj = volumeConverter.convert(bdtj + bdtjdw, ztjdw);//转换后的标定体积 |
|
|
@ -277,8 +388,43 @@ export default { |
|
|
this.addEcTableRow(index, "jyTableRef"); |
|
|
this.addEcTableRow(index, "jyTableRef"); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
onExport() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成进度 |
|
|
|
|
|
onProgressXqjyxx(progress) { |
|
|
|
|
|
console.log(`生成进度: ${progress}%`) |
|
|
|
|
|
this.removePageBreak() |
|
|
|
|
|
if (progress == 100) { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
//移除分页空白 |
|
|
|
|
|
removePageBreak() { |
|
|
|
|
|
document.querySelectorAll('.html2pdf__page-break').forEach(el => { |
|
|
|
|
|
el.remove() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
onExportXqjyxx() { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.$refs.html2PdfXqjyxx.generatePdf() |
|
|
|
|
|
}, 200); |
|
|
|
|
|
}, |
|
|
|
|
|
//生成进度 |
|
|
|
|
|
onProgressEcxsxx(progress) { |
|
|
|
|
|
console.log(`生成进度: ${progress}%`) |
|
|
|
|
|
this.removePageBreak() |
|
|
|
|
|
if (progress == 100) { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onExportEcxsxx() { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.$refs.html2PdfEcxsxx.generatePdf() |
|
|
|
|
|
}, 200); |
|
|
}, |
|
|
}, |
|
|
//删除样本说明 |
|
|
//删除样本说明 |
|
|
deleteConfig(item, type = "ybsmDataList") { |
|
|
deleteConfig(item, type = "ybsmDataList") { |
|
|
|