Commit 3325fc94 by wangweidong

证书编制修改

parent b82a8c38
...@@ -176,6 +176,26 @@ export default { ...@@ -176,6 +176,26 @@ export default {
) )
.then(res => res), .then(res => res),
certificateOk: data =>
http
.post(
'meter/v1/sample/certificate_record?sampleId=' +
data.sampleId +
'&formId=' +
data.formId
)
.then(res => res),
certificateEdit: data =>
http
.post(
'meter/v1/sample/certificate_record_edit?sampleId=' +
data.sampleId +
'&formId=' +
data.formId
)
.then(res => res),
distributeOutSample: data => distributeOutSample: data =>
http http
.post( .post(
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</template> </template>
<script> <script>
import global from '../../api/config' import global from '../../api/config'
import { meterPrint } from '../../api' import { meterSample } from '../../api'
/** /**
* 原始记录填写 * 原始记录填写
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
showDiagramModal: false, showDiagramModal: false,
templateId: '', templateId: '',
again: false, again: false,
itemIds: [] sampleId: ''
} }
}, },
mounted() { mounted() {
...@@ -39,8 +39,8 @@ export default { ...@@ -39,8 +39,8 @@ export default {
undefined === data.data.templateId && undefined === data.data.templateId &&
data.data.msg !== undefined data.data.msg !== undefined
) { ) {
const result = await meterPrint.originalRecordsAdd({ const result = await meterSample.certificateOk({
ids: this.itemIds, sampleId: this.sampleId,
formId: data.data.msg formId: data.data.msg
}) })
if (result) { if (result) {
...@@ -62,50 +62,40 @@ export default { ...@@ -62,50 +62,40 @@ export default {
this.showDiagramModal = false this.showDiagramModal = false
this.$emit('on-result-change') this.$emit('on-result-change')
}, },
_open(itemIds, modelId, dataSource) { _open(sampleId, modelId, dataSource) {
console.log(dataSource) const client = undefined === dataSource.client ? '' : dataSource.client
const num = const name = undefined === dataSource.name ? '' : dataSource.name
undefined === dataSource[0].sampleCode ? '' : dataSource[0].sampleCode const spec = undefined === dataSource.spec ? '' : dataSource.spec
const name = const factoryNumber =
undefined === dataSource[0].sampleName ? '' : dataSource[0].sampleName undefined === dataSource.factoryNumber ? '' : dataSource.factoryNumber
const testBasis = const manufacturer =
undefined === dataSource[0].testBasis ? '' : dataSource[0].testBasis undefined === dataSource.manufacturer ? '' : dataSource.manufacturer
let itemNames = '' const verification =
const length = dataSource.length undefined === dataSource.verification ? '' : dataSource.verification
let itemUrl = ''
for (let i = 0; i < length; i++) {
if (undefined !== dataSource[i].name && dataSource[i].name !== '') {
itemNames += dataSource[i].name + '、'
itemUrl += '&item' + (i + 1) + '=' + dataSource[i].name
}
}
console.log('itemUrl', itemUrl)
if (itemNames.length > 0) {
itemNames = itemNames.substring(0, itemNames.length - 1)
}
this.again = true this.again = true
this.itemIds = itemIds this.sampleId = sampleId
console.log('this.itemIds', this.itemIds)
this.showDiagramModal = true this.showDiagramModal = true
let baseUrl = global.baseURL let baseUrl = global.baseURL
baseUrl += baseUrl +=
'/llgt/v1/item/original_record_data_bind?ids=' + '/meter/v1/sample/certificate_record_data_bind?sampleId=' +
this.itemIds + this.sampleId +
'&modelId=' + '&modelId=' +
modelId modelId
const url = const url =
'http://record.patzn.com:7000/print/v1/eln/template_' + 'http://record.patzn.com:7000/print/v1/eln/template_' +
modelId + modelId +
'?num=' + '?client=' +
num + client +
'&itemNames=' + '&spec=' +
itemNames + spec +
'&factoryNumber=' +
factoryNumber +
'&manufacturer=' +
manufacturer +
'&verification=' +
verification +
'&name=' + '&name=' +
name + name +
'&testBasis=' +
encodeURIComponent(testBasis) +
'&bindUri=' + '&bindUri=' +
encodeURIComponent(baseUrl) encodeURIComponent(baseUrl)
$('#iframeOne').html( $('#iframeOne').html(
......
<template>
<div>
<Modal v-model="showDiagramModalSampleLook" title="检定(校准)证书" width="1300" class="footer-hidden">
<div id="iframeSampleLookThree" style="text-align:center;align-content:center;width: 100%;height: 790px">
</div>
<div slot="footer">
</div>
</Modal>
</div>
</template>
<script>
/**
* 详情
*/
import { meterSample } from '../../api'
export default {
data() {
return {
showDiagramModalSampleLook: false,
templateId: '',
formId: '',
again: true,
sampleId: '',
name: ''
}
},
mounted() {
// 监听原始记录消息
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._cancel()
} else {
this._cancel()
}
}
},
_cancel() {
this.showDiagramModalSampleLook = false
this.$emit('on-result-change')
},
_open(formId, name, sampleId) {
console.log(sampleId)
console.log(formId)
console.log(name)
this.again = true
this.formId = formId
this.showDiagramModalSampleLook = true
this.sampleId = sampleId
this.name = name
let url = ''
url =
name !== 'only'
? 'http://record.patzn.com:7000/print/v1/eln/form_' + 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>'
)
}
}
}
</script>
...@@ -6,24 +6,24 @@ ...@@ -6,24 +6,24 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-item" label="资质:"> <Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/> <Input v-model="formObj.aptitude" name="aptitude" placeholder="请输入资质" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
...@@ -61,13 +61,22 @@ ...@@ -61,13 +61,22 @@
<CarManage ref="carEdit"></CarManage> <CarManage ref="carEdit"></CarManage>
<InstruMentEdit ref="InstruEdit"></InstruMentEdit> <InstruMentEdit ref="InstruEdit"></InstruMentEdit>
<MeterPersonItemTaskManage ref="personModal"></MeterPersonItemTaskManage> <MeterPersonItemTaskManage ref="personModal"></MeterPersonItemTaskManage>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit> <MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_page"></MeterSubcontractorEdit>
<SelectOriTempRecord ref="SelectOriTempRecord"></SelectOriTempRecord> <SelectOriTempRecord ref="SelectOriTempRecord" @on-result-change="_certificateSelectBack"></SelectOriTempRecord>
<!--自定义编制证书-->
<CertificateMake ref="itemOriginalRecordModal" @on-result-change="_resultRecord"></CertificateMake>
<!--编辑证书-->
<CertificateMakeLook ref="itemOriginalRecordLookModal" @on-result-change="_resultRecord"></CertificateMakeLook>
</div> </div>
</template> </template>
<script> <script>
import { meterDevice, meterSample } from '../../../api' import { meterDevice, meterSample } from '../../../api'
import SelEquip from '../../../components/select-equip/SelEquip' import SelEquip from '../../../components/select-equip/SelEquip'
import CertificateMake from '../../meter-certificate/CertificateMake'
import CertificateMakeLook from '../../meter-certificate/CertificateMakeLook'
import MeterSubcontractorEdit from './MeterGoOutTestEdit' import MeterSubcontractorEdit from './MeterGoOutTestEdit'
import CarManage from './CarManage' import CarManage from './CarManage'
import MeterPersonItemTaskManage from './MeterPersonItemTaskManage' import MeterPersonItemTaskManage from './MeterPersonItemTaskManage'
...@@ -77,6 +86,8 @@ export default { ...@@ -77,6 +86,8 @@ export default {
components: { components: {
SelectOriTempRecord, SelectOriTempRecord,
MeterSubcontractorEdit, MeterSubcontractorEdit,
CertificateMake,
CertificateMakeLook,
CarManage, CarManage,
MeterPersonItemTaskManage, MeterPersonItemTaskManage,
SelEquip, SelEquip,
...@@ -142,13 +153,16 @@ export default { ...@@ -142,13 +153,16 @@ export default {
pageColumns: [ pageColumns: [
{ title: '样品名称', key: 'name', width: 120 }, { title: '样品名称', key: 'name', width: 120 },
{ title: '样品编号', key: 'code', width: 120 }, { title: '样品编号', key: 'code', width: 120 },
{ title: '型号规格', key: 'spec' }, { title: '证书是否编制', key: 'onlineReported', width: 120 },
{ title: '出厂编号', key: 'factoryNumber' }, { title: '型号规格', key: 'spec', width: 115 },
{ title: '检测类型', key: 'type' }, { title: '出厂编号', key: 'factoryNumber', width: 115 },
{ title: '制造厂商', key: 'manufacturer', width: 125 },
{ title: '检定依据', key: 'verification', width: 155 },
{ title: '检测类型', key: 'type', width: 115 },
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, // { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, // { title: '联系电话', key: 'tel', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, // { title: '详细地址', key: 'address', width: 250 },
{ title: '数量', key: 'quantity' }, { title: '数量', key: 'quantity' },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
] ]
...@@ -192,6 +206,11 @@ export default { ...@@ -192,6 +206,11 @@ export default {
_carManage() { _carManage() {
this.$refs.carEdit._open() this.$refs.carEdit._open()
}, },
// 追填原始记录 回调
_resultRecord() {
this._page()
this.$emit('on-result-change')
},
_receiveApparatus() { _receiveApparatus() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!') this.$Message.warning('请至少选择一条数据!')
...@@ -224,7 +243,7 @@ export default { ...@@ -224,7 +243,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '编制证书': case '编制证书':
this.$refs.SelectOriTempRecord._open(data.id) this._makeCertificate(data)
break break
case '仪器领用': case '仪器领用':
this.$refs.InstruEdit._open() this.$refs.InstruEdit._open()
...@@ -251,6 +270,30 @@ export default { ...@@ -251,6 +270,30 @@ export default {
} }
}) })
}, },
_makeCertificate(data) {
if (data.onlineReported === '否' || undefined === data.recordId) {
this.$refs.SelectOriTempRecord._open(data.id, data)
} else {
this._itemOriginalRecordLook(data, 'write')
}
},
_itemOriginalRecordLook(data, name) {
if (
data.recordId === null ||
undefined === data.recordId ||
data.recordId === ''
) {
this.$Message.warning('该检测项目暂无原始记录!')
} else {
this.$refs.itemOriginalRecordLookModal._open(
data.recordId,
name,
data.id
)
}
},
_personModal(data) { _personModal(data) {
console.log(data) console.log(data)
this.$refs.personModal._open(data.id) this.$refs.personModal._open(data.id)
...@@ -303,6 +346,23 @@ export default { ...@@ -303,6 +346,23 @@ export default {
this.getPage = result this.getPage = result
} }
}, },
_certificateSelectBack(data) {
if (data) {
this.$refs.itemOriginalRecordModal._open(
data.sampleId,
data.tempId,
data.dataSource
)
} else {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
// this._appendOriginalRecord()
}
}
},
_formSearch() { _formSearch() {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Modal v-model="showModal" v-drag width="1100"> <Modal v-model="showModal" v-drag width="1100">
<p slot="header">选择原始记录模板</p> <p slot="header">选择原始记录模板</p>
<div> <div>
<TwoCard @on-result-change="_refresh" :gutter=16 left-name="原始记录模板类别" right-name="实验室原始记录模板名称" left-span="8"> <TwoCard :gutter=16 left-name="原始记录模板类别" right-name="实验室原始记录模板名称" left-span="8" @on-result-change="_refresh">
<template slot="left"> <template slot="left">
<OriginalRecordClassTree ref="classTree" @on-result-change="_classData"></OriginalRecordClassTree> <OriginalRecordClassTree ref="classTree" @on-result-change="_classData"></OriginalRecordClassTree>
</template> </template>
...@@ -14,25 +14,25 @@ ...@@ -14,25 +14,25 @@
<Form :label-width="50" inline onsubmit="return false"> <Form :label-width="50" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="名称:"> <Form-item label="名称:">
<Input v-model="formObj.title" @on-enter="_search" placeholder="请输入名称" style="width: 200px" <Input v-model="formObj.title" placeholder="请输入名称" style="width: 200px" clearable
clearable/> @on-enter="_search"/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button> <Button type="primary" @click="_search">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :height="300" <PTVXETable ref="pageTable" :height="300"
@on-result-change="_tableResultChange" :getPage="getPage" :isRadio="true" hide-checkbox> :get-page="getPage" :is-radio="true" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="(item,index) in pageColumns"
:key="index"
:field="item.key" :field="item.key"
:title="item.title" :title="item.title"
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" :fixed="item.fixed?item.fixed:undefined" sortable>
v-for="(item,index) in pageColumns"
:key="index" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.key==='ctime'"> <div v-if="item.key==='ctime'">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}} {{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</TwoCard> </TwoCard>
</div> </div>
<div slot="footer"> <div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div> </div>
</Modal> </Modal>
<!--自定义post请求iframe--> <!--自定义post请求iframe-->
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
/** /**
* 选择原始记录模板(实验室的) * 选择原始记录模板(实验室的)
*/ */
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'
...@@ -82,7 +81,8 @@ export default { ...@@ -82,7 +81,8 @@ export default {
// businessTypeList: 0 // businessTypeList: 0
}, },
selectData: [], selectData: [],
itemIds: [], sampleId: '',
sampleData: '',
footerList: [ footerList: [
{ id: '', name: '取消', type: '' }, { id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' } { id: '', name: '确定', type: 'primary' }
...@@ -139,25 +139,18 @@ export default { ...@@ -139,25 +139,18 @@ export default {
_hideLoading() { _hideLoading() {
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
}, },
_open(ids) { _open(sampleId, data) {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
console.log('852369', this.formObj)
this._classTree() this._classTree()
this.showModal = true this.showModal = true
this.itemIds = ids this.sampleId = sampleId
// this.formObj.businessTypeList = 0 this.sampleData = data
this._page() this._page()
this.selectData = [] this.selectData = []
this._hideLoading() this._hideLoading()
count = 0 count = 0
}, },
_page: async function(data) { _page: async function(data) {
// 只查实验室的
// this.$refs.pageTable._page(
// '',
// 'ElnTemplate/page',
// this.$serializeFormSearch(this.formObj)
// )
const result = await meterPrint.pageSampleTemplate(data) const result = await meterPrint.pageSampleTemplate(data)
if (result) { if (result) {
this.getPage = result this.getPage = result
...@@ -169,17 +162,9 @@ export default { ...@@ -169,17 +162,9 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page': case 'singleSelect':
this.selectData = []
this.getPage = this.$store.state.ElnTemplate.page
break
case 'radioSelect':
this.selectData = [data] this.selectData = [data]
break break
case 'dbSelect':
this.selectData = [data]
this._ok()
break
case 'changeSize': case 'changeSize':
this._page() this._page()
break break
...@@ -192,71 +177,13 @@ export default { ...@@ -192,71 +177,13 @@ export default {
} else { } else {
// 校验多样品多项目原始记录模板 // 校验多样品多项目原始记录模板
const param = { const param = {
ids: this.itemIds.join(','), sampleId: this.sampleId,
tempId: this.selectData[0].id tempId: this.selectData[0].id,
dataSource: this.sampleData
} }
this.$store.dispatch('EnvItem/checkLimit', param).then(() => { this.$emit('on-result-change', param)
const result = this.$store.state.EnvItem.success
if (result) {
// 不是多样品项目模板或者数量小于限值,填写原始记录
// (3)originalTemplateId不为0也不为undefined ---- 填写过或者绑定过
this._bindOriginalRecord()
} else {
this.$msgTip('warning', '所选数据超过,原始记录模板设置最大值!')
this._hideLoading()
}
})
} }
}, },
// 生成原始记录
_bindOriginalRecord() {
this.$store
.dispatch('EnvItem/allCommonSampleCount', {
ids: this.itemIds.join(',')
})
.then(() => {
const result = this.$store.state.EnvItem.list
let allSampleCount = ''
let normalSampleCount = ''
let itemCount = ''
let parallel = ''
let labelSample = ''
result.forEach(item => {
if (item.sampleCountType === 'all') {
allSampleCount = item.sampleCountInteger
} else if (item.sampleCountType === 'normal') {
normalSampleCount = item.sampleCountInteger
} else if (item.sampleCountType === 'item') {
itemCount = item.sampleCountInteger
} else if (item.sampleCountType === 'parallel') {
parallel = item.sampleCountInteger
} else if (item.sampleCountType === 'mark') {
labelSample = item.sampleCountInteger
}
})
this.showModal = false
const url =
Global.recordURL +
'/print/v1/eln/template_YT_' +
this.selectData[0].id
const params = {
ids: this.itemIds.join(','),
allSampleCount: allSampleCount,
normalSampleCount: normalSampleCount,
itemCount: itemCount,
parallelCount: parallel,
labelSample: labelSample
}
this.$refs.iframeModal._createIframe(url, params)
localStorage.setItem('recordStatus', 'addLabRecord')
// this.$layx('recordAddTemplate', '原始记录添加', Global.recordURL + '/print/v1/eln/template_YT_'
// + this.selectData[0].id
// + '?bindUri=' + encodeURIComponent(bindUri))
})
},
_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