From da245c6f1995c5668866184d8068794c27622f62 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 24 九月 2025 11:05:20 +0800
Subject: [PATCH] 首检,巡检,入库检的数值判断
---
pages/QC/RKJ/detail.vue | 24 ++++++-
pages/QC/SJ/detail.vue | 22 ++++++
CLAUDE.md | 77 +++++++++++++++++--------
.claude/settings.local.json | 3
pages/QC/XJ/detail.vue | 24 ++++++-
5 files changed, 113 insertions(+), 37 deletions(-)
diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index 948cd55..38b29b1 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -2,7 +2,8 @@
"permissions": {
"allow": [
"Bash(git add:*)",
- "Bash(git push:*)"
+ "Bash(git push:*)",
+ "Bash(git commit:*)"
],
"deny": []
}
diff --git a/CLAUDE.md b/CLAUDE.md
index a7e52b7..b018fbb 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -4,33 +4,39 @@
## Project Overview
-This is a **uni-app** mobile application project for Quality Control (QC) and Warehouse management in a Manufacturing Execution System (MES). The application is built for PDA devices and supports quality inspection processes and warehouse operations.
+This is a **uni-app** mobile application project for Quality Control (QC) and Warehouse management in a Manufacturing
+Execution System (MES). The application is built for PDA devices and supports quality inspection processes and warehouse
+operations.
- **Framework**: uni-app (Vue 2.x based)
-- **App Name**: GS-MES-AP (骞挎繁绉戞妧 MES Application)
+- **App Name**: GS-MES-AP (骞挎繁绉戞妧 MES Application)
- **Target Platform**: Android mobile/PDA devices
- **UI Framework**: uView UI library
## Build and Development Commands
-This is a uni-app project that builds through HBuilderX IDE or uni-app CLI. The build output is generated in the `unpackage/` directory:
+This is a uni-app project that builds through HBuilderX IDE or uni-app CLI. The build output is generated in the
+`unpackage/` directory:
- **Development Build**: Use HBuilderX IDE or `npm run dev:app-plus` for development
- **Production Build**: APK files are generated in `unpackage/release/apk/`
- **Cache**: Build cache and temporary files are stored in `unpackage/cache/`
- **Testing**: Use HBuilderX IDE's built-in testing tools or deploy to PDA devices for testing
-**Note**: This project does not have traditional npm scripts. Development and building are primarily done through HBuilderX IDE.
+**Note**: This project does not have traditional npm scripts. Development and building are primarily done through
+HBuilderX IDE.
## Architecture Overview
### Core Structure
+
- **Entry Point**: `main.js` - Contains Vue prototypes, global mixins, and API configuration
- **State Management**: `store/index.js` - Vuex store with server configuration and minimal state
- **Routing**: `pages.json` - uni-app page configuration with tabBar navigation
- **Global Config**: `manifest.json` - App configuration including permissions and build settings
### Key Directories
+
- `pages/BasePages/` - Core app pages (login, main menu, user profile)
- `pages/QC/` - Quality Control modules (鏉ユ枡妫�楠� LLJ, 宸℃ XJ, 棣栨 SJ, 鍏ュ簱妫� RKJ)
- `pages/Warehouse/` - Warehouse operations (inventory, purchasing, allocation)
@@ -39,84 +45,103 @@
- `uni_modules/` - uni-app plugin modules including uView UI
### API Architecture
+
- **Base API**: Configured in Vuex store with environment-specific URLs
- **Request Methods**: Custom Vue prototypes (`$post`, `$get`, `$uni_request`) with loading states
- **Authentication**: User login state managed globally via `$loginInfo`
- **Error Handling**: Centralized error handling with toast messages
### Main Features
+
1. **Quality Control (QC)**:
- - 鏉ユ枡妫�楠� (LLJ) - Incoming Material Inspection
- - 宸℃ (XJ) - Patrol Inspection
- - 棣栨 (SJ) - First Article Inspection
- - 鍏ュ簱妫� (RKJ) - Warehouse Inspection
+ - 鏉ユ枡妫�楠� (LLJ) - Incoming Material Inspection
+ - 宸℃ (XJ) - Patrol Inspection
+ - 棣栨 (SJ) - First Article Inspection
+ - 鍏ュ簱妫� (RKJ) - Warehouse Inspection
2. **Warehouse Operations**:
- - Purchase inventory management
- - Material allocation and transfers
- - Barcode printing and scanning
+ - Purchase inventory management
+ - Material allocation and transfers
+ - Barcode printing and scanning
3. **Common Functions**:
- - Barcode/QR code scanning
- - Photo capture and upload
- - Bluetooth printing integration
- - Offline data synchronization
+ - Barcode/QR code scanning
+ - Photo capture and upload
+ - Bluetooth printing integration
+ - Offline data synchronization
### Navigation Structure
-- **Tab Bar**: 3 main tabs (棣栭〉/Home, 娑堟伅涓績/Message Center, 鎴戠殑/Profile)
+
+- **Tab Bar**: 2 main tabs (棣栭〉/Home, 鎴戠殑/Profile) - Message Center tab is commented out
- **Menu System**: Dynamic menu loading based on user permissions via `$getUserMenu()`
- **Page Flow**: List 鈫� Detail 鈫� Form pattern for most workflows
## Development Guidelines
### Server Configuration
+
The app connects to different servers based on environment:
-- Development: `http://localhost:10054` or `http://192.168.1.104:10056/api`
-- Check `store/index.js` for current active server endpoints
+
+- Current active: `http://192.168.1.104:10056/api` (configured in store/index.js)
+- Internal network: `http://192.168.11.251:10054`
+- Local development: `http://localhost:10054`
+- Testing: `http://192.168.1.104:10057/api`
+- Switch between environments by updating `serverAPI` in the Vuex store
### Global Utilities
+
- `$showMessage()` - Display toast notifications
-- `$showDialog()` - Show confirmation dialogs
+- `$showDialog()` - Show confirmation dialogs
- `$camera()` - Camera/photo selection functionality
- `$getDate()` - Date formatting utilities
- `$getUrlParams()` - URL parameter parsing
### Component Dependencies
+
- **uView UI**: Primary UI component library
- **Custom Components**: Scanner, printer utilities in `components/kk-printer/`
- **Third-party**: Charts (u-charts), maps (amap), markdown parsing
### File Upload System
-Image uploads use base64 encoding via `$fileUpload()` method, sending to `/Base/saveImage` endpoint.
+
+Image uploads use base64 encoding via `$fileUpload()` method, sending to `/Base/saveImage` endpoint. The `$camera()`
+method handles photo capture with optional automatic upload via the `isUpload` parameter.
### Authentication System
+
- User authentication is managed through `$loginInfo` object in `main.js`
- Login state persists using `uni.getStorageSync()` and `uni.setStorageSync()`
- Global mixin `globalMixin.js` provides `checkUserAuth()` for automatic login verification
- Users are redirected to `/pages/BasePages/login` if not authenticated
### Request Architecture
+
- **$post()** and **$get()**: Standard API requests with automatic loading indicators
- **$uni_request()**: Core request method with error handling and status checking
- **$toERP()**: External ERP system integration requests
- **$postSyncPost()**: Promise-based synchronous POST requests
+- **$uni_requestNew()**: Alternative request method for external API calls
- All requests automatically handle loading states, error messages, and network failures
### Hardware Integration
+
- **Camera**: Native camera access via `$camera()` with image compression options
- **Barcode Scanner**: QR/barcode scanning capabilities for PDA devices
- **Bluetooth Printing**: Printer integration through `components/kk-printer/`
- **Device Permissions**: Configured in `manifest.json` for camera, storage, network, and Bluetooth access
### Page Architecture Patterns
+
- **List Pages**: Pagination with pull-to-refresh and infinite scroll
- **Detail Pages**: Read-only view with navigation to edit forms
- **Add/Edit Forms**: Input validation and submission with photo upload capabilities
- **Scan Pages**: Barcode scanning with immediate data processing
-### Environment Configuration
-Current server endpoints are configured in `store/index.js`:
-- **Development**: `http://localhost:5184/api`
-- **Internal Network**: `http://192.168.11.251:10054`
-- **Testing**: `http://192.168.1.104:10056/api` or `10057/api`
-- Switch between environments by updating `serverAPI` in the Vuex store
\ No newline at end of file
+### Important Development Notes
+
+- **Vue Version**: Uses Vue 2.x (configured in manifest.json)
+- **Build Platform**: Primarily targets Android PDA devices with specific hardware permissions
+- **State Persistence**: User data persists using uni.getStorageSync/setStorageSync
+- **Error Handling**: Network failures clear local storage and redirect to login
+- **Image Processing**: Base64 encoding with PNG format prefix for uploads
+- **Hardware Modules**: Camera, Barcode scanning, and Bluetooth printing are configured in manifest.json
\ No newline at end of file
diff --git a/pages/QC/RKJ/detail.vue b/pages/QC/RKJ/detail.vue
index 09257d2..4c1bff2 100644
--- a/pages/QC/RKJ/detail.vue
+++ b/pages/QC/RKJ/detail.vue
@@ -311,8 +311,16 @@
return;
}
- if (this.formData.fcheckResu >= this.formData.minValue && this.formData.fcheckResu <= this.formData
- .maxValue) {
+ let checkValue = Number(this.formData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
+
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
+
+ if (checkValue >= minValue && checkValue <= maxValue) {
fstand = "鈭�"
} else {
fstand = "脳";
@@ -399,8 +407,16 @@
return;
}
- if (this.editData.fcheckResu >= this.formData.minValue && this.editData.fcheckResu <= this.formData
- .maxValue) {
+ let checkValue = Number(this.editData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
+
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
+
+ if (checkValue >= minValue && checkValue <= maxValue) {
this.editData.isPass = 1
} else {
this.editData.isPass = 0
diff --git a/pages/QC/SJ/detail.vue b/pages/QC/SJ/detail.vue
index b8fc3ea..3aa38be 100644
--- a/pages/QC/SJ/detail.vue
+++ b/pages/QC/SJ/detail.vue
@@ -299,7 +299,16 @@
return;
}
- if (this.formData.fcheckResu >= this.formData.minValue && this.formData.fcheckResu <= this.formData.maxValue) {
+ let checkValue = Number(this.formData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
+
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
+
+ if (checkValue >= minValue && checkValue <= maxValue) {
fstand = "鈭�"
} else {
fstand = "脳";
@@ -393,7 +402,16 @@
return;
}
- if (this.editData.fcheckResu >= this.formData.minValue && this.editData.fcheckResu <= this.formData.maxValue) {
+ let checkValue = Number(this.editData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
+
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
+
+ if (checkValue >= minValue && checkValue <= maxValue) {
this.editData.isPass = 1
} else {
this.editData.isPass = 0
diff --git a/pages/QC/XJ/detail.vue b/pages/QC/XJ/detail.vue
index 82571cc..18782b3 100644
--- a/pages/QC/XJ/detail.vue
+++ b/pages/QC/XJ/detail.vue
@@ -299,8 +299,16 @@
return;
}
- if (this.formData.fcheckResu >= this.formData.minValue && this.formData.fcheckResu <= this.formData
- .maxValue) {
+ let checkValue = Number(this.formData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
+
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
+
+ if (checkValue >= minValue && checkValue <= maxValue) {
fstand = "鈭�"
} else {
fstand = "脳";
@@ -385,8 +393,16 @@
return;
}
- if (this.editData.fcheckResu >= this.formData.minValue && this.editData.fcheckResu <= this.formData
- .maxValue) {
+ let checkValue = Number(this.editData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
+
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
+
+ if (checkValue >= minValue && checkValue <= maxValue) {
this.editData.isPass = 1
} else {
this.editData.isPass = 0
--
Gitblit v1.9.3