From 76c30727c77065c808b1c0fb3146080e423e5fe6 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 27 六月 2024 09:45:30 +0800
Subject: [PATCH] 测试完成

---
 src/views/knowledge/questionnaire/index.vue |  166 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 113 insertions(+), 53 deletions(-)

diff --git a/src/views/knowledge/questionnaire/index.vue b/src/views/knowledge/questionnaire/index.vue
index e4c3562..21d4429 100644
--- a/src/views/knowledge/questionnaire/index.vue
+++ b/src/views/knowledge/questionnaire/index.vue
@@ -29,7 +29,7 @@
         >
           <span class="custom-tree-node" slot-scope="{ node, data }">
             <span>{{ node.label }}</span>
-            <span>
+            <span v-if="data.id > 0">
               <el-button
                 type="text"
                 icon="el-icon-delete"
@@ -37,6 +37,17 @@
                 size="mini"
                 @click="() => remove(node, data)"
               >
+              </el-button>
+            </span>
+            <span v-if="data.id > 0">
+              <el-button
+                type="text"
+                circle
+                size="mini"
+                @click="() => altertag(node, data)"
+                ><span class="button-textxg"
+                  ><i class="el-icon-edit-outline"></i
+                ></span>
               </el-button>
             </span>
           </span>
@@ -66,13 +77,21 @@
                   @keyup.enter.native="handleQuery"
                 />
               </el-form-item>
-              <el-form-item label="閫傜敤绉戝" prop="sickness">
+              <el-form-item label="閫傜敤绉戝" prop="region">
                 <el-cascader
-                  v-model="queryParams.sickness"
-                  :options="editableTabs"
-                  :props="propss"
+                  v-model="queryParams.administrative"
+                  :options="deptList"
+                  :props="props"
+                  :show-all-levels="false"
                   clearable
-                ></el-cascader>
+                >
+                  <template slot-scope="{ node, data }">
+                    <span>{{ data.deptName }}</span>
+                    <span v-if="!node.isLeaf">
+                      ({{ data.children.length }})
+                    </span>
+                  </template>
+                </el-cascader>
               </el-form-item>
               <el-form-item label="閫氱煡鍐呭" prop="userName">
                 <el-input
@@ -172,12 +191,14 @@
               <el-table-column type="selection" width="50" align="center" />
               <el-table-column
                 label="搴忓彿"
+                fixed
                 align="center"
                 key="svyid"
                 prop="svyid"
               />
               <el-table-column
                 label="闂嵎鏍囬"
+                fixed
                 align="center"
                 key="svyname"
                 prop="svyname"
@@ -199,7 +220,7 @@
                 prop="description"
                 width="260"
               /><el-table-column
-                label="閫傜敤鐤剧梾(缂�)"
+                label="閫傜敤鐤剧梾"
                 align="center"
                 key="Applicable"
                 prop="Applicable"
@@ -216,33 +237,22 @@
                   >
                 </template>
               </el-table-column>
+
               <el-table-column
-                label="閫傜敤绉戝(缂�)"
+                label="鏍囩"
                 align="center"
-                key="administrative"
-                prop="administrative"
-                width="120"
-              />
-              <el-table-column
-                label="鏍囩(缂�)"
-                align="center"
-                key="tagList"
-                prop="tagList"
+                key="labelInfo"
+                prop="labelInfo"
                 width="160"
                 :show-overflow-tooltip="true"
               >
                 <template slot-scope="scope">
-                  <span v-for="item in scope.row.tagList">{{ item }} </span>
+                  <span v-for="item in scope.row.labelInfo.split(',')"
+                    >{{ item }}銆�
+                  </span>
                 </template>
               </el-table-column>
 
-              <el-table-column
-                label="璧勬枡褰㈠紡(缂�)"
-                align="center"
-                key="cphonenumaber"
-                prop="cphonenumaber"
-                width="120"
-              />
               <el-table-column
                 label="鍙敤"
                 align="center"
@@ -264,6 +274,7 @@
 
               <el-table-column
                 label="鎿嶄綔"
+                fixed="right"
                 align="center"
                 width="300"
                 class-name="small-padding fixed-width"
@@ -336,21 +347,18 @@
             <el-option
               v-for="item in deptOptions"
               :key="item.id"
