From 7c33a1164d3019feb3ad9e4844b3d364e5c6eb44 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期日, 17 十一月 2024 11:31:45 +0800
Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/zhangshi_app_web

---
 ruoyi-ui/src/views/pet/petInfo.vue |   81 +++++++++++++++++++++++++++++-----------
 1 files changed, 59 insertions(+), 22 deletions(-)

diff --git a/ruoyi-ui/src/views/pet/petInfo.vue b/ruoyi-ui/src/views/pet/petInfo.vue
index e0d5a8c..4f5c950 100644
--- a/ruoyi-ui/src/views/pet/petInfo.vue
+++ b/ruoyi-ui/src/views/pet/petInfo.vue
@@ -96,7 +96,7 @@
                     <el-input v-model="petList.sex === 1 ? '闆勬��':'闆屾��'" :disabled="true"></el-input>
                   </template>
                   <template v-else>
-                    <el-select v-model="petList.sex" placeholder="璇烽�夋嫨淇濇磥/鏀剁撼" clearable :style="{width: '100%'}">
+                    <el-select v-model="petList.sex" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}">
                       <el-option label="闆屾��" value="0"></el-option>
                       <el-option label="闆勬��" value="1"></el-option>
                     </el-select>
@@ -110,7 +110,7 @@
                 </el-form-item>
               </el-row>
               <el-row :span="5">
-                <el-form-item label="楗涔犳儻(鎭�)" prop="disEatHabit" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;">
+                <el-form-item label="楗涔犳儻(鎭�)" prop="disEatHabit" label-width="120px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;">
                   <el-input v-model="petList.disEatHabit" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
                   </el-input>
                 </el-form-item>
@@ -387,7 +387,7 @@
   </div>
 </template>
 <script>
-import {getPetList, listPetnote,uploadPic, download,updatePet} from "@/api/pet/index";
+import {getPetList, listPetnote,uploadPic1, download,updatePet} from "@/api/pet/index";
 import {addRole, updateRole} from "@/api/system/role";
 import {blobValidate} from "@/utils/ruoyi";
 import errorCode from "@/utils/errorCode";
@@ -447,7 +447,7 @@
         dialect: undefined,
         address:undefined,
         eatHabit:undefined,
-        diseatHabit: undefined,
+        disEatHabit: undefined,
         LifeHabit: undefined,
         disLifeHabit: undefined,
         url: undefined,
@@ -520,9 +520,9 @@
           trigger: 'blur'
         }],
 
-        diseatHabit: [{
+        disEatHabit: [{
           required: true,
-          message: '璇疯緭鍏ラギ椋熶範鎯�(鍠�)',
+          message: '璇疯緭鍏ラギ椋熶範鎯�(鎭�)',
           trigger: 'blur'
         }],
         masterName: [{
@@ -566,11 +566,11 @@
       this.isShow = true
 
      // document.title = "淇敼榄呭疇璇︾粏淇℃伅";
-      this.$route.meta.title = "淇敼榄呭疇璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉�
+      this.$route.meta.title = "淇敼瀹犵墿璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉�
     }
     else{
      // document.title = "鏌ョ湅榄呭疇璇︾粏淇℃伅";
-      this.$route.meta.title = "鏌ョ湅榄呭疇璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉�
+      this.$route.meta.title = "鏌ョ湅瀹犵墿璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉�
       this.btn = false;
       this.isShow = false;
     }
@@ -581,6 +581,10 @@
       this.loading = true;
       getPetList(id).then((response) => {
         this.petList = response.data;
+        if(this.petList.sex==1)
+        	this.petList.sex = '闆勬��'
+        else
+        	this.petList.sex = '闆屾��'
         console.log(this.petList)
      //   alert(this.petList.headPicture)
         this.loading = false;
@@ -611,21 +615,23 @@
       );
     },
 
-    requestUpload2(params)
-    {
-      var file = params.file;
-      var formData = new FormData();
+    // requestUpload2(params)
+    // {
+    //   var file = params.file;
+    //   var formData = new FormData();
 
-      formData.append('uploadFile', file);
-      let _this = this
+    //   formData.append('uploadFile', file);
+    //   let _this = this
 
-      uploadPic(formData).then(response => {
-        let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
-        _this.fileList2.push({name:response.data.fileName, url:response.data.url})
-        console("ok")
-      })
 
-    },
+    //   uploadPic1(formData).then(response => {
+    //     let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
+    //     _this.fileList2.push({name:response.data.fileName, url:response.data.url})
+    //     console("ok")
+    //   })
+
+
+    // },
     submitForm() {
 
       // let ul = this.fileList1.map(function (elem){
@@ -641,13 +647,25 @@
 
           if (valid) {
             if (this.petList.id != undefined) {
+              if(this.petList.sex=='闆勬��')
+              	this.petList.sex = 1
+              else
+              	this.petList.sex = 0
               updatePet(this.petList).then(response => {
                 this.$modal.msgSuccess("淇敼鎴愬姛");
                 // this.open = false;
+                if(this.petList.sex==1)
+                	this.petList.sex = '闆勬��'
+                else
+                	this.petList.sex = '闆屾��'
                 this.btn=false
               });
             } else {
               this.$modal.msgSuccess("淇敼澶辫触");
+              if(this.petList.sex==1)
+              	this.petList.sex = '闆勬��'
+              else
+              	this.petList.sex = '闆屾��'
 
             }
           }
@@ -753,25 +771,35 @@
       this.$refs.upload.clearFiles();
     //  this.uploading1 = true;
     //alert(100)
-    uploadPic(formData).then(response => {
+    uploadPic1(formData).then(response => {
      // alert(18)
      // let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
    //   _this.fileList1.push({name:response.data.fileName, url:response.data.url})
    //   console("ok")
     //  alert(90)
     //  alert(response.data.url)
+    if(this.petList.sex=='闆勬��')
+    	this.petList.sex = 1
+    else
+    	this.petList.sex = 0
       _this.petList.fullPicture =  response.data.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
       updatePet(_this.petList).then(response => {
         _this.$modal.msgSuccess("鍥惧儚淇敼鎴愬姛");
+        if(this.petList.sex==1)
+        	this.petList.sex = '闆勬��'
+        else
+        	this.petList.sex = '闆屾��'
         // this.open = false;
         _this.btn=false
       });
      // alert(100)
     })
+
       //alert(90)
      },
 requestUpload1(params)
     {
+
       var file = params.file;
       var formData = new FormData();
       formData.append('uploadFile', file);
@@ -780,21 +808,30 @@
       this.$refs.upload1.clearFiles();
     //  this.uploading1 = true;
     //alert(100)
-    uploadPic(formData).then(response => {
+    uploadPic1(formData).then(response => {
      // alert(18)
      // let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
    //   _this.fileList1.push({name:response.data.fileName, url:response.data.url})
    //   console("ok")
     //  alert(90)
     //  alert(response.data.url)
+    if(this.petList.sex=='闆勬��')
+    	this.petList.sex = 1
+    else
+    	this.petList.sex = 0
       _this.petList.headPicture =  response.data.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
       updatePet(_this.petList).then(response => {
         _this.$modal.msgSuccess("淇敼鎴愬姛");
         // this.open = false;
+        if(this.petList.sex==1)
+        	this.petList.sex = '闆勬��'
+        else
+        	this.petList.sex = '闆屾��'
         _this.btn=false
       });
      // alert(100)
     })
+
       //alert(90)
      },
 

--
Gitblit v1.9.1