Commit 301a4552 by wangweidong

计量证书修改

parent 88ff64b8
...@@ -194,6 +194,18 @@ export default { ...@@ -194,6 +194,18 @@ export default {
http.post('meter/v1/sample/submit_receive?ids=' + data).then(res => res), http.post('meter/v1/sample/submit_receive?ids=' + data).then(res => res),
toReportCheck: data => toReportCheck: data =>
http.post('meter/v1/sample/to_report_check?ids=' + data).then(res => res), http.post('meter/v1/sample/to_report_check?ids=' + data).then(res => res),
selectToReportCheck: data =>
http
.post(
'meter/v1/sample/select_to_report_check?ids=' +
data.ids +
'&userId=' +
data.userId +
'&user=' +
data.user
)
.then(res => res),
toReportMake: data => toReportMake: data =>
http.post('meter/v1/sample/to_report_make?ids=' + data).then(res => res), http.post('meter/v1/sample/to_report_make?ids=' + data).then(res => res),
taskTransfer: data => taskTransfer: data =>
...@@ -321,5 +333,10 @@ export default { ...@@ -321,5 +333,10 @@ export default {
) )
.then(res => res), .then(res => res),
getCertificateReport: data => getCertificateReport: data =>
http.post('meter/v1/sample/get_certificate_report?sampleId=' + data) http.post('meter/v1/sample/get_certificate_report?sampleId=' + data),
generatePdfAuto: data =>
http.get('meter/v1/report/generate_pdf_auto?id=' + data),
pageCertificate: data =>
http.post('meter/v1/report/page', data).then(res => res)
} }
...@@ -99,6 +99,11 @@ export default { ...@@ -99,6 +99,11 @@ export default {
id: '', id: '',
name: '在线查看证书' name: '在线查看证书'
}, },
{
type: 'ios-book',
id: '',
name: '预览pdf'
},
// { // {
// type: 'ios-list-box', // type: 'ios-list-box',
// id: '', // id: '',
...@@ -267,8 +272,8 @@ export default { ...@@ -267,8 +272,8 @@ export default {
case '在线查看证书': case '在线查看证书':
this._reportMakeLook(data) this._reportMakeLook(data)
break break
case '资质项目': case '预览pdf':
this._itemModal(data.id) this._pdfPreview(data.id)
break break
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
...@@ -290,13 +295,21 @@ export default { ...@@ -290,13 +295,21 @@ export default {
this._itemOriginalRecordLook(data) this._itemOriginalRecordLook(data)
} }
}, },
_pdfPreview: async function(id) {
const result = await meterSample.generatePdfAuto(id)
if (result) {
this.$pdfView(result)
}
},
_viewReport(data) { _viewReport(data) {
if (data) { if (data) {
this.$openWindowModeless({ this.$openWindowModeless({
objectKey: data.objectKey, objectKey: data.objectKey,
idType: 10, idType: 10,
id: data.id, id: data.id,
isReport: 4 isReport: 5
}) })
} }
}, },
......
...@@ -265,7 +265,7 @@ export default { ...@@ -265,7 +265,7 @@ export default {
objectKey: data.objectKey, objectKey: data.objectKey,
idType: 10, idType: 10,
id: data.id, id: data.id,
isReport: 4 isReport: 5
}) })
} }
}, },
......
...@@ -275,7 +275,7 @@ export default { ...@@ -275,7 +275,7 @@ export default {
objectKey: data.objectKey, objectKey: data.objectKey,
idType: 10, idType: 10,
id: data.id, id: data.id,
isReport: 4 isReport: 5
}) })
} }
}, },
......
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ 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: 'reportCode', width: 120 }, { title: '证书编号', key: 'reportCode', width: 150 },
{ title: '型号规格', key: 'spec', width: 100 }, { title: '型号规格', key: 'spec', width: 100 },
{ title: '出厂编号', key: 'factoryNumber' }, { title: '出厂编号', key: 'factoryNumber' },
{ title: '检测类型', key: 'type', width: 100 }, { title: '检测类型', key: 'type', width: 100 },
...@@ -276,7 +276,7 @@ export default { ...@@ -276,7 +276,7 @@ export default {
objectKey: data.objectKey, objectKey: data.objectKey,
idType: 10, idType: 10,
id: data.id, id: data.id,
isReport: 4 isReport: 5
}) })
} }
}, },
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
</div> </div>
</div> </div>
<CertificateMake ref="itemOriginalRecordModal" @on-result-change="_resultRecord"></CertificateMake> <CertificateMake ref="itemOriginalRecordModal" @on-result-change="_resultRecord"></CertificateMake>
<MeterCertificateHisVersion ref="meterCertificateHisVersion" @on-result-change="_page"></MeterCertificateHisVersion>
<CertificateMakeLook ref="itemOriginalRecordLookModal" @on-result-change="_resultRecord"></CertificateMakeLook> <CertificateMakeLook ref="itemOriginalRecordLookModal" @on-result-change="_resultRecord"></CertificateMakeLook>
<CreateReport ref="CreateReport"></CreateReport> <CreateReport ref="CreateReport"></CreateReport>
<SelectOriTempRecord ref="SelectOriTempRecord" @on-result-change="_certificateSelectBack"></SelectOriTempRecord> <SelectOriTempRecord ref="SelectOriTempRecord" @on-result-change="_certificateSelectBack"></SelectOriTempRecord>
...@@ -74,12 +75,14 @@ import operationModal from '../../../components/operation/Operation' ...@@ -74,12 +75,14 @@ import operationModal from '../../../components/operation/Operation'
import CreateReport from './CreateReport' import CreateReport from './CreateReport'
import CarManage from './CarManage' import CarManage from './CarManage'
import InstruMentEdit from './InstrumentEdit' import InstruMentEdit from './InstrumentEdit'
import MeterCertificateHisVersion from './MeterCertificateHisVersion'
import SelectOriTempRecord from './SelectOriTempRecord' import SelectOriTempRecord from './SelectOriTempRecord'
export default { export default {
components: { components: {
CreateReport, CreateReport,
CarManage, CarManage,
InstruMentEdit, InstruMentEdit,
MeterCertificateHisVersion,
operationModal, operationModal,
SelectOriTempRecord, SelectOriTempRecord,
CertificateMake, CertificateMake,
...@@ -104,6 +107,11 @@ export default { ...@@ -104,6 +107,11 @@ export default {
], ],
iconMsg: [ iconMsg: [
{ {
type: 'md-book',
id: '',
name: '历史版本'
},
{
type: 'ios-bookmarks', type: 'ios-bookmarks',
id: '', id: '',
name: '查看证书' name: '查看证书'
...@@ -122,7 +130,7 @@ export default { ...@@ -122,7 +130,7 @@ export default {
{ title: '样品编号', key: 'code', width: 120 }, { title: '样品编号', key: 'code', width: 120 },
{ title: '型号规格', key: 'spec', width: 100 }, { title: '型号规格', key: 'spec', width: 100 },
{ title: '证书是否编制', key: 'onlineReported', width: 120 }, { title: '证书是否编制', key: 'onlineReported', width: 120 },
{ title: '证书编号', key: 'reportCode', width: 120 }, { title: '证书编号', key: 'reportCode', width: 150 },
{ title: '出厂编号', key: 'factoryNumber' }, { title: '出厂编号', key: 'factoryNumber' },
{ title: '检测类型', key: 'type' }, { title: '检测类型', key: 'type' },
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
...@@ -265,6 +273,9 @@ export default { ...@@ -265,6 +273,9 @@ export default {
case '查看证书': case '查看证书':
this._makeCertificate(data) this._makeCertificate(data)
break break
case '历史版本':
this._hisVersion(data)
break
case '仪器领用': case '仪器领用':
this.$refs.InstruEdit._open() this.$refs.InstruEdit._open()
break break
...@@ -296,6 +307,12 @@ export default { ...@@ -296,6 +307,12 @@ export default {
_makeCertificate(data) { _makeCertificate(data) {
this._reportMakeLook(data) this._reportMakeLook(data)
}, },
_hisVersion(data) {
// 管理样品
this.$refs.meterCertificateHisVersion._open(data.id)
},
_reportMakeLook: async function(data) { _reportMakeLook: async function(data) {
const result = await meterSample.getCertificateReport(data.id) const result = await meterSample.getCertificateReport(data.id)
if (result) { if (result) {
......
...@@ -76,11 +76,11 @@ export default { ...@@ -76,11 +76,11 @@ export default {
formId: 'meterCertificatePrintIndexFormId', formId: 'meterCertificatePrintIndexFormId',
searchOpen: true, searchOpen: true,
btn: [ btn: [
// { {
// type: 'success', type: 'success',
// id: '', id: '',
// name: '提交' name: '打印'
// } }
], ],
iconMsg: [ iconMsg: [
// { // {
...@@ -142,8 +142,8 @@ export default { ...@@ -142,8 +142,8 @@ export default {
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '提交': case '打印':
this._submitToReview() this._printExcel()
break break
case '退回': case '退回':
this._goBack() this._goBack()
...@@ -157,18 +157,12 @@ export default { ...@@ -157,18 +157,12 @@ export default {
_submitToReview() { _submitToReview() {
this._submitByContractIds() this._submitByContractIds()
}, },
_submitByContractIds() { _printExcel() {
const ids = this.selectIds const ids = this.selectIds
if (ids.length === 0) { if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!') this.$Message.warning('请至少选择一条数据!')
} else { } else {
this.$Modal.confirm({ this.$pageofficePrint({ ids: ids, type: 'xlsx' })
title: '提示',
content: '确定提交吗?',
onOk: () => {
this._submitEnd(ids)
}
})
} }
}, },
...@@ -229,7 +223,7 @@ export default { ...@@ -229,7 +223,7 @@ export default {
objectKey: data.objectKey, objectKey: data.objectKey,
idType: 10, idType: 10,
id: data.id, id: data.id,
isReport: 4 isReport: 5
}) })
} }
}, },
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<CertificateMake ref="itemOriginalRecordModal" @on-result-change="_resultRecord"></CertificateMake> <CertificateMake ref="itemOriginalRecordModal" @on-result-change="_resultRecord"></CertificateMake>
<!--编辑证书--> <!--编辑证书-->
<CertificateMakeLook ref="itemOriginalRecordLookModal" @on-result-change="_resultRecord"></CertificateMakeLook> <CertificateMakeLook ref="itemOriginalRecordLookModal" @on-result-change="_resultRecord"></CertificateMakeLook>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson>
</div> </div>
</template> </template>
<script> <script>
...@@ -76,6 +76,7 @@ import { meterDevice, meterSample } from '../../../api' ...@@ -76,6 +76,7 @@ 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 CertificateMake from '../../meter-certificate/CertificateMake'
import CertificateMakeLook from '../../meter-certificate/CertificateMakeLook' import CertificateMakeLook from '../../meter-certificate/CertificateMakeLook'
import assignPerson from '../../../components/user-info-single/assignPerson'
import MeterSubcontractorEdit from './MeterGoOutTestEdit' import MeterSubcontractorEdit from './MeterGoOutTestEdit'
import CarManage from './CarManage' import CarManage from './CarManage'
import MeterPersonItemTaskManage from './MeterPersonItemTaskManage' import MeterPersonItemTaskManage from './MeterPersonItemTaskManage'
...@@ -92,6 +93,7 @@ export default { ...@@ -92,6 +93,7 @@ export default {
CarManage, CarManage,
MeterPersonItemTaskManage, MeterPersonItemTaskManage,
SelEquip, SelEquip,
assignPerson,
InstruMentEdit InstruMentEdit
}, },
data() { data() {
...@@ -110,6 +112,12 @@ export default { ...@@ -110,6 +112,12 @@ export default {
id: 'meter-sample-input-submit-btn', id: 'meter-sample-input-submit-btn',
name: '提交' name: '提交'
}, },
{
type: 'success',
id: '',
name: '提交至审核'
},
{ {
type: 'success', type: 'success',
id: 'meter-sample-input-submit-create-btn', id: 'meter-sample-input-submit-create-btn',
...@@ -204,6 +212,9 @@ export default { ...@@ -204,6 +212,9 @@ export default {
case '提交': case '提交':
this._submitToReportReview() this._submitToReportReview()
break break
case '提交至审核':
this._selectToReportReview()
break
case '提交至证书编制': case '提交至证书编制':
this._submitToReportMake() this._submitToReportMake()
break break
...@@ -236,7 +247,10 @@ export default { ...@@ -236,7 +247,10 @@ export default {
this.$Message.warning('请至少选择一条数据!') this.$Message.warning('请至少选择一条数据!')
} else { } else {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
if (data[i].recordId === undefined) { if (
data[i].onlineReported === undefined ||
data[i].onlineReported === '否'
) {
this.$Message.warning( this.$Message.warning(
'您选择的样品编号为' + data[i].code + '暂未编制证书,无法提交!' '您选择的样品编号为' + data[i].code + '暂未编制证书,无法提交!'
) )
...@@ -252,6 +266,45 @@ export default { ...@@ -252,6 +266,45 @@ export default {
}) })
} }
}, },
_selectToReportReview() {
const ids = this.selectIds
const data = this.selectData
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
for (let i = 0; i < data.length; i++) {
if (
data[i].onlineReported === undefined ||
data[i].onlineReported === '否'
) {
this.$Message.warning(
'您选择的样品编号为' + data[i].code + '暂未编制证书,无法提交!'
)
return false
}
}
this.$refs.userModal._open('salesman')
}
},
_userData(data, msg) {
if (msg === 'salesman') {
this._distributeCertificateCheck(data)
}
},
_distributeCertificateCheck: async function(data) {
const result = await meterSample.selectToReportCheck({
ids: this.selectIds,
userId: data.id,
user: data.realname
})
if (result) {
await this._page()
this.$Message.success('分配成功!')
}
},
_submitReportCheck: async function(ids) { _submitReportCheck: async function(ids) {
const result = await meterSample.toReportCheck(ids) const result = await meterSample.toReportCheck(ids)
if (result) { if (result) {
......
...@@ -162,7 +162,7 @@ export default { ...@@ -162,7 +162,7 @@ export default {
{ title: '样品名称', key: 'name', width: 120 }, { title: '样品名称', key: 'name', width: 120 },
{ title: '样品编号', key: 'code', width: 120 }, { title: '样品编号', key: 'code', width: 120 },
{ title: '证书是否编制', key: 'onlineReported', width: 120 }, { title: '证书是否编制', key: 'onlineReported', width: 120 },
{ title: '证书编号', key: 'reportCode', width: 130 }, { title: '证书编号', key: 'reportCode', width: 140 },
{ title: '型号规格', key: 'spec', width: 115 }, { title: '型号规格', key: 'spec', width: 115 },
{ title: '出厂编号', key: 'factoryNumber', width: 115 }, { title: '出厂编号', key: 'factoryNumber', width: 115 },
{ title: '制造厂商', key: 'manufacturer', width: 125 }, { title: '制造厂商', key: 'manufacturer', width: 125 },
......
...@@ -845,6 +845,23 @@ Vue.prototype.$openWindowModeless = function(data) { ...@@ -845,6 +845,23 @@ Vue.prototype.$openWindowModeless = function(data) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
return POBrowser.openWindowModeless(uri, 'width=1200px;height=800px;') return POBrowser.openWindowModeless(uri, 'width=1200px;height=800px;')
} }
Vue.prototype.$pdfView = function(data) {
if (data) {
// 根据objectKey下载pdf
const fileUrl = encodeURIComponent(
global.baseURL + '/print/v1/download?objectKey='
)
const uri =
global.staticURL +
'/pdf/PDFJS/pdfjs/web/viewer.html?file=' +
fileUrl +
data
return window.open(uri, '_blank')
} else {
this.$Message.warning('暂无PDF生成,不可预览~')
}
}
/** /**
* pageoffice(打印word,pdf(待定)) * pageoffice(打印word,pdf(待定))
* id * id
...@@ -852,15 +869,30 @@ Vue.prototype.$openWindowModeless = function(data) { ...@@ -852,15 +869,30 @@ Vue.prototype.$openWindowModeless = function(data) {
*/ */
Vue.prototype.$pageofficePrint = function(data) { Vue.prototype.$pageofficePrint = function(data) {
// id 为样品id或者委托id // id 为样品id或者委托id
const companyId = global.getUserInfo().companyId
const realname = encodeURI(encodeURI(global.getUserInfo().realname))
const userId = global.getUserInfo().id
const locaName = encodeURI('报告')
// id 为报告id或者委托id
const type = encodeURI(data.type)
const ids = data.ids.join(',')
const uri = const uri =
global.baseURL + global.baseURL +
'/print/v1/batch_print' + '/print/v1/batch_print_meter' +
'?sysMark=' + '?sysMark=' +
global.getCode() + global.getCode() +
'&location=' +
locaName +
'&companyId=' +
companyId +
'&userId=' +
userId +
'&username=' +
realname +
'&printType=' + '&printType=' +
data.type + type +
'&businessIds=' + '&businessIds=' +
data.id ids
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
return POBrowser.openWindowModeless(uri, 'width=350px;height=300px;') return POBrowser.openWindowModeless(uri, 'width=350px;height=300px;')
} }
......
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