|
@@ -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;
|