|
@@ -1,23 +1,13 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="ITEM" prop="item">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.item"
|
|
|
- :placeholder="$t('请输入') + 'ITEM'"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
<el-form-item :label="$t('年份')" prop="year">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.year"
|
|
|
- :placeholder="$t('请输入') + $t('年份')"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="queryParams.year"
|
|
|
+ type="year"
|
|
|
+ value-format="yyyy"
|
|
|
+ :placeholder="$t('请选择')+$t('年份')">
|
|
|
+ </el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
|
|
@@ -81,8 +71,8 @@
|
|
|
<el-table-column :label="$t('年份')" align="center" prop="year" width="50" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="ITEM" align="center" prop="item" width="80" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('内容')" align="center" prop="description" width="400" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column :label="$t('目标')" align="center" prop="targets" width="200" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column :label="$t('一季度')" align="center" prop="firstquarter" width="200" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column :label="$t('目标')" align="center" prop="targets" width="200"/>
|
|
|
+ <el-table-column :label="$t('一季度')" align="center" prop="firstquarter" width="200">
|
|
|
<template slot-scope="scope" v-if="scope.row.firstquarter != null">
|
|
|
<el-dropdown placement="bottom" trigger="click">
|
|
|
<span class="el-dropdown-link">
|
|
@@ -97,7 +87,7 @@
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :label="$t('二季度')" align="center" prop="halfyear" width="200" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column :label="$t('二季度')" align="center" prop="halfyear" width="200">
|
|
|
<template slot-scope="scope" v-if="scope.row.halfyear != null">
|
|
|
<el-dropdown placement="bottom" trigger="click">
|
|
|
<span class="el-dropdown-link">
|
|
@@ -112,7 +102,7 @@
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :label="$t('三季度')" align="center" prop="threequarter" width="200" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column :label="$t('三季度')" align="center" prop="threequarter" width="200">
|
|
|
<template slot-scope="scope" v-if="scope.row.threequarter != null">
|
|
|
<el-dropdown placement="bottom" trigger="click">
|
|
|
<span class="el-dropdown-link">
|
|
@@ -127,7 +117,7 @@
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :label="$t('四季度')" align="center" prop="annual" width="200" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column :label="$t('四季度')" align="center" prop="annual" width="200">
|
|
|
<template slot-scope="scope" v-if="scope.row.annual != null">
|
|
|
<el-dropdown placement="bottom" trigger="click">
|
|
|
<span class="el-dropdown-link">
|
|
@@ -142,6 +132,7 @@
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="偏差说明" align="center" prop="deviationInfo" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="行动项" align="center" prop="actionItem" width="400" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="负责人" align="center" prop="principalName" width="100" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="计划完成时间" align="center" prop="expectedDate" width="100">
|
|
@@ -155,7 +146,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
@@ -164,6 +155,13 @@
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['plant:targetreview:edit']"
|
|
|
>{{ $t('修改') }}</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-document"
|
|
|
+ @click="handleAction(scope.row)"
|
|
|
+ v-hasPermi="['plant:targetreview:edit']"
|
|
|
+ >{{ $t('行动项') }}</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -186,15 +184,8 @@
|
|
|
<!-- 添加或修改目标回顾对话框 -->
|
|
|
<el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item :label="$t('装置名称')" prop="plantCode">
|
|
|
- <el-select v-model="form.plantCode" :placeholder="$t('请选择') + $t('装置名称')">
|
|
|
- <el-option
|
|
|
- v-for="dict in plantCodeOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item :label="$t('年份')" prop="year">
|
|
|
+ <el-input v-model="form.year" :placeholder="$t('请输入') + $t('年份')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="ITEM" prop="item">
|
|
|
<el-input v-model="form.item" :placeholder="$t('请输入') + 'ITEM'" />
|
|
@@ -217,8 +208,8 @@
|
|
|
<el-form-item :label="$t('四季度')" prop="annual">
|
|
|
<el-input v-model="form.annual" :placeholder="$t('请输入') + $t('四季度')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('年份')" prop="year">
|
|
|
- <el-input v-model="form.year" :placeholder="$t('请输入') + $t('年份')" />
|
|
|
+ <el-form-item label="偏差说明" prop="deviationInfo">
|
|
|
+ <el-input v-model="form.deviationInfo" placeholder="请输入偏差说明" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="$t('备注')" prop="remarks">
|
|
|
<el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
|
|
@@ -266,6 +257,70 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 行动项对话框 -->
|
|
|
+ <el-dialog v-dialogDrag :title="actionTitle" :visible.sync="actionOpen" width="1000px" append-to-body>
|
|
|
+ <el-form :inline="true" :model="actionQueryParams">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button v-hasPermi="['plant:targetaction:add']" type="primary" @click="addAction()">{{ $t('新增') }}</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table v-loading="actionLoading" :data="targetactionList" border>
|
|
|
+ <el-table-column :label="$t('行动项')" align="center" header-align="center" prop="actionItem">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-if="scope.row.isEdit" v-model="scope.row.actionItem" :placeholder="$t('请输入') + $t('行动项')" />
|
|
|
+ <span v-else>{{ scope.row.actionItem }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('负责人')" align="center" header-align="center" prop="principal">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-if="scope.row.isEdit" v-model="scope.row.principal" filterable multiple :placeholder="$t('请选择') + $t('人员')">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in principalOptions"
|
|
|
+ :key="dict.staffid"
|
|
|
+ :label="dict.name"
|
|
|
+ :value="dict.staffid">
|
|
|
+ <span style="float: left">{{ dict.name }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ scope.row.principalName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('计划完成时间')" align="center" header-align="center" prop="expectedDate">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-date-picker
|
|
|
+ v-if="scope.row.isEdit"
|
|
|
+ v-model="scope.row.expectedDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :placeholder="$t('请选择') + $t('计划完成时间')">
|
|
|
+ </el-date-picker>
|
|
|
+ <span v-else>{{ parseTime(scope.row.expectedDate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('完成时间')" align="center" header-align="center" prop="completionDate">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-date-picker
|
|
|
+ v-if="scope.row.isEdit"
|
|
|
+ v-model="scope.row.completionDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :placeholder="$t('请选择') + $t('完成时间')">
|
|
|
+ </el-date-picker>
|
|
|
+ <span v-else>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button v-hasPermi="['plant:targetaction:edit']" type="text" size="small" v-if="scope.row.isEdit" @click="saveAction(scope.row)">{{ $t('保存') }}</el-button>
|
|
|
+ <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelAction(scope.row, scope.$index)">{{ $t('取消') }}</el-button>
|
|
|
+ <el-button v-hasPermi="['plant:targetaction:edit']" v-if="!scope.row.isEdit" @click="editAction(scope.row)" type="text" size="mini">{{ $t('编辑') }}</el-button>
|
|
|
+ <el-button v-hasPermi="['plant:targetaction:edit']" v-if="!scope.row.isEdit" type="text" size="small" @click="deleteAction(scope.row)">{{ $t('删除') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 下载对话框 -->
|
|
|
<el-dialog v-dialogDrag :title="download.title" :visible.sync="download.open" width="400px" append-to-body>
|
|
|
<el-form :model="queryParams" ref="queryForm" label-width="68px">
|
|
@@ -290,6 +345,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { listTargetreview, getTargetreview, delTargetreview, addTargetreview, updateTargetreview, exportTargetreview } from "@/api/plant/targetreview";
|
|
|
+ import { listTargetaction, getTargetaction, delTargetaction, addTargetaction, updateTargetaction} from "@/api/plant/targetaction";
|
|
|
import { listStaffmgr } from "@/api/plant/staffmgr";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -303,6 +359,7 @@
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
+ actionLoading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
@@ -315,13 +372,17 @@
|
|
|
total: 0,
|
|
|
// 目标回顾表格数据
|
|
|
targetreviewList: [],
|
|
|
+ //行动项表格数据
|
|
|
+ targetactionList: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
+ actionTitle: "",
|
|
|
// 部门树选项
|
|
|
deptOptions: undefined,
|
|
|
clientHeight:300,
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ actionOpen: false,
|
|
|
// 人员字典
|
|
|
principalOptions: [],
|
|
|
// 装置名称字典
|
|
@@ -371,13 +432,15 @@
|
|
|
staffmgrQueryParams: {
|
|
|
actualposts: null
|
|
|
},
|
|
|
+ actionQueryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ targetreviewId: null,
|
|
|
+ },
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- plantCode: [
|
|
|
- { required: true, message: this.$t('装置名称') + this.$t('不能为空'), trigger: "change" }
|
|
|
- ],
|
|
|
item: [
|
|
|
{ required: true, message: this.$t('序号') + this.$t('不能为空'), trigger: "blur" }
|
|
|
],
|
|
@@ -531,10 +594,29 @@
|
|
|
firstquarterStatus: null,
|
|
|
halfyearStatus: null,
|
|
|
threequarterStatus: null,
|
|
|
- annualStatus: null
|
|
|
+ annualStatus: null,
|
|
|
+ deviationInfo: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
+ //行动项表单重置
|
|
|
+ actionReset() {
|
|
|
+ this.actionForm = {
|
|
|
+ id: null,
|
|
|
+ targetreviewId: null,
|
|
|
+ actionItem: null,
|
|
|
+ principal: null,
|
|
|
+ principalName: null,
|
|
|
+ expectedDate: null,
|
|
|
+ completionDate: null,
|
|
|
+ delFlag: null,
|
|
|
+ createrCode: null,
|
|
|
+ createdate: null,
|
|
|
+ updaterCode: null,
|
|
|
+ updatedate: null,
|
|
|
+ };
|
|
|
+ this.resetForm("actionForm");
|
|
|
+ },
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
@@ -599,6 +681,122 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /** 行动项按钮操作 */
|
|
|
+ handleAction(row) {
|
|
|
+ let _this = this
|
|
|
+ this.actionReset();
|
|
|
+ this.actionLoading = true;
|
|
|
+ this.actionQueryParams.targetreviewId = row.id
|
|
|
+ listTargetaction(this.actionQueryParams).then(response => {
|
|
|
+ response.rows.forEach(element => {
|
|
|
+ element["isEdit"] = false
|
|
|
+ });
|
|
|
+ response.rows.forEach(element => {
|
|
|
+ element["isAdd"] = false
|
|
|
+ });
|
|
|
+ this.targetactionList = response.rows;
|
|
|
+ this.targetactionList.forEach(function (value,key,arr) {
|
|
|
+ let principal = null;
|
|
|
+ let principalName = null;
|
|
|
+ if (value.principal != null) {
|
|
|
+ principal = value.principal.split(",");
|
|
|
+ principal.forEach(function (id, index) {
|
|
|
+ _this.principalOptions.forEach(function (item) {
|
|
|
+ if (item.staffid === id) {
|
|
|
+ if (index === 0) {
|
|
|
+ principalName = item.name
|
|
|
+ }else {
|
|
|
+ principalName = principalName + "," + item.name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ _this.targetactionList[key].principal = principal;
|
|
|
+ _this.targetactionList[key].principalName = principalName;
|
|
|
+ })
|
|
|
+ this.actionLoading = false;
|
|
|
+ this.actionOpen = true;
|
|
|
+ this.actionTitle = this.$t('行动项');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 新增行动项按钮操作 */
|
|
|
+ addAction() {
|
|
|
+ this.targetactionList.push({
|
|
|
+ targetreviewId: this.actionQueryParams.targetreviewId,
|
|
|
+ actionItem: '',
|
|
|
+ expectedDate: '',
|
|
|
+ completionDate: '',
|
|
|
+ isEdit: true,
|
|
|
+ isAdd: true
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 保存行动项按钮操作 */
|
|
|
+ saveAction(row) {
|
|
|
+ row.isEdit = false;
|
|
|
+ var that = this;
|
|
|
+ that.actionLoading = true;
|
|
|
+ this.actionForm = row;
|
|
|
+ this.actionForm.targetreviewId = this.actionQueryParams.targetreviewId;
|
|
|
+ var principal = null;
|
|
|
+ this.actionForm.principal.forEach(function (value,key,arr) {
|
|
|
+ if (key != 0) {
|
|
|
+ principal = principal + "," + value;
|
|
|
+ }else if (key == 0) {
|
|
|
+ principal = value;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.actionForm.principal = principal;
|
|
|
+ if (row.isAdd == true) {
|
|
|
+ addTargetaction(this.actionForm).then(response => {
|
|
|
+ this.msgSuccess(this.$t('新增成功'));
|
|
|
+ this.actionOpen = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ updateTargetaction(this.actionForm).then(response => {
|
|
|
+ this.msgSuccess(this.$t('修改成功'));
|
|
|
+ this.actionOpen = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 取消行动项按钮操作 */
|
|
|
+ cancelAction(row, index) {
|
|
|
+ // 如果是新增的数据
|
|
|
+ if (row.isAdd) {
|
|
|
+ this.targetactionList.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ // 不是新增的数据 还原数据
|
|
|
+ for (const i in row.oldRow) {
|
|
|
+ row[i] = row.oldRow[i]
|
|
|
+ }
|
|
|
+ row.isEdit = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 修改行动项按钮操作 */
|
|
|
+ editAction(row) {
|
|
|
+ // 备份原始数据
|
|
|
+ row['oldRow'] = JSON.parse(JSON.stringify(row));
|
|
|
+ this.$nextTick(() => {
|
|
|
+ row.isEdit = true;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 删除行动项按钮操作 */
|
|
|
+ deleteAction(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
|
|
|
+ confirmButtonText: this.$t('确定'),
|
|
|
+ cancelButtonText: this.$t('取消'),
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delTargetaction(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.actionOpen = false;
|
|
|
+ this.msgSuccess(this.$t('删除成功'));
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
@@ -716,7 +914,7 @@
|
|
|
colspan: _col
|
|
|
};
|
|
|
}
|
|
|
- if (columnIndex === 13 ) {
|
|
|
+ if (columnIndex === 9 ) {
|
|
|
const _row = this.setTable(this.targetreviewList).merge[rowIndex];
|
|
|
const _col = _row > 0 ? 1 : 0;
|
|
|
return {
|
|
@@ -732,6 +930,14 @@
|
|
|
colspan: _col
|
|
|
};
|
|
|
}
|
|
|
+ if (columnIndex === 15 ) {
|
|
|
+ const _row = this.setTable(this.targetreviewList).merge[rowIndex];
|
|
|
+ const _col = _row > 0 ? 1 : 0;
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: _col
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
setTable(tableData) {
|
|
|
let spanArr = [],
|