<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">
|
<u-cell-group class="duty-record-scroll-list-group" :border="false">
|
<view class="content" v-for="(item, index) in list" :key="item.id" :index="index">
|
<view class="content-header">
|
<radio :value="item.id" :checked="item.isChecked" style="transform:scale(0.6)"
|
@click="choose(item)" />
|
</view>
|
<view class="content-body" @click="choose(item)">
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
工作站编号:
|
</view>
|
<view class="_content">
|
{{ item.workstationNo }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
工作站:
|
</view>
|
<view class="_content">
|
{{ item.name }}
|
</view>
|
</view>
|
|
<view class="row-list">
|
<view class="_label">
|
<view class="content-body-icon-one"></view>
|
工作站类型:
|
</view>
|
<view class="_content">
|
{{ item.type }}
|
</view>
|
</view>
|
|
</view>
|
</view>
|
</u-cell-group>
|
</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',
|
},
|
workCenter: null,
|
list: [],
|
current: 0,
|
params: null,
|
}
|
},
|
computed: {
|
customStyleOne() {
|
return {
|
color: '#666666',
|
background: '#FFFFFF',
|
width: '350rpx'
|
}
|
},
|
customStyleTwo() {
|
return {
|
color: '#FFFFFF',
|
background: '#234EED',
|
width: '350rpx'
|
}
|
},
|
},
|
onLoad(option) {
|
if (option.params) {
|
this.params = JSON.parse(decodeURIComponent(option.params));
|
this.loadList();
|
}
|
},
|
methods: {
|
loadList() {
|
this.$u.api.operationTask.getDutyRecordWorkstation({
|
workCenter: this.params.workCenter
|
}).then(res => {
|
if (res.code == 0 && res.data.length > 0) {
|
this.list = res.data;
|
this.list.forEach(el => {
|
this.$set(el, 'isChecked', false);
|
})
|
}
|
});
|
},
|
choose(item) {
|
if (item.isChecked) {
|
item.isChecked = false
|
} else {
|
item.isChecked = true
|
}
|
},
|
onCancel() {
|
// 返回上一页
|
uni.navigateBack({
|
delta: 1
|
})
|
},
|
onSubmit() {
|
const initList = this.list.filter(item => item.isChecked == true);
|
|
const ids = initList.map((item) => {
|
return item.id
|
});
|
|
this.$set(this.params, 'workstationIdList', ids);
|
|
this.$u.api.operationTask.batchSaveDutyRecord(this.params).then(res => {
|
if (res.code == 0) {
|
this.$u.toast('提交成功');
|
// 返回上一页
|
setTimeout(() => {
|
uni.navigateBack({
|
delta: 1
|
});
|
}, 1000)
|
} else {
|
this.$u.toast('提交失败:' + res.msg);
|
}
|
});
|
},
|
}
|
}
|
</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;
|
line-height: normal;
|
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 {
|
line-height: normal;
|
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: 190rpx;
|
|
.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>
|