From 43909f06f66a4d162ce06ac32e17955f5e446b4a Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期五, 02 二月 2024 11:15:14 +0800
Subject: [PATCH] 修改-配瓦规则设置、配瓦规则

---
 jcdm-ui/src/views/main/cfkb/tileMatchKb/index.vue  |  260 ++++++++++++++++++++++++++++++++++++++--------------
 jcdm-ui/src/views/main/da/tileMatchRules/index.vue |    2 
 2 files changed, 191 insertions(+), 71 deletions(-)

diff --git a/jcdm-ui/src/views/main/cfkb/tileMatchKb/index.vue b/jcdm-ui/src/views/main/cfkb/tileMatchKb/index.vue
index 4f7bed1..d868e24 100644
--- a/jcdm-ui/src/views/main/cfkb/tileMatchKb/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/tileMatchKb/index.vue
@@ -1,67 +1,119 @@
 <template>
   <div class="app-container">
-    <div style="height: 100%;width: 100%">
+    <div style="width: 100%">
       <el-card class="box-card" >
-        <el-form :model="queryParams" ref="queryForm" :inline="true" >
-          <el-form-item  label="杞村悕绉�:" prop="axisName" >
-            <el-input
-              style="width: 160px"
-              v-model="queryParams.axisName"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item  label="棰堝悕绉�:" prop="neckName" >
-            <el-input
-              style="width: 160px"
-              v-model="queryParams.neckName"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item  label="鐡﹀悕绉�:" prop="tileName" >
-            <el-input
-              style="width: 160px"
-              v-model="queryParams.tileName"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-        </el-form>
-      </el-card>
-        <el-col :span="20">
-      <el-card class="box-card" >
-        <el-form :model="queryParams" ref="queryForm" :inline="true" >
+        <el-form :model="from" ref="queryForm" :inline="true" >
           <el-form-item label="绠变綋鐮�:" prop="scanObject1" >
             <el-input
-              style=""
-              v-model="queryParams.scanObject1"
+              style="width: 350px"
+              v-model="from.scanObject1"
               placeholder="璇疯緭鍏ョ浣撶爜"
               clearable
               @keyup.enter.native="handleQuery"
+              @input="handleQuery"
             />
           </el-form-item>
           <el-form-item label="鏇茶酱鐮�:" prop="scanObject2" >
             <el-input
-              style=""
-              v-model="queryParams.scanObject2"
+              style="width: 350px"
+              v-model="from.scanObject2"
               placeholder="璇疯緭鍏ユ洸杞寸爜"
               clearable
               @keyup.enter.native="handleQuery"
+              @input="handleQuery"
             />
           </el-form-item>
         </el-form>
-      </el-card>
-        </el-col>
-        <el-col :span="4">
-          <el-card class="box-card" >
-          <el-form :model="queryParams" ref="queryForm" :inline="true" >
-          <el-form-item style="margin-left: 1%">
-            <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">鏌ヨ</el-button>
+        <el-form :model="from" ref="queryForm" :inline="true" >
+          <el-form-item  label="鏈哄瀷:" prop="productSeries" >
+            <el-select v-model="from.productSeries" placeholder="璇烽�夋嫨鏈哄瀷" clearable   style="width: 120px">
+              <el-option
+
+                v-for="dict in dict.type.productseries"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-select>
           </el-form-item>
