From 619b47962e41f506baf7ce2b535b2de1fecc719e Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期四, 19 六月 2025 10:58:49 +0800
Subject: [PATCH] rfid扫描添加原生插件

---
 pages/modal/form/index.vue |   74 +++++++++++++-----------------------
 1 files changed, 27 insertions(+), 47 deletions(-)

diff --git a/pages/modal/form/index.vue b/pages/modal/form/index.vue
index 1d2c903..bb650e4 100644
--- a/pages/modal/form/index.vue
+++ b/pages/modal/form/index.vue
@@ -1,5 +1,5 @@
 <template>
-	<view class="uni-page-modal-form">
+	<view class="uni-page-modal-form" :class="largeMode?'large-mode':''">
 		<view class="view-content">
 			<!-- 琛ㄥご鏍峰紡 -->
 			<OIForm ref="refBaseForm" class="v-head-style" :form="head_styledef.form" :focusId="focusFieldId"
@@ -7,7 +7,7 @@
 				@on-click-suffix="classAttr_extButton"></OIForm>
 		</view>
 		<view class="view-bottom">
-			<button type="primary" @tap="onClickOk" class="btn_add" :class="okLoading?'btn_disabled':''"
+			<button type="primary" @tap="ok" class="btn_add" :class="okLoading?'btn_disabled':''"
 				:disabled="okLoading">{{translateSys('ok')}}</button>
 			<button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button>
 
@@ -43,7 +43,7 @@
 <script>
 	import {
 		Base64
-	} from  '@/js/Base64.js';
+	} from '@/js/Base64.js';
 	import {
 		dictGetInfo
 	} from "@/api/mobox.js"
@@ -56,16 +56,15 @@
 	} from "@/api/data.js"
 	import dayjs from "dayjs";
 	import OIForm from '@/components/oi-form/index.vue'
-	import buttonClickMixin from '@/mixins/button-click.js';
 
 	export default {
 		name: "PageModalForm",
-		mixins: [buttonClickMixin],
 		components: {
 			OIForm
 		},
 		data() {
 			return {
+					largeMode: getApp().globalData.largeMode || false,
 				okLoading: false,
 				title: this.translateSys('add2'),
 				type: '',
@@ -294,6 +293,25 @@
 									}
 								}
 							}
+						}
+						const app = getApp()
+						if (app.globalData.bindClasses) {
+							styledefHead.form.items.push({
+								name: "Input",
+								label: this.translate("classes"),
+								labelWidth: 100,
+								disabled: true,
+								value: app.globalData.classes,
+								setting: {
+									width: 100,
+									height: 50,
+								},
+								bind: {
+									attr: "",
+								},
+								fieldId: "S_CLASSES",
+							})
+							styledefHead.form.model["S_CLASSES"] = app.globalData.classes
 						}
 
 					}
@@ -531,8 +549,8 @@
 				//console.log(e.target)
 				this.focusOldFieldId = item.fieldId
 				getApp().onScan((result) => {
-					console.log(result.decodedata);
-					item.value = result.decodedata;
+					console.log(result);
+					item.value = result;
 					var $this = this;
 					let newVal = item.value.trim()
 					if (newVal) {
@@ -902,7 +920,6 @@
 
 					//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹� 				})
-				console.log(head_styledef)
 				this.setData({
 					head_styledef: head_styledef
 				})
@@ -1461,12 +1478,6 @@
 					});
 				});
 			},
-			onClickOK() {
-				this.handleButtonClick(async (done) => {
-					await this.ok()
-					done(); // 閲嶇疆鐘舵�
-				});
-			},
 			//纭畾
 			async ok() {
 				try {
@@ -1475,6 +1486,7 @@
 						mask: true
 					});
 					this.okLoading = true
+					console.log(obj_attr)
 					var obj_attr = this.head_styledef.form.model || {};
 					console.log(obj_attr)
 					let ret = await this.sava();
@@ -1490,6 +1502,7 @@
 
 					uni.navigateBack()
 				} catch (ex) {
+					this.okLoading = true
 					return false;
 				}
 			},
@@ -1844,39 +1857,6 @@
 			flex-direction: column;
 		}
 
-		.v-head-style {
-			width: 98%;
-
-			.uni-forms-item {
-				margin-bottom: 11rpx;
-			}
-
-			.input-wrapper {
-				border: 1px solid #d5d5d5;
-				width: 100%;
-				display: flex;
-				flex-direction: row;
-
-				.uni-input {
-					flex: 1;
-					padding: 12rpx 8rpx;
-					color: #2d8cf0;
-					// height: 40rpx;
-					// line-height: 40rpx;
-				}
-
-				.uni-icon {
-
-					padding: 10rpx 5rpx;
-					font-size: 32rpx;
-					color: rgb(192, 196, 204);
-				}
-			}
-
-			.input-wrapper:hover {
-				border: 1px solid rgb(41, 121, 255);
-			}
-		}
 
 		.view-content {
 			display: flex;

--
Gitblit v1.9.1