From a0654f2c21511a0e16b977427a563a3ccdfd1fba Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期二, 14 三月 2023 15:34:06 +0800
Subject: [PATCH] 搜索bug

---
 src/views/your/suggest-manage/suggestManage.vue |  166 ++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 110 insertions(+), 56 deletions(-)

diff --git a/src/views/your/suggest-manage/suggestManage.vue b/src/views/your/suggest-manage/suggestManage.vue
index 8994f67..6ead1ef 100644
--- a/src/views/your/suggest-manage/suggestManage.vue
+++ b/src/views/your/suggest-manage/suggestManage.vue
@@ -12,9 +12,9 @@
           openTip ? "鍏抽棴鎻愮ず" : "寮�鍚彁绀�"
           }}</Button>
         <Input
-                v-model="searchForm.content"
+                v-model="searchForm2.content"
                 suffix="ios-search"
-                @on-change="getDataList"
+                @on-change="getDataList2"
                 placeholder="杈撳叆鍙嶉鍐呭鎼滅储"
                 clearable
                 style="width: 250px"
@@ -52,49 +52,15 @@
     </Card>
 
     <!-- 缂栬緫 -->
-    <Modal
-            :title="modalTitle"
-            v-model="roleModalVisible"
-            :mask-closable="false"
-            :width="500"
-    >
-      <Form
-              ref="addOilForm"
-              :model="addOilForm"
-              :label-width="80"
-              :rules="addOilFormValidate"
-      >
-        <FormItem label="杞﹁締" prop="carId">
-            <Select v-model="addOilForm.carId" filterable>
-              <Option v-for="item in carList" :value="item.id">{{ item.carNo }}</Option>
-            </Select>
-        </FormItem>
-        <Form-item label="鍔犳补鏃ユ湡" prop="addDate">
-          <Row>
-            <Col span="11">
-              <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" v-model="addOilForm.addDate"></Date-picker>
-            </Col>
-          </Row>
-        </Form-item>
-        <FormItem label="鍔犳补閲�" prop="amount">
-          <Input v-model="addOilForm.amount" type="number"/>
-        </FormItem>
-        <FormItem label="鍗曚环" prop="unitPrice">
-          <Input v-model="addOilForm.unitPrice" type="number"/>
-        </FormItem>
-        <FormItem label="鍔犳补閲戦" prop="money">
-          <Input v-model="addOilForm.money" type="number"/>
-        </FormItem>
-        <FormItem label="鍔犳补鏃堕噷绋�" prop="mileage">
-          <Input v-model="addOilForm.mileage" type="number"/>
-        </FormItem>
-        <FormItem label="澶囨敞" prop="remarks">
-          <Input v-model="addOilForm.remarks" />
+    <Modal :title="modalTitle" v-model="suggestVisible" :mask-closable="false" :width="500">
+      <Form ref="replyForm" :model="replyForm" :label-width="80" :rules="equipmentFormValidate">
+        <FormItem label="鍥炲鍐呭" prop="replyContent">
+          <Input v-model="replyForm.replyContent" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="璇疯緭鍏ュ洖澶嶅唴瀹�..."></Input>
         </FormItem>
       </Form>
       <div slot="footer">
         <Button type="text" @click="carRole">鍙栨秷</Button>
-        <Button type="primary" :loading="submitLoading" @click="submitAddOil"
+        <Button type="primary" :loading="submitLoading" @click="submitReplay"
         >鎻愪氦</Button
         >
       </div>
@@ -200,6 +166,7 @@
     deleteCar,
     getSuggest,
     deleteSuggest,
+    editSuggest,
   } from "@/api/open";
   import util from "@/libs/util.js";
   export default {
@@ -220,6 +187,7 @@
         modalType: 0,
         roleModalVisible: false,
         carModalVisible: false,
+        suggestVisible:false,
         permModalVisible: false,
         depModalVisible: false,
         modalTitle: "",
@@ -231,8 +199,19 @@
           order: "desc", // 榛樿鎺掑簭鏂瑰紡
           key: "",
         },
