<template>
|
<view class="content">
|
<view class="list" v-for="(item,index) in showList" :key="index">
|
<uni-card :title="item.任务单号"
|
:extra="item.单据号"
|
style="margin: 10px;"
|
@tap="showDetail = showDetail==index?-1:index"
|
:id="'card-'+index">
|
<view class="card-detail">
|
<view class="detail" v-if="item.工序流转卡号">
|
<text>流转卡号:</text>{{item.工序流转卡号}}
|
</view>
|
<view class="detail" v-if="item.产品名称">
|
<text>产品名称:</text>{{item.产品名称}}
|
</view>
|
<view class="detail" v-if="item.产品代码">
|
<text>产品代码:</text>{{item.产品代码}}
|
</view>
|
<view class="detail" v-if="item.款号">
|
<text>款号:</text>{{item.款号}}
|
</view>
|
<view class="detail" v-if="item.工序名称">
|
<text>工序名称:</text>{{item.工序名称}}
|
</view>
|
<view class="detail" v-if="item.工序代码">
|
<text>工序代码:</text>{{item.工序代码}}
|
</view>
|
<view class="detail" v-if="item.剩余数量">
|
<text>剩余数量:</text>{{item.剩余数量}}
|
</view>
|
<view class="detail" v-if="item.日期">
|
<text>日期:</text>{{item.日期.substr(0,10)}}
|
</view>
|
</view>
|
<view class="card-detail" v-if="showDetail == index">
|
<view class="detail" v-if="item.规格型号">
|
<text>规格型号:</text>{{item.规格型号}}
|
</view>
|
<view class="detail" v-if="item.流水号">
|
<text>流水号:</text>{{item.流水号}}
|
</view>
|
<view class="detail" v-if="item.流转卡数量">
|
<text>流转卡数量:</text>{{item.流转卡数量}}
|
</view>
|
<view class="detail" v-if="item.操作工名称">
|
<text>操作工:</text>{{item.操作工名称}}
|
</view>
|
<view class="detail" v-if="item.操作工代码">
|
<text>操作工代码:</text>{{item.操作工代码}}
|
</view>
|
<view class="detail" v-if="item.生产资源名称">
|
<text>生产资源:</text>{{item.生产资源名称}}
|
</view>
|
<view class="detail" v-if="item.生产资源代码">
|
<text>生产资源代码:</text>{{item.生产资源代码}}
|
</view>
|
<view class="detail" v-if="item.班组名称">
|
<text>生产班组:</text>{{item.班组名称}}
|
</view>
|
<view class="detail" v-if="item.班组代码">
|
<text>生产班组代码:</text>{{item.班组代码}}
|
</view>
|
<view class="detail" v-if="item.制单人">
|
<text>派单人:</text>{{item.制单人}}
|
</view>
|
<view class="detail" v-if="item.制单日期">
|
<text>制单日期:</text>{{item.制单日期.substr(0,10)}}
|
</view>
|
<view class="detail" v-if="item.备注">
|
<text>备注:</text>{{item.备注}}
|
</view>
|
</view>
|
|
<view class="more" v-if="showDetail == index ">
|
<view class="part" style="border-right: 1px solid #eee;">
|
<uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
|
</view>
|
<view class="part" @tap.stop="showStationOutBill(item,index)">
|
<uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>报工
|
</view>
|
</view>
|
<view class="more" v-if="showDetail != index">
|
<view class="part" style="border-right: 1px solid #eee;">
|
<uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
|
</view>
|
<view class="part" @tap.stop="showStationOutBill(item,index)">
|
<uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>报工
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
|
<BillListPopupVue ref="billList"></BillListPopupVue>
|
<view class="over" v-if="listData.length == 0">暂无数据</view>
|
<view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view>
|
<view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view>
|
<!-- 占位元素,确保页面可滚动 -->
|
<view style="height: 75vh;"></view>
|
</view>
|
</template>
|
|
<script>
|
import { getUserInfo } from "@/utils/auth.js";
|
import BillListPopupVue from '../../components/StationOutBillPopup/StationOutBillPopup.vue';
|
export default {
|
data() {
|
return {
|
userInfo:getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
|
sWhere:' and 1=1',
|
listData:[],
|
showList:[],
|
showDetail:-1,
|
page:1,
|
}
|
},
|
components: {
|
BillListPopupVue
|
},
|
onLoad() {
|
this.getList()
|
// console.log(this.userInfo,uni.getStorageSync('HUserName'))
|
},
|
onReachBottom: function() {
|
this.page++
|
setTimeout(() => {
|
this.showList = this.showList.concat(this.getPage(this.page,this.listData))
|
}, 100)
|
},
|
onPullDownRefresh: function() {
|
this.clear()
|
setTimeout(()=>{
|
uni.stopPullDownRefresh();
|
}, 1000);
|
},
|
methods: {
|
//出站汇报显示
|
showStationOutBill(e,index) {
|
console.log(e);
|
console.log(index);
|
uni.pageScrollTo({
|
//scrollTop: 20,
|
selector:`#card-${index}`,
|
duration: 100,
|
});
|
|
const hBarCode = e.工序流转卡号+"@"+e.工序号+"@"+e.序列号;
|
this.$refs.billList.showPopup(hBarCode);
|
},
|
getPage(page,list){
|
let sindex = (parseInt(page) - 1) * 20
|
let eindex = parseInt(page) * 20
|
let newList = list.slice(sindex,eindex)
|
return newList
|
},
|
getList(){
|
if(this.userInfo.HEmpID==0 || this.userInfo.HEmpID==''|| this.userInfo.HEmpID==null){
|
uni.showToast({
|
title:'用户未绑定职员请先绑定',
|
icon:'none'
|
})
|
return false;
|
}
|
this.sWhere += ` and CONVERT(DATE, 日期) = CONVERT(DATE, GETDATE())`
|
uni.showLoading({
|
title:'加载中...'
|
})
|
uni.request({
|
url: this.serverUrl + '/Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillListByEmp',
|
data:{
|
sWhere: this.sWhere,
|
user: uni.getStorageSync('HUserName'),
|
HEmpID:this.userInfo.HEmpID,
|
},
|
success: (res) => {
|
// console.log(1,res.data.data);
|
if(res.data.count == 1){
|
this.listData = res.data.data
|
this.showList = this.getPage(this.page,this.listData)
|
setTimeout(()=>{
|
uni.hideLoading()
|
}, 1000)
|
}else{
|
uni.hideLoading()
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
this.sWhere = ``
|
},
|
//重置
|
clear(){
|
this.listData = []
|
this.page = 1
|
this.showList = []
|
this.sWhere = ' and 1=1'
|
this.showDetail = -1,
|
|
this.getList()
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.form{
|
width: 640rpx;
|
margin: 20rpx auto;
|
}
|
picker input{
|
pointer-events: none;
|
}
|
.other{
|
margin-top: 8rpx;
|
text-align: center;
|
font-size: 28rpx;
|
padding: 4rpx 18rpx;
|
color: #1890FF;
|
}
|
.form-item{
|
display: flex;
|
align-items: center;
|
font-size: 28rpx;
|
padding: 6rpx 0;
|
.title{
|
width: 180rpx;
|
text{
|
color: red;
|
font-weight: bold;
|
}
|
}
|
.choose{
|
padding: 4rpx 16rpx 0 0;
|
width: 100%;
|
text-align: right;
|
}
|
.left{
|
width: 170rpx;
|
padding: 10rpx 0;
|
margin-right: 10rpx;
|
border: 1px solid #acacac;
|
border-radius: 22rpx;
|
color: #888;
|
text-align: center;
|
}
|
.right{
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
}
|
.righton{
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #e4e4e4;
|
background-color: #e4e4e4;
|
}
|
input{
|
width: 100%;
|
padding: 8rpx 20rpx;
|
font-size: 30rpx;
|
}
|
}
|
.buttons{
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
margin-top: 20rpx;
|
button{
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
.btn-a{
|
background-color: #acacac;
|
color: #fff;
|
}
|
.btn-b{
|
background-color: #41a863;
|
color: #fff;
|
}
|
.btn-c{
|
background-color: #3a78ff;
|
color: #fff;
|
}
|
}
|
|
.list{
|
width: 100%;
|
.card-detail{
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
line-height: 120%;
|
.detail{
|
// width: 50%;
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
margin-right: 20rpx;
|
text{
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
}
|
.more{
|
color: #888;
|
font-size: 24rpx;
|
display: flex;
|
border-top: 1px solid #eee;
|
padding-top: 20rpx;
|
.part{
|
width: 50%;
|
text-align: center;
|
}
|
}
|
.op{
|
display: flex;
|
justify-content: space-around;
|
margin-top: 20rpx;
|
button{
|
padding: 0;
|
width: 150rpx;
|
font-size: 25rpx;
|
}
|
.op1{
|
border: 1px solid #41a863;
|
color: #41a863;
|
}
|
.op2{
|
border: 1px solid #d98d00;
|
color: #d98d00;
|
}
|
.op3{
|
border: 1px solid #3a78ff;
|
color: #3a78ff;
|
}
|
.op4{
|
border: 1px solid #da0000;
|
color: #da0000;
|
}
|
.op5{
|
border: 1px solid #888;
|
color: #888;
|
}
|
}
|
}
|
|
</style>
|