工单详情改为接口请求

main
xuechunyuan 3 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", responseType: "blob",
}); });
}; };
// 工单详情
export const workOrderDetail = (query) => {
return request({
url: `${prefix}/detail`,
method: "get",
params: query,
});
};

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

@ -247,11 +247,20 @@ export default {
mixins: [exForm, theme], mixins: [exForm, theme],
components: { userSelect, WfExamineForm, WfButton, WfFlow }, components: { userSelect, WfExamineForm, WfButton, WfFlow },
watch: { 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) { handler(val) {
if (val) { if (val) {
const param = JSON.parse(Buffer.from(val, "base64").toString()); const { taskId, processInsId } = val;
const { taskId, processInsId } = param;
if (taskId && processInsId) this.getDetail(taskId, processInsId); if (taskId && processInsId) this.getDetail(taskId, processInsId);
} }
}, },

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

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

@ -277,11 +277,19 @@ export default {
this.$router.push({ this.$router.push({
path: "/workflow/process/effect", path: "/workflow/process/effect",
query: { query: {
form: JSON.stringify(row), id: row.id
// form: JSON.stringify(row),
}, },
}); });
} else { } 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" @size-change="sizeChange"
> >
<template slot-scope="{ row }" slot="menu"> <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> <el-button @click="effect(row)" style="margin-left:8px;" v-if="row.status == '已完成'">实施详情</el-button>
</template> </template>
<template slot-scope="scope" slot="status"> <template slot-scope="scope" slot="status">
@ -348,7 +349,17 @@ export default {
this.$router.push({ this.$router.push({
path: '/plugin/workflow/process/implementation?id=' + row.processInstanceId, 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> </script>

@ -26,7 +26,8 @@ module.exports = {
proxy: { proxy: {
'/api': { '/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.12:81',
// target: 'http://192.168.1.102:81', // target: 'http://192.168.1.102:81',
//远程演示服务地址,可用于直接启动项目 //远程演示服务地址,可用于直接启动项目

Loading…
Cancel
Save