Browse Source

发料任务、补料任务、翻包任务、装配上架、预生产上架、预生产收货、成品入库 任务承接处理

lijuncheng0816
lijuncheng 4 months ago
parent
commit
e53f0f2305
  1. 2
      src/common/config.js
  2. 6
      src/mycomponents/job/jobAccept.vue
  3. 5
      src/pages/inventoryMove/coms/comMoveRecord.vue
  4. 9
      src/pages/issue/coms/comIssueJobCard.vue
  5. 111
      src/pages/issue/job/issueJob.vue
  6. 6
      src/pages/package/coms/comOverPackJobCard.vue
  7. 91
      src/pages/package/job/overPackageJob.vue
  8. 10
      src/pages/productPutaway/coms/comProductJobCard.vue
  9. 23
      src/pages/productPutaway/job/fgProductPutawayJob.vue
  10. 117
      src/pages/productPutaway/job/productPutawayJob.vue
  11. 25
      src/pages/productPutaway/job/semiProductPutawayJob.vue
  12. 7
      src/pages/productReceipt/coms/comProductJobCard.vue
  13. 18
      src/pages/productReceipt/job/fgProductReceiptJob.vue
  14. 126
      src/pages/productReceipt/job/productReceiptJob.vue
  15. 28
      src/pages/productReceipt/job/scrapReceiptJob.vue
  16. 19
      src/pages/productReceipt/job/semiProductReceiptJob.vue
  17. 6
      src/pages/repleinsh/coms/comRepleinshJobCard.vue
  18. 118
      src/pages/repleinsh/job/repleinshJob.vue

2
src/common/config.js

@ -1,2 +1,4 @@
export const overPagePrint="overPage_print" export const overPagePrint="overPage_print"
export const overPageTemplate="overPage_Template" export const overPageTemplate="overPage_Template"
//3分钟刷新
export const planRefreshTime=3*60*1000

6
src/mycomponents/job/jobAccept.vue

@ -1,12 +1,12 @@
<template> <template>
<!-- style="margin-top: 10rpx;margin-bottom: 10rpx;" class="uni-flex uni-row space-between u-col-center" --> <!-- style="margin-top: 10rpx;margin-bottom: 10rpx;" class="uni-flex uni-row space-between u-col-center" -->
<view class="task_item" style="margin-left: 15rpx; margin-right: 15rpx;"> <view class="task_item" style="margin-left: 15rpx; margin-right: 15rpx;">
<view class="uni-flex space-between u-col-center"> <view class="uni-flex u-col" style="flex-direction: column;">
<view class="uni-flex uni-row u-col-center"> <view class="uni-flex uni-row u-col-center">
<text style="font-size: 32rpx;" >承接人:{{dataContent.acceptUserName}}</text> <text style="font-size: 32rpx;" >承接人: {{dataContent.acceptUserName}}</text>
</view> </view>
<view class="uni-flex uni-row u-col-center"> <view class="uni-flex uni-row u-col-center">
<text style="font-size: 32rpx;" class="center">承接时间:{{formatDate(dataContent.acceptTime)}}</text> <text style="font-size: 32rpx;" class="center">承接时间 : {{formatDate(dataContent.acceptTime)}}</text>
</view> </view>
</view> </view>
</view> </view>

