detail.vue 8.3 KB

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