Browse Source

修改发料和发料接收任务筛选

hella_online_20240829
lijuncheng 4 months ago
parent
commit
eb362df030
  1. 10
      src/mycomponents/job/jobFilter.vue
  2. 2
      src/pages/issue/coms/comIssueJobCard.vue
  3. 54
      src/pages/issue/job/issueJob.vue
  4. 7
      src/pages/productionReceipt/coms/comProductionJobCard.vue
  5. 91
      src/pages/productionReceipt/job/productionReceiptJob.vue

10
src/mycomponents/job/jobFilter.vue

@ -59,7 +59,7 @@
import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue" import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue"
export default { export default {
emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber","productionLineCode","fromLocationCode"], emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber","productionLineCode","fromLocationCode","fromLocationCodeConfirm"],
components: { components: {
winScanJobNumber, winScanJobNumber,
winScanAsnNumber winScanAsnNumber
@ -130,12 +130,6 @@
// 线 // 线
productionLineCodeConfirm(e){ productionLineCodeConfirm(e){
var lineCode=e var lineCode=e
// this.productionline.forEach(item=>{
// if(item.value==this.productionLineCode){
// lineCode=item.value
// }
// })
console.log("生产线+++"+lineCode)
this.$emit("productionLineCode", lineCode) this.$emit("productionLineCode", lineCode)
}, },
@ -175,10 +169,12 @@
scanNumberClick() { scanNumberClick() {
this.$refs.scanNumber.openScanPopup(); this.$refs.scanNumber.openScanPopup();
this.closeScanPopup();
}, },
scanOtherClick() { scanOtherClick() {
this.$refs.scanAsnNumber.openScanPopup(); this.$refs.scanAsnNumber.openScanPopup();
this.closeScanPopup();
}, },
getScanAsNumber(val) { getScanAsNumber(val) {

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

@ -1,7 +1,7 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class="" v-if ="dataContent.productionLineCode"> <view class="" >
<text style="font-size: 32rpx; margin-left: 35rpx;">生产线</text> <text style="font-size: 32rpx; margin-left: 35rpx;">生产线</text>
<text style="font-size: 35rpx; margin-left: 10rpx; font-weight: bold;" >{{dataContent.productionLineCode}}</text> <text style="font-size: 35rpx; margin-left: 10rpx; font-weight: bold;" >{{dataContent.productionLineCode}}</text>

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

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionline" <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait"
@onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"
@productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode">
@ -80,8 +80,10 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
productionline: [], productionlineList: [],
title:'' title:'',
productionLine:"",
fromLocation:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -89,7 +91,7 @@
this.getIssueJobByProductionline() this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh'); this.getList('refresh',this.fromLocation,this.productionLine);
}, },
onReady() { onReady() {
@ -101,11 +103,11 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList("more"); this.getList("more",this.productionLine);
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh',this.productionLine);
}, },
//退 //退
@ -132,16 +134,20 @@
getIssueJobByProductionline().then(res => { getIssueJobByProductionline().then(res => {
console.log('生产线', res) console.log('生产线', res)
if (res.code == 0) { if (res.code == 0) {
this.productionline = res.data.map(item => ({ this.productionlineList = res.data.map(item => ({
value: item.value, value: item.value,
text: item.name text: item.name
})) }))
this.productionlineList.unshift({
value: "",
text: "全部"
})
} else { } else {
this.productionline = [] this.productionlineList = []
} }
}) })
}, },
getList(type, fromLocationCode = '', productionLineCode = '') { getList(type, fromLocation = '', productionLine = '') {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -174,20 +180,20 @@
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
if (fromLocationCode != '') { if (fromLocation) {
// //
filters.push({ filters.push({
column: "fromLocationCode", column: "fromLocationCode",
action: "==", action: "==",
value: fromLocationCode value: fromLocation
}) })
} }
if (productionLineCode != '') { if (productionLine) {
// 线 // 线
filters.push({ filters.push({
column: "productionLineCode", column: "productionLineCode",
action: "==", action: "==",
value: productionLineCode value: productionLine
}) })
} }
@ -226,13 +232,13 @@
that.showMessage(error) that.showMessage(error)
}) })
}, },
fromLocationCode(fromLocationCode) { fromLocationCode(fromLocation) {
console.log('fromLocationCode', fromLocationCode) this.fromLocation =fromLocation;
this.getList('refresh', fromLocationCode, '') this.getList('refresh', this.fromLocation, this.productionLine)
}, },
productionLineCode(productionLineCode) { productionLineCode(productionLineCode) {
console.log('productionLineCode', productionLineCode) this.productionLine =productionLineCode
this.getList('refresh', '', productionLineCode) this.getList('refresh', this.fromLocation,this.productionLine)
}, },
getByAsnNumber(code) { getByAsnNumber(code) {
let that = this; let that = this;
@ -299,7 +305,7 @@
cancleJob(id) { cancleJob(id) {
cancleTakeIssueJob(id).then(res => { cancleTakeIssueJob(id).then(res => {
if (res.data) { if (res.data) {
this.getList("refresh") this.getList("refresh",this.fromLocation,this.productionLine)
uni.showToast({ uni.showToast({
title: "放弃任务成功" title: "放弃任务成功"
}) })
@ -314,13 +320,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.fromLocation,this.productionLine);
}, },
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.fromLocation,this.productionLine);
}, },
getScanNumber(code) { getScanNumber(code) {
@ -344,6 +350,12 @@
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,

7
src/pages/productionReceipt/coms/comProductionJobCard.vue

@ -1,7 +1,12 @@
<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="" >
<text style="font-size: 32rpx; margin-left: 35rpx;">生产线</text>
<text style="font-size: 35rpx; margin-left: 10rpx; font-weight: bold;" >{{dataContent.productionLineCode}}</text>
</view>
</job-com-main-card>
</template> </template>
<script> <script>

91
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -3,13 +3,14 @@
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"> :checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true"
@productionLineCode="productionLineCode"
:productionline="productionLineList">
</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-production-job-card :dataContent="item" @click='openJobDetail(item)'> <com-production-job-card :dataContent="item" @click='openJobDetail(item)'>
</com-production-job-card> </com-production-job-card>
@ -23,7 +24,7 @@
<uni-load-more :status="loadingType" /> <uni-load-more :status="loadingType" />
</view> </view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList> <jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -32,7 +33,8 @@
<script> <script>
import { import {
getProductionReceiptJobList, getProductionReceiptJobList,
cancleTakeProductionReceiptJob cancleTakeProductionReceiptJob,
getIssueJobByProductionline
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -80,16 +82,19 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
title:'', title: '',
scanMessage:"" scanMessage: "",
productionLineList: [],
productionLine:""
}; };
}, },
onLoad(option){ onLoad(option) {
this.title = option.title this.title = option.title
this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh'); this.getList('refresh', this.productionLine);
}, },
onReady() { onReady() {
@ -102,11 +107,11 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList("more"); this.getList("more", this.productionLine);
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh', this.productionLine);
}, },
//退 //退
@ -129,7 +134,28 @@
}, },
methods: { methods: {
getList(type) { productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.productionLine)
},
getIssueJobByProductionline() {
getIssueJobByProductionline().then(res => {
console.log('生产线', res)
if (res.code == 0) {
this.productionLineList = res.data.map(item => ({
value: item.value,
text: item.name
}))
this.productionLineList.unshift({
value: "",
text: "全部"
})
} else {
this.productionLineList = []
}
})
},
getList(type, productionLine = '') {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -161,6 +187,16 @@
action: "==", action: "==",
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
if (productionLine) {
// 线
filters.push({
column: "productionLineCode",
action: "==",
value: productionLine
})
}
var params = { var params = {
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
@ -175,7 +211,7 @@
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore"; this.loadingType = "loadmore";
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "nomore"; this.loadingType = "nomore";
@ -198,9 +234,10 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + scanMessage +'&title='+this.title url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
}); });
this.scanMessage="" this.scanMessage = ""
}, },
showItemList(itemList) { showItemList(itemList) {
@ -230,12 +267,12 @@
cancleJob(id) { cancleJob(id) {
cancleTakeProductionReceiptJob(id).then(res => { cancleTakeProductionReceiptJob(id).then(res => {
if(res.data){ if (res.data) {
this.getList("refresh") this.getList("refresh", this.productionLine)
uni.showToast({ uni.showToast({
title:"放弃任务成功" title: "放弃任务成功"
}) })
}else { } else {
this.showMessage("放弃任务失败") this.showMessage("放弃任务失败")
} }
}).catch(error => { }).catch(error => {
@ -246,13 +283,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.productionLine);
}, },
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.productionLine;
}, },
getScanNumber(code) { getScanNumber(code) {
this.getDataListByType(code) this.getDataListByType(code)
@ -310,11 +347,11 @@
}, },
selectItem(item) { selectItem(item) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item,this.scanMessage); this.openJobDetail(item, this.scanMessage);
}, },
getScanResult(result) { getScanResult(result) {
try { try {
this.scanMessage="" this.scanMessage = ""
var filters = [{ var filters = [{
column: "packingNumber", column: "packingNumber",
action: "==", action: "==",
@ -349,8 +386,8 @@
item.selected = false item.selected = false
}) })
let list = [] let list = []
resultList.forEach(item=>{ resultList.forEach(item => {
if(!list.find(subItem=>subItem.title==item.title)){ if (!list.find(subItem => subItem.title == item.title)) {
list.push(item) list.push(item)
} }
}) })
@ -360,10 +397,10 @@
this.selectItem(list[0]) this.selectItem(list[0])
} }
} else { } else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
}) })
} catch (e) { } catch (e) {

Loading…
Cancel
Save