detail.vue 8.0 KB

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