Commit 301a4552 by wangweidong

计量证书修改

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