detail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <div class="page">
  3. <div class="page-top flex flex-col justify-center items-center">
  4. <img class="logo" :src="supplierInfo.logo" />
  5. <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
  6. </div>
  7. <div class="page-content">
  8. <div class="page-title">设备认证</div>
  9. <div class="row">
  10. <div class="col">设备名称:</div>
  11. <div class="col">{{ productInfo.productName }}</div>
  12. </div>
  13. <div class="row">
  14. <div class="col">设备图片:</div>
  15. <div class="col">
  16. <el-image
  17. :src="productInfo.originalCertificateImage"
  18. ></el-image>
  19. </div>
  20. </div>
  21. <div class="row">
  22. <div class="col">所属品牌:</div>
  23. <div class="col">{{ productInfo.brandName }}</div>
  24. </div>
  25. <div class="row">
  26. <div class="col">购买渠道:</div>
  27. <div class="col">{{ productInfo.purchaseWay }}</div>
  28. </div>
  29. <div class="row">
  30. <div class="col">发票:</div>
  31. <div class="col">
  32. <el-image
  33. :src="productInfo.invoiceImage"
  34. ></el-image>
  35. </div>
  36. </div>
  37. <div class="row">
  38. <div class="col">设备SN码:</div>
  39. <div class="col">{{ productInfo.productName }}</div>
  40. </div>
  41. <div class="row">
  42. <div class="col">设备参数:</div>
  43. <div class="col">
  44. <div class="params-list">
  45. <div class="param"
  46. v-for="param in productInfo.paramList"
  47. :key="param.authId"
  48. >
  49. <div class="param-name">{{ param.productName }}</div>
  50. <div class="param-content">{{ param.productName }}</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="row">
  56. <div class="col">状态:</div>
  57. <div class="col" :class="auditStatusColor(productInfo.auditStatus)">{{ productInfo.auditStatus | auditStatusFilter }}</div>
  58. </div>
  59. <div class="row">
  60. <div class="col">原因:</div>
  61. <div class="col">{{ productInfo.invalidReason ? productInfo.invalidReason : '暂无' }}</div>
  62. </div>
  63. <div class="control flex flex-col items-center">
  64. <div class="button edit flex justify-center items-center" @click="onEdit">编辑</div>
  65. </div>
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import { mapGetters } from 'vuex'
  71. export default {
  72. layout: 'app',
  73. data() {
  74. return {
  75. productId:'',
  76. productInfo: {},
  77. }
  78. },
  79. filters: {
  80. auditStatusFilter(value) {// 认证状态:0审核未通过,1审核通过,2待审核
  81. const map = {
  82. 0: '审核未通过',
  83. 1: '审核通过',
  84. 2: '待审核',
  85. }
  86. return map[value]
  87. }
  88. },
  89. computed: {
  90. ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
  91. },
  92. mounted() {
  93. this.initData()
  94. },
  95. methods: {
  96. initData() {
  97. this.productId = this.$route.query.id
  98. this.getProductDetails()
  99. },
  100. // 获取认证机构信息
  101. async getProductDetails() {
  102. try {
  103. const res = await this.$http.api.getProductDetails({
  104. productId: this.productId,
  105. })
  106. this.productInfo = res.data
  107. console.log('res',this.productInfo)
  108. } catch (error) {}
  109. },
  110. auditStatusColor(value) {// 认证状态:0 danger,1 success,2 warning
  111. const map = {
  112. 0: 'danger',
  113. 1: 'success',
  114. 2: 'warning',
  115. }
  116. return map[value]
  117. },
  118. onEdit() {
  119. this.$router.push(`${this.routePrefix}/record/device/edit?id=${this.productId}`)
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. @media screen and (min-width: 768px) {
  126. .page {
  127. background: #fff;
  128. }
  129. .page-top {
  130. height: 360px;
  131. @include themify($themes) {
  132. background: themed('banner-club-register');
  133. background-size: auto 360px;
  134. }
  135. .logo {
  136. display: block;
  137. width: 120px;
  138. height: 120px;
  139. border-radius: 50%;
  140. background: #fff;
  141. }
  142. .name {
  143. font-size: 30px;
  144. color: #fff;
  145. }
  146. }
  147. .page-content {
  148. width: 700px;
  149. margin: 0 auto;
  150. overflow: hidden;
  151. min-height: calc(100vh - 80px - 80px - 360px);
  152. box-sizing: border-box;
  153. padding-bottom: 40px;
  154. .page-title {
  155. font-size: 24px;
  156. font-weight: bold;
  157. text-align: center;
  158. padding: 40px 0;
  159. }
  160. .params-list {
  161. .param {
  162. display: flex;
  163. justify-content: flex-start;
  164. align-items: flex-start;
  165. margin-bottom: 8px;
  166. }
  167. }
  168. .row {
  169. display: flex;
  170. justify-content: flex-start;
  171. align-items: flex-start;
  172. font-size: 18px;
  173. margin: 24px 0;
  174. .col {
  175. &.success {
  176. color: #f3920d !important;
  177. }
  178. &.warning {
  179. color: #1890ff !important;
  180. }
  181. &.danger {
  182. color: #f94b4b !important;
  183. }
  184. &:first-child {
  185. width: 90px;
  186. color: #666;
  187. }
  188. &:last-child {
  189. color: #282828;
  190. }
  191. }
  192. .el-image {
  193. width: 120px;
  194. height: 120px;
  195. margin-right: 12px;
  196. }
  197. }
  198. .control {
  199. margin-top: 62px;
  200. .button {
  201. width: 295px;
  202. height: 50px;
  203. cursor: pointer;
  204. &.edit {
  205. @include themify($themes) {
  206. border: 1px solid themed('color');
  207. color: themed('color');
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. @media screen and (max-width: 768px) {
  215. .page {
  216. background: #fff;
  217. }
  218. .page-top {
  219. height: 46vw;
  220. @include themify($themes) {
  221. background: themed('banner-home-h5');
  222. background-size: auto 46vw;
  223. }
  224. .logo {
  225. display: block;
  226. width: 14.8vw;
  227. height: 14.8vw;
  228. border-radius: 50%;
  229. background: #fff;
  230. }
  231. .name {
  232. font-size: 4vw;
  233. color: #fff;
  234. }
  235. }
  236. .page-content {
  237. box-sizing: border-box;
  238. padding: 8vw 7vw;
  239. .page-title {
  240. font-size: 4.2vw;
  241. font-weight: bold;
  242. text-align: center;
  243. color: #282828;
  244. margin-bottom: 4.6vw;
  245. }
  246. .params-list {
  247. .param {
  248. display: flex;
  249. justify-content: flex-start;
  250. align-items: flex-start;
  251. margin-bottom: 8px;
  252. }
  253. }
  254. .row {
  255. display: flex;
  256. justify-content: flex-start;
  257. align-items: flex-start;
  258. font-size: 3.4vw;
  259. margin: 5.6vw 0;
  260. .col {
  261. &:first-child {
  262. width: 19vw;
  263. color: #666;
  264. white-space: nowrap;
  265. }
  266. &:last-child {
  267. color: #282828;
  268. }
  269. }
  270. .el-image {
  271. width: 26vw;
  272. height: 26vw;
  273. }
  274. }
  275. .control {
  276. margin-top: 22.8vw;
  277. .button {
  278. width: 100%;
  279. height: 12vw;
  280. cursor: pointer;
  281. &.edit {
  282. @include themify($themes) {
  283. border: 1px solid themed('color');
  284. color: themed('color');
  285. }
  286. }
  287. }
  288. }
  289. }
  290. }
  291. </style>