28169 3 недель назад
Родитель
Сommit
1a5c3f2e04

+ 33 - 0
src/xt_pages/user/components/PatientDetail.vue Просмотреть файл

@@ -1030,6 +1030,22 @@
1030 1030
        </el-col>
1031 1031
       </el-row>
1032 1032
 
1033
+      <el-row>
1034
+        <el-col>
1035
+            <el-form-item label="病历图册:" prop="gallery">
1036
+             <div style="display: flex;">
1037
+              <div v-for="item in fileList" style="margin-left: 10px;">
1038
+                <el-image 
1039
+                  style="width: 100px; height: 100px"
1040
+                  :src="item" 
1041
+                  :preview-src-list="fileList">
1042
+               </el-image>
1043
+              </div>
1044
+             </div>
1045
+            </el-form-item>
1046
+        </el-col>
1047
+      </el-row>
1048
+
1033 1049
     </el-form>
1034 1050
     <!-- 打印预览 style="display: none"-->
1035 1051
     <div style="display: none">
@@ -1669,6 +1685,7 @@ const defaultForm = {
1669 1685
   print_date:"",
1670 1686
   famality_record:"",
1671 1687
   patient_type:"",
1688
+  org_logo:"",
1672 1689
 };
1673 1690
 
1674 1691
 export default {
@@ -1776,6 +1793,8 @@ export default {
1776 1793
       liuAddresslist:[],
1777 1794
       patientVascularAccessOne:{},
1778 1795
       patientType: [{ value: 1, label: "血透患者" }, { value: 2, label: "慢病患者" }, { value: 3, label: "会员患者" },{ value: 4, label: "腹透患者" },{ value: 5, label: "CKD患者" },{ value: 6, label: "其他患者" }],
1796
+      fileList:[],
1797
+      guploading:false,
1779 1798
     };
1780 1799
   },
1781 1800
   computed: {
@@ -1916,6 +1935,7 @@ export default {
1916 1935
         }
1917 1936
       });
1918 1937
     },
