diff --git a/fe/PC/src/api/wms-job.js b/fe/PC/src/api/wms-job.js index 401c663c0..f5a37bc56 100644 --- a/fe/PC/src/api/wms-job.js +++ b/fe/PC/src/api/wms-job.js @@ -75,6 +75,14 @@ export function open(url, data) { }) } +//任务流程——完成 +export function CompleteAsyncJob(url,data) { + return request({ + url: baseURL + url + '/CompleteAsync/' + data.id, + method: 'post', + }) +} + //获取详情 export function getDetailed(id, url) { diff --git a/fe/PC/src/filters/status.js b/fe/PC/src/filters/status.js index 4d4798fdc..fc0c6e510 100644 --- a/fe/PC/src/filters/status.js +++ b/fe/PC/src/filters/status.js @@ -131,6 +131,11 @@ import store from '@/store/index' value: 9, background:"#EC5B28", }, + 30: { + label: "等待", + value: 30, + background:"#EC5B28", + }, } return Enum(status, index, prop) } diff --git a/fe/PC/src/mixins/drawerMixins.js b/fe/PC/src/mixins/drawerMixins.js index be903feb1..0a00086f7 100644 --- a/fe/PC/src/mixins/drawerMixins.js +++ b/fe/PC/src/mixins/drawerMixins.js @@ -11,7 +11,8 @@ import { close, cancel, cancelAccept, - open + open, + CompleteAsyncJob } from '@/api/wms-job' export const drawerMixins = { data() { @@ -57,186 +58,317 @@ export const drawerMixins = { // 申请业务 流程按钮实现 // 【提交】操作 if (val == requestDataNames.submit) { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/submit/').then(res => { - that.$successMsg('已提交') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定提交?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/submit/').then(res => { + that.$successMsg('已提交') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【审批】操作 else if (val == requestDataNames.agree) { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/agree/').then(res => { - that.$successMsg('已同意') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定审批?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/agree/').then(res => { + that.$successMsg('已同意') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【处理】操作 else if (val == requestDataNames.handle) { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/handle/').then(res => { - that.$successMsg('处理完成') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定处理?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/handle/').then(res => { + that.$successMsg('处理完成') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【执行】操作 else if (val == requestDataNames.againHandle) { // 针对部分完成情况下,再次执行任务操作 - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/handle/').then(res => { - that.$successMsg('执行成功') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定执行?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/handle/').then(res => { + that.$successMsg('执行成功') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【中止】操作 else if (val == requestDataNames.abort) { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/abort/').then(res => { - that.$successMsg('已中止') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定中止?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/abort/').then(res => { + that.$successMsg('已中止') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【执行完成】操作 else if (val == 'completeRequest') { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/complete/').then(res => { - that.$successMsg('执行完成') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定完成?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/complete/').then(res => { + that.$successMsg('执行完成') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【取消】操作 else if (val == requestDataNames.cancel) { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/cancel/').then(res => { - that.$successMsg('已取消') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定取消?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/cancel/').then(res => { + that.$successMsg('已取消') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 【驳回】操作 else if (val == requestDataNames.refuse) { - that.Loading.appMainLoading = true - processRequest(that.propsData.id, that.URL + '/refuse/').then(res => { - that.$successMsg('已驳回') - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定驳回?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + processRequest(that.propsData.id, that.URL + '/refuse/').then(res => { + that.$successMsg('已驳回') + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging() + that.Loading.appMainLoading = false + }).catch(err => { + console.log(err) + that.Loading.appMainLoading = false }) - that.paging() - that.Loading.appMainLoading = false - }).catch(err => { - console.log(err) - that.Loading.appMainLoading = false }) + .catch(() => { + }); } // 任务 流程按钮实现 if (val == 'acceptJob') { - that.Loading.appMainLoading = true - accept(that.URL, {id: that.propsData.id}).then(res => { - that.$successMsg('已接任务') - that.Loading.appMainLoading = false - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + this.$confirm('是否确定接受任务?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + accept(that.URL, {id: that.propsData.id}).then(res => { + that.$successMsg('已接任务') + that.Loading.appMainLoading = false + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging(); + }).catch(err => { + that.Loading.appMainLoading = false }) - that.paging(); - }).catch(err => { - that.Loading.appMainLoading = false }) - } else if(val == 'closeJob'){ - that.Loading.appMainLoading = true - close(that.URL, {id: that.propsData.id}).then(res => { - that.$successMsg('已关闭任务') - that.Loading.appMainLoading = false - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + .catch(() => { + }); + } + else if(val == 'closeJob'){ + this.$confirm('是否确定关闭任务?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + close(that.URL, {id: that.propsData.id}).then(res => { + that.$successMsg('已关闭任务') + that.Loading.appMainLoading = false + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging(); + }).catch(err => { + that.Loading.appMainLoading = false + }) + }) + .catch(() => { + }); + } + else if(val == 'invalidJob'){ + this.$confirm('是否确定作废任务?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + cancel(that.URL, {id: that.propsData.id}).then(res => { + that.$successMsg('已作废任务') + that.Loading.appMainLoading = false + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging(); + }).catch(err => { + that.Loading.appMainLoading = false }) - that.paging(); - }).catch(err => { - that.Loading.appMainLoading = false }) - } else if(val == 'invalidJob'){ - that.Loading.appMainLoading = true - cancel(that.URL, {id: that.propsData.id}).then(res => { - that.$successMsg('已作废任务') - that.Loading.appMainLoading = false - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + .catch(() => { + }); + } + // 新版独立操作 + else if(val == 'CompleteAsyncJob'){ + this.$confirm('是否确定完成任务?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + CompleteAsyncJob(that.URL, {id: that.propsData.id}).then(res => { + that.$successMsg('任务已完成') + that.Loading.appMainLoading = false + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging(); + }).catch(err => { + that.Loading.appMainLoading = false }) - that.paging(); - }).catch(err => { - that.Loading.appMainLoading = false }) - } else if(val == 'cancelAcceptJob'){ - that.Loading.appMainLoading = true - cancelAccept(that.URL, {id: that.propsData.id}).then(res => { - that.$successMsg('已取消接受任务') - that.Loading.appMainLoading = false - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + .catch(() => { + }); + } + else if(val == 'cancelAcceptJob'){ + this.$confirm('是否确定取消接受任务?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + cancelAccept(that.URL, {id: that.propsData.id}).then(res => { + that.$successMsg('已取消接受任务') + that.Loading.appMainLoading = false + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging(); + }).catch(err => { + that.Loading.appMainLoading = false }) - that.paging(); - }).catch(err => { - that.Loading.appMainLoading = false }) - } else if(val == 'openJob'){ - that.Loading.appMainLoading = true - open(that.URL, {id: that.propsData.id}).then(res => { - that.$successMsg('已打开任务') - that.Loading.appMainLoading = false - getDetailed(that.propsData.id, that.URL).then(res => { - that.propsData = res + .catch(() => { + }); + } + else if(val == 'openJob'){ + this.$confirm('是否确定打开任务?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + that.Loading.appMainLoading = true + open(that.URL, {id: that.propsData.id}).then(res => { + that.$successMsg('已打开任务') + that.Loading.appMainLoading = false + getDetailed(that.propsData.id, that.URL).then(res => { + that.propsData = res + }) + that.paging(); + }).catch(err => { + that.Loading.appMainLoading = false }) - that.paging(); - }).catch(err => { - that.Loading.appMainLoading = false }) - } else if(val == 'handleJob'){ + .catch(() => { + }); + } + else if(val == 'handleJob'){ // 请在主页写相关执行任务操作代码 console.log('请在主页写相关执行任务操作代码') } diff --git a/fe/PC/src/views/kittingManage/KittingIssueJob.vue b/fe/PC/src/views/kittingManage/KittingIssueJob.vue index 41c1c603f..fc1ade973 100644 --- a/fe/PC/src/views/kittingManage/KittingIssueJob.vue +++ b/fe/PC/src/views/kittingManage/KittingIssueJob.vue @@ -43,8 +43,9 @@ :drawer="displayDialog.detailsDialog" :propsData="propsData" :tabsDesTions="tabsDesTions" - :Butttondata="[]" + :Butttondata="DrawerButtonData" @drawerShut="(val) => (displayDialog.detailsDialog = val)" + @drawerbutton="drawerbutton" @handleCommand="drawerHandle" @close-value="closeValue" :tableColumns="detailsTableColumns" @@ -61,6 +62,8 @@ import { drawerMixins } from "@/mixins/drawerMixins"; import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; import { mixins } from "@/mixins/mixins"; + import { complete } from "@/api/wms-job"; + export default { name: "KittingIssueJob", mixins: [ @@ -70,6 +73,19 @@ TableHeaderMixins, mixins, ], + computed: { + hideButton: function () { + return function (val) { + let data = true + val.forEach(key => { + if (this.propsData.jobStatus == key) { + data = false + } + }) + return data + } + }, + }, data() { return { URL: "wms/store/kitting-issue-job", @@ -80,11 +96,21 @@ this.defaultFreshBtn(),//刷新 this.defaultFilterBtn(),//筛选 ], + DrawerButtonData: [ + { + type: 'success', + label: '完成', + hide: false, + name: "CompleteAsyncJob", + hide: () => { return this.hideButton([1,2,4]) }, + size: 'mini' + }, + ], }; }, mounted() { this.paging(); - }, + } }; \ No newline at end of file