Commit 9b78fc63 by lichengming

修改了证书编制

parent 978f7154
<template>
<div>
<Modal v-model="showDiagramModal" title="检定(校准)证书编制" width="100%" class="footer-hidden iframeOne">
<div id="iframeOne" style="text-align:center;align-content:center;width: 100%;height: 790px">
</div>
<div slot="footer">
</div>
</Modal>
<!-- <Modal v-model="showDiagramModal" title="检定(校准)证书编制" width="100%" class="footer-hidden iframeOne">-->
<!-- <div id="iframeOne" style="text-align:center;align-content:center;width: 100%;height: 790px">-->
<!-- </div>-->
<!-- <div slot="footer">-->
<!-- </div>-->
<!-- </Modal>-->
<div v-show="showDiagramModal">
<RecordIframe ref="iframeModal"></RecordIframe>
</div>
</div>
</template>
<script>
import global from '../../api/config'
import { meterSample } from '../../api'
import RecordIframe from '../meter-out/personal-task/RecordIframe'
/**
* 原始记录填写
*/
export default {
components: {
RecordIframe
},
data() {
return {
showDiagramModal: false,
......@@ -59,6 +65,8 @@ export default {
}
},
_cancel() {
this.$Message.success('保存成功!')
this.$refs.iframeModal._closeIframe()
this.showDiagramModal = false
this.$emit('on-result-change')
},
......@@ -98,11 +106,23 @@ export default {
name +
'&bindUri=' +
encodeURIComponent(baseUrl)
$('#iframeOne').html(
'<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' +
url +
'></iframe>'
)
// $('#iframeOne').html(
// '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' +
// url +
// '></iframe>'
// )
const param = {
sampleId: this.sampleId,
tempId: modelId,
client: client,
spec: spec,
name: name,
factoryNumber: factoryNumber,
manufacturer: manufacturer,
verification: verification,
bindUri: encodeURIComponent(baseUrl)
}
this.$refs.iframeModal._createIframe(url, param)
}
}
}
......
<template>
<div>
<Modal v-model="showDiagramModalSampleLook" title="检定(校准)证书" width="100%" class="footer-hidden iframeSampleLookThree">
<div id="iframeSampleLookThree" style="text-align:center;align-content:center;width: 100%;height: 790px">
</div>
<div slot="footer">
</div>
</Modal>
<!-- <Modal v-model="showDiagramModalSampleLook" title="检定(校准)证书" width="100%" class="footer-hidden iframeSampleLookThree">-->
<!-- <div id="iframeSampleLookThree" style="text-align:center;align-content:center;width: 100%;height: 790px">-->
<!-- </div>-->
<!-- <div slot="footer">-->
<!-- </div>-->
<!-- </Modal>-->
<div v-show="showDiagramModalSampleLook">
<RecordIframe ref="iframeModal"></RecordIframe>
</div>
</div>
</template>
<script>
......@@ -13,7 +16,11 @@
* 详情
*/
import { meterSample } from '../../api'
import RecordIframe from '../meter-out/personal-task/RecordIframe'
export default {
components: {
RecordIframe
},
data() {
return {
showDiagramModalSampleLook: false,
......@@ -54,6 +61,7 @@ export default {
}
},
_cancel() {
this.$refs.iframeModal._closeIframe()
this.showDiagramModalSampleLook = false
this.$emit('on-result-change')
},
......@@ -71,11 +79,12 @@ export default {
name !== 'only'
? 'http://record.patzn.com:7000/print/v1/eln/form_meter_' + formId
: 'http://record.patzn.com:7000/print/v1/form/' + formId
$('#iframeSampleLookThree').html(
'<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' +
encodeURI(url) +
'></iframe>'
)
// $('#iframeSampleLookThree').html(
// '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' +
// encodeURI(url) +
// '></iframe>'
// )
this.$refs.iframeModal._createIframe(url)
}
}
}
......
......@@ -357,6 +357,7 @@ export default {
) {
this.$Message.warning('该检测项目暂无原始记录!')
} else {
console.log('Original')
this.$refs.itemOriginalRecordLookModal._open(
data.recordId,
name,
......@@ -365,6 +366,7 @@ export default {
}
},
_resultRecord() {
this.$refs.SelectOriTempRecord.showModal = false
this._page()
this.$emit('on-result-change')
},
......
......@@ -51,14 +51,13 @@
</div>
</Modal>
<!--自定义post请求iframe-->
<RecordIframe ref="iframeModal"></RecordIframe>
<RecordIframe ref="iframeModal" @on-result-change="_recordChange"></RecordIframe>
</div>
</template>
<script>
/**
* 选择原始记录模板(实验室的)
*/
import Global from '../../../api/config'
import TwoCard from '../../../components/base/TwoCard'
import { meterPrint } from '../../../api'
import RecordIframe from './RecordIframe'
......@@ -81,6 +80,7 @@ export default {
title: ''
// businessTypeList: 0
},
again: false,
selectData: [],
sampleId: '',
sampleData: '',
......@@ -97,13 +97,12 @@ export default {
},
mounted() {
// 监听原始记录消息
window.addEventListener('message', this._saveOriginal)
},
// 销毁监听事件
beforeDestroy() {
count = 0
window.removeEventListener('message', this._saveOriginal)
},
// beforeDestroy() {
// count = 0
// window.removeEventListener('message', this._saveOriginal)
// },
methods: {
// 刷新左右数据
_refresh() {
......@@ -177,17 +176,13 @@ export default {
this._hideLoading()
} else {
// 校验多样品多项目原始记录模板
const url =
Global.recordURL +
'/meter/v1/sample/certificate_record_data_bind?' +
this.selectData[0].id
console.log(this.sampleData)
const param = {
sampleId: this.sampleId,
tempId: this.selectData[0].id,
dataSource: this.sampleData
}
console.log(url, param)
// this.$refs.iframeModal._createIframe(url, param)
console.log(param)
this.$emit('on-result-change', param)
}
},
......@@ -195,7 +190,7 @@ export default {
this.$emit('on-result-change')
},
// 保存原始记录信息
_saveOriginal(data) {
saveOriginal(data) {
if (localStorage.getItem('recordStatus') === 'addLabRecord') {
if (count === 0) {
if (data.data.msg !== true) {
......
......@@ -63,7 +63,6 @@
<MeterPersonItemTaskManage ref="personModal"></MeterPersonItemTaskManage>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_page"></MeterSubcontractorEdit>
<SelectOriTempRecord ref="SelectOriTempRecord" @on-result-change="_certificateSelectBack"></SelectOriTempRecord>
<RecordIframe ref="iframeModal" @on-result-change="_resultRecord"></RecordIframe>
<!--自定义编制证书-->
<CertificateMake ref="itemOriginalRecordModal" @on-result-change="_resultRecord"></CertificateMake>
<!--编辑证书-->
......@@ -81,10 +80,8 @@ import CarManage from './CarManage'
import MeterPersonItemTaskManage from './MeterPersonItemTaskManage'
import InstruMentEdit from './InstrumentEdit'
import SelectOriTempRecord from './SelectOriTempRecord'
import RecordIframe from './RecordIframe'
export default {
components: {
RecordIframe,
SelectOriTempRecord,
MeterSubcontractorEdit,
CertificateMake,
......@@ -186,33 +183,8 @@ export default {
},
mounted() {
this._page()
window.addEventListener('message', this._saveOriginal)
},
methods: {
async _saveOriginal(data) {
console.log('data11111', data)
console.log('formId', this.formId)
console.log('sampleId: [],', this.sampleId)
console.log('data.data.msg,', data.data.msg)
if (this.again) {
this.again = false
if (
undefined !== this.formId &&
this.formId !== '' &&
this.sampleId !== undefined
) {
await meterSample.certificateEdit({
sampleId: this.sampleId,
formId: this.formId
})
}
if (data.data.msg === true) {
this.$refs.iframeModal._closeIframe()
} else {
this.$refs.iframeModal._closeIframe()
}
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -243,6 +215,7 @@ export default {
},
// 追填原始记录 回调
_resultRecord() {
this.$refs.SelectOriTempRecord.showModal = false
this._page()
this.$emit('on-result-change')
},
......@@ -354,28 +327,13 @@ export default {
) {
this.$Message.warning('该检测项目暂无原始记录!')
} else {
// this.$refs.itemOriginalRecordLookModal._open(
// data.recordId,
// name,
// data.id
// )
this._iframeModal(data, name)
this.$refs.itemOriginalRecordLookModal._open(
data.recordId,
name,
data.id
)
}
},
_iframeModal(data, name) {
this.again = true
this.formId = data.recordId
this.showDiagramModalSampleLook = true
this.sampleId = data.id
this.name = name
let url = ''
url =
name !== 'only'
? 'http://record.patzn.com:7000/print/v1/eln/form_meter_' +
data.recordId
: 'http://record.patzn.com:7000/print/v1/form/' + data.recordId
this.$refs.iframeModal._createIframe(url)
},
_personModal(data) {
console.log(data)
this.$refs.personModal._open(data.id)
......
......@@ -59,8 +59,7 @@
* 选择原始记录模板(实验室的)
*/
import TwoCard from '../../../components/base/TwoCard'
import { meterPrint, meterSample } from '../../../api'
import Global from '../../../api/config'
import { meterPrint } from '../../../api'
import RecordIframe from './RecordIframe'
import OriginalRecordClassTree from './OriginalRecordClassTree'
......@@ -99,7 +98,7 @@ export default {
},
mounted() {
// 监听原始记录消息
window.addEventListener('message', this._saveOriginal)
// window.addEventListener('message', this._saveOriginal)
},
// 销毁监听事件
// beforeDestroy() {
......@@ -107,36 +106,6 @@ export default {
// window.removeEventListener('message', this._saveOriginal)
// },
methods: {
async _saveOriginal(data) {
console.log('data222', data)
if (this.again) {
this.again = false
if (undefined !== data.data.msg && data.data.msg === true) {
this._cancel()
} else if (
undefined === data.data.templateId &&
data.data.msg !== undefined
) {
const result = await meterSample.certificateOk({
sampleId: this.sampleId,
formId: data.data.msg
})
if (result) {
this.$refs.iframeModal._closeIframe()
}
} else {
console.log('保存失败了')
// this.$store
// .dispatch('FoodItem/saveModelForTestBasis', {
// ids: this.itemIds,
// templateId: data.data.templateId
// })
// .then(() => {
// this._cancel()
// })
}
}
},
// 刷新左右数据
_refresh() {
this.formObj = this.$resetFields(this.formObj)
......@@ -215,67 +184,8 @@ export default {
dataSource: this.sampleData
}
console.log(param)
// this.$emit('on-result-change', param)
this._iframeModal()
}
},
_iframeModal() {
const client =
undefined === this.sampleData.client ? '' : this.sampleData.client
const name =
undefined === this.sampleData.name ? '' : this.sampleData.name
const spec =
undefined === this.sampleData.spec ? '' : this.sampleData.spec
const factoryNumber =
undefined === this.sampleData.factoryNumber
? ''
: this.sampleData.factoryNumber
const manufacturer =
undefined === this.sampleData.manufacturer
? ''
: this.sampleData.manufacturer
const verification =
undefined === this.sampleData.verification
? ''
: this.sampleData.verification
this.again = true
this.showDiagramModal = true
let baseUrl = Global.baseURL
baseUrl +=
'/meter/v1/sample/certificate_record_data_bind?sampleId=' +
this.sampleId +
'&modelId=' +
this.selectData[0].id
const url =
'http://record.patzn.com:7000/print/v1/eln/template_meter_' +
this.selectData[0].id +
'?client=' +
client +
'&spec=' +
spec +
'&factoryNumber=' +
factoryNumber +
'&manufacturer=' +
manufacturer +
'&verification=' +
verification +
'&name=' +
name +
'&bindUri=' +
encodeURIComponent(baseUrl)
const param = {
sampleId: this.sampleId,
tempId: this.selectData[0].id,
client: client,
spec: spec,
name: name,
factoryNumber: factoryNumber,
manufacturer: manufacturer,
verification: verification,
bindUri: encodeURIComponent(baseUrl)
// dataSource: this.sampleData
this.$emit('on-result-change', param)
}
this.$refs.iframeModal._createIframe(url, param)
},
_recordChange() {
this.$emit('on-result-change')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment