Browse Source

修改发料任务筛选 2024/8/6

pull/1/head
test 3 months ago
parent
commit
024d5920e7
  1. 4
      src/mycomponents/balance/level.vue
  2. 106
      src/mycomponents/job/jobFilter.vue
  3. 93
      src/pages/issue/job/issueJob.vue
  4. 4
      src/pages/repleinsh/job/repleinshJob.vue

4
src/mycomponents/balance/level.vue

@ -10,8 +10,8 @@ import { getPriorityName } from '@/common/directory.js'
const props = defineProps({
priority: {
type: String,
default: '2'
type: Number,
default: 2
},
title: {
type: String,

106
src/mycomponents/job/jobFilter.vue

@ -1,37 +1,72 @@
<template>
<u-popup v-model="show" @click="show = false" mode="right" width="450rpx">
<uni-popup ref="popup">
<view class="maskbox" @tap="maskClick"></view>
<view class="uni-flex uni-column center" style="background-color: white; width: 200px; height: auto; padding: 20rpx; z-index: 100; position: relative; top: 100rpx; right: 20rpx; left: 30rpx; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); border-radius: 10rpx">
<view class="uni-flex space-between u-col-center" style="width: 100%">
<view class="" style="font-size: 32rpx"> 只看当天 </view>
<view class="uni-flex uni-column center"
style="background-color: white;width: 100%; height:auto;padding: 20rpx;z-index: 99;position: relative; border-radius: 10rpx;">
<u-switch v-model="checkedTodayModel" active-color="#4DD865" inactive-color="#eee" size="35" @change="switchChangeToday"></u-switch>
<!-- 现场并不需要这两个筛选条件暂时拿掉 -->
<!-- <view class="uni-flex space-between u-col-center" style="width: 100%;">
<view class="" style="font-size: 32rpx;">
只看当天
</view>
<u-switch v-model="checkedTodayModel" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchChangeToday"></u-switch>
</view>
<view class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx">
<view class="" style="font-size: 32rpx"> 只看待处理 </view>
<u-switch v-model="checkedWaitModel" active-color="#4DD865" inactive-color="#eee" size="35" @change="switchChangeWait"></u-switch>
<view class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
只看待处理
</view>
<u-switch v-model="checkedWaitModel" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchChangeWait"></u-switch>
</view> -->
<view v-if="isShowProductionLineCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
生产线
</view>
<!-- <u-input style="margin-left: 20rpx;" v-model="productionLineCode" :border="true"
placeholder="请输入生产线" @confirm="productionLineCodeConfirm" /> -->
<uni-data-select class="uni-data-select" style="margin-left: 50rpx;" placeholder="请输入生产线"
v-model="productionLineCode" :clear="false" :localdata="productionline"
@change="productionLineCodeConfirm"></uni-data-select>
</view>
<view v-if="isShowProductionLineCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx">
<view class="" style="font-size: 32rpx"> 生产线 </view>
<!-- <u-input style="margin-left: 20rpx" v-model="productionLineCode" :border="true" placeholder="请输入生产线" @confirm="productionLineCodeConfirm" /> -->
<uni-data-select class="uni-data-select" style="margin-left: 50rpx" placeholder="请输入生产线" v-model="productionLineCode" :clear="false" :localdata="productionline" @change="productionLineCodeConfirm"></uni-data-select>
<view v-if="isShowItemCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
物料代码
</view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="itemCode" :border="true"
placeholder="请输入物料代码" @confirm="itemCodeConfirm" />
</view>
<view v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center" style="width: 100%; margin-top: 30rpx">
<view class="" style="font-size: 32rpx"> 来源库位 </view>
<u-input style="margin-left: 20rpx" confirmType="search" v-model="fromLocationCode" :border="true" placeholder="请输入来源库位" @confirm="fromLocationCodeConfirm" />
<view v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
来源库位
</view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="fromLocationCode" :border="true"
placeholder="请输入来源库位" @confirm="fromLocationCodeConfirm" />
</view>
<view class="">
<view class="uni-flex u-row-center" style="margin-top: 30rpx" v-if="isShowAsn">
<button class="filter_button" hover-class="filter_button_after" @click="scanOtherClick">扫描ASN单号</button>
<!-- <view class="">
<view class="uni-flex u-row-center" style="margin-top: 30rpx;" v-if="isShowAsn">
<button class="filter_button" hover-class="filter_button_after"
@click="scanOtherClick">扫描ASN单号</button>
</view>
<view class="uni-flex u-row-center" style="margin-top: 30rpx" v-if="isShowJob">
<button class="filter_button" hover-class="filter_button_after" @click="scanNumberClick">扫描任务编号</button>
<view class="uni-flex u-row-center" style="margin-top: 30rpx;" v-if="isShowJob">
<button class="filter_button" hover-class="filter_button_after"
@click="scanNumberClick">扫描任务编号</button>
</view>
</view> -->
<view class=" uni-flex uni-row" style="margin-top: 5px;">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="query()">查询</button>
</view>
</view>
</u-popup>
<win-scan-job-number ref="scanNumber" title="任务编号" @getScanCode="getScanNumber"></win-scan-job-number>
<win-scan-asn-number ref="scanAsnNumber" :title="otherTitle" @getScanCode="getScanAsNumber"></win-scan-asn-number>
</uni-popup>
<win-scan-job-number ref="scanNumber" title="任务编号" @getScanCode='getScanNumber'></win-scan-job-number>
<win-scan-asn-number ref="scanAsnNumber" :title="otherTitle" @getScanCode='getScanAsNumber'></win-scan-asn-number>
</template>
<script setup lang="ts">
@ -73,6 +108,10 @@ const props = defineProps({
productionline: {
type: Array,
default: []
},
isShowItemCode: {
type: Boolean,
default: false
}
})
const dataContent = ref({})
@ -83,6 +122,7 @@ const fromLocationCode = ref('') // 来源库位
const show = ref(false)
const scanNumber = ref()
const scanAsnNumber = ref()
const itemCode = ref('')//
//
watch(
() => props.checkedToday,
@ -99,17 +139,31 @@ watch(
},
{ immediate: true, deep: true }
)
const getQueryCondition = ()=>{
let params = {
productionLineCode: productionLineCode.value,
fromLocationCode: fromLocationCode.value,
itemCode: itemCode.value
}
return params;
}
const query = ()=> {
let params = getQueryCondition();
emit("onQuery", params)
closeScanPopup();
}
// 线
const productionLineCodeConfirm = (e) => {
const lineCode = e
emit('productionLineCode', productionLineCode.value)
productionLineCode.value = e
// emit('productionLineCode', productionLineCode.value)
}
//
const fromLocationCodeConfirm = () => {
emit('fromLocationCode', fromLocationCode.value)
// emit('fromLocationCode', fromLocationCode.value)
}
const itemCodeConfirm = ()=> {}
//
const maskClick = () => {
//

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

@ -1,7 +1,17 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<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>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait"
@onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"
:isShowItemCode="true" @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"
@onQuery="getListByFilter">
<!-- <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 : item.status == '1' ? detailCloseOptions : 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>
@ -121,7 +131,7 @@ const getBusinessTypeFunc = ()=> {
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
// this.openScanPopup();
} else {
showErrorMessage(res.message)
comMessageRef.value.showErrorMessage(res.message)
}
});
}
@ -188,9 +198,7 @@ const getList = (type, fromLocation = '', productionLine = '') => {
const params = {
filters,
pageNo: pageNo.value,
pageSize: pageSize.value,
sort: 'fromLocationCode',
by: 'asc'
pageSize: 100,
}
getIssueJobList(params)
.then((res) => {
@ -220,13 +228,16 @@ const getList = (type, fromLocation = '', productionLine = '') => {
loadingType.value = ''
updateTitle(title.value)
uni.hideLoading()
showErrorMessage(error)
comMessageRef.value.showErrorMessage(error)
})
}
const openJobDetail = (item, scanMessage = '') => {
proxy.$tab.navigateTo(`./issueDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}`)
}
const showItemList = (itemList)=> {
jobListPopupRef.value.openPopup(itemList);
}
const selectedItem = (item) => {
openJobDetail(item)
}
@ -259,6 +270,74 @@ const swipeClick = (index, index1) => {
})
}
}
const getListByFilter = ( param )=>{
uni.showLoading({
title: "加载中­....",
mask: true
});
let filters = []
if (checkedToday.value) {
filters.push({
column: "create_time",
action: "betweeen",
value: todayTime.value
})
}
filters.push({
column: "status",
action: "in",
value: status.value
})
filters.push({
column: "accept_user_id",
action: "==",
value:store.id
})
if (param.fromLocationCode) {
//
filters.push({
column: "fromLocationCode",
action: "==",
value: param.fromLocationCode
})
}
if (param.productionLine) {
// 线
filters.push({
column: "productionLineCode",
action: "==",
value: param.productionLine
})
}
if (param.itemCode) {
// 线
filters.push({
column: "itemCode",
action: "like",
value: param.itemCode
})
}
let params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.total == 0) {
showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.total == 1) {
openJobDetail(res.data.list[0]);
} else {
showItemList(res.data.list);
}
}).catch(error => {
showMessage(error)
})
}
const fromLocationCode = (fromLocationParams) => {
fromLocation.value = fromLocationParams
getList('refresh', fromLocation.value, productionLine.value)
@ -285,7 +364,7 @@ const getByAsnNumber = (code) => {
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
comMessageRef.value.showErrorMessage(error)
})
}
const openjobInfoPopup = (item) => {

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

@ -1,7 +1,7 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @fromLocationCode="fromLocationCode"> </job-filter>
<job-filter :isShowFromLocationCode="true" ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :isShowItemCode="true" :checkedWaitTask="checkedWaitTask" @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 : item.status == '1' ? detailCloseOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick">
<com-repleinsh-job-card :dataContent="item" @click="openJobDetail(item)"></com-repleinsh-job-card>
@ -66,6 +66,7 @@ const businessType = ref(null)
const scanBalance = ref({})
const outInventoryStatus = ref("")
const inInventoryStatus = ref("")
const checkedWaitTask = ref(false)
onShow(() => {
nextTick(() => {
getList('refresh')
@ -264,6 +265,7 @@ const switchChangeToday = (state, creationTime) => {
getList('refresh')
}
const switchChangeWait = (state, jobStatus) => {
checkedWaitTask.value = state;
waitTask.value = state
status.value = jobStatus
getList('refresh')

Loading…
Cancel
Save