detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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.productName"
  48. >
  49. <div class="param-name">{{ param.paramName }}</div>
  50. <div class="param-content">{{ param.paramContent }}</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"v-if="productInfo.auditStatus === 0">
  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?type=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. .param-name{
  167. margin-right: 20px;
  168. }
  169. }
  170. }
  171. .row {
  172. display: flex;
  173. justify-content: flex-start;
  174. align-items: flex-start;
  175. font-size: 18px;
  176. margin: 24px 0;
  177. .col {
  178. &.success {
  179. color: #f3920d !important;
  180. }
  181. &.warning {
  182. color: #1890ff !important;
  183. }
  184. &.danger {
  185. color: #f94b4b !important;
  186. }
  187. &:first-child {
  188. width: 90px;
  189. color: #666;
  190. }
  191. &:last-child {
  192. color: #282828;
  193. }
  194. }
  195. .el-image {
  196. width: 120px;
  197. height: 120px;
  198. margin-right: 12px;
  199. box-sizing: border-box;
  200. border-radius: 4px;
  201. }
  202. }
  203. .control {
  204. margin-top: 62px;
  205. .button {
  206. width: 295px;
  207. height: 50px;
  208. cursor: pointer;
  209. &.edit {
  210. @include themify($themes) {
  211. border: 1px solid themed('color');
  212. color: themed('color');
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. @media screen and (max-width: 768px) {
  220. .page {
  221. background: #fff;
  222. }
  223. .page-top {
  224. height: 46vw;
  225. @include themify($themes) {
  226. background: themed('banner-home-h5');
  227. background-size: auto 46vw;
  228. }
  229. .logo {
  230. display: block;
  231. width: 14.8vw;
  232. height: 14.8vw;
  233. border-radius: 50%;
  234. background: #fff;
  235. }
  236. .name {
  237. font-size: 4vw;
  238. color: #fff;
  239. }
  240. }
  241. .page-content {
  242. box-sizing: border-box;
  243. padding: 8vw 7vw;
  244. .page-title {
  245. font-size: 4.2vw;
  246. font-weight: bold;
  247. text-align: center;
  248. color: #282828;
  249. margin-bottom: 4.6vw;
  250. }
  251. .params-list {
  252. .param {
  253. display: flex;
  254. justify-content: flex-start;
  255. align-items: flex-start;
  256. margin-bottom: 8px;
  257. .param-name{
  258. margin-right: 10px;
  259. }
  260. }
  261. }
  262. .row {
  263. display: flex;
  264. justify-content: flex-start;
  265. align-items: flex-start;
  266. font-size: 3.4vw;
  267. margin: 5.6vw 0;
  268. .col {
  269. &:first-child {
  270. width: 19vw;
  271. color: #666;
  272. white-space: nowrap;
  273. }
  274. &:last-child {
  275. color: #282828;
  276. }
  277. }
  278. .el-image {
  279. width: 26vw;
  280. height: 26vw;
  281. border-radius: 1vw;
  282. }
  283. }
  284. .control {
  285. margin-top: 22.8vw;
  286. .button {
  287. width: 100%;
  288. height: 12vw;
  289. cursor: pointer;
  290. &.edit {
  291. @include themify($themes) {
  292. border: 1px solid themed('color');
  293. color: themed('color');
  294. }
  295. }
  296. }
  297. }
  298. }
  299. }
  300. </style>