Commit 3325fc94 by wangweidong

证书编制修改

parent b82a8c38
......@@ -176,6 +176,26 @@ export default {
)
.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 =>
http
.post(
......
......@@ -10,7 +10,7 @@
</template>
<script>
import global from '../../api/config'
import { meterPrint } from '../../api'
import { meterSample } from '../../api'
/**
* 原始记录填写
......@@ -21,7 +21,7 @@ export default {
showDiagramModal: false,
templateId: '',
again: false,
itemIds: []
sampleId: ''
}
},
mounted() {
......@@ -39,8 +39,8 @@ export default {
undefined === data.data.templateId &&
data.data.msg !== undefined
) {
const result = await meterPrint.originalRecordsAdd({
ids: this.itemIds,
const result = await meterSample.certificateOk({
sampleId: this.sampleId,
formId: data.data.msg
})
if (result) {
......@@ -62,50 +62,40 @@ export default {
this.showDiagramModal = false
this.$emit('on-result-change')
},
_open(itemIds, modelId, dataSource) {
console.log(dataSource)
const num =
undefined === dataSource[0].sampleCode ? '' : dataSource[0].sampleCode
const name =
undefined === dataSource[0].sampleName ? '' : dataSource[0].sampleName
const testBasis =
undefined === dataSource[0].testBasis ? '' : dataSource[0].testBasis
let itemNames = ''
const length = dataSource.length
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)
}
_open(sampleId, modelId, dataSource) {
const client = undefined === dataSource.client ? '' : dataSource.client
const name = undefined === dataSource.name ? '' : dataSource.name
const spec = undefined === dataSource.spec ? '' : dataSource.spec
const factoryNumber =
undefined === dataSource.factoryNumber ? '' : dataSource.factoryNumber
const manufacturer =
undefined === dataSource.manufacturer ? '' : dataSource.manufacturer
const verification =
undefined === dataSource.verification ? '' : dataSource.verification
this.again = true
this.itemIds = itemIds
console.log('this.itemIds', this.itemIds)
this.sampleId = sampleId
this.showDiagramModal = true
let baseUrl = global.baseURL
baseUrl +=
'/llgt/v1/item/original_record_data_bind?ids=' +
this.itemIds +
'/meter/v1/sample/certificate_record_data_bind?sampleId=' +
this.sampleId +
'&modelId=' +
modelId
const url =
'http://record.patzn.com:7000/print/v1/eln/template_' +
modelId +
'?num=' +
num +
'&itemNames=' +
itemNames +
'?client=' +
client +
'&spec=' +
spec +
'&factoryNumber=' +
factoryNumber +
'&manufacturer=' +
manufacturer +
'&verification=' +
verification +
'&name=' +
name +
'&testBasis=' +
encodeURIComponent(testBasis) +
'&bindUri=' +
encodeURIComponent(baseUrl)
$('#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 @@
<Row>
<!--查询-->
<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>
<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 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 class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
......@@ -61,13 +61,22 @@
<CarManage ref="carEdit"></CarManage>
<InstruMentEdit ref="InstruEdit"></InstruMentEdit>
<MeterPersonItemTaskManage ref="personModal"></MeterPersonItemTaskManage>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<SelectOriTempRecord ref="SelectOriTempRecord"></SelectOriTempRecord>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_page"></MeterSubcontractorEdit>
<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>
</template>
<script>
import { meterDevice, meterSample } from '../../../api'
import SelEquip from '../../../components/select-equip/SelEquip'
import CertificateMake from '../../meter-certificate/CertificateMake'
import CertificateMakeLook from '../../meter-certificate/CertificateMakeLook'
import MeterSubcontractorEdit from './MeterGoOutTestEdit'
import CarManage from './CarManage'
import MeterPersonItemTaskManage from './MeterPersonItemTaskManage'
......@@ -77,6 +86,8 @@ export default {
components: {
SelectOriTempRecord,
MeterSubcontractorEdit,
CertificateMake,
CertificateMakeLook,
CarManage,
MeterPersonItemTaskManage,
SelEquip,
......@@ -142,13 +153,16 @@ export default {
pageColumns: [
{ title: '样品名称', key: 'name', width: 120 },
{ title: '样品编号', key: 'code', width: 120 },
{ title: '型号规格', key: 'spec' },
{ title: '出厂编号', key: 'factoryNumber' },
{ title: '检测类型', key: 'type' },
{ title: '证书是否编制', key: 'onlineReported', width: 120 },
{ title: '型号规格', key: 'spec', width: 115 },
{ 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: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
// { title: '联系人', key: 'person', width: 120 },
// { title: '联系电话', key: 'tel', width: 120 },
// { title: '详细地址', key: 'address', width: 250 },
{ title: '数量', key: 'quantity' },
{ title: '备注', key: 'remark' }
]
......@@ -192,6 +206,11 @@ export default {
_carManage() {
this.$refs.carEdit._open()
},
// 追填原始记录 回调
_resultRecord() {
this._page()
this.$emit('on-result-change')
},
_receiveApparatus() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......@@ -224,7 +243,7 @@ export default {
this.$nextTick(function() {
switch (res) {
case '编制证书':
this.$refs.SelectOriTempRecord._open(data.id)
this._makeCertificate(data)
break
case '仪器领用':
this.$refs.InstruEdit._open()
......@@ -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) {
console.log(data)
this.$refs.personModal._open(data.id)
......@@ -303,6 +346,23 @@ export default {
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() {
this.$refs.pageTable._pageChange(1)
},
......
......@@ -3,7 +3,7 @@
<Modal v-model="showModal" v-drag width="1100">
<p slot="header">选择原始记录模板</p>
<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">
<OriginalRecordClassTree ref="classTree" @on-result-change="_classData"></OriginalRecordClassTree>
</template>
......@@ -14,25 +14,25 @@
<Form :label-width="50" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="名称:">
<Input v-model="formObj.title" @on-enter="_search" placeholder="请输入名称" style="width: 200px"
clearable/>
<Input v-model="formObj.title" placeholder="请输入名称" style="width: 200px" clearable
@on-enter="_search"/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
<Button type="primary" @click="_search">搜索</Button>
</Form-item>
</Form>
</Col>
<!-- 表格 -->
<Col span="24">
<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
v-for="(item,index) in pageColumns"
:key="index"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="(item,index) in pageColumns"
:key="index" sortable>
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.key==='ctime'">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}
......@@ -47,7 +47,7 @@
</TwoCard>
</div>
<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>
</Modal>
<!--自定义post请求iframe-->
......@@ -58,7 +58,6 @@
/**
* 选择原始记录模板(实验室的)
*/
import Global from '../../../api/config'
import TwoCard from '../../../components/base/TwoCard'
import { meterPrint } from '../../../api'
import RecordIframe from './RecordIframe'
......@@ -82,7 +81,8 @@ export default {
// businessTypeList: 0
},
selectData: [],
itemIds: [],
sampleId: '',
sampleData: '',
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
......@@ -139,25 +139,18 @@ export default {
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(ids) {
_open(sampleId, data) {
this.formObj = this.$resetFields(this.formObj)
console.log('852369', this.formObj)
this._classTree()
this.showModal = true
this.itemIds = ids
// this.formObj.businessTypeList = 0
this.sampleId = sampleId
this.sampleData = data
this._page()
this.selectData = []
this._hideLoading()
count = 0
},
_page: async function(data) {
// 只查实验室的
// this.$refs.pageTable._page(
// '',
// 'ElnTemplate/page',
// this.$serializeFormSearch(this.formObj)
// )
const result = await meterPrint.pageSampleTemplate(data)
if (result) {
this.getPage = result
......@@ -169,17 +162,9 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectData = []
this.getPage = this.$store.state.ElnTemplate.page
break
case 'radioSelect':
case 'singleSelect':
this.selectData = [data]
break
case 'dbSelect':
this.selectData = [data]
this._ok()
break
case 'changeSize':
this._page()
break
......@@ -192,71 +177,13 @@ export default {
} else {
// 校验多样品多项目原始记录模板
const param = {
ids: this.itemIds.join(','),
tempId: this.selectData[0].id
sampleId: this.sampleId,
tempId: this.selectData[0].id,
dataSource: this.sampleData
}
this.$store.dispatch('EnvItem/checkLimit', param).then(() => {
const result = this.$store.state.EnvItem.success
if (result) {
// 不是多样品项目模板或者数量小于限值,填写原始记录
// (3)originalTemplateId不为0也不为undefined ---- 填写过或者绑定过
this._bindOriginalRecord()
} else {
this.$msgTip('warning', '所选数据超过,原始记录模板设置最大值!')
this._hideLoading()
}
})
this.$emit('on-result-change', param)
}
},
// 生成原始记录
_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() {
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