123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <template>
- <view class="page-container uni-column">
- <view class="consultation-container uni-column">
- <view class="title uni-row">箱号:{{ data.carrier_code }}</view>
- <view class="info-row uni-row">
- <view class="label">批次号</view>
- <view class="value">{{ data.lot_code }}</view>
- </view>
- <view class="info-row uni-row">
- <view class="label">产品描述</view>
- <view class="value">{{ data.product_description }}</view>
- </view>
- <view class="info-row uni-row">
- <view class="label">当前工序</view>
- <view class="value">{{ data.current_process }}</view>
- </view>
- <view class="info-row uni-row">
- <view class="label">投产数量</view>
- <view class="value">{{ data.production_quantity }}</view>
- </view>
- <input type="text" v-model="carrierCode" placeholder="请输入箱号" />
- <view class="btn uni-row" style="background-color: #ff5555;" @click.stop="handleScanCode">
- <uni-icons type="scan" size="16" style="color: #ffffff; margin-right: 8rpx;" />
- <text>扫描箱码</text>
- </view>
- <view class="btn uni-row" style="margin-top: 48rpx;" @click.stop="handleConfirm">确定</view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue'
- import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
-
- const carrierCode = ref('')
- const data = ref({
- carrier_id: '',
- carrier_code: '',
- lot_id: 'D2423156000691',
- lot_code: 'D2423156000691',
- product_description: '',
- current_process: '热处理',
- production_quantity: 300
- })
-
- // 页面生命周期函数
- onLoad(() => {})
-
- // 扫码
- const handleScanCode = () => {
- uni.scanCode({
- onlyFromCamera: true,
- success: function (res) {
- if (res.scanType !== 'QR_CODE') {
- uni.showToast({
- icon: 'none',
- title: '二维码未识别成功',
- duration: 2000
- })
- return
- }
- const result = JSON.parse(res.result)
- console.log(result)
- // 此处根据拿到的箱子id,获取到相对应的【 lot_id 】,【 lot_code 】,以及该批次关联的其它箱号
- // 需要定义一个请求方法,从后端获取
- data.value.carrier_id = result.carrierId
- data.value.carrier_code = result.carrierCode
- }
- });
- }
-
- // 确定后,将批次id,批次号,传递过去
- const handleConfirm = () => {
- uni.navigateTo({
- url: '/pages/processInspection/form?lotId=' + data.value.lot_id + '&lotCode=' + data.value.lot_code
- })
- // if (type === 'ok') {
- // uni.navigateBack()
- // }
- }
- </script>
- <style lang="scss">
- .page-container {
- height: 100%;
- background-color: #ececec;
- font-size: 28rpx;
- padding: 24rpx;
- box-sizing: border-box;
- }
- .consultation-container {
- background-color: #ffffff;
- padding: 24rpx;
- border-radius: 12rpx;
-
- .title {
- justify-content: center;
- font-size: 32rpx;
- font-weight: 700;
- }
- .info-row {
- margin-top: 24rpx;
-
- .label {
- width: 160rpx;
- }
- .value {
- flex: 1;
-
- textarea {
- flex: 1;
- border: 1px solid #888888;
- box-sizing: border-box;
- padding: 16rpx;
- }
- }
- }
-
- .btn {
- background-color: #1684fc;
- color: #ffffff;
- border-radius: 8rpx;
- margin: 4rpx 24rpx 24rpx 24rpx;
- height: 64rpx;
- justify-content: center;
- align-items: center;
- }
- input {
- margin: 48rpx 24rpx 0 24rpx;
- height: 64rpx;
- border: 1px solid #888888;
- text-align: center;
- }
- }
- </style>
|