-          </el-form>
-          </el-card>
-        </el-col>
+          <el-form-item  label="杞村悕绉�:" prop="axisName" >
+            <el-select v-model="from.axisName" placeholder="璇烽�夋嫨杞村悕绉�" clearable style="width: 135px">
+              <el-option
+                v-for="dict in dict.type.axisname"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item  label="棰堝悕绉�:" prop="neckName" >
+            <el-select v-model="from.neckName" placeholder="璇烽�夋嫨棰堝悕绉�" clearable style="width: 135px">
+              <el-option
+                v-for="dict in dict.type.neckname"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item  label="鐡﹀悕绉�:" prop="tileName" >
+            <el-select v-model="from.tileName" placeholder="璇烽�夋嫨鐡﹀悕绉�" clearable style="width: 135px" >
+            <el-option
+              v-for="dict in dict.type.tilename"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+              @keyup.enter.native="handleQuery"
+            />
+            </el-select>
+          </el-form-item>
+          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">鏌ヨ</el-button>
+        </el-form>
+      </el-card>
+<!--        <el-col :span="20">-->
+<!--      <el-card class="box-card" >-->
+<!--        <el-form :model="queryParams" ref="queryForm" :inline="true" >-->
+<!--          <el-form-item label="绠变綋鐮�:" prop="scanObject1" >-->
+<!--            <el-input-->
+<!--              style=""-->
+<!--              v-model="queryParams.scanObject1"-->
+<!--              placeholder="璇疯緭鍏ョ浣撶爜"-->
+<!--              clearable-->
+<!--              @keyup.enter.native="handleQuery"-->
+<!--            />-->
+<!--          </el-form-item>-->
+<!--          <el-form-item label="鏇茶酱鐮�:" prop="scanObject2" >-->
+<!--            <el-input-->
+<!--              style=""-->
+<!--              v-model="queryParams.scanObject2"-->
+<!--              placeholder="璇疯緭鍏ユ洸杞寸爜"-->
+<!--              clearable-->
+<!--              @keyup.enter.native="handleQuery"-->
+<!--            />-->
+<!--          </el-form-item>-->
+<!--          <el-form-item  label="鏈哄瀷:" prop="productSeries" >-->
+<!--            <el-input-->
+<!--              style="width: 160px"-->
+<!--              v-model="queryParams.productSeries"-->
+<!--              clearable-->
+<!--              @keyup.enter.native="handleQuery"-->
+<!--            />-->
+<!--          </el-form-item>-->
+<!--        </el-form>-->
+<!--      </el-card>-->
+<!--        </el-col>-->
+<!--        <el-col :span="4">-->
+<!--          <el-card class="box-card" >-->
+<!--          <el-form :model="queryParams" ref="queryForm" :inline="true" >-->
+<!--          <el-form-item style="margin-left: 1%">-->
+
+<!--          </el-form-item>-->
+<!--          </el-form>-->
+<!--          </el-card>-->
+<!--        </el-col>-->
 
       <el-col :span="24" >
         <el-card class="bottom-card">
@@ -88,8 +140,11 @@
             <el-descriptions-item label="鐡﹀悕绉�">
               <span>{{queryParams.tileName}}</span>
             </el-descriptions-item>
+            <el-descriptions-item label="閲嶉噺">
+              <span>{{queryParams.weight}}</span>
+            </el-descriptions-item>
             <el-descriptions-item label="閰嶇摝棰滆壊">
-              <span :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span>
+              <span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span>
             </el-descriptions-item>
           </el-descriptions>
           <el-divider></el-divider>
@@ -103,7 +158,7 @@
 import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
 export default {
   name: "index",
-  dicts: ['colour_hex'],
+  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
   components: {
     VueQr,
   },
@@ -113,15 +168,16 @@
       tileMatchKbList: [],
       qrCode: '',
       // 鏌ヨ鍙傛暟
-      queryParams: {
+      from:{
         pageNum: 1,
         pageSize: 10,
         productSeries: null,
-        scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA',
+        scanObject1: null,
+        // scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA',
         scanObject2: 'P0SQ0-041000-1002;T2312020675;DAABBA;S500003',
-        axisName: '涓棿涓昏酱瀛�',
-        neckName: '涓棿涓昏酱棰�',
-        tileName: '涓績涓昏酱鐡�',
+        axisName: null,
+        neckName: null,
+        tileName: null,
         axisParameterNoPosition: null,
         neckParameterPosition: null,
         axisValue: null,
@@ -130,42 +186,93 @@
         createUser: null,
         updateUser: null,
         state: null,
+        weight: null,
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        productSeries: null,
+        scanObject1: null,
+        // scanObject1: 'P0SQ0-01FZ01-1000;T231224116;DBBBBA',
+        scanObject2: null,
+        axisName: null,
+        neckName: null,
+        tileName: null,
+        axisParameterNoPosition: null,
+        neckParameterPosition: null,
+        axisValue: null,
+        neckValue: null,
+        tileColor: null,
+        createUser: null,
+        updateUser: null,
+        state: null,
+        weight: null,
       },
     }
   },
   methods:{
-
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
-      this.axisValueextracted();
-      this.neckValueextracted();
-      this.productSeriesextracted();
-      this.getList();
-      this.$message(response.row.tileColor)
+      this.clear();
+
+      if(this.from.scanObject1 !== null && this.from.scanObject2 !== null
+        && this.from.axisName !== null && this.from.axisName !== ""
+        && this.from.neckName !== null && this.from.neckName !== ""
+        && this.from.tileName !== null && this.from.tileName !== ""
+        && this.from.productSeries !== null && this.from.productSeries !== "")
+      {
+        this.axisValueextracted();
+        this.neckValueextracted();
+        if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
+          this.insetFromToQueryParams();
+          this.getList();
+        }
+        else{
+          const h = this.$createElement;
+          this.$message({
+            message: h('p',null, [
+              h('span', null, '璀﹀憡 '),
+              h('i', { style: 'color: black' }, '绠变綋鐮佹垨鏇茶酱鐮佽緭鍏ユ湁璇�'),
+              h()]),
+            type: 'error',
+            center: true,
+            offset:300
+          });
+        }
+      }
+      else{
+        const h = this.$createElement;
+        this.$message({
+          message: h('p',null, [
+            h('span', null, '璀﹀憡 '),
+            h('i', { style: 'color: black' }, '璇峰~鍐欐墍鏈夋悳绱㈡潯浠�'),
+            h()]),
+          type: 'error',
+          center: true,
+          offset:300
+        });
+      }
     },