5
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -341,6 +341,11 @@
this.showErrorMessage("请先选择目标库位") this.showErrorMessage("请先选择目标库位")
return; return;
} }
if(this.fromLocationCode==this.toLocationCode){
this.showErrorMessage("来源库位和目标库位不能一致")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
// //
uni.showLoading({ uni.showLoading({

9
src/pages/issue/coms/comIssueJobCard.vue

@ -1,6 +1,8 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class="task_item" style="margin-left: 15px;"> <view class="task_item" style="margin-left: 15px;">
<view class="task_text"> <view class="task_text">
<view class="card_view"> <view class="card_view">
@ -9,16 +11,21 @@
</view> </view>
</view> </view>
</view> </view>
<view class='split_line'></view>
<jobAccept :dataContent="dataContent"></jobAccept>
</job-com-main-card> </job-com-main-card>
</template> </template>
<script> <script>
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import jobAccept from '@/mycomponents/job/jobAccept.vue'
export default { export default {
components: { components: {
jobComMainCard, jobComMainCard,
jobComMainDetailCard jobComMainDetailCard,
jobAccept
}, },
data() { data() {
return {}; return {};

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

@ -53,6 +53,11 @@
getBusinessType getBusinessType
} from '@/common/record.js'; } from '@/common/record.js';
import {
planRefreshTime
} from '@/common/config.js';
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption, getDetailGiveupOption,
@ -103,6 +108,7 @@
filterItemCode: "", filterItemCode: "",
businessTypeCode: "Issue", businessTypeCode: "Issue",
businessType: null, businessType: null,
timer:null
}; };
}, },
onLoad(option) { onLoad(option) {
@ -110,8 +116,15 @@
this.getIssueJobByProductionline() this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) this.timerRefresh();
},
onHide() {
this.stopRefresh();
},
onUnload(){
this.stopRefresh();
}, },
onReady() { onReady() {
@ -153,6 +166,21 @@
}, },
methods: { methods: {
timerRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh', that.fromLocation, that.productionLine, that.filterItemCode)
console.log('发料刷新');
}, planRefreshTime)
},
stopRefresh() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
getBusinessTypeFunc() { getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
@ -210,11 +238,6 @@
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (fromLocation) { if (fromLocation) {
// //
@ -297,11 +320,6 @@
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (params.fromLocationCode) { if (params.fromLocationCode) {
// //
@ -395,10 +413,8 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ this.getJobInfoByNumber(item.number,scanMessage = '')
url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
});
}, },
showItemList(itemList) { showItemList(itemList) {
@ -487,6 +503,58 @@
this.status = jobStatus; this.status = jobStatus;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
getJobInfoByNumber(number,scanMessage){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}
});
return;
}
uni.navigateTo({
url: './issueDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
});
this.scanMessage=""
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
getScanNumber(code) { getScanNumber(code) {
this.getDataListByType(code) this.getDataListByType(code)
@ -509,12 +577,6 @@
value: code value: code
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -523,7 +585,7 @@
getIssueJobList(params).then(res => { getIssueJobList(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 + '】的发料任务');
} else if (res.data.list.length == 1) { } else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]); that.openJobDetail(res.data.list[0]);
} }
@ -537,7 +599,7 @@
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
if (this.$refs.scanPopup) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus() this.$refs.scanPopup.getfocus()
} }
} }
}); });
@ -549,9 +611,6 @@
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopup(this.businessType);
} }
}, },
// openScanPopup() {
// this.$refs.scanPopup.openScanPopup();
// },
getScanResult(result) { getScanResult(result) {
let balance = result.balance; let balance = result.balance;
if (balance != null) { if (balance != null) {

6
src/pages/package/coms/comOverPackJobCard.vue

@ -1,16 +1,20 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class='split_line'></view>
<jobAccept :dataContent="dataContent"></jobAccept>
</job-com-main-card> </job-com-main-card>
</template> </template>
<script> <script>
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import jobAccept from '@/mycomponents/job/jobAccept.vue'
export default { export default {
components: { components: {
jobComMainCard, jobComMainCard,
jobComMainDetailCard jobComMainDetailCard,
jobAccept
}, },
data() { data() {
return {}; return {};

91
src/pages/package/job/overPackageJob.vue

@ -32,6 +32,9 @@
goHome, goHome,
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
planRefreshTime
} from '@/common/config.js';
import { import {
getDetailOption, getDetailOption,
@ -64,7 +67,8 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
title:'' title:'',
timer:null
}; };
}, },
@ -73,7 +77,16 @@
}, },
onShow() { onShow() {
this.getList('refresh');
this.timerRefresh();
},
onHide() {
this.stopRefresh();
},
onUnload(){
this.stopRefresh();
}, },
onReady() { onReady() {
@ -112,6 +125,21 @@
}, },
methods: { methods: {
timerRefresh() {
this.getList('refresh')
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh')
console.log('发料刷新');
}, planRefreshTime)
},
stopRefresh() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
getList(type) { getList(type) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
@ -139,11 +167,6 @@
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
@ -203,9 +226,7 @@
openJobDetail(item) { openJobDetail(item) {
uni.navigateTo({ this.getJobInfoByNumber(item.number)
url: './overPackageJobDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title
});
}, },
showItemList(itemList) { showItemList(itemList) {
@ -213,7 +234,7 @@
}, },
selectedItem(item) { selectedItem(item) {
this.openJobDetail(item); this.openJobDetail(item.number);
}, },
swipeClick(e, dataContent) { swipeClick(e, dataContent) {
@ -306,6 +327,54 @@
} }
}); });
}, },
getJobInfoByNumber(number){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getOverPageJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
this.getList('refresh')
}
});
return;
}
uni.navigateTo({
url: './overPackageJobDetail?id=' + result.masterId + '&status=' + result.status+'&title='+this.title
});
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
} }
} }
</script> </script>

10
src/pages/productPutaway/coms/comProductJobCard.vue

