<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 :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="维修编码">
|
<a-input placeholder="请输入维修编码" v-model="queryParam.repairCode"></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="项目名称">
|
<a-input placeholder="请输入项目名称" v-model="queryParam.repairName"></a-input>
|
</a-form-item>
|
</a-col>
|
<template v-if="toggleSearchStatus">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="维修状态">
|
<j-dict-select-tag placeholder="请选择维修状态" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="维修类型">
|
<a-select v-model="queryParam.repairType" placeholder="请选择维修类型">
|
<a-select-option value="大修">大修</a-select-option>
|
<a-select-option value="项修">项修</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="计划开始日期">
|
<a-range-picker
|
v-model="planDateRange"
|
@change="selectDateChange"
|
format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
/>
|
</a-form-item>
|
</a-col>
|
</template>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
<a @click="handleToggleSearch" style="margin-left: 8px">
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
</a>
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
|
<!-- 操作按钮区域 -->
|
<div class="table-operator">
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('eam_major_partial_repair')">导出</a-button>-->
|
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
|
<!-- <a-button type="primary" icon="import">导入</a-button>-->
|
<!-- </a-upload>-->
|
<!-- 高级查询区域 -->
|
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-menu slot="overlay">
|
<a-menu-item key="1" @click="batchSubmit"><a-icon type="form"/>提交</a-menu-item>
|
<a-menu-item key="2" @click="batchConfirm"><a-icon type="check"/>确认</a-menu-item>
|
<a-menu-item key="3" @click="batchRepeal"><a-icon type="close"/>作废</a-menu-item>
|
<a-menu-item key="4" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
</a-menu>
|
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
|
</a-dropdown>
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
</div>
|
|
<a-table
|
ref="table"
|
size="middle"
|
:scroll="{x:true}"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
class="j-table-force-nowrap"
|
@change="handleTableChange">
|
|
<template slot="htmlSlot" slot-scope="text">
|
<div v-html="text"></div>
|
</template>
|
<template slot="imgSlot" slot-scope="text,record">
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
</template>
|
<template slot="fileSlot" slot-scope="text">
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<a-button
|
v-else
|
:ghost="true"
|
type="primary"
|
icon="download"
|
size="small"
|
@click="downloadFile(text)">
|
下载
|
</a-button>
|
</template>
|
|
<span slot="action" slot-scope="text, record">
|
<a @click="handleDetail(record)">详情</a>
|
<span v-if="record.repairStatus === 'PENDING_SUBMISSION'">
|
<a-divider type="vertical" />
|
<a-popconfirm title="确定要提交吗?" @confirm="() => handleSubmit(record.id)">
|
<a>提交</a>
|
</a-popconfirm>
|
</span>
|
<span v-if="record.repairStatus === 'PENDING_CONFIRMATION'">
|
<a-divider type="vertical" />
|
<a-popconfirm title="要完成确认吗?" @confirm="() => handleConfirm(record.id)">
|
<a>确认</a>
|
</a-popconfirm>
|
</span>
|
<span v-if="record.repairStatus === 'CONFIRMED'">
|
<a-divider type="vertical" />
|
<a @click="handleFill(record)">填报</a>
|
</span>
|
|
<span v-if="record.repairStatus === 'PENDING_SUBMISSION'">
|
<a-divider type="vertical" />
|
<a-dropdown>
|
<a class="ant-dropdown-link">更多<a-icon type="down" /></a>
|
<a-menu slot="overlay">
|
<a-menu-item>
|
<a @click="handleEdit(record)">编辑</a>
|
</a-menu-item>
|
<a-menu-item>
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown>
|
</span>
|
</span>
|
|
</a-table>
|
</div>
|
|
<eam-major-partial-repair-modal ref="modalForm" @ok="modalFormOk"></eam-major-partial-repair-modal>
|
<eam-major-partial-repair-detail-modal ref="modalDetailForm" @ok="modalFormOk"></eam-major-partial-repair-detail-modal>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal'
|
import EamMajorPartialRepairDetailModal from './modules/EamMajorPartialRepairDetailModal'
|
import { getAction } from '../../../api/manage'
|
|
export default {
|
name: 'EamMajorPartialRepairList',
|
mixins:[JeecgListMixin, mixinDevice],
|
components: {
|
EamMajorPartialRepairModal,
|
EamMajorPartialRepairDetailModal
|
},
|
data () {
|
return {
|
description: '大修项修管理页面',
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key:'rowIndex',
|
width:60,
|
align:"center",
|
customRender:function (t,r,index) {
|
return parseInt(index)+1;
|
}
|
},
|
{
|
title:'维修编码',
|
align:"center",
|
dataIndex: 'repairCode'
|
},
|
{
|
title:'项目名称',
|
align:"center",
|
dataIndex: 'repairName'
|
},
|
{
|
title:'维修状态',
|
align:"center",
|
dataIndex: 'repairStatus_dictText'
|
},
|
{
|
title:'维修类型',
|
align:"center",
|
dataIndex: 'repairType'
|
},
|
{
|
title:'申请人',
|
align:"center",
|
dataIndex: 'applicant_dictText'
|
},
|
{
|
title:'申请车间',
|
align:"center",
|
dataIndex: 'applicantProduction_dictText'
|
},
|
{
|
title:'计划开始日期',
|
align:"center",
|
dataIndex: 'planStartDate'
|
},
|
{
|
title:'计划结束日期',
|
align:"center",
|
dataIndex: 'planEndDate'
|
},
|
{
|
title:'实际开始时间',
|
align:"center",
|
dataIndex: 'actualStartTime'
|
},
|
{
|
title:'实际结束时间',
|
align:"center",
|
dataIndex: 'actualEndTime'
|
},
|
{
|
title:'总金额',
|
align:"center",
|
dataIndex: 'totalAmount'
|
},
|
// {
|
// title:'故障描述',
|
// align:"center",
|
// dataIndex: 'faultDescription'
|
// },
|
// {
|
// title:'申请原因',
|
// align:"center",
|
// dataIndex: 'applicantReason'
|
// },
|
{
|
title:'责任人',
|
align:"center",
|
dataIndex: 'responsiblePerson_dictText'
|
},
|
{
|
title:'备注',
|
align:"center",
|
dataIndex: 'remark'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align:"center",
|
fixed:"right",
|
width:147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: "/eam/eamMajorPartialRepair/list",
|
delete: "/eam/eamMajorPartialRepair/delete",
|
deleteBatch: "/eam/eamMajorPartialRepair/deleteBatch",
|
exportXlsUrl: "/eam/eamMajorPartialRepair/exportXls",
|
importExcelUrl: "eam/eamMajorPartialRepair/importExcel",
|
submit: "eam/eamMajorPartialRepair/submit",
|
submitBatch: "eam/eamMajorPartialRepair/submitBatch",
|
confirm: "eam/eamMajorPartialRepair/confirm",
|
confirmBatch: "eam/eamMajorPartialRepair/confirmBatch",
|
repeal: "eam/eamMajorPartialRepair/repeal",
|
repealBatch: "eam/eamMajorPartialRepair/repealBatch"
|
},
|
planDateRange: [],
|
dictOptions:{},
|
superFieldList:[],
|
}
|
},
|
created() {
|
this.getSuperFieldList();
|
},
|
computed: {
|
importExcelUrl: function(){
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
},
|
},
|
methods: {
|
searchReset() {
|
this.planDateRange = []
|
this.queryParam = {}
|
this.loadData(1);
|
},
|
selectDateChange(value, dateString) {
|
if (dateString && dateString.length === 2) {
|
this.queryParam.planStartDate = dateString[0]
|
this.queryParam.planEndDate = dateString[1]
|
}
|
},
|
handleFill(record) {
|
this.$refs.modalDetailForm.open(record);
|
this.$refs.modalDetailForm.title = "填报";
|
this.$refs.modalDetailForm.disableSubmit = false;
|
},
|
handleSubmit(id) {
|
getAction(this.url.submit,{id:id}).then((res)=>{
|
if(res.success){
|
this.loadData();
|
this.$message.success(res.message);
|
} else {
|
this.$message.warning(res.message);
|
}
|
})
|
},
|
handleConfirm(id) {
|
getAction(this.url.confirm,{id:id}).then((res)=>{
|
if(res.success){
|
this.loadData();
|
this.$message.success(res.message);
|
} else {
|
this.$message.warning(res.message);
|
}
|
})
|
},
|
batchSubmit() {
|
if (this.selectedRowKeys.length <= 0) {
|
this.$notification.warning({
|
message: '消息',
|
description: '请选择一条记录'
|
})
|
return
|
} else {
|
var ids = ''
|
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
ids += this.selectedRowKeys[a] + ','
|
}
|
var that = this
|
this.$confirm({
|
title: '确认提交',
|
content: '是否提交选中数据,只有待提交状态的数据才可提交成功?',
|
onOk: function () {
|
that.loading = true
|
getAction(that.url.submitBatch, { ids: ids }).then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
that.reCalculatePage(that.selectedRowKeys.length)
|
// that.$message.success(res.message);
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
that.onClearSelected()
|
} else {
|
// that.$message.warning(res.message);
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
}).finally(() => {
|
that.loading = false
|
})
|
}
|
})
|
}
|
},
|
batchConfirm() {
|
if (this.selectedRowKeys.length <= 0) {
|
this.$notification.warning({
|
message: '消息',
|
description: '请选择一条记录'
|
})
|
return
|
} else {
|
var ids = ''
|
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
ids += this.selectedRowKeys[a] + ','
|
}
|
var that = this
|
this.$confirm({
|
title: '是否确认',
|
content: '是否确认选中数据,只有待确认状态的数据才可确认成功?',
|
onOk: function () {
|
that.loading = true
|
getAction(that.url.confirmBatch, { ids: ids }).then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
that.reCalculatePage(that.selectedRowKeys.length)
|
// that.$message.success(res.message);
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
that.onClearSelected()
|
} else {
|
// that.$message.warning(res.message);
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
}).finally(() => {
|
that.loading = false
|
})
|
}
|
})
|
}
|
},
|
batchRepeal() {
|
if (this.selectedRowKeys.length <= 0) {
|
this.$notification.warning({
|
message: '消息',
|
description: '请选择一条记录'
|
})
|
return
|
} else {
|
var ids = ''
|
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
ids += this.selectedRowKeys[a] + ','
|
}
|
var that = this
|
this.$confirm({
|
title: '是否作废',
|
content: '是否作废选中数据,只有待提交状态的数据才可作废成功?',
|
onOk: function () {
|
that.loading = true
|
getAction(that.url.repealBatch, { ids: ids }).then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
that.reCalculatePage(that.selectedRowKeys.length)
|
// that.$message.success(res.message);
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
that.onClearSelected()
|
} else {
|
// that.$message.warning(res.message);
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
}).finally(() => {
|
that.loading = false
|
})
|
}
|
})
|
}
|
},
|
initDictConfig(){
|
},
|
getSuperFieldList(){
|
let fieldList=[];
|
fieldList.push({type:'string',value:'repairCode',text:'维修编码',dictCode:''})
|
fieldList.push({type:'string',value:'repairName',text:'项目名称',dictCode:''})
|
fieldList.push({type:'string',value:'repairStatus',text:'维修状态',dictCode:''})
|
fieldList.push({type:'string',value:'repairType',text:'维修类型',dictCode:''})
|
fieldList.push({type:'string',value:'applicant',text:'申请人',dictCode:''})
|
fieldList.push({type:'string',value:'applicantProduction',text:'申请车间',dictCode:''})
|
fieldList.push({type:'date',value:'planStartDate',text:'计划开始日期'})
|
fieldList.push({type:'date',value:'planEndDate',text:'计划结束日期'})
|
fieldList.push({type:'date',value:'actualStartTime',text:'实际开始时间'})
|
fieldList.push({type:'date',value:'actualEndTime',text:'实际结束时间'})
|
fieldList.push({type:'BigDecimal',value:'totalAmount',text:'总金额',dictCode:''})
|
fieldList.push({type:'string',value:'faultDescription',text:'故障描述',dictCode:''})
|
fieldList.push({type:'string',value:'applicantReason',text:'申请原因',dictCode:''})
|
fieldList.push({type:'string',value:'responsiblePerson',text:'责任人',dictCode:''})
|
fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
|
this.superFieldList = fieldList
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|