流程管理接口问题调整

dev-scheduling
zhangdi 1 month ago
parent 4e7c71f7a2
commit 1751c8cb16
  1. 89
      src/views/flowManagement/addDialog.vue
  2. 41
      src/views/flowManagement/managementOfKeyTasks.vue
  3. 71
      src/views/flowManagement/milestoneDialog.vue

@ -206,7 +206,7 @@
align="center"
:width="isDetail ? '120' : ''"
label="里程碑负责人"
prop="milestoneMan"
prop="milestoneMemo"
>
<template #header>
<span><i style="color: red">*</i>里程碑负责人</span>
@ -215,14 +215,15 @@
<template v-if="!isDetail">
<el-form-item
label-width="0"
:prop="`stoneList[${scope.$index}].milestoneMan`"
:rules="addRules.milestoneMan"
:prop="`stoneList[${scope.$index}].milestoneMemo`"
:rules="addRules.milestoneMemo"
>
<el-select
v-model="scope.row.milestoneMan"
v-model="scope.row.milestoneMemo"
placeholder="请选择里程碑负责人"
clearable
filterable
@change="handleStoneListChange(scope.$index, scope.row, 'milestoneMemo')"
>
<el-option
v-for="item in memberList"
@ -291,7 +292,9 @@
</el-form-item>
</template>
<template v-else>
<span>{{ scope.row.milestoneNode }}</span>
<span>{{
scope.row.milestoneNode ? scope.row.milestoneNode.substring(0, 10) : ''
}}</span>
</template>
</template>
</el-table-column>
@ -302,7 +305,12 @@
label="执行类型"
prop="executeType"
:width="isDetail ? '120' : ''"
></el-table-column>
>
<template #default="scope">
<!-- {{ executeTypeFn(scope.row.executeType) }} -->
{{ scope.row.executeTypeText }}
</template>
</el-table-column>
<el-table-column
v-if="isDetail"
align="center"
@ -316,7 +324,13 @@
label="核查结果"
prop="checkResult"
:width="isDetail ? '120' : ''"
></el-table-column>
>
<template #default="scope">
<span v-if="scope.row.checkResult === 0">未核查</span>
<span v-else-if="scope.row.checkResult === 1">已核查</span>
<span v-else-if="scope.row.checkResult === 2">已核准</span>
</template>
</el-table-column>
<el-table-column
v-if="isDetail"
align="center"
@ -328,16 +342,21 @@
v-if="isDetail"
align="center"
label="评价等级"
prop="grade"
prop="gradeTitle"
:width="isDetail ? '120' : ''"
></el-table-column>
>
</el-table-column>
<el-table-column
v-if="isDetail"
align="center"
label="评价人"
prop="gradeMan"
:width="isDetail ? '120' : ''"
></el-table-column>
>
<template #default="scope">
{{ scope.row.gradeTitle == '待评价' ? '' : scope.row.gradeMan }}
</template>
</el-table-column>
<el-table-column
v-if="isDetail"
width="200"
@ -360,8 +379,8 @@
<!-- 弹窗底部按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="handleSubmitForm"> </el-button>
<el-button @click="handleClose" :loading="loadingShow"> </el-button>
<el-button type="primary" @click="handleSubmitForm" :loading="loadingShow"> </el-button>
</span>
</template>
</el-dialog>
@ -392,6 +411,7 @@ export default {
},
data() {
return {
loadingShow:false,
formError: '',
addRules: {
projectName: [{ required: true, message: '请填写项目名称', trigger: ['blur', 'submit'] }],
@ -440,7 +460,7 @@ export default {
milestonePlan: [
{ required: true, message: '请填写里程碑计划', trigger: ['blur', 'submit'] },
],
milestoneMan: [
milestoneMemo: [
{ required: true, message: '请选择里程碑负责人', trigger: ['change', 'submit'] },
],
outputMaterial: [
@ -457,6 +477,7 @@ export default {
addForm: {
stoneList: [],
},
executeResultList: [], //
};
},
computed: {
@ -472,9 +493,26 @@ export default {
this.getDeplList();
if (this.title === '详情' || this.title === '修改') {
this.getDetails();
this.getExecuteResultList();
}
},
methods: {
executeTypeFn(type) {
const item = this.executeResultList.find(item => item.dictKey === type);
return item ? item.dictValue : '';
},
getExecuteTypeText(type) {
const item = this.executeResultList.find(item => item.dictKey === type);
console.log('item', item);
return item ? item.dictValue : '';
},
handleStoneListChange(index, row, type) {
if (type === 'milestoneMemo') {
let sel = this.memberList.filter(item => item.id == row.milestoneMemo)[0];
this.addForm.stoneList[index].milestoneMan = sel.realName;
}
},
handleChange(type) {
//
if (type == 'touchingDeptId') {
@ -506,11 +544,22 @@ export default {
this.projectType = res.data.data;
});
},
//
getExecuteResultList() {
getDictionary({ code: 'flow_project_executeResult' }).then(res => {
this.executeResultList = res.data.data;
});
},
//
getDetails() {
getProcessDetail(this.rowItem.id).then(res => {
console.log(res.data.data, 'res');
this.addForm = res.data.data;
const records = res.data.data;
this.addForm.stoneList = records.stoneList.map(item => {
item.executeTypeText = this.getExecuteTypeText(item.executeType);
return item;
});
// memberName
if (res.data.data.memberName) {
this.addForm.memberName = String(res.data.data.memberName)
@ -537,13 +586,12 @@ export default {
//
handleOpenDialog() {
const newRow = {
id: 0,
id: null,
fmProjectApplication: {},
attachList: [], //
paId: 0,
paIndex: `${(this.addForm.stoneList?.length || 0) + 1}`,
milestonePlan: '',
milestoneMan: '',
outputMaterial: '',
milestoneNode: '',
milestoneMemo: '',
@ -610,6 +658,7 @@ export default {
});
return;
}
this.loadingShow = true
const submitData = this.formatSubmitData(this.addForm);
submitData.projectStartTime = submitData.projectStartTime + ' 00:00:00';
submitData.projectDesiredEnd = submitData.projectDesiredEnd + ' 00:00:00';
@ -617,13 +666,19 @@ export default {
updateProcess({ ...submitDat, approvalStatus: 1 }).then(res => {
this.$message.success('修改成功');
this.handleClose(true);
});
this.loadingShow = false
}).catch(err=>{
this.loadingShow = false
})
return;
} else {
addProcess({ ...submitData, approvalStatus: 1 }).then(res => {
this.$message.success('提交成功');
this.handleClose(true);
});
this.loadingShow = false
}).catch(err=>{
this.loadingShow = false
})
}
});
},

@ -58,7 +58,11 @@
{{ scope.row.milestoneNode ? scope.row.milestoneNode.substring(0, 10) : '' }}
</template>
</el-table-column>
<el-table-column align="center" label="执行类型" prop="executeType"> </el-table-column>
<el-table-column align="center" label="执行类型" prop="executeType">
<template #default="scope">
{{ scope.row.executeTypeText }}
</template>
</el-table-column>
<!-- <el-table-column align="center" label="状态" prop="status"></el-table-column> -->
<el-table-column align="center" label="延期时间" prop="delayTime"></el-table-column>
<el-table-column
@ -68,7 +72,11 @@
></el-table-column>
<el-table-column align="center" label="核查人" prop="checkMan"></el-table-column>
<el-table-column align="center" label="评价等级" prop="gradeTitle"></el-table-column>
<el-table-column align="center" label="评价人" prop="gradeMan"></el-table-column>
<el-table-column align="center" label="评价人" prop="gradeMan">
<template #default="scope">
{{ scope.row.gradeTitle == '待评价' ? '' : scope.row.gradeMan }}
</template>
</el-table-column>
<el-table-column
align="center"
label="业务领导评价"
@ -77,27 +85,21 @@
></el-table-column>
<el-table-column label="操作">
<template #default="scope">
<!-- -->
<el-button
type="text"
v-if="row.approvalStatus == 3 && scope.row.checkResult == 0"
@click="executeRow(row, scope.row)"
>执行</el-button
>
<!-- -->
<el-button
type="text"
v-if="
(row.approvalStatus == 3 && (scope.row.checkResult == 1) ||
scope.row.checkResult == 3)
"
v-if="scope.row.checkResult == 1 || scope.row.checkResult == 3"
@click="auditRow(row, scope.row)"
>核查</el-button
>
<!-- -->
<el-button
type="text"
v-if="row.approvalStatus == 3 && scope.row.checkResult == 2"
v-if="scope.row.gradeTitle=='待评价'&&scope.row.checkResult == 2"
@click="examineRow(row, scope.row)"
>核准</el-button
>
@ -300,10 +302,15 @@ export default {
this.getExecuteResult();
},
methods: {
getExecuteTypeText(type) {
const item = this.executeResultList.find(item => item.dictKey === type);
console.log('item', item);
return item ? item.dictValue : '';
},
// flow_project_executeResult
getExecuteResult() {
getDictionary({ code: 'flow_project_executeResult' }).then(res => {
this.executeResultList = res.data;
this.executeResultList = res.data.data;
});
},
// flow_project_checkResult
@ -458,7 +465,17 @@ export default {
this.loading = true;
getProcessList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(
res => {
this.data = res.data.data.records;
// this.data = res.data.data.records;
const records = res.data.data.records;
this.data = records.map(item => {
if (item.stoneList && Array.isArray(item.stoneList)) {
item.stoneList = item.stoneList.map(stone => ({
...stone,
executeTypeText: this.getExecuteTypeText(stone.executeType),
}));
}
return item;
});
this.loading = false;
this.page.total = res.data.data.total;
}

@ -47,6 +47,7 @@
<el-select
:disabled="subTitle == '核查' || subTitle == '核准'"
v-model="detailForm.executeType"
@change="executeTypeChange"
>
<el-option
v-for="(item, index) in executeResultList"
@ -130,7 +131,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="核查人:" v-if="subTitle == '执行'">
<el-select v-model="detailForm.userId" clearable filterable>
<el-select v-model="detailForm.userId" clearable filterable @change="handleUserChange">
<el-option
v-for="item in memberList"
:label="item.realName"
@ -190,8 +191,8 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="closeDialog" :loading="loadingShow"> </el-button>
<el-button type="primary" @click="submit" :loading="loadingShow"> </el-button>
</span>
</template>
</el-dialog>
@ -222,6 +223,7 @@ export default {
},
data() {
return {
loadingShow: false,
openShow: false,
memberList: [],
executeForm: {},
@ -239,12 +241,20 @@ export default {
this.openShow = this.showDialog;
this.executeForm = this.rowItem;
console.log(this.detailForm, 'title');
this.detailForm.checkResult = null;
this.subTitle = this.title;
console.log(this.rowItem, 'rowItem');
this.getRoleUserList();
this.getExecuteResult();
},
methods: {
executeTypeChange() {
this.detailForm.delayTime = '';
},
handleUserChange() {
this.detailForm.checkMan =
this.memberList.find(item => item.id === this.detailForm.userId)?.realName || '';
},
getExecuteResult() {
getDictionary({ code: 'flow_project_executeResult' }).then(res => {
this.executeResultList = res.data.data;
@ -263,9 +273,9 @@ export default {
submit() {
this.$refs.executeForm.validate(valid => {
if (valid) {
this.loadingShow = true;
// this.executeDialog = false;
if (this.title == '执行') {
this.executeForm.delayTime = this.executeForm.delayTime + ' 00:00:00';
let query_ = {
...this.detailForm,
fmProjectApplication: {
@ -275,10 +285,16 @@ export default {
};
query_.checkResult = 1;
query_.fmProjectApplication.approvalStatus = 4;
console.log(query_, 'query_');
projectExecute(query_).then(res => {
query_.fmProjectApplication.delayTime =
query_.fmProjectApplication.delayTime + ' 00:00:00';
projectExecute(query_)
.then(res => {
this.$message.success('操作成功!');
this.closeDialog();
this.loadingShow = false;
})
.catch(err => {
this.loadingShow = false;
});
}
if (this.title == '核查') {
@ -289,16 +305,21 @@ export default {
},
// attachList: this.existingFiles,
};
if (query_.checkResult == 2) {
query_.fmProjectApplication.approvalStatus = 6;
}
if (query_.checkResult == 3) {
query_.fmProjectApplication.approvalStatus = 5;
}
// if (query_.checkResult == 2) {
// query_.fmProjectApplication.approvalStatus = 6;
// }
// if (query_.checkResult == 3) {
// query_.fmProjectApplication.approvalStatus = 5;
// }
console.log(query_, '核查query_');
projectCheck(query_).then(res => {
projectCheck(query_)
.then(res => {
this.$message.success('操作成功!');
this.closeDialog();
this.loadingShow = false;
})
.catch(err => {
this.loadingShow = false;
});
}
if (this.title == '核准') {
@ -314,19 +335,33 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
})
.then(() => {
// return removePersonAbility(row.id);
query_.fmProjectApplication.approvalStatus = 7;
projectApprove(query_).then(res => {
// query_.fmProjectApplication.approvalStatus = 7;
projectApprove(query_)
.then(res => {
this.$message.success('操作成功!');
this.closeDialog();
this.loadingShow = false;
})
.catch(err => {
this.loadingShow = false;
});
})
.catch(() => {
this.loadingShow = false;
});
} else {
query_.fmProjectApplication.approvalStatus = 8;
projectApprove(query_).then(res => {
// query_.fmProjectApplication.approvalStatus = 8;
projectApprove(query_)
.then(res => {
this.$message.success('操作成功!');
this.closeDialog();
this.loadingShow = false;
})
.catch(err => {
this.loadingShow = false;
});
}
}

Loading…
Cancel
Save