Browse Source

直接备货任务

hella_vue3
lijuncheng 8 months ago
parent
commit
f796ccac69
  1. 68
      src/api/request2.js
  2. 35
      src/pages/pick/job/pickJob.vue
  3. 16
      src/pages/pick/job/pickJobDetail.vue

68
src/api/request2.js

@ -2047,6 +2047,74 @@ export function productPutawayRecordSubmit(params) {
} }
/**
* 直接备货 任务
* status 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* @param {*}
*/
export function getPickJobList(params) {
return request({
url: baseApi + "/wms/pick-job-main/senior",
method: "post",
data: params,
});
}
/**
* 直接备货 获取任务明细
* @param {*} id 任务id
*
*/
export function getPickJobDetail(id) {
return request({
url: baseApi + "/wms/pick-job-main/getPickJobById?id=" + id,
method: "get",
data: {},
});
}
/**
* 直接备货任务 承接
* @param {*} id
*
*/
export function takePickJob(id) {
return request({
url: baseApi + "/wms/pick-job-main/accept?id=" + id,
method: "put",
data: {},
});
}
/**
* 直接备货任务 放弃承接
* @param {*} id
*
*/
export function cancleTakePickJob(id) {
return request({
url: baseApi + "/wms/pick-job-main/abandon?id=" + id,
method: "put",
data: {},
});
}
/**
* 直接备货任务 提交
* @param {*} params
*/
export function pickJobsubmit(params) {
return request({
url: baseApi + "/wms/pick-job-main/execute",
method: "put",
data: params,
});
}
/** /**
* 制品拆解 任务 * 制品拆解 任务
* status 任务状态 * status 任务状态

35
src/pages/pick/job/pickJob.vue

@ -5,12 +5,11 @@
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"> :checkedWaitTask="checkedWaitTask">
</job-filter> </job-filter>
<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 <uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-product-job-card :dataContent="item" @click='openJobDetail(item)'></com-product-job-card> <com-product-job-card :dataContent="item" @click='openJobDetail(item)'></com-product-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -28,8 +27,8 @@
<script> <script>
import { import {
getProductReceiptJobList, getPickJobList,
cancleTakeProductReceiptJob cancleTakePickJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -82,7 +81,7 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
}, },
onReachBottom() { onReachBottom() {
// //
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
@ -90,7 +89,7 @@
} }
this.getList("more"); this.getList("more");
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh');
}, },
@ -135,24 +134,24 @@
value: this.todayTime value: this.todayTime
}) })
} }
filters.push({ filters.push({
column: "status", column: "status",
action: "in", action: "in",
value: this.status value: this.status
}) })
var params = { var params = {
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
getProductReceiptJobList(params).then(res => { getPickJobList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
this.loadingType = "loadmore"; this.loadingType = "loadmore";
@ -207,13 +206,13 @@
}, },
cancleJob(id) { cancleJob(id) {
cancleTakeProductReceiptJob(id).then(res => { cancleTakePickJob(id).then(res => {
if(res.data){ if (res.data) {
this.getList("refresh") this.getList("refresh")
uni.showToast({ uni.showToast({
title:"放弃任务成功" title: "放弃任务成功"
}) })
}else { } else {
this.showMessage("放弃任务失败") this.showMessage("放弃任务失败")
} }
}).catch(error => { }).catch(error => {
@ -252,13 +251,13 @@
action: "==", action: "==",
value: code value: code
}) })
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
} }
getProductReceiptJobList(params).then(res => { getPickJobList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务'); that.showMessage('未查找到' + '【' + code + '】的收货任务');
@ -284,4 +283,4 @@
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>

16
src/pages/pick/job/pickJobDetail.vue

@ -49,10 +49,10 @@
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
getProductReceiptJobDetail, getPickJobDetail,
takeProductReceiptJob, takePickJob,
cancleTakeProductReceiptJob, cancleTakePickJob,
productReceiptJobsubmit pickJobsubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -134,7 +134,7 @@
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.jobStatus=="2") { if (this.jobStatus=="2") {
// //
cancleTakeProductReceiptJob(this.id).then(res => { cancleTakePickJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
}).catch(error => { }).catch(error => {
uni.navigateBack(); uni.navigateBack();
@ -160,7 +160,7 @@
// //
receive(callback) { receive(callback) {
if (this.id != null) { if (this.id != null) {
takeProductReceiptJob(this.id).then(res => { takePickJob(this.id).then(res => {
callback(); callback();
}).catch(error => { }).catch(error => {
this.showErrorMessage(error) this.showErrorMessage(error)
@ -174,7 +174,7 @@
title: "加载中....", title: "加载中....",
mask: true mask: true
}); });
getProductReceiptJobDetail(that.id).then(res => { getPickJobDetail(that.id).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data == null) { if (res.data == null) {
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');
@ -329,7 +329,7 @@
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams(); var params = this.setParams();
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
productReceiptJobsubmit(params).then(res => { pickJobsubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data, )

Loading…
Cancel
Save