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/orderManage/AddOrderManageDialog.vue |  225 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 153 insertions(+), 72 deletions(-)

diff --git a/src/views/service/orderManage/AddOrderManageDialog.vue b/src/views/service/orderManage/AddOrderManageDialog.vue
index 048a9a7..35f5062 100644
--- a/src/views/service/orderManage/AddOrderManageDialog.vue
+++ b/src/views/service/orderManage/AddOrderManageDialog.vue
@@ -22,54 +22,70 @@
           <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="orderNumber">
-                  <el-input v-model="editConfig.infomation.orderNumber"></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="orderName">
-                  <el-input v-model="editConfig.infomation.orderName"></el-input>
+                <el-form-item label="宸ュ崟鍚嶇О" prop="name">
+                  <el-input v-model="editConfig.infomation.name"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="宸ュ崟绫诲瀷" prop="orderType">
-                  <CommonSelectView
-                    :common-value="editConfig.infomation.orderType"
-                    :common-options="orderTypeOptions"
-                  />
+                  <div class="common-select">
+                    <el-select
+                      v-model="editConfig.infomation.orderType"
+                      placeholder="璇烽�夋嫨"
+                      class="common-select-sel"
+                      size="mini"
+                    >
+                      <el-option v-for="item in orderTypeOptions" :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="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>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鎶ヤ慨鏉ユ簮" prop="repairSource">
-                  <CommonSelectView
-                    :common-value="editConfig.infomation.repairSource"
-                    :common-options="repairSourceOptions"
-                  />
+                <el-form-item label="鎶ヤ慨鏉ユ簮" prop="reportSourceId">
+                  <div class="common-select">
+                    <el-select
+                      v-model="editConfig.infomation.reportSourceId"
+                      placeholder="璇烽�夋嫨"
+                      class="common-select-sel"
+                      size="mini"
+                    >
+                      <el-option v-for="item in reportSourceOptions" :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="selSourceOrder">
-                  <el-select v-model="editConfig.infomation.selSourceOrder" size="mini">
+              <!-- <el-col :span="12">
+                <el-form-item label="閫夋嫨婧愬崟" prop="sourceSheet">
+                  <el-select v-model="editConfig.infomation.sourceSheet" size="mini">
                     <el-option
-                      v-for="item in selSourceOrderOptions"
+                      v-for="item in sourceSheetOptions"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
@@ -77,7 +93,7 @@
                     </el-option>
                   </el-select>
                 </el-form-item>
-              </el-col>
+              </el-col> -->
             </el-row>
           </div>
           <!-- 闂鎻忚堪 -->
@@ -85,12 +101,12 @@
           <div class="basic-info-view">
             <el-row>
               <el-col :span="24">
-                <el-form-item label="闂鎻忚堪" prop="problemDesc">
+                <el-form-item label="闂鎻忚堪" prop="problemDescription">
                   <el-input
                     type="textarea"
                     :autosize="{ minRows: 2, maxRows: 4 }"
                     placeholder="璇疯緭鍏ュ唴瀹�"
-                    v-model="editConfig.infomation.problemDesc"
+                    v-model="editConfig.infomation.problemDescription"
                   ></el-input>
                 </el-form-item>
               </el-col>
@@ -102,8 +118,21 @@
             <el-row>
               <el-col :span="12">
                 <el-form-item label="闄勪欢" prop="">
+                  <template slot="label">
+                    <div style="display: flex; float: right">
+                      <div style="font-size: 16px">
+                        <i class="el-icon-warning-outline" title="鏈�澶氫笂浼�20涓檮浠讹紝鏈�澶ч檺鍒�5MB"></i>
+                      </div>
+                      <span style="margin-left: 5px">闄勪欢</span>
+                    </div>
+                  </template>
                   <div class="annex-view">
