details.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <!-- @format -->
  2. <template>
  3. <view class="container">
  4. <view class="contentItems">
  5. <view class="content">
  6. <view class="title">器具类型</view>
  7. <view class="message">{{ ledgerDetails.typeName }} </view>
  8. </view>
  9. <view class="content">
  10. <view class="title">器具用途</view>
  11. <view class="message">{{ ledgerDetails.purposeName }} </view>
  12. </view>
  13. <view class="content">
  14. <view class="title">器具名称</view>
  15. <view class="message">{{ ledgerDetails.name }}</view>
  16. </view>
  17. <view class="content">
  18. <view class="title">器具种别 </view>
  19. <view class="message">{{ ledgerDetails.className }}</view>
  20. </view>
  21. <view class="content">
  22. <view class="title">创建时间</view>
  23. <view class="message">{{ ledgerDetails.createTime }}</view>
  24. </view>
  25. <!-- <view class="content">
  26. <view class="title">制作单位</view>
  27. <view class="message">{{ ledgerDetails.manufactoryName }}</view>
  28. </view> -->
  29. <view class="content">
  30. <view class="title">规格型号</view>
  31. <view class="message">{{ ledgerDetails.modelSpecific }}</view>
  32. </view>
  33. <view class="content">
  34. <view class="title">出厂编号</view>
  35. <view class="message">{{ ledgerDetails.serialNumber }}</view>
  36. </view>
  37. <view class="content">
  38. <view class="title">生产日期</view>
  39. <view class="message">{{ ledgerDetails.productionDate }}</view>
  40. </view>
  41. <view class="content">
  42. <view class="title">内部编号</view>
  43. <view class="message">{{ ledgerDetails.internalNumber }}</view>
  44. </view>
  45. <view class="content">
  46. <view class="title">申请状态</view>
  47. <view
  48. class="message"
  49. :style="{
  50. color:
  51. applicationColor[applicationStatus(ledgerDetails.checkStatus)],
  52. }"
  53. >{{ applicationStatus(ledgerDetails.checkStatus) }}</view
  54. >
  55. </view>
  56. <view class="content">
  57. <view class="title">器具检定状态</view>
  58. <view
  59. class="message"
  60. :style="{
  61. color:
  62. verificationColor[verificationStatus(ledgerDetails.checkStatus)],
  63. }"
  64. >{{ verificationStatus(ledgerDetails.checkStatus) }}</view
  65. >
  66. </view>
  67. <view class="content">
  68. <view class="title">备案状态</view>
  69. <view
  70. class="message"
  71. :style="{
  72. color: recordColor[recordStatus(ledgerDetails.auditStatus)],
  73. }"
  74. >{{ recordStatus(ledgerDetails.auditStatus) }}</view
  75. >
  76. </view>
  77. <view class="content">
  78. <view class="title">使用单位</view>
  79. <view class="message">{{ ledgerDetails.useUnitName }}</view>
  80. </view>
  81. <view class="content">
  82. <view class="title">单位区域</view>
  83. <view class="message">{{ ledgerDetails.useAddrName }}</view>
  84. </view>
  85. <view class="content">
  86. <view class="title">使用地点</view>
  87. <view class="message">{{
  88. ledgerDetails.setupPlace ? ledgerDetails.setupPlace : ""
  89. }}</view>
  90. </view>
  91. <!-- <view class="content">
  92. <view class="title">购置日期</view>
  93. <view class="message">{{ }}</view>
  94. </view> -->
  95. </view>
  96. <view class="history">
  97. <u-button
  98. @click="handleVerificationHistory"
  99. :customStyle="{ width: '300rpx' }"
  100. type="success"
  101. shape="circle"
  102. :plain="true"
  103. size="small"
  104. >检定记录</u-button
  105. >
  106. <u-button
  107. @click="handleRecordHistory"
  108. :customStyle="{ width: '300rpx' }"
  109. type="primary"
  110. shape="circle"
  111. :plain="true"
  112. size="small"
  113. >备案记录</u-button
  114. >
  115. </view>
  116. <view style="height: 100rpx"></view>
  117. </view>
  118. </template>
  119. <script>
  120. import { getLedgerDetails } from "@/api/Ledger";
  121. import { useDict, paraseDict } from "@/utils/index";
  122. export default {
  123. data() {
  124. return {
  125. ledgerDetails: {},
  126. verificationColor: {
  127. 未检定: "#909399",
  128. 已校准: "#19be6b",
  129. 已检定: "#19be6b",
  130. 不合格: "#fa3534",
  131. 已超期: "#fa3534",
  132. },
  133. applicationColor: {
  134. 已中止: "#fa3534",
  135. 已完成: "#19be6b",
  136. 未申请: "#909399",
  137. 不受理: "#fa3534",
  138. 办理中: "#2979ff",
  139. },
  140. recordColor: {
  141. 已撤回: "#fa3534",
  142. 已接收: "#19be6b",
  143. 待提交: "#2979ff",
  144. 备案中: "#2979ff",
  145. 已拒绝: "#fa3534",
  146. 勿备案: "#fa3534",
  147. 未备案: "#909399",
  148. 免备案: "#909399",
  149. 已退回: "#fa3534",
  150. },
  151. verification: [], //检定字典
  152. verification: [], //检定字典
  153. application: [], //申请字典
  154. record: [], //备案字典
  155. };
  156. },
  157. computed: {
  158. //检定状态
  159. verificationStatus() {
  160. return (row) => {
  161. return paraseDict(this.verification, row);
  162. };
  163. },
  164. //申请状态
  165. applicationStatus() {
  166. return (row) => {
  167. return paraseDict(this.application, row);
  168. };
  169. },
  170. //备案状态
  171. recordStatus() {
  172. return (row) => {
  173. return paraseDict(this.record, row);
  174. };
  175. },
  176. },
  177. onLoad(options) {
  178. getLedgerDetails({ id: options.id }).then((res) => {
  179. this.ledgerDetails = res.data;
  180. });
  181. useDict("ejian_instrCheckStatus").then((res) => {
  182. this.verification = res;
  183. });
  184. useDict("ejian_instrCheckRecordStatusV2").then((res) => {
  185. this.application = res;
  186. });
  187. useDict("ejian_instrFillingStatus").then((res) => {
  188. this.record = res;
  189. });
  190. },
  191. methods: {
  192. //检定记录
  193. handleVerificationHistory() {
  194. console.log(this.ledgerDetails);
  195. uni.navigateTo({
  196. url: `/pages/Ledger/verificationHistory?id=${this.ledgerDetails.id}`,
  197. success: (res) => {},
  198. fail: () => {},
  199. complete: () => {},
  200. });
  201. },
  202. //备案记录
  203. handleRecordHistory() {
  204. uni.navigateTo({
  205. url: `/pages/Ledger/recordHistory?id=${this.ledgerDetails.id}`,
  206. success: (res) => {},
  207. fail: () => {},
  208. complete: () => {},
  209. });
  210. },
  211. },
  212. };
  213. </script>
  214. <style lang="scss" scoped>
  215. .history {
  216. display: flex;
  217. padding: 20rpx 10rpx;
  218. background: #fff;
  219. width: 100%;
  220. position: fixed;
  221. bottom: 0;
  222. left: 0;
  223. }
  224. .container {
  225. height: 100vh;
  226. background: rgb(243, 244, 249);
  227. padding: 30rpx 0 110rpx;
  228. .contentItems {
  229. width: 95%;
  230. border-radius: 6px;
  231. background: #fff;
  232. margin: 0rpx auto 30rpx;
  233. padding: 20rpx 30rpx 20rpx;
  234. .content {
  235. border-bottom: 1px solid rgb(242, 242, 242);
  236. padding: 24rpx 0;
  237. display: flex;
  238. justify-content: space-between;
  239. }
  240. .content:last-child {
  241. border-bottom: none;
  242. }
  243. .title {
  244. font-size: 26rpx;
  245. color: black;
  246. letter-spacing: 3rpx;
  247. }
  248. .message {
  249. font-size: 26rpx;
  250. color: rgb(146, 146, 146);
  251. }
  252. }
  253. }
  254. </style>