equipment-model.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view style="padding-top: 50rpx">
  3. <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
  4. <equipment-line title="型号" :content="infoData.model" />
  5. <equipment-line title="名称型号" :content="infoData.nameModel" />
  6. <equipment-line title="设备名称" :content="infoData.name" />
  7. <equipment-line title="设备类型" :content="infoData.typeName" />
  8. <equipment-line
  9. title="自定义类型"
  10. :content="$BaseTool.Object.getField(useTypeMap, infoData.useType)"
  11. />
  12. <equipment-line
  13. title="设备等级"
  14. :content="$BaseTool.Object.getField(levelMap, infoData.level)"
  15. />
  16. <equipment-line title="生产商" :content="infoData.producerName" />
  17. <equipment-line
  18. title="计量单位"
  19. :content="$BaseTool.Object.getField(unitMap, infoData.unit)"
  20. />
  21. <equipment-line
  22. title="设备原值"
  23. :content="$BaseTool.Amount.formatter(infoData.initialValue)"
  24. />
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. detailId: "",
  33. infoData: {},
  34. useTypeMap: {},
  35. levelMap: {},
  36. unitMap: {},
  37. };
  38. },
  39. onLoad(options) {
  40. this.detailId = options.detailId;
  41. this.initData();
  42. this.useTypeMap = this.$DictCache.getLabelByValueMapByType(
  43. this.$DictCache.TYPE.SB_USE_TYPE
  44. );
  45. this.levelMap = this.$DictCache.getLabelByValueMapByType(
  46. this.$DictCache.TYPE.SBINFO_LEVEL
  47. );
  48. this.unitMap = this.$DictCache.getLabelByValueMapByType(
  49. this.$DictCache.TYPE.SBINFO_UNIT
  50. );
  51. this.statusMap = this.$DictCache.getLabelByValueMapByType(
  52. this.$DictCache.TYPE.SB_INFO_STATUS
  53. );
  54. },
  55. methods: {
  56. initData() {
  57. this.$Http
  58. .fetchSbInfo({
  59. id: this.detailId,
  60. })
  61. .then((res) => {
  62. this.infoData = res.data;
  63. });
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang="less">
  69. page {
  70. background-color: #f4f4f4;
  71. }
  72. </style>