2243 lines
84 KiB
Java
2243 lines
84 KiB
Java
<template>
|
||
<a-card :bordered="false">
|
||
<!-- <div class="header-text">-->
|
||
<!-- {{ $t('DocumentStandard') }}-->
|
||
<!-- </div>-->
|
||
<div class="table-page-search-wrapper">
|
||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||
<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" :title="$t('areaOfResponsibility')">
|
||
<span>{{ $t('areaOfResponsibility') }}</span>
|
||
</div>
|
||
<j-dict-select-tag class="box-input" v-model="queryParam.dutyTerritory"
|
||
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
|
||
:type="'select'"
|
||
:triggerChange="false" :dictCode="'duty_territory'"/>
|
||
</div>
|
||
</a-col>
|
||
<a-col :md="6" :sm="8">
|
||
<div class="box-title-text">
|
||
<div class="title-text" :title="$t('listConfirmationStatus')">
|
||
<span>{{ $t('listConfirmationStatus') }}</span>
|
||
</div>
|
||
<a-select :placeholder="$t('PleaseSelect')+$t('listConfirmationStatus')"
|
||
class="box-input"
|
||
allowClear
|
||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||
v-model="queryParam.inventoryAffirmStatus">
|
||
<a-select-option v-for="(item, key) in listOptions"
|
||
:key="item.key"
|
||
:value="item.value">
|
||
<span style="display: inline-block;width: 100%" :title=" item.label ">
|
||
{{ item.label}}
|
||
</span>
|
||
</a-select-option>
|
||
</a-select>
|
||
</div>
|
||
</a-col>
|
||
<a-col :md="6" :sm="8">
|
||
<div class="box-title-text">
|
||
<div class="title-text" :title="$t('taskAffirmStatus')">
|
||
<span>{{ $t('taskAffirmStatus') }}</span>
|
||
</div>
|
||
<a-select :placeholder="$t('PleaseSelect')+$t('taskAffirmStatus')"
|
||
class="box-input"
|
||
allowClear
|
||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||
v-model="queryParam.taskAffirmStatus">
|
||
<a-select-option v-for="(item, key) in taskOptions"
|
||
:key="item.key"
|
||
:value="item.value">
|
||
<span style="display: inline-block;width: 100%" :title=" item.label ">
|
||
{{ item.label}}
|
||
</span>
|
||
</a-select-option>
|
||
</a-select>
|
||
</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>
|
||
</a-form>
|
||
</div>
|
||
<div class="table-operator"
|
||
v-if="(isRoleSwitching && !isDisplay) || (!isDisplay && roleSwitchingList.length > 1) || isDisplay"
|
||
style="overflow:hidden;margin-bottom: 20px">
|
||
<div style="float: left;margin-bottom: 0px;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" @click="alterationClick">
|
||
<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" v-has="'projectLawsInventory:exportData'" 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="ExportReportClick">
|
||
<a-icon type="export"/>
|
||
{{ $t('ExportReport') }}
|
||
</div>
|
||
<div class="operator-text-title" @click="batSettingClick">
|
||
<a-icon type="setting"/>
|
||
{{ $t('batSetting') }}
|
||
</div>
|
||
<div class="operator-text-title" @click="questionClick">
|
||
<a-icon type="apartment"/>
|
||
{{ $t('question') }}
|
||
</div>
|
||
</template>
|
||
<div class="operator-text" style="position: relative">
|
||
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
|
||
</div>
|
||
</a-popconfirm>
|
||
<div class="operator-text" @click="bringInRelevantPersonnelClick">
|
||
<a-icon type="user"/>
|
||
{{ $t('bringInRelevantPersonnel') }}
|
||
</div>
|
||
<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"
|
||
v-if="roleSwitchingList.length > 1"
|
||
@click="roleSwitchingClick">
|
||
<a-icon type="select"/>
|
||
{{ $t('roleSwitching') }}
|
||
</div>
|
||
</div>
|
||
<div v-if="!isDisplay" style="float: right;margin-top: 1px;margin-bottom: 0px">
|
||
<div class="operator-text" @click="submitClick(0)" v-if="isRoleSwitching">
|
||
<a-icon type="check-circle"/>
|
||
{{ $t('submit') }}
|
||
</div>
|
||
<div class="operator-text" @click="submitClick(1)" v-if="isRoleSwitching">
|
||
<a-icon type="close-circle"/>
|
||
{{ $t('overrule') }}
|
||
</div>
|
||
<div class="operator-text" @click="batSettingClick" v-if="isRoleSwitching">
|
||
<a-icon type="setting"/>
|
||
{{ $t('batSetting') }}
|
||
</div>
|
||
<div class="operator-text"
|
||
v-if="roleSwitchingList.length > 1"
|
||
@click="roleSwitchingClick">
|
||
<a-icon type="select"/>
|
||
{{ $t('roleSwitching') }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="width: 100%">
|
||
<a-table
|
||
ref="table"
|
||
class="tableList"
|
||
:loading="loading"
|
||
:pagination="false"
|
||
:scroll="{x: '100%',y:'calc(100vh - 170px)'}"
|
||
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.regulationOwnerSubmitStatus) ||
|
||
(record.roleCode == 2 && !record.homologationEngineerSubmitStatus) ||
|
||
(record.roleCode == 4 && !record.regulationOwnerSubmitStatus && !record.homologationEngineerSubmitStatus)))
|
||
|| 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>
|
||
</span>
|
||
<span slot="titleName" slot-scope="text,record" :title="text">
|
||
<span class="textName">
|
||
{{text}}
|
||
</span>
|
||
</span>
|
||
|
||
<span slot="standard" slot-scope="text,record" :title="text">
|
||
<a class="textName" @click="standardClick(record)">
|
||
{{text}}
|
||
</a>
|
||
</span>
|
||
<span slot="designDeliverableTemplateName" slot-scope="text,record">
|
||
<span>{{ record.designDeliverableTypeName }}</span><br v-if="record.designDeliverableTypeName">
|
||
<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.prehomoDeliverableTypeName }}</span><br v-if="record.prehomoDeliverableTypeName">
|
||
<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.verifyDeliverableTypeName }}</span><br v-if="record.verifyDeliverableTypeName">
|
||
<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="listTitle"
|
||
:width="500"
|
||
:visible="visible"
|
||
:confirm-loading="confirmLoading"
|
||
:maskClosable="false"
|
||
@ok="handleOk"
|
||
@cancel="handleCancel"
|
||
>
|
||
<a-spin :spinning="confirmLoading">
|
||
<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"
|
||
:disabledDate="disabledDate"
|
||
: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"
|
||
:disabledDate="disabledDate"
|
||
:getCalendarContainer="(trigger) => trigger.parentNode"
|
||
v-model="formInline.taskAffirmDueDate"
|
||
style="width: 100%"/>
|
||
</a-form-model-item>
|
||
</div>
|
||
</a-col>
|
||
</a-row>
|
||
</a-form-model>
|
||
</a-spin>
|
||
</a-modal>
|
||
<a-modal
|
||
:title="fileTitle"
|
||
: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>
|
||
<a-modal
|
||
:title="$t('roleSwitching')"
|
||
:width="500"
|
||
:visible="visibleRoleSwitching"
|
||
:confirm-loading="confirmLoadingRoleSwitching"
|
||
:maskClosable="false"
|
||
@ok="handleOkRoleSwitching"
|
||
@cancel="handleCancelRoleSwitching"
|
||
>
|
||
<a-form-model :model="formInlineRoleSwitching" class="formAdd" :rules="rulesRoleSwitching"
|
||
ref="ruleFormRoleSwitching">
|
||
<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('roleSwitching')">{{$t('roleSwitching')}}</span>
|
||
</div>
|
||
<a-form-model-item class="itemModelComment" :prop="'roleSwitchingCode'">
|
||
<a-select allowClear :placeholder="$t('pleaseSelect')+$t('roleSwitching')"
|
||
v-model="formInlineRoleSwitching.roleSwitchingCode">
|
||
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
|
||
<a-select-option :value="item.roleCode" v-for="item in roleSwitchingList">
|
||
<span class="itemOption-index" :title="item.roleName">
|
||
{{item.roleName}}
|
||
</span>
|
||
</a-select-option>
|
||
</a-select>
|
||
</a-form-model-item>
|
||
</div>
|
||
</a-col>
|
||
</a-row>
|
||
</a-form-model>
|
||
</a-modal>
|
||
<JLoading :loading="JLoading">{{$t('dataLoading')}}</JLoading>
|
||
<resultReportedUpload @resultReportedUploadForm="addModelList" ref="resultReportedUploadRef"/>
|
||
</a-card>
|
||
</template>
|
||
|
||
<script>
|
||
import ImportFile from '@/components/ImportFile/index'
|
||
import listAddModel from './listAddModel'
|
||
import listEditModel from './listEditModel'
|
||
import batSetting from './batSetting'
|
||
import transferList from './transferList'
|
||
import fixedPlate from './fixedPlateForm'
|
||
import resultReportedUpload from './resultReportedUpload'
|
||
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',
|
||
props: ['areaOfResponsibilityList'],
|
||
components: {
|
||
ImportFile,
|
||
listAddModel,
|
||
listEditModel,
|
||
batSetting,
|
||
transferList,
|
||
globalAdvancedQuery,
|
||
fixedPlate,
|
||
resultReportedUpload
|
||
},
|
||
data() {
|
||
return {
|
||
roleSwitchingList: [],
|
||
listTitle: '',
|
||
columnsAll: [
|
||
{
|
||
title: this.$t('standard'),
|
||
align: 'center',
|
||
dataIndex: 'serialNumber',
|
||
width: 180,
|
||
fixed: 'left',
|
||
scopedSlots: { customRender: 'standard' }
|
||
},
|
||
{
|
||
title: this.$t('title'),
|
||
align: 'center',
|
||
dataIndex: 'title',
|
||
width: 180,
|
||
fixed: 'left',
|
||
scopedSlots: { customRender: 'titleName' }
|
||
},
|
||
{
|
||
title: this.$t('subtitle'),
|
||
align: 'center',
|
||
dataIndex: 'subtitle',
|
||
ellipsis: true,
|
||
width: 180
|
||
},
|
||
{
|
||
title: this.$t('listConfirmationStatus'),
|
||
align: 'center',
|
||
dataIndex: 'inventoryAffirmStatusName',
|
||
width: 240,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('taskAffirmStatus'),
|
||
align: 'center',
|
||
dataIndex: 'taskAffirmStatusName',
|
||
width: 240,
|
||
ellipsis: true
|
||
},
|
||
// {
|
||
// title: this.$t('taskReleaseStatus'),
|
||
// align: 'center',
|
||
// dataIndex: 'taskReleaseStatus'
|
||
// },
|
||
{
|
||
title: this.$t('zoneOfApplication'),
|
||
align: 'center',
|
||
dataIndex: 'region_dictText',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('correspondingStandard'),
|
||
align: 'center',
|
||
dataIndex: 'correspondingStandard',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('implementationCategory'),
|
||
align: 'center',
|
||
dataIndex: 'implementType_dictText',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('ImplementationDate'),
|
||
align: 'center',
|
||
width: 200,
|
||
dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1',
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('vehicleInProductionDate'),
|
||
align: 'center',
|
||
width: 220,
|
||
dataIndex: 'implementTime',
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('certificationType'),
|
||
align: 'center',
|
||
dataIndex: 'attestationType_dictText',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('certificationLevel'),
|
||
align: 'center',
|
||
dataIndex: 'attestationRank_dictText',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('applicableSupplement'),
|
||
align: 'center',
|
||
width: 220,
|
||
dataIndex: 'applicableSupplement',
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: 'WVTA ID',
|
||
align: 'center',
|
||
dataIndex: 'wvtaId',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('areaOfResponsibility'),
|
||
align: 'center',
|
||
ellipsis: true,
|
||
dataIndex: 'dutyTerritory_dictText',
|
||
width: 180
|
||
},
|
||
{
|
||
title: this.$t('regulatoryEngineer'),
|
||
align: 'center',
|
||
ellipsis: true,
|
||
dataIndex: 'regulationOwnerName',
|
||
width: 180
|
||
},
|
||
{
|
||
title: this.$t('certifiedEngineer'),
|
||
align: 'center',
|
||
ellipsis: true,
|
||
dataIndex: 'homologationEngineerName',
|
||
width: 180
|
||
},
|
||
{
|
||
title: this.$t('engineeringInterfacePerson'),
|
||
align: 'center',
|
||
ellipsis: true,
|
||
dataIndex: 'engineeringInterfacePersonName',
|
||
width: 180
|
||
},
|
||
{
|
||
title: this.$t('remarks'),
|
||
align: 'center',
|
||
dataIndex: 'remark',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('confirmationOfDesignConformity'),
|
||
children: [
|
||
{
|
||
title: this.$t('Deliverables'),
|
||
dataIndex: 'designDeliverableTemplateName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true,
|
||
scopedSlots: { customRender: 'designDeliverableTemplateName' }
|
||
},
|
||
{
|
||
title: this.$t('Sponsor'),
|
||
dataIndex: 'designInitiatorName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('personLiable'),
|
||
dataIndex: 'designDutyName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('TaskCutOffTime'),
|
||
dataIndex: 'designDueDate',
|
||
align: 'center',
|
||
ellipsis: true,
|
||
width: 140
|
||
},
|
||
{
|
||
title: this.$t('descriptionDeliverables'),
|
||
dataIndex: 'designRemark',
|
||
align: 'center',
|
||
width: 220,
|
||
ellipsis: true
|
||
}
|
||
]
|
||
},
|
||
{
|
||
title: this.$t('PrehomoConfirmation'),
|
||
children: [
|
||
{
|
||
title: this.$t('Deliverables'),
|
||
dataIndex: 'prehomoDeliverableTemplateName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true,
|
||
scopedSlots: { customRender: 'prehomoDeliverableTemplateName' }
|
||
},
|
||
{
|
||
title: this.$t('Sponsor'),
|
||
dataIndex: 'prehomoInitiatorName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('personLiable'),
|
||
dataIndex: 'prehomoDutyName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('TaskCutOffTime'),
|
||
dataIndex: 'prehomoDueDate',
|
||
align: 'center',
|
||
width: 140,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('descriptionDeliverables'),
|
||
dataIndex: 'prehomoRemark',
|
||
align: 'center',
|
||
width: 220,
|
||
ellipsis: true
|
||
}
|
||
]
|
||
},
|
||
{
|
||
title: this.$t('verificationAndConformityconfirmation'),
|
||
children: [
|
||
{
|
||
title: this.$t('Deliverables'),
|
||
dataIndex: 'verifyDeliverableTemplateName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true,
|
||
scopedSlots: { customRender: 'verifyDeliverableTemplateName' }
|
||
},
|
||
{
|
||
title: this.$t('Sponsor'),
|
||
dataIndex: 'verifyInitiatorName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('personLiable'),
|
||
dataIndex: 'verifyDutyName',
|
||
align: 'center',
|
||
width: 180,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('TaskCutOffTime'),
|
||
dataIndex: 'verifyDueDate',
|
||
align: 'center',
|
||
ellipsis: true,
|
||
width: 140
|
||
},
|
||
{
|
||
title: this.$t('descriptionDeliverables'),
|
||
dataIndex: 'verifyRemark',
|
||
align: 'center',
|
||
width: 220,
|
||
ellipsis: true
|
||
}
|
||
]
|
||
},
|
||
{
|
||
title: this.$t('operation'),
|
||
align: 'center',
|
||
fixed: 'right',
|
||
width: 210,
|
||
scopedSlots: { customRender: 'operation' }
|
||
}
|
||
],
|
||
columnsFileAll: [
|
||
{
|
||
title: this.$t('deliverableTemplate'),
|
||
dataIndex: 'fileName',
|
||
align: 'center',
|
||
width: 260,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('resultReported'),
|
||
dataIndex: 'fileName',
|
||
align: 'center',
|
||
width: 260,
|
||
ellipsis: true
|
||
},
|
||
{
|
||
title: this.$t('operation'),
|
||
align: 'center',
|
||
width: 130,
|
||
scopedSlots: { customRender: 'fileOperation' }
|
||
}
|
||
],
|
||
visibleFile: false,
|
||
JLoading: false,
|
||
isRoleSwitching: true,
|
||
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: {},
|
||
fileTitle: '',
|
||
url: {
|
||
addModelList: '/project/projectLawsInventoryEO/queryPageDummy',
|
||
queryConditionInventory: '/project/projectLawsInventoryEO/queryConditionInventory',
|
||
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',//调取
|
||
ExportReportUrl: '/project/projectLawsInventoryEO/downloadDocxReport',
|
||
AndUserId: '/project/projectLibraryRoleRelEO/queryByProjectLibraryIdAndUserId',
|
||
AndUserIdEdit: '/project/projectLibraryRoleRelEO/edit'
|
||
},
|
||
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
|
||
loading: false,
|
||
dataSource: [],
|
||
isResultReported: false,
|
||
// fieldList | array |✔| 需要查询的列集合示例如下,type类型有:date/datetime/string/int/number
|
||
fieldList: [
|
||
{
|
||
type: 'string',
|
||
value: 'correspondingStandard',
|
||
text: this.$t('correspondingStandard')
|
||
},
|
||
{
|
||
type: 'string',
|
||
value: 'subtitle',
|
||
text: this.$t('subtitle')
|
||
},
|
||
{
|
||
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 是什么,都显示为字典下拉框
|
||
},
|
||
{
|
||
type: '',
|
||
value: 'region',
|
||
text: this.$t('zoneOfApplication'),
|
||
dictCode: 'region'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
|
||
},
|
||
{
|
||
type: 'Personnel',
|
||
value: 'regulationOwnerId',
|
||
valueName: 'regulationOwnerIdName',
|
||
text: this.$t('regulatoryEngineer')
|
||
},
|
||
{
|
||
type: 'Personnel',
|
||
value: 'homologationEngineerId',
|
||
valueName: 'homologationEngineerIdName',
|
||
text: this.$t('certifiedEngineer')
|
||
},
|
||
{
|
||
type: 'Personnel',
|
||
value: 'engineeringInterfacePerson',
|
||
valueName: 'engineeringInterfacePersonName',
|
||
text: this.$t('engineeringInterfacePerson')
|
||
}
|
||
],
|
||
listOptions: [
|
||
{
|
||
value: 'Not started',
|
||
key: 'Not started',
|
||
label: this.$t('notLaunch')
|
||
},
|
||
{
|
||
value: 'List to confirm',
|
||
key: 'List to confirm',
|
||
label: this.$t('toBeConfirmed')
|
||
},
|
||
{
|
||
value: 'Accepted',
|
||
key: 'Accepted',
|
||
label: this.$t('accept')
|
||
},
|
||
{
|
||
value: 'Rejected',
|
||
key: 'Rejected',
|
||
label: this.$t('refuse')
|
||
}
|
||
],
|
||
taskOptions: [
|
||
{
|
||
value: 'Not started',
|
||
key: 'Not started',
|
||
label: this.$t('notLaunch')
|
||
},
|
||
{
|
||
value: 'List to confirm',
|
||
key: 'List to confirm',
|
||
label: this.$t('toBeConfirmed')
|
||
},
|
||
{
|
||
value: 'Accepted',
|
||
key: 'Accepted',
|
||
label: this.$t('accept')
|
||
},
|
||
{
|
||
value: 'Rejected',
|
||
key: 'Rejected',
|
||
label: this.$t('refuse')
|
||
}
|
||
],
|
||
visibleRoleSwitching: false,
|
||
confirmLoadingRoleSwitching: false,
|
||
formInlineRoleSwitching: {},
|
||
AndUserId: '',
|
||
rulesRoleSwitching: {
|
||
roleSwitchingCode: [
|
||
{
|
||
required: true,
|
||
message: this.$t('roleSwitching') + this.$t('cannotEmpty'),
|
||
trigger: 'change'
|
||
}
|
||
]
|
||
},
|
||
detailedSuccessList: [],
|
||
detailedWarningList: [],
|
||
rowKeysSuccessList: [],
|
||
rowKeysWarningList: []
|
||
}
|
||
},
|
||
|
||
mounted() {
|
||
// if (this.$route.query.studioEngineer == this.userInfo().id) {
|
||
this.JLoading = true
|
||
// this.getAndUserId()
|
||
this.getRoleByUserId(() => {
|
||
this.getAndUserId()
|
||
})
|
||
if (this.areaOfResponsibilityList && this.areaOfResponsibilityList.dutyTerritory) {
|
||
this.queryParam.dutyTerritory = this.areaOfResponsibilityList.dutyTerritory
|
||
}
|
||
// } else {
|
||
// this.isDisplay = false
|
||
// }
|
||
|
||
},
|
||
computed: {
|
||
columnsFile() {
|
||
let columnResult = JSON.parse(JSON.stringify(this.columnsFileAll))
|
||
if (!this.isResultReported) {
|
||
for (var i = 0; i < columnResult.length; i++) {
|
||
if (columnResult[i].title === this.$t('resultReported')) {
|
||
columnResult.splice(i, 1)
|
||
i--
|
||
}
|
||
}
|
||
} else if (this.isResultReported) {
|
||
for (var i = 0; i < columnResult.length; i++) {
|
||
if (columnResult[i].title === this.$t('deliverableTemplate')) {
|
||
columnResult.splice(i, 1)
|
||
i--
|
||
}
|
||
}
|
||
}
|
||
return columnResult
|
||
},
|
||
columns() {
|
||
let columnResult = JSON.parse(JSON.stringify(this.columnsAll))
|
||
if (!this.isRoleSwitching) {
|
||
for (var i = 0; i < columnResult.length; i++) {
|
||
if (columnResult[i].title === this.$t('operation')) {
|
||
columnResult.splice(i, 1)
|
||
i--
|
||
}
|
||
}
|
||
}
|
||
return columnResult
|
||
}
|
||
},
|
||
methods: {
|
||
...mapGetters(['userInfo']),
|
||
handleModule() {
|
||
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
|
||
},
|
||
disabledDate(current) {
|
||
return current && current < moment().subtract(1, 'day')
|
||
},
|
||
getRoleByUserId(callback) {
|
||
getAction('/project/projectLawsInventoryEO/getRoleByUserId', { projectLibraryId: this.$route.query.id }).then((res) => {
|
||
if (res.success) {
|
||
this.roleSwitchingList = res.result || []
|
||
} else {
|
||
this.roleSwitchingList = []
|
||
}
|
||
callback && callback()
|
||
})
|
||
},
|
||
getAndUserId() {
|
||
let query = {
|
||
projectLibraryId: this.$route.query.id,
|
||
userId: this.userInfo().id
|
||
}
|
||
getAction(this.url.AndUserId, query).then((res) => {
|
||
if (res.success) {
|
||
this.isDisplay = true
|
||
this.formInlineRoleSwitching.roleSwitchingCode = res.result.roleCode
|
||
this.AndUserId = res.result.id
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode) {
|
||
if (!(this.roleSwitchingList.some(val => val.roleCode == this.formInlineRoleSwitching.roleSwitchingCode))) {
|
||
this.formInlineRoleSwitching.roleSwitchingCode = this.roleSwitchingList[0] ? this.roleSwitchingList[0].roleCode : ''
|
||
}
|
||
} else {
|
||
this.formInlineRoleSwitching.roleSwitchingCode = this.roleSwitchingList[0] ? this.roleSwitchingList[0].roleCode : ''
|
||
}
|
||
this.isRoleSwitching = true
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
|
||
this.isDisplay = true
|
||
} else {
|
||
this.isDisplay = false
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12' ||
|
||
this.formInlineRoleSwitching.roleSwitchingCode == '') {
|
||
this.isRoleSwitching = false
|
||
}
|
||
}
|
||
this.getList()
|
||
// this.JLoading = false
|
||
} else {
|
||
this.JLoading = false
|
||
}
|
||
})
|
||
},
|
||
ExportReportClick() {
|
||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||
if (selectedRowKeys && selectedRowKeys.length == 0) {
|
||
this.$message.warning(this.$t('pleaseSelectData'))
|
||
} else if (selectedRowKeys.length > 1) {
|
||
this.$message.warning(this.$t('OnlyOneSelected'))
|
||
} else {
|
||
downloadFile(this.url.ExportReportUrl, this.$t('listOfRegulations') + this.$t('ExportReport') + '.docx', { id: selectedRowKeys.join(',') })
|
||
}
|
||
},
|
||
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'))
|
||
}
|
||
},
|
||
questionClick() {
|
||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||
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].taskAffirmStatus == 'List to confirm' ||
|
||
this.dataSource[i].inventoryAffirmStatus == 'List to confirm') {
|
||
isTrue = true
|
||
} else {
|
||
isTrue = false
|
||
this.$message.warning(this.$t('OnlyOrTaskconfirmationOut'))
|
||
return
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (isTrue) {
|
||
let _this = this
|
||
this.$confirm({
|
||
content: _this.$t('ConfirmQuestion'),
|
||
onOk() {
|
||
let query = {
|
||
ids: selectedRowKeys.join(','),
|
||
projectLibraryId: _this.$route.query.id
|
||
}
|
||
postAction('project/projectLawsInventoryEO/expediting', query).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'))
|
||
}
|
||
},
|
||
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()
|
||
}
|
||
}
|
||
},
|
||
alterationClick() {
|
||
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].taskAffirmStatus == 'Accepted') {
|
||
isTrue = true
|
||
} else {
|
||
isTrue = false
|
||
this.$message.warning(this.$t('onlyDataChanged'))
|
||
return
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (isTrue) {
|
||
this.changeInterface(selectedRowKeys)
|
||
}
|
||
} else {
|
||
this.$message.warning(this.$t('selectLeastOne'))
|
||
}
|
||
},
|
||
changeInterface() {
|
||
let _this = this
|
||
this.$confirm({
|
||
width: 760,
|
||
content: _this.$t('NoteConfirmTheChange'),
|
||
onOk() {
|
||
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
|
||
getAction('/project/projectLawsInventoryEO/change', {
|
||
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'))
|
||
}
|
||
})
|
||
}
|
||
})
|
||
},
|
||
handleAdd() {
|
||
this.$refs.addModelRef.addModel()
|
||
},
|
||
handleOkRoleSwitching() {
|
||
this.$refs.ruleFormRoleSwitching.validate(valid => {
|
||
if (valid) {
|
||
let query = {
|
||
roleCode: this.formInlineRoleSwitching.roleSwitchingCode,
|
||
id: this.AndUserId
|
||
}
|
||
this.confirmLoadingRoleSwitching = true
|
||
postAction(this.url.AndUserIdEdit, query).then((res) => {
|
||
if (res.success) {
|
||
this.isRoleSwitching = true
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
|
||
this.isDisplay = true
|
||
} else {
|
||
this.isDisplay = false
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') {
|
||
this.isRoleSwitching = false
|
||
}
|
||
}
|
||
this.$message.success(this.$t('OperationSuccessful'))
|
||
this.visibleRoleSwitching = false
|
||
this.confirmLoadingRoleSwitching = false
|
||
this.getList()
|
||
} else {
|
||
this.confirmLoadingRoleSwitching = false
|
||
this.$message.warning(this.$t('operationFailed'))
|
||
}
|
||
})
|
||
}
|
||
})
|
||
},
|
||
handleCancelRoleSwitching() {
|
||
this.visibleRoleSwitching = false
|
||
},
|
||
roleSwitchingClick() {
|
||
this.visibleRoleSwitching = true
|
||
this.$nextTick(() => {
|
||
this.$refs.ruleFormRoleSwitching.clearValidate()
|
||
if (!this.formInlineRoleSwitching.roleSwitchingCode) {
|
||
this.formInlineRoleSwitching.roleSwitchingCode = '0'
|
||
}
|
||
if (!(this.roleSwitchingList.some(val => val.roleCode == this.formInlineRoleSwitching.roleSwitchingCode))) {
|
||
this.formInlineRoleSwitching.roleSwitchingCode = this.roleSwitchingList[0] ? this.roleSwitchingList[0].roleCode : ''
|
||
}
|
||
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
|
||
})
|
||
},
|
||
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))
|
||
postAction(_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) {
|
||
let roleCodeIndex
|
||
if (this.isDisplay) {
|
||
roleCodeIndex = 0
|
||
} else {
|
||
roleCodeIndex = 4
|
||
}
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') {
|
||
roleCodeIndex = 0
|
||
}
|
||
item.roleCodeIndex = roleCodeIndex
|
||
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.queryParam = {}
|
||
this.$refs.globalAdvancedQueryRef.resetLine()
|
||
this.$refs.globalAdvancedQueryRef.emitCallback()
|
||
// 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 roleCode
|
||
if (this.isDisplay) {
|
||
roleCode = 0
|
||
} else {
|
||
roleCode = 4
|
||
}
|
||
if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') {
|
||
roleCode = 0
|
||
}
|
||
let query = {
|
||
...this.queryParamQuery,
|
||
...this.queryParam,
|
||
projectLibraryId: this.$route.query.id,
|
||
roleCode: roleCode
|
||
}
|
||
this.loading = true
|
||
getAction(this.url.list, query).then((res) => {
|
||
this.getRoleByUserId()
|
||
if (res.success) {
|
||
this.dataSource = res.result
|
||
this.loading = false
|
||
this.JLoading = false
|
||
} else {
|
||
this.JLoading = false
|
||
this.loading = false
|
||
}
|
||
})
|
||
},
|
||
getPersonnelList() {
|
||
this.getList()
|
||
},
|
||
initiateListConfirmationcClick(name) {
|
||
this.listTitle = this.$t('ListConfirmationDeadline')
|
||
this.timeName = name
|
||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||
let isTrue = true
|
||
this.detailedSuccessList = []
|
||
this.detailedWarningList = []
|
||
let dataSource = []
|
||
for (let i = 0; i < this.dataSource.length; i++) {
|
||
for (let j = 0; j < selectedRowKeys.length; j++) {
|
||
if (this.dataSource[i].id == selectedRowKeys[j]) {
|
||
dataSource.push(this.dataSource[i])
|
||
}
|
||
}
|
||
}
|
||
for (let i = 0; i < dataSource.length; i++) {
|
||
if (dataSource[i].inventoryAffirmStatus == 'Not started' || dataSource[i].inventoryAffirmStatus == 'Rejected') {
|
||
if (dataSource[i].homologationEngineerId && dataSource[i].regulationOwnerId) {
|
||
if (dataSource[i].designDeliverableType) {
|
||
if (!dataSource[i].designInitiatorId) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('designComplianceReview') + this.$t('Sponsor') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
if (!dataSource[i].designDutyId) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('designComplianceReview') + this.$t('personLiable') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
if (!dataSource[i].designDueDate) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('designComplianceReview') + this.$t('cutoffTime') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
}
|
||
if (dataSource[i].prehomoDeliverableType) {
|
||
if (!dataSource[i].prehomoInitiatorId) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('preHomeConfirmation') + this.$t('Sponsor') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
if (!dataSource[i].prehomoDutyId) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('preHomeConfirmation') + this.$t('personLiable') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
if (!dataSource[i].prehomoDueDate) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('preHomeConfirmation') + this.$t('cutoffTime') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
}
|
||
if (dataSource[i].verifyDeliverableType) {
|
||
if (!dataSource[i].verifyInitiatorId) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('verificationComplianceReview') + this.$t('Sponsor') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
if (!dataSource[i].verifyDutyId) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('verificationComplianceReview') + this.$t('personLiable') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
if (!dataSource[i].verifyDueDate) {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('verificationComplianceReview') + this.$t('cutoffTime') + this.$t('cannotEmpty') } < /div>)
|
||
continue
|
||
}
|
||
}
|
||
this.detailedSuccessList.push(dataSource[i])
|
||
|
||
} else {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + this.$t('TheEngineerAndCertification') } < /div>)
|
||
// this.$message.warning(this.dataSource[i].serialNumber + this.$t('TheEngineerAndCertification'))
|
||
// isTrue = false
|
||
// return
|
||
}
|
||
} else {
|
||
this.detailedWarningList.push( < div > { dataSource[i].serialNumber + ',' + this.$t('pleaseSelectinitiatedOrRejected') } < /div>)
|
||
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseSelectinitiatedOrRejected'))
|
||
// isTrue = false
|
||
// return
|
||
}
|
||
}
|
||
if (this.detailedSuccessList && this.detailedSuccessList.length > 0) {
|
||
this.visible = true
|
||
this.formInline = {}
|
||
} else {
|
||
let that = this
|
||
this.$warning({
|
||
content: (
|
||
< div >
|
||
{ that.detailedWarningList }
|
||
< /div>
|
||
)
|
||
})
|
||
}
|
||
} else {
|
||
this.$message.warning(this.$t('selectLeastOne'))
|
||
}
|
||
},
|
||
|
||
initiateTaskConfirmationClick(name) {
|
||
this.timeName = name
|
||
this.listTitle = this.$t('taskConfirmationDeadline')
|
||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||
let isTrue = true
|
||
this.TaskSuccessList = []
|
||
this.TaskWarningList = []
|
||
let dataList = []
|
||
for (let i = 0; i < this.dataSource.length; i++) {
|
||
for (let j = 0; j < selectedRowKeys.length; j++) {
|
||
if (this.dataSource[i].id == selectedRowKeys[j]) {
|
||
dataList.push(this.dataSource[i])
|
||
}
|
||
}
|
||
}
|
||
for (let i = 0; i < dataList.length; i++) {
|
||
if ((dataList[i].taskAffirmStatus == 'Not started' || dataList.taskAffirmStatus == 'Rejected') &&
|
||
dataList[i].inventoryAffirmStatus == 'Accepted') {
|
||
if (dataList[i].engineeringInterfacePerson) {
|
||
if (dataList[i].verifyDeliverableType) {
|
||
if (dataList[i].verifyDueDate && dataList[i].verifyDutyId
|
||
&& dataList[i].verifyInitiatorId) {
|
||
} else {
|
||
this.TaskWarningList.push( < div > { dataList[i].serialNumber + this.$t('pleaseConformityVerification') } < /div>)
|
||
continue
|
||
// isTrue = false
|
||
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConformityVerification'))
|
||
// return
|
||
}
|
||
}
|
||
|
||
if (dataList[i].prehomoDeliverableType) {
|
||
if (dataList[i].prehomoDueDate && dataList[i].prehomoDutyId
|
||
&& dataList[i].prehomoInitiatorId) {
|
||
} else {
|
||
this.TaskWarningList.push( < div > { dataList[i].serialNumber + this.$t('pleaseConfirmedByPrehomo') } < /div>)
|
||
continue
|
||
// isTrue = false
|
||
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConfirmedByPrehomo'))
|
||
// return
|
||
}
|
||
}
|
||
|
||
if (dataList[i].designDeliverableType) {
|
||
if (dataList[i].designDueDate && dataList[i].designDutyId
|
||
&& dataList[i].designInitiatorId) {
|
||
} else {
|
||
this.TaskWarningList.push( < div > { dataList[i].serialNumber + this.$t('pleaseDesignConformityConfirmation') } < /div>)
|
||
continue
|
||
// isTrue = false
|
||
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseDesignConformityConfirmation'))
|
||
// return
|
||
}
|
||
}
|
||
this.TaskSuccessList.push(dataList[i])
|
||
} else {
|
||
this.TaskWarningList.push( < div > { dataList[i].serialNumber + this.$t('theProjectContactEmpty') } < /div>)
|
||
// isTrue = false
|
||
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('theProjectContactEmpty'))
|
||
// return
|
||
}
|
||
} else {
|
||
this.TaskWarningList.push( < div > { dataList[i].serialNumber + this.$t('PleaseTaskConfirmationRejected') } < /div>)
|
||
// isTrue = false
|
||
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('PleaseTaskConfirmationRejected'))
|
||
// return
|
||
}
|
||
}
|
||
if (this.TaskSuccessList && this.TaskSuccessList.length > 0) {
|
||
this.visible = true
|
||
this.formInline = {}
|
||
} else {
|
||
let that = this
|
||
this.$warning({
|
||
content: (
|
||
< div >
|
||
{ that.TaskWarningList }
|
||
< /div>
|
||
)
|
||
})
|
||
}
|
||
} else {
|
||
this.$message.warning(this.$t('selectLeastOne'))
|
||
}
|
||
},
|
||
|
||
handleOk() {
|
||
this.$refs.ruleForm.validate(valid => {
|
||
if (valid) {
|
||
if (this.timeName == '清单') {
|
||
let selectedRowKeys = []
|
||
this.detailedSuccessList.forEach(res => {
|
||
selectedRowKeys.push(res.id)
|
||
})
|
||
let query = {
|
||
operatorType: 0,
|
||
ids: selectedRowKeys.join(','),
|
||
projectLibraryId: this.$route.query.id,
|
||
...this.formInline
|
||
}
|
||
this.confirmLoading = true
|
||
postAction(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
|
||
}
|
||
let that = this
|
||
if (this.detailedWarningList.length > 0) {
|
||
this.$warning({
|
||
content: (
|
||
< div >
|
||
{ that.detailedWarningList }
|
||
< /div>
|
||
)
|
||
})
|
||
}
|
||
this.detailedSuccessList = []
|
||
this.detailedWarningList = []
|
||
})
|
||
} else {
|
||
for (let i = 0; i < this.TaskSuccessList.length; i++) {
|
||
((i) => {
|
||
this.TaskSuccessList[i].taskAffirmDueDate = this.formInline.taskAffirmDueDate
|
||
Object.keys(this.TaskSuccessList[i]).forEach(res => {
|
||
if (this.TaskSuccessList[i][res] && this.TaskSuccessList[i][res] instanceof String) {
|
||
this.TaskSuccessList[i][res] = this.TaskSuccessList[i][res].replace(/\"/g, '“')
|
||
this.TaskSuccessList[i][res] = this.TaskSuccessList[i][res].replace(/\'/g, '‘')
|
||
}
|
||
})
|
||
setTimeout(() => {
|
||
this.confirmLoading = true
|
||
this.startProcess(this.TaskSuccessList[i], (i + 1))
|
||
}, 500)
|
||
})(i)
|
||
}
|
||
}
|
||
}
|
||
})
|
||
},
|
||
|
||
startProcess(value, index) {
|
||
let query = {
|
||
type: 1,
|
||
msg: JSON.stringify(value).replace(/\"/g, '\''),
|
||
projectNameId: this.$route.query.projectNameId,
|
||
projectName: this.$route.query.projectName,
|
||
projectLawsInventoryId: value.id,
|
||
taskAffirmDueDate: this.formInline.taskAffirmDueDate
|
||
}
|
||
postAction('/workFlow/startProcess', query).then((res) => {
|
||
if (res.success) {
|
||
this.completeTask(value, res.result, index)
|
||
}
|
||
})
|
||
},
|
||
|
||
completeTask(value, taskId, index) {
|
||
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) {
|
||
if (index == this.TaskSuccessList.length) {
|
||
this.visible = false
|
||
this.selectedRowKeys = []
|
||
this.$message.success(this.$t('OperationSuccessful'))
|
||
this.confirmLoading = false
|
||
this.getList()
|
||
let that = this
|
||
if (this.TaskWarningList.length > 0) {
|
||
this.$warning({
|
||
content: (
|
||
< div >
|
||
{ that.TaskWarningList }
|
||
< /div>
|
||
)
|
||
})
|
||
}
|
||
}
|
||
} else {
|
||
this.$message.warning(this.$t('operationFailed'))
|
||
}
|
||
})
|
||
},
|
||
|
||
getRowKeys(value, num, callBack) {
|
||
let isTrue = true
|
||
let dataSource = []
|
||
for (let i = 0; i < this.dataSource.length; i++) {
|
||
for (let j = 0; j < value.length; j++) {
|
||
if (this.dataSource[i].id == value[j]) {
|
||
dataSource.push(this.dataSource[i])
|
||
}
|
||
}
|
||
}
|
||
this.rowKeysSuccessList = []
|
||
this.rowKeysWarningList = []
|
||
for (let i = 0; i < dataSource.length; i++) {
|
||
if (dataSource[i].inventoryAffirmStatus == 'List to confirm') {
|
||
if (dataSource[i].roleCode == 1 && dataSource[i].regulationOwnerSubmitStatus) {
|
||
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('submitted') } < /div>)
|
||
continue
|
||
// isTrue = false
|
||
// this.$message.warning(dataSource[i].serialNumber + this.$t('submitted'))
|
||
// return
|
||
} else if (dataSource[i].roleCode == 2 && dataSource[i].homologationEngineerSubmitStatus) {
|
||
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('submitted') } < /div>)
|
||
continue
|
||
// isTrue = false
|
||
// this.$message.warning(dataSource[i].serialNumber + this.$t('submitted'))
|
||
// return
|
||
} else if (dataSource[i].roleCode == 4 && (dataSource[i].homologationEngineerSubmitStatus && dataSource[i].regulationOwnerSubmitStatus)) {
|
||
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('submitted') } < /div>)
|
||
continue
|
||
// isTrue = false
|
||
// this.$message.warning(dataSource[i].serialNumber + this.$t('submitted'))
|
||
// return
|
||
}
|
||
if (num == 1) {
|
||
if ((dataSource[i].designInitiatorId == dataSource[i].regulationOwnerId
|
||
&& dataSource[i].designInitiatorId == this.userInfo().id) ||
|
||
(dataSource[i].designInitiatorId == dataSource[i].homologationEngineerId
|
||
&& dataSource[i].designInitiatorId == this.userInfo().id)) {
|
||
if (!dataSource[i].designDutyId && !dataSource[i].designDueDate) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('confirmationOfDesignConformity') + this.$t('theResponsiblePersonAndDeadlineClank') } < /div>)
|
||
continue
|
||
} else if (!dataSource[i].designDutyId) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('confirmationOfDesignConformity') + this.$t('theResponsiblePersonEmpty') } < /div>)
|
||
continue
|
||
} else if (!dataSource[i].designDueDate) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('confirmationOfDesignConformity') + this.$t('theDeadlineEmpty') } < /div>)
|
||
continue
|
||
}else if (!dataSource[i].designDeliverableType) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('confirmationOfDesignConformity') + this.$t('theDeliveryTypeCannotBeEmpty') } < /div>)
|
||
continue
|
||
}
|
||
}
|
||
if ((dataSource[i].prehomoInitiatorId == dataSource[i].regulationOwnerId
|
||
&& dataSource[i].prehomoInitiatorId == this.userInfo().id) ||
|
||
(dataSource[i].prehomoInitiatorId == dataSource[i].homologationEngineerId
|
||
&& dataSource[i].prehomoInitiatorId == this.userInfo().id)) {
|
||
if (!dataSource[i].prehomoDutyId && !dataSource[i].prehomoDueDate) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('PrehomoConfirmation') + this.$t('theResponsiblePersonAndDeadlineClank') } < /div>)
|
||
continue
|
||
} else if (!dataSource[i].prehomoDutyId) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('PrehomoConfirmation') + this.$t('theResponsiblePersonEmpty') } < /div>)
|
||
continue
|
||
} else if (!dataSource[i].prehomoDueDate) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('PrehomoConfirmation') + this.$t('theDeadlineEmpty') } < /div>)
|
||
continue
|
||
}else if (!dataSource[i].prehomoDeliverableType) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('PrehomoConfirmation') + this.$t('theDeliveryTypeCannotBeEmpty') } < /div>)
|
||
continue
|
||
}
|
||
}
|
||
if ((dataSource[i].verifyInitiatorId == dataSource[i].regulationOwnerId
|
||
&& dataSource[i].verifyInitiatorId == this.userInfo().id) ||
|
||
(dataSource[i].verifyInitiatorId == dataSource[i].homologationEngineerId
|
||
&& dataSource[i].verifyInitiatorId == this.userInfo().id)) {
|
||
if (!dataSource[i].verifyDutyId && !dataSource[i].verifyDueDate) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('verificationAndConformityconfirmation') + this.$t('theResponsiblePersonAndDeadlineClank') } < /div>)
|
||
continue
|
||
} else if (!dataSource[i].verifyDutyId) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('verificationAndConformityconfirmation') + this.$t('theResponsiblePersonEmpty') } < /div>)
|
||
continue
|
||
} else if (!dataSource[i].verifyDueDate) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('verificationAndConformityconfirmation') + this.$t('theDeadlineEmpty') } < /div>)
|
||
continue
|
||
}else if (!dataSource[i].verifyDeliverableType) {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('verificationAndConformityconfirmation') + this.$t('theDeliveryTypeCannotBeEmpty') } < /div>)
|
||
continue
|
||
}
|
||
}
|
||
}
|
||
this.rowKeysSuccessList.push(dataSource[i])
|
||
} else {
|
||
this.rowKeysWarningList.push( < div > { dataSource[i].serialNumber + this.$t('incorrectsubmitted') } < /div>)
|
||
// isTrue = false
|
||
// this.$message.warning(dataSource[i].serialNumber+ this.$t('incorrectsubmitted'))
|
||
// return
|
||
}
|
||
}
|
||
|
||
if (this.rowKeysSuccessList && this.rowKeysSuccessList.length > 0) {
|
||
callBack && callBack()
|
||
} else {
|
||
let that = this
|
||
this.$warning({
|
||
content: (
|
||
< div >
|
||
{ that.rowKeysWarningList }
|
||
< /div>
|
||
)
|
||
})
|
||
}
|
||
},
|
||
|
||
updateStatusBatch(num, selectedRowKeys) {
|
||
let _this = this
|
||
let lawsInventoryList = []
|
||
for (let i = 0; i < this.rowKeysSuccessList.length; i++) {
|
||
let roleCode
|
||
if (this.rowKeysSuccessList[i].regulationOwnerId == this.userInfo().id &&
|
||
this.rowKeysSuccessList[i].homologationEngineerId == this.userInfo().id) {
|
||
roleCode = 4
|
||
} else if (this.rowKeysSuccessList[i].regulationOwnerId == this.userInfo().id) {
|
||
roleCode = 1
|
||
} else if (this.rowKeysSuccessList[i].homologationEngineerId == this.userInfo().id) {
|
||
roleCode = 2
|
||
}
|
||
lawsInventoryList.push({
|
||
id: this.rowKeysSuccessList[i].id,
|
||
roleCode: roleCode
|
||
})
|
||
}
|
||
let query = {
|
||
operatorType: 1,
|
||
lawsInventoryList: lawsInventoryList,
|
||
projectLibraryId: _this.$route.query.id,
|
||
operatorResult: num
|
||
}
|
||
postAction(_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
|
||
}
|
||
if (this.rowKeysWarningList && this.rowKeysWarningList.length > 0) {
|
||
let that = this
|
||
this.$warning({
|
||
content: (
|
||
< div >
|
||
{ that.rowKeysWarningList }
|
||
< /div>
|
||
)
|
||
})
|
||
}
|
||
this.rowKeysWarningList = []
|
||
this.rowKeysSuccessList = []
|
||
})
|
||
},
|
||
|
||
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, 1, function() {
|
||
_this.updateStatusBatch(num, selectedRowKeys)
|
||
})
|
||
} else {
|
||
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
|
||
_this.getRowKeys(selectedRowKeys, 2, function() {
|
||
_this.visibleComment = true
|
||
_this.formInlineComment = {}
|
||
_this.$nextTick(()=>{
|
||
_this.$refs.ruleFormComment.clearValidate()
|
||
})
|
||
})
|
||
}
|
||
}
|
||
})
|
||
} else {
|
||
this.$message.warning(this.$t('selectLeastOne'))
|
||
}
|
||
},
|
||
handleOkComment() {
|
||
this.$refs.ruleFormComment.validate(valid => {
|
||
if (valid) {
|
||
let url = '/project/projectCommentEO/add'
|
||
let content = []
|
||
if (this.rowKeysSuccessList && this.rowKeysSuccessList.length > 0) {
|
||
this.rowKeysSuccessList.forEach(res => {
|
||
content.push(res.serialNumber)
|
||
})
|
||
}
|
||
let query = {
|
||
commentContent: this.$t('For')+content.join(',') + this.$t('markedRejection')+':' + 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 + '&userName=' + this.userInfo().username))
|
||
} 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 + '&userName=' + this.userInfo().username))
|
||
} 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, userName: this.userInfo().username })
|
||
}
|
||
},
|
||
|
||
download(item) {
|
||
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id, userName: this.userInfo().username })
|
||
},
|
||
|
||
clickButtonToUpload(item, num) {
|
||
if (num == 1) {
|
||
this.isResultReported = true
|
||
this.fileTitle = this.$t('resultReported')
|
||
} else {
|
||
this.isResultReported = false
|
||
this.fileTitle = this.$t('deliverableTemplate')
|
||
}
|
||
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'))
|
||
}
|
||
})
|
||
}
|
||
})
|
||
},
|
||
|
||
resultReportedClick(val) {
|
||
if (val.regulationOwnerId == this.userInfo().id) {
|
||
this.$refs.resultReportedUploadRef.clickButtonToUploadFile(val)
|
||
} else {
|
||
if (val.fileId) {
|
||
this.clickButtonToUpload(val.fileId, 1)
|
||
} else {
|
||
this.$message.warning(this.$t('reportNotUploaded'))
|
||
}
|
||
}
|
||
},
|
||
standardClick(row) {
|
||
let newUrl = this.$router.resolve({
|
||
path: '/docManage/library/detail',
|
||
query: {
|
||
id: row.standId
|
||
}
|
||
})
|
||
window.open(newUrl.href, '_blank')
|
||
}
|
||
}
|
||
}
|
||
</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: 92px;
|
||
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;
|
||
}
|
||
|
||
.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;
|
||
}
|
||
|
||
.textName {
|
||
width: 100%;
|
||
overflow: hidden;
|
||
display: -webkit-box;
|
||
text-overflow: ellipsis;
|
||
/*! autoprefixer: off */
|
||
-webkit-box-orient: vertical;
|
||
-webkit-line-clamp: 1;
|
||
/*! autoprefixer: on;*/
|
||
text-justify: inter-ideograph;
|
||
word-break: break-all
|
||
}
|
||
</style>
|
||
<style>
|
||
.box-input .ant-select-selection {
|
||
height: 38px !important;
|
||
}
|
||
|
||
.box-input .ant-select-selection__rendered {
|
||
line-height: 38px;
|
||
}
|
||
|
||
.popconfirm {
|
||
z-index: 999;
|
||
}
|
||
|
||
.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;
|
||
}
|
||
|
||
.tableList .ant-table-thead > tr > th {
|
||
padding: 7px 16px !important;
|
||
}
|
||
</style> |