<template>
|
<div>
|
<el-card shadow="never" class="aui-card--fill">
|
<div class="mod-list">
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
<el-form-item v-if="type === 'monthly'">
|
<el-date-picker
|
v-model="dataForm.ny"
|
type="month"
|
value-format="yyyy-MM"
|
placeholder="选择月">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item v-if="type === 'yearly'">
|
<el-date-picker
|
v-model="dataForm.ny"
|
type="year"
|
value-format="yyyy"
|
placeholder="选择年">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="getDataList()">查询</el-button>
|
<el-button type="primary" @click="openForm()">新增</el-button>
|
<el-button @click="exportExcel()">导出</el-button>
|
</el-form-item>
|
</el-form>
|
<el-table
|
ref="table"
|
v-loading="dataListLoading"
|
:data="dataList"
|
height="400"
|
highlight-current-row
|
@current-change="currentChange"
|
border
|
style="width: 100%;">
|
<el-table-column prop="lsh" header-align="center" align="center" min-width="200"
|
label="流水号"></el-table-column>
|
<el-table-column prop="ny" header-align="center" align="center" min-width="200"
|
:label="type === 'monthly' ? '月份' : '年份'"></el-table-column>
|
<el-table-column prop="bzr" header-align="center" align="center" min-width="150"
|
label="编制人"></el-table-column>
|
<el-table-column prop="bzsj" header-align="center" align="center" min-width="200"
|
label="编制时间"></el-table-column>
|
<el-table-column prop="bpmCreateDate" header-align="center" align="center" min-width="200"
|
label="上报时间"></el-table-column>
|
<el-table-column prop="shsj" header-align="center" align="center" min-width="200"
|
label="审核时间"></el-table-column>
|
<el-table-column prop="bpmStatusName" header-align="center" align="center" width="150"
|
label="状态"></el-table-column>
|
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center"
|
width="100">
|
<template slot-scope="scope">
|
<el-button type="text" size="small"
|
@click="viewHandle(scope.row.id)">详情
|
</el-button>
|
<span>|</span>
|
<el-dropdown>
|
<span class="el-dropdown-link">
|
<el-button type="text" size="small">更多</el-button>
|
<i class="el-icon-arrow-down el-icon--right"></i>
|
</span>
|
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-item>
|
<el-button type="text" size="small"
|
v-if="(scope.row.bpmStatus === 1 || scope.row.bpmStatus === 0)"
|
@click="openForm(scope.row.id)">修改
|
</el-button>
|
</el-dropdown-item>
|
<el-dropdown-item>
|
<el-button type="text" size="small"
|
v-if="(scope.row.bpmStatus === 1 || scope.row.bpmStatus === 0)"
|
@click="handleDelete(scope.row.id)">删除
|
</el-button>
|
</el-dropdown-item>
|
<el-dropdown-item>
|
<el-button v-if="scope.row.bpmStatus === 2"
|
@click="clickCancelProcess(scope.row)" type="text"
|
size="small">撤回
|
</el-button>
|
</el-dropdown-item>
|
<el-dropdown-item>
|
<el-button v-if="scope.row.bpmStatus === 0" @click="clickSubmitApply(scope.row)"
|
type="text"
|
size="small">重新申请
|
</el-button>
|
</el-dropdown-item>
|
<el-dropdown-item>
|
<el-button v-if="scope.row.bpmStatus === 1" @click="clickSubmitApply(scope.row)"
|
type="text"
|
size="small">提交申请
|
</el-button>
|
</el-dropdown-item>
|
<el-dropdown-item>
|
<el-button
|
v-if="scope.row.bpmStatus === 2 || scope.row.bpmStatus === 3 || scope.row.bpmStatus === 4"
|
@click="clickProcessHistory(scope.row)" type="text" size="small">审批历史
|
</el-button>
|
</el-dropdown-item>
|
</el-dropdown-menu>
|
</el-dropdown>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
:current-page="page"
|
:page-sizes="[10, 20, 50, 100]"
|
:page-size="limit"
|
:total="total"
|
layout="total, sizes, prev, pager, next, jumper"
|
@size-change="pageSizeChangeHandle"
|
@current-change="pageCurrentChangeHandle">
|
</el-pagination>
|
<!-- 弹窗, 新增 / 修改 -->
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :type="type"
|
@refreshDataList="getDataList"></add-or-update>
|
<!-- 弹窗, 详情 -->
|
<info-view v-if="dataViewVisible" ref="dataView" :type="type"></info-view>
|
<!-- 弹窗, 详细列表 -->
|
<Form v-if="detListVisible" ref="formRef" style="height: 100%"></det-list>
|
<!-- 提交申请 -->
|
<submit-apply ref="sumbitApplyRef" :row="row" @refreshDataList="getDataList"></submit-apply>
|
<!-- 撤回申请 -->
|
<cancel-apply ref="cancelRef" :businessKey="row.id" :procInstId="row.procInstId"
|
@refreshDataList="getDataList"></cancel-apply>
|
<!-- 审批历史 -->
|
<history ref="historyRef" :businessKey="row.id" :procInstId="row.procInstId"></history>
|
</div>
|
</el-card>
|
<el-card shadow="never" class="aui-card--fill">
|
<div class="mod-analysis-full-det">
|
<data-det ref="dataDet"></data-det>
|
</div>
|
</el-card>
|
</div>
|
|
</template>
|
<script lang="ts" setup>
|
import DetList from './prodPlanDet'
|
import AddOrUpdate from './prodPlanAddOrUpdate'
|
import InfoView from './prodPlanView'
|
import SubmitApply from '@/components/process/SubmitApply'
|
import CancelApply from '@/components/process/CancelApply'
|
import History from '@/components/process/History'
|
import DataDet from './prodPlanDet'
|
import {exportByDom} from "@/utils/exportUtil";
|
import {ref} from "vue";
|
|
|
const type = ref('')
|
|
const dataForm = reactive({
|
jhlb: type,
|
ny: '',
|
sslb: ''
|
})
|
const detListVisible = ref(false)
|
const dataViewVisible = ref(false)
|
|
//工作流需要
|
const row = ref({}) //要提交审批的记录
|
const assigneeParams = reactive({
|
roleName: '', //办理人角色
|
sameDept: 0 //是否同部门
|
})
|
|
// 查看详细
|
const currentChange = async (currentRow) => {
|
this.$nextTick(() => {
|
this.$refs.dataDet.init(currentRow)
|
})
|
},
|
// 删除
|
const handleDelete
|
(id)
|
{
|
this.$confirm(`确定对选中项进行删除操作?`, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.$http({
|
url: `/iailab-iems-coal-proddisp/wash/plan/delete/${id}`,
|
method: 'post',
|
params: this.$http.adornParams()
|
}).then(({data}) => {
|
if (data && data.code === 0) {
|
this.$message({
|
message: '操作成功',
|
type: 'success',
|
duration: 1500,
|
onClose: () => {
|
if (this.pageIndex > 1 && (this.totalPage - 1) % this.pageSize === 0) {
|
this.pageIndex = this.pageIndex - 1
|
}
|
this.getDataList()
|
}
|
})
|
} else {
|
this.$message.error(data.msg)
|
}
|
})
|
}).catch(() => {
|
})
|
}
|
,
|
|
// 详情
|
viewHandle(id)
|
{
|
this.dataViewVisible = true
|
this.$refs.dataView.dataForm.id = id
|
this.$nextTick(() => {
|
this.$refs.dataView.init()
|
})
|
}
|
,
|
|
commit(id)
|
{
|
this.$confirm(`确定对选中项进行提交操作?`, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.$http({
|
url: `/iailab-iems-coal-proddisp/wash/plan/commit/${id}`,
|
method: 'post',
|
params: this.$http.adornParams()
|
}).then(({data}) => {
|
if (data && data.code === 0) {
|
this.$message({
|
message: '操作成功',
|
type: 'success',
|
duration: 1500,
|
onClose: () => {
|
this.getDataList()
|
}
|
})
|
} else {
|
this.$message.error(data.msg)
|
}
|
})
|
}).catch(() => {
|
})
|
}
|
,
|
|
// 提交申请
|
clickSubmitApply(row)
|
{
|
this.row = row
|
this.$refs.sumbitApplyRef.visible = true
|
}
|
,
|
|
// 点击审批进度
|
clickProcessHistory(row)
|
{
|
this.row = row
|
this.$refs.historyRef.visible = true
|
}
|
,
|
|
// 撤回申请
|
clickCancelProcess(row)
|
{
|
this.row = row
|
this.$refs.cancelRef.visible = true
|
}
|
,
|
exportExcel()
|
{
|
let dom = this.$refs.table
|
exportByDom(dom, undefined, this.type === 'monthly' ? '生产月计划' : '生产年计划')
|
}
|
}
|
}
|
</script>
|