Commit 39e4701f by Mr. Lan

feat: 添加工单删除功能。

parent a0427fb7
...@@ -71,3 +71,11 @@ export function activeOrder(data, workOrderId) { ...@@ -71,3 +71,11 @@ export function activeOrder(data, workOrderId) {
data data
}) })
} }
// 删除工单
export function deleteWorkOrder(workOrderId) {
return request({
url: `/api/v1/work-order/delete/${workOrderId}`,
method: 'delete'
})
}
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<span>{{ parseTime(scope.row.create_time) }}</span> <span>{{ parseTime(scope.row.create_time) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-permisaction="['process:list:all:select']" v-permisaction="['process:list:all:select']"
...@@ -80,6 +80,13 @@ ...@@ -80,6 +80,13 @@
icon="el-icon-switch-button" icon="el-icon-switch-button"
@click="handleUnity(scope.row)" @click="handleUnity(scope.row)"
>结单</el-button> >结单</el-button>
<el-button
v-permisaction="['process:list:all:delete']"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -122,7 +129,7 @@ ...@@ -122,7 +129,7 @@
</template> </template>
<script> <script>
import { workOrderList, unityWorkOrder, inversionWorkOrder } from '@/api/process/work-order' import { workOrderList, unityWorkOrder, inversionWorkOrder, deleteWorkOrder } from '@/api/process/work-order'
import { listUser } from '@/api/system/sysuser' import { listUser } from '@/api/system/sysuser'
export default { export default {
data() { data() {
...@@ -174,6 +181,26 @@ export default { ...@@ -174,6 +181,26 @@ export default {
handleView(row) { handleView(row) {
this.$router.push({ name: 'ProcessListHandle', query: { workOrderId: row.id, processId: row.process }}) this.$router.push({ name: 'ProcessListHandle', query: { workOrderId: row.id, processId: row.process }})
}, },
handleDelete(row) {
this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteWorkOrder(row.id).then(response => {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getList()
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
handleUnity(row) { handleUnity(row) {
this.$confirm('此操作将会结束该工单, 是否继续?', '提示', { this.$confirm('此操作将会结束该工单, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
......
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 sign in to comment