From 7ebd84a4ad1f6561f450d5e92d987d22924d59ec Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期二, 04 一月 2022 13:35:12 +0800
Subject: [PATCH] 回复

---
 src/views/your/area-manage/areaManage.vue                   |    7 +
 src/views/your/car-manage/carManage.vue                     |   21 ++++-
 src/views/your/carRepairCost-manage/carRepairCostManage.vue |    5 
 src/views/your/suggest-manage/suggestManage.vue             |  119 ++++++++++++++++++-----------
 src/api/open.js                                             |   15 +++
 src/views/your/carInfo-manage/carInfoManage.vue             |   43 ++++------
 6 files changed, 129 insertions(+), 81 deletions(-)

diff --git a/src/api/open.js b/src/api/open.js
index 11c8f3f..19a99c0 100644
--- a/src/api/open.js
+++ b/src/api/open.js
@@ -117,6 +117,11 @@
     return getRequest('/user/getAll', params)
 }
 
+// 鏌ヨ鍙告満淇℃伅
+export const getDriver = (params) => {
+    return getRequest('/user/findByType2', params)
+}
+
 // 鏌ヨ鐗囧尯淇℃伅
 export const getArea = (params) => {
     return getRequest('/area/getByPage', params)
@@ -206,3 +211,13 @@
 export const getInfo = (params) => {
     return getRequest('/car/getInfo', params)
 }
+
+// 鏍规嵁杞﹁締鐕冩补璐圭敤缁翠慨璐圭敤
+export const getCarCount = (params) => {
+    return getRequest('/pcStatistic2/getCarCount', params)
+}
+
+//娣诲姞鍔犳补璁板綍
+export const editSuggest = (params) => {
+    return postRequest('/suggest/insertOrUpdate', params)
+}
\ No newline at end of file
diff --git a/src/views/your/area-manage/areaManage.vue b/src/views/your/area-manage/areaManage.vue
index 2277c71..2b8be6b 100644
--- a/src/views/your/area-manage/areaManage.vue
+++ b/src/views/your/area-manage/areaManage.vue
@@ -277,6 +277,7 @@
   addCar,
   getCarList,
   getUser,
+  getDriver,
   addArea,
   deleteArea,
   getAreaSection,
@@ -600,7 +601,9 @@
       data2: [],
       data3: [],
       total: 0,
-
+      type: {
+        type : 1
+      },
       total2: 0,
       permData: [],
       editRolePermId: "",
@@ -706,7 +709,7 @@
       });
     },
     getAllUser(){
-      getUser().then((res)=>{
+      getDriver(this.type).then((res)=>{
         if (res.success){
           this.userList=res.result;
         }
diff --git a/src/views/your/car-manage/carManage.vue b/src/views/your/car-manage/carManage.vue
index ff427d3..d6ddb11 100644
--- a/src/views/your/car-manage/carManage.vue
+++ b/src/views/your/car-manage/carManage.vue
@@ -87,7 +87,7 @@
         </FormItem>
         <FormItem label="璺熻溅浜�" prop="followUserId">
           <Select v-model="carForm.followUserId" filterable>
-            <Option v-for="item in userList" :value="item.id" :key="item.id">{{ item.nickname }}</Option>
+            <Option v-for="item in driverList" :value="item.id" :key="item.id">{{ item.nickname }}</Option>
           </Select>
         </FormItem>
       </Form>
@@ -243,6 +243,7 @@
   getEquipment,
   addEquipment,
   getUser,
+  getDriver,
   deleteEquipment,
 } from "@/api/open";
 import util from "@/libs/util.js";
@@ -280,6 +281,9 @@
       carForm: {
         status : 0
       },
+      type: {
+        type : 0
+      },
       equipmentForm: {
         status : 0
       },
@@ -307,7 +311,7 @@
         {
           title: "杞︾墝鍙�",
           key: "carNo",
-          width: 100,
+          width: 110,
           sortable: true,
         },
         {
@@ -592,6 +596,7 @@
       depData: [],
       dataType: 0,
       carId: '',
+      driverList: [],
       userList: [],
       editDepartments: [],
       buyYear:''
@@ -662,9 +667,15 @@
       this.getDataList();
     },
     getAllUser(){
-      getUser().then((res)=>{
+      getDriver(this.type).then((res)=>{
         if (res.success){
           this.userList=res.result;
+        }
+      });
+      this.type.type=1;
+      getDriver(this.type).then((res)=>{
+        if (res.success){
+          this.driverList=res.result;
         }
       });
     },
@@ -735,7 +746,7 @@
               if (res.success) {
                 this.$Message.success("鎿嶄綔鎴愬姛");
                 this.getDataList();
-                this.roleModalVisible = false;
+                this.roleModalVisible = true;
               }
             });
           } else {
@@ -745,7 +756,7 @@
               if (res.success) {
                 this.$Message.success("鎿嶄綔鎴愬姛");
                 this.getDataList();
-                this.roleModalVisible = false;
+                this.roleModalVisible = true;
               }
             });
           }
diff --git a/src/views/your/carInfo-manage/carInfoManage.vue b/src/views/your/carInfo-manage/carInfoManage.vue
index bf40a19..6328033 100644
--- a/src/views/your/carInfo-manage/carInfoManage.vue
+++ b/src/views/your/carInfo-manage/carInfoManage.vue
@@ -290,9 +290,24 @@
             }
           },
           {
+            title: "閫佽揣鎴锋暟",
+            key: "oilWear",
+            width: 130,
+          },
+          {
+            title: "閫佽揣閲�(浠�)",
+            key: "oilWear",
+            width: 130,
+          },
+          {
             title: "鏈堟补鑰�(鍗�)",
             key: "oilWear",
             width: 130,
+          },
+          {
+            title: "鏈堢噧娌硅垂(鍏�)",
+            key: "money",
+            width: 140,
           },
           {
             title: "鐧惧叕閲屾补鑰�",
@@ -314,32 +329,6 @@
             render: (h, params) => {
               return h("div",params.row.car.nickName);
             }
-          },
-          {
-            title: "鏈堝姞娌归噾棰�(鍏�)",
-            key: "money",
-            width: 140,
-          },
-          {
-            title: "鎿嶄綔",
-            key: "action",
-            align: "center",
-            width: 120,
-            render: (h, params) => {
-              return h("div", [
-                h(
-                  "a",
-                  {
-                    on: {
-                      click: () => {
-                        this.remove(params.row);
-                      },
-                    },
-                  },
-                  "鍒犻櫎"
-                ),
-              ]);
-            },
           },
         ],
         data: [],
