utensilList.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <!-- @format -->
  2. <template>
  3. <view class="container">
  4. <view
  5. v-for="item of ledgerList"
  6. :key="item.orderInstrumentId"
  7. style="margin-top: 15rpx"
  8. class="content-header"
  9. @click="handleDetail(item.instrumentId)"
  10. >
  11. <view class="">
  12. <view style="justify-content: space-between" class="content">
  13. <view
  14. style="color: black; font-size: 36rpx; font-weight: 700"
  15. class="message"
  16. >
  17. {{ item.name }}
  18. </view>
  19. <view
  20. style="padding-top: 5rpx"
  21. :style="{
  22. color:
  23. applicationColor[applicationStatus(item.checkRecordStatus)],
  24. }"
  25. >{{ applicationStatus(item.checkRecordStatus) }}</view
  26. >
  27. </view>
  28. <!--<view style="display: flex" class="content">
  29. <view class="title"
  30. >唯一标识:<span class="message">{{ item.instrNo }} </span>
  31. </view>
  32. </view>-->
  33. <view style="display: flex; align-items: center" class="content">
  34. <view class="title">规格型号:</view>
  35. <view class="message">{{ item.modelSpecific }}</view>
  36. </view>
  37. <view style="display: flex; align-items: center" class="content">
  38. <view class="title">检定机构:</view>
  39. <view class="message">{{ item.organizationName }}</view>
  40. </view>
  41. <view style="display: flex; align-items: center" class="content">
  42. <view class="title">检定实验室:</view>
  43. <view class="message">{{ item.deptName }}</view>
  44. </view>
  45. <view style="display: flex; align-items: center" class="content">
  46. <view class="title">部门联系方式:</view>
  47. <view class="message">{{ item.phone }}</view>
  48. </view>
  49. <!-- </view> -->
  50. <view style="display: flex; justify-content: space-between" class="">
  51. <view style="display: flex" class="content">
  52. <view class="title">出厂编号:</view>
  53. <view style="padding-top: 5rpx" class="message">
  54. {{ item.serialNumber }}
  55. </view>
  56. </view>
  57. </view>
  58. <view style="display: flex; justify-content: space-between" class="">
  59. <view style="display: flex" class="content">
  60. <view class="title">制造单位:</view>
  61. <view style="padding-top: 5rpx" class="message">
  62. {{ item.manufactoryName }}
  63. </view>
  64. </view>
  65. </view>
  66. <u-divider></u-divider>
  67. <view style="display: flex">
  68. <view
  69. v-if="item.checkCertPath != null && item.checkCertPath != ''"
  70. style="margin-left: auto; width: 200rpx; margin-right: 20rpx"
  71. >
  72. <u-button
  73. @click="downloadCert(item.checkCertPath)"
  74. type="primary"
  75. size="small"
  76. >证书下载</u-button
  77. >
  78. </view>
  79. <view style="margin-left: auto; width: 200rpx">
  80. <u-button
  81. @click="handleCirculation(item)"
  82. size="small"
  83. type="primary"
  84. >器具流转记录</u-button
  85. >
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view style="height: 200rpx"></view>
  91. <view style="display: flex; justify-content: center" class="submitBtn">
  92. <!-- <u-button @click="downLoadPDF" type="primary" style="margin: 0 auto; width:47%">备案申请单PDF下载</u-button> -->
  93. <view style="width: 300rpx">
  94. <u-button v-if="showChehui" @click="chehui" type="error">撤回</u-button>
  95. </view>
  96. </view>
  97. <u-modal
  98. :show="show"
  99. :showCancelButton="true"
  100. @cancel="show = false"
  101. @confirm="handleGD"
  102. title="提示"
  103. content="确认要撤回此检定机构任务单吗?"
  104. ></u-modal>
  105. </view>
  106. </template>
  107. <script>
  108. import {
  109. orderApplyInstrumentList,
  110. recallCheckOrderApply,
  111. } from "@/api/verification";
  112. import { useDict, paraseDict } from "@/utils/index";
  113. export default {
  114. data() {
  115. return {
  116. baseUrl: this.$baseUrl,
  117. showChehui: true,
  118. rollbackDisabled: null,
  119. rollbacked: null,
  120. show: false,
  121. verificationColor: {
  122. 未检定: "#909399",
  123. 已校准: "#19be6b",
  124. 已检定: "#19be6b",
  125. 不合格: "#fa3534",
  126. 已完成: "#19be6b",
  127. 已分发: "#2979ff",
  128. 不受理: "#fa3534",
  129. 已中止: "#fa3534",
  130. },
  131. record: [], //备案字典
  132. ledgerList: [],
  133. total: 0,
  134. application: null,
  135. queryParams: {
  136. id: "",
  137. },
  138. orderApplyId: null,
  139. };
  140. },
  141. onLoad(option) {
  142. this.rollbackDisabled = option.rollbackDisabled;
  143. this.rollbacked = option.rollbacked;
  144. this.showChehui = option.rollbackDisabled == 0 && option.rollbacked == 0;
  145. console.log(this.showChehui);
  146. useDict("ejian_instrCheckRecordStatus").then((res) => {
  147. this.application = res;
  148. });
  149. orderApplyInstrumentList(option.id).then(({ data }) => {
  150. this.ledgerList = data;
  151. });
  152. this.orderApplyId = option.id;
  153. },
  154. computed: {
  155. //申请状态
  156. applicationStatus() {
  157. return (row) => {
  158. return paraseDict(this.application, row);
  159. };
  160. },
  161. },
  162. methods: {
  163. chehui() {
  164. this.show = true;
  165. },
  166. handleGD() {
  167. recallCheckOrderApply({ orderApplyId: this.orderApplyId }).then((res) => {
  168. uni.showToast({
  169. title: "撤回成功",
  170. icon: "none",
  171. duration: 1000,
  172. });
  173. setTimeout(() => {
  174. uni.navigateBack();
  175. }, 1000);
  176. // getMiAuditApplyRoobtList({
  177. // ...this.queryParams,
  178. // }).then(({ rows, total }) => {
  179. // this.ledgerList = [...this.ledgerList, ...rows];
  180. // this.total = total;
  181. // });
  182. // this.showChehui = false;
  183. this.show = false;
  184. });
  185. },
  186. handleDetail(id) {
  187. uni.navigateTo({
  188. url: "/pagesB/Ledger/details?id=" + id,
  189. success: (res) => {},
  190. fail: () => {},
  191. complete: () => {},
  192. });
  193. },
  194. //流转记录
  195. handleCirculation(item) {
  196. console.log(item.orderInstrumentId);
  197. uni.navigateTo({
  198. url: "/pages/verification/circulation?id=" + item.orderInstrumentId,
  199. success: (res) => {},
  200. fail: () => {},
  201. complete: () => {},
  202. });
  203. },
  204. onReachBottom() {
  205. //触底事件
  206. if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
  207. uni.showToast({
  208. title: "没有更多数据了",
  209. icon: "none",
  210. duration: 1000,
  211. });
  212. setTimeout(() => {
  213. uni.hideLoading();
  214. }, 500);
  215. } else {
  216. if (this.queryParams.pageNum <= this.queryParams.pageNum - 1) {
  217. setTimeout(() => {
  218. uni.hideLoading();
  219. }, 500);
  220. } else {
  221. this.queryParams.pageNum++;
  222. getMiAuditApplyRoobtList({
  223. ...this.queryParams,
  224. }).then(({ rows, total }) => {
  225. this.ledgerList = [...this.ledgerList, ...rows];
  226. this.total = total;
  227. });
  228. }
  229. setTimeout(() => {
  230. uni.hideLoading();
  231. }, 500);
  232. }
  233. },
  234. downloadCert: function (path) {
  235. uni.showLoading({
  236. title: "加载中",
  237. });
  238. console.log(path);
  239. uni.downloadFile({
  240. url: this.baseUrl + "/api/instrument/sysFileDownload?path=" + path,
  241. success: (res) => {
  242. var filePath = res.tempFilePath;
  243. uni.openDocument({
  244. filePath: filePath,
  245. showMenu: true,
  246. success: function (res) {
  247. console.log("打开文档成功");
  248. uni.hideLoading();
  249. },
  250. });
  251. },
  252. });
  253. },
  254. },
  255. };
  256. </script>
  257. <style lang="scss">
  258. .submitBtn {
  259. width: 100%;
  260. background: #fff;
  261. padding: 15rpx 0;
  262. position: fixed;
  263. bottom: 0;
  264. }
  265. .content-header {
  266. width: 95%;
  267. border-radius: 6px;
  268. background: #fff;
  269. margin: 10rpx auto 10rpx;
  270. padding: 20rpx 30rpx 10rpx;
  271. .content {
  272. /* border-bottom: 1px solid rgb(242, 242, 242); */
  273. padding: 8rpx 0;
  274. display: flex;
  275. /* justify-content: space-between; */
  276. }
  277. .content:last-child {
  278. border-bottom: none;
  279. }
  280. .passIcon {
  281. position: absolute;
  282. top: 20rpx;
  283. right: 40rpx;
  284. }
  285. .title {
  286. font-size: 28rpx;
  287. color: rgb(146, 146, 146);
  288. letter-spacing: 3rpx;
  289. }
  290. .message {
  291. font-size: 28rpx;
  292. color: rgb(146, 146, 146);
  293. }
  294. }
  295. .container {
  296. height: 100vh;
  297. background: rgb(243, 244, 249);
  298. padding: 0rpx 0 110rpx;
  299. .contentItems {
  300. width: 95%;
  301. border-radius: 6px;
  302. background: #fff;
  303. margin: 0rpx auto 10rpx;
  304. padding: 10rpx 30rpx 10rpx;
  305. .content {
  306. /* border-bottom: 1px solid rgb(242, 242, 242); */
  307. padding: 14rpx 0;
  308. display: flex;
  309. /* justify-content: space-between; */
  310. }
  311. .content:last-child {
  312. border-bottom: none;
  313. }
  314. .title {
  315. font-size: 28rpx;
  316. color: black;
  317. letter-spacing: 3rpx;
  318. }
  319. .message {
  320. font-size: 28rpx;
  321. color: rgb(146, 146, 146);
  322. }
  323. }
  324. }
  325. </style>