detail.vue 8.8 KB

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