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

343 lines
10 KiB
Java

<template>
<a-card :bordered="false">
<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" style="width: 64px" :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>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<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">
<div @click="handleExport" class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{ $t('export') }}
</div>
</div>
<div>
<a-table
ref="table"
size="middle"
:loading="loading"
rowKey="uuid"
:pagination="false"
:scroll="{x: '100%'}"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:data-source="dataSource"
:columns="columns"
>
<span slot="standard" slot-scope="text,result">
<a @click="standardClick(result)" class="textName" :title="text">
{{text}}
</a>
</span>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
</a-card>
</template>
<script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import store from '@/store/'
export default {
name: 'nonConformance',
data() {
return {
queryParam: {},
loading: false,
dataSource: [],
selectedRowKeys: [],
columns: [
{
title: this.$t('standard'),
align: 'center',
dataIndex: 'serialNumber',
scopedSlots: { customRender: 'standard' },
ellipsis: true,
width: 180
},
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title',
ellipsis: true,
width: 180,
scopedSlots: { customRender: 'standard' }
},
{
title: this.$t('ProcessType'),
align: 'center',
dataIndex: 'flowType',
ellipsis: true,
width: 180
},
{
title: this.$t('areaOfResponsibility'),
align: 'center',
dataIndex: 'dutyTerritory',
ellipsis: true,
width: 180
},
{
title: this.$t('problemType'),
align: 'center',
dataIndex: 'problemType',
ellipsis: true,
width: 180
},
{
title: this.$t('Sponsor'),
align: 'center',
dataIndex: 'initiator',
ellipsis: true,
width: 140
},
{
title: this.$t('personLiable'),
align: 'center',
dataIndex: 'duty',
ellipsis: true,
width: 140
}
],
total: 0,
pageSize: 10,
pageNo: 1,
url: {
page: '/project/ncrTrackController/queryPageInfo',
exportData: '/project/ncrTrackController/exportDataInfo'
}
}
},
mounted() {
this.getList()
},
created() {
if (store.getters.userInfo) {
this.$socketPublic.dispatch('webSocketInit')//初始化ws
}
},
watch: {
'$socketPublic.state.msg': {
//处理接收到的消息
handler: function(res) {
let that = this
let data = JSON.parse(res.data)
if (data.msgId) {
this.getList()
}
}
}
},
methods: {
searchQuery() {
this.pageNo = 1
this.getList()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.getList()
},
pageOnChange(page, pageSize) {
this.pageNo = page
this.getList()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getList()
},
onSelectChange(value) {
this.content = []
this.selectedRowKeys = value
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.dataSource.forEach(res => {
this.selectedRowKeys.forEach(val => {
if (res.uuid == val) {
this.content.push({
id: res.id,
flowType: res.flowType
})
}
})
})
}
},
handleExport() {
let query = {
...this.queryParam,
projectLibraryId: this.$route.query.id,
ncrTrackVOList: JSON.stringify(this.content)
}
downloadFile(this.url.exportData, this.$t('NonConformance') + '.xls', query, this.Deselect)
},
getList() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectLibraryId: this.$route.query.id,
...this.queryParam
}
this.loading = true
getAction(this.url.page, query).then((res) => {
if (res.success) {
this.dataSource = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.dataSource = []
this.loading = false
}
})
},
standardClick(val) {
let num = val.prcType
let query = {
taskIds: val.taskId,
projectTaskInventoryId: val.projectLawsInventoryId,
projectLibraryId: val.projectLibraryId,
projectName: val.projectName,
id: val.projectLibraryId,
serialNumber: val.serialNumber,
actiProcInstId: val.prcId,
primaryKeyId: val.projectTaskInventoryDetailId,
TaskKey: val.taskDefinitionKey,
isDisplay: val.status == 'NotDone' ? true : false
}
switch (num) {
case '2':
query.flowType = 2
query.Sponsor = 'designInitiatorName'
query.personLiable = 'designDutyName'
query.typeOfDeliverables = 'designDeliverableTypeName'
query.deliverableTemplate = 'designDeliverableTemplate'
query.DueDate = 'designDueDate'
query.remarks = 'designRemark'
break
case '3':
query.flowType = 3
query.Sponsor = 'prehomoInitiatorName'
query.personLiable = 'prehomoDutyName'
query.typeOfDeliverables = 'prehomoDeliverableTypeName'
query.deliverableTemplate = 'prehomoDeliverableTemplate'
query.DueDate = 'prehomoDueDate'
query.remarks = 'prehomoRemark'
break
case '4':
query.flowType = 4
query.Sponsor = 'verifyInitiatorName'
query.personLiable = 'verifyDutyName'
query.typeOfDeliverables = 'verifyDeliverableTypeName'
query.deliverableTemplate = 'verifyDeliverableTemplate'
query.DueDate = 'verifyDueDate'
query.remarks = 'verifyRemark'
break
}
let newUrl = this.$router.resolve({
path: '/taskListProcess',
query: query
})
window.open(newUrl.href, '_blank')
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 32px;
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;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
/*margin-top: 2px;*/
}
.page {
text-align: right;
margin-top: 20px;
}
.textName {
width: 100%;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*! autoprefixer: on;*/
text-justify: inter-ideograph;
word-break: break-all
}
</style>