<template>
|
<view class="page">
|
<view class="workstation-index-bg" />
|
<u-navbar title="班次记录" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
|
back-icon-color="#000" />
|
|
<view class="wrap">
|
<scroll-view class="operation-task-scroll-list" scroll-y="true" @scrolltolower="loadMore">
|
<u-cell-group class="duty-record-scroll-list-group" :border="false">
|
<radio-group @change="radioChange">
|
<view class="content" v-for="(item, index) in list" :key="item.id" :index="index">
|
<view class="content-header">
|
<radio :value="item.id" style="transform:scale(0.6)" />
|
<view class="content-header-title">班次编号:{{ item.dutyNo }}</view>
|
</view>
|
<view class="content-body">
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
班次日期:
|
</view>
|
<view class="_content">
|
{{ item.dutyDate }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
生产班次:
|
</view>
|
<view class="_content">
|
{{ item.shiftName }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
工作站:
|
</view>
|
<view class="_content">
|
{{ item.workstationName }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
生产班组:
|
</view>
|
<view class="_content">
|
{{ item.crewName }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
班次产量:
|
</view>
|
<view class="_content">
|
{{ item.dutyOutput }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
是否提交:
|
</view>
|
<view class="_content">
|
{{ item.isSubmit == true ? '是' : '否' }}
|
</view>
|
</view>
|
</view>
|
</view>
|
</radio-group>
|
</u-cell-group>
|
<view class="loadmore" @click="loadMore">
|
<u-loadmore :status="loadStatus"></u-loadmore>
|
</view>
|
</scroll-view>
|
<view class="bottom">
|
<view class="bottom-btn">
|
<wu-button :custom-style="customStyleOne" size="normal" @click="onCancel"
|
style="padding-left: 15rpx;">
|
取消
|
</wu-button>
|
</view>
|
<view class="bottom-btn">
|
<wu-button :custom-style="customStyleTwo" size="normal" @click="onSubmit"
|
style="padding-right: 15rpx;">
|
确定
|
</wu-button>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import content_bg from '@/static/custom/product/productBg.png'
|
export default {
|
data() {
|
return {
|
background: {
|
backgroundImage: `url(${content_bg})`,
|
backgroundAttachment: 'fixed',
|
backgroundSize: '100% auto',
|
backgroundRepeat: 'no-repeat',
|
},
|
params: {
|
current: 1,
|
size: 10,
|
workstationId: null
|
},
|
list: [],
|
current: 0,
|
loadStatus: 'loadmore',
|
}
|
},
|
computed: {
|
customStyleOne() {
|
return {
|
color: '#666666',
|
background: '#FFFFFF',
|
width: '350rpx'
|
}
|
},
|
customStyleTwo() {
|
return {
|
color: '#FFFFFF',
|
background: '#234EED',
|
width: '350rpx'
|
}
|
},
|
},
|
onLoad(option) {
|
if (option.id) {
|
this.params.workstationId = option.id;
|
}
|
this.loadList();
|
},
|
methods: {
|
loadList() {
|
this.$u.api.operationTask.getDutyRecordList(this.params).then(res => {
|
if (!res.data.records || res.data.records.length == 0) {
|
this.loadStatus = "nomore";
|
return;
|
}
|
this.list = this.list.concat(res.data.records);
|
this.query.current = res.data.current;
|
this.query.size = res.data.size;
|
this.loadStatus = "loadmore";
|
});
|
},
|
loadMore() {
|
this.loadStatus = "loading";
|
setTimeout(() => {
|
this.params.current += 1;
|
this.loadList();
|
}, 100);
|
},
|
radioChange: function(evt) {
|
this.current = evt.detail.value;
|
},
|
onCancel() {
|
// 返回上一页
|
uni.navigateBack({
|
delta: 1
|
})
|
},
|
onSubmit() {
|
const params = {
|
id: null,
|
dutyRecordId: this.current
|
}
|
|
this.list.forEach(el => {
|
if (el.id == this.current) {
|
params.id = el.workstationId;
|
return;
|
}
|
});
|
|
this.$u.api.operationTask.updWorkstation(params).then(res => {
|
if (res.code != 0) {
|
return;
|
}
|
});
|
|
this.$u.api.operationTask.getWorkstationList({
|
id: params.id
|
}).then(res => {
|
if (res.code == 0) {
|
const workstation = res.data[0];
|
|
// 获取页面栈
|
let pages = getCurrentPages()
|
|
// 获取上一页栈
|
let prevPage = pages[pages.length - 2]
|
let prevTwoPage = pages[pages.length - 3]
|
|
// 触发上一页 upData 函数(并携带参数)
|
prevPage.$vm.setWorkstation(workstation)
|
prevTwoPage.$vm.setWorkstation(workstation)
|
|
// 返回上一页
|
uni.navigateBack({
|
delta: 1
|
})
|
}
|
});
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.workstation-index-bg {
|
background-color: #F6F9FF;
|
background-image: url('~@/static/custom/product/productBg.png');
|
// background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
|
padding: 0 20rpx;
|
background-attachment: fixed;
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
position: fixed;
|
top: 0;
|
bottom: 0;
|
width: 100%;
|
z-index: -1;
|
}
|
|
.wrap {}
|
|
.wrap .operation-task-scroll-list {
|
height: calc(100vh - var(--window-top) - var(--window-bottom) - 254rpx);
|
width: 100%;
|
}
|
|
.bottom {
|
display: flex;
|
justify-content: space-between;
|
height: 100rpx;
|
margin-top: 20rpx;
|
}
|
|
.duty-record-scroll-list-group {
|
::v-deep .u-cell-item-box {
|
background-color: rgba(250, 252, 255, 0.36) !important;
|
padding: 0rpx 30rpx;
|
}
|
|
.content {
|
font-size: 12px;
|
background-color: #FFFFFF;
|
box-sizing: border-box;
|
border-radius: 10rpx;
|
margin: 0rpx 0rpx 24rpx;
|
height: 392rpx;
|
padding: 10rpx 20rpx;
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(127, 127, 127, 0.1) !important;
|
position: relative;
|
|
.content-header {
|
display: flex;
|
align-items: center;
|
|
.header-item-bottom {
|
height: 50rpx;
|
display: flex;
|
align-items: center;
|
|
.content-header-icon-two {
|
background-image: url('~@/static/custom/materialReturn/label-icon-2.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height: 28rpx;
|
width: 28rpx;
|
}
|
|
.content-header-title-ne {
|
margin-left: 11rpx;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
}
|
}
|
|
.content-body {
|
height: 320rpx;
|
background: #F5F9FF;
|
border-radius: 10rpx;
|
padding: 10rpx 23rpx;
|
|
.row-list {
|
height: 50rpx;
|
display: flex;
|
flex-direction: row;
|
padding: 0px;
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.row-list ._label {
|
display: flex;
|
color: #666666;
|
font-size: 26rpx;
|
align-items: center;
|
width: 170rpx;
|
|
.content-body-icon-one {
|
background-image: url('~@/static/custom/operationTask/label-icon-1.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height: 18rpx;
|
width: 18rpx;
|
margin-right: 10rpx;
|
}
|
}
|
|
.row-list ._content {
|
text-align: right;
|
color: #909399;
|
font-size: 24rpx;
|
|
._content-text {
|
color: #214ded;
|
}
|
}
|
|
.row-list ._input {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
border-bottom: 1px solid #4FA0FF;
|
height: 56rpx;
|
|
.edit_icon {
|
background-image: url('~@/static/custom/materialReturn/icon_edit.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height: 26rpx;
|
width: 26rpx;
|
}
|
|
::v-deep .uni-input-input {
|
color: #D35651;
|
}
|
}
|
|
.row-list .s1 {
|
display: flex;
|
color: #214DED;
|
font-size: 26rpx;
|
align-items: center;
|
width: 170rpx;
|
}
|
}
|
|
.content-footer {
|
.row-list {
|
height: 50rpx;
|
display: flex;
|
flex-direction: row;
|
padding: 0px;
|
align-items: center;
|
// justify-content: space-between;
|
|
.content-footer-time-icon {
|
background-image: url('~@/static/custom/operationTask/time-icon.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height: 28rpx;
|
width: 28rpx;
|
margin-right: 3px;
|
}
|
}
|
|
.row-list ._label {
|
display: flex;
|
color: #666666;
|
font-size: 26rpx;
|
align-items: center;
|
width: 200rpx;
|
}
|
|
.row-list ._content {
|
text-align: right;
|
color: #909399;
|
font-size: 24rpx;
|
|
._content-text {
|
color: #214ded;
|
}
|
}
|
}
|
}
|
}
|
</style>
|