From 51ce81df657be1e2eb5cfd8f21ebe731d8d3444b Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 21 七月 2023 10:29:14 +0800
Subject: [PATCH] 后台配置相关

---
 src/views/service/serviceFollowup/AddServiceFollowupDialog.vue |  250 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 168 insertions(+), 82 deletions(-)

diff --git a/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue b/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue
index 55dfdfa..352ffbf 100644
--- a/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue
+++ b/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue
@@ -22,23 +22,23 @@
           <div class="basic-info-view">
             <el-row>
               <el-col :span="12">
-                <el-form-item label="瀹㈡埛鍚嶇О" prop="customName">
+                <el-form-item label="瀹㈡埛鍚嶇О" prop="clientId">
                   <div class="custom-name">
-                    <el-input v-model="editConfig.infomation.customName"></el-input>
+                    <el-input v-model="editConfig.infomation.clientId"></el-input>
                     <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div>
                     <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div>
                   </div>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鍥炶鍗曠紪鍙�" prop="followupNumber">
-                  <el-input v-model="editConfig.infomation.followupNumber"></el-input>
+                <el-form-item label="鍥炶鍗曠紪鍙�" prop="number">
+                  <el-input v-model="editConfig.infomation.number"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鑱旂郴浜哄鍚�" prop="contactName">
+                <el-form-item label="鑱旂郴浜哄鍚�" prop="contactId">
                   <div class="custom-name">
-                    <el-input v-model="editConfig.infomation.contactName"></el-input>
+                    <el-input v-model="editConfig.infomation.contactId"></el-input>
                     <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div>
                     <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div>
                   </div>
@@ -54,17 +54,17 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鍥炶浜�" prop="visitor">
-                  <el-select v-model="editConfig.infomation.visitor" size="mini">
-                    <el-option v-for="item in visitorOptions" :key="item.value" :label="item.label" :value="item.value">
+                <el-form-item label="鍥炶浜�" prop="memberId">
+                  <el-select v-model="editConfig.infomation.memberId" size="mini">
+                    <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="椤圭洰璁″垝" prop="projectPlan">
+                <el-form-item label="椤圭洰璁″垝" prop="planId">
                   <div class="custom-name">
-                    <el-input v-model="editConfig.infomation.projectPlan"></el-input>
+                    <el-input v-model="editConfig.infomation.planId"></el-input>
                     <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div>
                     <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div>
                   </div>
