From 76df26183884e9aef75b782509a1c60390c88785 Mon Sep 17 00:00:00 2001
From: chen.llin <1442464845@qq.comm>
Date: 星期六, 17 一月 2026 18:44:42 +0800
Subject: [PATCH] 增加清空缓存库位功能
---
pages/home/home.vue | 166 +++++++++--
pages/stock/locCacheLock.vue | 606 +++++++++++++++++++++++++++++++++++++++++++
pages.json | 10
3 files changed, 740 insertions(+), 42 deletions(-)
diff --git a/pages.json b/pages.json
index 3cf9195..ac85377 100644
--- a/pages.json
+++ b/pages.json
@@ -53,14 +53,14 @@
{
"path": "pages/AGV/agv_start",
"style": {
- "navigationBarTitleText": "AGV瀹瑰櫒鍏ュ簱",
+ "navigationBarTitleText": "AGV瀹瑰櫒鍏ュ簱(瀹炴墭)",
"enablePullDownRefresh": false
}
},
{
"path": "pages/AGV/agv_back",
"style": {
- "navigationBarTitleText": "AGV瀹瑰櫒鍥炲簱",
+ "navigationBarTitleText": "AGV瀹瑰櫒鍥炲簱(鎷f枡)",
"enablePullDownRefresh": false
}
},
@@ -78,6 +78,12 @@
}
},
{
+ "path": "pages/stock/locCacheLock",
+ "style": {
+ "navigationBarTitleText": "缂撳瓨搴撲綅鐘舵�佺鐞�"
+ }
+ },
+ {
"path": "pages/rfid/settings",
"style": {
"navigationBarTitleText": "RFID璁剧疆"
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 7ae22a0..d5d955a 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -55,7 +55,7 @@
</view>
<!-- 鏈垎绫昏彍鍗曞垎闅斿尯鍩� -->
- <view class="uncategorized-section" v-if="uncategorizedMenus.length > 0">
+ <view class="uncategorized-section" v-if="uncategorizedMenus.length > 0 && uncategorizedMenus.filter(item => !excludeFromCategory.includes(item.name)).length > 0">
<view class="section-divider">
<view class="divider-line"></view>
<text class="divider-text">鍏朵粬</text>
@@ -137,14 +137,14 @@
url: '/order/orderList'
},
{
- title: 'AGV瀹瑰櫒鍏ュ簱',
+ title: 'AGV瀹瑰櫒鍏ュ簱(瀹炴墭)',
name: 'agv_start',
color: 'blue',
cuIcon: '',
url: '/AGV/agv_start'
},
{
- title: 'AGV瀹瑰櫒鍥炲簱',
+ title: 'AGV瀹瑰櫒鍥炲簱(鎷f枡)',
name: 'agv_back',
color: 'orange',
cuIcon: '',
@@ -188,21 +188,28 @@
],
colorList: ['cyan', 'purple', 'blue', 'pink', 'orange', 'green', 'mauve', 'brown', 'olive', 'red', 'yellow', 'grey'],
// 鍥炬爣鏄犲皠
- iconMap: {
- 'pakin': 'upload',
- 'orderPakin': 'list',
- 'stockQuery': 'search',
- 'logOut': 'redo',
- 'orderPutOn': 'top',
- 'orderPutDown': 'bottom',
- 'restock': 'refresh',
- 'stockCheck': 'checkbox',
- 'agv_start': 'navigate',
- 'agv_back': 'refresh',
- 'agv_empty': 'upload',
- 'rfidSettings': 'scan',
- 'uhftest': 'scan',
- },
+ iconMap: {
+ 'pakin': 'upload',
+ '缁勬墭': 'upload',
+ 'orderPakin': 'list',
+ '璁㈠崟鍏ュ簱': 'list',
+ 'stockQuery': 'search',
+ '搴撳瓨鏌ヨ': 'search',
+ 'logOut': 'redo',
+ 'orderPutOn': 'top',
+ 'orderPutDown': 'bottom',
+ 'restock': 'refresh',
+ 'stockCheck': 'checkbox',
+ 'agv_start': 'navigate',
+ 'AGV瀹瑰櫒鍏ュ簱(瀹炴墭)': 'navigate',
+ 'agv_back': 'refresh',
+ 'AGV瀹瑰櫒鍥炲簱(鎷f枡)': 'refresh',
+ '缂撳瓨搴撲綅鐘舵�佺鐞�': 'settings',
+ 'agv_empty': 'upload',
+ 'AGV绌烘墭鍏ュ簱': 'upload',
+ 'rfidSettings': 'scan',
+ 'uhftest': 'scan',
+ },
// 鑿滃崟鍒嗙被閰嶇疆锛堜粎鍒嗙被妯″紡浣跨敤锛�
// key: 鍒嗙被鍞竴鏍囪瘑
// name: 鍒嗙被鏄剧ず鍚嶇О
@@ -215,21 +222,24 @@
name: '鍏ュ簱绠$悊',
color: 'cyan',
icon: 'upload',
- menuNames: ['pakin', 'orderPakin']
+ menuNames: ['pakin', 'orderPakin', '缁勬墭', '璁㈠崟鍏ュ簱'], // 鍏煎涓嫳鏂囧悕绉�
+ parentName: '鍏ュ簱绠$悊' // 鐖惰彍鍗曞悕绉帮紝鐢ㄤ簬灞傜骇缁撴瀯鍖归厤
},
{
key: 'agv_category',
name: 'AGV绠$悊',
color: 'blue',
icon: 'navigate',
- menuNames: ['agv_start', 'agv_back', 'agv_empty']
+ menuNames: ['agv_start', 'agv_back', 'agv_empty', 'AGV瀹瑰櫒鍏ュ簱(瀹炴墭)', 'AGV瀹瑰櫒鍥炲簱(鎷f枡)', 'AGV绌烘墭鍏ュ簱'], // 鍏煎涓嫳鏂囧悕绉�
+ parentName: 'AGV绠$悊' // 鐖惰彍鍗曞悕绉帮紝鐢ㄤ簬灞傜骇缁撴瀯鍖归厤
},
{
key: 'stock_category',
name: '搴撳瓨绠$悊',
color: 'green',
icon: 'search',
- menuNames: ['stockQuery']
+ menuNames: ['stockQuery', '搴撳瓨鏌ヨ', '缂撳瓨搴撲綅鐘舵�佺鐞�'], // 鍏煎涓嫳鏂囧悕绉�
+ parentName: '搴撳瓨绠$悊' // 鐖惰彍鍗曞悕绉帮紝鐢ㄤ簬灞傜骇缁撴瀯鍖归厤
},
{
key: 'device_category',
@@ -241,28 +251,48 @@
],
// 涓嶅弬涓庡垎绫荤殑鑿滃崟椤癸紙濡傞��鍑虹櫥褰曪紝濮嬬粓鍗曠嫭鏄剧ず锛�
excludeFromCategory: ['logOut'],
- // 褰撳墠灞曞紑鐨勫垎绫诲垪琛�
+ // 褰撳墠灞曞紑鐨勫垎绫诲垪琛紙榛樿鎶樺彔鎵�鏈夊垎绫伙級
expandedCategories: []
};
},
computed: {
// 鍒嗙被鍚庣殑鑿滃崟鏁版嵁锛堣繃婊ゆ帀绌哄垎绫伙級
categorizedMenus() {
- return this.categoryConfig.map(category => {
- const items = this.elements.filter(item =>
- category.menuNames.includes(item.name)
- );
+ const result = this.categoryConfig.map(category => {
+ const items = this.elements.filter(item => {
+ // 浼樺厛鏍规嵁parentName鍖归厤锛堥�傜敤浜庡眰绾х粨鏋勶級
+ if (category.parentName && item.parentName === category.parentName) {
+ return true;
+ }
+ // 鍏舵鏍规嵁menuNames鍖归厤锛堝吋瀹规棫鏁版嵁锛�
+ if (category.menuNames && category.menuNames.includes(item.name)) {
+ return true;
+ }
+ return false;
+ });
return {
...category,
items: items
};
- }).filter(category => category.items.length > 0);
+ }).filter(category => category.items && category.items.length > 0);
+ return result;
},
// 鏈垎绫荤殑鑿滃崟锛堜笉鍦ㄤ换浣曞垎绫讳腑鎴栧湪鎺掗櫎鍒楄〃涓級
uncategorizedMenus() {
- const allCategorizedNames = this.categoryConfig.flatMap(c => c.menuNames);
+ // 鑾峰彇鎵�鏈夊凡鍒嗙被鐨勮彍鍗曞悕绉帮紙鍖呮嫭閫氳繃parentName鍖归厤鐨勶級
+ const allCategorizedItems = new Set();
+ this.categoryConfig.forEach(category => {
+ this.elements.forEach(item => {
+ if (category.parentName && item.parentName === category.parentName) {
+ allCategorizedItems.add(item.name);
+ } else if (category.menuNames && category.menuNames.includes(item.name)) {
+ allCategorizedItems.add(item.name);
+ }
+ });
+ });
+
return this.elements.filter(item =>
- !allCategorizedNames.includes(item.name) || this.excludeFromCategory.includes(item.name)
+ !allCategorizedItems.has(item.name) || this.excludeFromCategory.includes(item.name)
);
}
},
@@ -308,19 +338,75 @@
that.elements = that.elements2;
return;
}
- for (var i = 0; i < res.data.length; i++) {
- if (res.data.length < 0) {
- break;
+
+ // 妫�鏌ヨ繑鍥炵殑鏁版嵁鏄惁鏄眰绾х粨鏋勶紙鍖呭惈type瀛楁鍜宑hildren瀛楁锛�
+ var isHierarchical = res.data.length > 0 && res.data[0].type !== undefined;
+
+ if (isHierarchical) {
+ // 灞傜骇缁撴瀯锛氱埗鑿滃崟鍖呭惈瀛愯彍鍗�
+ var colorIndex = 0;
+ for (var i = 0; i < res.data.length; i++) {
+ var item = res.data[i];
+ if (item.type === 'parent' && item.children && item.children.length > 0) {
+ // 鐖惰彍鍗曪細涓嶇洿鎺ユ坊鍔犲埌elements锛岃�屾槸灏嗗瓙鑿滃崟娣诲姞鍒癳lements锛屽苟淇濆瓨鐖惰彍鍗曚俊鎭�
+ for (var j = 0; j < item.children.length; j++) {
+ var child = item.children[j];
+ that.getIcon(child.name);
+ // 浼樺厛浠巈lements2涓煡鎵惧悓鍚嶈彍鍗曠殑棰滆壊锛堝尮閰峮ame鎴杢itle锛夛紝濡傛灉娌℃湁鍒欎娇鐢ㄩ粯璁ら鑹�
+ var defaultMenu = that.elements2.find(function(e) {
+ return e.name === child.name || e.title === child.name;
+ });
+ var childColor = defaultMenu ? defaultMenu.color : (that.colorList[colorIndex % that.colorList.length]);
+ that.elements.push({
+ title: child.name,
+ name: child.name,
+ color: childColor,
+ cuIcon: that.icon,
+ url: child.action,
+ parentName: item.name // 淇濆瓨鐖惰彍鍗曞悕绉帮紝鐢ㄤ簬鍒嗙被鍖归厤
+ });
+ }
+ colorIndex++; // 姣忎釜鐖惰彍鍗曚娇鐢ㄤ笉鍚岀殑棰滆壊
+ } else if (item.type === 'standalone') {
+ // 鐙珛鑿滃崟锛堟病鏈夌埗鑿滃崟鐨勬潈闄愶級
+ that.getIcon(item.name);
+ // 浼樺厛浠巈lements2涓煡鎵惧悓鍚嶈彍鍗曠殑棰滆壊锛堝尮閰峮ame鎴杢itle锛夛紝濡傛灉娌℃湁鍒欎娇鐢ㄩ粯璁ら鑹�
+ var defaultMenu = that.elements2.find(function(e) {
+ return e.name === item.name || e.title === item.name;
+ });
+ var standaloneColor = defaultMenu ? defaultMenu.color : (that.colorList[colorIndex % that.colorList.length]);
+ that.elements.push({
+ title: item.name,
+ name: item.name,
+ color: standaloneColor,
+ cuIcon: that.icon,
+ url: item.action
+ });
+ colorIndex++;
+ }
}
- that.getIcon(res.data[i].title);
- that.elements.unshift({
- title: res.data[i].name,
- name: res.data[i].title,
- color: that.colorList[i % that.colorList.length],
- cuIcon: that.icon,
- url: res.data[i].action
- });
+ } else {
+ // 骞抽摵缁撴瀯锛堝吋瀹规棫閫昏緫锛�
+ for (var i = 0; i < res.data.length; i++) {
+ if (res.data.length < 0) {
+ break;
+ }
+ that.getIcon(res.data[i].name);
+ // 浼樺厛浠巈lements2涓煡鎵惧悓鍚嶈彍鍗曠殑棰滆壊锛堝尮閰峮ame鎴杢itle锛夛紝濡傛灉娌℃湁鍒欎娇鐢ㄩ粯璁ら鑹�
+ var defaultMenu = that.elements2.find(function(e) {
+ return e.name === res.data[i].name || e.title === res.data[i].name;
+ });
+ var flatColor = defaultMenu ? defaultMenu.color : (that.colorList[i % that.colorList.length]);
+ that.elements.unshift({
+ title: res.data[i].name, // 鏉冮檺鍚嶇О浣滀负鏄剧ず鏍囬
+ name: res.data[i].name, // 鏉冮檺鍚嶇О浣滀负鍐呴儴鏍囪瘑
+ color: flatColor,
+ cuIcon: that.icon,
+ url: res.data[i].action // 鎺ュ彛鍦板潃浣滀负椤甸潰璺緞
+ });
+ }
}
+
that.elements.push({
title: '閫�鍑虹櫥褰�',
name: 'logOut',
diff --git a/pages/stock/locCacheLock.vue b/pages/stock/locCacheLock.vue
new file mode 100644
index 0000000..d9dc00a
--- /dev/null
+++ b/pages/stock/locCacheLock.vue
@@ -0,0 +1,606 @@
+<template>
+ <view class="page-container">
+ <!-- 琛ㄥ崟鍖哄煙 -->
+ <view class="form-section">
+ <view class="form-item">
+ <view class="form-label">
+ <uni-icons type="scan" size="18" color="#667eea"></uni-icons>
+ <text class="label-text">缂撳瓨搴撲綅鍙�</text>
+ </view>
+ <view class="form-input-wrap">
+ <input class="form-input" type="text" placeholder="鎵爜 / 杈撳叆缂撳瓨搴撲綅鍙�" v-model="locNo"
+ :focus="locNoFocus" @input="locNoInput()" @focus="onLocNoFocus()" @blur="onLocNoBlur()" />
+ <uni-icons v-if="locNo" type="clear" size="18" color="#c0c4cc" @click="clearLocNo"></uni-icons>
+ </view>
+ </view>
+ </view>
+
+ <!-- 搴撲綅淇℃伅灞曠ず -->
+ <view class="info-section" v-if="locCacheInfo">
+ <view class="info-card">
+ <view class="info-header">
+ <text class="info-title">搴撲綅淇℃伅</text>
+ </view>
+ <view class="info-body">
+ <view class="info-row">
+ <view class="info-col">
+ <text class="info-label">搴撲綅鍙�</text>
+ <text class="info-value">{{locCacheInfo.locNo || '-'}}</text>
+ </view>
+ </view>
+ <view class="info-row">
+ <view class="info-col half">
+ <text class="info-label">鎺�</text>
+ <text class="info-value">{{locCacheInfo.row1 || '-'}}</text>
+ </view>
+ <view class="info-col half">
+ <text class="info-label">鍒�</text>
+ <text class="info-value">{{locCacheInfo.bay1 || '-'}}</text>
+ </view>
+ </view>
+ <view class="info-row">
+ <view class="info-col half">
+ <text class="info-label">灞�</text>
+ <text class="info-value">{{locCacheInfo.lev1 || '-'}}</text>
+ </view>
+ <view class="info-col half">
+ <text class="info-label">搴撲綅鐘舵��</text>
+ <text class="info-value" :class="{'locked': locCacheInfo.locSts === 'F', 'unlocked': locCacheInfo.locSts === 'O'}">
+ {{getLocStsDesc(locCacheInfo.locSts)}}
+ </text>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="bottom-bar">
+ <view class="btn-reset" @click="reset()">
+ <uni-icons type="refresh" size="18" color="#909399"></uni-icons>
+ <text class="btn-text">閲嶇疆</text>
+ </view>
+ <view class="btn-group">
+ <view class="btn-unlock" :class="{'btn-disabled': !locCacheInfo || isSubmitting}" @click="unlockLoc()">
+ <uni-icons type="unlocked" size="18" color="#ffffff"></uni-icons>
+ <text class="btn-text">纭宸插彇璧板綋鍓嶅簱浣�</text>
+ </view>
+ <view class="btn-lock" :class="{'btn-disabled': !locCacheInfo || isSubmitting}" @click="lockLoc()">
+ <uni-icons type="locked" size="18" color="#ffffff"></uni-icons>
+ <text class="btn-text">鏍囪涓哄湪搴�</text>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鍒楁搷浣滄寜閽� -->
+ <view class="row-bar" v-if="locCacheInfo">
+ <view class="btn-group-row">
+ <view class="btn-unlock-row" :class="{'btn-disabled': isSubmitting}" @click="unlockBay()">
+ <uni-icons type="unlocked" size="18" color="#ffffff"></uni-icons>
+ <text class="btn-text">纭宸插彇璧板綋鍓嶅垪</text>
+ </view>
+ <view class="btn-lock-row" :class="{'btn-disabled': isSubmitting}" @click="lockBay()">
+ <uni-icons type="locked" size="18" color="#ffffff"></uni-icons>
+ <text class="btn-text">鏍囪褰撳墠鍒楀湪搴�</text>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鎺掓搷浣滄寜閽� -->
+ <view class="row-bar" v-if="locCacheInfo" style="margin-top: 10px;">
+ <view class="btn-group-row">
+ <view class="btn-unlock-row" :class="{'btn-disabled': isSubmitting}" @click="clearAllColumnsInRow()">
+ <uni-icons type="trash" size="18" color="#ffffff"></uni-icons>
+ <text class="btn-text">纭宸插彇璧板綋鍓嶆帓</text>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鎻愮ず淇℃伅寮圭獥 -->
+ <uni-popup ref="message" type="message">
+ <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
+ </uni-popup>
+
+ <!-- 纭寮圭獥 -->
+ <uni-popup ref="confirmDialog" type="dialog">
+ <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
+ @confirm="confirmAction" @close="closeConfirm"></uni-popup-dialog>
+ </uni-popup>
+
+ <!-- 閫夋嫨婊℃墭/绌烘墭寮圭獥 -->
+ <uni-popup ref="fullPltDialog" type="dialog">
+ <view class="popup-card">
+ <view class="popup-header">
+ <text class="popup-title">閫夋嫨鎵樼洏绫诲瀷</text>
+ </view>
+ <view class="popup-body">
+ <view class="popup-row">
+ <text class="popup-label">璇烽�夋嫨鎵樼洏绫诲瀷</text>
+ </view>
+ <view class="plt-options">
+ <view class="plt-option" :class="{'selected': selectedFullPlt === true}" @click="selectFullPlt(true)">
+ <uni-icons type="checkbox-filled" size="20" :color="selectedFullPlt === true ? '#667eea' : '#c0c4cc'"></uni-icons>
+ <text class="plt-text">婊℃墭</text>
+ </view>
+ <view class="plt-option" :class="{'selected': selectedFullPlt === false}" @click="selectFullPlt(false)">
+ <uni-icons type="checkbox-filled" size="20" :color="selectedFullPlt === false ? '#667eea' : '#c0c4cc'"></uni-icons>
+ <text class="plt-text">绌烘墭</text>
+ </view>
+ </view>
+ </view>
+ <view class="popup-footer">
+ <view class="popup-btn cancel" @click="closeFullPltDialog">鍙栨秷</view>
+ <view class="popup-btn confirm" :class="{'disabled': selectedFullPlt === null}" @click="confirmFullPlt">纭</view>
+ </view>
+ </view>
+ </uni-popup>
+ </view>
+</template>
+
+<script>
+ import rfidScanner from '@/common/rfid-scanner.js';
+
+ export default {
+ data() {
+ return {
+ baseUrl: '',
+ token: '',
+ locNo: '',
+ locNoFocus: true,
+ locCacheInfo: null,
+ msgType: 'success',
+ messageText: '',
+ title: '',
+ content: '',
+ isSubmitting: false,
+ actionType: '', // 'lock', 'unlock', 'lockBay', 'unlockBay'
+ actionLocNo: '',
+ selectedFullPlt: null // true-婊℃墭, false-绌烘墭, null-鏈�夋嫨
+ }
+ },
+ onLoad() {
+
+ },
+ onShow() {
+ this.baseUrl = uni.getStorageSync('baseUrl');
+ this.token = uni.getStorageSync('token');
+ // 璁剧疆褰撳墠椤甸潰瀹炰緥锛岀敤浜庡叏灞�鎵弿鏃惰嚜鍔ㄥ~鍏�
+ rfidScanner.setCurrentPageInstance(this);
+ },
+ onHide() {
+ // 椤甸潰闅愯棌鏃跺仠姝FID鎵弿
+ },
+ methods: {
+ // 搴撲綅鍙疯緭鍏ユ鑾峰緱鐒︾偣
+ onLocNoFocus() {
+ console.log('[locCacheLock] 搴撲綅鍙疯緭鍏ユ鑾峰緱鐒︾偣');
+ this.locNoFocus = true;
+ },
+ // 搴撲綅鍙疯緭鍏ユ澶卞幓鐒︾偣
+ onLocNoBlur() {
+ console.log('[locCacheLock] 搴撲綅鍙疯緭鍏ユ澶卞幓鐒︾偣');
+ },
+ clearLocNo() {
+ this.locNo = '';
+ this.locCacheInfo = null;
+ this.locNoFocus = false;
+ setTimeout(() => {
+ this.locNoFocus = true;
+ }, 100);
+ },
+ // 搴撲綅鍙疯緭鍏ヤ簨浠�
+ locNoInput() {
+ setTimeout(() => {
+ if (this.locNo && this.locNo.length >= 6) {
+ this.queryLocCache();
+ }
+ }, 300);
+ },
+ // 鏌ヨ搴撲綅淇℃伅
+ queryLocCache() {
+ if (!this.locNo) {
+ return;
+ }
+
+ let that = this;
+ uni.request({
+ url: that.baseUrl + '/locCache/list/auth',
+ data: {
+ locNo: that.locNo,
+ curr: 1,
+ limit: 1
+ },
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ success(result) {
+ result = result.data;
+ if (result.code === 200 && result.data && result.data.records && result.data.records.length > 0) {
+ that.locCacheInfo = result.data.records[0];
+ that.messageText = "鏌ヨ鎴愬姛";
+ that.msgType = 'success';
+ that.$refs.message.open();
+ } else if (result.code == 403) {
+ that.messageText = result.msg;
+ that.msgType = 'error';
+ that.$refs.message.open();
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ that.locCacheInfo = null;
+ that.messageText = result.msg || "搴撲綅涓嶅瓨鍦�";
+ that.msgType = 'error';
+ that.$refs.message.open();
+ }
+ },
+ fail: () => {
+ that.messageText = "缃戠粶璇锋眰瓒呮椂";
+ that.msgType = 'error';
+ that.$refs.message.open();
+ }
+ });
+ },
+ // 鏍囪褰撳墠搴撲綅涓哄湪搴�
+ lockLoc() {
+ if (!this.locCacheInfo || this.isSubmitting) return;
+ this.actionType = 'lock';
+ this.actionLocNo = this.locNo;
+ this.selectedFullPlt = null;
+ this.$refs.fullPltDialog.open();
+ },
+ // 纭宸插彇璧板綋鍓嶅簱浣�
+ unlockLoc() {
+ if (!this.locCacheInfo || this.isSubmitting) return;
+ this.actionType = 'unlock';
+ this.actionLocNo = this.locNo;
+ this.title = '纭鎿嶄綔';
+ this.content = '纭宸插彇璧板簱浣嶏細' + this.locNo + '锛�';
+ this.$refs.confirmDialog.open();
+ },
+ // 鏍囪褰撳墠鍒楀湪搴�
+ lockBay() {
+ if (!this.locCacheInfo || this.isSubmitting) return;
+ this.actionType = 'lockBay';
+ this.actionLocNo = this.locNo;
+ this.selectedFullPlt = null;
+ this.$refs.fullPltDialog.open();
+ },
+ // 纭宸插彇璧板綋鍓嶅垪
+ unlockBay() {
+ if (!this.locCacheInfo || this.isSubmitting) return;
+ this.actionType = 'unlockBay';
+ this.actionLocNo = this.locNo;
+ this.title = '纭鎿嶄綔';
+ this.content = '纭宸插彇璧扮' + this.locCacheInfo.bay1 + '鍒楃殑鎵�鏈夊簱浣嶏紵';
+ this.$refs.confirmDialog.open();
+ },
+ // 纭宸插彇璧板綋鍓嶆帓
+ clearAllColumnsInRow() {
+ if (!this.locCacheInfo || this.isSubmitting) return;
+ this.actionType = 'clearAllColumnsInRow';
+ this.actionLocNo = this.locNo;
+ this.title = '纭鎿嶄綔';
+ this.content = '纭宸插彇璧扮' + this.locCacheInfo.row1 + '鎺掔殑鎵�鏈夊簱浣嶏紙鎵�鏈夊垪锛夛紵';
+ this.$refs.confirmDialog.open();
+ },
+ // 閫夋嫨婊℃墭/绌烘墭
+ selectFullPlt(fullPlt) {
+ this.selectedFullPlt = fullPlt;
+ },
+ // 纭婊℃墭/绌烘墭閫夋嫨
+ confirmFullPlt() {
+ if (this.selectedFullPlt === null) return;
+ this.$refs.fullPltDialog.close();
+ // 鏄剧ず纭瀵硅瘽妗�
+ if (this.actionType === 'lock') {
+ this.title = '纭鏍囪';
+ this.content = '纭灏嗗簱浣嶏細' + this.actionLocNo + ' 鏍囪涓哄湪搴擄紙' + (this.selectedFullPlt ? '婊℃墭' : '绌烘墭') + '锛夛紵';
+ } else if (this.actionType === 'lockBay') {
+ this.title = '纭鏍囪';
+ this.content = '纭灏嗙' + this.locCacheInfo.bay1 + '鍒楃殑鎵�鏈夊簱浣嶆爣璁颁负鍦ㄥ簱锛�' + (this.selectedFullPlt ? '婊℃墭' : '绌烘墭') + '锛夛紵';
+ }
+ this.$refs.confirmDialog.open();
+ },
+ // 鍏抽棴婊℃墭/绌烘墭閫夋嫨寮圭獥
+ closeFullPltDialog() {
+ this.$refs.fullPltDialog.close();
+ this.selectedFullPlt = null;
+ },
+ // 纭鎿嶄綔
+ confirmAction() {
+ if (this.isSubmitting) return;
+
+ this.isSubmitting = true;
+ let that = this;
+ let url = '';
+ let data = {};
+
+ if (this.actionType === 'lock' || this.actionType === 'unlock') {
+ // 閿佸畾/瑙i攣鍗曚釜搴撲綅
+ url = that.baseUrl + '/locCache/lockOrUnlock/auth';
+ data = {
+ locNo: that.actionLocNo,
+ lock: that.actionType === 'lock'
+ };
+ // 濡傛灉鏄攣瀹氭搷浣滐紝闇�瑕佷紶閫抐ullPlt鍙傛暟
+ if (that.actionType === 'lock') {
+ data.fullPlt = that.selectedFullPlt;
+ }
+ } else if (this.actionType === 'lockBay' || this.actionType === 'unlockBay') {
+ // 閿佸畾/瑙i攣褰撳墠鍒�
+ url = that.baseUrl + '/locCache/lockOrUnlockBay/auth';
+ data = {
+ locNo: that.actionLocNo,
+ lock: that.actionType === 'lockBay'
+ };
+ // 濡傛灉鏄攣瀹氭搷浣滐紝闇�瑕佷紶閫抐ullPlt鍙傛暟
+ if (that.actionType === 'lockBay') {
+ data.fullPlt = that.selectedFullPlt;
+ }
+ } else if (this.actionType === 'clearAllColumnsInRow') {
+ // 娓呯┖鏁存帓锛堟墍鏈夊垪锛�
+ url = that.baseUrl + '/locCache/clearAllColumnsInRow/auth';
+ data = {
+ locNo: that.actionLocNo,
+ lock: false // 娓呯┖鎿嶄綔锛宭ock=false
+ };
+ }
+
+ uni.request({
+ url: url,
+ method: 'POST',
+ data: data,
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ success(result) {
+ var res = result.data;
+ if (res.code === 200) {
+ let actionDesc = '';
+ if (that.actionType === 'lock') {
+ actionDesc = '鏍囪涓哄湪搴擄紙' + (that.selectedFullPlt ? '婊℃墭' : '绌烘墭') + '锛�';
+ } else if (that.actionType === 'unlock') {
+ actionDesc = '纭宸插彇璧板綋鍓嶅簱浣�';
+ } else if (that.actionType === 'lockBay') {
+ actionDesc = '鏍囪褰撳墠鍒楀湪搴擄紙' + (that.selectedFullPlt ? '婊℃墭' : '绌烘墭') + '锛�';
+ } else if (that.actionType === 'unlockBay') {
+ actionDesc = '纭宸插彇璧板綋鍓嶅垪';
+ } else if (that.actionType === 'clearAllColumnsInRow') {
+ actionDesc = '纭宸插彇璧板綋鍓嶆帓';
+ }
+ that.messageText = actionDesc + '鎴愬姛';
+ that.msgType = 'success';
+ that.$refs.message.open();
+ // 閲嶆柊鏌ヨ搴撲綅淇℃伅
+ setTimeout(() => {
+ that.queryLocCache();
+ }, 500);
+ // 閲嶇疆閫夋嫨
+ that.selectedFullPlt = null;
+ } else if (res.code == 403) {
+ that.messageText = res.msg;
+ that.msgType = 'error';
+ that.$refs.message.open();
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ that.messageText = res.msg || "鎿嶄綔澶辫触";
+ that.msgType = 'error';
+ that.$refs.message.open();
+ }
+ },
+ fail: () => {
+ that.messageText = "缃戠粶璇锋眰瓒呮椂";
+ that.msgType = 'error';
+ that.$refs.message.open();
+ },
+ complete: () => {
+ that.isSubmitting = false;
+ that.$refs.confirmDialog.close();
+ }
+ });
+ },
+ // 鍏抽棴纭寮圭獥
+ closeConfirm() {
+ this.$refs.confirmDialog.close();
+ },
+ // 閲嶇疆
+ reset() {
+ this.locNo = '';
+ this.locCacheInfo = null;
+ this.selectedFullPlt = null;
+ this.locNoFocus = false;
+ setTimeout(() => {
+ this.locNoFocus = true;
+ }, 100);
+ },
+ // 鑾峰彇搴撲綅鐘舵�佹弿杩�
+ getLocStsDesc(locSts) {
+ if (!locSts) return '鏈煡';
+ const statusMap = {
+ 'D': '绌烘《/绌烘爤鏉�',
+ 'F': '鍦ㄥ簱',
+ 'O': '绌哄簱浣�',
+ 'P': '鎷f枡/鐩樼偣/骞舵澘鍑哄簱涓�',
+ 'Q': '鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴�',
+ 'R': '鍑哄簱棰勭害',
+ 'S': '鍏ュ簱棰勭害',
+ 'X': '绂佺敤',
+ 'Y': '琚悎骞�'
+ };
+ return statusMap[locSts] || '鏈煡';
+ }
+ }
+ }
+</script>
+
+<style>
+ /* 寮曞叆鍏叡鏍峰紡 */
+ @import url('../../static/css/common.css');
+ @import url('../../static/css/wms.css/wms.css');
+
+ .info-section {
+ padding: 20rpx;
+ }
+
+ .info-card {
+ background: #ffffff;
+ border-radius: 16rpx;
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
+ overflow: hidden;
+ }
+
+ .info-header {
+ padding: 24rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+ }
+
+ .info-title {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #333333;
+ }
+
+ .info-body {
+ padding: 24rpx;
+ }
+
+ .info-row {
+ display: flex;
+ margin-bottom: 24rpx;
+ }
+
+ .info-row:last-child {
+ margin-bottom: 0;
+ }
+
+ .info-col {
+ flex: 1;
+ }
+
+ .info-col.half {
+ flex: 0 0 50%;
+ }
+
+ .info-label {
+ display: block;
+ font-size: 26rpx;
+ color: #999999;
+ margin-bottom: 8rpx;
+ }
+
+ .info-value {
+ display: block;
+ font-size: 30rpx;
+ color: #333333;
+ font-weight: 500;
+ }
+
+ .info-value.locked {
+ color: #f56c6c;
+ }
+
+ .info-value.unlocked {
+ color: #67c23a;
+ }
+
+ .btn-group {
+ display: flex;
+ flex: 1;
+ gap: 20rpx;
+ }
+
+ .btn-unlock, .btn-lock {
+ flex: 1;
+ height: 88rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 12rpx;
+ gap: 12rpx;
+ }
+
+ .btn-unlock {
+ background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
+ }
+
+ .btn-lock {
+ background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%);
+ }
+
+ .btn-disabled {
+ opacity: 0.5;
+ pointer-events: none;
+ }
+
+ .row-bar {
+ padding: 20rpx;
+ background: #f8f9fa;
+ border-top: 1rpx solid #e9ecef;
+ }
+
+ .btn-group-row {
+ display: flex;
+ gap: 20rpx;
+ }
+
+ .btn-unlock-row, .btn-lock-row {
+ flex: 1;
+ height: 88rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 12rpx;
+ gap: 12rpx;
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ }
+
+ .btn-unlock-row {
+ background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
+ }
+
+ .btn-lock-row {
+ background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%);
+ }
+
+ .plt-options {
+ display: flex;
+ gap: 20rpx;
+ margin-top: 20rpx;
+ }
+
+ .plt-option {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 12rpx;
+ padding: 24rpx;
+ border: 2rpx solid #e0e0e0;
+ border-radius: 12rpx;
+ background: #ffffff;
+ transition: all 0.3s;
+ }
+
+ .plt-option.selected {
+ border-color: #667eea;
+ background: #f0f4ff;
+ }
+
+ .plt-text {
+ font-size: 30rpx;
+ color: #333333;
+ font-weight: 500;
+ }
+
+ .popup-btn.disabled {
+ opacity: 0.5;
+ pointer-events: none;
+ }
+</style>
--
Gitblit v1.9.1