Commit 13e5e2de by qinjianhui

fix: 工单修改

parent 5afadf92
......@@ -17,9 +17,10 @@ export function workAssigned(id, user) {
})
}
export function startWorder(id) {
export function startWorder(id, estimateCompleteTime) {
return axios.post('platform/platformWorkOrder/start', {
id: id,
estimateCompleteTime: estimateCompleteTime,
})
}
......@@ -29,10 +30,9 @@ export function archiveWorkOrder(id) {
})
}
export function completeWorkOrder(id, estimateCompleteTime) {
export function completeWorkOrder(id) {
return axios.post('platform/platformWorkOrder/complete', {
id: id,
estimateCompleteTime: estimateCompleteTime,
})
}
......
......@@ -756,24 +756,9 @@ export default {
},
// 开始工单
async startWorkOrder(item) {
try {
await this.$confirm('确定开始吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
try {
const res = await startWorder(item.id)
if (res.code === 200) {
this.getlist()
this.getOrderTree()
}
} catch (e) {
console.error(e)
}
this.estimateCompleteTime = ''
this.completeVisible = true
this.rowId = item.id
},
// 提交分派
async submitAssign() {
......@@ -838,19 +823,33 @@ export default {
}
},
async complete(item) {
this.estimateCompleteTime = ''
this.completeVisible = true
this.rowId = item.id
try {
await this.$confirm('确定开始吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
try {
const res = await completeWorkOrder(
item.id,
)
if (res.code === 200) {
this.getlist()
this.getOrderTree()
}
} catch (e) {
console.error(e)
}
},
async submitTime() {
if (!this.estimateCompleteTime) {
return this.$message.warning('请选择预计完成时间')
}
try {
const res = await completeWorkOrder(
this.rowId,
this.estimateCompleteTime,
)
const res = await startWorder(this.rowId, this.estimateCompleteTime)
if (res.code === 200) {
this.getlist()
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