-              :label="item.indexAssortName"
+              :label="item.name"
               :value="item.id"
             >
             </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="璇疯緭鍏ョ被鍒悕绉�">
-          <el-input
-            v-model="classifyform.indexAssortName"
-            autocomplete="off"
-          ></el-input>
+          <el-input v-model="classifyform.name" autocomplete="off"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button>
+        <el-button @click="getDeptTree()">鍙� 娑�</el-button>
         <el-button type="primary" @click="submitsidecolumn">纭� 瀹�</el-button>
       </div>
     </el-dialog>
@@ -408,7 +416,12 @@
         <div class="qrcode-text">
           {{ namequestionnaire }}<span>{{ haoquestionnaire }}</span>
         </div>
-        <div class="qrcode-img"></div>
+        <div class="qrcode-img">
+          <el-image
+            src="D:/qrcode/fc9a1fa37e394ac3ac606bf6b77b17c3"
+            fit="cover"
+          ></el-image>
+        </div>
       </div>
     </el-dialog>
   </div>
@@ -421,6 +434,7 @@
   getQtemplateclassify,
   delQtemplateclassify,
   addQtemplateclassify,
+  editQtemplateclassify,
   getQtemplatelist,
   issueinfo,
   compileissue,
@@ -431,7 +445,10 @@
   getillnesslist,
   illnesslistget,
   getillness,
+  getQRcode,
 } from "@/api/AiCentre/index";
+import { listDept } from "@/api/system/dept";
+
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -455,6 +472,7 @@
       total: 0,
       namequestionnaire: "",
       haoquestionnaire: "",
+      QRcodeurl: "",
       // 鐢ㄦ埛琛ㄦ牸鏁版嵁
       userList: [],
 
@@ -485,9 +503,11 @@
       illnesslistapi: [],
       illnesslist: [],
       defaultProps: {
-        children: "svyLibTopicCategoryList",
-        label: "indexAssortName",
+        children: "svyLibTitleCategoryList",
+        label: "name",
       },
+      deptList: [],
+      props: { multiple: true, value: "deptId", label: "deptName" },
       mode: [],
       languagelist: [],
       qyoptions: [],
@@ -505,7 +525,7 @@
   watch: {},
   created() {
     this.getList();
-    // this.getDeptTree();
+    this.getDeptTree();
     this.mode = store.getters.mode;
     this.languagelist = store.getters.languagelist;
     this.qyoptions = store.getters.usable;
@@ -521,9 +541,18 @@
         this.total = response.total;
         this.loading = false;
       });
