进度跟踪新增工单状态切换
This commit is contained in:
parent
ffa2f2659d
commit
64622a2300
@ -221,3 +221,12 @@ export function GetWorkorderTraceProgressList(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//修改工单状态
|
||||
export function UpdateWorkorderStatus(data) {
|
||||
return request({
|
||||
url: 'mes/productManagement/ProWorkorder/setWorkorderStatus',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -64,10 +64,20 @@
|
||||
<!-- 添加计划完成列 -->
|
||||
<el-table-column prop="planNum" label="计划完成" width="100" align="center"
|
||||
v-if="columns.showColumn('planNum')" />
|
||||
<el-table-column prop="ticketStatus" label="工单状态" width="240" align="center">
|
||||
<template #default="scope">
|
||||
<el-select @change="handleWorkOrderStatusChange(scope.row)" v-model="scope.row.ticketStatus"
|
||||
placeholder="请选择工单状态">
|
||||
<el-option v-for="item in options.workOrderOptions" :key="item.label" :value="item.label">
|
||||
{{ item.label }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 添加实际完成列 -->
|
||||
<el-table-column prop="actualNum" label="实际完成" width="100" align="center"
|
||||
v-if="columns.showColumn('actualNum')" />
|
||||
<el-table-column prop="deliveryNum" label="工单进度" align="center">
|
||||
<el-table-column prop="deliveryNum" label="工单进度" width="240" align="center">
|
||||
<template #default="scope">
|
||||
<el-progress :text-inside="true" :stroke-width="24" :percentage="getPercentage(scope.row)"
|
||||
:status="getProgressColor(scope.row)" />
|
||||
@ -80,7 +90,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="proworkorder">
|
||||
import { GetWorkorderTraceProgressList } from '@/api/productManagement/proworkorder.js'
|
||||
import { GetWorkorderTraceProgressList, UpdateWorkorderStatus } from '@/api/productManagement/proworkorder.js'
|
||||
import { getOneDict } from '@/utils/dict.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const loading = ref(false)
|
||||
@ -94,6 +104,7 @@ const queryParams = reactive({
|
||||
sort: 'sort',
|
||||
sortType: 'asc'
|
||||
})
|
||||
|
||||
const columns = ref([
|
||||
{ visible: true, prop: 'workorder', label: '工单号' },
|
||||
{ visible: true, prop: 'lineCode', label: '线别' },
|
||||
@ -128,6 +139,28 @@ function getList() {
|
||||
})
|
||||
}
|
||||
|
||||
function handleWorkOrderStatusChange(val) {
|
||||
let status = null
|
||||
if (val.ticketStatus == '初始化') {
|
||||
status = 1
|
||||
} else if (val.ticketStatus == '开始') {
|
||||
status = 2
|
||||
} else if (val.ticketStatus == '结束') {
|
||||
status = 3
|
||||
} else {
|
||||
status = 4
|
||||
}
|
||||
let data = {
|
||||
id: val.id,
|
||||
status: status,
|
||||
}
|
||||
UpdateWorkorderStatus(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
proxy.messageSuccess('修改成功!')
|
||||
getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
@ -166,7 +199,13 @@ const state = reactive({
|
||||
],
|
||||
dictWorkTypeOptions: [],
|
||||
// 工单状态 选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
statusOptions: []
|
||||
statusOptions: [],
|
||||
workOrderOptions: [
|
||||
{ label: '初始化', value: '1' },
|
||||
{ label: '开始', value: '2' },
|
||||
{ label: '结束', value: '3' },
|
||||
{ label: '暂停', value: '4' },
|
||||
]
|
||||
},
|
||||
processList: [],
|
||||
stationList: []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user