|
@@ -4,17 +4,17 @@
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-form layout="inline">
|
|
|
<a-row :gutter="48">
|
|
|
- <a-col :md="8" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="计划名称">
|
|
|
<a-input v-model="queryParam.planName" placeholder="请输入计划名称"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="8" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="负责人">
|
|
|
<a-input v-model="queryParam.keyword" placeholder="请输入负责人"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="8" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="任务状态">
|
|
|
<a-select
|
|
|
v-model="queryParam.status"
|
|
@@ -28,9 +28,27 @@
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="8 || 24" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="起始日期">
|
|
|
+ <a-date-picker
|
|
|
+ v-model="queryParam.searchStartTime"
|
|
|
+ style="width: 100%"
|
|
|
+ :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="结束日期">
|
|
|
+ <a-date-picker
|
|
|
+ v-model="queryParam.searchEndTime"
|
|
|
+ style="width: 100%"
|
|
|
+ :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="24" :sm="24">
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
+ <a-button type="primary" @click="handleOk">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
|
|
|
</span>
|
|
|
</a-col>
|
|
@@ -38,10 +56,11 @@
|
|
|
</a-form>
|
|
|
</div>
|
|
|
|
|
|
- <!-- <div class="table-operator">
|
|
|
- <a-button v-if="$auth('check-jobs-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
|
|
|
+ <div class="table-operator">
|
|
|
+ <a-button v-if="$auth('check-polling-jobs-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
|
|
|
<a-button style="margin-left: 8px" v-if="($auth('check-spot-jobs-export') || $auth('check-polling-jobs-export'))" type="primary" icon="download" @click="doExport">导出</a-button>
|
|
|
- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-jobs-finish') || $auth('check-polling-jobs-finish'))">
|
|
|
+ <a-button style="margin-left: 8px" v-if="($auth('check-spot-jobs-export') || $auth('check-polling-jobs-export'))" type="success" @click="handleSeven">近七日</a-button>
|
|
|
+ <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-jobs-edit') || $auth('check-polling-jobs-edit'))">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
|
|
|
<a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
|
|
@@ -51,8 +70,7 @@
|
|
|
批量操作 <a-icon type="down" />
|
|
|
</a-button>
|
|
|
</a-dropdown>
|
|
|
- </div>-->
|
|
|
-
|
|
|
+ </div>
|
|
|
<s-table
|
|
|
ref="table"
|
|
|
size="default"
|
|
@@ -67,13 +85,13 @@
|
|
|
<template>
|
|
|
<a @click="handleView(record)">查看</a>
|
|
|
<template v-if="record.status === DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a @click="handleFinish(record)">完成</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="handleFinish(record)">完成</a>
|
|
|
</template>
|
|
|
<template v-if="record.status != DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a @click="handleEdit(record)">修改</a>
|
|
|
- </template>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="handleEdit(record)">修改</a>
|
|
|
+ </template>
|
|
|
<!-- <a-divider type="vertical" />-->
|
|
|
<!-- <a-popconfirm v-if="$auth('check-jobs-del')" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">-->
|
|
|
<!-- <a>删除</a>-->
|
|
@@ -93,7 +111,7 @@
|
|
|
</s-table>
|
|
|
</div>
|
|
|
<base-form :check-type="checkType" ref="baseModal" @ok="handleOk"/>
|
|
|
- <detail :check-type="checkType" ref="detailModal" @ok="handleOk"/>
|
|
|
+ <detail :check-type="checkType" ref="detailModal" @ok="handleOk"/>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
@@ -102,6 +120,7 @@ import { STable, Ellipsis } from '@/components'
|
|
|
import BaseForm from './modules/BaseForm'
|
|
|
import Detail from './modules/Detail'
|
|
|
import { queryNum, getCheckJobPage, deleteCheckJobs, fetchCheckJob, exportCheckJob, executeJob } from '@/api/check/checkjob'
|
|
|
+import BaseTool from '@/utils/tool'
|
|
|
|
|
|
export default {
|
|
|
name: 'CheckJobList',
|
|
@@ -131,6 +150,8 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
type: this.checkType,
|
|
|
+ searchStartTime: null,
|
|
|
+ searchEndTime: null,
|
|
|
filter: this.filter
|
|
|
},
|
|
|
// 表头
|
|
@@ -148,42 +169,42 @@ export default {
|
|
|
dataIndex: 'sbName',
|
|
|
checked: true
|
|
|
},
|
|
|
- //{
|
|
|
- // title: '计划单号',
|
|
|
- // dataIndex: 'planNo',
|
|
|
- // checked: true
|
|
|
- //},
|
|
|
+ // {
|
|
|
+ // title: '计划单号',
|
|
|
+ // dataIndex: 'planNo',
|
|
|
+ // checked: true
|
|
|
+ // },
|
|
|
{
|
|
|
title: '任务名称',
|
|
|
dataIndex: 'name',
|
|
|
checked: true
|
|
|
},
|
|
|
-/* {
|
|
|
+ /* {
|
|
|
title: '计划名称',
|
|
|
dataIndex: 'planName',
|
|
|
checked: true
|
|
|
- },*/
|
|
|
+ }, */
|
|
|
{
|
|
|
title: '负责人',
|
|
|
dataIndex: 'checkUserName',
|
|
|
checked: true
|
|
|
},
|
|
|
|
|
|
- //{
|
|
|
- // title: '负责部件',
|
|
|
- // dataIndex: 'partName',
|
|
|
- // checked: true
|
|
|
- //},
|
|
|
+ // {
|
|
|
+ // title: '负责部件',
|
|
|
+ // dataIndex: 'partName',
|
|
|
+ // checked: true
|
|
|
+ // },
|
|
|
{
|
|
|
title: '执行日期',
|
|
|
dataIndex: 'startTime',
|
|
|
checked: true
|
|
|
},
|
|
|
-/* {
|
|
|
+ /* {
|
|
|
title: '截至日期',
|
|
|
dataIndex: 'endTime',
|
|
|
checked: true
|
|
|
- },*/
|
|
|
+ }, */
|
|
|
{
|
|
|
title: '标准工时',
|
|
|
dataIndex: 'standardHours'
|
|
@@ -212,7 +233,7 @@ export default {
|
|
|
// checked: true,
|
|
|
// scopedSlots: { customRender: 'stopFlag' }
|
|
|
// },
|
|
|
- {
|
|
|
+ /* {
|
|
|
title: '创建人名称',
|
|
|
dataIndex: 'createdUserName'
|
|
|
},
|
|
@@ -220,7 +241,7 @@ export default {
|
|
|
title: '创建时间',
|
|
|
dataIndex: 'createdTime',
|
|
|
checked: true
|
|
|
- },
|
|
|
+ },*/
|
|
|
{
|
|
|
title: '操作',
|
|
|
key: 'action',
|
|
@@ -239,7 +260,7 @@ export default {
|
|
|
...parameter,
|
|
|
...this.queryParam,
|
|
|
dataScope: {
|
|
|
- sortBy: 'desc',
|
|
|
+ sortBy: 'asc',
|
|
|
sortName: 'start_time'
|
|
|
}
|
|
|
}
|
|
@@ -336,6 +357,8 @@ export default {
|
|
|
},
|
|
|
handleOk () {
|
|
|
this.visible = true
|
|
|
+ this.queryParam.searchStartTime = this.queryParam.searchStartTime ? this.queryParam.searchStartTime.format(this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN) : null
|
|
|
+ this.queryParam.searchEndTime = this.queryParam.searchEndTime ? this.queryParam.searchEndTime.format(this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN) : null
|
|
|
this.$refs.table.refresh()
|
|
|
},
|
|
|
onSelectChange (selectedRowKeys, selectedRows) {
|
|
@@ -347,9 +370,44 @@ export default {
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+ handleSeven () {
|
|
|
+ this.queryParam.searchStartTime = this.BaseTool.Date.formatter(this.getBeforeDate(0), this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
|
|
|
+ this.queryParam.searchEndTime = this.BaseTool.Date.formatter(this.getBeforeDate(-7), this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
|
|
|
+ console.log(this.queryParam.searchStartTime)
|
|
|
+ console.log(this.queryParam.searchEndTime)
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
+ getBeforeDate (num, time) {
|
|
|
+ const n = num
|
|
|
+ let d = ''
|
|
|
+ if (time) {
|
|
|
+ d = new Date(time)
|
|
|
+ } else {
|
|
|
+ d = new Date()
|
|
|
+ }
|
|
|
+ let year = d.getFullYear()
|
|
|
+ let mon = d.getMonth() + 1
|
|
|
+ let day = d.getDate()
|
|
|
+ if (day <= n) {
|
|
|
+ if (mon > 1) {
|
|
|
+ mon = mon - 1
|
|
|
+ } else {
|
|
|
+ year = year - 1
|
|
|
+ mon = 12
|
|
|
+ }
|
|
|
+ }
|
|
|
+ d.setDate(d.getDate() - n)
|
|
|
+ year = d.getFullYear()
|
|
|
+ mon = d.getMonth() + 1
|
|
|
+ day = d.getDate()
|
|
|
+ const s = year + '-' + (mon < 10 ? ('0' + mon) : mon) + '-' + (day < 10 ? ('0' + day) : day)
|
|
|
+ return s
|
|
|
+ },
|
|
|
doExport () {
|
|
|
const parameter = {
|
|
|
- ...this.queryParam
|
|
|
+ ...this.queryParam,
|
|
|
+ searchStartTime: this.queryParam.searchStartTime ? this.queryParam.searchStartTime.format(this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN) : null,
|
|
|
+ searchEndTime: this.queryParam.searchEndTime ? this.queryParam.searchEndTime.format(this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN) : null
|
|
|
}
|
|
|
exportCheckJob(parameter).then(file => {
|
|
|
this.BaseTool.UPLOAD.downLoadExportExcel(file)
|