Compare commits

...

2 Commits

  1. 1
      src/common/config.js
  2. 4
      src/manifest.json
  3. 210
      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" : {

210
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() {
if (this.itemTypeList.length == 0) {
this.getItemTypeList()
} else {
this.getList('refresh'); 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({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "accept_user_id", var queryFiltersParams = this.setQueryParam()
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");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh"); this.getList("refresh");
}, },
getScanNumber(code) { setQueryParam() {
this.getDataListByType(code) var filterParams = [];
}, var queryParams = uni.getStorageSync(deliverJobFilter)
getDataListByType(code) { if (queryParams.creationTime) {
let that = this; filterParams.push({
uni.showLoading({ column: "create_time",
title: "加载中....", action: "betweeen",
mask: true value: queryParams.creationTime
}); })
var filters = [] }
filters.push({ //
if (queryParams.status) {
filterParams.push({
column: "status", column: "status",
action: "in", action: "in",
value: '1,2' value: queryParams.status
}) })
filters.push({ } else {
column: "number", filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
filterParams.push({
column: "accept_user_id",
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: "==",
getDeliverJobList(params).then(res => { value: this.businessType
uni.hideLoading(); })
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
} }
}).catch(error => { //
uni.hideLoading(); if (queryParams.itemType) {
that.showMessage(error); filterParams.push({
column: "itemType",
action: "==",
value: queryParams.itemType
})
this.itemType = queryParams.itemType
} else {
if (this.itemType) {
filterParams.push({
column: "itemType",
action: "==",
value: this.itemType
}) })
}
}
return filterParams;
}, },
showMessage(message) { showMessage(message) {
@ -293,8 +332,19 @@
} }
}); });
},
itemTypeConfirm(e) {
var params = uni.getStorageSync(deliverJobFilter)
this.itemType = e;
//
if (!params) {
params = {
itemType: ""
} }
} }
this.getListByFilter(params)
},
}
} }
</script> </script>

Loading…
Cancel
Save