Commit 9b78fc63 by lichengming

修改了证书编制

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