Files
laws-sinotruk-client/src/views/enterpriseStandardLibrary/reviewPlan/ReviewPlanList.vue
T

256 lines
9.2 KiB
Vue
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="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!-- 企标编号 -->
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.reviewPlan.enterpriseStandardNum')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.reviewPlan.enterpriseStandardNum')" v-model="queryParam.standardNo"></a-input>
</a-form-item>
</a-col>
<!-- 企标名称 -->
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.reviewPlan.enterpriseStandardName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.reviewPlan.enterpriseStandardName')" v-model="queryParam.standardName"></a-input>
</a-form-item>
</a-col>
<!-- 发布日期 -->
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.reviewPlan.publishDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
@change="publishDateChange"
v-model="queryParam.publishDate">
</a-range-picker>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<!-- 复审日期 -->
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.reviewPlan.reviewDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
@change="reviewDateChange"
v-model="queryParam.reviewData">
</a-range-picker>
</a-form-item>
</a-col>
</template>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a @click="handleToggleSearch">
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'enterpriseStandardLibrary:recheckPlan:search'">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div class="table-operator">
<!-- 发起复审 -->
<a-button icon="plus" type="primary" ghost v-has="'enterpriseStandardLibrary:reviewPlan:initReview'"
@click="handleInitReview">
{{ $t('enterpriseStandardLibrary.reviewPlan.initReview') }}
</a-button>
<!-- 批量复审 -->
<a-button icon="plus" type="primary" ghost v-has="'enterpriseStandardLibrary:reviewPlan:initReview'"
@click="handleBatchReview">
{{ $t('enterpriseStandardLibrary.reviewPlan.batchReview') }}
</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%', y: yScrollHeight}"
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<!-- 企标编号/企标名称 -->
<template v-slot:toDetail="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a v-if="text" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 复审日期 当前日期在复审日期的后七天之内标红 -->
<template slot="reviewDate" slot-scope="{text}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text" :class="{'table-red-text' : text && isRed(text)}">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
</div>
</a-card>
</template>
<script>
import JTable from '@/components/jero/JTable'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { reviewPlanBatchReview } from '../../../api/enterpriseStandardLibraryApi'
export default {
name: 'ReviewPlanList',
components: { JTable },
mixins: [JeroListMixin],
data () {
return {
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
width: 80,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 企标编号
title: this.$t('enterpriseStandardLibrary.reviewPlan.enterpriseStandardNum'),
align: 'center',
width: 180,
dataIndex: 'standardNo',
scopedSlots: { customRender: 'toDetail' }
},
{ // 企标名称
title: this.$t('enterpriseStandardLibrary.reviewPlan.enterpriseStandardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'toDetail' }
},
{ // 发布日期
title: this.$t('enterpriseStandardLibrary.reviewPlan.publishDate'),
align: 'center',
width: 180,
dataIndex: 'releaseDate',
scopedSlots: { customRender: 'text' }
},
{ // 复审日期
title: this.$t('enterpriseStandardLibrary.reviewPlan.reviewDate'),
align: 'center',
width: 180,
dataIndex: 'recheckDate',
scopedSlots: { customRender: 'reviewDate' }
},
{ // 复审结果
title: this.$t('enterpriseStandardLibrary.reviewPlan.reviewResult'),
align: 'center',
width: 180,
dataIndex: 'recheckResult_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主起草人
title: this.$t('enterpriseStandardLibrary.reviewPlan.principalDrafter'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUser_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主起草单位
title: this.$t('enterpriseStandardLibrary.reviewPlan.mainDraftingUnit'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUnit_dictText',
scopedSlots: { customRender: 'text' }
}
],
labelCol: {
span: 4
},
wrapperCol: {
span: 14
},
url: {
list: '/enterprise/recheckPlan/page'
}
}
},
methods: {
isRed (reviewDate) {
const reviewDateDate = new Date(Date.parse(reviewDate))
const currentDate = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
const reviewDatePlusSeven = reviewDateDate.setDate(reviewDateDate.getDate() + 7)
return new Date(Date.parse(reviewDate)) < new Date(Date.parse(currentDate)) && new Date(Date.parse(currentDate)) <= reviewDatePlusSeven
},
// 发布日期改变
publishDateChange (val) {
this.queryParam.releaseStartDate = val[0]
this.queryParam.releaseEndDate = val[1]
},
// 复审日期改变
reviewDateChange (val) {
this.queryParam.recheckStartDate = val[0]
this.queryParam.recheckEndDate = val[1]
},
// 点击跳转企标详情
handleGoDetail (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
standardNumber: record.standardNo
}
})
},
// 发起复审
handleInitReview () {
if (this.selectedRowKeys.length !== 1) {
this.$message.warning(this.$t('selectARecord'))
return
}
this.$router.push({
path: '/workCenter/enterpriseStandardRecheck/enterpriseStandardRecheckFlow',
query: {
recheckPlanId: this.selectedRowKeys[0]
}
})
},
// 批量复审
handleBatchReview () {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning(this.$t('selectAtLeastOne'))
return
}
const param = {}
param.recheckPlanIds = this.selectedRowKeys.join(',')
reviewPlanBatchReview(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
this.selectedRowKeys = []
} else {
this.$message.warning(res.message)
}
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .ant-form-item-label{
min-width: 70px !important;
}
</style>