From 4d53e153221c0f31c3defce1589d1d92dbaee7f9 Mon Sep 17 00:00:00 2001
From: gaoluyang <gaoluyang@rengu.cc>
Date: 星期四, 04 七月 2024 09:39:30 +0800
Subject: [PATCH] 表格支持输入^字符

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 4e3ceb3..9e6591a 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -301,7 +301,8 @@
                   <template v-if="n.v.ps!=undefined && n.v.ps.value==='妫�楠屽��' && state==1">
                     <el-input v-if="getInspectionValueType(n.i) == 1" class="table_input" v-model="n.v.v"
                       :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
-                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)" type="number" @mousewheel.native.prevent :key="'abc-'+'000'+index+'000'+i+'000'+j">
+                              @input="handleInput(n)"
+                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)" @mousewheel.native.prevent :key="'abc-'+'000'+index+'000'+i+'000'+j">
                       <el-button slot="append" type="primary" icon="el-icon-edit" size="mini"
                         v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button>
                     </el-input>
@@ -866,7 +867,7 @@
           }
           let list = await this.getCurrentProduct(this.currentSample.id,0)
           this.currentSample.insProduct = this.HaveJson(list)
-          console.log(this.currentSample)
+          // console.log(this.currentSample)
           this.currentSample.insProduct.forEach(a => {
             this.param[a.id] = {
               insValue: [],
@@ -1484,7 +1485,6 @@
               }
             }
           })
-          console.log(5555,a.template)
           // return
           ids.forEach(id => {
             for (let b = 0; b < a.template.length; b++) {
@@ -1651,7 +1651,6 @@
         let id = str[0]
         let pId = str[3]
         var list = []
-        // console.log(id, 'r', r , 'c',c,this.tableList)
         for (let a in this.tableList) {
           if (this.tableList[a].templateId == id) {
             list = this.tableList[a].arr
@@ -1991,6 +1990,9 @@
         }
         return sum
       },
+      handleInput (n) {
+        n.v.v = n.v.v.replace(/[^\d.^]/g, '');
+      },
       getInspectionItemType(id) {
         for (var a in this.currentSample.insProduct) {
           if (this.currentSample.insProduct[a].id == id) {
@@ -2019,14 +2021,14 @@
             }
           })
         } catch (e) {
-          console.log(e);
+          // console.log(e);
           this.$message.error('鎵句笉鍒拌澶囧唴瀹�')
         }
-        console.log(n, code);
+        // console.log(n, code);
         fetch('http://localhost:82/寰俊鍥剧墖_20240518100811.png').then(res=>res.blob()).then(blob=>{
-          console.log(blob);
+          // console.log(blob);
           const url = URL.createObjectURL(blob)
-          console.log(url);
+          // console.log(url);
         })
         /* this.$message.error('閲囬泦澶辫触銆愬凡寮�鏀炬墜鍔ㄦ柟寮忋��')
         for (var a in this.currentSample.insProduct) {

--
Gitblit v1.9.3