detail.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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-asbl',
  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. @include useTheme() {
  161. background: #fff;
  162. .page-top {
  163. height: 360px;
  164. background: fetch('pc-banner-record-device');
  165. background-size: auto 360px;
  166. .logo {
  167. display: block;
  168. width: 120px;
  169. height: 120px;
  170. border-radius: 50%;
  171. background: #fff;
  172. }
  173. .name {
  174. font-size: 30px;
  175. color: #fff;
  176. }
  177. }
  178. .page-content {
  179. width: 600px;
  180. margin: 0 auto;
  181. overflow: hidden;
  182. min-height: calc(100vh - 80px - 80px - 360px);
  183. box-sizing: border-box;
  184. padding-bottom: 40px;
  185. .page-title {
  186. font-size: 24px;
  187. font-weight: bold;
  188. text-align: center;
  189. padding: 40px 0;
  190. }
  191. .params-list {
  192. .param {
  193. display: grid;
  194. grid-template-columns: repeat(2, 1fr);
  195. grid-column-gap: 8px;
  196. grid-row-gap: 16px;
  197. .param-name {
  198. text-align: right;
  199. }
  200. }
  201. }
  202. .row {
  203. display: flex;
  204. justify-content: flex-start;
  205. align-items: flex-start;
  206. font-size: 18px;
  207. margin: 24px 0;
  208. .col {
  209. &.success {
  210. color: #36bbce !important;
  211. }
  212. &.warning {
  213. color: #1890ff !important;
  214. }
  215. &.danger {
  216. color: #f94b4b !important;
  217. }
  218. &:first-child {
  219. width: 100px;
  220. color: #666;
  221. text-align: right;
  222. }
  223. &:last-child {
  224. color: #282828;
  225. }
  226. }
  227. .el-image {
  228. width: 120px;
  229. height: 120px;
  230. margin-right: 12px;
  231. box-sizing: border-box;
  232. border-radius: 4px;
  233. }
  234. }
  235. .control {
  236. margin-top: 62px;
  237. .button {
  238. width: 295px;
  239. height: 50px;
  240. cursor: pointer;
  241. &.edit {
  242. border: 1px solid fetch('color');
  243. color: fetch('color');
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. @media screen and (max-width: 768px) {
  252. .page {
  253. @include useTheme() {
  254. background: #fff;
  255. .page-top {
  256. height: 46vw;
  257. background: fetch('h5-banner-record-device');
  258. background-size: auto 46vw;
  259. .logo {
  260. display: block;
  261. width: 14.8vw;
  262. height: 14.8vw;
  263. border-radius: 50%;
  264. background: #fff;
  265. }
  266. .name {
  267. font-size: 4vw;
  268. color: #fff;
  269. }
  270. }
  271. .page-content {
  272. box-sizing: border-box;
  273. padding: 8vw 7vw;
  274. .page-title {
  275. font-size: 4.2vw;
  276. font-weight: bold;
  277. text-align: center;
  278. color: #282828;
  279. margin-bottom: 4.6vw;
  280. }
  281. .params-list {
  282. .param {
  283. display: grid;
  284. grid-template-columns: repeat(2, 1fr);
  285. grid-column-gap: 1.2vw;
  286. grid-row-gap: 2.4vw;
  287. .param-name {
  288. text-align: right;
  289. }
  290. }
  291. }
  292. .row {
  293. display: flex;
  294. justify-content: flex-start;
  295. align-items: flex-start;
  296. font-size: 3.4vw;
  297. margin: 5.6vw 0;
  298. .col {
  299. &.success {
  300. color: #36bbce !important;
  301. }
  302. &.warning {
  303. color: #1890ff !important;
  304. }
  305. &.danger {
  306. color: #f94b4b !important;
  307. }
  308. &:first-child {
  309. width: 19vw;
  310. color: #666;
  311. white-space: nowrap;
  312. flex-shrink: 0;
  313. // text-align: right;
  314. }
  315. &:last-child {
  316. color: #282828;
  317. }
  318. }
  319. .el-image {
  320. width: 26vw;
  321. height: 26vw;
  322. border-radius: 1vw;
  323. }
  324. }
  325. .control {
  326. margin-top: 22.8vw;
  327. .button {
  328. width: 100%;
  329. height: 12vw;
  330. cursor: pointer;
  331. &.edit {
  332. border: 1px solid fetch('color');
  333. color: fetch('color');
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }
  340. }
  341. </style>