Browse Source

hah阿凡达

28169 3 weeks ago
parent
commit
1a5c3f2e04

+ 33 - 0
src/xt_pages/user/components/PatientDetail.vue View File

1030
        </el-col>
1030
        </el-col>
1031
       </el-row>
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
     </el-form>
1049
     </el-form>
1034
     <!-- 打印预览 style="display: none"-->
1050
     <!-- 打印预览 style="display: none"-->
1035
     <div style="display: none">
1051
     <div style="display: none">
1669
   print_date:"",
1685
   print_date:"",
1670
   famality_record:"",
1686
   famality_record:"",
1671
   patient_type:"",
1687
   patient_type:"",
1688
+  org_logo:"",
1672
 };
1689
 };
1673
 
1690
 
1674
 export default {
1691
 export default {
1776
       liuAddresslist:[],
1793
       liuAddresslist:[],
1777
       patientVascularAccessOne:{},
1794
       patientVascularAccessOne:{},
1778
       patientType: [{ value: 1, label: "血透患者" }, { value: 2, label: "慢病患者" }, { value: 3, label: "会员患者" },{ value: 4, label: "腹透患者" },{ value: 5, label: "CKD患者" },{ value: 6, label: "其他患者" }],
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
   computed: {
1800
   computed: {
1916
         }
1935
         }
1917
       });
1936
       });
1918
     },
1937
     },
1938
+   
1919
     fetchPatient(id) {
1939
     fetchPatient(id) {
1920
       fetchPatient(id)
1940
       fetchPatient(id)
1921
         .then((response) => {
1941
         .then((response) => {
2062
             this.form.tell_phone = patietInfo.tell_phone;
2082
             this.form.tell_phone = patietInfo.tell_phone;
2063
             this.form.dialysis_age = patietInfo.dialysis_age;
2083
             this.form.dialysis_age = patietInfo.dialysis_age;
2064
             this.form.record_number = patietInfo.record_number
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
             if (patietInfo.expense_kind == 0) {
2098
             if (patietInfo.expense_kind == 0) {
2066
               this.form.expense_kind = "";
2099
               this.form.expense_kind = "";
2067
             } else {
2100
             } else {

+ 145 - 6
src/xt_pages/user/components/PatientForm.vue View File

1075
           </el-form-item>
1075
           </el-form-item>
1076
        </el-col>
1076
        </el-col>
1077
       </el-row>
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
        <el-row>
1099
        <el-row>
1080
           <el-col :span="24" align="right" class="newCol">
1100
           <el-col :span="24" align="right" class="newCol">
1140
 import { fetchAllAdminUsers } from "@/api/doctor";
1160
 import { fetchAllAdminUsers } from "@/api/doctor";
1141
 // import { fetchAllDoctorAndNurse } from "@/api/doctor";
1161
 // import { fetchAllDoctorAndNurse } from "@/api/doctor";
1142
 import { getDataConfig } from "@/utils/data";
1162
 import { getDataConfig } from "@/utils/data";
1143
-
1144
 const defaultForm = {
1163
 const defaultForm = {
1145
   avatar: "https://images.shengws.com/201809182128111.png",
1164
   avatar: "https://images.shengws.com/201809182128111.png",
1146
   name: "",
1165
   name: "",
1205
   allergic_history:"",
1224
   allergic_history:"",
1206
   print_date:"",
1225
   print_date:"",
1207
   famality_record:"",
1226
   famality_record:"",
1227
+  org_logo:"",
1208
   formItem: [
1228
   formItem: [
1209
     {
1229
     {
1210
       id: 0,
1230
       id: 0,
1355
   dbp: "",
1375
   dbp: "",
1356
   showOne:true,
1376
   showOne:true,
1357
   treatment_plan:"",
1377
   treatment_plan:"",
1378
+  
1358
 };
1379
 };
1359
 
1380
 
1360
 export default {
1381
 export default {
1540
       },
1561
       },
1541
       adminUserOptions:[],
1562
       adminUserOptions:[],
1542
       org_id:0,
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
   components: {
1573
   components: {
1636
     // }
1663
     // }
1637
   },
1664
   },
1638
   methods: {
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
     fetchAllAdminUsers() {
1765
     fetchAllAdminUsers() {
1640
       fetchAllAdminUsers().then((response) => {
1766
       fetchAllAdminUsers().then((response) => {
1641
         if (response.data.state === 1) {
1767
         if (response.data.state === 1) {
1735
             if(this.form.patient_type >0){
1861
             if(this.form.patient_type >0){
1736
                this.form.patient_type = parseInt(this.form.patient_type)
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
                 if (response.data.state == 0) {
1867
                 if (response.data.state == 0) {
1743
                   this.$message.error(response.data.msg);
1868
                   this.$message.error(response.data.msg);
1744
                   this.formSubmit = true;
1869
                   this.formSubmit = true;
1938
           if (response.data.state == 1) {
2063
           if (response.data.state == 1) {
1939
             this.$emit("tran-patient-info", response.data.data.patient);
2064
             this.$emit("tran-patient-info", response.data.data.patient);
1940
             var patietInfo = response.data.data.patient;
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
             console.log("9999999",response.data.data.patient)
2080
             console.log("9999999",response.data.data.patient)
1942
             this.form.avatar = patietInfo.avatar;
2081
             this.form.avatar = patietInfo.avatar;
1943
             this.form.name = patietInfo.name;
2082
             this.form.name = patietInfo.name;