Commit 13e5e2de by qinjianhui

fix: 工单修改

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