doctorRenzheng.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. <template>
  2. <view style="width: 100%;height: 100%;background-color: #FFF;">
  3. <!-- 性别选择器 -->
  4. <u-select v-model="sexshow" :list="sexlist" @confirm="sexconfirm"></u-select>
  5. <!-- 省市区选择 -->
  6. <u-select v-model="regionShow" mode="mutil-column-auto" :list="regionlist" @confirm="regionChoice"></u-select>
  7. <!-- 机构科室资质选择 -->
  8. <u-select v-model="hospitalShow" mode="mutil-column-auto" :list="hospitallist" @confirm="hospitalChoice"></u-select>
  9. <u-gap height="30" bg-color="#f0f2f5"></u-gap>
  10. <!-- 姓名 性别 身份证 -->
  11. <view style="padding: 0 28rpx;">
  12. <view class="flex align-center justify-between" style="margin: 20rpx 0;">
  13. <view style="width: 30%;font-weight: bold;" class="felx align-center">医生姓名</view>
  14. <text v-if="allupload">{{form.name}}</text>
  15. <u-input v-model="form.name" type="text" :border="false" placeholder="请填写真实姓名" input-align="right" maxlength="6"
  16. v-else />
  17. </view>
  18. <u-line color="#f0f2f5" />
  19. <view class="flex align-center justify-between" style="margin: 20rpx 0;">
  20. <view style="width: 30%;font-weight: bold;" class="felx align-center">性别</view>
  21. <text v-if="allupload">{{form.sex}}</text>
  22. <u-icon name="arrow-down" color="#dddfe1" @click="sexshow = true" :label="form.sex==''?'请选择性别':form.sex" label-pos="left"
  23. :label-color="form.sex==''?'#c7c9ca':'#000000'" v-else></u-icon>
  24. </view>
  25. <u-line color="#f0f2f5" />
  26. <view class="flex align-center justify-between" style="margin: 20rpx 0;">
  27. <view style="width: 30%;font-weight: bold;" class="felx align-center">身份证</view>
  28. <text v-if="allupload">{{form.ID}}</text>
  29. <u-input v-model="form.ID" type="idcard" :border="false" placeholder="请填写身份证号" input-align="right" maxlength="18"
  30. v-else />
  31. </view>
  32. </view>
  33. <u-gap height="30" bg-color="#f0f2f5"></u-gap>
  34. <!-- 照片上传 -->
  35. <view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
  36. <view style="margin-bottom: 30rpx;">
  37. <text style="font-size: 30rpx;font-weight: bold;">上传医师执业证书</text>
  38. <text style="color: #999999;font-size: 26rpx;">(清晰照片和信息页)</text>
  39. </view>
  40. <!-- 上传 -->
  41. <view>
  42. <!-- <u-upload :action="action" :file-list="form.certificate" max-count="2" ref="Upractice" :auto-upload="true"
  43. :deletable="!allupload"></u-upload> -->
  44. <view class="cu-form-group">
  45. <view class="grid col-4 grid-square flex-sub">
  46. <view class="bg-img" v-for="(item,index) in form.certificate" :key="index" :data-url="form.certificate[index]">
  47. <image :src="imghost+form.certificate[index]" mode='aspectFill'></image>
  48. <view class="cu-tag bg-red" v-if="iscertificate" @click="certificateDelImg" :data-index="index">
  49. <text class="cuIcon-close"></text>
  50. </view>
  51. </view>
  52. <view class="solids" @click="certificateChooseImage" v-if="form.certificate.length<9">
  53. <text class="cuIcon-cameraadd"></text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
  60. <view style="margin-bottom: 30rpx;">
  61. <text style="font-size: 30rpx;font-weight: bold;">上传身份证</text>
  62. <text style="color: #999999;font-size: 26rpx;">(请上传身份证人像面和国徽面各一张)</text>
  63. </view>
  64. <!-- 上传 -->
  65. <view>
  66. <!-- <u-upload :action="action" :file-list="form.idPhoto" max-count="2" ref="Ucard_photo" :auto-upload="true" :deletable="!allupload"></u-upload> -->
  67. <view class="cu-form-group">
  68. <view class="grid col-4 grid-square flex-sub">
  69. <view class="bg-img" v-for="(item,index) in form.idPhoto" :key="index" :data-url="form.idPhoto[index]">
  70. <image :src="imghost+form.idPhoto[index]" mode='aspectFill'></image>
  71. <view class="cu-tag bg-red" v-if="iscertificate" @click="idPhotoDelImg" :data-index="index">
  72. <text class="cuIcon-close"></text>
  73. </view>
  74. </view>
  75. <view class="solids" @click="idPhotoChooseImage" v-if="form.idPhoto.length<2">
  76. <text class="cuIcon-cameraadd"></text>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
  83. <view style="margin-bottom: 30rpx;">
  84. <text style="font-size: 30rpx;font-weight: bold;">上传医生资格证</text>
  85. <text style="color: #999999;font-size: 26rpx;">(请上传清晰的照片和相关信息页面)</text>
  86. </view>
  87. <!-- 上传 -->
  88. <view>
  89. <!-- <u-upload :action="action" :file-list="form.doctorQualification" max-count="2" ref="Uis_quali" :auto-upload="true"
  90. :deletable="!allupload"></u-upload> -->
  91. <view class="cu-form-group">
  92. <view class="grid col-4 grid-square flex-sub">
  93. <view class="bg-img" v-for="(item,index) in form.doctorQualification" :key="index" :data-url="form.doctorQualification[index]">
  94. <image :src="imghost+form.doctorQualification[index]" mode='aspectFill'></image>
  95. <view class="cu-tag bg-red" v-if="iscertificate" @click="doctorQualificationDelImg" :data-index="index">
  96. <text class="cuIcon-close"></text>
  97. </view>
  98. </view>
  99. <view class="solids" @click="doctorQualificationChooseImage" v-if="form.doctorQualification.length<9">
  100. <text class="cuIcon-cameraadd"></text>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <u-gap height="30" bg-color="#f0f2f5"></u-gap>
  107. <view style="padding: 36rpx 28rpx 0rpx 28rpx;;background-color: #FFF;" class="flex align-center">
  108. <view style="font-size: 28rpx;margin-right: 20rpx;font-weight: bold;font-size: 32rpx;">认证机构</view>
  109. </view>
  110. <!-- 工作机构一 -->
  111. <view style="padding: 45rpx 28rpx 30rpx 28rpx;" v-for="item,index in mechanismList" :key="index">
  112. <view style="margin-bottom: 20rpx;font-weight: bold;font-size: 30rpx;" class="flex justify-between">
  113. <!-- 标题 -->
  114. <text>{{item.title}}</text>
  115. <!-- 删除按钮 -->
  116. <u-icon name="close" size="30" @click="closemechanism" style="margin-right:20rpx;" v-if="index != 0&&item.Submit==4"></u-icon>
  117. <!-- 状态 1审核中 2审核通过 3审核不通过 -->
  118. <view v-else-if="item.Submit==0" style="color:#EA970E;font-size: 28rpx;">状态:审核中</view>
  119. <view v-else-if="item.Submit==1" style="color:#00aa7f;font-size: 28rpx;">状态:已认证</view>
  120. <view v-else-if="item.Submit==2" style="color:#ff0000;font-size: 28rpx;">状态:审核拒绝</view>
  121. <view v-else-if="item.Submit==3" style="color:#55aaff;font-size: 28rpx;">状态:审核通过</view>
  122. <view v-else="item.Submit==4"></view>
  123. </view>
  124. <!-- 地区 -->
  125. <view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="regionClick(index)">
  126. <view style="width: 95%;font-size: 28rpx;background-color: ;">{{item.regionText==""?'请选择 省-市-区':item.regionText}}</view>
  127. <view class="flex align-center">
  128. <u-icon name="arrow-right" color="#C0C0C0"></u-icon>
  129. </view>
  130. </view>
  131. <!-- 机构 -->
  132. <view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="hospitalClick(index)">
  133. <view style="width: 95%;font-size: 28rpx;background-color: ;">{{item.hospitalText==""?'请选择 机构-科室-资质':item.hospitalText}}</view>
  134. <view class="flex align-center">
  135. <u-icon name="arrow-right" color="#C0C0C0"></u-icon>
  136. </view>
  137. </view>
  138. </view>
  139. <view style="height: 100rpx;background-color: #f0f2f5;" class="flex align-center justify-center" v-if="mechanismList[mechanismList.length-1].preservation">
  140. <view style="font-size: 28rpx;color: #096CBB;border:1rpx solid #C0C0C0;border-radius: 15rpx;padding: 10rpx 20rpx;background-color: #FFF;"
  141. @click="addmechanism">
  142. <text>继续添加</text>
  143. <u-icon name="plus" color="#096CBB"></u-icon>
  144. </view>
  145. </view>
  146. <view style="height: 100rpx;background-color: #f0f2f5;" class="flex align-center justify-center" v-else>
  147. <view style="font-size: 28rpx;color: #096CBB;border:1rpx solid #C0C0C0;border-radius: 15rpx;padding: 10rpx 20rpx;background-color: #096CBB;"
  148. @click="bcmechanism">
  149. <text style="color: #FFF;">点击保存</text>
  150. </view>
  151. </view>
  152. <u-gap height="200" bg-color="#f0f2f5"></u-gap>
  153. <view class="bottomButton" @click="bc">提交</view>
  154. <!-- <view class="bottomButton" @click="jxrz" style="background-color: #FFF;color: #0000FF;">继续认证</view> -->
  155. </view>
  156. </template>
  157. <script>
  158. export default {
  159. components: {},
  160. onLoad() {
  161. this.imghost = this.$imgHost
  162. this.provinceconfirm()
  163. this.addmechanism()
  164. this.docterInfos();
  165. },
  166. mounted() {},
  167. data() {
  168. return {
  169. action: 'https://t11.swdz.com/api/v2/Common/uploadFile',
  170. //保存选择的列数
  171. form: {
  172. name: '', //姓名
  173. sex: '', //性别
  174. ID: '', //身份证
  175. works: [],
  176. certificate: [], //证书
  177. idPhoto: [], //身份证
  178. doctorQualification: [], //医生资格
  179. },
  180. //性别选择
  181. sexshow: false,
  182. sexlist: [{
  183. value: '1',
  184. label: '男'
  185. },
  186. {
  187. value: '2',
  188. label: '女'
  189. }
  190. ],
  191. //机构列表
  192. mechanismList: [],
  193. //省市区选择器
  194. regionShow: false,
  195. regionlist: [],
  196. regindex: 0, //记录点击的地方
  197. //机构科室资质选择器
  198. hospitalShow: false,
  199. hospitallist: [],
  200. hosindex: 0, //记录点击的地方
  201. //提交之后不能修改姓名 身份证 性别 证书
  202. allupload: false, //是否已经提交过并且审核通过
  203. iscertificate: false,
  204. imghost:""
  205. }
  206. },
  207. methods: {
  208. /*****************view点击**********************/
  209. //省市区选择器打开
  210. docterInfos: async function() {
  211. let res = await this.$request.post("doctor/getRenInfo");
  212. if (res.status == 0) {
  213. if (res.data != undefined || res.data != "undefined") {
  214. if (res.data.oqf.length != 0 || res.data.orgList.length != 0) {
  215. if (res.data.info.is_then == 0) {
  216. this.allupload = false
  217. } else if (res.data.info.is_then == 1) {
  218. this.allupload = true
  219. }
  220. this.form.name = res.data.info.name;
  221. this.form.sex = res.data.info.sex == 1 ? '男' : '女';
  222. this.form.ID = res.data.info.card_id;
  223. if (res.data.info.is_then == 0) {
  224. this.iscertificate = true
  225. }
  226. if (res.data.info.practice != '0') {
  227. this.form.certificate = res.data.info.practice.split(',');
  228. }
  229. if (res.data.info.card_photo != '0') {
  230. this.form.idPhoto = res.data.info.card_photo.split(',');
  231. }
  232. if (res.data.info.is_quail != '0') {
  233. this.form.doctorQualification = res.data.info.is_quail.split(',');
  234. }
  235. }
  236. console.log(this.form.certificate)
  237. if (res.data.orgList.length != 0 && res.data.oqf.length != 0) {
  238. let orglist = res.data.orgList;
  239. let oqflist = res.data.oqf;
  240. this.mechanismList.length = 0;
  241. this.form.works.length = 0;
  242. console.log('orglist', orglist)
  243. for (let i = 0; i < orglist.length; i++) {
  244. // 获取到修改中数据
  245. this.form.works.push({
  246. hospital: orglist[i].organization.id, //医院id
  247. department: oqflist[i].office.id, //科室id
  248. qualifications: oqflist[i].qualification.id, //资质id
  249. state: orglist[i].state,
  250. })
  251. // 渲染页面数据
  252. this.mechanismList.push({
  253. title: '工作机构' + this.convertToChinese(this.mechanismList.length + 1), //工作机构名称
  254. regionText: orglist[i].province + '-' + orglist[i].city + '-' + orglist[i].area, //地区信息文字
  255. hospitalText: orglist[i].name + '-' + oqflist[i].office.name + '-' + oqflist[i].qualification.name, //机构信息文字
  256. preservation: true, //是否已经保存
  257. Submit: orglist[i].state, // 0=审核中,1=审核通过,2=审核拒绝 信息状态 0未提交 1审核中 2审核通过 3审核不通过
  258. hospitalID: orglist[i].organization.id,
  259. })
  260. console.log(this.mechanismList)
  261. }
  262. }
  263. }
  264. }
  265. },
  266. regionClick(index) {
  267. if (this.mechanismList[index].Submit == 0 || this.mechanismList[index].Submit == 1) {
  268. uni.showToast({
  269. title: '无法修改',
  270. icon: 'none'
  271. })
  272. return false
  273. }
  274. if (this.mechanismList.length - 1 == index) {
  275. this.regionShow = true
  276. this.regindex = index //保存点击的地方
  277. } else {
  278. uni.showToast({
  279. title: '无法修改',
  280. icon: 'none'
  281. })
  282. }
  283. },
  284. //机构选择器打开
  285. hospitalClick(index) {
  286. console.log(index);
  287. if (this.mechanismList[index].Submit == 0 || this.mechanismList[index].Submit == 1) {
  288. uni.showToast({
  289. title: '无法修改',
  290. icon: 'none'
  291. })
  292. return false
  293. }
  294. if (this.hospitallist.length != 0) {
  295. if (this.mechanismList.length - 1 == index) {
  296. if (this.mechanismList[index].regionText != '') {
  297. this.hospitalShow = true
  298. this.hosindex = index //保存点击的地方
  299. } else {
  300. uni.showToast({
  301. title: '请先填写地区数据',
  302. icon: 'none'
  303. })
  304. }
  305. } else {
  306. uni.showToast({
  307. title: '无法修改',
  308. icon: 'none'
  309. })
  310. }
  311. } else {
  312. uni.showToast({
  313. title: '此地区暂无医院',
  314. icon: 'none'
  315. })
  316. }
  317. },
  318. //省市区选择器确认
  319. regionChoice(e) {
  320. console.log(e)
  321. console.log('hosindex', this.hosindex)
  322. console.log('regindex', this.regindex)
  323. this.hospitallist.splice(0, this.hospitallist.length);
  324. this.$forceUpdate()
  325. // this.mechanismList[this.hosindex].hospitalText = '';
  326. this.hospitalconfirm(e[0].value, e[1].value, e[2].value);
  327. this.mechanismList[this.regindex].regionText = e[0].label + '-' + e[1].label + '-' + e[2].label //利用保存的地方赋值
  328. },
  329. //机构选择
  330. hospitalChoice(e) {
  331. // this.mechanismList.map(val => {
  332. // if (val.hospitalText == e[0].label + '-' + e[1].label + '-' + e[2].label) {
  333. // return false;
  334. // }
  335. // })
  336. console.log(e)
  337. if (typeof this.form.works[this.hosindex] == undefined || typeof this.form.works[this.hosindex] == 'undefined') {
  338. this.form.works.push({
  339. hospital: e[0].value, //医院id
  340. department: e[1].value, //科室id
  341. qualifications: e[2].value, //资质id
  342. state: 0,
  343. })
  344. } else {
  345. this.form.works[this.hosindex].hospital = e[0].value;
  346. this.form.works[this.hosindex].department = e[1].value;
  347. this.form.works[this.hosindex].qualifications = e[2].value;
  348. this.form.works[this.hosindex].state = 0;
  349. }
  350. this.mechanismList[this.hosindex].hospitalText = e[0].label + '-' + e[1].label + '-' + e[2].label
  351. this.mechanismList[this.hosindex].hospitalID = e[0].value
  352. },
  353. //数字转文字
  354. convertToChinese(num) {
  355. var N = [
  356. "零", "一", "二", "三", "四", "五", "六", "七", "八", "九"
  357. ];
  358. var str = num.toString();
  359. var len = num.toString().length;
  360. var C_Num = [];
  361. for (var i = 0; i < len; i++) {
  362. C_Num.push(N[str.charAt(i)]);
  363. }
  364. return C_Num.join('');
  365. },
  366. //添加机构
  367. addmechanism() {
  368. this.mechanismList.push({
  369. title: '工作机构' + this.convertToChinese(this.mechanismList.length + 1), //工作机构名称
  370. regionText: '', //地区信息文字
  371. hospitalText: '', //机构信息文字
  372. preservation: false, //是否已经保存
  373. Submit: 4, // 信息状态
  374. hospitalID: 0 //医院id
  375. })
  376. console.log(this.mechanismList)
  377. },
  378. //保存机构
  379. bcmechanism() {
  380. if (this.mechanismList[this.mechanismList.length - 1].regionText == '' || this.mechanismList[this.mechanismList.length -
  381. 1].hospitalText == '') {
  382. uni.showToast({
  383. title: '请完善机构信息',
  384. icon: 'none'
  385. })
  386. } else {
  387. this.mechanismList[this.mechanismList.length - 1].preservation = true
  388. uni.showToast({
  389. title: '保存成功'
  390. })
  391. }
  392. },
  393. //删除机构
  394. closemechanism() {
  395. this.mechanismList.splice(this.mechanismList.length - 1, 1)
  396. },
  397. /************************/
  398. // 性别
  399. sexconfirm(e) {
  400. console.log(e);
  401. this.form.sex = e[0].label
  402. console.log(this.form.sex);
  403. },
  404. /*******************接口*********************/
  405. //省
  406. provinceconfirm: async function() {
  407. // 点击请求接口
  408. let res = await this.$request.post('doctor/getCityList', {
  409. 'type': 1
  410. });
  411. // console.log('省', res.data)
  412. // this.provincelist = this.provincelist2 = res.data
  413. this.regionlist = res.data
  414. },
  415. //市
  416. cityconfirm: async function(e) {
  417. // parent_id为省份返回的id
  418. let res = await this.$request.post('doctor/getCityList', {
  419. 'type': 2,
  420. 'parent_id': e
  421. });
  422. console.log('市', res.data)
  423. if (this.province == 1) {
  424. this.citylist = res.data
  425. } else if (this.province == 2) {
  426. this.citylist2 = res.data
  427. }
  428. },
  429. //区
  430. areaconfirm: async function(e) {
  431. // parent_id为市返回的id
  432. let res = await this.$request.post('doctor/getCityList', {
  433. 'type': 3,
  434. 'parent_id': e
  435. });
  436. console.log('区', res.data)
  437. if (this.city == 1) {
  438. this.arealist = res.data
  439. } else if (this.city == 2) {
  440. this.arealist2 = res.data
  441. }
  442. },
  443. //医院
  444. hospitalconfirm: async function(p, c, a) {
  445. console.log(p, c, a)
  446. //organizations_ids为省市区返回的id字符串,顺序为,省id,市id,区id
  447. let res = await this.$request.post('doctor/get_city_id', {
  448. 'level_type': 4,
  449. "province": p,
  450. "city": c,
  451. "area": a,
  452. });
  453. if (res.status == 0) {
  454. this.hospitallist = res.data
  455. /**
  456. * 新需求,已经选择过的医院不再出现
  457. * 循环已经认证的机构,在里面找
  458. * */
  459. for (let i = 0; i < this.mechanismList.length; i++) {
  460. console.log('hospitalID', this.mechanismList[i].hospitalID)
  461. for (let j = 0; j < this.hospitallist.length; j++) {
  462. if (this.mechanismList[i].hospitalID == this.hospitallist[j].value) {
  463. this.hospitallist.splice(j, 1);
  464. }
  465. }
  466. // console.log('第'+i+'个数据',this.mechanismList[i].hospitalText)
  467. // let a = this.mechanismList[i].hospitalText.indexOf('-')
  468. // console.log('a',a)
  469. // if(a>0){
  470. // }
  471. }
  472. console.log('hospitallist', this.hospitallist)
  473. console.log('mechanismList', this.mechanismList)
  474. }
  475. },
  476. // //科室
  477. // departmentconfirm: async function(e) {
  478. // let res = await this.$request.post('doctor/getOfferList', {
  479. // 'type': 1
  480. // });
  481. // if (this.hospital == 1) {
  482. // this.departmentlist = res.data
  483. // console.log('科室列表', this.departmentlist)
  484. // } else if (this.hospital == 2) {
  485. // this.departmentlist2 = res.data
  486. // }
  487. // },
  488. // //资质
  489. // qualificationsconfirm: async function(e) {
  490. // let res = await this.$request.post('doctor/getOfferList', {
  491. // 'type': 2
  492. // });
  493. // if (this.department == 1) {
  494. // this.qualificationslist = res.data
  495. // console.log('资质列表', this.qualificationslist)
  496. // } else if (this.department == 2) {
  497. // this.qualificationslist2 = res.data
  498. // }
  499. // },
  500. // 保存
  501. bc: async function() {
  502. if (this.mechanismList[this.mechanismList.length - 1].preservation == false) {
  503. uni.showModal({
  504. 'title': '请先保存机构!'
  505. })
  506. return false;
  507. }
  508. //保存之后改变机构信息状态
  509. /* this.mechanismList.map(val => {
  510. //判断是不是新增的数据 状态为0
  511. if(val.Submit==0){
  512. val.Submit = 1;
  513. }
  514. }) */
  515. //照片
  516. let practice = [] //证书
  517. let card_photo = [] //身份证
  518. let is_quali = [] //资格
  519. // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
  520. // practice = this.$refs.uUpload.lists.filter(val => {
  521. // return val.progress == 100;
  522. // })
  523. // card_photo = this.$refs.uUpload.lists.filter(val => {
  524. // return val.progress == 100;
  525. // })
  526. // is_quail = this.$refs.uUpload.lists.filter(val => {
  527. // return val.progress == 100;
  528. // })
  529. // 如果您不需要进行太多的处理,直接如下即可
  530. /* practice = this.$refs.Upractice.lists; //证书
  531. card_photo = this.$refs.Ucard_photo.lists; //身份证
  532. is_quali = this.$refs.Uis_quali.lists; //资格
  533. if (typeof practice[0] == 'undefined' || typeof practice[1] == 'undefined') {
  534. uni.showToast({
  535. 'title': '医师职业证书必填',
  536. icon: "none"
  537. })
  538. return false;
  539. }
  540. if (typeof card_photo[0] == 'undefined' || typeof card_photo[1] == 'undefined') {
  541. uni.showToast({
  542. 'title': '身份证必填',
  543. icon: "none"
  544. })
  545. return false;
  546. }
  547. if (typeof is_quali[0] == 'undefined' || typeof is_quali[1] == 'undefined') {
  548. uni.showToast({
  549. 'title': '资格证必填',
  550. icon: "none"
  551. })
  552. return false;
  553. }
  554. this.form.certificate = [practice[0].response.data.url, practice[1].response.data.url]
  555. this.form.idPhoto = [card_photo[0].response.data.url, card_photo[1].response.data.url]
  556. this.form.doctorQualification = [is_quali[0].response.data.url, is_quali[1].response.data.url] */
  557. if (typeof this.form.works != 'string') {
  558. this.form.works = JSON.stringify(this.form.works);
  559. }
  560. console.log('提交表单!', this.form);
  561. // 注意要 {'doctor_name':'ddd',doctor_sex:1....}分开传值因为我方便拦截垃圾数据
  562. let res = await this.$request.post('doctor/addthen', this.form);
  563. console.log('res...:', res);
  564. if (res.status == 0) {
  565. // uni.switchTab({
  566. // url: '../index/index'
  567. // })
  568. uni.navigateBack({
  569. delta: 1
  570. })
  571. } else {
  572. uni.showToast({
  573. icon: 'none',
  574. title: res.message
  575. })
  576. }
  577. },
  578. certificateChooseImage() {
  579. let arr = []
  580. uni.chooseImage({
  581. count: 9, //默认9
  582. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  583. sourceType: ['album', 'camera'], //从相册选择
  584. success: (res) => {
  585. if (arr.length != 0) {
  586. arr = arr.concat(res.tempFilePaths)
  587. arr.forEach(item => {
  588. this.$request.upload("Common/uploadFile", item, {}).then(data => {
  589. this.form.certificate.push(JSON.parse(data).data.url)
  590. })
  591. })
  592. } else {
  593. arr = res.tempFilePaths
  594. arr.forEach(item => {
  595. this.$request.upload("Common/uploadFile", item, {}).then(data => {
  596. this.form.certificate.push(JSON.parse(data).data.url)
  597. })
  598. })
  599. }
  600. }
  601. });
  602. },
  603. idPhotoChooseImage() {
  604. let arr = []
  605. uni.chooseImage({
  606. count: 2, //默认9
  607. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  608. sourceType: ['album', 'camera'], //从相册选择
  609. success: (res) => {
  610. if (arr.length != 0) {
  611. arr = arr.concat(res.tempFilePaths)
  612. arr.forEach(item => {
  613. this.$request.upload("Common/uploadFile", item, {}).then(data => {
  614. this.form.idPhoto.push(JSON.parse(data).data.url)
  615. })
  616. })
  617. } else {
  618. arr = res.tempFilePaths
  619. arr.forEach(item => {
  620. this.$request.upload("Common/uploadFile", item, {}).then(data => {
  621. this.form.idPhoto.push(JSON.parse(data).data.url)
  622. })
  623. })
  624. }
  625. }
  626. });
  627. },
  628. doctorQualificationChooseImage() {
  629. let arr = []
  630. uni.chooseImage({
  631. count: 9, //默认9
  632. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  633. sourceType: ['album', 'camera'], //从相册选择
  634. success: (res) => {
  635. if (arr.length != 0) {
  636. arr = arr.concat(res.tempFilePaths)
  637. arr.forEach(item => {
  638. this.$request.upload("Common/uploadFile", item, {}).then(data => {
  639. this.form.doctorQualification.push(JSON.parse(data).data.url)
  640. })
  641. })
  642. } else {
  643. arr = res.tempFilePaths
  644. arr.forEach(item => {
  645. this.$request.upload("Common/uploadFile", item, {}).then(data => {
  646. this.form.doctorQualification.push(JSON.parse(data).data.url)
  647. })
  648. })
  649. }
  650. }
  651. });
  652. },
  653. certificateDelImg(e) {
  654. uni.showModal({
  655. title: '提示',
  656. content: '确定要删除吗?',
  657. cancelText: '再想想',
  658. confirmText: '删除',
  659. success: res => {
  660. if (res.confirm) {
  661. this.form.certificate.splice(e.currentTarget.dataset.index, 1);
  662. this.form.certificate = this.form.certificate
  663. }
  664. }
  665. })
  666. },
  667. idPhotoDelImg(e) {
  668. uni.showModal({
  669. title: '提示',
  670. content: '确定要删除吗?',
  671. cancelText: '再想想',
  672. confirmText: '删除',
  673. success: res => {
  674. if (res.confirm) {
  675. this.form.idPhoto.splice(e.currentTarget.dataset.index, 1);
  676. this.form.idPhoto = this.form.idPhoto
  677. }
  678. }
  679. })
  680. },
  681. doctorQualificationDelImg(e) {
  682. uni.showModal({
  683. title: '提示',
  684. content: '确定要删除吗?',
  685. cancelText: '再想想',
  686. confirmText: '删除',
  687. success: res => {
  688. if (res.confirm) {
  689. this.form.doctorQualification.splice(e.currentTarget.dataset.index, 1);
  690. this.form.doctorQualification = this.form.doctorQualification
  691. }
  692. }
  693. })
  694. },
  695. }
  696. };
  697. </script>
  698. <style scoped lang="scss">
  699. page {
  700. background-color: #f0f2f5;
  701. }
  702. .bottomButton {
  703. position: fixed;
  704. bottom: 0;
  705. left: 0;
  706. width: 100%;
  707. height: 100rpx;
  708. display: flex;
  709. align-items: center;
  710. justify-content: center;
  711. background-color: #0B73B9;
  712. color: #FFFFFF;
  713. z-index: 99;
  714. font-size: 32rpx;
  715. }
  716. .xiala {
  717. width: 50%;
  718. flex-direction: row-reverse;
  719. align-items: center;
  720. display: flex;
  721. }
  722. </style>