You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
244 lines
6.0 KiB
244 lines
6.0 KiB
1 year ago
|
<template>
|
||
|
<page-meta root-font-size="18px"></page-meta>
|
||
|
<view class="">
|
||
|
<!-- <view class="uni-flex uni-row require_wrap">
|
||
|
<button @click="isTodayChange" :class="[isToday==true?'require_cell require_active':'require_cell']">
|
||
|
<text></text>
|
||
|
只看当天发料
|
||
|
</button>
|
||
|
<button @click="timeSortingChange"
|
||
|
:class="[isIssueTimeChange==true?'require_cell require_active':'require_cell']">
|
||
|
<text></text>
|
||
|
按发料时间排序
|
||
|
</button>
|
||
|
</view> -->
|
||
|
|
||
|
<win-empty-view v-if="issueList.length==0"></win-empty-view>
|
||
|
|
||
|
<view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id"
|
||
|
@click="openDetail(item)">
|
||
12 months ago
|
<comKittingIssue :dataContent="item"></comKittingIssue>
|
||
1 year ago
|
</view>
|
||
|
<uni-load-more :status="loadingType" v-if="issueList.length>0" />
|
||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button>
|
||
|
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
|
||
|
</win-mulit-scan>
|
||
|
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list>
|
||
|
<!-- com-message必须放在最下层 -->
|
||
|
<com-message ref="comMessage"></com-message>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import {
|
||
12 months ago
|
getCoatingIssueList,
|
||
|
getCoatingIssueJobByNumber,
|
||
|
getCoatingIssueListByRequest
|
||
1 year ago
|
} from '@/api/index.js';
|
||
|
|
||
|
import {
|
||
|
goHome
|
||
|
} from '@/common/basic.js';
|
||
|
|
||
|
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
|
||
|
import issueDetail from './issue_detail.vue';
|
||
|
import comIssue from '@/mycomponents/coms/task/comIssue.vue';
|
||
|
import comMessage from '@/mycomponents/common/comMessage.vue'
|
||
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
|
||
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
|
||
|
import comScanIssueList from '@/mycomponents/scan/comScanIssueList.vue'
|
||
12 months ago
|
import comKittingIssue from '@/mycomponents/coms/task/comKittingIssue.vue';
|
||
|
|
||
1 year ago
|
export default {
|
||
|
name: 'issue',
|
||
|
components: {
|
||
|
winEmptyView,
|
||
|
comIssue,
|
||
|
issueDetail,
|
||
|
comMessage,
|
||
|
winScanButton,
|
||
|
winMulitScan,
|
||
12 months ago
|
comScanIssueList,
|
||
|
comKittingIssue
|
||
1 year ago
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
//popup
|
||
|
type: '',
|
||
|
issueList: [],
|
||
|
reload: false,
|
||
|
status: '',
|
||
|
contentText: {
|
||
|
contentdown: '上拉加载更多',
|
||
|
contentrefresh: '加载中',
|
||
|
contentnomore: '没有更多'
|
||
|
},
|
||
|
pageSize: this.modelConfig,
|
||
|
pageIndex: 1,
|
||
|
isIssueTimeChange: false,
|
||
|
isToday: false,
|
||
|
titleArray: ['任务编号'],
|
||
|
loadingType: "nomore"
|
||
|
};
|
||
|
},
|
||
|
props: {
|
||
|
datacontent: {
|
||
|
type: Object,
|
||
|
value: null
|
||
|
},
|
||
|
isByFIFO: {
|
||
|
type: Boolean,
|
||
|
value: false
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
this.getList('refresh');
|
||
|
},
|
||
|
methods: {
|
||
|
openScanPopup() {
|
||
|
this.$refs.scanPopup.openScanPopup();
|
||
|
},
|
||
|
|
||
|
//按时间窗口排序
|
||
|
timeSortingChange() {
|
||
|
this.isIssueTimeChange = !this.isIssueTimeChange;
|
||
|
this.getList()
|
||
|
},
|
||
|
//只看当天到货
|
||
|
isTodayChange() {
|
||
|
this.isToday = !this.isToday
|
||
|
this.getList()
|
||
|
},
|
||
|
|
||
|
//查询发料任务
|
||
|
getList(type) {
|
||
|
let that = this;
|
||
|
uni.showLoading({
|
||
|
title: "加载中....",
|
||
|
mask: true
|
||
|
});
|
||
|
this.loadingType = "loading";
|
||
|
if (type === "refresh") {
|
||
|
this.pageIndex = 1;
|
||
|
this.issueList = [];
|
||
|
}
|
||
12 months ago
|
getCoatingIssueList(that.pageIndex,that.pageSize,false)
|
||
1 year ago
|
.then(res => {
|
||
|
uni.hideLoading();
|
||
|
if (type === "refresh") {
|
||
|
uni.stopPullDownRefresh();
|
||
|
}
|
||
12 months ago
|
res.items.forEach(item=>{
|
||
|
item.requestNumber = item.coatingRequestNumber
|
||
|
})
|
||
1 year ago
|
var list = res.items;
|
||
|
this.loadingType = "loadmore";
|
||
|
if (list == null || list.length == 0) {
|
||
|
//没数据了
|
||
|
this.loadingType = "nomore";
|
||
|
return;
|
||
|
}
|
||
|
that.issueList = type === "refresh" ? list : this.issueList.concat(list);
|
||
|
that.pageIndex++;
|
||
|
})
|
||
|
.catch(err => {
|
||
|
this.showMessage(err.message);
|
||
|
uni.hideLoading();
|
||
|
});
|
||
|
},
|
||
|
|
||
|
getScanResult(type, result) {
|
||
|
let code = result.data.code;
|
||
|
if (code == '') {
|
||
|
this.showMessage('扫描的内容不能为空')
|
||
|
return;
|
||
|
}
|
||
|
if (type == '申请单号') {
|
||
|
this.scanByRequesNumber(code, type);
|
||
|
} else if (type == '任务编号') {
|
||
|
this.scanByNumber(code, type);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
//扫描申请单号
|
||
|
scanByRequesNumber(code, type) {
|
||
|
let that = this;
|
||
|
uni.showLoading({
|
||
|
title: "加载中....",
|
||
|
mask: true
|
||
|
});
|
||
12 months ago
|
getCoatingIssueListByRequest(code).then(res => {
|
||
1 year ago
|
uni.hideLoading();
|
||
|
let items = res.items;
|
||
|
if (res.totalCount > 0) {
|
||
|
if (res.totalCount == 1) {
|
||
|
that.openDetail(items[0]);
|
||
|
} else {
|
||
|
that.showItemList(items);
|
||
|
}
|
||
|
} else {
|
||
|
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
|
||
|
}
|
||
|
}).catch(err => {
|
||
|
that.showMessage(err.message);
|
||
|
uni.hideLoading();
|
||
|
});
|
||
|
},
|
||
|
|
||
|
//扫描申请单号
|
||
|
scanByNumber(code, type) {
|
||
|
let that = this;
|
||
|
uni.showLoading({
|
||
|
title: "加载中....",
|
||
|
mask: true
|
||
|
});
|
||
12 months ago
|
getCoatingIssueJobByNumber(code).then(res => {
|
||
1 year ago
|
uni.hideLoading();
|
||
|
if (res != null) {
|
||
|
that.openDetail(res);
|
||
|
} else {
|
||
|
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
|
||
|
}
|
||
|
}).catch(err => {
|
||
|
that.showMessage(err.message);
|
||
|
uni.hideLoading();
|
||
|
});
|
||
|
},
|
||
|
|
||
|
openDetail(item) {
|
||
12 months ago
|
if(item.enumIssueSendType==1){
|
||
|
uni.navigateTo({
|
||
|
url: './coatingIssuleJobDetailByQty?id=' + item.id + '&jobStatus=' + item.jobStatus
|
||
|
});
|
||
|
}else {
|
||
|
uni.navigateTo({
|
||
|
url: './coatingIssuleJobDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
|
||
|
});
|
||
|
}
|
||
1 year ago
|
},
|
||
|
|
||
|
showMessage(message) {
|
||
|
this.$refs.comMessage.showMessage(message);
|
||
|
},
|
||
|
onPull() {
|
||
|
this.getList('refresh');
|
||
|
},
|
||
|
onReach() {
|
||
|
//避免多次触发
|
||
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
|
||
|
return;
|
||
|
}
|
||
|
this.getList('more');
|
||
|
},
|
||
|
showItemList(itemList) {
|
||
|
this.$refs.scanList.openPopup(itemList);
|
||
|
},
|
||
|
selectedItem(item) {
|
||
|
this.openDetail(item);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
</script>
|
||
|
<style scoped lang="scss">
|
||
|
</style>
|