verificationHistory.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <!-- @format -->
  2. <template>
  3. <view class="container">
  4. <view class="">
  5. <view style="" v-if="recordList.length">
  6. <!-- <u-search
  7. :showAction="false"
  8. bgColor="#fff"
  9. placeholder="请输入检定单编号"
  10. style="width: 95%; margin: 30rpx auto"
  11. ></u-search> -->
  12. <view
  13. class="contentItems"
  14. @click="handleVerDetails"
  15. v-for="item of recordList"
  16. >
  17. <view class="title">
  18. <span class="name">{{ item.name }}</span>
  19. <span
  20. class="createTime"
  21. :style="{
  22. color: verificationColor[recordStatus(item.checkRecordStatus)],
  23. }"
  24. >检定状态:{{ recordStatus(item.checkRecordStatus) }}</span
  25. >
  26. </view>
  27. <view class="contentItem">
  28. <view class="item">
  29. <span
  30. style="color: #fa3534; font-size: 28rpx; margin-right: 40rpx"
  31. >检定编号:{{ item.number }}</span
  32. >
  33. </view>
  34. <view class="item">
  35. <span>唯一标识:{{ item.instrNo }}</span>
  36. </view>
  37. <view class="item">
  38. <view>审核机构:{{ item.organizationName }}</view>
  39. </view>
  40. <view class="item">
  41. <view>检定部门:{{ item.deptName }}</view>
  42. </view>
  43. <view class="item">
  44. <span>检定部门联系电话:{{ item.phone }}</span>
  45. </view>
  46. <view class="item">
  47. <span>申请时间:{{ item.createTime }}</span>
  48. </view>
  49. <u-divider></u-divider>
  50. <view style="display: flex">
  51. <view v-if="item.checkCertPath != null && item.checkCertPath != ''" style="margin-left: auto; width: 200rpx; margin-right: 20rpx">
  52. <u-button
  53. @click="downloadCert(item.checkCertPath)"
  54. type="primary"
  55. size="small"
  56. >证书下载</u-button
  57. >
  58. </view>
  59. <view style="margin-left: auto; width: 200rpx">
  60. <u-button
  61. @click="handleCirculation(item)"
  62. size="small"
  63. type="primary"
  64. >器具流转记录</u-button
  65. >
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view v-else>
  72. <u-empty mode="data" text="当前没有检定记录"> </u-empty>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import { getCheckRecordList } from "@/api/Ledger";
  79. import { useDict, paraseDict } from "@/utils/index";
  80. export default {
  81. data() {
  82. return {
  83. recordId: null,
  84. recordList: [],
  85. verificationColor: {
  86. 未检定: "#909399",
  87. 已校准: "#19be6b",
  88. 已检定: "#19be6b",
  89. 不合格: "#fa3534",
  90. 已完成: "#19be6b",
  91. 已分发: "#2979ff",
  92. 不受理: "#fa3534",
  93. 已中止: "#fa3534",
  94. },
  95. verification: [], //备案字典
  96. baseUrl: this.$baseUrl,
  97. };
  98. },
  99. computed: {
  100. //备案状态
  101. recordStatus() {
  102. return (row) => {
  103. return paraseDict(this.verification, row);
  104. };
  105. },
  106. },
  107. async onLoad(options) {
  108. useDict("ejian_instrCheckRecordStatus").then((res) => {
  109. this.verification = res;
  110. });
  111. this.recordId = options.id;
  112. try {
  113. let { data } = await getCheckRecordList({
  114. instrumentId: this.recordId,
  115. });
  116. this.recordList = data;
  117. } catch (error) {}
  118. },
  119. methods: {
  120. handleCirculation(item) {
  121. console.log(item.orderInstrumentId);
  122. uni.navigateTo({
  123. url: "/pages/verification/circulation?id=" + item.orderInstrumentId,
  124. success: (res) => {},
  125. fail: () => {},
  126. complete: () => {},
  127. });
  128. },
  129. downloadCert: function (path) {
  130. uni.showLoading({
  131. title: "加载中",
  132. });
  133. uni.downloadFile({
  134. url: this.baseUrl + "/api/instrument/sysFileDownload?path=" + path,
  135. success: (res) => {
  136. var filePath = res.tempFilePath;
  137. uni.openDocument({
  138. filePath: filePath,
  139. showMenu: true,
  140. success: function (res) {
  141. console.log("打开文档成功");
  142. uni.hideLoading();
  143. },
  144. });
  145. },
  146. });
  147. }
  148. }
  149. };
  150. </script>
  151. <style lang="scss">
  152. .item {
  153. color: #909399;
  154. font-size: 24rpx;
  155. margin: 15rpx 0;
  156. }
  157. .title {
  158. padding-bottom: 10rpx;
  159. border-bottom: 1px solid rgb(242, 242, 242);
  160. display: flex;
  161. align-items: center;
  162. justify-content: space-between;
  163. .name {
  164. font-size: 30rpx;
  165. color: black;
  166. font-weight: bold;
  167. }
  168. .createTime {
  169. color: #909399;
  170. font-size: 28rpx;
  171. font-weight: bold;
  172. }
  173. }
  174. .container {
  175. height: 100vh;
  176. background: rgb(248, 249, 250);
  177. padding: 30rpx;
  178. }
  179. .contentItems {
  180. width: 97%;
  181. border-radius: 6px;
  182. background: #fff;
  183. margin: 0rpx auto 30rpx;
  184. padding: 20rpx 30rpx 20rpx;
  185. .content {
  186. border-bottom: 1px solid rgb(242, 242, 242);
  187. padding: 24rpx 0;
  188. display: flex;
  189. justify-content: space-between;
  190. }
  191. .content:last-child {
  192. border-bottom: none;
  193. }
  194. .title {
  195. font-size: 26rpx;
  196. color: black;
  197. letter-spacing: 3rpx;
  198. }
  199. .message {
  200. font-size: 26rpx;
  201. color: rgb(146, 146, 146);
  202. }
  203. }
  204. </style>