工单详情改为接口请求

main
xuechunyuan 2 years ago
parent ce3aed86d0
commit b0adf43689
  1. 9
      src/api/plugin/workflow/workorder.js
  2. 6
      src/router/views/index.js
  3. 15
      src/views/plugin/workflow/process/components/detail.vue
  4. 112
      src/views/plugin/workflow/process/components/effect.vue
  5. 3
      src/views/plugin/workflow/process/implementation.vue
  6. 12
      src/views/plugin/workflow/process/todo.vue
  7. 15
      src/views/plugin/workflow/process/workorder.vue
  8. 3
      vue.config.js

@ -91,3 +91,12 @@ export const workOrderExcel = (query) => {
responseType: "blob",
});
};
// 工单详情
export const workOrderDetail = (query) => {
return request({
url: `${prefix}/detail`,
method: "get",
params: query,
});
};

@ -131,6 +131,12 @@ export default [{
component: () =>
import( /* webpackChunkName: "views" */ '@/views/plugin/workflow/process/components/form'),
},
{
path: 'process/details',
name: '流程详情',
component: () =>
import( /* webpackChunkName: "views" */ '@/views/plugin/workflow/process/components/detail'),
},
{
path: 'process/detail/:params',
name: '流程详情',

@ -247,11 +247,20 @@ export default {
mixins: [exForm, theme],
components: { userSelect, WfExamineForm, WfButton, WfFlow },
watch: {
"$route.params.params": {
// "$route.params.params": {
// handler(val) {
// if (val) {
// const param = JSON.parse(Buffer.from(val, "base64").toString());
// const { taskId, processInsId } = param;
// if (taskId && processInsId) this.getDetail(taskId, processInsId);
// }
// },
// immediate: true,
// },
"$route.query": {
handler(val) {
if (val) {
const param = JSON.parse(Buffer.from(val, "base64").toString());
const { taskId, processInsId } = param;
const { taskId, processInsId } = val;
if (taskId && processInsId) this.getDetail(taskId, processInsId);
}
},

@ -51,7 +51,7 @@
<script>
import { downloadFile } from "@/api/plugin/workflow/form.js";
import { add } from "@/api/plugin/workflow/workorder.js";
import { add, workOrderDetail } from "@/api/plugin/workflow/workorder.js";
import { mapGetters } from "vuex";
import website from '@/config/website';
export default {
@ -129,7 +129,7 @@ export default {
prop: "operateSys",
labelPosition: "top",
disabled: true,
display: JSON.parse(this.$route.query.form).operateSysName ? false : true,
// display: this.form.operateSysName ? false : true,
},
{
type: "input",
@ -141,7 +141,7 @@ export default {
prop: "operateSysName",
labelPosition: "top",
disabled: true,
display: JSON.parse(this.$route.query.form).operateSysName ? true : false,
// display: this.form.operateSysName ? true : false,
},
{
type: "input",
@ -240,55 +240,63 @@ export default {
};
},
created() {
const {
applyUser,
maintenanceCompanyName,
maintenanceCompany,
managementName,
taskParentName,
taskTypeName,
taskLevelName,
operateSys,
operateSysName,
operateModuleName,
repeatModeName,
uploadRecords,
expectedCompletionTime,
isFinish,
id,
remark,
detail
} = JSON.parse(this.$route.query.form);
this.form = {
applyUser,
maintenanceCompanyName,
maintenanceCompany,
managementName,
taskParentName,
taskTypeName,
operateSys,
taskLevelName,
operateSysName,
operateModuleName,
repeatModeName,
uploadRecords,
expectedCompletionTime,
isFinish,
id,
remark,
detail
};
if(this.userInfo){
this.option.column.find(item => item.prop == 'remark').disabled = (JSON.parse(this.$route.query.form).isFinish === 1 ||
JSON.parse(this.$route.query.form).maintenanceCompany !== this.userInfo.user_id
) ? true : false;
this.option.column.find(item => item.prop == 'remark').placeholder = (JSON.parse(this.$route.query.form).isFinish === 1 ||
JSON.parse(this.$route.query.form).maintenanceCompany !== this.userInfo.user_id
) ? " " : "请输入实施反馈";
this.option.column.find(item => item.prop == 'shangchuan').display = (JSON.parse(this.$route.query.form).isFinish === 1 ||
JSON.parse(this.$route.query.form).maintenanceCompany !== this.userInfo.user_id
) ? false : true
}
const id = this.$route.query.id;
// const {
// applyUser,
// maintenanceCompanyName,
// maintenanceCompany,
// managementName,
// taskParentName,
// taskTypeName,
// taskLevelName,
// operateSys,
// operateSysName,
// operateModuleName,
// repeatModeName,
// uploadRecords,
// expectedCompletionTime,
// isFinish,
// id,
// remark,
// detail
// } = JSON.parse(this.$route.query.form);
// this.form = {
// applyUser,
// maintenanceCompanyName,
// maintenanceCompany,
// managementName,
// taskParentName,
// taskTypeName,
// operateSys,
// taskLevelName,
// operateSysName,
// operateModuleName,
// repeatModeName,
// uploadRecords,
// expectedCompletionTime,
// isFinish,
// id,
// remark,
// detail
// };
workOrderDetail({id:id}).then(res =>{
this.form = res.data.data;
// console.log('form',this.form)
if(this.userInfo){
this.option.column.find(item => item.prop == 'operateSys').display = this.form.operateSysName ? true : false;
this.option.column.find(item => item.prop == 'operateSysName').display = this.form.operateSysName ? true : false;
this.option.column.find(item => item.prop == 'remark').disabled = (this.form.isFinish === 1 ||
this.form.maintenanceCompany !== this.userInfo.user_id
) ? true : false;
this.option.column.find(item => item.prop == 'remark').placeholder = (this.form.isFinish === 1 ||
this.form.maintenanceCompany !== this.userInfo.user_id
) ? " " : "请输入实施反馈";
this.option.column.find(item => item.prop == 'shangchuan').display = (this.form.isFinish === 1 ||
this.form.maintenanceCompany !== this.userInfo.user_id
) ? false : true
}
})
},
computed: {

@ -305,7 +305,8 @@ export default {
this.$router.push({
path: "/workflow/process/effect",
query: {
form: JSON.stringify(row),
id: row.id
// form: JSON.stringify(row),
},
});
},

@ -277,11 +277,19 @@ export default {
this.$router.push({
path: "/workflow/process/effect",
query: {
form: JSON.stringify(row),
id: row.id
// form: JSON.stringify(row),
},
});
} else {
this.dynamicRoute(row, "detail");
// this.dynamicRoute(row, "detail");
this.$router.push({
path: "/workflow/process/details",
query: {
taskId: row.taskId,
processInsId: row.processInstanceId,
},
});
}
},
},

@ -158,7 +158,8 @@
@size-change="sizeChange"
>
<template slot-scope="{ row }" slot="menu">
<el-button @click="dynamicRoute(row, 'detail')" >详情</el-button>
<!-- <el-button @click="dynamicRoute(row, 'detail')" >详情</el-button> -->
<el-button @click="details(row)" >详情</el-button>
<el-button @click="effect(row)" style="margin-left:8px;" v-if="row.status == '已完成'">实施详情</el-button>
</template>
<template slot-scope="scope" slot="status">
@ -348,7 +349,17 @@ export default {
this.$router.push({
path: '/plugin/workflow/process/implementation?id=' + row.processInstanceId,
})
}
},
//
details(row) {
this.$router.push({
path: "/workflow/process/details",
query: {
taskId: row.taskId,
processInsId: row.processInstanceId,
},
});
},
},
};
</script>

@ -26,7 +26,8 @@ module.exports = {
proxy: {
'/api': {
//本地服务接口地址
target: 'http://192.168.3.36:81',
target: 'http://192.168.1.34:81',
// target: 'http://192.168.3.36:81',
// target: 'http://192.168.1.12:81',
// target: 'http://192.168.1.102:81',
//远程演示服务地址,可用于直接启动项目

Loading…
Cancel
Save