@ -1,16 +1,20 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
</job-com-main-card> <view class='split_line'></view>
<jobAccept :dataContent="dataContent"></jobAccept>
</job-com-main-card>
</template> </template>
<script> <script>
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
export default { import jobAccept from '@/mycomponents/job/jobAccept.vue'
export default {
components: { components: {
jobComMainCard, jobComMainCard,
jobComMainDetailCard jobComMainDetailCard,
jobAccept
}, },
data() { data() {
return {}; return {};

23
src/pages/productPutaway/job/fgProductPutawayJob.vue

@ -19,18 +19,29 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onReachBottom() {
this.$refs.productPutawayJob.onReach();
},
onShow() { onShow() {
if(this.$refs.productPutawayJob!=undefined){ if(this.$refs.productPutawayJob){
this.$refs.productPutawayJob.refresh(); this.$refs.productPutawayJob.timerRefresh();
}
},
onHide() {
if(this.$refs.productPutawayJob){
this.$refs.productPutawayJob.stopRefresh();
}
},
onUnload(){
if(this.$refs.productPutawayJob){
this.$refs.productPutawayJob.stopRefresh();
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.productPutawayJob.refresh(); this.$refs.productPutawayJob.timerRefresh();
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
this.$refs.productPutawayJob.toHome(); this.$refs.productPutawayJob.toHome();

117
src/pages/productPutaway/job/productPutawayJob.vue

@ -45,6 +45,9 @@
getDetailOption, getDetailOption,
getDetailGiveupOption getDetailGiveupOption
} from '@/common/array.js'; } from '@/common/array.js';
import {
planRefreshTime
} from '@/common/config.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue' import jobFilter from '@/mycomponents/job/jobFilter.vue'
@ -79,7 +82,8 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
scanMessage: "" scanMessage: "",
timer:null
}; };
}, },
props: { props: {
@ -90,26 +94,15 @@
} }
}, },
mounted() {
this.getList('refresh');
},
onReady() { onReady() {
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
}, },
onReachBottom() { mounted() {
// this.timerRefresh()
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
}, },
onPullDownRefresh() {
this.getList('refresh');
},
//退 //退
onBackPress(options) { onBackPress(options) {
@ -121,15 +114,6 @@
} }
}, },
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: { methods: {
onReach() { onReach() {
// //
@ -144,8 +128,22 @@
openFilter() { openFilter() {
this.$refs.filter.openFilter(); this.$refs.filter.openFilter();
}, },
refresh() {
timerRefresh() {
this.getList('refresh'); this.getList('refresh');
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh');
console.log('预生产上架刷新');
}, planRefreshTime)
},
stopRefresh() {
console.log('stopRefresh预生产上架刷新');
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
}, },
getList(type) { getList(type) {
let that = this; let that = this;
@ -174,11 +172,6 @@
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
filters.push({ filters.push({
column: "type", column: "type",
action: "==", action: "==",
@ -220,11 +213,58 @@
}, },
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ this.getJobInfoByNumber(item.number,scanMessage = '')
url: './productPutawayDetail?id=' + item.masterId + '&status=' + item.status + '&type=' + item },
.type + '&scanMessage=' + this.scanMessage + '&title=' + this.title
getJobInfoByNumber(number,scanMessage){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
}); });
this.scanMessage = "" var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductPutawayJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
this.getList('refresh')
}
});
return;
}
uni.navigateTo({
url: './productPutawayDetail?id=' + result.masterId + '&status=' + result.status + '&type=' + result
.type + '&scanMessage=' + this.scanMessage + '&title=' + this.title
});
this.scanMessage = ""
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
}, },
showItemList(itemList) { showItemList(itemList) {
@ -298,12 +338,6 @@
action: "==", action: "==",
value: code value: code
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -374,11 +408,6 @@
column: "status", column: "status",
action: "in", action: "in",
value: '1,2', value: '1,2',
},
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
} }
// { // {
// column: "fromLocationCode", // column: "fromLocationCode",

25
src/pages/productPutaway/job/semiProductPutawayJob.vue

