Files
hht-zzzw-uni/pages/zw/ll-instore.vue

354 lines
8.8 KiB
Vue
Raw Normal View History

2025-08-05 18:15:31 +08:00
<template>
<view class="zd_container">
<!-- 来料入库 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
2025-08-06 10:07:38 +08:00
<view class="zd_wrapper" v-if="flag">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">载具编码</span>
2025-08-05 18:15:31 +08:00
</view>
2025-08-06 10:07:38 +08:00
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.storagevehicle_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料编码</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">批次</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.pcsn" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">可用数</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.qty" disabled>
2025-08-05 18:15:31 +08:00
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
2026-02-24 17:14:02 +08:00
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
2025-08-05 18:15:31 +08:00
<th>点位码</th>
2025-09-08 17:48:45 +08:00
<th>托盘码</th>
2025-10-21 13:31:10 +08:00
<th>批次号</th>
<th>物料类型</th>
2025-09-08 17:48:45 +08:00
<th>物料编码</th>
<th>重量</th>
<th>单据</th>
2025-08-05 18:15:31 +08:00
</tr>
</thead>
<tbody>
2025-09-08 17:48:45 +08:00
<!-- <tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.site_code}"> -->
2025-08-12 13:11:53 +08:00
<tr v-for="(e, i) in dataList" :key="i">
2025-08-06 10:07:38 +08:00
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
2025-08-05 18:15:31 +08:00
<td>{{e.site_code}}</td>
2025-09-08 17:48:45 +08:00
<td>{{e.vehicle_code}}</td>
2025-10-21 13:31:10 +08:00
<td>{{e.pcsn}}</td>
<td>{{e.material_model}}</td>
2025-09-08 17:48:45 +08:00
<td>{{e.material_code}}</td>
<td>{{e.qty}}</td>
2025-09-16 10:13:01 +08:00
<td>{{e.form_data_code}}</td>
2025-08-05 18:15:31 +08:00
</tr>
</tbody>
</table>
</view>
</view>
</view>
2026-02-24 17:14:02 +08:00
2025-08-05 18:15:31 +08:00
<view class="zd-row submit-bar">
2026-02-24 17:14:02 +08:00
<button class="zd-col-11 button-primary" @tap="_getInBillList">刷新</button>
2026-06-01 09:25:03 +08:00
<!-- <button class="zd-col-11 button-primary" :class="{'button-info': !checkedArr.length}" @click="showDialog = true" @tap="_zwConfirmIn">提交</button> -->
<button class="zd-col-11 button-primary" :class="{'button-info': !checkedArr.length}" @tap="handleSubmit">提交</button>
</view>
<!-- 弹窗无遮罩 -->
<view class="dialog" v-if="showDialog">
<!-- 转运类型横排不换行 -->
<view class="form-line">
<text class="label">转运类型</text>
<view class="radio-group">
<view class="radio-item" :class="{active: selectType === '0'}" @click="selectType = '0'">
<view class="circle"><view class="dot" v-if="selectType === '0'"></view></view>
<text class="text">人工转运</text>
</view>
<view class="radio-item" :class="{active: selectType === '1'}" @click="selectType = '1'">
<view class="circle"><view class="dot" v-if="selectType === '1'"></view></view>
<text class="text">AGV转运</text>
</view>
</view>
</view>
<!-- 按钮组 -->
<view class="btn-group">
<button class="btn cancel" @click="closeDialog">取消</button>
<button class="btn save" @click="save">保存</button>
</view>
2025-08-05 18:15:31 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2026-02-24 16:47:47 +08:00
import {getFormDataList, getPlate, getInBillList, zwConfirmIn} from '@/utils/getData4.js'
2025-08-05 18:15:31 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
id: '',
code: '',
2025-09-08 17:48:45 +08:00
pkId: '',
pkObj: {},
2026-05-20 11:31:41 +08:00
dataList: [],
// dataList: [
// {site_code: 's01', vehicle_code: 'v01', checked: false},
// {site_code: 's04', vehicle_code: 'v04', checked: false},
// {site_code: 's05', vehicle_code: 'v05', checked: false}
// ],
2026-02-24 17:14:02 +08:00
allCheck: false,
2025-08-12 13:11:53 +08:00
checkedArr: [],
2025-08-05 18:15:31 +08:00
pkId: '',
2025-08-06 10:07:38 +08:00
currentData: {},
flag: false,
2026-06-01 09:25:03 +08:00
disabled: false,
showDialog: false, // 控制弹窗显示
selectType: '0' // 选中的类型
2025-08-05 18:15:31 +08:00
};
},
onLoad (options) {
this.title = options.title
this.id = options.id
},
created () {
2026-02-24 16:47:47 +08:00
this._getInBillList()
2025-08-05 18:15:31 +08:00
},
methods: {
2026-06-01 09:25:03 +08:00
// 关闭弹窗
closeDialog() {
this.showDialog = false
},
// 保存并关闭
save() {
this._zwConfirmIn()
this.showDialog = false
},
handleSubmit () {
if (!this.checkedArr.length) {
this.disabled = false
return
}
this.showDialog = true
},
2025-09-08 17:48:45 +08:00
// async _getPlate () {
// try {
// let res = await getPlate(this.val1)
// if (res.code === '200') {
// this.flag = true
// this.currentData = res.data
// setTimeout(() => {
// this.flag = false
// },1000)
// this.handleAdd()
// } else {
// uni.showToast({
// title: res.message,
// icon: 'none'
// })
// }
// } catch (e) {
// }
// },
toChek (e) {
this.pkId = this.pkId === e.site_code ? '' : e.site_code
this.pkObj = this.pkId === e.site_code ? e : {}
2025-08-21 14:39:09 +08:00
},
2026-02-24 17:14:02 +08:00
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
2025-08-06 10:07:38 +08:00
toCheck (e) {
e.checked = !e.checked
2025-08-12 13:11:53 +08:00
this.checkedArr = this.dataList.filter(el => el.checked === true)
2026-02-24 17:14:02 +08:00
this.allCheck = this.checkedArr.length === this.dataList.length
2025-08-05 18:15:31 +08:00
},
clearUp () {
2025-08-12 13:11:53 +08:00
this.dataList = []
this.checkedArr = []
2025-08-05 18:15:31 +08:00
},
2026-02-24 16:47:47 +08:00
async _getInBillList () {
2025-08-21 14:39:09 +08:00
try {
2026-02-24 16:47:47 +08:00
let res = await getInBillList()
2025-08-21 14:39:09 +08:00
if (res.code === '200') {
2026-02-24 17:14:02 +08:00
this.dataList = [...res.data]
this.allCheck = true
this.dataList.map(el => {
2026-05-20 11:30:27 +08:00
this.$set(el, 'checked', false)
2026-02-24 17:14:02 +08:00
})
2025-08-21 14:39:09 +08:00
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
} catch (e) {
}
},
2025-08-05 18:15:31 +08:00
async _zwConfirmIn () {
this.disabled = true
2026-05-20 11:30:27 +08:00
this.checkedArr = this.dataList.filter(el => el.checked === true)
2025-08-05 18:15:31 +08:00
try {
2026-05-20 11:30:27 +08:00
// 去掉checked字段再上传
this.checkedArr.forEach(item => delete item.checked);
2026-06-01 09:25:03 +08:00
let res = await zwConfirmIn(this.checkedArr, this.selectType)
2025-08-05 18:15:31 +08:00
if (res.code === '200') {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
2026-06-01 09:25:03 +08:00
this._getInBillList()
2025-08-05 18:15:31 +08:00
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
}
} catch (e) {
this.disabled = false
}
}
}
}
</script>
2025-08-12 13:11:53 +08:00
<style lang="stylus" scoped>
.checked
background #ffffff
.slide_new table tr.checked td {
// background-color: transparent;
// color: #fff;
}
2026-06-01 09:25:03 +08:00
/* 弹窗:居中 + 无遮罩 */
.dialog {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 90%;
max-width: 600rpx;
background: #fff;
border-radius: 16rpx;
2026-06-03 13:05:15 +08:00
z-index: 9999 !important; /* 最高层级 */
2026-06-01 09:25:03 +08:00
overflow: hidden;
}
/* 转运类型行 */
.form-line {
display: flex;
align-items: center;
padding: 40rpx;
padding-top: 50rpx;
}
.label {
font-size: 30rpx;
width: 150rpx;
flex-shrink: 0;
}
/* 单选组:横排 + 不换行 */
.radio-group {
display: flex;
align-items: center;
white-space: nowrap;
}
.radio-item {
display: flex;
align-items: center;
margin-right: 50rpx;
}
/* 单选圆圈 */
.circle {
width: 36rpx;
height: 36rpx;
border: 2rpx solid #ccc;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12rpx;
}
.dot {
width: 20rpx;
height: 20rpx;
background: #007aff;
border-radius: 50%;
}
.radio-item.active .circle {
border-color: #007aff;
}
.text {
font-size: 30rpx;
white-space: nowrap; /* 强制不换行 */
}
/* 底部按钮 */
.btn-group {
display: flex;
border-top: 1rpx solid #eee;
}
.btn {
flex: 1;
height: 90rpx;
line-height: 90rpx;
font-size: 30rpx;
border: none;
background: #fff;
}
.cancel {
border-right: 1rpx solid #eee;
color: #666;
}
.save {
color: #007aff;
font-weight: 500;
}
2025-08-12 13:11:53 +08:00
</style>