工作流列表展示优化

This commit is contained in:
曹前明 2022-10-24 19:01:07 +08:00
parent a4221224b8
commit 61367639ff
7 changed files with 694 additions and 509 deletions

View File

@ -223,7 +223,7 @@
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="settingClose"
></save-dialog> ></save-dialog>
</template> </template>
@ -316,6 +316,10 @@ export default {
this.getGroup(); this.getGroup();
}, },
methods: { methods: {
settingClose(){
this.dialog.save = false;
this.$refs.table.refresh();
},
// //
async getGroup() { async getGroup() {
let res = await this.$API.system.dept.list.req({ page: 0 }); let res = await this.$API.system.dept.list.req({ page: 0 });

View File

@ -170,6 +170,7 @@
>查看 >查看
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.state == 10"
link link
type="danger" type="danger"
size="small" size="small"

View File

@ -1,4 +1,5 @@
<template> <template>
<el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select <el-select
@ -17,7 +18,7 @@
</el-select> </el-select>
<el-select <el-select
v-model="query.script_run_last_result" v-model="query.script_run_last_result"
placeholder="执行状态" placeholder="任务执行状态"
@change="handleQuery" @change="handleQuery"
clearable clearable
style="margin-left: 2px" style="margin-left: 2px"
@ -42,7 +43,6 @@
/> />
</div> </div>
</el-header> </el-header>
<el-container>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
@ -52,12 +52,12 @@
stripe stripe
highlightCurrentRow highlightCurrentRow
> >
<el-table-column label="ID" prop="id" width="180"></el-table-column>
<el-table-column label="流水号" prop="sn" width="180"></el-table-column> <el-table-column label="流水号" prop="sn" width="180"></el-table-column>
<el-table-column <el-table-column
label="工单标题" label="工单标题"
prop="title" prop="title"
width="180" width="180"
:show-overflow-tooltip="true"
></el-table-column> ></el-table-column>
<el-table-column label="工作流" prop="title"> <el-table-column label="工作流" prop="title">
@ -92,9 +92,17 @@
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="处理人类型"> <el-table-column label="可处理人" :show-overflow-tooltip="true">
<template #default="scope"> <template #default="scope">
{{ participant_[scope.row.participant_type] }} <span v-if="scope.row.participant_type==1">
{{ scope.row.participant_ .name}}
</span>
<span v-else-if="scope.row.participant_type==2">
<span v-for="item in scope.row.participant_" :key="item.id">{{ item.name}}/</span>
</span>
<span v-else>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -1,100 +1,135 @@
<template> <template>
<el-container> <el-container>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
:apiObj = "apiObj" :apiObj="apiObj"
:params = "params" :params="params"
row-key="id" row-key="id"
stripe stripe
highlightCurrentRow highlightCurrentRow
hidePagination >
> <el-table-column label="流水号" prop="sn" width="180"></el-table-column>
<el-table-column label="ID" prop="id" width="180"></el-table-column> <el-table-column
<el-table-column label="流水号" prop="sn" width="180"></el-table-column> label="工单标题"
<el-table-column label="工单标题" prop="title" width="180"></el-table-column> prop="title"
width="180"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="工作流" prop="title"> <el-table-column label="工作流" prop="title">
<template #default="scope"> <template #default="scope">
{{ scope.row.workflow_.name }} {{ scope.row.workflow_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所在节点"> <el-table-column label="所在节点">
<template #default="scope"> <template #default="scope">
{{ scope.row.state_.name }} {{ scope.row.state_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="进行状态" prop="sort"> <el-table-column label="进行状态" prop="sort">
<template #default="scope"> <template #default="scope">
<el-tag <el-tag
:type="scope.row.act_state===0?'':scope.row.act_state===1?'':scope.row.act_state===2?'danger':scope.row.act_state===3?'danger':scope.row.act_state===5?'danger':scope.row.act_state===4?'success':''" :type="
>{{act_states[scope.row.act_state]}}</el-tag> scope.row.act_state === 0
</template> ? ''
</el-table-column> : scope.row.act_state === 1
<el-table-column label="处理人类型"> ? ''
<template #default="scope"> : scope.row.act_state === 2
{{ participant_[scope.row.participant_type] }} ? 'danger'
</template> : scope.row.act_state === 3
</el-table-column> ? 'danger'
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column> : scope.row.act_state === 5
<el-table-column label="操作" fixed="right" align="center" width="100"> ? 'danger'
<template #default="scope"> : scope.row.act_state === 4
<el-button text size="small" type="primary" @click="handleShow(scope.row)">查看详情</el-button> ? 'success'
</template> : ''
</el-table-column> "
</scTable> >{{ act_states[scope.row.act_state] }}</el-tag
</el-main> >
</el-container> </template>
</el-table-column>
<el-table-column label="可处理人" :show-overflow-tooltip="true">
<template #default="scope">
<span v-if="scope.row.participant_type==1">
{{ scope.row.participant_ .name}}
</span>
<span v-else-if="scope.row.participant_type==2">
<span v-for="item in scope.row.participant_" :key="item.id">{{ item.name}}/</span>
</span>
<span v-else>
</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
width="150"
></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100">
<template #default="scope">
<el-button
text
size="small"
type="primary"
@click="handleShow(scope.row)"
>查看</el-button
>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template> </template>
<script> <script>
export default { export default {
name: "state", name: "state",
data() { data() {
return { return {
apiObj: this.$API.wf.ticket.list, apiObj: this.$API.wf.ticket.list,
params: {"category": "cc"}, params: { category: "cc" },
act_states: { act_states: {
0: "草稿中", 0: "草稿中",
1: "进行中", 1: "进行中",
2: "被退回", 2: "被退回",
3: "被撤回", 3: "被撤回",
4: "已完成", 4: "已完成",
5: "已关闭", 5: "已关闭",
}, },
participant_: { participant_: {
0: "无处理人", 0: "无处理人",
1: "个人", 1: "个人",
2: "多人", 2: "多人",
}, },
}; };
}, },
mounted() { mounted() {},
}, methods: {
methods: { handleShow(row) {
handleShow(row) { let cateType = row.workflow_.key;
let cateType = row.workflow_.key; let projectId = null;
let projectId = null; if (cateType === "visit") {
if (cateType === 'visit') { projectId = row.ticket_data.visit;
projectId = row.ticket_data.visit; } else if (cateType === "rpj") {
} else if (cateType === 'rpj') { projectId = row.ticket_data.rpj;
projectId = row.ticket_data.rpj; } else if (cateType.indexOf("opl_") != -1) {
} else if(cateType.indexOf('opl_')!=-1){ projectId = row.ticket_data.opl;
projectId = row.ticket_data.opl; cateType = "opl";
cateType = 'opl' }
} this.$router.push({
this.$router.push({ path: "ticketdetail",
path: "ticketdetail", query: {
query: { id: row.id,
id: row.id, type: "show",
type: 'show', projectId: projectId,
projectId: projectId, catetype: cateType,
catetype: cateType, },
}, });
}); },
}, },
}, };
};
</script> </script>
<style scoped> <style scoped>

View File

@ -1,153 +1,192 @@
<template> <template>
<el-container> <el-container>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
:apiObj="apiObj" :apiObj="apiObj"
:params="params" :params="params"
row-key="id" row-key="id"
stripe stripe
highlightCurrentRow highlightCurrentRow
hidePagination >
> <el-table-column label="流水号" prop="sn" width="180"></el-table-column>
<el-table-column label="ID" prop="id" width="180"></el-table-column> <el-table-column
<el-table-column label="流水号" prop="sn" width="180"></el-table-column> label="工单标题"
<el-table-column label="工单标题" prop="title" width="180"></el-table-column> prop="title"
width="180"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="工作流" prop="title"> <el-table-column label="工作流" prop="title">
<template #default="scope"> <template #default="scope">
{{ scope.row.workflow_.name }} {{ scope.row.workflow_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所在节点"> <el-table-column label="所在节点">
<template #default="scope"> <template #default="scope">
{{ scope.row.state_.name }} {{ scope.row.state_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="进行状态" prop="sort"> <el-table-column label="进行状态" prop="sort">
<template #default="scope"> <template #default="scope">
<el-tag <el-tag
:type="scope.row.act_state===0?'':scope.row.act_state===1?'':scope.row.act_state===2?'danger':scope.row.act_state===3?'danger':scope.row.act_state===5?'danger':scope.row.act_state===4?'success':''" :type="
>{{act_states[scope.row.act_state]}}</el-tag> scope.row.act_state === 0
</template> ? ''
</el-table-column> : scope.row.act_state === 1
<el-table-column label="处理人类型"> ? ''
<template #default="scope"> : scope.row.act_state === 2
{{ participant_[scope.row.participant_type] }} ? 'danger'
</template> : scope.row.act_state === 3
</el-table-column> ? 'danger'
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column> : scope.row.act_state === 5
<el-table-column label="操作" align="center"> ? 'danger'
<template #default="scope"> : scope.row.act_state === 4
<el-button ? 'success'
link : ''
size="small" "
v-if="(scope.row.act_state===1||scope.row.act_state===3)&&scope.row.state_.type===0" >{{ act_states[scope.row.act_state] }}</el-tag
type="primary" >
@click="handleDetail(scope.row)" </template>
> </el-table-column>
处理 <el-table-column label="可处理人" :show-overflow-tooltip="true">
</el-button> <template #default="scope">
<el-button v-if="scope.row.state_.distribute_type===1&&scope.row.participant_type===2" <span v-if="scope.row.participant_type==1">
link type="success" size="small" @click="handleAccept(scope.row)"> {{ scope.row.participant_ .name}}
接单 </span>
</el-button> <span v-else-if="scope.row.participant_type==2">
<el-button <span v-for="item in scope.row.participant_" :key="item.id">{{ item.name}}/</span>
type="success" </span>
link <span v-else>
size="small"
@click="handleLogs(scope.row)" </span>
> </template>
工单日志 </el-table-column>
</el-button> <el-table-column
</template> label="创建时间"
</el-table-column> prop="create_time"
</scTable> width="150"
</el-main> ></el-table-column>
</el-container> <el-table-column label="操作" align="center">
<el-dialog v-model="limitedFlowLogs" title="工单日志"> <template #default="scope">
<ticket-log ref="ticketLogs" :ticket="ticketId"></ticket-log> <el-button
</el-dialog> link
size="small"
v-if="
(scope.row.act_state === 1 || scope.row.act_state === 3) &&
scope.row.state_.type === 0
"
type="primary"
@click="handleDetail(scope.row)"
>
处理
</el-button>
<el-button
v-if="
scope.row.state_.distribute_type === 1 &&
scope.row.participant_type === 2
"
link
type="success"
size="small"
@click="handleAccept(scope.row)"
>
接单
</el-button>
<el-button
type="success"
link
size="small"
@click="handleLogs(scope.row)"
>
工单日志
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<el-dialog v-model="limitedFlowLogs" title="工单日志">
<ticket-log ref="ticketLogs" :ticket="ticketId"></ticket-log>
</el-dialog>
</template> </template>
<script> <script>
import ticketLog from "./details.vue"; import ticketLog from "./details.vue";
export default { export default {
components: { components: {
ticketLog, ticketLog,
}, },
name: "state", name: "state",
data() { data() {
return { return {
apiObj: this.$API.wf.ticket.list, apiObj: this.$API.wf.ticket.list,
params: {"category": "duty"}, params: { category: "duty" },
act_states: { act_states: {
0: "草稿中", 0: "草稿中",
1: "进行中", 1: "进行中",
2: "被退回", 2: "被退回",
3: "被撤回", 3: "被撤回",
4: "已完成", 4: "已完成",
5: "已关闭", 5: "已关闭",
}, },
participant_: { participant_: {
0: "无处理人", 0: "无处理人",
1: "个人", 1: "个人",
2: "多人", 2: "多人",
}, },
floeLogs: [], floeLogs: [],
ticketId: '', ticketId: "",
limitedFlowLogs: false, limitedFlowLogs: false,
}; };
}, },
mounted() { mounted() {},
}, methods: {
methods: { //
// handleDetail(row) {
handleDetail(row) { let cateType = row.workflow_.key;
let cateType = row.workflow_.key; let projectId = null;
let projectId = null; if (cateType === "visit") {
if (cateType === 'visit') { projectId = row.ticket_data.visit;
projectId = row.ticket_data.visit; } else if (cateType === "rpj") {
} else if (cateType === 'rpj') { projectId = row.ticket_data.rpj;
projectId = row.ticket_data.rpj; } else if (cateType.indexOf("opl_") != -1) {
} else if(cateType.indexOf('opl_')!=-1){ projectId = row.ticket_data.opl;
projectId = row.ticket_data.opl; cateType = "opl";
cateType = 'opl' }
} this.$router.push({
this.$router.push({ path: "ticketdetail",
path: "ticketdetail", query: {
query: { id: row.id,
id: row.id, projectId: projectId,
projectId: projectId, catetype: cateType,
catetype: cateType, },
}, });
}); },
}, //
// handleLogs(row) {
handleLogs(row) { let that = this;
let that = this; let id = row.id;
let id = row.id; this.ticketId = row.id;
this.ticketId = row.id; that.limitedFlowLogs = true;
that.limitedFlowLogs = true; that.$API.wf.ticket.ticketFlow.req({ ticket: id }).then((res) => {
that.$API.wf.ticket.ticketFlow.req({ticket: id}).then(res => { if (res.err_msg) {
if (res.err_msg) { } else {
that.floeLogs = res.results;
} else { }
that.floeLogs = res.results; });
} },
}) handleAccept(row) {
}, this.$API.wf.ticket.ticketAccept.req(row.id, {}).then((res) => {
handleAccept(row) { if (res.err_msg) {
this.$API.wf.ticket.ticketAccept.req(row.id, {}).then(res => { } else {
if (res.err_msg) { this.$refs.table.refresh();
} else { }
this.$refs.table.refresh() });
} },
}) },
}, };
},
};
</script> </script>
<style scoped> <style scoped>

View File

@ -1,178 +1,241 @@
<template> <template>
<el-container> <el-container>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
:apiObj="apiObj" :apiObj="apiObj"
:params="params" :params="params"
row-key="id" row-key="id"
stripe stripe
highlightCurrentRow highlightCurrentRow
hidePagination hidePagination
> >
<el-table-column label="ID" prop="id" width="180"></el-table-column> <el-table-column label="流水号" prop="sn" width="180"></el-table-column>
<el-table-column label="流水号" prop="sn" width="180"></el-table-column> <el-table-column
<el-table-column label="工单标题" prop="title" width="180"></el-table-column> label="工单标题"
prop="title"
width="180"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="工作流" prop="title"> <el-table-column label="工作流" prop="title">
<template #default="scope"> <template #default="scope">
{{ scope.row.workflow_.name }} {{ scope.row.workflow_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所在节点"> <el-table-column label="所在节点">
<template #default="scope"> <template #default="scope">
{{ scope.row.state_.name }} {{ scope.row.state_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="进行状态" prop="sort"> <el-table-column label="进行状态" prop="sort">
<template #default="scope"> <template #default="scope">
<el-tag <el-tag
:type="scope.row.act_state===0?'':scope.row.act_state===1?'':scope.row.act_state===2?'danger':scope.row.act_state===3?'danger':scope.row.act_state===5?'danger':scope.row.act_state===4?'success':''" :type="
>{{act_states[scope.row.act_state]}}</el-tag> scope.row.act_state === 0
</template> ? ''
</el-table-column> : scope.row.act_state === 1
<el-table-column label="处理人类型"> ? ''
<template #default="scope"> : scope.row.act_state === 2
{{ participant_[scope.row.participant_type] }} ? 'danger'
</template> : scope.row.act_state === 3
</el-table-column> ? 'danger'
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column> : scope.row.act_state === 5
<el-table-column label="操作" fixed="right" align="center" width="160"> ? 'danger'
<template #default="scope"> : scope.row.act_state === 4
<el-button text size="small" type="primary" @click="handleShow(scope.row)">查看</el-button> ? 'success'
<!--创建人在初始状态--> : ''
<el-button "
v-if="scope.row.state_.type===1&&userId===scope.row.create_by" >{{ act_states[scope.row.act_state] }}</el-tag
type="danger" >
size="small" </template>
link </el-table-column>
@click="handleClose(scope,'2')" <el-table-column label="可处理人" :show-overflow-tooltip="true">
> <template #default="scope">
关闭 <span v-if="scope.row.participant_type==1">
</el-button> {{ scope.row.participant_ .name}}
<!--如果state_.retreat/state_.type==1处于草稿状态 --> </span>
<el-button <span v-else-if="scope.row.participant_type==2">
v-if="scope.row.state_.enable_retreat&&userId===scope.row.create_by&&scope.row.state_.type!==1" <span v-for="item in scope.row.participant_" :key="item.id">{{ item.name}}/</span>
type="danger" </span>
@click="handleClose(scope,'1')" <span v-else>
size="small"
link </span>
> </template>
撤回 </el-table-column>
</el-button> <el-table-column
</template> label="创建时间"
</el-table-column> prop="create_time"
</scTable> width="150"
</el-main> ></el-table-column>
<el-dialog v-model="limitedRetreat" :title="handleTitle"> <el-table-column label="操作" fixed="right" align="center" width="160">
<el-form ref="Form" :model="handleForm" label-width="100px" label-position="right"> <template #default="scope">
<el-form-item :label="handleLabel"> <el-button
<el-input type="textarea" :rows="3" v-model="handleForm.suggestion" placeholder="原因"/> text
</el-form-item> size="small"
</el-form> type="primary"
<div style="text-align: center"> @click="handleShow(scope.row)"
<el-button class="filter-item" type="" @click="handleCancel">取消</el-button> >查看</el-button
<el-button class="filter-item" type="primary" @click="handleSubmit">确定</el-button> >
</div> <!--创建人在初始状态-->
</el-dialog> <el-button
</el-container> v-if="
scope.row.state_.type === 1 && userId === scope.row.create_by
"
type="danger"
size="small"
link
@click="handleClose(scope, '2')"
>
关闭
</el-button>
<!--如果state_.retreat/state_.type==1处于草稿状态 -->
<el-button
v-if="
scope.row.state_.enable_retreat &&
userId === scope.row.create_by &&
scope.row.state_.type !== 1
"
type="danger"
@click="handleClose(scope, '1')"
size="small"
link
>
撤回
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
<el-dialog v-model="limitedRetreat" :title="handleTitle">
<el-form
ref="Form"
:model="handleForm"
label-width="100px"
label-position="right"
>
<el-form-item :label="handleLabel">
<el-input
type="textarea"
:rows="3"
v-model="handleForm.suggestion"
placeholder="原因"
/>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button class="filter-item" type="" @click="handleCancel"
>取消</el-button
>
<el-button class="filter-item" type="primary" @click="handleSubmit"
>确定</el-button
>
</div>
</el-dialog>
</el-container>
</template> </template>
<script> <script>
export default { export default {
name: "state", name: "state",
data() { data() {
return { return {
apiObj: this.$API.wf.ticket.list, apiObj: this.$API.wf.ticket.list,
params: {"category": "owner"}, params: { category: "owner" },
userId: this.$TOOL.data.get("USER_INFO").id, userId: this.$TOOL.data.get("USER_INFO").id,
act_states: { act_states: {
0: "草稿中", 0: "草稿中",
1: "进行中", 1: "进行中",
2: "被退回", 2: "被退回",
3: "被撤回", 3: "被撤回",
4: "已完成", 4: "已完成",
5: "已关闭", 5: "已关闭",
}, },
participant_: { participant_: {
0: "无处理人", 0: "无处理人",
1: "个人", 1: "个人",
2: "多人", 2: "多人",
}, },
handleForm: { handleForm: {
suggestion: '', suggestion: "",
}, },
handleLabel: '撤回原因', handleLabel: "撤回原因",
handleTitle: '撤回工单', handleTitle: "撤回工单",
ticketId: null, ticketId: null,
limitedRetreat: false, limitedRetreat: false,
}; };
}, },
mounted() { mounted() {},
}, methods: {
methods: { handleShow(row) {
handleShow(row) { let cateType = row.workflow_.key;
let cateType = row.workflow_.key; let projectId = null;
let projectId = null; if (cateType === "visit") {
if (cateType === 'visit') { projectId = row.ticket_data.visit;
projectId = row.ticket_data.visit; } else if (cateType === "rpj") {
} else if (cateType === 'rpj') { projectId = row.ticket_data.rpj;
projectId = row.ticket_data.rpj; } else if (cateType.indexOf("opl_") != -1) {
} else if(cateType.indexOf('opl_')!=-1){ projectId = row.ticket_data.opl;
projectId = row.ticket_data.opl; cateType = "opl";
cateType = 'opl' }
} this.$router.push({
this.$router.push({ path: "ticketdetail",
path: "ticketdetail", query: {
query: { id: row.id,
id: row.id, type: "show",
type: "show", projectId: projectId,
projectId: projectId, catetype: cateType,
catetype: cateType, },
}, });
}); },
}, handleClose(scope, index) {
handleClose(scope, index) { if (index === "1") {
if (index === '1') { this.handleTitle = "撤回工单";
this.handleTitle = '撤回工单'; this.handleLabel = "撤回原因";
this.handleLabel = '撤回原因'; } else {
} else { this.handleTitle = "关闭工单";
this.handleTitle = '关闭工单'; this.handleLabel = "关闭原因";
this.handleLabel = '关闭原因'; }
} this.limitedRetreat = true;
this.limitedRetreat = true; this.ticketId = scope.row.id;
this.ticketId = scope.row.id; },
}, handleCancel() {
handleCancel() { this.limitedRetreat = false;
this.limitedRetreat = false; },
}, handleSubmit() {
handleSubmit() { let res = "";
let res = ''; let that = this;
let that = this; that
that.$confirm('确认' + that.handleTitle + '吗?', "温馨提示", { .$confirm("确认" + that.handleTitle + "吗?", "温馨提示", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(async () => { .then(async () => {
if (that.handleTitle === '撤回工单') { if (that.handleTitle === "撤回工单") {
res = that.$API.wf.ticket.ticketRetreat.req(that.ticketId, that.handleForm); res = that.$API.wf.ticket.ticketRetreat.req(
} else { that.ticketId,
res = that.$API.wf.ticket.ticketClose.req(that.ticketId, that.handleForm); that.handleForm
} );
if (res.err_msg) { } else {
that.$refs.table.refresh() res = that.$API.wf.ticket.ticketClose.req(
} else { that.ticketId,
that.limitedRetreat = false; that.handleForm
that.$refs.table.refresh() );
} }
}) if (res.err_msg) {
.catch((err) => { that.$refs.table.refresh();
console.error(err); } else {
}); that.limitedRetreat = false;
}, that.$refs.table.refresh();
}, }
}; })
.catch((err) => {
console.error(err);
});
},
},
};
</script> </script>
<style scoped> <style scoped>

View File

@ -1,100 +1,135 @@
<template> <template>
<el-container> <el-container>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
:apiObj="apiObj" :apiObj="apiObj"
:params="params" :params="params"
row-key="id" row-key="id"
stripe stripe
highlightCurrentRow highlightCurrentRow
hidePagination >
> <el-table-column label="流水号" prop="sn" width="180"></el-table-column>
<el-table-column label="ID" prop="id" width="180"></el-table-column> <el-table-column
<el-table-column label="流水号" prop="sn" width="180"></el-table-column> label="工单标题"
<el-table-column label="工单标题" prop="title" width="180"></el-table-column> prop="title"
width="180"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="工作流" prop="title"> <el-table-column label="工作流" prop="title">
<template #default="scope"> <template #default="scope">
{{ scope.row.workflow_.name }} {{ scope.row.workflow_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所在节点"> <el-table-column label="所在节点">
<template #default="scope"> <template #default="scope">
{{ scope.row.state_.name }} {{ scope.row.state_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="进行状态" prop="sort"> <el-table-column label="进行状态" prop="sort">
<template #default="scope"> <template #default="scope">
<el-tag <el-tag
:type="scope.row.act_state===0?'':scope.row.act_state===1?'':scope.row.act_state===2?'danger':scope.row.act_state===3?'danger':scope.row.act_state===5?'danger':scope.row.act_state===4?'success':''" :type="
>{{act_states[scope.row.act_state]}}</el-tag> scope.row.act_state === 0
</template> ? ''
</el-table-column> : scope.row.act_state === 1
<el-table-column label="处理人类型"> ? ''
<template #default="scope"> : scope.row.act_state === 2
{{ participant_[scope.row.participant_type] }} ? 'danger'
</template> : scope.row.act_state === 3
</el-table-column> ? 'danger'
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column> : scope.row.act_state === 5
<el-table-column label="操作" fixed="right" align="center" width="100"> ? 'danger'
<template #default="scope"> : scope.row.act_state === 4
<el-button text size="small" type="primary" @click="handleShow(scope.row)">查看详情</el-button> ? 'success'
</template> : ''
</el-table-column> "
</scTable> >{{ act_states[scope.row.act_state] }}</el-tag
</el-main> >
</el-container> </template>
</el-table-column>
<el-table-column label="可处理人" :show-overflow-tooltip="true">
<template #default="scope">
<span v-if="scope.row.participant_type==1">
{{ scope.row.participant_ .name}}
</span>
<span v-else-if="scope.row.participant_type==2">
<span v-for="item in scope.row.participant_" :key="item.id">{{ item.name}}/</span>
</span>
<span v-else>
</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
width="150"
></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100">
<template #default="scope">
<el-button
text
size="small"
type="primary"
@click="handleShow(scope.row)"
>查看</el-button
>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template> </template>
<script> <script>
export default { export default {
name: "state", name: "state",
data() { data() {
return { return {
apiObj: this.$API.wf.ticket.list, apiObj: this.$API.wf.ticket.list,
params: {"category": "worked"}, params: { category: "worked" },
act_states: { act_states: {
0: "草稿中", 0: "草稿中",
1: "进行中", 1: "进行中",
2: "被退回", 2: "被退回",
3: "被撤回", 3: "被撤回",
4: "已完成", 4: "已完成",
5: "已关闭", 5: "已关闭",
}, },
participant_: { participant_: {
0: "无处理人", 0: "无处理人",
1: "个人", 1: "个人",
2: "多人", 2: "多人",
}, },
}; };
}, },
mounted() { mounted() {},
}, methods: {
methods: { handleShow(row) {
handleShow(row) { let cateType = row.workflow_.key;
let cateType = row.workflow_.key; let projectId = null;
let projectId = null; if (cateType === "visit") {
if (cateType === 'visit') { projectId = row.ticket_data.visit;
projectId = row.ticket_data.visit; } else if (cateType === "rpj") {
} else if (cateType === 'rpj') { projectId = row.ticket_data.rpj;
projectId = row.ticket_data.rpj; } else if (cateType.indexOf("opl_") != -1) {
} else if(cateType.indexOf('opl_')!=-1){ projectId = row.ticket_data.opl;
projectId = row.ticket_data.opl; cateType = "opl";
cateType = 'opl' }
} this.$router.push({
this.$router.push({ path: "ticketdetail",
path: "ticketdetail", query: {
query: { id: row.id,
id: row.id, type: "show",
type: "show", projectId: projectId,
projectId: projectId, catetype: cateType,
catetype: cateType, },
}, });
}); },
}, },
}, };
};
</script> </script>
<style scoped> <style scoped>