Compare commits

...

2 Commits

  1. 1
      src/common/config.js
  2. 4
      src/manifest.json
  3. 218
      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 overPackageJobFilter="over_package_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",
"appid" : "__UNI__C9CF4BF",
"description" : "",
"versionName" : "1.0.85",
"versionCode" : 85,
"versionName" : "1.0.86",
"versionCode" : 86,
"transformPx" : false,
/* 5+App */
"app-plus" : {

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

@ -1,15 +1,23 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
<view class="uni-flex" style="flex-direction: column;;">
<job-filter ref="filter" @onQuery="getListByFilter" :isShowQurery="true">
</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">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-deliver-job-card :dataContent="item" @click='openJobDetail(item)'></com-deliver-job-card>
</uni-swipe-action-item>
@ -27,17 +35,29 @@
</template>
<script>
import {
getDeliverJobList,
cancleTakeDeliverJob
} from '@/api/request2.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getItemTypeInfo
} from '@/common/directory.js';
import {
planRefreshTime,
deliverJobFilter
} from '@/common/config.js';
import {
getDetailOption,
getDetailGiveupOption
@ -72,8 +92,10 @@
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
businessType:'',
title:''
businessType: '',
title: '',
itemType: "",
itemTypeList: [],
};
},
onLoad(option) {
@ -81,7 +103,12 @@
this.businessType = option.businessType
},
onShow() {
this.getList('refresh');
if (this.itemTypeList.length == 0) {
this.getItemTypeList()
} else {
this.getList('refresh');
}
},
onReady() {
@ -120,6 +147,26 @@
},
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) {
let that = this;
uni.showLoading({
@ -131,35 +178,11 @@
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
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 queryFiltersParams = this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
@ -171,7 +194,7 @@
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")");
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
@ -193,7 +216,7 @@
openJobDetail(item) {
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) {
cancleTakeDeliverJob(id).then(res => {
if(res.data){
if (res.data) {
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
title: "放弃任务成功"
})
}else {
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
@ -237,54 +260,70 @@
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
getListByFilter(params) {
params.itemType = this.itemType
uni.setStorageSync(deliverJobFilter, params)
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) {
this.checkedWaitTask = state;
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",
filterParams.push({
column: "accept_user_id",
action: "==",
value: code
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
if (this.businessType && this.businessType.length > 0) {
// :businessType=Deliver businessType=ZZBJDeliver
filterParams.push({
column: "businessType",
action: "==",
value: this.businessType
})
}
getDeliverJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
//
if (queryParams.itemType) {
filterParams.push({
column: "itemType",
action: "==",
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) {
@ -293,7 +332,18 @@
}
});
}
},
itemTypeConfirm(e) {
var params = uni.getStorageSync(deliverJobFilter)
this.itemType = e;
//
if (!params) {
params = {
itemType: ""
}
}
this.getListByFilter(params)
},
}
}
</script>

Loading…
Cancel
Save