+
+    // 鍙栫浣撶爜绗笁娈典负閰嶇摝鍊�
     axisValueextracted() {
-      // 鍙栫浣撶爜绗笁娈典负閰嶇摝鍊�
-      const parts1 = this.queryParams.scanObject1.split(";");
+      const parts1 = this.from.scanObject1.split(";");
       if (parts1.length >= 3) {
         const axisValueextracted = parts1[2].substring(3,4);
         return this.queryParams.axisValue= axisValueextracted;
+
       }
     },
+
+    //鍙栨洸杞寸爜绗笁娈典负閰嶇摝鍊�
     neckValueextracted() {
-      //鍙栨洸杞寸爜绗笁娈典负閰嶇摝鍊�
-      const parts2 = this.queryParams.scanObject2.split(";");
+      const parts2 = this.from.scanObject2.split(";");
       if (parts2.length >= 3) {
         const neckValueextracted = parts2[2].substring(3,4);
         return this.queryParams.neckValue= neckValueextracted;
       }
     },
-    productSeriesextracted() {
-    const parts3 =this.queryParams.scanObject2.split(";");
-    if(parts3.length >= 3) {
-    const productSeriesextracted = parts3[0].substring(1, 5);
-    return this.queryParams.productSeries = productSeriesextracted;
-        }
-    },
+    //鍙栭厤鐡﹂鑹�
     getList() {
       let queryParams = {
         productSeries : this.queryParams.productSeries,
@@ -180,7 +287,20 @@
         this.queryParams.tileColor = response.rows[0].tileColor;
       });
     },
-},
+    clear(){
+      this.queryParams.axisValue=null;
+      this.queryParams.neckValue=null;
+    },
+    insetFromToQueryParams(){
+      this.queryParams.productSeries=this.from.productSeries;
+      this.queryParams.axisName=this.from.axisName;
+      this.queryParams.neckName=this.from.neckName;
+      this.queryParams.tileName=this.from.tileName;
+      this.queryParams.scanObject1=this.from.scanObject1;
+      this.queryParams.scanObject2=this.from.scanObject2;
+    }
+
+  },
 }
 </script>
 
diff --git a/jcdm-ui/src/views/main/da/tileMatchRules/index.vue b/jcdm-ui/src/views/main/da/tileMatchRules/index.vue
index 3812ffb..104eb91 100644
--- a/jcdm-ui/src/views/main/da/tileMatchRules/index.vue
+++ b/jcdm-ui/src/views/main/da/tileMatchRules/index.vue
@@ -118,7 +118,7 @@
         </el-table-column>
         <el-table-column label="鐡﹂鑹�" align="center" prop="tileColor" >
           <template slot-scope="scope">
-            <dict-tag :options="dict.type.colour_hex" :value="scope.row.tileColor" :style="{ backgroundColor: scope.row.tileColor }"/>
+            <dict-tag :options="dict.type.colour_hex" :value="scope.row.tileColor" style="color: #FFFFFF;" :style="{ backgroundColor: scope.row.tileColor }"/>
           </template>
         </el-table-column>
 <!--        <el-table-column label="鍒涘缓鐢ㄦ埛" align="center" prop="createUser">-->

--
Gitblit v1.9.3