detail.vue 8.3 KB

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