|
@@ -14,19 +14,39 @@
|
|
|
<detail-list-item term="型号">{{ model.model }}</detail-list-item>
|
|
|
<detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
|
|
|
</detail-list>
|
|
|
- <title-divider title="保养信息" width="90px"></title-divider>
|
|
|
+ <title-divider title="保养任务" width="90px"></title-divider>
|
|
|
<div class="table-operator" style="margin-bottom:8px;">
|
|
|
- <a-button type="primary" @click="handleAdd">
|
|
|
+ <!-- <a-button type="primary" @click="handleAdd">
|
|
|
<a-icon type="plus"/>
|
|
|
添加
|
|
|
+ </a-button>-->
|
|
|
+ <a-button type="primary" @click="handleExecuteBatch" v-if="selectedRowKeys.length > 0">
|
|
|
+ <a-icon style="margin-left: 8px" type="plus"/>
|
|
|
+ 批量接收
|
|
|
</a-button>
|
|
|
- <!-- <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>-->
|
|
|
+ <a-button style="margin-left: 8px" type="primary" v-if="selectedRowKeys.length > 0" @click="handleFinishBatch">
|
|
|
+ <a-icon type="plus"/>
|
|
|
+ 批量完成
|
|
|
+ </a-button>
|
|
|
+ <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>
|
|
|
+ <a-select
|
|
|
+ style="margin-left: 8px;width:100px;"
|
|
|
+ @change="statusChange"
|
|
|
+ placeholder="请选择">
|
|
|
+ <a-select-option
|
|
|
+ v-for="(label,value) in statusMap"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
</div>
|
|
|
<a-table
|
|
|
:data-source="data"
|
|
|
:columns="columns"
|
|
|
tableLayout="auto"
|
|
|
- :scroll="{x: 1000 }"
|
|
|
+ :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
+ :scroll="{x: 1500 }"
|
|
|
rowKey="id">
|
|
|
<span slot="action" slot-scope="record">
|
|
|
<template>
|
|
@@ -48,14 +68,14 @@
|
|
|
</span>
|
|
|
</a-table>
|
|
|
<base-form ref="baseModal" :check-type="checkType" @ok="handleOk"/>
|
|
|
- <detail ref="detailModal"/>
|
|
|
+ <detail ref="detailModal" @ok="handleOk"/>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import DetailList from '@/components/tools/DetailList'
|
|
|
-import { queryCheckJob, deleteCheckJobs, fetchCheckJob, exportCheckJob, executeJob } from '@/api/check/checkjob'
|
|
|
+import { queryCheckJob, deleteCheckJobs, fetchCheckJob, exportCheckJob, executeJobBatch, finishJobBatch } from '@/api/check/checkjob'
|
|
|
import BaseForm from './BaseForm'
|
|
|
import Detail from './Detail'
|
|
|
import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
|
|
@@ -81,6 +101,9 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ status: null,
|
|
|
+ selectedRowKeys: [], // Check here to configure the default column
|
|
|
+ optionAlertShow: false,
|
|
|
confirmLoading: false,
|
|
|
mdl: {},
|
|
|
model: {
|
|
@@ -104,6 +127,8 @@ export default {
|
|
|
{
|
|
|
title: '序号',
|
|
|
dataIndex: 'index',
|
|
|
+ checked: true,
|
|
|
+ width: '100px',
|
|
|
customRender: (text, record, index) => {
|
|
|
return index + 1
|
|
|
}
|
|
@@ -158,13 +183,16 @@ export default {
|
|
|
title: '任务状态',
|
|
|
dataIndex: 'status',
|
|
|
checked: true,
|
|
|
+ width: '100px',
|
|
|
+ fixed: 'right',
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
key: 'action',
|
|
|
- width: '200px',
|
|
|
+ width: '250px',
|
|
|
align: 'center',
|
|
|
+ fixed: 'right',
|
|
|
scopedSlots: { customRender: 'action' },
|
|
|
checked: true
|
|
|
}
|
|
@@ -216,6 +244,7 @@ export default {
|
|
|
},
|
|
|
handleCancel () {
|
|
|
this.visible = false
|
|
|
+ this.selectedRowKeys = []
|
|
|
this.confirmLoading = false
|
|
|
this.$emit('ok')
|
|
|
},
|
|
@@ -246,6 +275,41 @@ export default {
|
|
|
},
|
|
|
handleSbSelect () {
|
|
|
this.$refs.sbInfoSelectModal.base()
|
|
|
+ },
|
|
|
+ onSelectChange (selectedRowKeys) {
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
+ },
|
|
|
+ handleExecuteBatch () {
|
|
|
+ let ids = []
|
|
|
+ const length = this.selectedRowKeys.length
|
|
|
+ if (length === 0) {
|
|
|
+ this.$message.info('请选择记录')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(this.selectedRowKeys)
|
|
|
+ ids = this.selectedRowKeys
|
|
|
+ executeJobBatch(ids).then(res => {
|
|
|
+ this.$message.info('接收成功')
|
|
|
+ this.handleOk()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFinishBatch () {
|
|
|
+ let ids = []
|
|
|
+ const length = this.selectedRowKeys.length
|
|
|
+ if (length === 0) {
|
|
|
+ this.$message.info('请选择记录')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ids = this.selectedRowKeys
|
|
|
+ finishJobBatch(ids).then(res => {
|
|
|
+ this.$message.info('完成成功')
|
|
|
+ this.handleOk()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ statusChange (value) {
|
|
|
+ queryCheckJob({ sbId: this.model.id, type: this.checkType, status: value }).then(res => {
|
|
|
+ this.data = res.data
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|