detail.vue 8.5 KB

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