From 30ee3eccaf15859197bb44d71f70c7fcf983753c Mon Sep 17 00:00:00 2001
From: corala <18339694416@163.com>
Date: Wed, 4 Jan 2023 15:08:33 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E5=86=99=E6=96=B9?=
 =?UTF-8?q?=E5=BC=8F=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/views/building/index.vue | 51 ++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 22 deletions(-)

diff --git a/src/views/building/index.vue b/src/views/building/index.vue
index 069415f..65b1368 100644
--- a/src/views/building/index.vue
+++ b/src/views/building/index.vue
@@ -266,22 +266,20 @@
       :visible.sync="dialogVisible"
       @close="dialogClose"
       width="600px"
-      :center="true"
+      center
     >
       <div
-        style="margin: 0 auto; width: 90%; height: 500px; overflow-y: scroll"
+        style="padding: 0 10px;height: 500px; overflow-y: scroll"
       >
         <el-form
           :model="ruleForm"
           label-position="labelPosition"
           ref="ruleForm"
           label-width="150px"
-          style="width: 80%"
           :rules="rules"
         >
           <el-form-item label="公司" prop="orgCode" v-if="orgType != 2">
             <el-select
-              style="width: 100%"
               :disabled="editFlag == true"
               v-model="ruleForm.orgCode"
               filterable
@@ -318,8 +316,8 @@
             v-if="orgType != 2"
           >
             <el-date-picker
+            style="width:280px"
               v-model="time"
-              style="width: 100%"
               @change="timeChange"
               type="daterange"
               range-separator="-"
@@ -332,6 +330,7 @@
           </el-form-item>
           <el-form-item label="日报推送时间" prop="time">
             <el-time-picker
+            style="width:280px"
               v-model="ruleForm.time"
               format="HH:mm"
               value-format="HH:mm"
@@ -341,8 +340,8 @@
           </el-form-item>
           <el-form-item label="项目离线推送时间" prop="offLine">
             <el-time-picker
-              style="width: 100%"
               is-range
+              style="width:280px"
               v-model="ruleForm.offLine"
               range-separator="-"
               start-placeholder="开始时间"
@@ -396,7 +395,6 @@
           <el-form-item label="项目地区" prop="provinceId">
             <el-cascader
               :props="props"
-              style="width: 100%"
               @change="locationsChange"
               :options="addressOptions"
               placeholder="省/市"
@@ -442,12 +440,14 @@
             ></el-input>
           </el-form-item>
           <el-form-item label="转写方式" prop="transliterationMethod">
-            <el-select style="width:120px" v-model="ruleForm.transliterationMethod" placeholder="请选择项目" @change="changeFun">
-              <el-option v-for="(item,index) in projectlist" :label="item.name" :key="index" :value="item.code"></el-option>
-            </el-select>
-            <el-select style="width:120px" v-model="ruleForm.language" placeholder="请选择语种">
-              <el-option v-for="(item,index) in languageList" :label="item.name" :key="index" :value="item.code"></el-option>
-            </el-select>
+            <div style="display:flex;align-items:center">
+              <el-select style="width:150px" v-model="ruleForm.transliterationMethod" placeholder="请选择项目" @change="changeFun">
+                <el-option v-for="(item,index) in projectList" :label="item.name" :key="index" :value="item.code"></el-option>
+              </el-select>
+              <el-select style="width:150px" v-model="ruleForm.language" placeholder="请选择语种">
+                <el-option v-for="(item,index) in languageList" :label="item.name" :key="index" :value="item.code"></el-option>
+              </el-select>
+            </div>
           </el-form-item>
         </el-form>
       </div>
@@ -940,7 +940,7 @@ export default {
       agentForm: {
         agentId: "",
       },
-      projectlist:[],//转写方式
+      projectList:[],//转写方式
       languageList:[]//语言
     };
   },
@@ -1013,7 +1013,7 @@ export default {
     changeFun(value){
         // console.log(value)
       this.ruleForm.language = ''
-      this.projectlist.forEach(item=>{
+      this.projectList.forEach(item=>{
         if(item.code==value){
           this.languageList = item.list
         }
@@ -1029,7 +1029,7 @@ export default {
         }).then((res) => {
           // console.log(res)
           if(res.code==0){
-            this.projectlist = res.data||[]
+            this.projectList = res.data||[]
             this.languageList = res.data&&res.data[0].list||[]
           }
       });
@@ -1269,18 +1269,21 @@ export default {
             this.loadingFlag = false;
             return;
           }
+          if (this.ruleForm.language=='') {
+            this.$message.error("请选择转写语言");
+            this.loadingFlag = false;
+            return;
+          }
           this.ruleForm.offLine = this.ruleForm.offLine.join("~");
           // 编辑
           if (this.editFlag) {
             this.$api.api
               .editZkhouse(this.ruleForm)
               .then((res) => {
-                // console.log(res);
                 if (res.code == 0) {
                   this.dialogVisible = false;
                   setTimeout(() => {
                     this.loadingFlag = false;
-                    console.log("防重");
                   }, 1);
                   this.$message.success("编辑成功");
                   this.zkhousePage();
@@ -1294,12 +1297,10 @@ export default {
             this.$api.api
               .addZkhouse(this.ruleForm)
               .then((res) => {
-                console.log(res);
                 if (res.code == 0) {
                   this.dialogVisible = false;
                   setTimeout(() => {
                     this.loadingFlag = false;
-                    console.log("防重");
                   }, 1);
                   this.$message.success("新增项目成功");
                   this.zkhousePage();
@@ -1409,9 +1410,15 @@ export default {
       if (row.offLine && row.offLine.indexOf('~') != -1) {
         this.ruleForm.offLine = row.offLine.split('~')
       }
-
+      if(row.transliterationMethod){
+        this.projectList.forEach(item=>{
+          if(item.code==row.transliterationMethod){
+            this.languageList = item.list
+          }
+        })
+      }else{
+      }
       this.editFlag = true;
-
       this.dialogVisible = true;
       this.$forceUpdate();
     },