Compare commits

...

2 Commits

  1. 1
      src/common/config.js
  2. 4
      src/manifest.json
  3. 224
      src/pages/deliver/job/deliverJob.vue

1
src/common/config.js

@ -7,4 +7,5 @@ export const issueJobFilter="issue_job_filter"
export const repleinshJobFilter="repleinsh_job_filter" export const repleinshJobFilter="repleinsh_job_filter"
export const overPackageJobFilter="over_package_job_filter" export const overPackageJobFilter="over_package_job_filter"
export const productionReceiptJobFilter="production_receipt_job_filter" export const productionReceiptJobFilter="production_receipt_job_filter"
export const deliverJobFilter="deliver_job_filter"

4
src/manifest.json

@ -3,8 +3,8 @@
"package" : "uni.UNI43932FE", "package" : "uni.UNI43932FE",
"appid" : "__UNI__C9CF4BF", "appid" : "__UNI__C9CF4BF",
"description" : "", "description" : "",
"versionName" : "1.0.85", "versionName" : "1.0.86",
"versionCode" : 85, "versionCode" : 86,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

224
src/pages/deliver/job/deliverJob.vue

@ -1,15 +1,23 @@
<template> <template>
<view class=""> <view class="uni-flex" style="flex-direction: column;;">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" @onQuery="getListByFilter" :isShowQurery="true">
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter> </job-filter>
<view style="background-color: #fff; padding-left: 20rpx; border-radius: 15rpx;">
<view class="uni-flex space-between u-col-center" style="width: 100%;padding-top: 20rpx;">
<view class="" style="font-size: 32rpx; font-weight: bold;">
物料类型 :
</view>
<uni-data-select class="uni-data-select" style="margin-left: 10rpx;" placeholder="请输入物料类型"
v-model="itemType" :clear="false" :localdata="itemTypeList"
@change="itemTypeConfirm"></uni-data-select>
</view>
</view>
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<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-deliver-job-card :dataContent="item" @click='openJobDetail(item)'></com-deliver-job-card> <com-deliver-job-card :dataContent="item" @click='openJobDetail(item)'></com-deliver-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -27,17 +35,29 @@
</template> </template>
<script> <script>
import { import {
getDeliverJobList, getDeliverJobList,
cancleTakeDeliverJob cancleTakeDeliverJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
getBusinessType,
} from '@/common/record.js';
import { import {
goHome, goHome,
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getItemTypeInfo
} from '@/common/directory.js';
import {
planRefreshTime,
deliverJobFilter
} from '@/common/config.js';
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption getDetailGiveupOption
@ -72,8 +92,10 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
businessType:'', businessType: '',
title:'' title: '',
itemType: "",
itemTypeList: [],
}; };
}, },
onLoad(option) { onLoad(option) {
@ -81,7 +103,12 @@
this.businessType = option.businessType this.businessType = option.businessType
}, },
onShow() { onShow() {
this.getList('refresh'); if (this.itemTypeList.length == 0) {
this.getItemTypeList()
} else {
this.getList('refresh');
}
}, },
onReady() { onReady() {
@ -120,6 +147,26 @@
}, },
methods: { methods: {
getItemTypeList() {
var typeCode = "Deliver"
getBusinessType(typeCode, res => {
if (res.success && res.itemCodeTypeList.length > 0) {
var list = []
res.itemCodeTypeList.forEach(item => {
var itemText = getItemTypeInfo(item).label
list.push({
value: item,
text: itemText
})
})
this.itemTypeList = list;
} else {
this.itemTypeList = []
}
this.getList('refresh')
});
},
getList(type) { getList(type) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
@ -131,35 +178,11 @@
this.pageNo = 1; this.pageNo = 1;
this.jobList = []; this.jobList = [];
} }
var filters = []
if (this.checkedToday) {
filters.push({ var queryFiltersParams = this.setQueryParam()
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
filters.push({
column: "status",
action: "in",
value: this.status
})
if(this.businessType&&this.businessType.length>0){
// :businessType=Deliver businessType=ZZBJDeliver
filters.push({
column: "businessType",
action: "==",
value: this.businessType
})
}
var params = { var params = {
filters: filters, filters: queryFiltersParams,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
@ -171,7 +194,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";
@ -193,7 +216,7 @@
openJobDetail(item) { openJobDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: './deliverDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title url: './deliverDetail?id=' + item.masterId + '&status=' + item.status + '&title=' + this.title
}); });
}, },
@ -224,12 +247,12 @@
cancleJob(id) { cancleJob(id) {
cancleTakeDeliverJob(id).then(res => { cancleTakeDeliverJob(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 => {
@ -237,54 +260,70 @@
}) })
}, },
switchChangeToday(state, creationTime) { getListByFilter(params) {
this.checkedToday = state; params.itemType = this.itemType
this.todayTime = creationTime; uni.setStorageSync(deliverJobFilter, params)
this.getList("refresh"); this.getList("refresh");
}, },
setQueryParam() {
var filterParams = [];
var queryParams = uni.getStorageSync(deliverJobFilter)
if (queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: queryParams.creationTime
})
}
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
} else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
switchChangeWait(state, jobStatus) { filterParams.push({
this.checkedWaitTask = state; column: "accept_user_id",
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==", action: "==",
value: code value: this.$store.state.user.id
}) })
var params = { if (this.businessType && this.businessType.length > 0) {
filters: filters, // :businessType=Deliver businessType=ZZBJDeliver
pageNo: 1, filterParams.push({
pageSize: 100, column: "businessType",
action: "==",
value: this.businessType
})
} }
getDeliverJobList(params).then(res => { //
uni.hideLoading(); if (queryParams.itemType) {
if (res.data.list.length == 0) { filterParams.push({
that.showMessage('未查找到' + '【' + code + '】的收货任务'); column: "itemType",
} else if (res.data.list.length == 1) { action: "==",
that.openJobDetail(res.data.list[0]); value: queryParams.itemType
})
this.itemType = queryParams.itemType
} else {
if (this.itemType) {
filterParams.push({
column: "itemType",
action: "==",
value: this.itemType
})
} }
}).catch(error => { }
uni.hideLoading();
that.showMessage(error); return filterParams;
})
}, },
showMessage(message) { showMessage(message) {
@ -293,11 +332,22 @@
} }
}); });
} },
itemTypeConfirm(e) {
var params = uni.getStorageSync(deliverJobFilter)
this.itemType = e;
//
if (!params) {
params = {
itemType: ""
}
}
this.getListByFilter(params)
},
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>
Loading…
Cancel
Save