addSchedule.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <template>
  2. <view class="content">
  3. <view class="inner">
  4. <view class="time-box">
  5. <view class="time">2025年7月15日</view>
  6. <view class="txt">今日待办</view>
  7. <view class="num">10</view>
  8. </view>
  9. <view class="form-box">
  10. <text class="form-title">开始时间</text>
  11. <view class="form-item">
  12. <picker class="birth-picker" mode="date" @change="bindDateChange">
  13. <view class="right-box">
  14. <view class="input-box">
  15. <input type="text" :value="form.birthday" placeholder="请选择日程开始时间" placeholder-class="form-input" disabled="disabled" />
  16. </view>
  17. <image class="w48 h48" src="/static/images/health/right_arrow_right_icon24.png"></image>
  18. </view>
  19. </picker>
  20. </view>
  21. <text class="form-title">日程安排</text>
  22. <view class="form-item">
  23. <textarea maxlength="200" class="form-textarea" v-model="form.remark" placeholder="请输入您的日程安排" placeholder-class="form-input" />
  24. </view>
  25. </view>
  26. </view>
  27. <view class="btn-box">
  28. <view class="sub-btn" @click="submit()">
  29. 添加
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. getDocDetails,
  37. addDoc,
  38. editDoc
  39. } from '@/api/doc.js'
  40. export default {
  41. data() {
  42. return {
  43. type: null,
  44. patientId: null,
  45. famaleurl:"/static/images/health/female_profile.png",
  46. maleurl:"/static/images/health/my_heads.png",
  47. checked:1,
  48. array:['是','否'],
  49. tags: [{
  50. name: '心脏病',
  51. checked:true,
  52. id: 1
  53. },
  54. {
  55. name: '脑梗死',
  56. checked:false,
  57. id: 2
  58. },{
  59. name: '肾病',
  60. checked:false,
  61. id: 3
  62. },{
  63. name: '脂肪肝',
  64. checked:false,
  65. id: 4
  66. }],
  67. form: {
  68. userName: null,
  69. idCard: null,
  70. sex: null,
  71. birthday: null,
  72. remark: null,
  73. }
  74. };
  75. },
  76. onLoad(option) {
  77. this.type = option.type;
  78. console.log(this.type)
  79. if (this.type == 'edit') {
  80. this.docId = option.docId;
  81. // this.getDocDetails();
  82. }
  83. },
  84. methods: {
  85. sexChange(type) {
  86. this.form.sex = type
  87. },
  88. radioClick(item) {
  89. this.checked=item.id
  90. },
  91. getDocDetails() {
  92. var data = {
  93. docId: this.docId
  94. };
  95. getDocDetails(data).then(
  96. res => {
  97. if (res.code == 200) {
  98. this.form = res.data;
  99. } else {
  100. uni.showToast({
  101. title: res.msg,
  102. });
  103. }
  104. },
  105. rej => {}
  106. );
  107. },
  108. onChooseAvatar(e){
  109. let {
  110. avatarUrl
  111. } = e.detail;
  112. uni.uploadFile({
  113. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  114. filePath: avatarUrl,
  115. name: 'file',
  116. formData: {
  117. 'user': 'test' // 上传附带参数
  118. },
  119. success: (uploadFileRes) => {
  120. this.user.avatar =JSON.parse(uploadFileRes.data).url
  121. }
  122. });
  123. },
  124. submit() {
  125. // if (this.form.userName == null) {
  126. // uni.showToast({
  127. // icon: 'none',
  128. // title: "姓名不能为空",
  129. // });
  130. // return;
  131. // }
  132. // if (this.form.idCard == null) {
  133. // uni.showToast({
  134. // icon: 'none',
  135. // title: "身份证号不能为空",
  136. // });
  137. // return;
  138. // }
  139. // if (this.form.sex == null) {
  140. // uni.showToast({
  141. // icon: 'none',
  142. // title: "性别不能为空",
  143. // });
  144. // return;
  145. // }
  146. // if (this.form.birthday == null) {
  147. // uni.showToast({
  148. // icon: 'none',
  149. // title: "出生年月不能为空",
  150. // });
  151. // return;
  152. // }
  153. // if (this.type == "add") {
  154. // this.addDoc()
  155. // } else if (this.type == "edit") {
  156. // this.editDoc()
  157. // }
  158. uni.navigateTo({
  159. url: '/pages_health/doc?type=edit&docId='
  160. })
  161. },
  162. editDoc() {
  163. editDoc(this.form).then(
  164. res => {
  165. if (res.code == 200) {
  166. uni.showToast({
  167. icon: 'success',
  168. title: "操作成功",
  169. });
  170. setTimeout(function() {
  171. uni.$emit('refreshDoc');
  172. uni.navigateBack({
  173. delta: 1
  174. })
  175. }, 500);
  176. } else {
  177. uni.showToast({
  178. icon: 'none',
  179. title: res.msg,
  180. });
  181. }
  182. },
  183. rej => {}
  184. );
  185. },
  186. addDoc() {
  187. addDoc(this.form).then(
  188. res => {
  189. if (res.code == 200) {
  190. uni.showToast({
  191. icon: 'success',
  192. title: "操作成功",
  193. });
  194. setTimeout(function() {
  195. uni.$emit('refreshDoc');
  196. uni.navigateBack({
  197. delta: 1
  198. })
  199. }, 500);
  200. } else {
  201. uni.showToast({
  202. icon: 'none',
  203. title: res.msg,
  204. });
  205. }
  206. },
  207. rej => {}
  208. );
  209. },
  210. // 出生日期选择
  211. bindDateChange: function(e) {
  212. this.form.birthday = e.target.value
  213. },
  214. }
  215. }
  216. </script>
  217. <style lang="scss">
  218. page {
  219. height: 100%;
  220. }
  221. .content {
  222. height: 100%;
  223. display: flex;
  224. flex-direction: column;
  225. justify-content: space-between;
  226. .inner {
  227. // height: calc(100% - 120upx);
  228. // padding: 20upx;
  229. background: #008FD3;
  230. .time-box{
  231. padding: 30rpx;
  232. text-align: left;
  233. .time{
  234. font-family: PingFang SC;
  235. font-weight: 500;
  236. font-size: 28rpx;
  237. color: #FFFFFF;
  238. padding-bottom: 25rpx;
  239. }
  240. .txt{
  241. font-weight: 500;
  242. font-size: 24rpx;
  243. color: rgba(255,255,255,0.5);
  244. padding-bottom: 12rpx;
  245. }
  246. .num{
  247. font-family: Roboto, Roboto;
  248. font-weight: 500;
  249. font-size: 64rpx;
  250. color: #FFFFFF;
  251. }
  252. }
  253. .form-box {
  254. padding: 0 30upx;
  255. background: #FFFFFF;
  256. border-radius: 32upx;
  257. margin-bottom: -40upx;
  258. .form-title {
  259. font-family: PingFang SC;
  260. font-weight: 600;
  261. font-size: 36rpx;
  262. color: #222426;
  263. text-align: left;
  264. padding: 30rpx 0;
  265. display: block;
  266. }
  267. .form-item {
  268. padding: 30upx 0;
  269. display: flex;
  270. align-items: flex-start;
  271. border-bottom: 1px solid #F1F1F1;
  272. &:last-child {
  273. border-bottom: none;
  274. }
  275. .label {
  276. width: 300upx;
  277. text-align: left;
  278. font-size: 32upx;
  279. line-height: 44upx;
  280. font-family: PingFang SC;
  281. font-weight: 500;
  282. color: #222222;
  283. flex-shrink: 0;
  284. }
  285. input {
  286. text-align:left;
  287. }
  288. .form-input {
  289. font-size: 30upx;
  290. font-family: PingFang SC;
  291. // font-weight: 500;
  292. color: #B2B2B2;
  293. text-align: left;
  294. }
  295. .form-item-tag{
  296. margin-right: 16rpx;
  297. .tag{
  298. border-radius: 8rpx 8rpx 8rpx 8rpx;
  299. border: 2rpx solid #ECECEC;
  300. display: flex;
  301. align-items: center;
  302. padding: 24rpx;
  303. font-family: PingFang SC;
  304. font-weight: 400;
  305. font-size: 24rpx;
  306. &.active{
  307. background: #F0FAFF;
  308. border: 2rpx solid #008FD3;
  309. color: #008FD3;
  310. }
  311. }
  312. }
  313. .right{
  314. display: flex;
  315. align-items: center;
  316. }
  317. .sex-box{
  318. flex:1;
  319. display: flex;
  320. align-items: center;
  321. justify-content: flex-end;
  322. .sex-item{
  323. width: 146rpx;
  324. height: 64rpx;
  325. display: flex;
  326. align-items: center;
  327. justify-content: center;
  328. background: #F5F7FA;
  329. border-radius: 32rpx 32rpx 32rpx 32rpx;
  330. margin-left: 16rpx;
  331. .u-icon__icon{
  332. margin: 0;
  333. }
  334. text{
  335. // font-family: PingFang SC, PingFang SC;
  336. font-weight: 400;
  337. font-size: 28rpx;
  338. color: #898E91;
  339. margin-left: 12rpx;
  340. }
  341. &.active{
  342. background: #FCF0E7;
  343. text{
  344. color:#FF5030
  345. }
  346. }
  347. }
  348. }
  349. .form-textarea{
  350. font-size: 30upx;
  351. color: #999999;
  352. height: 100upx;
  353. padding: 4upx 0;
  354. }
  355. .birth-picker {
  356. width: 100%;
  357. .right-box{
  358. width: 100%;
  359. display: flex;
  360. align-items: center;
  361. justify-content: space-between;
  362. .input-box{
  363. flex: 1;
  364. // width: 470upx;
  365. }
  366. .arrow{
  367. width: 13upx;
  368. height: 23upx;
  369. margin-left: 20upx;
  370. }
  371. }
  372. }
  373. }
  374. }
  375. }
  376. .btn-box {
  377. height: 120upx;
  378. padding: 0 30upx;
  379. display: flex;
  380. align-items: center;
  381. justify-content: center;
  382. .sub-btn {
  383. width: 100%;
  384. height: 88upx;
  385. line-height: 88upx;
  386. text-align: center;
  387. font-size: 32upx;
  388. font-family: PingFang SC;
  389. font-weight: bold;
  390. color: #FFFFFF;
  391. background: #008FD3 ;
  392. border-radius: 44upx;
  393. margin-bottom: 40upx;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. image{
  398. margin-right: 16rpx;
  399. }
  400. }
  401. }
  402. }
  403. </style>