+      listDept(this.queryParams).then((response) => {
+        this.deptList = this.handleTree(response.data, "deptId");
+      });
     },
 
     goQRCode(row) {
+      getQRcode({
+        url: "/outsideChain?param1=KHRYDSSuTpwGWDhAS6OnpfxObRZf8fd/TIagYWPvDuyku+MjtrWt1efC1htoBDc+G4QP2UOWPNitAO4TwH4oIQ==&param2=CP/xYqwqDhWACt2aQ/HOwhgRM62Lh4/1upwYDl7dmKSuiaa4zRzMgu7rmRztiwQj2YvJ1KAX1zBTpUAIdxPvUA==",
+      }).then((res) => {
+        console.log(res);
+        this.QRcodeurl = "D:/qrcode/fc9a1fa37e394ac3ac606bf6b77b17c3";
+      });
       this.goQRCodeVisible = true;
       this.namequestionnaire = row.userName;
       this.haoquestionnaire = row.nickName;
@@ -666,38 +695,49 @@
     getDeptTree() {
       getQtemplateclassify({}).then((res) => {
         this.deptOptions = res.rows;
-        console.log(res);
+        this.dialogFormVisible = false;
       });
     },
 
     // 娣诲姞绫诲埆鏍�
     submitsidecolumn() {
+      if (this.classifyform.id) {
+        editQtemplateclassify(this.classifyform).then((res) => {
+          this.getDeptTree();
+          this.$modal.msgSuccess("淇敼鎴愬姛");
+          this.classifyform = {};
+          this.dialogFormVisible = false;
+        });
+        return;
+      }
       let calssvalue = {};
       if (
         this.classifyform.pid &&
-        this.classifyform.indexAssortName &&
+        this.classifyform.name &&
         this.radio == "瀛愬垎绫�"
       ) {
         const index = this.deptOptions.findIndex(
           (obj) => obj.id == this.classifyform.pid
         );
         calssvalue = this.deptOptions[index];
-        calssvalue.ivrLibaTemplateAssortList.push(this.classifyform);
-      } else if (this.radio == "涓诲垎绫�" && this.classifyform.indexAssortName) {
+        calssvalue.svyLibTitleCategoryList.push(this.classifyform);
+      } else if (this.radio == "涓诲垎绫�" && this.classifyform.name) {
         this.classifyform.pid = null;
-        this.classifyform.ivrLibaTemplateAssortList = [];
+        this.classifyform.svyLibTitleCategoryList = [];
       } else {
         return this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
       }
       addQtemplateclassify(this.classifyform).then((res) => {
         this.getDeptTree();
         this.$modal.msgSuccess("鏂板鎴愬姛");
+        this.classifyform = {};
+        this.dialogFormVisible = false;
       });
     },
     remove(a, b) {
       if (b.pid) {
         this.$modal
-          .confirm('鏄惁纭鍒犻櫎鍒嗙被椤逛负"' + b.indexAssortName + '"鐨勬暟鎹」锛�')
+          .confirm('鏄惁纭鍒犻櫎鍒嗙被椤逛负"' + b.name + '"鐨勬暟鎹」锛�')
           .then(function () {
             return delQtemplateclassify(b.id);
           })
@@ -709,9 +749,7 @@
       } else {
         this.$modal
           .confirm(
-            '鏄惁纭鍒犻櫎涓�绾у垎绫�"' +
-              b.indexAssortName +
-              '"锛熷垹闄ゅ悗鍏朵笅鍒嗙被灏嗗綊绫烩�樻湭鍒嗙被鈥�'
+            '鏄惁纭鍒犻櫎涓�绾у垎绫�"' + b.name + '"锛熷垹闄ゅ悗鍏朵笅鍒嗙被灏嗗綊绫烩�樻湭鍒嗙被鈥�'
           )
           .then(() => {
             return delQtemplateclassify(b.id);
@@ -723,11 +761,21 @@
           .catch(() => {});
       }
     },
+    altertag(a, b) {
+      this.dialogFormVisible = true;
+      if (!b.pid) {
+        this.radio = "涓诲垎绫�";
+      } else {
+        this.radio = "瀛愬垎绫�";
+      }
+      this.classifyform = b;
+      this.dialogFormVisible = true;
+    },
 
     // 绛涢�夎妭鐐�
     filterNode(value, data) {
       if (!value) return true;
-      return data.indexAssortName.indexOf(value) !== -1;
+      return data.name.indexOf(value) !== -1;
     },
     handleNodeClick(data) {
       this.queryParams.assortid = data.id;
@@ -771,13 +819,7 @@
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
-    /** 鏂板鎸夐挳鎿嶄綔 */
-    handleAdd() {
-      this.$router.push({
-        path: "/knowledge/verbaltrick/particulars/",
-        query: { id: "1" },
-      });
-    },
+
 
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
@@ -809,7 +851,7 @@
   margin-top: 20px;
   margin: 20px;
   padding: 30px;
-  background: #edf1f7;
+  background: #fff;
   border: 1px solid #dcdfe6;
   -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
     0 0 6px 0 rgba(0, 0, 0, 0.04);
@@ -925,6 +967,24 @@
   font-size: 20px;
   cursor: pointer;
 }
+::v-deep .el-tree {
+  position: relative;
+  cursor: default;
+  border-radius: 5px;
+  background: #eff8fe;
+  color: #606266;
+  border: 1px solid #bbe1fa;
+  // border: 1px solid #dcdfe6;
+  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
+    0 0 6px 0 rgba(0, 0, 0, 0.04);
+}
+::v-deep
+  .el-tree--highlight-current
+  .el-tree-node.is-current
+  > .el-tree-node__content {
+  background-color: #7799fb;
+  color: #fff;
+}
 ::v-deep .el-button--mini.is-circle {
   padding: 7px;
   margin: 0;

--
Gitblit v1.9.3