infoPage.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="gradingControl-infoPage">
  3. <view class="text-box">
  4. <view>管控名称:</view>
  5. <view>{{newData.name}}</view>
  6. </view>
  7. <view class="text-box">
  8. <view>二级单位:</view>
  9. <view>{{newData.deptName}}</view>
  10. </view>
  11. <view class="text-box">
  12. <view>安全分类:</view>
  13. <view>{{newData.typeName}}</view>
  14. </view>
  15. <view class="text-box">
  16. <view>安全分级:</view>
  17. <view>{{newData.levelName}}</view>
  18. </view>
  19. <view class="text-box">
  20. <view>管控描述:</view>
  21. <view>{{newData.manageDes}}</view>
  22. </view>
  23. <view class="text-box">
  24. <view>执行状态:</view>
  25. <view :class="newData.status == 1?'colorA':'colorB'">{{newData.status == 1?'已执行':'未执行'}}</view>
  26. </view>
  27. <view class="text-box" v-if="newData.status == 1">
  28. <view>执行人:</view>
  29. <view>{{newData.executionUser}}</view>
  30. </view>
  31. <view class="text-box" v-if="newData.status == 1">
  32. <view>执行时间:</view>
  33. <view>{{newData.executionTime}}</view>
  34. </view>
  35. <view class="text-box" v-if="newData.status == 1">
  36. <view>执行备注:</view>
  37. <view>{{newData.remark}}</view>
  38. </view>
  39. <view class="text-box" v-if="newData.status == 0">
  40. <view>执行备注:</view>
  41. <textarea v-model="inputData" class="input-box" placeholder="请输入执行备注" maxlength="50"></textarea>
  42. </view>
  43. <view class="null-p"></view>
  44. <view class="button-p" v-if="newData.status == 0" @click="buttonClick">执行</view>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. parseTime
  50. } from '@/component/public.js'
  51. import {
  52. laboratoryGradeManageExecute,
  53. } from '@/pages_manage/api/index.js'
  54. export default {
  55. name: "gradingControl-infoPage",
  56. data() {
  57. return {
  58. //列表数据
  59. newData: {},
  60. inputData: "",
  61. }
  62. },
  63. onLoad(option) {
  64. this.$set(this, 'newData', JSON.parse(decodeURIComponent(option.infoData)));
  65. },
  66. onShow() {
  67. this.$nextTick(() => {
  68. this.newData.executionTime = parseTime(this.newData.executionTime, "{y}-{m}-{d} {h}:{i}")
  69. })
  70. },
  71. methods: {
  72. buttonClick() {
  73. let self = this;
  74. if (!this.inputData) {
  75. uni.showToast({
  76. title: '请输入执行备注',
  77. icon: "none",
  78. mask: true,
  79. duration: 2000
  80. });
  81. return
  82. }
  83. uni.showModal({
  84. // title: '确认要退出吗?',
  85. content: '确认提交?',
  86. cancelColor: "#999",
  87. confirmColor: "#0183FA",
  88. success: function(res) {
  89. if (res.confirm) {
  90. self.laboratoryGradeManageExecute();
  91. } else if (res.cancel) {}
  92. }
  93. });
  94. },
  95. async laboratoryGradeManageExecute() {
  96. let obj = {
  97. id: this.newData.id,
  98. remark: this.inputData,
  99. status: 1,
  100. }
  101. const {
  102. data
  103. } = await laboratoryGradeManageExecute(obj);
  104. if (data.code == 200) {
  105. uni.showToast({
  106. title: data.message,
  107. icon: "none",
  108. mask: true,
  109. duration: 2000
  110. });
  111. setTimeout(function() {
  112. uni.redirectTo({
  113. url: '/pages_manage/views/gradingControl/gradingControl'
  114. });
  115. }, 2000);
  116. }
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="stylus" scoped>
  122. .gradingControl-infoPage {
  123. height: 100%;
  124. display: flex;
  125. flex-direction: column;
  126. background: #fff;
  127. padding: 0 20rpx;
  128. .text-box:nth-child(1) {
  129. margin-top: 30rpx;
  130. }
  131. .text-box {
  132. display: flex;
  133. font-size: 32rpx;
  134. color: #333;
  135. view:nth-child(1) {
  136. width: 160rpx;
  137. line-height: 60rpx;
  138. }
  139. view:nth-child(2) {
  140. flex: 1;
  141. line-height: 40rpx;
  142. padding: 10rpx 0;
  143. }
  144. .colorA {
  145. color: #0183FA;
  146. }
  147. .colorB {
  148. color: #666;
  149. }
  150. .input-box {
  151. margin-top: 20rpx;
  152. height: 200rpx;
  153. width: 500rpx;
  154. padding: 10rpx;
  155. border: 1px solid #dedede;
  156. border-radius: 12rpx;
  157. }
  158. }
  159. .null-p {
  160. flex: 1;
  161. }
  162. .button-p {
  163. font-size: 32rpx;
  164. text-align: center;
  165. line-height: 60rpx;
  166. width: 200rpx;
  167. border-radius: 8rpx;
  168. margin: 40rpx auto;
  169. background-color: #0183FA;
  170. color: #fff;
  171. }
  172. }
  173. </style>infoPage