|
@@ -72,14 +72,6 @@
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['plant:targetlist:edit']"
|
|
|
>{{ $t('修改') }}</el-button>
|
|
|
- <!--<el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-document"
|
|
|
- @click="handleAction(scope.row)"
|
|
|
- v-hasPermi="['plant:targetmeasures:edit']"
|
|
|
- v-if="scope.row.parentId !== 0"
|
|
|
- >{{ $t('行动项') }}</el-button>-->
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -193,70 +185,6 @@
|
|
|
</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">
|
|
@@ -361,7 +289,6 @@
|
|
|
|
|
|
<script>
|
|
|
import { getTargetmeasures, delTargetmeasures, addTargetmeasures, updateTargetmeasures, exportTargetmeasures, importTemplate} from "@/api/plant/targetmeasures";
|
|
|
- import { listTargetaction, getTargetaction, delTargetaction, addTargetaction, updateTargetaction} from "@/api/plant/targetaction";
|
|
|
import { listMeasures, getTargetlist } from "@/api/plant/targetlist";
|
|
|
import { listStaffmgr } from "@/api/plant/staffmgr";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
@@ -378,7 +305,6 @@
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
- actionLoading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
@@ -402,13 +328,11 @@
|
|
|
principalOptions: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
- actionTitle: "",
|
|
|
// 部门树选项
|
|
|
deptOptions: undefined,
|
|
|
clientHeight:300,
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- actionOpen: false,
|
|
|
// 用户导入参数
|
|
|
upload: {
|
|
|
// 是否显示弹出层(用户导入)
|
|
@@ -471,11 +395,6 @@
|
|
|
staffmgrPrincipal: {
|
|
|
actualposts: null
|
|
|
},
|
|
|
- actionQueryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 20,
|
|
|
- targetreviewId: null,
|
|
|
- },
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
@@ -565,94 +484,6 @@
|
|
|
this.principalOptions = response.rows;
|
|
|
});
|
|
|
},
|
|
|
- //根据分数显示颜色提示
|
|
|
- tableCellClassName({ row, column, rowIndex, columnIndex }) {
|
|
|
- if (columnIndex == 8){
|
|
|
- return this.changeColor(row.firstquarterStatus)
|
|
|
- }
|
|
|
- if (columnIndex == 10){
|
|
|
- return this.changeColor(row.halfyearStatus)
|
|
|
- }
|
|
|
- if (columnIndex == 12){
|
|
|
- return this.changeColor(row.threequarterStatus)
|
|
|
- }
|
|
|
- if (columnIndex == 14){
|
|
|
- return this.changeColor(row.annualStatus)
|
|
|
- }
|
|
|
- },
|
|
|
- changeColor (value) {
|
|
|
- if (value == 1){
|
|
|
- return 'cellFinish'
|
|
|
- }else if( value == 2) {
|
|
|
- return 'cellCare'
|
|
|
- }else if( value == 3) {
|
|
|
- return 'cellUrgent'
|
|
|
- }
|
|
|
- },
|
|
|
- //变换季度状态
|
|
|
- statusFinish (index, row) {
|
|
|
- const id = row.measuresId;
|
|
|
- getTargetmeasures(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.$nextTick(() => {
|
|
|
- if (index == 1) {
|
|
|
- this.form.firstquarterStatus = 1;
|
|
|
- }else if (index == 2) {
|
|
|
- this.form.halfyearStatus = 1;
|
|
|
- }else if (index == 3) {
|
|
|
- this.form.threequarterStatus = 1;
|
|
|
- }else if (index == 4) {
|
|
|
- this.form.annualStatus = 1;
|
|
|
- }
|
|
|
- updateTargetmeasures(this.form).then(response => {
|
|
|
- this.msgSuccess(this.$t('修改成功'));
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- statusCare (index, row) {
|
|
|
- const id = row.measuresId;
|
|
|
- getTargetmeasures(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.$nextTick(() => {
|
|
|
- if (index == 1) {
|
|
|
- this.form.firstquarterStatus = 2;
|
|
|
- }else if (index == 2) {
|
|
|
- this.form.halfyearStatus = 2;
|
|
|
- }else if (index == 3) {
|
|
|
- this.form.threequarterStatus = 2;
|
|
|
- }else if (index == 4) {
|
|
|
- this.form.annualStatus = 2;
|
|
|
- }
|
|
|
- updateTargetmeasures(this.form).then(response => {
|
|
|
- this.msgSuccess(this.$t('修改成功'));
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- statusUrgent (index, row) {
|
|
|
- const id = row.measuresId;
|
|
|
- getTargetmeasures(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.$nextTick(() => {
|
|
|
- if (index == 1) {
|
|
|
- this.form.firstquarterStatus = 3;
|
|
|
- }else if (index == 2) {
|
|
|
- this.form.halfyearStatus = 3;
|
|
|
- }else if (index == 3) {
|
|
|
- this.form.threequarterStatus = 3;
|
|
|
- }else if (index == 4) {
|
|
|
- this.form.annualStatus = 3;
|
|
|
- }
|
|
|
- updateTargetmeasures(this.form).then(response => {
|
|
|
- this.msgSuccess(this.$t('修改成功'));
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -692,24 +523,6 @@
|
|
|
};
|
|
|
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;
|
|
@@ -806,122 +619,6 @@
|
|
|
this.msgSuccess(this.$t('删除成功'));
|
|
|
})
|
|
|
},
|
|
|
- /** 行动项按钮操作 */
|
|
|
- handleAction(row) {
|
|
|
- let _this = this
|
|
|
- this.actionReset();
|
|
|
- this.actionLoading = true;
|
|
|
- this.actionQueryParams.targetreviewId = row.measuresId
|
|
|
- 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('删除成功'));
|
|
|
- })
|
|
|
- },
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
this.download.open = true;
|