Files
laws_weilai/jero-web/src/views/projectManagement/components/listOfRegulations.vue
T

1503 lines
53 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<a-card :bordered="false">
<div class="header-text">
{{ $t('DocumentStandard') }}
</div>
<div class="table-page-search-wrapper">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('standard')">
<span>{{ $t('standard') }}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serialNumber"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{ $t('title') }}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.title"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" style="width: 44px" :title="$t('subtitle')">
<span>{{ $t('subtitle') }}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('subtitle')"
v-model="queryParam.subtitle"></j-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<globalAdvancedQuery ref="globalAdvancedQueryRef"
@handleSuperQuery="handleSuperQuery"
:fieldList="fieldList"/>
<a-button class="box-button" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button class="box-button" style="margin-left: 8px"
@click="searchReset">{{ $t('reset') }}</a-button>
</a-col>
</span>
</a-row>
</div>
<div class="table-operator" style="overflow:hidden;">
<div style="float: left;margin-bottom: 10px;margin-left: 20px" v-if="isDisplay">
<div class="operator-text" @click="initiateListConfirmationcClick('清单')">
<a-icon type="solution"/>
{{ $t('initiateListConfirmation') }}
</div>
<div class="operator-text" @click="initiateTaskConfirmationClick('任务')">
<a-icon type="file-protect"/>
{{ $t('initiateTaskConfirmation') }}
</div>
<div class="operator-text">
<a-icon type="file-search"/>
{{ $t('alteration') }}
</div>
<div class="operator-text" @click="fixedPlateClick">
<a-icon type="bulb"/>
{{ $t('fixedPlate') }}
</div>
</div>
<div style="float: right;margin-top: 1px;" v-if="isDisplay">
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight">
<template slot="title" id="popconfirm">
<div class="operator-text-title">
<ImportFile :url="url" :projectLibraryId=$route.query.id :isTrue="true" :accept="'.zip'"
@getList="getPersonnelList"/>
</div>
<div @click="handleModule" class="operator-text-title">
<a-icon type="download"/>
{{ $t('templateDownload') }}
</div>
<div @click="handleExport" class="operator-text-title">
<a-icon type="export" :rotate="-90"/>
{{ $t('export') }}
</div>
<div @click="handleDel" class="operator-text-title">
<a-icon type="delete"/>
{{ $t('BatchDelete') }}
</div>
<div class="operator-text-title" @click="bringInRelevantPersonnelClick">
<a-icon type="user"/>
{{ $t('bringInRelevantPersonnel') }}
</div>
</template>
<div class="operator-text" style="position: relative">
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
</div>
</a-popconfirm>
<div @click="transferClick" class="operator-text">
<a-icon type="profile"/>
{{ $t('Transfer') }}
</div>
<div @click="copyClick" class="operator-text">
<a-icon type="copy"/>
{{ $t('copy') }}
</div>
<div @click="handleAdd" class="operator-text">
<a-icon type="plus"/>
{{ $t('add') }}
</div>
<div class="operator-text" @click="batSettingClick">
<a-icon type="setting"/>
{{ $t('batSetting') }}
</div>
</div>
<div v-if="!isDisplay" style="float: right;margin-top: 1px;margin-bottom: 19px">
<div class="operator-text" @click="submitClick(0)">
<a-icon type="check-circle"/>
{{ $t('submit') }}
</div>
<div class="operator-text" @click="submitClick(1)">
<a-icon type="close-circle"/>
{{ $t('overrule') }}
</div>
<div class="operator-text" @click="batSettingClick">
<a-icon type="setting"/>
{{ $t('batSetting') }}
</div>
</div>
</div>
<div style="width: 100%">
<a-table
ref="table"
:loading="loading"
:pagination="false"
:scroll="{x: 'max-content',y:'calc(100vh - 400px)'}"
rowKey="id"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
<span slot="operation" slot-scope="text,record">
<a class="text-operation"
v-if="(record.inventoryAffirmStatus == 'List to confirm' && (record.roleCode == 1 || record.roleCode == 2 || record.roleCode == 4)) || record.roleCode == 0"
@click="edit(record)">
{{ $t('edit') }}
</a>
<a class="text-operation"
v-if="(record.inventoryAffirmStatus == 'Not started' || record.inventoryAffirmStatus == 'rejected') && record.roleCode == 0"
@click="deleteLib(record)">
{{ $t('deleteLib') }}
</a>
<!-- <a class="text-operation" @click="resultReportedClick(record)">{{$t('resultReported')}}</a>-->
<a @click="addProcess(record)">发起</a>
</span>
<span slot="titleName" slot-scope="text,record" :title="text">
{{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}
</span>
<span slot="designDeliverableTemplateName" slot-scope="text,record">
<span>{{ record.designDeliverableType_dictText }}</span><br v-if="record.designDeliverableType_dictText">
<a v-if="record.designDeliverableTemplate && record.designDeliverableTemplate.split(',').length == 1"
:title="record.designDeliverableTemplateName"
@click="pdfPreviewClick(record.designDeliverableTemplateName,record.designDeliverableTemplate)">
{{ record.designDeliverableTemplateName.length > 10 ? record.designDeliverableTemplateName.slice(0, 9) + '...' :record.designDeliverableTemplateName}}
</a>
<a v-else-if="record.designDeliverableTemplate && record.designDeliverableTemplate.split(',').length > 1"
@click="clickButtonToUpload(record.designDeliverableTemplate)">{{ $t('viewFile') }}</a>
<span v-else>--</span>
</span>
<span slot="prehomoDeliverableTemplateName" slot-scope="text,record">
<span>{{ record.prehomoDeliverableType_dictText }}</span><br v-if="record.prehomoDeliverableType_dictText">
<a v-if="record.prehomoDeliverableTemplate && record.prehomoDeliverableTemplate.split(',').length == 1"
:title="record.prehomoDeliverableTemplateName"
@click="pdfPreviewClick(record.prehomoDeliverableTemplateName,record.prehomoDeliverableTemplate)">
{{ record.prehomoDeliverableTemplateName.length > 10 ? record.prehomoDeliverableTemplateName.slice(0, 9) + '...' :record.prehomoDeliverableTemplateName}}
</a>
<a v-else-if="record.prehomoDeliverableTemplate && record.prehomoDeliverableTemplate.split(',').length > 1"
@click="clickButtonToUpload(record.prehomoDeliverableTemplate)">{{ $t('viewFile') }}</a>
<span v-else>--</span>
</span>
<span slot="verifyDeliverableTemplateName" slot-scope="text,record">
<span>{{ record.verifyDeliverableType_dictText }}</span><br v-if="record.verifyDeliverableType_dictText">
<a v-if="record.verifyDeliverableTemplate && record.verifyDeliverableTemplate.split(',').length == 1"
:title="record.verifyDeliverableTemplateName"
@click="pdfPreviewClick(record.verifyDeliverableTemplateName,record.verifyDeliverableTemplate)">
{{ record.verifyDeliverableTemplateName.length > 10 ? record.verifyDeliverableTemplateName.slice(0, 9) + '...' :record.verifyDeliverableTemplateName}}
</a>
<a v-else-if="record.verifyDeliverableTemplate && record.verifyDeliverableTemplate.split(',').length > 1"
@click="clickButtonToUpload(record.verifyDeliverableTemplate)">{{ $t('viewFile') }}</a>
<span v-else>--</span>
</span>
</a-table>
</div>
<listAddModel :url="url" @addModelList="addModelList" ref="addModelRef"/>
<listEditModel :url="url" @editModelList="addModelList" ref="editModelRef"/>
<batSetting :url="url" @batSettingList="addModelList" ref="batSettingRef"/>
<transferList :url="url" @transferListForm="addModelList" ref="transferListRef"/>
<fixedPlate @fixedPlateForm="addModelList" ref="fixedPlateRef"/>
<a-modal
:title="$t('ListConfirmationDeadline')"
:width="500"
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="handleCancel"
>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text-index">
<div class="title-text-index">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('TaskCutOffTime')">{{ $t('TaskCutOffTime') }}</span>
</div>
<a-form-model-item v-if="this.timeName == '清单'" class="itemModel" prop="inventoryAffirmDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'inventoryAffirmDueDate'})"
format="YYYY-MM-DD"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.inventoryAffirmDueDate"
style="width: 100%"/>
</a-form-model-item>
<a-form-model-item v-else-if="this.timeName == '任务'" class="itemModel" prop="taskAffirmDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'taskAffirmDueDate'})"
format="YYYY-MM-DD"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.taskAffirmDueDate"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<a-modal
:title="$t('deliverableTemplate')"
:width="600"
:visible="visibleFile"
:maskClosable="false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
:pagination="false"
:scroll="{x:500,y: 400}"
:data-source="dataSourceFile"
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
</a>
</span>
</a-table>
</a-modal>
<a-modal
:title="$t('reasonsForRejection')"
:width="500"
:visible="visibleComment"
:confirm-loading="confirmLoadingComment"
:maskClosable="false"
@ok="handleOkComment"
@cancel="handleCancelComment"
>
<a-form-model :model="formInlineComment" class="formAdd" :rules="rulesComment" ref="ruleFormComment">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text-index">
<div class="title-text-Comment">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('reasonsForRejection')">{{$t('reasonsForRejection')}}</span>
</div>
<a-form-model-item class="itemModelComment" :prop="'commentContent'">
<a-textarea
style="width: 100%"
:placeholder="$t('PleaseEnter')+$t('reasonsForRejection')"
:disabled="false"
v-model="formInlineComment.commentContent" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</a-card>
</template>
<script>
import ImportFile from '@/components/ImportFile/index'
import listAddModel from './listAddModel'
import listEditModel from './listEditModel'
import uploadFile from '@/components/uploadFile/file'
import batSetting from './batSetting'
import transferList from './transferList'
import fixedPlate from './fixedPlateForm'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import moment from 'moment'
import { mapGetters } from 'vuex'
import { Base64 } from 'js-base64'
export default {
name: 'listOfRegulations',
components: {
ImportFile,
listAddModel,
listEditModel,
batSetting,
uploadFile,
transferList,
globalAdvancedQuery,
fixedPlate
},
data() {
return {
columns: [
{
title: this.$t('standard'),
align: 'center',
dataIndex: 'serialNumber',
width: 180,
fixed: 'left',
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title',
width: 180,
fixed: 'left',
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('subtitle'),
align: 'center',
dataIndex: 'subtitle',
width: 180,
fixed: 'left',
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('listConfirmationStatus'),
align: 'center',
dataIndex: 'inventoryAffirmStatusName',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('taskAffirmStatus'),
align: 'center',
dataIndex: 'taskAffirmStatusName',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
// {
// title: this.$t('taskReleaseStatus'),
// align: 'center',
// dataIndex: 'taskReleaseStatus'
// },
{
title: this.$t('zoneOfApplication'),
align: 'center',
dataIndex: 'region_dictText',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('correspondingStandard'),
align: 'center',
dataIndex: 'correspondingStandard',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('implementationCategory'),
align: 'center',
dataIndex: 'implementType_dictText',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('ImplementationDate'),
align: 'center',
width: 140,
dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1'
},
{
title: this.$t('vehicleInProductionDate'),
align: 'center',
width: 140,
dataIndex: 'implementTime'
},
{
title: this.$t('certificationType'),
align: 'center',
dataIndex: 'attestationType_dictText',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('certificationLevel'),
align: 'center',
dataIndex: 'attestationRank_dictText',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: 'WVTA ID',
align: 'center',
dataIndex: 'wvtaId',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('areaOfResponsibility'),
align: 'center',
ellipsis: true,
dataIndex: 'dutyTerritory_dictText',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('regulatoryEngineer'),
align: 'center',
ellipsis: true,
dataIndex: 'regulationOwnerName',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('certifiedEngineer'),
align: 'center',
ellipsis: true,
dataIndex: 'homologationEngineerName',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('engineeringInterfacePerson'),
align: 'center',
ellipsis: true,
dataIndex: 'engineeringInterfacePersonName',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('remarks'),
align: 'center',
dataIndex: 'remark',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('confirmationOfDesignConformity'),
children: [
{
title: this.$t('Deliverables'),
dataIndex: 'designDeliverableTemplateName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'designDeliverableTemplateName' }
},
{
title: this.$t('Sponsor'),
dataIndex: 'designInitiatorName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('personLiable'),
dataIndex: 'designDutyName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('TaskCutOffTime'),
dataIndex: 'designDueDate',
align: 'center',
width: 140
}
]
},
{
title: this.$t('PrehomoConfirmation'),
children: [
{
title: this.$t('Deliverables'),
dataIndex: 'prehomoDeliverableTemplateName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'prehomoDeliverableTemplateName' }
},
{
title: this.$t('Sponsor'),
dataIndex: 'prehomoInitiatorName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('personLiable'),
dataIndex: 'prehomoDutyName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('TaskCutOffTime'),
dataIndex: 'prehomoDueDate',
align: 'center',
width: 140
}
]
},
{
title: this.$t('verificationAndConformityconfirmation'),
children: [
{
title: this.$t('Deliverables'),
dataIndex: 'verifyDeliverableTemplateName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'verifyDeliverableTemplateName' }
},
{
title: this.$t('Sponsor'),
dataIndex: 'verifyInitiatorName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('personLiable'),
dataIndex: 'verifyDutyName',
align: 'center',
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('TaskCutOffTime'),
dataIndex: 'verifyDueDate',
align: 'center',
width: 140
}
]
},
{
title: this.$t('operation'),
align: 'center',
fixed: 'right',
width: 210,
scopedSlots: { customRender: 'operation' }
}
],
columnsFile: [
{
title: this.$t('deliverableTemplate'),
dataIndex: 'fileName',
align: 'center',
width: 260,
ellipsis: true
},
{
title: this.$t('operation'),
align: 'center',
width: 130,
scopedSlots: { customRender: 'fileOperation' }
}
],
visibleFile: false,
formInlineComment: {},
rulesComment: {
commentContent: [
{
required: true,
message: this.$t('reasonsForRejection') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
},
timeName: '',
visibleComment: false,
dataSourceFile: [],
confirmLoading: false,
confirmLoadingComment: false,
queryParamQuery: {},
isDisplay: true,
selectedRowKeys: [],
visible: false,
formInline: {},
rules: {
inventoryAffirmDueDate: [
{
required: true,
message: this.$t('TaskCutOffTime') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
taskAffirmDueDate: [
{
required: true,
message: this.$t('TaskCutOffTime') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
queryParam: {},
url: {
addModelList: '/project/projectLawsInventoryEO/queryPageInfoBussDocument',
list: '/project/projectLawsInventoryEO/list',
addModel: 'project/projectLawsInventoryEO/add',
editModel: '/project/projectLawsInventoryEO/edit',
deleteBatch: '/project/projectLawsInventoryEO/deleteBatch',
deleteOne: '/project/projectLawsInventoryEO/delete',
updateStatusBatch: '/project/projectLawsInventoryEO/updateStatusBatch',
matchRelevantPeople: '/project/projectLawsInventoryEO/matchRelevantPeople',
queryPersonByProject: '/project/projectRelatedPersonnel/queryPersonByProjectId',
importZipUrl: '/project/projectLawsInventoryEO/importData',
exportTemplate: '/project/projectLawsInventoryEO/exportTemplate',
exportData: '/project/projectLawsInventoryEO/exportData',
setBatch: '/project/projectLawsInventoryEO/setBatch',//批量设置
copyUrl: '/project/projectLawsInventoryEO/copyInfoByIds',//复制
transferUrl: '/project/projectLawsInventoryEO/getPageInfoDummy'//调取
},
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
loading: false,
dataSource: [],
// fieldList | array |✔| 需要查询的列集合示例如下,type类型有:date/datetime/string/int/number
fieldList: [
{
type: 'string',
value: 'correspondingStandard',
text: this.$t('correspondingStandard')
},
{
type: '',
value: 'implementType',
text: this.$t('implementationCategory'),
dictCode: 'implement_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
{
type: 'date',
value: 'xin1Che1Xing2Shi2Shi1Ri4Qi1',
text: this.$t('ImplementationDate')
},
{
type: 'date',
value: 'implementTime',
text: this.$t('vehicleInProductionDate')
},
{
type: 'string',
value: 'wvtaId',
text: 'WVTA ID'
},
{
type: '',
value: 'attestationType',
text: this.$t('certificationType'),
dictCode: 'attestation_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
{
type: '',
value: 'attestationRank',
text: this.$t('certificationLevel'),
dictCode: 'attestation_rank'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
{
type: '',
value: 'dutyTerritory',
text: this.$t('areaOfResponsibility'),
dictCode: 'duty_territory'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
}
]
}
},
mounted() {
if (this.$route.query.studioEngineer == this.userInfo().id) {
this.isDisplay = true
} else {
this.isDisplay = false
}
this.getList()
},
methods: {
...mapGetters(['userInfo']),
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
},
handleExport() {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let query = {
...this.queryParam,
ids: selectedRowKeys.join(','),
...this.queryParamQuery,
projectLibraryId: this.$route.query.id
}
downloadFile(this.url.exportData, this.$route.query.projectName + this.$t('listOfRegulations') + '.zip', query, this.Deselect)
},
//复制
copyClick() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmReplication'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
getAction(_this.url.copyUrl, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//调取
transferClick() {
this.$refs.transferListRef.transferModel()
},
batSettingClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)))
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
fixedPlateClick() {
if (this.dataSource && this.dataSource.length > 0) {
let isTrue
for (let i = 0; i < this.dataSource.length; i++) {
if (this.dataSource[i].taskAffirmStatus == 'accepted' && this.dataSource[i].inventoryAffirmStatus == 'accepted') {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('theReceived'))
return
}
}
if (isTrue) {
this.$refs.fixedPlateRef.getData()
}
}
},
handleAdd() {
this.$refs.addModelRef.addModel()
},
handleDel() {
if (this.selectedRowKeys.length > 0) {
let _this = this
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
let isTrue
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
if (this.dataSource[i].inventoryAffirmStatus == 'Not started' || this.dataSource[i].inventoryAffirmStatus == 'rejected') {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('onlyDeleted'))
return
}
}
}
}
if (isTrue) {
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
deleteAction(_this.url.deleteBatch, {
ids: idList.join(','),
projectLibraryId: _this.$route.query.id
}).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
}
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
edit(item) {
this.$refs.editModelRef.editModel(JSON.parse(JSON.stringify(item)))
},
deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteOne, { id: val.id, projectLibraryId: _this.$route.query.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
},
searchQuery() {
this.getList()
},
searchReset() {
this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback()
this.queryParam = {}
this.getList()
},
addModelList() {
this.getList()
},
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
sqp['superQueryParams'] = ''
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
sqp['superQueryParams'] = encodeURI(JSON.stringify(params))
sqp['superQueryMatchType'] = matchType
}
this.queryParamQuery = sqp
this.getList()
},
getList() {
let query = {
...this.queryParamQuery,
...this.queryParam,
projectLibraryId: this.$route.query.id
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSource = res.result
this.loading = false
} else {
this.loading = false
}
})
},
getPersonnelList() {
this.getList()
},
initiateListConfirmationcClick(name) {
this.timeName = name
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let isTrue = true
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
if ((this.dataSource[i].inventoryAffirmStatus == 'Not started' || this.dataSource[i].inventoryAffirmStatus == 'rejected') &&
this.dataSource[i].homologationEngineerId && this.dataSource[i].regulationOwnerId) {
isTrue = true
} else {
this.$message.warning(this.$t('dataConfirmation'))
isTrue = false
return
}
}
}
}
if (isTrue) {
this.visible = true
this.formInline = {}
}
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
initiateTaskConfirmationClick(name) {
this.timeName = name
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let isTrue = true
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
if ((this.dataSource[i].taskAffirmStatus == 'Not started' || this.dataSource[i].taskAffirmStatus == 'rejected') &&
this.dataSource[i].engineeringInterfacePerson && this.dataSource[i].inventoryAffirmStatus == 'accepted') {
if ((this.dataSource[i].verifyDueDate && this.dataSource[i].verifyDutyId
&& this.dataSource[i].verifyInitiatorId && this.dataSource[i].verifyDeliverableType) ||
(!this.dataSource[i].verifyDueDate && !this.dataSource[i].verifyDutyId
&& !this.dataSource[i].verifyInitiatorId && !this.dataSource[i].verifyDeliverableType)) {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('pleaseConformityVerification'))
return
}
if ((this.dataSource[i].prehomoDueDate && this.dataSource[i].prehomoDutyId
&& this.dataSource[i].prehomoInitiatorId && this.dataSource[i].prehomoDeliverableType) ||
(!this.dataSource[i].prehomoDueDate && !this.dataSource[i].prehomoDutyId
&& !this.dataSource[i].prehomoInitiatorId && !this.dataSource[i].prehomoDeliverableType)) {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('pleaseConfirmedByPrehomo'))
return
}
if ((this.dataSource[i].designDueDate && this.dataSource[i].designDutyId
&& this.dataSource[i].designInitiatorId && this.dataSource[i].designDeliverableType) ||
(!this.dataSource[i].designDueDate && !this.dataSource[i].designDutyId
&& !this.dataSource[i].designInitiatorId && !this.dataSource[i].designDeliverableType)) {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('pleaseDesignConformityConfirmation'))
return
}
} else {
isTrue = false
this.$message.warning(this.$t('taskDataConfirmation'))
return
}
}
}
}
if (isTrue) {
this.visible = true
this.formInline = {}
}
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
if (this.timeName == '清单') {
let query = {
operatorType: 0,
ids: selectedRowKeys.join(','),
projectLibraryId: this.$route.query.id,
...this.formInline
}
this.confirmLoading = true
getAction(this.url.updateStatusBatch, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.selectedRowKeys = []
this.confirmLoading = false
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
} else {
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
this.dataSource[i].taskAffirmDueDate = this.formInline.taskAffirmDueDate
Object.keys(this.dataSource[i]).forEach(res => {
if (this.dataSource[i][res] && this.dataSource[i][res] instanceof String) {
this.dataSource[i][res] = this.dataSource[i][res].replace(/\"/g, '“')
this.dataSource[i][res] = this.dataSource[i][res].replace(/\'/g, '‘')
}
})
setTimeout(() => {
this.confirmLoading = true
this.startProcess(this.dataSource[i])
}, 500)
}
}
}
}
}
})
},
startProcess(value) {
let query = {
type: 1,
msg: JSON.stringify(value).replace(/\"/g, '\''),
projectNameId: this.$route.query.projectNameId,
projectName: this.$route.query.projectName,
taskAffirmDueDate: this.formInline.taskAffirmDueDate
}
postAction('/workFlow/startProcess', query).then((res) => {
if (res.success) {
this.completeTask(value, res.result)
}
})
},
completeTask(value, taskId) {
let handlingTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
value.handlingTime = handlingTime
let query = {
userid: this.userInfo().id,
taskId: taskId,
json: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.visible = false
this.selectedRowKeys = []
this.$message.success(this.$t('OperationSuccessful'))
this.confirmLoading = false
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
},
getRowKeys(value, callBack) {
let isTrue = true
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < value.length; j++) {
if (this.dataSource[i].id == value[j]) {
if (this.dataSource[i].inventoryAffirmStatus == 'List to confirm') {
if (this.dataSource[i].roleCode == 1 && this.dataSource[i].regulationOwnerSubmitStatus) {
isTrue = false
this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted'))
return
} else if (this.dataSource[i].roleCode == 2 && this.dataSource[i].homologationEngineerSubmitStatus) {
isTrue = false
this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted'))
return
} else if (this.dataSource[i].roleCode == 4 && (this.dataSource[i].homologationEngineerSubmitStatus && this.dataSource[i].regulationOwnerSubmitStatus)) {
isTrue = false
this.$message.warning(this.$t('The') + (i + 1) + this.$t('submitted'))
return
}
} else {
isTrue = false
this.$message.warning(this.$t('The') + (i + 1) + this.$t('incorrectsubmitted'))
return
}
}
}
}
if (isTrue) {
callBack()
}
},
updateStatusBatch(num, selectedRowKeys) {
let _this = this
let query = {
operatorType: 1,
ids: selectedRowKeys.join(','),
projectLibraryId: _this.$route.query.id,
operatorResult: num
}
getAction(_this.url.updateStatusBatch, query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.visible = false
this.selectedRowKeys = []
_this.confirmLoading = false
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
_this.confirmLoading = false
}
})
},
submitClick(num) {
let _this = this
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.$confirm({
content: num == 0 ? _this.$t('confirmSubmit') : _this.$t('confirmOverrule'),
onOk() {
if (num == 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
_this.getRowKeys(selectedRowKeys, function() {
_this.updateStatusBatch(num, selectedRowKeys)
})
} else {
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
_this.getRowKeys(selectedRowKeys, function() {
_this.visibleComment = true
})
}
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleOkComment() {
this.$refs.ruleFormComment.validate(valid => {
if (valid) {
let url = '/project/projectCommentEO/add'
let query = {
commentContent: this.formInlineComment.commentContent,
projectLibraryId: this.$route.query.id
}
this.confirmLoadingComment = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
this.updateStatusBatch(1, selectedRowKeys)
postAction(url, query).then((res) => {
if (res.success) {
this.visibleComment = false
this.confirmLoadingComment = false
} else {
this.confirmLoadingComment = false
}
})
}
})
},
handleCancelComment() {
this.visibleComment = false
},
handleCancel() {
this.formInline = {}
this.visible = false
},
dateChange(item) {
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : ''
},
pdfPreview(fileQuery) {
let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id))
} else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
}
},
pdfPreviewClick(name, id) {
let fileName = name
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id))
} else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', name, { id: id })
}
},
download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id })
},
clickButtonToUpload(item) {
this.loading = true
this.visibleFile = true
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
this.loading = false
}
})
},
bringInRelevantPersonnelClick() {
let _this = this
this.$confirm({
content: _this.$t('confirmBringInRelevantPersonnel'),
onOk() {
getAction(_this.url.matchRelevantPeople, { projectLibraryId: _this.$route.query.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
addProcess(val) {
let num = 1
for (let i = 0; i < 3; i++) {
setTimeout(() => {
++num
this.startProcessDesign(val, num)
}, 500)
}
},
startProcessDesign(value, num) {
let query = {
type: num,
msg: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/startProcess', query).then((res) => {
if (res.success) {
this.completeTaskDesign(value, res.result)
}
})
},
completeTaskDesign(value, taskId) {
value.reviewResult = 'launch'
let operatorTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
value.operatorTime = operatorTime
let query = {
userid: this.userInfo().id,
taskId: taskId,
json: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.visible = false
this.$message.success(this.$t('OperationSuccessful'))
this.$router.push({
path: '/ProcessCenter'
})
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
},
resultReportedClick(val) {
this.clickButtonToUploadFile()
},
clickButtonToUploadFile(item) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.doc-detail {
background: #fff;
height: 100%;
.Virtual-detail-header {
width: 100%;
height: 68px;
line-height: 68px;
padding: 0 32px 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
.Virtual-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
}
}
.Virtual-detail-content {
padding: 0 38px 0 38px;
box-sizing: border-box;
font-size: 16px;
.box-title-text-add {
line-height: 1.4;
}
.title-text-add {
display: inline-block;
font-weight: 500;
margin-right: 16px;
height: 42px;
line-height: 42px;
}
}
}
.header-text {
font-size: 16px;
font-weight: 400;
height: 60px;
color: #000F16;
line-height: 40px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.box-title-text-index {
line-height: 1.4;
display: flex;
}
.title-text {
width: 32px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.title-text-index {
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 40px;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.box-button {
height: 38px;
}
.text-operation {
margin-right: 8px;
}
.page {
text-align: right;
margin-top: 20px;
}
.operator-text-left {
font-size: 14px;
margin-right: 20px;
background: #eff1f3;
padding: 8px 8px;
cursor: pointer;
border-radius: 4px;
}
/deep/ .ant-popover-buttons {
display: none !important;
}
.operator-text-title {
cursor: pointer;
margin-right: 22px;
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-bottom: 22px;
}
.itemModelComment{
width: calc(100% - 64px);
display: inline-block;
margin-top: 2px;
}
.title-text-Comment{
width: 74px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
</style>
<style>
.box-input .ant-select-selection {
height: 38px !important;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
}
.popconfirm .ant-popover-buttons {
display: none !important;
}
.popconfirm .anticon-exclamation-circle {
display: none !important;
}
.ant-table-placeholder {
padding: 0;
border-top: none;
}
.itemModelComment .ant-form-item-control-wrapper{
width: 100% !important;
}
</style>