@@ -72,39 +72,74 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="婊℃剰搴�" prop="satisfaction">
-                  <CommonSelectView
-                    :common-value="editConfig.infomation.satisfaction"
-                    :common-options="satisfactionOptions"
-                  />
+                  <div class="common-select">
+                    <el-select
+                      v-model="editConfig.infomation.satisfaction"
+                      placeholder="璇烽�夋嫨"
+                      class="common-select-sel"
+                      size="mini"
+                    >
+                      <el-option v-for="item in satisfactionOptions" :key="item.id" :label="item.name" :value="item.id">
+                      </el-option>
+                    </el-select>
+                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
+                  </div>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="鍙婃椂鐜�" prop="timelyRate">
-                  <CommonSelectView
-                    :common-value="editConfig.infomation.timelyRate"
-                    :common-options="satisfactionOptions"
-                  />
+                  <div class="common-select">
+                    <el-select
+                      v-model="editConfig.infomation.timelyRate"
+                      placeholder="璇烽�夋嫨"
+                      class="common-select-sel"
+                      size="mini"
+                    >
+                      <el-option v-for="item in timelyRateOptions" :key="item.id" :label="item.name" :value="item.id">
+                      </el-option>
+                    </el-select>
+                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
+                  </div>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="瑙e喅鐜�" prop="resolveRate">
-                  <CommonSelectView
-                    :common-value="editConfig.infomation.resolveRate"
-                    :common-options="satisfactionOptions"
-                  />
+                <el-form-item label="瑙e喅鐜�" prop="solveRate">
+                  <div class="common-select">
+                    <el-select
+                      v-model="editConfig.infomation.solveRate"
+                      placeholder="璇烽�夋嫨"
+                      class="common-select-sel"
+                      size="mini"
+                    >
+                      <el-option v-for="item in solveRateOptions" :key="item.id" :label="item.name" :value="item.id">
+                      </el-option>
+                    </el-select>
+                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
+                  </div>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鍘熸湇鍔′汉鍛�" prop="originServicePerson">
-                  <el-select v-model="editConfig.infomation.originServicePerson" size="mini">
-                    <el-option v-for="item in visitorOptions" :key="item.value" :label="item.label" :value="item.value">
+                <el-form-item label="鍘熸湇鍔′汉鍛�" prop="oldMemberId">
+                  <el-select v-model="editConfig.infomation.oldMemberId" size="mini">
+                    <el-option v-for="item in oldMemberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鏈嶅姟浜哄憳鏄惁鏉ヨ繃" prop="haveBeen">
-                  <CommonSelectView :common-value="editConfig.infomation.haveBeen" :common-options="haveBeenOptions" />
+                <el-form-item label="鏈嶅姟浜哄憳鏄惁鏉ヨ繃" prop="isVisit">
+                  <div class="common-select">
+                    <el-select
+                      v-model="editConfig.infomation.isVisit"
+                      placeholder="璇烽�夋嫨"
+                      class="common-select-sel"
+                      size="mini"
+                    >
+                      <el-option v-for="item in isVisitOptions" :key="item.id" :label="item.name" :value="item.id">
+                      </el-option>
+                    </el-select>
+                    <div class="common-select-btn"><i class="el-icon-setting"></i></div>
+                  </div>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -114,12 +149,12 @@
           <div class="basic-info-view">
             <el-row>
               <el-col :span="24">
-                <el-form-item label="澶囨敞" prop="notes">
+                <el-form-item label="澶囨敞" prop="remark">
                   <el-input
                     type="textarea"
                     :autosize="{ minRows: 2, maxRows: 4 }"
                     placeholder="璇疯緭鍏ュ唴瀹�"
-                    v-model="editConfig.infomation.notes"
+                    v-model="editConfig.infomation.remark"
                   ></el-input>
                 </el-form-item>
               </el-col>
@@ -156,7 +191,7 @@
       </el-form>
 
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" size="small" @click="editConfig.visible = false">淇濆瓨</el-button>
+        <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
         <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
       </div>
     </el-dialog>
@@ -164,7 +199,8 @@
 </template>
 
 <script>
-import CommonSelectView from "@/components/makepager/CommonSelectView"
+import { getAllData } from "@/api/client/client"
+import { getAddServiceFollowup, getUpdateServiceFollowup } from "@/api/serviceManage/serviceFollowup"
 export default {
   name: "AddServiceFollowupDialog",
   props: {
@@ -174,25 +210,12 @@
         return {
           visible: false,
           title: "鏂板缓",
-          infomation: {
-            customName: "",
-            followupNumber: "HF21",
-            contactName: "",
-            customServiceForm: "",
-            visitor: "",
-            projectPlan: "",
-            satisfaction: "",
-            timelyRate: "",
-            resolveRate: "",
-            originServicePerson: "",
-            haveBeen: "",
-            notes: ""
-          }
+          infomation: {}
         }
       }
     }
   },
