index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="content">
  3. <view class="updateDoctorInfo-wrap">
  4. <view class="zhcx-table">
  5. <view class="zhcx-table-row">
  6. <view class="name">
  7. <text>姓名</text>
  8. </view>
  9. <view class="text" >
  10. <input type="text" v-model="form.name" />
  11. </view>
  12. </view>
  13. <view class="zhcx-table-row">
  14. <view class="name">
  15. <text>性别</text>
  16. </view>
  17. <view class="text" >
  18. <radio-group @change="changeGender">
  19. <label>
  20. <radio value="0" :checked="form.gender==='0'" /><text>男</text>
  21. </label>
  22. <label class="gender-item-woman">
  23. <radio value="1" :checked="form.gender==='1'" /><text>女</text>
  24. </label>
  25. </radio-group>
  26. </view>
  27. </view>
  28. <view class="zhcx-table-row">
  29. <view class="name">
  30. <text>身份证</text>
  31. </view>
  32. <view class="text" >
  33. <input type="text" v-model="form.idCard" />
  34. </view>
  35. </view>
  36. <view class="zhcx-table-row">
  37. <view class="name">
  38. <text>住址</text>
  39. </view>
  40. <view class="text" >
  41. <input type="text" v-model="form.address" />
  42. </view>
  43. </view>
  44. <view class="zhcx-table-row">
  45. <view class="name">
  46. <text>所属医院</text>
  47. </view>
  48. <view class="text" >
  49. <input type="text" v-model="form.hospital" />
  50. </view>
  51. </view>
  52. <view class="zhcx-table-row">
  53. <view class="name">
  54. <text>科室</text>
  55. </view>
  56. <view class="text" >
  57. <input type="text" v-model="form.offices" />
  58. </view>
  59. </view>
  60. <view class="zhcx-table-row">
  61. <view class="name">
  62. <text>医生资格证号</text>
  63. </view>
  64. <view class="text" >
  65. <input type="text" v-model="form.doctorQualificationsNumber" />
  66. </view>
  67. </view>
  68. <view class="zhcx-table-row">
  69. <view class="name">
  70. <text>资格证照片</text>
  71. </view>
  72. <view class="text" v-show="0">
  73. <input type="text" v-model="form.qualificationsImg" />
  74. </view>
  75. </view>
  76. <view class="zhcx-upload" @click="uploadBt">
  77. <div class="icon"></div>
  78. <text class="uploadTitle">点击上传</text>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="handle-wrap">
  83. <view class="submit-BT" @click="submit">
  84. <text>提交</text>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import {modifyinfo} from '@/api/doctor';
  91. import {upload} from '@/api/index';
  92. export default {
  93. data() {
  94. return {
  95. form:{
  96. name:"",
  97. idCard:"",
  98. gender:"",
  99. address:"",
  100. hospital:"",
  101. offices:"",
  102. doctorQualificationsNumber:"",
  103. qualificationsImg:""
  104. }
  105. }
  106. },
  107. created() {
  108. this.init();
  109. },
  110. methods: {
  111. init(){
  112. let doctorAccountInfo=uni.getStorageSync('doctorAccountInfo');
  113. this.$set(this.form,'name',doctorAccountInfo.doctorName);
  114. this.$set(this.form,'gender',doctorAccountInfo.doctorSex);
  115. this.$set(this.form,'idCard',doctorAccountInfo.doctorIdCard);
  116. this.$set(this.form,'hospital',doctorAccountInfo.doctorHospital);
  117. this.$set(this.form,'offices',doctorAccountInfo.doctorDepartment);
  118. this.$set(this.form,'doctorQualificationsNumber',doctorAccountInfo.doctorQualificationsNumber);
  119. this.$set(this.form,'doctorQualificationsImg',doctorAccountInfo.qualificationsImg);
  120. this.$set(this.form,'doctorJob',doctorAccountInfo.doctorJobTitle);
  121. this.$set(this.form,'address',doctorAccountInfo.doctorAddress);
  122. },
  123. changeGender({detail}){
  124. this.form.gender=detail.value;
  125. },
  126. submit(){
  127. let form=this.form;
  128. let doctorAccountInfo=uni.getStorageSync('doctorAccountInfo');
  129. var params={
  130. doctorId:doctorAccountInfo.doctorId,
  131. doctorSex:form['gender'],
  132. doctorIdCard:form['idCard'],
  133. doctorHospital:form['hospital'],
  134. doctorDepartment:form['offices'],
  135. doctorQualificationsNumber:form['doctorQualificationsNumber'],
  136. doctorQualificationsImg:form['qualificationsImg'],
  137. doctorAddress:form['address'],
  138. accountRealName:form['name'],
  139. doctorName:form['name']
  140. }
  141. modifyinfo(params).then(()=>{
  142. uni.showToast({
  143. title:"补传资料成功!请等待审核员审核!",
  144. icon:'none'
  145. })
  146. setTimeout(()=>{
  147. uni.reLaunch({
  148. url:"/pages/login/index"
  149. })
  150. },1500)
  151. })
  152. },
  153. uploadBt(){
  154. uni.chooseImage({
  155. success: (chooseImageRes) => {
  156. const tempFilePaths = chooseImageRes.tempFilePaths;
  157. this.uploadSubmit(tempFilePaths[0])
  158. }
  159. });
  160. },
  161. uploadSubmit(filePath){
  162. let callback=this.onProgressUpdate;
  163. upload({filePath,callback}).then((res)=>{
  164. let cont=JSON.parse(res)
  165. this.form.qualificationsImg=cont.data.path;
  166. }).catch((msg)=>{
  167. console.log(msg)
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .content{
  175. .updateDoctorInfo-wrap{
  176. .zhcx-table-row{
  177. .text{
  178. text-align: left;
  179. .gender-item-woman{
  180. margin-left: 40upx;
  181. }
  182. }
  183. }
  184. .zhcx-upload{
  185. margin-top: 20upx;
  186. }
  187. }
  188. }
  189. .handle-wrap{
  190. &{
  191. width: 100%;
  192. position: fixed;
  193. bottom: 0;
  194. left: 0;
  195. padding: 10upx 0;
  196. }
  197. .submit-BT{
  198. width: 702upx;
  199. height: 100upx;
  200. line-height: 100upx;
  201. text-align: center;
  202. background-color: #3384FF;
  203. border-radius: 12upx;
  204. color: #fff;
  205. font-size: 32upx;
  206. margin: 0 auto;
  207. }
  208. }
  209. </style>