@@ -465,7 +454,7 @@
           this.loading = false;
           if (res.success) {
             this.data = res.result;
-            this.total = res.result.length;
+            this.total = res.result[0].total;
           }
         });
       },
diff --git a/src/views/your/carRepairCost-manage/carRepairCostManage.vue b/src/views/your/carRepairCost-manage/carRepairCostManage.vue
index 30cd7a9..5523ff9 100644
--- a/src/views/your/carRepairCost-manage/carRepairCostManage.vue
+++ b/src/views/your/carRepairCost-manage/carRepairCostManage.vue
@@ -51,7 +51,6 @@
                 show-total
                 show-elevator
                 show-sizer
-                v-show="this.page"
         ></Page>
       </Row>
     </Card>
@@ -242,7 +241,7 @@
           {
             title: "杞︾墝鍙�",
             key: "carNo",
-            width: 100,
+            width: 110,
             align: "center",
           },
           {
@@ -513,7 +512,7 @@
           this.loading = false;
           if (res.success) {
             this.data = res.result;
-            this.total = res.result.length;
+            this.total = res.result.total;
           }
         });
       },
diff --git a/src/views/your/suggest-manage/suggestManage.vue b/src/views/your/suggest-manage/suggestManage.vue
index ccb4ae3..8c2757e 100644
--- a/src/views/your/suggest-manage/suggestManage.vue
+++ b/src/views/your/suggest-manage/suggestManage.vue
@@ -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" :key="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: "",
@@ -233,6 +201,9 @@
         },
         addOilForm: {
           status : 0
+        },
+        replyForm: {
+          status : 1
         },
         removeForm: {
           status : 1
@@ -256,11 +227,6 @@
             align: "center",
           },
           {
-            title: "鎰忚鍒嗙被",
-            key: "title",
-            width: 150,
-          },
-          {
             title: "鍐呭",
             key: "content",
             tooltip:true,
@@ -281,11 +247,32 @@
             width: 260,
           },
           {
+            title: "鍥炲鍐呭",
+            key: "replyContent",
+            tooltip:true,
+            width: 260,
+          },
+          {
             title: "鎿嶄綔",
             key: "action",
             align: "center",
             render: (h, params) => {
               return h("div", [
+                h(
+                  "a",
+                  {
+                    on: {
+                      click: () => {
+                        this.reply(params.row);
+                      },
+                    },
+                  },
+                  "鍥炲"
+                ),h("Divider", {
+                  props: {
+                    type: "vertical",
+                  },
+                }),
                 h(
                   "a",
                   {
@@ -535,6 +522,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 = {
@@ -652,6 +654,35 @@
           }
         });
       },
+      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;
+                }
+              });
+            }
+          }
+        });
+      },
       submitPermEdit() {
         this.submitPermLoading = true;
         let permIds = "";

--
Gitblit v1.9.1