-  components: { CommonSelectView },
+  components: {},
   computed: {
     searchCommonHeight() {
       return this.$refs.searchCommonView.offsetHeight
@@ -203,20 +226,96 @@
       dialogWidth: "80%",
       editConfig: this.editCommonConfig,
       rules: {
-        followupNumber: [{ required: true, message: "璇疯緭鍏ュ洖璁垮崟鍗曠紪鍙�", trigger: "blur" }],
-        visitor: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
+        number: [{ required: true, message: "璇疯緭鍏ュ洖璁垮崟鍗曠紪鍙�", trigger: "blur" }],
+        memberId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
       },
-      satisfactionOptions: [], // 婊℃剰搴� 鍙婃椂鐜� 瑙e喅鐜�
-      haveBeenOptions: [], // 鏈嶅姟浜哄憳鏄惁鏉ヨ繃
-      visitorOptions: [
-        // 鍥炶浜�
-        { value: "1", label: "绯荤粺绠$悊鍛�" },
-        { value: "2", label: "閿�鍞�荤洃" }
-      ]
+      satisfactionOptions: [], // 婊℃剰搴�
+      timelyRateOptions: [], // 鍙婃椂鐜�
+      solveRateOptions: [], // 瑙e喅鐜�
+      oldMemberOptions: [], // 鍘熸湇鍔′汉鍛�
+      isVisitOptions: [], // 鏈嶅姟浜哄憳鏄惁鏉ヨ繃
+      memberOptions: []
     }
   },
-  created() {},
+  created() {
+    this.getCommonData()
+  },
   methods: {
+    getCommonData() {
+      getAllData()
+        .then((res) => {
+          this.memberOptions = res.data.member
+        })
+        .catch((err) => {
+          console.log(err)
+        })
+    },
+    // 淇濆瓨
+    saveClick(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          console.log(this.editConfig.infomation)
+          const params = this.saveParams()
+          console.log(params)
+          if (this.editConfig.title === "鏂板缓") {
+            getAddServiceFollowup(params)
+              .then((res) => {
+                console.log(res)
+                this.editConfig.visible = false
+                if (res.code === 200) {
+                  this.$message({
+                    message: "娣诲姞鎴愬姛",
+                    type: "success"
+                  })
+                  this.$parent.getData()
+                }
+              })
+              .catch((err) => {
+                console.log(err)
+              })
+          } else {
+            getUpdateServiceFollowup(params)
+              .then((res) => {
+                console.log(res)
+                this.editConfig.visible = false
+                if (res.code === 200) {
+                  this.$message({
+                    message: "缂栬緫鎴愬姛",
+                    type: "success"
+                  })
+                  this.$parent.getData()
+                }
+              })
+              .catch((err) => {
+                console.log(err)
+              })
+          }
+        } else {
+          console.log("error submit")
+          return false
+        }
+      })
+    },
+    saveParams() {
+      let data = this.editConfig.infomation
+      let params = {
+        id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
+        clientId: data.clientId || 0,
+        contactId: data.contactId || 0,
+        file: data.file || "",
+        isVisit: data.isVisit || 0,
+        memberId: data.memberId || 0,
+        number: data.number || "",
+        oldMemberId: data.oldMemberId || 0,
+        planId: data.planId || 0,
+        remark: data.remark || "",
+        satisfaction: data.satisfaction || 0,
+        serviceId: data.serviceId || 0,
+        solveRate: data.solveRate || 0,
+        timelyRate: data.timelyRate || 0
+      }
+      return params
+    },
     handleClose() {
       this.editConfig.visible = false
     },
@@ -251,10 +350,17 @@
           font-size: 18px;
         }
       }
-    }
-    .address-view {
-      margin-top: 10px;
-      padding-right: 40px;
+      .common-select {
+        display: flex;
+        .common-select-sel {
+          width: 270px;
+        }
+        .common-select-btn {
+          margin-left: 5px;
+          font-size: 16px;
+          cursor: pointer;
+        }
+      }
     }
     .annex-view {
       display: flex;
@@ -275,26 +381,6 @@
     background-color: #f5f5f5;
     height: 55px;
     line-height: 55px;
-  }
-}
-::v-deep {
-  .el-dialog__header {
-    padding: 12.5px 10px;
-    border-bottom: 1px solid #e5e5e5;
-    .el-dialog__title {
-      font-size: 15px;
-      color: #323232;
-      font-weight: bold;
-    }
-  }
-  .el-dialog__body {
-    padding: 0px;
-  }
-  .el-dialog__footer {
-    padding: 0px;
-    text-align: center;
-    box-sizing: border-box;
-    border-top: 1px solid #dadee5;
   }
 }
 </style>

--
Gitblit v1.8.0