-                    <div @click="addAnnexClick">娣诲姞</div>
+                    <div @click="addAnnexClick">
+                      <div style="display: flex; float: right">
+                        <div style="font-size: 16px"><i class="el-icon-paperclip"></i></div>
+                        <span>娣诲姞</span>
+                      </div>
+                    </div>
                     <div class="setFormat" @click="setFormatClick">璁剧疆鍏佽涓婁紶鐨勬枃浠舵牸寮�</div>
                   </div>
                 </el-form-item>
@@ -111,7 +140,7 @@
             </el-row>
           </div>
           <!-- 閫夋嫨瀹℃壒娴佺▼ -->
-          <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div>
+          <!-- <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div>
           <div class="basic-info-view">
             <el-row>
               <el-col :span="20">
@@ -149,13 +178,13 @@
                 </el-form-item>
               </el-col>
             </el-row>
-          </div>
+          </div> -->
         </div>
       </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="editConfig.visible = false">淇濆瓨</el-button>
+        <!-- <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>
@@ -163,7 +192,8 @@
 </template>
 
 <script>
-import CommonSelectView from "@/components/makepager/CommonSelectView"
+import { getAllData } from "@/api/client/client"
+import { getAddOrderManage, getUpdateOrderManage } from "@/api/serviceManage/orderManage"
 export default {
   name: "AddOrderManageDialog",
   props: {
@@ -173,25 +203,12 @@
         return {
           visible: false,
           title: "鏂板缓",
-          infomation: {
-            customName: "",
-            orderNumber: "AC6521",
-            orderName: "",
-            orderType: "",
-            contactName: "",
-            repairSource: "",
-            selSourceOrder: "",
-            problemDesc: "",
-            approvalWorkflow: "",
-            approvalSteps: "",
-            approvalPerson: "",
-            approvalOpinion: ""
-          }
+          infomation: {}
         }
       }
     }
   },
-  components: { CommonSelectView },
+  components: {},
   computed: {
     searchCommonHeight() {
       return this.$refs.searchCommonView.offsetHeight
@@ -202,22 +219,95 @@
       dialogWidth: "80%",
       editConfig: this.editCommonConfig,
       rules: {
-        customName: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
-        orderNumber: [{ required: true, message: "璇疯緭鍏ュ伐鍗曠紪鍙�", trigger: "blur" }],
+        clientId: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
+        number: [{ required: true, message: "璇疯緭鍏ュ伐鍗曠紪鍙�", trigger: "blur" }],
         orderType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-        problemDesc: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }]
+        problemDescription: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }]
       },
-      orderTypeOptions: [], // 宸ュ崟绫诲瀷
-      repairSourceOptions: [], // 鎶ヤ慨鏉ユ簮
-      selSourceOrderOptions: [
+      orderTypeOptions: [{ id: 1, name: "绫诲瀷1" }], // 宸ュ崟绫诲瀷
+      reportSourceOptions: [], // 鎶ヤ慨鏉ユ簮
+      sourceSheetOptions: [
         { value: "1", label: "閿�鍞槑缁嗗崟" },
         { value: "2", label: "鏈嶅姟鍚堝悓" }
       ],
       approvalWorkflowOptions: [] // 瀹℃壒娴佺▼
     }
   },
-  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 === "鏂板缓") {
+            getAddOrderManage(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 {
+            getUpdateOrderManage(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: parseInt(data.clientId) || 0,
+        contactId: data.contactId || 0,
+        file: data.file || "",
+        name: data.name || "",
+        number: data.number || "",
+        orderType: data.orderType || 0,
+        problemDescription: data.problemDescription || "",
+        reportSourceId: data.reportSourceId || 0,
+        sourceSheet: data.sourceSheet || 0
+      }
+      return params
+    },
     handleClose() {
       this.editConfig.visible = false
     },
@@ -252,6 +342,17 @@
           font-size: 18px;
         }
       }
+      .common-select {
+        display: flex;
+        .common-select-sel {
+          width: 270px;
+        }
+        .common-select-btn {
+          margin-left: 5px;
+          font-size: 16px;
+          cursor: pointer;
+        }
+      }
     }
     .annex-view {
       display: flex;
@@ -265,26 +366,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