@ -21,15 +21,30 @@
}, },
onShow() { onShow() {
if(this.$refs.productPutawayJob!=undefined){ if(this.$refs.productPutawayJob){
this.$refs.productPutawayJob.refresh(); this.$refs.productPutawayJob.timerRefresh();
} }
}, },
onReachBottom() {
this.$refs.productPutawayJob.onReach(); onHide() {
if(this.$refs.productPutawayJob){
this.$refs.productPutawayJob.stopRefresh();
}
},
onUnload(){
if(this.$refs.productPutawayJob){
this.$refs.productPutawayJob.stopRefresh();
}
console.log("页面销毁")
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.productPutawayJob.refresh(); this.$refs.productPutawayJob.timerRefresh();
},
onReachBottom() {
this.$refs.productPutawayJob.onReach();
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {

7
src/pages/productReceipt/coms/comProductJobCard.vue

@ -1,6 +1,9 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class='split_line'></view>
<jobAccept :dataContent="dataContent"></jobAccept>
<!-- <view class="task_item"> <!-- <view class="task_item">
<view class="task_text"> <view class="task_text">
<view class=""> <view class="">
@ -36,10 +39,12 @@
<script> <script>
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import jobAccept from '@/mycomponents/job/jobAccept.vue'
export default { export default {
components: { components: {
jobComMainCard, jobComMainCard,
jobComMainDetailCard jobComMainDetailCard,
jobAccept
}, },
data() { data() {
return {}; return {};

18
src/pages/productReceipt/job/fgProductReceiptJob.vue

@ -20,15 +20,27 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() { onShow() {
if(this.$refs.productreceiptjob!=undefined){ if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.refresh(); this.$refs.productreceiptjob.timerRefresh();
}
},
onHide() {
if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.stopRefresh();
} }
},
onUnload(){
if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.stopRefresh();
}
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.productreceiptjob.refresh(); this.$refs.productreceiptjob.timerRefresh();
}, },
onReachBottom() { onReachBottom() {

126
src/pages/productReceipt/job/productReceiptJob.vue

@ -39,6 +39,10 @@
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
planRefreshTime
} from '@/common/config.js';
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption getDetailGiveupOption
@ -79,7 +83,8 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
scanMessage: "" scanMessage: "",
timer:null
}; };
}, },
// type = 'assemble' // type = 'assemble'
@ -96,13 +101,7 @@
mounted() { mounted() {
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
this.getList('refresh'); this.timerRefresh()
},
onPullDownRefresh() {
this.getList('refresh');
}, },
@ -134,8 +133,22 @@
} }
this.getList("more"); this.getList("more");
}, },
refresh() {
timerRefresh() {
this.getList('refresh'); this.getList('refresh');
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh');
console.log('装配刷新');
}, planRefreshTime)
},
stopRefresh() {
console.log('stopRefresh装配刷新');
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
}, },
getList(type) { getList(type) {
let that = this; let that = this;
@ -162,11 +175,6 @@
action: "in", action: "in",
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
filters.push({ filters.push({
column: "type", column: "type",
action: "==", action: "==",
@ -210,23 +218,7 @@
}, },
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
if (this.type == 'predict') { this.getJobInfoByNumber(item.number,scanMessage = '')
uni.navigateTo({
url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
} else if (this.type == 'assemble') {
uni.navigateTo({
url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
} else {
uni.navigateTo({
url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
}
this.scanMessage = ""
}, },
showItemList(itemList) { showItemList(itemList) {
@ -300,11 +292,6 @@
action: "==", action: "==",
value: code value: code
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: filters,
@ -382,11 +369,6 @@
column: "status", column: "status",
action: "in", action: "in",
value: '1,2', value: '1,2',
},
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
} }
] ]
getProductReceiptJobList({ getProductReceiptJobList({
@ -423,6 +405,68 @@
this.showMessage(e.message) this.showMessage(e.message)
} }
}, },
getJobInfoByNumber(number,scanMessage){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductReceiptJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
this.getList('refresh')
}
});
return;
}
if (this.type == 'predict') {
uni.navigateTo({
url: './productReceiptDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
} else if (this.type == 'assemble') {
uni.navigateTo({
url: './fgProductReceiptDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
} else {
uni.navigateTo({
url: './scrapReceiptDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
}
this.scanMessage = ""
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
} }
} }

28
src/pages/productReceipt/job/scrapReceiptJob.vue

@ -20,16 +20,30 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow(){ onShow() {
this.$nextTick(()=>{ if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.refresh() this.$refs.productreceiptjob.timerRefresh();
}) }
}, },
onReachBottom() {
this.$refs.productreceiptjob.onReach(); onHide() {
if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.stopRefresh();
}
}, },
onUnload(){
if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.stopRefresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.productreceiptjob.refresh(); this.$refs.productreceiptjob.timerRefresh();
},
onReachBottom() {
this.$refs.productreceiptjob.onReach();
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {

19
src/pages/productReceipt/job/semiProductReceiptJob.vue

@ -24,14 +24,27 @@
this.$refs.productreceiptjob.onReach(); this.$refs.productreceiptjob.onReach();
}, },
onShow() { onShow() {
if(this.$refs.productreceiptjob!=undefined){ if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.refresh(); this.$refs.productreceiptjob.timerRefresh();
}
},
onHide() {
if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.stopRefresh();
}
},
onUnload(){
if(this.$refs.productreceiptjob){
this.$refs.productreceiptjob.stopRefresh();
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.productreceiptjob.refresh(); this.$refs.productreceiptjob.timerRefresh();
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
this.$refs.productreceiptjob.toHome(); this.$refs.productreceiptjob.toHome();

6
src/pages/repleinsh/coms/comRepleinshJobCard.vue

@ -1,16 +1,20 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class='split_line'></view>
<jobAccept :dataContent="dataContent"></jobAccept>
</job-com-main-card> </job-com-main-card>
</template> </template>
<script> <script>
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import jobAccept from '@/mycomponents/job/jobAccept.vue'
export default { export default {
components: { components: {
jobComMainCard, jobComMainCard,
jobComMainDetailCard jobComMainDetailCard,
jobAccept
}, },
data() { data() {
return {}; return {};

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

@ -59,9 +59,12 @@
getDetailCloseOption getDetailCloseOption
} from '@/common/array.js'; } from '@/common/array.js';
import {
planRefreshTime
} from '@/common/config.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue' import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue' import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue'
import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue' import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue'
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue' import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue'
@ -105,7 +108,8 @@
productionLineCode: "", productionLineCode: "",
productionlineList: [], productionlineList: [],
fromLocationCode:'', fromLocationCode:'',
filterItemCode:'' filterItemCode:'',
timer:null
}; };
}, },
onLoad(option) { onLoad(option) {
@ -113,8 +117,13 @@
this.getBusinessTypeFunc() this.getBusinessTypeFunc()
}, },
onShow() { onShow() {
this.getList('refresh', this.fromLocationCode, this.filterItemCode) this.timerRefresh();
},
onHide() {
this.stopRefresh();
}, },
onReady() { onReady() {
@ -155,6 +164,21 @@
}, },
methods: { methods: {
timerRefresh() {
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh', that.fromLocationCode, that.filterItemCode)
console.log('补料刷新');
}, planRefreshTime)
},
stopRefresh() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
getBusinessTypeFunc() { getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
@ -197,11 +221,6 @@
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (fromLocationCode != '') { if (fromLocationCode != '') {
// //
filters.push({ filters.push({
@ -275,12 +294,6 @@
value: this.status value: this.status
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (params.fromLocationCode) { if (params.fromLocationCode) {
// //
this.fromLocationCode = params.fromLocationCode this.fromLocationCode = params.fromLocationCode
@ -335,11 +348,62 @@
}, },
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ this.getJobInfoByNumber(item.number,scanMessage = '')
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' +
scanMessage + '&title=' + this.title },
getJobInfoByNumber(number,scanMessage){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
}); });
this.scanMessage = "" var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getRepleinshJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
}
});
return;
}
uni.navigateTo({
url: './repleinshDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
});
this.scanMessage = ""
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
}, },
showItemList(itemList) { showItemList(itemList) {
@ -377,7 +441,7 @@
cancleJob(id) { cancleJob(id) {
cancleTakeRepleinshJob(id).then(res => { cancleTakeRepleinshJob(id).then(res => {
if (res.data) { if (res.data) {
this.getList("refresh") this.getList('refresh', this.fromLocationCode, this.filterItemCode)
uni.showToast({ uni.showToast({
title: "放弃任务成功" title: "放弃任务成功"
}) })
@ -397,7 +461,7 @@
closeTakeRepleinshJob(id).then(res => { closeTakeRepleinshJob(id).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.getList("refresh") this.getList('refresh', this.fromLocationCode, this.filterItemCode)
uni.showToast({ uni.showToast({
title: "关闭任务成功" title: "关闭任务成功"
}) })
@ -413,13 +477,13 @@
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;
this.todayTime = creationTime; this.todayTime = creationTime;
this.getList("refresh"); this.getList('refresh', this.fromLocationCode, this.filterItemCode)
}, },
switchChangeWait(state, jobStatus) { switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state; this.checkedWaitTask = state;
this.status = jobStatus; this.status = jobStatus;
this.getList("refresh"); this.getList('refresh', this.fromLocationCode, this.filterItemCode)
}, },
getScanNumber(code) { getScanNumber(code) {
this.getDataListByType(code) this.getDataListByType(code)
@ -441,11 +505,6 @@
action: "==", action: "==",
value: code value: code
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: filters,
@ -513,11 +572,6 @@
action: "==", action: "==",
value: result.label.itemCode value: result.label.itemCode
}, },
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
},
{ {
column: "fromLocationCode", column: "fromLocationCode",
action: "==", action: "==",

Loading…
Cancel
Save