Browse Source

补料任务、发料任务,需要增加关闭任务功能,只有待处理的任务可以关闭

hella_online_20240829
zhang_li 2 months ago
parent
commit
8819121a61
  1. 24
      src/api/request2.js
  2. 20
      src/common/array.js
  3. 49
      src/pages/issue/job/issueJob.vue
  4. 38
      src/pages/repleinsh/job/repleinshJob.vue

24
src/api/request2.js

@ -1418,6 +1418,18 @@ export function cancleTakeIssueJob(id) {
data: {}, data: {},
}); });
} }
/**
* 发料 关闭任务
* @param {*} id
*
*/
export function closeTakeIssueJob(id) {
return request({
url: baseApi + "/wms/issue-job-main/close?id=" + id,
method: "put",
data: {},
});
}
/** /**
* 发料任务 提交 * 发料任务 提交
@ -3861,6 +3873,18 @@ export function cancleTakeRepleinshJob(id) {
}); });
} }
/**
* 补料任务 关闭任务
* @param {*} id
*
*/
export function closeTakeRepleinshJob(id) {
return request({
url: baseApi + "/wms/repleinsh-job-main/close?id=" + id,
method: "put",
data: {},
});
}
/** /**
* 补料任务 提交 * 补料任务 提交
* @param {*} params * @param {*} params

20
src/common/array.js

@ -223,7 +223,7 @@ export function getDetailEditRemoveOption() {
} }
//详情编辑放弃 //详情编辑关闭
export function getDetailGiveupOption() { export function getDetailGiveupOption() {
let option_detail_giveup = [{ let option_detail_giveup = [{
text: '详情', text: '详情',
@ -241,7 +241,23 @@ export function getDetailGiveupOption() {
return option_detail_giveup; return option_detail_giveup;
} }
//详情放弃
export function getDetailCloseOption() {
let option_detail_giveup = [{
text: '详情',
style: {
backgroundColor: '#3C9CFF'
}
},
{
text: '关闭',
style: {
backgroundColor: '#F56C6C'
}
}
];
return option_detail_giveup;
}
//详情编辑移除 //详情编辑移除
export function getEditRemoveOption() { export function getEditRemoveOption() {

49
src/pages/issue/job/issueJob.vue

@ -9,7 +9,8 @@
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index"> <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" <uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card> <com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card>
@ -34,7 +35,8 @@
import { import {
cancleTakeIssueJob, cancleTakeIssueJob,
getIssueJobList, getIssueJobList,
getIssueJobByProductionline getIssueJobByProductionline,
closeTakeIssueJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -43,7 +45,8 @@
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption getDetailGiveupOption,
getDetailCloseOption
} from '@/common/array.js'; } from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
@ -81,6 +84,7 @@
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
productionlineList: [], productionlineList: [],
detailCloseOptions: [],
title:'', title:'',
productionLine:"", productionLine:"",
fromLocation:"" fromLocation:""
@ -97,6 +101,7 @@
onReady() { onReady() {
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
this.detailCloseOptions = getDetailCloseOption();
}, },
onReachBottom() { onReachBottom() {
// //
@ -289,11 +294,18 @@
this.openjobInfoPopup(dataContent); this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") { } else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => { res => {
if (res) { if (res) {
this.cancleJob(dataContent.masterId); this.cancleJob(dataContent.masterId);
} }
}); });
}else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
res => {
if (res) {
this.closeJob(dataContent.masterId);
}
});
} }
}, },
@ -315,6 +327,27 @@
this.showMessage(error) this.showMessage(error)
}) })
}, },
closeJob(id) {
uni.showLoading({
title: "加载中....",
mask: true
});
closeTakeIssueJob(id).then(res => {
uni.hideLoading()
if(res.data){
this.getList("refresh")
uni.showToast({
title:"关闭任务成功"
})
}else {
this.showMessage("关闭任务失败")
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;

38
src/pages/repleinsh/job/repleinshJob.vue

@ -9,7 +9,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index"> <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item <uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions" :right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-repleinsh-job-card :dataContent="item" @click='openJobDetail(item)'></com-repleinsh-job-card> <com-repleinsh-job-card :dataContent="item" @click='openJobDetail(item)'></com-repleinsh-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -31,7 +31,8 @@
import { import {
getRepleinshJobList, getRepleinshJobList,
cancleTakeRepleinshJob cancleTakeRepleinshJob,
closeTakeRepleinshJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -41,7 +42,8 @@
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption getDetailGiveupOption,
getDetailCloseOption
} from '@/common/array.js'; } from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
@ -77,6 +79,7 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
detailCloseOptions: [],
title:'', title:'',
scanMessage:"" scanMessage:""
}; };
@ -92,6 +95,7 @@
onReady() { onReady() {
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
this.detailCloseOptions = getDetailCloseOption();
}, },
//退 //退
@ -231,6 +235,13 @@
this.cancleJob(dataContent.masterId); this.cancleJob(dataContent.masterId);
} }
}); });
}else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
res => {
if (res) {
this.closeJob(dataContent.masterId);
}
});
} }
}, },
@ -252,6 +263,27 @@
this.showMessage(error) this.showMessage(error)
}) })
}, },
closeJob(id) {
uni.showLoading({
title: "加载中....",
mask: true
});
closeTakeRepleinshJob(id).then(res => {
uni.hideLoading()
if(res.data){
this.getList("refresh")
uni.showToast({
title:"关闭任务成功"
})
}else {
this.showMessage("关闭任务失败")
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;

Loading…
Cancel
Save