+        searchForm2: {
+          // 鎼滅储妗嗗垵濮嬪寲瀵硅薄
+          pageNumber: 1, // 褰撳墠椤垫暟
+          pageSize: 10, // 椤甸潰澶у皬
+          sort: "createTime", // 榛樿鎺掑簭瀛楁
+          order: "desc", // 榛樿鎺掑簭鏂瑰紡
+          key: "",
+        },
         addOilForm: {
           status : 0
+        },
+        replyForm: {
+          status : 1
         },
         removeForm: {
           status : 1
@@ -245,43 +224,64 @@
         submitLoading: false,
         selectList: [],
         columns: [
-          {
-            type: "selection",
-            width: 60,
-            align: "center",
-          },
+          // {
+          //   type: "selection",
+          //   width: 60,
+          //   align: "center",
+          // },
           {
             type: "index",
             width: 60,
             align: "center",
           },
           {
-            title: "鎰忚鍒嗙被",
-            key: "title",
-            width: 150,
-          },
-          {
             title: "鍐呭",
             key: "content",
-            width: 200,
+            tooltip:true,
+            width: 230,
           },
           {
             title: "鍙嶉鏃堕棿",
             key: "createTime",
-            width: 240,
-            sortable: true,
+            width: 130,
+            render: (h, params) => {
+              return h("div",params.row.createTime.substr(0,10));
+            }
           },
           {
             title: "鍙嶉鍟嗘埛",
             key: "name",
-            width: 150,
+            tooltip:true,
+            width: 260,
+          },
+          {
+            title: "鍥炲鍐呭",
+            key: "replyContent",
+            tooltip:true,
+            width: 300,
           },
           {
             title: "鎿嶄綔",
             key: "action",
             align: "center",
+            width: 150,
             render: (h, params) => {
               return h("div", [
+                h(
+                  "a",
+                  {
+                    on: {
+                      click: () => {
+                        this.reply(params.row);
+                      },
+                    },
+                  },
+                  "鍥炲"
+                ),h("Divider", {
+                  props: {
+                    type: "vertical",
+                  },
+                }),
                 h(
                   "a",
                   {
@@ -384,6 +384,16 @@
       getDataList() {
         this.loading = true;
         getSuggest(this.searchForm).then((res) => {
+          this.loading = false;
+          if (res.success) {
+            this.data = res.result.records;
+            this.total = res.result.total;
+          }
+        });
+      },
+      getDataList2() {
+        this.loading = true;
+        getSuggest(this.searchForm2).then((res) => {
           this.loading = false;
           if (res.success) {
             this.data = res.result.records;
@@ -531,6 +541,21 @@
           },
         });
       },
+      reply(v) {
+
+        this.modalType = 1;
+        this.modalTitle = "鍥炲";
+        // 杞崲null涓�""
+        for (let attr in v) {
+          if (v[attr] == null) {
+            v[attr] = "";
+          }
+        }
+        let str = JSON.stringify(v);
+        let roleInfo = JSON.parse(str);
+        this.replyForm = roleInfo;
+        this.suggestVisible = true;
+      },
       setDefault(v) {
         this.loading = true;
         let params = {
@@ -645,6 +670,35 @@
           e.checked = select;
           if (e.children && e.children.length > 0) {
             that.selectedTreeAll(e.children, select);
+          }
+        });
+      },
+      submitReplay(v){
+        this.$refs.replyForm.validate((valid) => {
+          this.replyForm.status=1;
+          if (valid) {
+            if (this.modalType == 0) {
+              // 娣诲姞
+              this.submitLoading = true;
+              editSuggest(this.replyForm).then((res) => {
+                this.submitLoading = false;
+                if (res.success) {
+                  this.$Message.success("鎿嶄綔鎴愬姛");
+                  this.getDataList();
+                  this.suggestVisible = false;
+                }
+              });
+            } else {
+              this.submitLoading = true;
+              editSuggest(this.replyForm).then((res) => {
+                this.submitLoading = false;
+                if (res.success) {
+                  this.$Message.success("鎿嶄綔鎴愬姛");
+                  this.getDataList();
+                  this.suggestVisible = false;
+                }
+              });
+            }
           }
         });
       },
@@ -809,4 +863,4 @@
       this.init();
     },
   };
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.9.1