1938
+   
1919 1939
     fetchPatient(id) {
1920 1940
       fetchPatient(id)
1921 1941
         .then((response) => {
@@ -2062,6 +2082,19 @@ export default {
2062 2082
             this.form.tell_phone = patietInfo.tell_phone;
2063 2083
             this.form.dialysis_age = patietInfo.dialysis_age;
2064 2084
             this.form.record_number = patietInfo.record_number
2085
+            this.fileList = []
2086
+            var arrNew = []
2087
+            if(patietInfo.org_logo!=""){
2088
+              arrNew = patietInfo.org_logo.split(",")
2089
+            }
2090
+            if(arrNew!=null){
2091
+              for(let i=0;i<arrNew.length;i++){
2092
+                if(arrNew[i]!=""){
2093
+                  this.fileList.push(arrNew[i])
2094
+                }
2095
+              }
2096
+            }
2097
+            console.log("----------------------------",this.fileList)
2065 2098
             if (patietInfo.expense_kind == 0) {
2066 2099
               this.form.expense_kind = "";
2067 2100
             } else {

+ 145 - 6
src/xt_pages/user/components/PatientForm.vue Просмотреть файл

@@ -1075,6 +1075,26 @@
1075 1075
           </el-form-item>
1076 1076
        </el-col>
1077 1077
       </el-row>
1078
+
1079
+      <el-row>
1080
+        <el-col>
1081
+            <el-form-item label="病历图册:" prop="gallery">
1082
+                <el-upload
1083
+                    v-loading="guploading"
1084
+                    :data="uploadData"
1085
+                    action="https://upload.qiniup.com"
1086
+                    list-type="picture-card"
1087
+                    :file-list="fileList"
1088
+                    :on-remove="handleRemove"
1089
+                    :on-error="handleGalleryError"
1090
+                    :on-success="handleGallerySuccess"
1091
+                    :before-upload="beforeGalleryUpload">
1092
+                    <i class="el-icon-plus"></i>
1093
+                </el-upload>
1094
+                
1095
+            </el-form-item>
1096
+        </el-col>
1097
+      </el-row>
1078 1098
       
1079 1099
        <el-row>
1080 1100
           <el-col :span="24" align="right" class="newCol">
@@ -1140,7 +1160,6 @@ import {
1140 1160
 import { fetchAllAdminUsers } from "@/api/doctor";
1141 1161
 // import { fetchAllDoctorAndNurse } from "@/api/doctor";
1142 1162
 import { getDataConfig } from "@/utils/data";
1143
-
1144 1163
 const defaultForm = {
1145 1164
   avatar: "https://images.shengws.com/201809182128111.png",
1146 1165
   name: "",
@@ -1205,6 +1224,7 @@ const defaultForm = {
1205 1224
   allergic_history:"",
1206 1225
   print_date:"",
1207 1226
   famality_record:"",
1227
+  org_logo:"",
1208 1228
   formItem: [
1209 1229
     {
1210 1230
       id: 0,
@@ -1355,6 +1375,7 @@ const defaultForm = {
1355 1375
   dbp: "",
1356 1376
   showOne:true,
1357 1377
   treatment_plan:"",
1378
+  
1358 1379
 };
1359 1380
 
1360 1381
 export default {
@@ -1540,7 +1561,13 @@ export default {
1540 1561
       },
1541 1562
       adminUserOptions:[],
1542 1563
       org_id:0,
1543
-      liuAddresslist:[]
1564
+      liuAddresslist:[],
1565
+      formloading:false,
1566
+      uploading:false,
1567
+      guploading:false,
1568
+      formsubmit:false,
1569
+      loadingText:'',
1570
+      fileList:[],
1544 1571
     };
1545 1572
   },
1546 1573
   components: {
@@ -1636,6 +1663,105 @@ export default {
1636 1663
     // }
1637 1664
   },
1638 1665
   methods: {
1666
+    handleAvatarSuccessOne(res, file) {
1667
+            this.form.org_logo = this.qiniuDomain + res.url;
1668
+            this.uploading = false;
1669
+        },
1670
+        beforeAvatarUploadOne(file) {
1671
+            var fileType = file.type
1672
+            const isJPG = fileType.indexOf('image') > -1
1673
+            const isLt2M = file.size / 1024 / 1024 < 5
1674
+
1675
+            if (!isJPG) {
1676
+                this.$message.error('只能上传图片')
1677
+                return false
1678
+            }
1679
+            if (!isLt2M) {
1680
+                this.$message.error('上传头像图片大小不能超过 5MB!')
1681
+                return false
1682
+            }
1683
+
1684
+            var date = new Date()
1685
+            var ext = getFileExtension(file.name)
1686
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
1687
+            this.uploading = true;
1688
+            this.loadingText = '机构头像上传中'
1689
+
1690
+            const _self = this
1691
+            return new Promise((resolve, reject) => {
1692
+                getToken().then(response => {
1693
+                    const token = response.data.data.uptoken
1694
+                    _self._data.uploadData.token = token
1695
+                    _self._data.uploadData.key = key
1696
+                    resolve(true)
1697
+                }).catch(err => {
1698
+                    reject(false)
1699
+                    this.uploading = false;
1700
+                })
1701
+            })
1702
+        },
1703
+        handleGalleryError(err, file, fileList) {
1704
+            this.$message.error(err);
1705
+            this.guploading = false;
1706
+            return false
1707
+        },
1708
+        handleGallerySuccess(res, file) {
1709
+            var data = {type:1, url: this.qiniuDomain + res.url};
1710
+            // this.fileList.push(data.url)
1711
+            // if(this.fileList!=null){
1712
+            //   for(let i=0;i<this.fileList.length;i++){
1713
+            //      this.form.org_logo += this.fileList[i].url+","
1714
+            //   }
1715
+            // }
1716
+           console.log("hahahahhwoowowo",this.form.org_logo)
1717
+           this.form.org_logo += data.url+","
1718
+
1719
+            this.guploading = false;
1720
+        },
1721
+    beforeGalleryUpload(file) {
1722
+        var fileType = file.type
1723
+        const isJPG = fileType.indexOf('image') > -1
1724
+        const isLt100M = file.size / 1024 / 1024 < 100
1725
+
1726
+        if (!isJPG) {
1727
+            this.$message.error('只能上传图片')
1728
+            return false
1729
+        }
1730
+        if (!isLt100M) {
1731
+            this.$message.error('上传图片大小不能超过 100MB!')
1732
+            return false
1733
+        }
1734
+
1735
+        var date = new Date()
1736
+        var ext = getFileExtension(file.name)
1737
+        var key = ""+date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_g_' + file.uid + '.' + ext;
1738
+        this.guploading = true;
1739
+        this.loadingText = '机构图册上传中'
1740
+
1741
+        const _self = this
1742
+        return new Promise((resolve, reject) => {
1743
+            getToken().then(response => {
1744
+                const token = response.data.data.uptoken
1745
+                _self._data.uploadData.token = token
1746
+                _self._data.uploadData.key = key
1747
+                resolve(true)
1748
+            }).catch(err => {
1749
+                reject(false)
1750
+                this.guploading = false;
1751
+            })
1752
+        })
1753
+    },
1754
+
1755
+    handleRemove(file, fileList) {
1756
+      console.log("fileList--------------",fileList)
1757
+      var log_str = ""
1758
+      for(let i=0;i<fileList.length;i++){
1759
+          log_str +=fileList[i].url+","
1760
+      }
1761
+      this.form.org_logo = ""
1762
+      this.form.org_logo = log_str
1763
+    
1764
+    },
1639 1765
     fetchAllAdminUsers() {
1640 1766
       fetchAllAdminUsers().then((response) => {
1641 1767
         if (response.data.state === 1) {
@@ -1735,10 +1861,9 @@ export default {
1735 1861
             if(this.form.patient_type >0){
1736 1862
                this.form.patient_type = parseInt(this.form.patient_type)
1737 1863
             }
1738
-
1739
-            editPatient(this.patientID, this.form)
1740
-
1741
-              .then(response => {
1864
+            console.log("form===============",this.form)
1865
+            
1866
+            editPatient(this.patientID, this.form).then(response => {
1742 1867
                 if (response.data.state == 0) {
1743 1868
                   this.$message.error(response.data.msg);
1744 1869
                   this.formSubmit = true;
@@ -1938,6 +2063,20 @@ export default {
1938 2063
           if (response.data.state == 1) {
1939 2064
             this.$emit("tran-patient-info", response.data.data.patient);
1940 2065
             var patietInfo = response.data.data.patient;
2066
+            this.fileList = []
2067
+            var arrNew = []
2068
+            if(patietInfo.org_logo!=""){
2069
+              arrNew = patietInfo.org_logo.split(",")
2070
+            }
2071
+            if(arrNew!=null){
2072
+              for(let i=0;i<arrNew.length;i++){
2073
+                if(arrNew[i]!=""){
2074
+                  var image = { name:i+1, url:arrNew[i]+'?vframe/jpg/offset/0/w/100/h/100'};
2075
+                  this.fileList.push(image)
2076
+                }
2077
+              }
2078
+            }
2079
+            console.log("---------------------",this.fileList)
1941 2080
             console.log("9999999",response.data.data.patient)
1942 2081
             this.form.avatar = patietInfo.avatar;
1943 2082
             this.form.name = patietInfo.name;