123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <dialog-base ref="baseDialog" title="请选择报工批次">
- <view>
- <uni-section title="批次" type="line">
- <uni-data-select v-model="selectedLot" :localdata="lotList" :clear="false"
- @change="handleLotChange"></uni-data-select>
- </uni-section>
- </view>
- <view class="add-btn-container uni-row">
- <button type="primary" class="btn" @click="handleStart">确定</button>
- </view>
- </dialog-base>
- </template>
- <script setup>
- import {
- ref
- } from 'vue'
- import {
- onLoad
- } from '@dcloudio/uni-app'
- import {
- store
- } from '@/store/index.js'
- const baseDialog = ref(null)
- const selectedLot = ref("")
- const lotList = ref([])
- const infos = ref([])
- const emit = defineEmits(['handleSelectDaywork'])
- // onLoad(() => {
- // })
- function open(data) {
- lotList.value = data.map(v => ({
- text: v.lotCode,
- value: v.lotCode,
- }))
- infos.value = data
- baseDialog.value.open();
- }
- function handleLotChange() {
- console.log("选中", selectedLot.value);
- }
- function handleStart() {
- const info = infos.value.find(e => e.lotCode === selectedLot.value)
- emit('handleSelectDaywork', info);
- close()
- }
- function close() {
- baseDialog.value.close()
- }
- defineExpose({
- open
- })
- </script>
- <style lang="scss">
- .dialog-body {
- .equipment-container {
- height: 300rpx;
- overflow: auto;
- flex-wrap: wrap;
- justify-content: flex-start;
- margin: 24rpx 0 0 7%;
- .item {
- width: 236rpx;
- height: 60rpx;
- text-align: center;
- line-height: 60rpx;
- border-radius: 6rpx;
- margin: 16rpx;
- flex: 0 0 40%;
- border: 1px solid #000000;
- }
- .selected {
- background-color: #1684fc;
- color: #FFF;
- }
- }
- .add-btn-container {
- margin-top: 32rpx;
- .btn {
- flex: 1;
- }
- }
- .switch {
- font-size: 26rpx;
- align-items: center;
- justify-content: space-between;
- margin: 16rpx;
- }
- .userList {
- border: 1rpx solid #1684fc;
- border-radius: 8rpx;
- max-height: 300rpx;
- overflow: auto;
- width: 100%;
- .showUser {
- justify-content: flex-start;
- flex-wrap: wrap;
- .user {
- border: 1rpx solid #999;
- border-radius: 8rpx;
- width: 150rpx;
- height: 50rpx;
- text-align: center;
- line-height: 50rpx;
- margin: 10rpx;
- overflow: auto;
- }
- }
- }
- .selectedUserList {
- width: 100%;
- justify-content: flex-start;
- flex-wrap: wrap;
- .selectedUser {
- border: 1rpx solid #999;
- border-radius: 8rpx;
- width: 150rpx;
- height: 50rpx;
- text-align: center;
- line-height: 50rpx;
- margin: 20rpx 20rpx 0 0;
- justify-content: space-around;
- }
- }
- }
- </style>
|