batchRecord.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <template>
  2. <view class="content">
  3. <view class="top-box align-center justify-between">
  4. <view class="title">检查时间</view>
  5. <view class="align-center">
  6. <view class="time">{{date}}</view>
  7. <image src="/static/images/health/right_arrow_right_icon24.png" class="w48 h48"></image>
  8. </view>
  9. </view>
  10. <!-- <mescroll-body ref="mescrollRef"> -->
  11. <view class="phone-list">
  12. <view class="title-top align-center">
  13. <view class="left">记录指标</view>
  14. <!-- <view class="right align-center" @click="navgetTo()">
  15. <image src="/static/images/user/edit_add_icon12.png" class="w24 h24"></image>
  16. <text>编辑指标</text>
  17. </view> -->
  18. </view>
  19. <view v-for="(item,index) in dataList" :key="index" :class="item.testValue==null?'item edit':'item'">
  20. <view class="phone-name">
  21. <view class="name">{{item.indicatorName}}{{item.description&&item.description!==null?'('+item.description+')':''}}
  22. </view>
  23. <input type="digit" v-model="item.testValue" placeholder="请输入测量值" placeholder-class="form-input"/>
  24. <!-- <view v-if="item.testValue" class="num">{{item.testValue||''}}</view> -->
  25. </view>
  26. <view class="text">参考范围:{{item.refRange||''}} 单位:{{item.unitName||''}}</view>
  27. </view>
  28. </view>
  29. <!-- </mescroll-body> -->
  30. <view class="h160"></view>
  31. <view class="btn-box2">
  32. <!-- <view class="sub-btn2" @click="navgetTo('/pages_user/user/myFolder')">
  33. <image src="/static/images/user/nav_add_icon25.png" class="w48 h48"></image>
  34. <text>识别导入</text>
  35. </view> -->
  36. <view class="sub-btn" @click="submit()">
  37. <text>保存</text>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. listByReport,
  45. listByIndicator,
  46. addBatchAdd,
  47. deleteResult,
  48. listEnabled,
  49. updateBatch
  50. } from '@/api/companyUser.js'
  51. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  52. export default {
  53. mixins: [MescrollMixin],
  54. data() {
  55. return {
  56. orderStatus: [{
  57. name: "电话记录",
  58. val: 1
  59. },
  60. {
  61. name: "短信记录",
  62. val: 2
  63. },
  64. ],
  65. date: null,
  66. showType: 1,
  67. mescroll: null,
  68. // 上拉加载的配置
  69. upOption: {
  70. onScroll: true,
  71. use: true, // 是否启用上拉加载; 默认true
  72. page: {
  73. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  74. size: 10 // 每页数据的数量,默认10
  75. },
  76. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  77. empty: {
  78. icon: '/static/images/no_data.png',
  79. tip: '暂无数据'
  80. }
  81. },
  82. // 列表数据
  83. dataList: [
  84. // {
  85. // orderId: 1,
  86. // name: '大血小板比率(P-LCR)',
  87. // num: 13,
  88. // text: '参考值:15.9~43.47 %',
  89. // edit: 0
  90. // },
  91. // {
  92. // orderId: 2,
  93. // name: '血小板体积分布宽度(PDW)',
  94. // num: 11,
  95. // text: '参考范围:0-1.75 单位:U/L',
  96. // edit: 0
  97. // },
  98. // {
  99. // orderId: 3,
  100. // name: '血小板体积分布宽度(PDW)',
  101. // text: '参考范围:0-1.75 单位:U/L',
  102. // edit: 1
  103. // }
  104. ],
  105. }
  106. },
  107. onLoad(options) {
  108. if (options.id) {
  109. this.reportId = options.id;
  110. this.listByReport()
  111. }
  112. this.date = options.date
  113. // uni.$on('refreshDoctorOrder', () => {
  114. // this.mescroll.resetUpScroll()
  115. // })
  116. },
  117. methods: {
  118. pay(item) {
  119. uni.navigateTo({
  120. url: '/pages_/doctor/paymentOrder?orderId=' + item.orderId
  121. })
  122. },
  123. navgetTo(url) {
  124. uni.navigateTo({
  125. url: '/pages_user/user/addResult?type=add&reportId=' + this.reportId
  126. })
  127. },
  128. listByReport() {
  129. listByReport(this.reportId).then(
  130. res => {
  131. if (res.code == 200) {
  132. this.dataList = res.data;
  133. } else {
  134. uni.showToast({
  135. title: res.msg,
  136. });
  137. }
  138. },
  139. rej => {}
  140. );
  141. },
  142. cancel(item, index) {
  143. var that = this;
  144. // let test = 'swipeAction' + index
  145. uni.showModal({
  146. title: '提示',
  147. content: '确定删除指标吗',
  148. success: function(res) {
  149. if (res.confirm) {
  150. // var data = {
  151. // orderId:item.orderId
  152. // };
  153. deleteResult(item.resultId).then(res => {
  154. if (res.code == 200) {
  155. uni.showToast({
  156. icon: 'success',
  157. title: '删除成功',
  158. });
  159. that.listByReport()
  160. // that.$refs[test][0].closeHandler()
  161. // that.mescroll.resetUpScroll()
  162. } else {
  163. uni.showToast({
  164. icon: 'none',
  165. title: res.msg,
  166. });
  167. }
  168. });
  169. } else if (res.cancel) {
  170. // that.$refs[test][0].closeHandler()
  171. }
  172. }
  173. });
  174. },
  175. submit() {
  176. // if(this.form.recordDate==null){
  177. // uni.showToast({
  178. // icon:'none',
  179. // title: "日期不能为空",
  180. // });
  181. // return;
  182. // }
  183. // if(this.form.recordTime==null){
  184. // uni.showToast({
  185. // icon:'none',
  186. // title: "记录时间不能为空",
  187. // });
  188. // return;
  189. // }
  190. // if(this.form.mealDescription==null){
  191. // uni.showToast({
  192. // icon:'none',
  193. // title: "用餐情况不能为空",
  194. // });
  195. // return;
  196. // }
  197. // this.formList.push(this.form)
  198. // this.addReport()
  199. const data = this.dataList.map(item => ({
  200. reportId: this.reportId,
  201. resultId: item.resultId,
  202. abnormalType: item.abnormalType,
  203. indicatorCateId: item.indicatorCateId,
  204. indicatorId: item.indicatorId,
  205. indicatorName: item.indicatorName,
  206. isAbnormal: item.isAbnormal,
  207. remarks: item.remarks,
  208. testResult: item.testResult,
  209. testValue: item.testValue
  210. }));
  211. this.updateReport(data)
  212. // if(this.type=="add"){
  213. // this.addReport()
  214. // }
  215. // else if(this.type=="edit"){
  216. // this.updateReport()
  217. // }
  218. },
  219. updateReport(data) {
  220. updateBatch(data).then(
  221. res => {
  222. if (res.code == 200) {
  223. uni.showToast({
  224. icon: 'success',
  225. title: "更新成功",
  226. });
  227. setTimeout(function() {
  228. uni.$emit('refreshInformation');
  229. uni.navigateBack({
  230. delta: 1
  231. })
  232. }, 500);
  233. } else {
  234. uni.showToast({
  235. icon: 'none',
  236. title: res.msg,
  237. });
  238. }
  239. },
  240. rej => {}
  241. );
  242. },
  243. addReport() {
  244. const list = this.dataList.filter(item => item.testValue !== null && item.testValue !== undefined)
  245. const data = list.map(item => ({
  246. reportId: this.reportId,
  247. resultId: item.resultId,
  248. abnormalType: item.abnormalType,
  249. indicatorCateId: item.indicatorCateId,
  250. indicatorId: item.indicatorId,
  251. indicatorName: item.indicatorName,
  252. isAbnormal: item.isAbnormal,
  253. remarks: item.remarks,
  254. testResult: item.testResult,
  255. testValue: item.testValue
  256. }));
  257. addBatchAdd(data).then(
  258. res => {
  259. if (res.code == 200) {
  260. uni.showToast({
  261. icon: 'success',
  262. title: "操作成功",
  263. });
  264. setTimeout(function() {
  265. uni.$emit('refreshInformation');
  266. uni.navigateBack({
  267. delta: 1
  268. })
  269. }, 500);
  270. } else {
  271. uni.showToast({
  272. icon: 'none',
  273. title: res.msg,
  274. });
  275. }
  276. },
  277. rej => {}
  278. );
  279. },
  280. // tab切换
  281. orderStatusChange(item) {
  282. this.showType = item.val
  283. // this.mescroll.resetUpScroll()
  284. },
  285. mescrollInit(mescroll) {
  286. this.mescroll = mescroll;
  287. },
  288. /*下拉刷新的回调 */
  289. downCallback(mescroll) {
  290. mescroll.resetUpScroll()
  291. },
  292. upCallback(page) {
  293. //联网加载数据
  294. var that = this;
  295. var data = {
  296. status: this.showType,
  297. page: page.num,
  298. pageSize: page.size
  299. };
  300. // getMyDoctorOrderList(data).then(res => {
  301. // if(res.code==200){
  302. // //设置列表数据
  303. // if (page.num == 1) {
  304. // that.dataList = res.data.list;
  305. // } else {
  306. // that.dataList = that.dataList.concat(res.data.list);
  307. // }
  308. // that.mescroll.endBySize(res.data.list.length, res.data.total);
  309. // }else{
  310. // uni.showToast({
  311. // icon:'none',
  312. // title: "请求失败",
  313. // });
  314. // that.dataList = null;
  315. // that.mescroll.endErr();
  316. // }
  317. // });
  318. },
  319. showDetail(item) {
  320. uni.navigateTo({
  321. url: '/pages_user/user/addResult?type=edit&id=' + item.resultId
  322. })
  323. }
  324. }
  325. }
  326. </script>
  327. <style lang="scss">
  328. .content {
  329. padding: 20upx;
  330. .top-box {
  331. padding: 30rpx;
  332. background: #FFFFFF;
  333. border-radius: 16rpx 16rpx 16rpx 16rpx;
  334. margin-bottom: 20rpx;
  335. .title {
  336. font-family: PingFang SC, PingFang SC;
  337. font-weight: 500;
  338. font-size: 32rpx;
  339. color: #222426;
  340. // line-height: 34rpx;
  341. }
  342. .time {
  343. font-weight: 400;
  344. font-size: 32rpx;
  345. color: #222426;
  346. // line-height: 34rpx;
  347. text-align: right;
  348. }
  349. }
  350. .btn-box2 {
  351. z-index: 9999;
  352. width: 100%;
  353. padding: 30upx;
  354. position: fixed;
  355. bottom: 0;
  356. left: 0;
  357. box-sizing: border-box;
  358. background: #FFFFFF;
  359. display: flex;
  360. align-items: center;
  361. justify-content: space-between;
  362. padding-bottom: 40rpx;
  363. .sub-btn {
  364. flex: 1;
  365. // width: 100%;
  366. height: 88upx;
  367. line-height: 88upx;
  368. text-align: center;
  369. font-size: 32upx;
  370. font-family: PingFang SC;
  371. font-weight: bold;
  372. color: #FFFFFF;
  373. background: #008FD3;
  374. border-radius: 44upx;
  375. display: flex;
  376. align-items: center;
  377. border: 2rpx solid #008FD3;
  378. justify-content: center;
  379. }
  380. .sub-btn2 {
  381. flex: 1;
  382. height: 88upx;
  383. line-height: 88upx;
  384. display: flex;
  385. align-items: center;
  386. justify-content: center;
  387. text-align: center;
  388. font-size: 32rpx;
  389. color: #fff;
  390. font-family: PingFang SC;
  391. font-weight: bold;
  392. background: #FF5030;
  393. border-radius: 44rpx 44rpx 44rpx 44rpx;
  394. margin-right: 20rpx;
  395. image {
  396. margin-right: 16rpx;
  397. }
  398. }
  399. }
  400. .phone-list {
  401. padding: 30rpx;
  402. background: #FFFFFF;
  403. border-radius: 16rpx 16rpx 16rpx 16rpx;
  404. .title-top {
  405. margin-bottom: 30rpx;
  406. .left {
  407. font-family: PingFang SC, PingFang SC;
  408. font-weight: 600;
  409. font-size: 32rpx;
  410. color: #222426;
  411. text-align: left;
  412. }
  413. .right {
  414. text {
  415. font-weight: 400;
  416. font-size: 24rpx;
  417. color: #008FD3;
  418. text-align: right;
  419. margin-left: 5rpx;
  420. }
  421. }
  422. }
  423. .item {
  424. display: flex;
  425. flex-direction: column;
  426. align-items: flex-start;
  427. justify-content: space-between;
  428. padding: 20rpx;
  429. margin-bottom: 20rpx;
  430. background: linear-gradient(360deg, #F0FAFF 0%, #DEF4FF 100%);
  431. border-radius: 16rpx 16rpx 16rpx 16rpx;
  432. border: 2rpx solid rgba(0, 143, 211, 0.5);
  433. height: 158rpx;
  434. box-sizing: border-box;
  435. &:last-child {
  436. margin-bottom: 0;
  437. }
  438. &.edit {
  439. background: #FFF6EA;
  440. border-radius: 16rpx 16rpx 16rpx 16rpx;
  441. border: 2rpx solid #F3CDA7;
  442. }
  443. .phone-name {
  444. // height: 158rpx;
  445. display: flex;
  446. align-items: center;
  447. justify-content: space-between;
  448. width: 100%;
  449. .name {
  450. font-family: PingFang SC, PingFang SC;
  451. font-weight: 600;
  452. font-size: 32rpx;
  453. color: #222426;
  454. text-align: left;
  455. }
  456. input {
  457. text-align: right;
  458. }
  459. .form-input {
  460. font-size: 32upx;
  461. font-family: PingFang SC;
  462. font-weight: 400;
  463. color: #999999;
  464. text-align: right;
  465. }
  466. .num {
  467. font-weight: 600;
  468. font-size: 32rpx;
  469. }
  470. }
  471. .text {
  472. font-family: PingFang SC, PingFang SC;
  473. font-weight: 400;
  474. font-size: 24rpx;
  475. color: #898E91;
  476. text-align: left;
  477. }
  478. }
  479. }
  480. .sms-list {
  481. .item {
  482. padding: 30rpx;
  483. background: #FFFFFF;
  484. border-radius: 16rpx 16rpx 16rpx 16rpx;
  485. margin-bottom: 20rpx;
  486. .title {
  487. font-family: PingFang SC;
  488. font-weight: 500;
  489. font-size: 32rpx;
  490. color: #222426;
  491. text-align: left;
  492. }
  493. .box {
  494. display: flex;
  495. align-items: center;
  496. justify-content: space-between;
  497. padding-top: 22rpx;
  498. .time {
  499. font-family: PingFang SC;
  500. font-weight: 400;
  501. font-size: 24rpx;
  502. color: #898E91;
  503. text-align: left;
  504. }
  505. .state {
  506. font-family: PingFang SC;
  507. font-weight: 400;
  508. font-size: 24rpx;
  509. color: #2CAE5C;
  510. text-align: right;
  511. }
  512. }
  513. }
  514. }
  515. }
  516. </style>