Commit 17888adb by qinjianhui

fix: 工单管理优化

parent 6e4c331a
...@@ -99,59 +99,6 @@ ...@@ -99,59 +99,6 @@
查询 查询
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="statusCode === 'PRE_HANDLING'">
<el-button
type="primary"
size="mini"
@click="confirm"
>确认</el-button
>
</el-form-item>
<el-form-item
v-if="statusCode === 'TO_BE_CONFIRMED'"
>
<el-button
type="success"
size="mini"
@click="startWorkOrder"
>开始</el-button
>
</el-form-item>
<!-- <el-form-item v-if="statusCode === 'IN_PROGRESS'">
<el-button type="success" size="mini"
>关闭</el-button
>
</el-form-item> -->
<el-form-item v-if="statusCode === 'TO_BE_ASSIGN'">
<el-button
type="success"
size="mini"
@click="showAssign"
>指派给</el-button
>
</el-form-item>
<!-- <el-form-item v-if="statusCode === 'PRE_HANDLING'">
<el-button type="primary" size="mini"
>评价</el-button
>
</el-form-item> -->
<!-- <el-form-item v-if="statusCode !== 'PRE_HANDLING'">
<el-button
type="warning"
size="mini"
@click="rejectTask"
>驳回</el-button
>
</el-form-item> -->
<el-form-item label v-if="statusCode === 'CLOSED'">
<el-button
@click="archive()"
type="success"
size="mini"
>
归档
</el-button>
</el-form-item>
</el-form> </el-form>
<div class="table-wrap" v-loading="loading"> <div class="table-wrap" v-loading="loading">
<table-view <table-view
...@@ -413,6 +360,10 @@ import { ...@@ -413,6 +360,10 @@ import {
} from '@/common/api/order' } from '@/common/api/order'
import { getSystemUserList } from '@/common/api/system' import { getSystemUserList } from '@/common/api/system'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import confirmWork from '@/assets/work/confirm.png'
import assignWork from '@/assets/work/assign.png'
import startWork from '@/assets/work/start.png'
import archiveWork from '@/assets/work/archive.png'
export default { export default {
name: 'task_center', name: 'task_center',
...@@ -527,19 +478,48 @@ export default { ...@@ -527,19 +478,48 @@ export default {
></i> ></i>
</span> </span>
)} )}
{/* { {item.orderStatus === 'PRE_HANDLING' && (
<span <span title="确认" class="icon-view">
title="评价" <img
class="icon-view icon-tools-view" width="24"
> height="24"
<i src={confirmWork}
class="el-icon-chat-dot-square" onClick={() => this.confirm(item)}
/>
</span>
)}
{item.orderStatus === 'TO_BE_ASSIGN' && (
<span title="指派给" class="icon-view">
<img
width="24"
height="24"
src={assignWork}
onClick={() => this.showAssign(item)}
/>
</span>
)}
{item.orderStatus === 'TO_BE_CONFIRMED' && (
<span title="开始" class="icon-view">
<img
width="24"
height="24"
src={startWork}
onClick={() => onClick={() =>
this.operation('2', item) this.startWorkOrder(item)
} }
></i> />
</span> </span>
} */} )}
{item.orderStatus === 'CLOSED' && (
<span title="归档" class="icon-view">
<img
width="24"
height="24"
src={archiveWork}
onClick={() => this.archive(item)}
/>
</span>
)}
</span> </span>
), ),
}, },
...@@ -573,10 +553,7 @@ export default { ...@@ -573,10 +553,7 @@ export default {
} }
}, },
// 确认 // 确认
async confirm() { async confirm(item) {
if (this.selections.length !== 1) {
return this.$message.warning('请选择一条记录')
}
try { try {
await this.$confirm('确定执行吗?', '提示', { await this.$confirm('确定执行吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -586,10 +563,8 @@ export default { ...@@ -586,10 +563,8 @@ export default {
} catch { } catch {
return return
} }
const id = this.selections[0].id
try { try {
const res = await workConfirmed(id) const res = await workConfirmed(item.id)
if (res.code === 200) { if (res.code === 200) {
this.getlist() this.getlist()
this.getOrderTree() this.getOrderTree()
...@@ -620,18 +595,12 @@ export default { ...@@ -620,18 +595,12 @@ export default {
} }
}, },
showAssign(item) { showAssign(item) {
if (this.selections.length !== 1) {
return this.$message.warning('请选择一条记录')
}
this.currentRowId = item.id this.currentRowId = item.id
this.taskLeader = '' this.taskLeader = ''
this.assignVisible = true this.assignVisible = true
}, },
// 开始工单 // 开始工单
async startWorkOrder() { async startWorkOrder(item) {
if (this.selections.length !== 1) {
return this.$message.warning('请选择一条记录')
}
try { try {
await this.$confirm('确定开始吗?', '提示', { await this.$confirm('确定开始吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -642,7 +611,7 @@ export default { ...@@ -642,7 +611,7 @@ export default {
return return
} }
try { try {
const res = await startWorder(this.selections[0].id) const res = await startWorder(item.id)
if (res.code === 200) { if (res.code === 200) {
this.getlist() this.getlist()
this.getOrderTree() this.getOrderTree()
...@@ -693,10 +662,7 @@ export default { ...@@ -693,10 +662,7 @@ export default {
this.loading = false this.loading = false
}) })
}, },
async archive() { async archive(item) {
if (this.selections.length === 0) {
return this.$message.warning('请至少选择一条记录')
}
try { try {
await this.$confirm('确定归档吗?', '提示', { await this.$confirm('确定归档吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -707,9 +673,7 @@ export default { ...@@ -707,9 +673,7 @@ export default {
return return
} }
try { try {
const res = await archiveWorkOrder( const res = await archiveWorkOrder(item.id)
this.selections[0].id,
)
if (res.code === 200) { if (res.code === 200) {
this.getlist() this.getlist()
this.getOrderTree() this.getOrderTree()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment