From 218e046d9339ddf3a729930f6bb7b0b77bbed858 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 19 十二月 2025 20:01:32 +0800
Subject: [PATCH] 新增并板入库
---
pages/sockroom/sockroom.vue | 1502 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 1,019 insertions(+), 483 deletions(-)
diff --git a/pages/sockroom/sockroom.vue b/pages/sockroom/sockroom.vue
index 8751742..7d4991d 100644
--- a/pages/sockroom/sockroom.vue
+++ b/pages/sockroom/sockroom.vue
@@ -1,35 +1,32 @@
<template>
<view class="sockpage">
<view class="column">
+ <!-- 鎵樼洏缂栫爜 -->
<view class="form-card">
<view class="form-row">
<view class="label">
<text class="required">*</text>鎵樼洏缂栫爜锛�
</view>
- <view class="picker-wrap" hover-class="picker-hover">
+ <view class="picker-wrap">
<view class="input-box">
<input
- id="pdacode"
- type="text"
- ref="barcodeInput"
- v-model="barcode"
- placeholder="璇锋壂鐮�(12浣嶄互涓嬩负鎵樼洏鐮�)"
- :focus="focusState"
- @focus="focusFn"
- @blur="focusState = false"
+ type="text"
+ v-model="barcode"
+ placeholder="璇锋壂鐮�"
+ placeholder-class="input-placeholder"
/>
</view>
</view>
</view>
</view>
- <!-- 绠卞瀷鏍忥紙瀵瑰簲鍚庣boxType锛� -->
+ <!-- 绠卞瀷閫夋嫨 -->
<view class="form-card">
<view class="form-row">
<view class="label">
- <text class="required">*</text>绠� 鍨嬶細
+ <text class="required">*</text>绠卞瀷锛�
</view>
- <view class="picker-wrap" hover-class="picker-hover">
+ <view class="picker-wrap">
<picker @change="modePickerChange" :value="index_mode" :range="mode">
<view class="input-box">
<text class="input-placeholder" v-if="!mode.length || !mode[index_mode]">璇烽�夋嫨绠卞瀷</text>
@@ -40,364 +37,598 @@
</view>
</view>
- <!-- 鐗╂枡淇℃伅杈撳叆鏍忥紙瀵瑰簲鍚庣MatList锛� -->
+ <!-- 鐗╂枡鐮佹壂鐮侊紙闅愯棌浣嗗彲鐢級 -->
+ <!-- <view class="form-card" style="height: 0; overflow: hidden; padding: 0; margin: 0;"> -->
+ <view class="form-card" style=" overflow: hidden; padding: 0; margin: 0;">
+ <view class="form-row">
+ <view class="label">
+ <text class="required">*</text>鐗╂枡鐮侊細
+ </view>
+ <view class="picker-wrap">
+ <view class="input-box">
+ <input
+ type="text"
+ v-model="scanBuffer"
+ placeholder="璇锋壂鐮�"
+ @input="handleMaterialScan"
+ ref="scanInput"
+ />
+ </view>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鐗╂枡淇℃伅 -->
<view class="form-card material-card">
<view class="card-title">鐗╂枡淇℃伅</view>
- <view class="material-grid">
- <view class="material-item">
- <text class="material-label"><text class="required">*</text>鍗峰彿锛�</text>
- <input
- class="material-input"
- type="text"
- v-model="matList.model"
- placeholder="璇锋壂鐮佹垨杈撳叆鍗峰彿"
- placeholder-class="input-placeholder"
- ref="modelInput"
- />
+
+ <!-- 澶氱墿鏂欏垪琛� -->
+ <view class="material-list" v-if="matList.length > 0">
+ <view class="material-item" v-for="(mat, index) in matList" :key="mat.id">
+ <view class="material-header">
+ <text class="material-title">鐗╂枡 {{ index + 1 }}</text>
+ <view class="material-actions">
+ <view class="action-btn" @click="removeMaterial(index)">鍒犻櫎</view>
+ </view>
+ </view>
+
+ <view class="material-grid">
+ <view class="material-item">
+ <text class="material-label"><text class="required">*</text>浣嶇疆锛�</text>
+ <input
+ class="material-input"
+ type="text"
+ v-model="mat.position"
+ placeholder="璇烽�夋嫨浣嶇疆"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label"><text class="required">*</text>绠卞彿锛�</text>
+ <input
+ class="material-input"
+ type="text"
+ v-model="mat.batch"
+ placeholder="璇锋壂鐮佹垨杈撳叆绠卞彿"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label"><text class="required">*</text>鍗峰彿锛�</text>
+ <input
+ class="material-input"
+ type="text"
+ v-model="mat.model"
+ placeholder="璇锋壂鐮佹垨杈撳叆鍗峰彿"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label">瑙勬牸锛�</text>
+ <input
+ class="material-input"
+ type="text"
+ v-model="mat.matnr"
+ placeholder="璇疯緭鍏ヨ鏍�"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label">闀垮害锛�</text>
+ <input
+ class="material-input"
+ type="number"
+ v-model="mat.rollExtent"
+ placeholder="璇疯緭鍏ラ暱搴�"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label">鍑�閲嶏細</text>
+ <input
+ class="material-input"
+ type="number"
+ v-model="mat.weight"
+ placeholder="璇疯緭鍏ュ噣閲�"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label">姣涢噸锛�</text>
+ <input
+ class="material-input"
+ type="number"
+ v-model="mat.roughWeight"
+ placeholder="璇疯緭鍏ユ瘺閲�"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ <view class="material-item">
+ <text class="material-label">鎺ュご锛�</text>
+ <input
+ class="material-input"
+ type="number"
+ v-model="mat.joint"
+ placeholder="璇疯緭鍏ユ帴澶存暟"
+ placeholder-class="input-placeholder"
+ />
+ </view>
+ </view>
</view>
- <view class="material-item">
- <text class="material-label"><text class="required">*</text>绠卞彿锛�</text>
- <input
- class="material-input"
- type="text"
- v-model="matList.batch"
- placeholder="璇锋壂鐮佹垨杈撳叆绠卞彿"
- placeholder-class="input-placeholder"
- ref="batchInput"
- />
- </view>
- <view class="material-item">
- <text class="material-label">瑙勬牸锛�</text>
- <input
- class="material-input"
- type="text"
- v-model="matList.matnr"
- placeholder="璇疯緭鍏ヨ鏍�"
- placeholder-class="input-placeholder"
- />
- </view>
- <view class="material-item">
- <text class="material-label">闀垮害锛�</text>
- <input
- class="material-input"
- type="number"
- v-model="matList.rollExtent"
- placeholder="璇疯緭鍏ラ暱搴�"
- placeholder-class="input-placeholder"
- />
- </view>
- <view class="material-item">
- <text class="material-label">鍑�閲嶏細</text>
- <input
- class="material-input"
- type="number"
- v-model="matList.weight"
- placeholder="璇疯緭鍏ュ噣閲�"
- placeholder-class="input-placeholder"
- />
- </view>
- <view class="material-item">
- <text class="material-label">姣涢噸锛�</text>
- <input
- class="material-input"
- type="number"
- v-model="matList.roughWeight"
- placeholder="璇疯緭鍏ユ瘺閲�"
- placeholder-class="input-placeholder"
- />
- </view>
- <view class="material-item">
- <text class="material-label">鎺ュご锛�</text>
- <input
- class="material-input"
- type="number"
- v-model="matList.joint"
- placeholder="璇疯緭鍏ユ帴澶存暟"
- placeholder-class="input-placeholder"
- />
- </view>
+ </view>
+
+ <!-- 绌虹姸鎬佹彁绀� -->
+ <view class="empty-state" v-else>
+ <view class="empty-icon">馃摝</view>
+ <text class="empty-text">鏆傛棤鐗╂枡淇℃伅</text>
+ <text class="empty-tip">璇锋壂鎻忕墿鏂欑爜娣诲姞鐗╂枡</text>
+ </view>
+
+ <!-- 鎵爜鎸夐挳 -->
+ <view class="scan-btn" @click="focusScanInput">
+ <text class="scan-icon">+</text>
+ <text class="scan-text">鎵爜娣诲姞鐗╂枡</text>
</view>
</view>
<!-- 鎿嶄綔鎸夐挳缁� -->
<view class="btn-group">
- <button class="operate-btn scan-btn" @click="startScan">寮�濮嬫壂鐮�</button>
- <button class="operate-btn submit-btn" @click="submit">鎴愬搧鍏ュ簱</button>
+ <button class="operate-btn submit-btn" @click="submit">缁勬墭</button>
+ </view>
+ </view>
+
+ <!-- 鎵爜纭寮圭獥 -->
+ <view class="modal-mask" v-if="showScanModal" @click="closeModal">
+ <view class="modal-content" @click.stop>
+ <view class="modal-header">
+ <text class="modal-title">鎵爜纭</text>
+ </view>
+ <view class="modal-body">
+ <view class="scan-preview">
+ <text class="scan-label">鎵弿鍒扮墿鏂欙細</text>
+ <text class="scan-code">{{ tempMaterial.model || '鏈煡鐗╂枡' }}</text>
+ </view>
+
+ <view class="preview-grid">
+ <view class="preview-item">
+ <text class="preview-label">绠卞彿锛�</text>
+ <text class="preview-value">{{ tempMaterial.batch || '鏈瘑鍒�' }}</text>
+ </view>
+ <view class="preview-item">
+ <text class="preview-label">鍗峰彿锛�</text>
+ <text class="preview-value">{{ tempMaterial.model || '鏈瘑鍒�' }}</text>
+ </view>
+ <view class="preview-item">
+ <text class="preview-label">瑙勬牸锛�</text>
+ <text class="preview-value">{{ tempMaterial.matnr || '鏈瘑鍒�' }}</text>
+ </view>
+ <view class="preview-item">
+ <text class="preview-label">闀垮害锛�</text>
+ <text class="preview-value">{{ tempMaterial.rollExtent || '鏈瘑鍒�' }}</text>
+ </view>
+ <view class="preview-item">
+ <text class="preview-label">鍑�閲嶏細</text>
+ <text class="preview-value">{{ tempMaterial.weight || '鏈瘑鍒�' }}</text>
+ </view>
+ <view class="preview-item">
+ <text class="preview-label">姣涢噸锛�</text>
+ <text class="preview-value">{{ tempMaterial.roughWeight || '鏈瘑鍒�' }}</text>
+ </view>
+ <view class="preview-item">
+ <text class="preview-label">鎺ュご锛�</text>
+ <text class="preview-value">{{ tempMaterial.joint || '鏈瘑鍒�' }}</text>
+ </view>
+
+ <view class="preview-item full-width">
+ <text class="preview-label">鐗╂枡浣嶇疆锛�</text>
+ <view class="position-selector" @click.stop="togglePositionPicker">
+ <view class="position-display">
+ <text v-if="positionIndex >= 0">{{ positionOptions[positionIndex].label }}</text>
+ <text v-else class="placeholder">璇烽�夋嫨浣嶇疆</text>
+ <text class="position-arrow">鈻�</text>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鏂板锛氳嚜瀹氫箟閫夋嫨鍣ㄥ脊鍑哄眰 -->
+ <view v-if="showPositionPicker" class="custom-picker-overlay" @click.stop="closePositionPicker">
+ <view class="custom-picker-content" @click.stop>
+ <view class="custom-picker-header">
+ <text class="custom-picker-title">閫夋嫨鐗╂枡浣嶇疆</text>
+ <view class="custom-picker-close" @click="closePositionPicker">脳</view>
+ </view>
+ <view class="custom-picker-list">
+ <view
+ v-for="(item, index) in positionOptions"
+ :key="index"
+ class="custom-picker-item"
+ :class="{'selected': positionIndex === index}"
+ @click="selectPosition(index)"
+ >
+ <text class="custom-picker-text">{{ item.label }}</text>
+ <text v-if="positionIndex === index" class="custom-picker-check">鉁�</text>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ <view class="modal-footer">
+ <button class="modal-btn cancel" @click="cancelAddMaterial">鍙栨秷</button>
+ <button class="modal-btn confirm" @click="confirmAddMaterial">纭畾娣诲姞</button>
+ </view>
</view>
</view>
</view>
</template>
<script>
-import { onLoad } from '../../uni_modules/uview-ui/libs/mixin/mixin'
-
export default {
- onLoad(){
- // 鍏堣鍙栫紦瀛橈紝鍐嶆墽琛岃姹�
- this.baseUrl = uni.getStorageSync('baseUrl');
- this.token = uni.getStorageSync('token');
- // 椤甸潰鍔犺浇鏃� mode 涓虹┖锛岃皟鐢ㄦ帴鍙e悗鎵嶅~鍏呮暟鎹�
- this.POSTinfo();
+ onLoad(options) {
+ this.checkLoginStatus();
+ this.POSTinfo();
},
- mounted() {
- this.setupScanListener();
+ onShow() {
+ this.checkLoginStatus();
},
- beforeDestroy() {
- this.removeScanListener();
+ onHide() {
+ if (this.scanTimeout) {
+ clearTimeout(this.scanTimeout);
+ this.scanTimeout = null;
+ }
+ },
+
+ onReady() {
+ // 鍦ㄩ〉闈㈠噯澶囧氨缁悗鍒濆鍖栨壂鐮佺洃鍚�
+ setTimeout(() => {
+ this.initScanListener();
+ }, 500);
},
data() {
return {
- focusState: false,
baseUrl: '',
- barcodeNum:'',
- barcode: '', // 鎵樼洏鐮�
- palletizingNo: '1', // 鐮佸灈浣嶇紪鍙�
- boxType: '', // 鏈ㄧ绫诲瀷
- matList: {
- matnr: '', // 瑙勬牸
- maktx: '', // 鐗╂枡鍚嶇О
- batch: '', // 鏈ㄧ缂栧彿
- model: '', // 鍗风紪鍙�
- position: '1', // 鏈ㄧ鐮佸灈浣嶇疆
- weight: '', // 鍑�閲�
- roughWeight: '', // 姣涢噸
- anfme: 1.0, // 榛樿鍊�1.0
- rollExtent: '', // 鍗烽暱搴�
- joint: 0, // 鎺ュご
- cutting: 2,
- qualified: 0,
- modelFront: '', // 鍒嗗垏鍓嶇缂栧彿
- batchFront: '' ,// 鍒嗗垏鍓嶅嵎鍙�
- },
- // 鍒濆鍖� mode 涓虹┖鏁扮粍 鈫� 椤甸潰鍔犺浇鏃剁鍨嬫棤鏁版嵁
- mode: [],
+ token: '',
+ barcode: '',
+ boxType: '',
+ mode: [],
index_mode: 0,
- index_num: 0,
- submitData: {} ,// 鏈�缁堟彁浜ょ粰鍚庣鐨勬暟鎹�
- scanBuffer: '', // 娣诲姞鎵爜缂撳啿鍖�
- scanTimeout: null, // 鎵爜瓒呮椂瀹氭椂鍣�
- isScanning: false, // 鎵爜鐘舵�佹爣蹇�
- scanMode: 'tray', // 鎵爜妯″紡: tray-鎵樼洏鐮�, material-鐗╂枡鐮�
- lastFillTarget: null // 璁板綍涓婃濉厖鐨勭洰鏍�
+
+ // 鎵爜鐩稿叧
+ scanBuffer: '',
+ scanTimeout: null,
+
+ // 鐗╂枡鍒楄〃
+ matList: [],
+ materialId: 1,
+
+ // 寮圭獥鐩稿叧
+ showScanModal: false,
+ tempMaterial: {
+ model: '',
+ batch: '',
+ matnr: '',
+ rollExtent: '',
+ weight: '',
+ roughWeight: '',
+ joint: 0,
+ position: '1' // 鏂板锛氱墿鏂欎綅缃紝榛樿鍊间负"1"(宸�)
+ },
+
+ // 鏂板锛氱墿鏂欎綅缃笅鎷夋鐩稿叧鏁版嵁
+ positionIndex: 0, // 榛樿閫変腑绗竴涓�(宸�)
+
+ // 鏂板锛氭帶鍒惰嚜瀹氫箟閫夋嫨鍣ㄦ樉绀�
+ showPositionPicker: false,
+ positionOptions: [
+ { label: '1', value: '1' },
+ { label: '2', value: '2' }
+ ]
}
},
+
methods: {
- POSTinfo(){
- uni.request({
- url: this.baseUrl + '/mobile/box/type/complete/auth/v2',
- method:'POST',
- header: {
- 'Content-Type': 'application/json'
- },
- success:(res)=>{
- // 鎺ュ彛杩斿洖鍚庢墠濉厖绠卞瀷鏁版嵁
- this.mode = res.data.data.map(item => item.boxSpecs || '').filter(item => item);
- console.log('鎻愬彇鐨勭鍨嬫暟鎹�:', this.mode);
- },
- fail:(err)=>{
- console.error('鑾峰彇绠卞瀷澶辫触:', err)
+ // 鏂板锛氬垏鎹綅缃�夋嫨鍣ㄦ樉绀�
+ togglePositionPicker() {
+ this.showPositionPicker = !this.showPositionPicker;
+ },
+
+ // 鏂板锛氬叧闂綅缃�夋嫨鍣�
+ closePositionPicker() {
+ this.showPositionPicker = false;
+ },
+
+ // 鏂板锛氶�夋嫨浣嶇疆
+ selectPosition(index) {
+ this.positionIndex = index;
+ this.tempMaterial.position = this.positionOptions[index].value;
+ this.closePositionPicker();
+ },
+
+ // 鍒濆鍖栨壂鐮佺洃鍚�
+ initScanListener() {
+ // 鍦╱ni-app涓紝鍙互閫氳繃ref鑾峰彇DOM鑺傜偣锛屼絾瑕佹敞鎰忓钩鍙板樊寮�
+ // 杩欓噷鎴戜滑閫氳繃涓�涓畨鍏ㄧ殑鏂规硶鏉ヨ仛鐒﹁緭鍏ユ
+ this.$nextTick(() => {
+ const input = this.$refs.scanInput;
+ if (input && typeof input.focus === 'function') {
+ input.focus();
}
- })
+ });
},
- // 璁剧疆鎵爜鐩戝惉
- setupScanListener() {
- // 绉婚櫎涔嬪墠鐨勭洃鍚�
- this.removeScanListener();
+ // 鑱氱劍鎵爜杈撳叆妗�
+ focusScanInput() {
+ // 浣跨敤uni-app鐨勫畨鍏ㄦ柟娉�
+ this.$nextTick(() => {
+ const input = this.$refs.scanInput;
+ if (input) {
+ // 鍦╱ni-app涓紝input鍙兘鏄竴涓粍浠跺疄渚�
+ // 鎴戜滑闇�瑕佽幏鍙栧叾DOM鑺傜偣鎴栦娇鐢ㄥ钩鍙扮壒瀹氱殑鏂规硶
+ // 杩欓噷鎴戜滑灏濊瘯璋冪敤focus锛屽鏋滀笉鍙敤鍒欒烦杩�
+ try {
+ if (typeof input.focus === 'function') {
+ input.focus();
+ } else if (input.$el && typeof input.$el.focus === 'function') {
+ // 濡傛灉鏄疺ue缁勪欢瀹炰緥
+ input.$el.focus();
+ }
+ } catch (error) {
+ console.log('鑱氱劍澶辫触锛屼絾涓嶅奖鍝嶅姛鑳�:', error);
+ }
+ }
+ });
+ },
+
+ // 澶勭悊鎵爜杈撳叆
+ handleMaterialScan(e) {
+ const value = e.detail ? e.detail.value : e.target.value;
- // 鐩戝惉閿洏杈撳叆浜嬩欢
- document.addEventListener('keydown', this.handleKeyDown);
- },
-
- // 绉婚櫎鐩戝惉
- removeScanListener() {
- document.removeEventListener('keydown', this.handleKeyDown);
+ // 闃叉姈澶勭悊
if (this.scanTimeout) {
clearTimeout(this.scanTimeout);
}
+
+ this.scanTimeout = setTimeout(() => {
+ if (value && value.trim()) {
+ this.parseBarcodeContent(value.trim());
+ this.showScanModal = true;
+ this.scanBuffer = ''; // 娓呯┖缂撳啿鍖�
+
+ // 姣忔鎵撳紑寮圭獥鏃堕噸缃綅缃�夋嫨涓洪粯璁ゅ��
+ this.positionIndex = 0;
+ this.tempMaterial.position = '1';
+ }
+ }, 300);
},
- // 閿洏浜嬩欢澶勭悊
- handleKeyDown(e) {
- // 鎺掗櫎鍔熻兘閿紙F1-F12绛夛級
- if (e.key.length > 1 && !['Enter', 'Tab'].includes(e.key)) {
+ // 瑙f瀽鏉$爜鍐呭
+ parseBarcodeContent(content) {
+ // const lines = content.split(/\\n/).filter(line => line.trim() !== '');
+ const lines = content.split(' ').filter(line => line.trim().length > 0);
+
+ // 娓呯┖涓存椂鏁版嵁
+ this.tempMaterial = {
+ model: '',
+ batch: '',
+ matnr: '',
+ rollExtent: '',
+ weight: '',
+ roughWeight: '',
+ joint: 0,
+ position: '1' // 閲嶇疆浣嶇疆涓洪粯璁ゅ��
+ };
+
+ // 浣跨敤姝e垯琛ㄨ揪寮忔彁鍙栭敭鍊煎[6,7](@ref)
+ const extractKeyValue = (line) => {
+ const match = line.match(/([^锛歖+)锛�(.+)/);
+ if (match && match.length === 3) {
+ return {
+ key: match[1].trim(),
+ value: match[2].trim()
+ };
+ }
+ return null;
+ };
+
+ // 鎻愬彇鏁板瓧锛堝寘鎷皬鏁帮級[6,7](@ref)
+ const extractNumber = (str) => {
+ const match = str.match(/[\d.]+/);
+ return match ? match[0] : '';
+ };
+
+ // 閬嶅巻姣忎竴琛岋紝瑙f瀽閿�煎
+ lines.forEach(line => {
+ const keyValue = extractKeyValue(line);
+ if (keyValue) {
+ const { key, value } = keyValue;
+
+ switch (key) {
+ case '鍗峰彿':
+ this.tempMaterial.model = value;
+ break;
+ case '绠卞彿':
+ this.tempMaterial.batch = value;
+ break;
+ case '瑙勬牸':
+ this.tempMaterial.matnr = value;
+ break;
+ case '闀垮害':
+ this.tempMaterial.rollExtent = extractNumber(value);
+ break;
+ case '鍑�閲�':
+ this.tempMaterial.weight = extractNumber(value);
+ break;
+ case '姣涢噸':
+ this.tempMaterial.roughWeight = extractNumber(value);
+ break;
+ case '鎺ュご':
+ this.tempMaterial.joint = extractNumber(value) || 0;
+ break;
+ default:
+ // 鍙互澶勭悊鏈煡閿垨蹇界暐
+ break;
+ }
+ }
+ });
+ },
+
+ // 纭娣诲姞鐗╂枡
+ confirmAddMaterial() {
+ this.closePositionPicker();
+ if (!this.tempMaterial.model) {
+ uni.showToast({
+ title: '鍗峰彿涓嶈兘涓虹┖',
+ icon: 'none'
+ });
return;
}
- // PDA鎵爜閫氬父浠ュ洖杞︾粨鏉�
- if (e.key === 'Enter') {
- e.preventDefault(); // 闃绘榛樿琛屼负
- this.processScanCode();
- } else {
- // 绱Н鎵爜瀛楃锛堟帓闄hift绛変慨楗伴敭锛�
- if (!e.ctrlKey && !e.altKey && !e.metaKey && e.key.length === 1) {
- this.scanBuffer += e.key;
-
- // 閲嶇疆瓒呮椂瀹氭椂鍣�
- if (this.scanTimeout) {
- clearTimeout(this.scanTimeout);
- }
-
- // 璁剧疆瓒呮椂锛堝亣璁炬壂鐮侀棿闅旇秴杩�200ms琛ㄧず涓�娆℃壂鐮佸畬鎴愶級
- this.scanTimeout = setTimeout(() => {
- this.processScanCode();
- }, 200);
- }
- }
+ // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓鐗╂枡
+ const exists = this.matList.some(item =>
+ item.model === this.tempMaterial.model &&
+ item.batch === this.tempMaterial.batch
+ );
+
+ if (exists) {
+ uni.showToast({
+ title: '璇ョ墿鏂欏凡瀛樺湪',
+ icon: 'none'
+ });
+ this.closeModal();
+ return;
+ };
+
+ // 娣诲姞鍒扮墿鏂欏垪琛�
+ const newMaterial = {
+ id: this.materialId++,
+ ...this.tempMaterial,
+ position: (this.matList.length + 1).toString(),
+ cutting: 2,
+ qualified: 0
+ };
+
+ this.matList.push(newMaterial);
+
+ uni.showToast({
+ title: '鐗╂枡娣诲姞鎴愬姛',
+ icon: 'success'
+ });
+
+ this.closeModal();
},
- // 澶勭悊鎵爜缁撴灉
- processScanCode() {
- if (!this.scanBuffer) return;
+ // 鍙栨秷娣诲姞
+ cancelAddMaterial() {
+ this.closeModal();
+ },
+
+ // 鍏抽棴寮圭獥
+ closeModal() {
+ this.showPositionPicker = false;
+ this.showScanModal = false;
+ this.tempMaterial = {
+ model: '',
+ batch: '',
+ matnr: '',
+ rollExtent: '',
+ weight: '',
+ roughWeight: '',
+ joint: 0,
+ position: '1' // 閲嶇疆浣嶇疆
+ };
- const scanResult = this.scanBuffer.trim();
- this.scanBuffer = '';
+ // 閲嶇疆浣嶇疆閫夋嫨
+ this.positionIndex = 0;
- // 鍒ゆ柇鎵爜闀垮害鍐冲畾濉厖浣嶇疆
- if (scanResult.length <= 12) {
- // 12浣嶄互涓嬪~鍏呭埌鎵樼洏缂栫爜
- this.barcode = scanResult;
- this.lastFillTarget = 'tray';
- uni.showToast({
- title: '鎵樼洏鐮佸凡濉厖',
- icon: 'success',
- duration: 1000
- });
- } else {
- // 12浣嶄互涓婂~鍏呭埌鐗╂枡淇℃伅
- this.autoFillMaterialInfo(scanResult);
- this.lastFillTarget = 'material';
- uni.showToast({
- title: '鐗╂枡鐮佸凡濉厖',
- icon: 'success',
- duration: 1000
- });
- }
-
- // 娓呴櫎瀹氭椂鍣�
- if (this.scanTimeout) {
- clearTimeout(this.scanTimeout);
- this.scanTimeout = null;
- }
-
- // 鑷姩澶辩劍
+ // 閲嶆柊鑱氱劍鍒版壂鐮佽緭鍏ユ
setTimeout(() => {
- this.focusState = false;
+ this.focusScanInput();
}, 100);
},
- // 鑷姩濉厖鐗╂枡淇℃伅
- autoFillMaterialInfo(code) {
- // 灏濊瘯瑙f瀽浜岀淮鐮佸唴瀹�
- if (code.includes('鍗峰彿锛�') && code.includes('绠卞彿锛�')) {
- // 濡傛灉鏄甫鏍煎紡鐨勪簩缁寸爜
- const parseResult = this.parseQrCodeText(code);
- this.matList = { ...this.matList, ...parseResult };
- console.log('瑙f瀽鍚庣殑鐗╂枡淇℃伅:', parseResult);
- } else {
- // 濡傛灉鏄函鏁板瓧/鏉$爜锛屾櫤鑳藉~鍏�
- this.smartFillMaterialFields(code);
- }
+ // 鍒犻櫎鐗╂枡
+ removeMaterial(index) {
+ uni.showModal({
+ title: '纭鍒犻櫎',
+ content: '纭畾瑕佸垹闄よ繖涓墿鏂欏悧锛�',
+ success: (res) => {
+ if (res.confirm) {
+ this.matList.splice(index, 1);
+ uni.showToast({
+ title: '鍒犻櫎鎴愬姛',
+ icon: 'success'
+ });
+ }
+ }
+ });
},
- // 鏅鸿兘濉厖鐗╂枡瀛楁
- smartFillMaterialFields(code) {
- // 鏍规嵁涓氬姟閫昏緫鍒ゆ柇锛岃繖閲屽亣璁鹃暱鏉$爜鍙兘鏄嵎鍙锋垨绠卞彿
- // 濡傛灉鍗峰彿涓虹┖锛屼紭鍏堝~鍏呭嵎鍙�
- if (!this.matList.model) {
- this.matList.model = code;
- }
- // 濡傛灉鍗峰彿宸叉湁鍊间絾绠卞彿涓虹┖锛屽~鍏呯鍙�
- else if (!this.matList.batch) {
- this.matList.batch = code;
- }
- // 濡傛灉涓よ�呴兘鏈夊�硷紝鎻愮ず鐢ㄦ埛
- else {
+ // 妫�鏌ョ櫥褰曠姸鎬�
+ checkLoginStatus() {
+ this.token = uni.getStorageSync('token');
+ this.baseUrl = uni.getStorageSync('baseUrl');
+
+ if (!this.token || !this.baseUrl) {
uni.showModal({
title: '鎻愮ず',
- content: `鎵弿鍒伴暱鏉$爜: ${code}\n璇烽�夋嫨濉厖浣嶇疆锛歚,
- showCancel: true,
- cancelText: '鍗峰彿',
- confirmText: '绠卞彿',
+ content: '璇峰厛鐧诲綍',
+ showCancel: false,
success: (res) => {
if (res.confirm) {
- this.matList.batch = code;
- } else if (res.cancel) {
- this.matList.model = code;
+ uni.navigateTo({
+ url: '/pages/login/login'
+ });
}
}
});
+ return false;
}
+ return true;
},
- // 瑙f瀽浜岀淮鐮佹枃鏈紙鐢ㄤ簬鎵揣鐗╃爜鍔熻兘锛�
- parseQrCodeText(qrText) {
- const result = {};
- const lines = qrText.split('\n');
+ // 鑾峰彇绠卞瀷鏁版嵁
+ POSTinfo() {
+ if (!this.checkLoginStatus()) return;
- lines.forEach(line => {
- if (line.includes('鍗峰彿锛�')) {
- result.model = line.split('鍗峰彿锛�')[1]?.trim() || '';
- }
- if (line.includes('绠卞彿锛�')) {
- result.batch = line.split('绠卞彿锛�')[1]?.trim() || '';
- }
- if (line.includes('瑙勬牸锛�')) {
- result.matnr = line.split('瑙勬牸锛�')[1]?.trim() || '';
- }
- // 鍙互鏍规嵁闇�瑕佹坊鍔犳洿澶氬瓧娈电殑瑙f瀽
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
});
- return result;
- },
-
- // 鎵嬪姩寮�濮嬫壂鐮�
- startScan() {
- // 娓呯┖褰撳墠鍊煎苟鑱氱劍
- this.scanBuffer = '';
-
- this.$nextTick(() => {
- this.focusState = true;
-
- // 寤惰繜纭繚input宸茶仛鐒�
- setTimeout(() => {
- const input = document.getElementById('pdacode');
- if (input) {
- input.focus();
- input.select();
- }
- }, 100);
- });
- },
-
- // 淇敼focusFn
- focusFn() {
- this.focusState = true;
- this.scanBuffer = ''; // 鑱氱劍鏃舵竻绌虹紦鍐插尯
- },
-
- // 淇濈暀鍘熸湁鐨勬壂璐х墿鐮佸姛鑳�
- scantwo() {
- uni.scanCode({
- autoDecodeCharSet: true,
- scanType: ['qrCode', 'barCode'],
+ uni.request({
+ url: this.baseUrl + '/mobile/box/type/complete/auth/v2',
+ method: 'POST',
+ header: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ' + this.token
+ },
success: (res) => {
- const qrResult = res.result.trim();
- this.autoFillMaterialInfo(qrResult);
+ uni.hideLoading();
- uni.showToast({
- title: '鐗╂枡淇℃伅鎵爜鎴愬姛',
- icon: 'success',
- duration: 2000
- });
+ if (res.data && res.data.code === 200 && Array.isArray(res.data.data)) {
+ this.mode = res.data.data
+ .map(item => item.boxSpecs || item.boxType || item.typeName || item.name || '')
+ .filter(item => item && item.trim() !== '');
+ if (this.mode.length === 0) {
+ uni.showToast({
+ title: '鏃犲彲鐢ㄧ鍨�',
+ icon: 'none'
+ });
+ }
+ } else {
+ uni.showToast({
+ title: res.data?.message || '鑾峰彇绠卞瀷澶辫触',
+ icon: 'none'
+ });
+ }
},
fail: (err) => {
- console.log('鎵爜澶辫触:', err);
+ uni.hideLoading();
+ console.error('鑾峰彇绠卞瀷澶辫触:', err);
uni.showToast({
- title: '鎵爜澶辫触鎴栧彇娑�',
+ title: '缃戠粶閿欒',
icon: 'none'
});
}
@@ -406,134 +637,221 @@
modePickerChange(e) {
this.index_mode = e.detail.value;
- this.boxType = this.mode[this.index_mode]; // 鍚屾鍒癰oxType
+ this.boxType = this.mode[this.index_mode];
},
- numPickerChange(e) {
- this.index_num = e.detail.value;
- },
-
- // 淇敼閲嶇疆鏂规硶
- resetForm() {
- this.barcodeNum = '';
- this.barcode = '';
- this.boxType = '';
- this.index_mode = 0;
- this.index_num = 0;
- this.submitData = {};
- this.mode = [];
- this.lastFillTarget = null;
- this.scanBuffer = '';
-
- // 閲嶇疆鐗╂枡淇℃伅
- this.matList = {
- matnr: '',
- maktx: '',
- batch: '',
- model: '',
- position: '1',
- weight: '',
- roughWeight: '',
- anfme: 1.0,
- rollExtent: '',
- joint: 0,
- cutting: 2,
- qualified: 0,
- modelFront: '',
- batchFront: ''
- };
- },
-
+ // 鎻愪氦鏁版嵁
submit() {
- // 鏍¢獙蹇呭~椤�
+ if (!this.checkLoginStatus()) return;
+
+ // 楠岃瘉蹇呭~椤�
if (!this.barcode) {
uni.showToast({title: '璇锋壂鎻忔墭鐩樼紪鐮�', icon: 'none'});
return;
}
-
+
+ this.boxType = 999;
if (!this.boxType) {
uni.showToast({title: '璇烽�夋嫨绠卞瀷', icon: 'none'});
return;
}
- if (!this.matList.model || !this.matList.batch) {
- uni.showToast({title: '璇峰~鍐欏嵎鍙峰拰绠卞彿', icon: 'none'});
+ if (this.matList.length === 0) {
+ uni.showToast({title: '璇疯嚦灏戞坊鍔犱竴涓墿鏂�', icon: 'none'});
return;
}
- // 鏁版嵁绫诲瀷杞崲
- const matItem = {
- ...this.matList,
- weight: this.matList.weight ? Number(this.matList.weight) : null,
- roughWeight: this.matList.roughWeight ? Number(this.matList.roughWeight) : null,
- rollExtent: this.matList.rollExtent ? Number(this.matList.rollExtent) : null,
- joint: this.matList.joint ? Number(this.matList.joint) : 0,
- anfme: 1.0,
- cutting: 2,
- qualified: 0
- };
+ // 楠岃瘉姣忎釜鐗╂枡鐨勫繀濉瓧娈�
+ for (let i = 0; i < this.matList.length; i++) {
+ const mat = this.matList[i];
+ if (!mat.model) {
+ uni.showToast({title: `鐗╂枡${i+1}鍗峰彿涓嶈兘涓虹┖`, icon: 'none'});
+ return;
+ }
+ if (!mat.batch) {
+ uni.showToast({title: `鐗╂枡${i+1}绠卞彿涓嶈兘涓虹┖`, icon: 'none'});
+ return;
+ }
+ }
- // 缁勮鎻愪氦鏁版嵁
- this.submitData = {
+ // 鍑嗗鎻愪氦鏁版嵁
+ const submitData = {
barcode: this.barcode,
- palletizingNo: this.palletizingNo,
boxType: this.boxType,
- matList: [matItem]
+ matList: this.matList.map(mat => ({
+ ...mat,
+ weight: mat.weight ? Number(mat.weight) : null,
+ roughWeight: mat.roughWeight ? Number(mat.roughWeight) : null,
+ rollExtent: mat.rollExtent ? Number(mat.rollExtent) : null,
+ joint: mat.joint ? Number(mat.joint) : 0,
+ position: mat.position // 鍖呭惈浣嶇疆淇℃伅
+ }))
};
- console.log('鎻愪氦鏁版嵁锛�', this.submitData);
+ console.log('鎻愪氦鏁版嵁:', submitData);
- // 鎻愪氦璇锋眰
+ // 鍙戦�佽姹�
+ uni.showLoading({
+ title: '鎻愪氦涓�...',
+ mask: true
+ });
+
uni.request({
url: this.baseUrl + '/mobile/truss/comd/auth/v2',
method: 'POST',
- header: {'Content-Type': 'application/json'},
- data: this.submitData,
+ header: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ' + this.token
+ },
+ data: submitData,
success: (res) => {
- console.log('鍚庣杩斿洖锛�', res);
+ uni.hideLoading();
- if (res.data && res.data.code === 200) {
- uni.showToast({title: '鎻愪氦鎴愬姛', icon: 'success'});
- this.resetForm();
+ if (res.data.code === 200) {
+ uni.showToast({
+ title: '鎻愪氦鎴愬姛',
+ icon: 'success',
+ duration: 2000
+ });
+
+ // 娓呯┖琛ㄥ崟
+ setTimeout(() => {
+ this.resetForm();
+ }, 1500);
} else {
- uni.showToast({title: res.data.message || '鎻愪氦澶辫触', icon: 'none'});
+ uni.showToast({
+ title: res.data.msg || '鎻愪氦澶辫触',
+ icon: 'none'
+ });
}
},
fail: (err) => {
- console.error('璇锋眰澶辫触璇︽儏锛�', err);
- uni.showToast({title: '缃戠粶璇锋眰澶辫触', icon: 'none'});
+ uni.hideLoading();
+ console.error('鎻愪氦澶辫触:', err);
+ uni.showToast({
+ title: '缃戠粶閿欒',
+ icon: 'none'
+ });
}
});
+ },
+
+ // 閲嶇疆琛ㄥ崟
+ resetForm() {
+ this.barcode = '';
+ this.boxType = '';
+ this.index_mode = 0;
+ this.matList = [];
+ this.materialId = 1;
}
}
}
</script>
<style scoped>
-/* 鍏ㄥ眬鏍峰紡 */
+
+/* 鐗╂枡浣嶇疆閫夋嫨鍣ㄦ牱寮� */
+.full-width {
+ grid-column: 1 / -1; /* 鍗犳弧鏁磋 */
+ margin-top: 8rpx;
+ position: relative;
+ z-index: 100; /* 纭繚鍦ㄥ脊绐楀唴閮ㄥ眰绾ф甯� */
+}
+
+.position-selector {
+ width: 200rpx;
+ display: flex;
+ justify-content: flex-end;
+}
+
+.position-picker {
+ width: 200rpx;
+}
+
+.position-display {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 8rpx 16rpx;
+ border: 1rpx solid #e5e7eb;
+ border-radius: 6rpx;
+ background-color: #ffffff;
+ color: #333;
+ font-size: 28rpx;
+ min-height: 40rpx;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.placeholder {
+ color: #999;
+}
+
+.position-arrow {
+ font-size: 20rpx;
+ color: #666;
+ margin-left: 8rpx;
+}
+/* 鍏ㄥ眬鏍峰紡 - 淇濇寔鍘熸湁椋庢牸 */
.sockpage {
background-color: #f5f7fa;
- padding: 24rpx;
+ padding: 20rpx;
min-height: 100vh;
}
-/* 琛ㄥ崟鍒楀鍣� */
.column {
display: flex;
flex-direction: column;
- gap: 24rpx;
+ gap: 20rpx;
}
-/* 琛ㄥ崟鍗$墖 */
.form-card {
background: #ffffff;
- border-radius: 12rpx;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
- padding: 24rpx;
- transition: all 0.2s ease;
+ border-radius: 8rpx;
+ padding: 20rpx;
+ box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1);
}
-/* 鐗╂枡淇℃伅鍗$墖鐗规畩鏍峰紡 */
+.form-row {
+ display: flex;
+ align-items: center;
+ gap: 20rpx;
+}
+
+.label {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 500;
+ min-width: 140rpx;
+}
+
+.required {
+ color: #e64340;
+ margin-right: 4rpx;
+}
+
+.picker-wrap {
+ flex: 1;
+}
+
+.input-box {
+ border: 1rpx solid #e5e7eb;
+ border-radius: 6rpx;
+ padding: 16rpx 20rpx;
+ background: #fff;
+}
+
+.input-placeholder {
+ color: #999;
+ font-size: 28rpx;
+}
+
+.input-value {
+ color: #333;
+ font-size: 28rpx;
+}
+
+/* 鐗╂枡淇℃伅鍗$墖 */
.material-card {
padding: 0;
}
@@ -541,168 +859,386 @@
.card-title {
font-size: 30rpx;
font-weight: 500;
- color: #1f2937;
- padding: 24rpx 24rpx 16rpx;
+ color: #333;
+ padding: 20rpx 20rpx 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
-/* 琛ㄥ崟琛� */
-.form-row {
+/* 鐗╂枡鍒楄〃 */
+.material-list {
+ padding: 0 20rpx;
+}
+
+.material-item {
+ margin-bottom: 20rpx;
+}
+
+.material-header {
display: flex;
- flex-direction: row;
- align-items: center;
- gap: 16rpx;
-}
-
-/* 鏍囩鏍峰紡 */
-.label {
- font-size: 28rpx;
- color: #374151;
- font-weight: 500;
- min-width: 140rpx;
-}
-
-/* 蹇呭~椤规爣绾� */
-.required {
- color: #ef4444;
- margin-right: 4rpx;
-}
-
-/* 閫夋嫨鍣ㄥ鍣� */
-.picker-wrap {
- flex: 1;
- display: flex;
- align-items: center;
justify-content: space-between;
+ align-items: center;
+ margin-bottom: 16rpx;
+ padding-bottom: 12rpx;
+ border-bottom: 1rpx solid #f0f0f0;
}
-/* 閫夋嫨鍣╤over鎬� */
-.picker-hover {
- background-color: #f9fafb;
- border-radius: 8rpx;
-}
-
-/* 杈撳叆妗嗗鍣� */
-.input-box {
- flex: 1;
+.material-title {
font-size: 28rpx;
- padding: 16rpx 12rpx;
- border: 1rpx solid #e5e7eb;
- border-radius: 8rpx;
- transition: border-color 0.2s ease;
+ font-weight: 500;
+ color: #333;
}
-.input-box:focus-within {
- border-color: #f97316;
+.material-actions {
+ display: flex;
+ gap: 20rpx;
}
-/* 杈撳叆鍊兼牱寮� */
-.input-value {
- color: #1f2937;
-}
-
-/* 鎵爜鍥炬爣 */
-.scan-icon {
+.action-btn {
font-size: 24rpx;
- margin-left: 8rpx;
- color: #6b7280;
+ color: #e64340;
+ padding: 6rpx 12rpx;
+ border-radius: 4rpx;
+ background: #fff0f0;
}
-/* 鐗╂枡淇℃伅缃戞牸甯冨眬 */
+/* 鐗╂枡缃戞牸 */
.material-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
- gap: 20rpx;
- padding: 24rpx;
+ gap: 16rpx;
}
-/* 鐗╂枡淇℃伅椤� */
.material-item {
display: flex;
flex-direction: column;
gap: 8rpx;
}
-/* 鐗╂枡鏍囩 */
.material-label {
font-size: 26rpx;
- color: #4b5563;
+ color: #666;
}
-/* 鐗╂枡杈撳叆妗� */
.material-input {
font-size: 28rpx;
- color: #1f2937;
- padding: 16rpx 12rpx;
+ color: #333;
+ padding: 12rpx;
border: 1rpx solid #e5e7eb;
- border-radius: 8rpx;
+ border-radius: 6rpx;
background-color: #ffffff;
- transition: border-color 0.2s ease;
}
-.material-input:focus {
- border-color: #f97316;
- outline: none;
+/* 绌虹姸鎬� */
+.empty-state {
+ text-align: center;
+ padding: 40rpx 20rpx;
}
-/* 鎸夐挳缁� */
-.btn-group {
- display: flex;
- gap: 20rpx;
- justify-content: center;
- margin-top: 16rpx;
- padding: 8rpx 0;
+.empty-icon {
+ font-size: 60rpx;
+ display: block;
+ margin-bottom: 20rpx;
+ opacity: 0.5;
}
-/* 鎿嶄綔鎸夐挳閫氱敤鏍峰紡 */
-.operate-btn {
- flex: 1;
- max-width: 200rpx;
- height: 80rpx;
- line-height: 80rpx;
+.empty-text {
+ display: block;
font-size: 28rpx;
- font-weight: 500;
- border-radius: 12rpx;
- border: none;
- transition: all 0.2s ease;
- display: flex;
- align-items: center;
- justify-content: center;
+ color: #999;
+ margin-bottom: 10rpx;
+}
+
+.empty-tip {
+ display: block;
+ font-size: 24rpx;
+ color: #ccc;
}
/* 鎵爜鎸夐挳 */
.scan-btn {
- background-color: #3b82f6;
- color: #ffffff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 10rpx;
+ padding: 20rpx;
+ margin: 20rpx 20rpx 20rpx;
+ background: #f0f7ff;
+ border: 1rpx dashed #1989fa;
+ border-radius: 8rpx;
+ color: #1989fa;
+ font-size: 28rpx;
}
-.scan-btn:active {
- background-color: #2563eb;
- transform: scale(0.98);
+.scan-icon {
+ font-size: 36rpx;
+ font-weight: bold;
}
-/* 鎻愪氦鎸夐挳 */
-.submit-btn {
- background-color: #f97316;
- color: #ffffff;
+/* 鎸夐挳缁� */
+.btn-group {
+ margin-top: 20rpx;
+ padding: 8rpx 0;
+ text-align: center;
}
-.submit-btn:active {
- background-color: #ea580c;
- transform: scale(0.98);
+.operate-btn {
+ width: 200rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 30rpx;
+ font-weight: 500;
+ border-radius: 8rpx;
+ border: none;
+ background: #333;
+ color: #fff;
}
-/* 閫傞厤灏忓睆骞� */
-@media (max-width: 375px) {
+/* 寮圭獥鏍峰紡 */
+.modal-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 1000;
+}
+
+.modal-content {
+ background: #fff;
+ border-radius: 12rpx;
+ width: 600rpx;
+ max-width: 90%;
+ overflow: hidden;
+}
+
+.modal-header {
+ padding: 30rpx 30rpx 20rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+}
+
+.modal-title {
+ font-size: 32rpx;
+ font-weight: 500;
+ color: #333;
+}
+
+.modal-body {
+ padding: 30rpx;
+}
+
+.scan-preview {
+ margin-bottom: 20rpx;
+ padding-bottom: 20rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+}
+
+.scan-label {
+ font-size: 28rpx;
+ color: #666;
+ display: block;
+ margin-bottom: 10rpx;
+}
+
+.scan-code {
+ font-size: 32rpx;
+ color: #333;
+ font-weight: bold;
+ word-break: break-all;
+}
+
+.preview-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 15rpx;
+}
+
+.preview-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.preview-label {
+ font-size: 28rpx;
+ color: #666;
+}
+
+.preview-value {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 500;
+}
+
+.modal-footer {
+ display: flex;
+ border-top: 1rpx solid #f0f0f0;
+}
+
+.modal-btn {
+ flex: 1;
+ height: 90rpx;
+ line-height: 90rpx;
+ font-size: 30rpx;
+ border: none;
+ background: transparent;
+ border-radius: 0;
+}
+
+.modal-btn.cancel {
+ color: #999;
+ border-right: 1rpx solid #f0f0f0;
+}
+
+.modal-btn.confirm {
+ color: #1989fa;
+ font-weight: 500;
+}
+
+/* 鑷畾涔夐�夋嫨鍣ㄦ牱寮� */
+.custom-picker-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 9999; /* 纭繚鍦ㄦ渶涓婂眰 */
+}
+
+.custom-picker-content {
+ background-color: #ffffff;
+ border-radius: 12rpx;
+ width: 600rpx;
+ max-width: 80%;
+ max-height: 70vh;
+ overflow: hidden;
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
+ animation: fadeIn 0.3s ease;
+}
+
+@keyframes fadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(20rpx);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.custom-picker-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 30rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+}
+
+.custom-picker-title {
+ font-size: 32rpx;
+ font-weight: 500;
+ color: #333;
+}
+
+.custom-picker-close {
+ font-size: 40rpx;
+ color: #999;
+ line-height: 1;
+ padding: 0 10rpx;
+ cursor: pointer;
+}
+
+.custom-picker-list {
+ max-height: 50vh;
+ overflow-y: auto;
+ padding: 0;
+}
+
+.custom-picker-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 25rpx 30rpx;
+ border-bottom: 1rpx solid #f5f5f5;
+ cursor: pointer;
+ transition: background-color 0.2s;
+}
+
+.custom-picker-item:last-child {
+ border-bottom: none;
+}
+
+.custom-picker-item:hover {
+ background-color: #f8f9fa;
+}
+
+.custom-picker-item.selected {
+ background-color: #f0f7ff;
+ color: #1989fa;
+}
+
+.custom-picker-text {
+ font-size: 30rpx;
+}
+
+.custom-picker-check {
+ font-size: 28rpx;
+ color: #1989fa;
+ font-weight: bold;
+}
+
+/* 寮圭獥鏍峰紡璋冩暣锛岀‘淇濆眰绾у叧绯� */
+.modal-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 1000; /* 寮圭獥鍩虹灞傜骇 */
+}
+
+.modal-content {
+ position: relative; /* 纭繚瀛愬厓绱犵浉瀵瑰畾浣� */
+ z-index: 1001; /* 姣旇挋鐗堥珮涓�绾� */
+ background: #fff;
+ border-radius: 12rpx;
+ width: 600rpx;
+ max-width: 90%;
+ overflow: visible; /* 鏀逛负 visible 鍏佽閫夋嫨鍣ㄥ脊鍑� */
+}
+
+/* 鍝嶅簲寮忛�傞厤 */
+@media (max-width: 750rpx) {
.material-grid {
grid-template-columns: 1fr;
}
- .operate-btn {
- max-width: 160rpx;
- height: 72rpx;
- line-height: 72rpx;
- font-size: 26rpx;
+ .preview-grid {
+ grid-template-columns: 1fr;
+ }
+
+ .modal-content {
+ width: 90%;
+ }
+ .custom-picker-content {
+ width: 90%;
+ max-width: 90%;
+ }
+
+ .custom-picker-item {
+ padding: 20rpx 25rpx;
}
}
</style>
\ No newline at end of file
--
Gitblit v1.9.1