Commit 2f70f58b by wangweidong

计量证书修改

parent bce6c3be
......@@ -72,7 +72,7 @@
<InstruMentEdit ref="InstruEdit"></InstruMentEdit>
<operationModal ref="operationModal"></operationModal>
<FileManage ref="FileManage"></FileManage>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson>
<SelectOriTempRecordExcel ref="SelectOriTempRecordExcel" @on-result-change="_certificateSelectExcelBack"></SelectOriTempRecordExcel>
</div>
</template>
......@@ -82,6 +82,7 @@ import CertificateMakeLook from '../../meter-certificate/CertificateMakeLook'
import { meterSample } from '../../../api'
import operationModal from '../../../components/operation/Operation'
import SelectOriTempRecordExcel from '../../meter-send/sample-input/SelectOriTempRecordExcel'
import assignPerson from '../../../components/user-info-single/assignPerson'
import CreateReport from './CreateReport'
import CarManage from './CarManage'
import InstruMentEdit from './InstrumentEdit'
......@@ -90,6 +91,7 @@ export default {
components: {
CreateReport,
CarManage,
assignPerson,
InstruMentEdit,
SelectOriTempRecordExcel,
operationModal,
......@@ -103,11 +105,11 @@ export default {
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
// {
// type: 'success',
// id: '',
// name: '生成'
// },
{
type: 'success',
id: '',
name: '提交至审核'
},
{
type: 'success',
id: '',
......@@ -192,6 +194,9 @@ export default {
case '提交':
this._submitToCheck()
break
case '提交至审核':
this._selectToReportReview()
break
case '添加':
this._editModal(false)
break
......@@ -201,6 +206,43 @@ 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('分配成功!')
}
},
_certificateSelectBack(data) {
if (data) {
// this.$refs.itemOriginalRecordModal._open(
......
......@@ -73,49 +73,49 @@ export default {
btn: [
{
type: 'success',
id: 'meter-go-out-entrust-add',
id: '',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-review',
id: '',
name: '提交评审'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit',
id: '',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: 'meter-go-out-entrust-edit-o',
id: '',
name: '编辑'
},
{
type: 'ios-beaker',
id: 'meter-go-out-entrust-sample-manage-o',
id: '',
name: '管理样品'
},
{
type: 'md-cloud',
id: 'meter-go-out-entrust-accessory-o',
id: '',
name: '附件'
},
{
type: 'md-document',
id: 'meter-go-out-entrust-export-entrust-o',
id: '',
name: '导出委托单'
},
{
type: 'md-remove-circle',
id: 'meter-go-out-entrust-remove-o',
id: '',
name: '删除'
},
{
type: 'ios-clock',
id: 'meter-go-out-entrust-record-o',
id: '',
name: '操作日志'
}
],
......
......@@ -71,6 +71,7 @@
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<CertificateMakeLook ref="itemOriginalRecordLookModal" @on-result-change="_resultRecord"></CertificateMakeLook>
<SelectOriTempRecordExcel ref="SelectOriTempRecordExcel" @on-result-change="_certificateSelectExcelBack"></SelectOriTempRecordExcel>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson>
</div>
</template>
<script>
......@@ -80,6 +81,7 @@ import SelEquip from '../../../components/select-equip/SelEquip'
import operationModal from '../../../components/operation/Operation'
import CertificateMakeLook from '../../meter-certificate/CertificateMakeLook'
import SelectOriTempRecordExcel from '../../meter-send/sample-input/SelectOriTempRecordExcel'
import assignPerson from '../../../components/user-info-single/assignPerson'
import MeterSubcontractorEdit from './MeterGoOutTestEdit'
import CarManage from './CarManage'
import MeterPersonItemTaskManage from './MeterPersonItemTaskManage'
......@@ -89,6 +91,7 @@ import SelectOriTempRecord from './SelectOriTempRecord'
export default {
components: {
CertificateMake,
assignPerson,
CertificateMakeLook,
SelectOriTempRecordExcel,
SelectOriTempRecord,
......@@ -118,6 +121,11 @@ export default {
},
{
type: 'success',
id: '',
name: '提交至审核'
},
{
type: 'success',
id: 'meter-out-personal-task-submit',
name: '提交'
},
......@@ -229,6 +237,9 @@ export default {
case '提交':
this._submitToReportReview()
break
case '提交至审核':
this._selectToReportReview()
break
case '提交至证书编制':
this._submitToReportMake()
break
......@@ -238,6 +249,43 @@ 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('分配成功!')
}
},
_docimasy() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......
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