|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<com-empty-view v-if="jobList.length == 0"></com-empty-view> |
|
|
|
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionline" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> </job-filter> |
|
|
|
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> </job-filter> |
|
|
|
<view v-if="jobList.length > 0" class="u-m-20"> |
|
|
|
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in jobList" :key="index" :options="item.status == '2' ? detailGiveupOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick"> |
|
|
|
<com-issue-job-card :dataContent="item" @click="openJobDetail(item)"></com-issue-job-card> |
|
|
@ -53,8 +53,10 @@ const todayTime = ref('') |
|
|
|
const status = ref('1,2') // 待处理 、进行中 |
|
|
|
const detailOptions = ref([]) |
|
|
|
const detailGiveupOptions = ref([]) |
|
|
|
const productionline = ref([]) |
|
|
|
const productionlineList = ref([]) |
|
|
|
const title = ref('') |
|
|
|
const productionLine = ref('') |
|
|
|
const fromLocation = ref('') |
|
|
|
const filter = ref() |
|
|
|
const scanMessage = ref('') |
|
|
|
const comMessageRef = ref() |
|
|
@ -64,7 +66,7 @@ const scanPopup = ref() |
|
|
|
const jobListRef = ref() |
|
|
|
onShow(() => { |
|
|
|
nextTick(() => { |
|
|
|
getList('refresh') |
|
|
|
getList('refresh', fromLocation.value, productionLine.value) |
|
|
|
}) |
|
|
|
}) |
|
|
|
onLoad((option) => { |
|
|
@ -80,10 +82,10 @@ onReachBottom(() => { |
|
|
|
if (loadingType.value == 'loading' || loadingType.value == 'nomore') { |
|
|
|
return |
|
|
|
} |
|
|
|
getList('more') |
|
|
|
getList('more', productionLine.value) |
|
|
|
}) |
|
|
|
onPullDownRefresh(() => { |
|
|
|
getList('refresh') |
|
|
|
getList('refresh', productionLine.value) |
|
|
|
}) |
|
|
|
// 后退按钮 |
|
|
|
onBackPress((options) => { |
|
|
@ -106,16 +108,20 @@ const getIssueJobByProductionline1 = () => { |
|
|
|
getIssueJobByProductionline().then((res) => { |
|
|
|
console.log('生产线', res) |
|
|
|
if (res.code == 0) { |
|
|
|
productionline.value = res.data.map((item) => ({ |
|
|
|
productionlineList.value = res.data.map((item) => ({ |
|
|
|
value: item.value, |
|
|
|
text: item.name |
|
|
|
})) |
|
|
|
productionlineList.value.unshift({ |
|
|
|
value: '', |
|
|
|
text: '全部' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
productionline.value = [] |
|
|
|
productionlineList.value = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const getList = (type, fromLocationCode = '', productionLineCode = '') => { |
|
|
|
const getList = (type, fromLocation = '', productionLine = '') => { |
|
|
|
proxy.$modal.loading('加载中....') |
|
|
|
loadingType.value = 'loading' |
|
|
|
if (type === 'refresh') { |
|
|
@ -142,20 +148,20 @@ const getList = (type, fromLocationCode = '', productionLineCode = '') => { |
|
|
|
action: '==', |
|
|
|
value: store.id |
|
|
|
}) |
|
|
|
if (fromLocationCode != '') { |
|
|
|
if (fromLocation) { |
|
|
|
// 来源库位 |
|
|
|
filters.push({ |
|
|
|
column: 'fromLocationCode', |
|
|
|
action: '==', |
|
|
|
value: fromLocationCode |
|
|
|
value: fromLocation |
|
|
|
}) |
|
|
|
} |
|
|
|
if (productionLineCode != '') { |
|
|
|
if (productionLine) { |
|
|
|
// 生产线 |
|
|
|
filters.push({ |
|
|
|
column: 'productionLineCode', |
|
|
|
action: '==', |
|
|
|
value: productionLineCode |
|
|
|
value: productionLine |
|
|
|
}) |
|
|
|
} |
|
|
|
const params = { |
|
|
@ -223,13 +229,14 @@ const swipeClick = (index, index1) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
const fromLocationCode = (fromLocationCode) => { |
|
|
|
getList('refresh', fromLocationCode, '') |
|
|
|
const fromLocationCode = (fromLocationParams) => { |
|
|
|
fromLocation.value = fromLocationParams |
|
|
|
getList('refresh', fromLocation.value, productionLine.value) |
|
|
|
} |
|
|
|
|
|
|
|
const productionLineCode = (productionLineCode) => { |
|
|
|
console.log('productionLineCode', productionLineCode) |
|
|
|
getList('refresh', '', productionLineCode) |
|
|
|
productionLine.value = productionLineCode |
|
|
|
getList('refresh', fromLocation.value, productionLine.value) |
|
|
|
} |
|
|
|
const getByAsnNumber = (code) => { |
|
|
|
proxy.$modal.loading('加载中....') |
|
|
@ -258,7 +265,7 @@ const cancleJob = (id) => { |
|
|
|
cancleTakeIssueJob(id) |
|
|
|
.then((res) => { |
|
|
|
if (res.data) { |
|
|
|
getList('refresh') |
|
|
|
getList('refresh', fromLocation.value, productionLine.value) |
|
|
|
uni.showToast({ |
|
|
|
title: '放弃任务成功' |
|
|
|
}) |
|
|
@ -273,12 +280,12 @@ const cancleJob = (id) => { |
|
|
|
const switchChangeToday = (state, creationTime) => { |
|
|
|
checkedToday.value = state |
|
|
|
todayTime.value = creationTime |
|
|
|
getList('refresh') |
|
|
|
getList('refresh', fromLocation.value, productionLine.value) |
|
|
|
} |
|
|
|
const switchChangeWait = (state, jobStatus) => { |
|
|
|
checkedWaitTask.value = state |
|
|
|
status.value = jobStatus |
|
|
|
getList('refresh') |
|
|
|
getList('refresh', fromLocation.value, productionLine.value) |
|
|
|
} |
|
|
|
const getScanNumber = (code) => { |
|
|
|
getDataListByType(code) |
|
|
@ -296,6 +303,11 @@ const getDataListByType = (code) => { |
|
|
|
action: '==', |
|
|
|
value: code |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: 'accept_user_id', |
|
|
|
action: '==', |
|
|
|
value: store.id |
|
|
|
}) |
|
|
|
const params = { |
|
|
|
filters, |
|
|
|
pageNo: 1, |
|
|
|