in-store-detail.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view style="margin: 0rpx 40rpx 0" class="container">
  3. <view class="my2 p3 bg-color-white" style="border-radius: 16rpx">
  4. <view class="f-size-32 f-weight-6 py2 mb-2 title">入库信息</view>
  5. <detail-list-item title="入库单号">{{ model.inNo }}</detail-list-item>
  6. <detail-list-item title="入库类型">{{ $BaseTool.Object.getField(typeMap, model.type) }}</detail-list-item>
  7. <detail-list-item title="仓库">{{ model.storeName }}</detail-list-item>
  8. <detail-list-item title="总价">{{ model.totalPrice }}</detail-list-item>
  9. <!-- <detail-list-item title="入库人">{{ model.pickUserName }}</detail-list-item>
  10. <detail-list-item title="入库说明">{{ model.reason }}</detail-list-item>-->
  11. <view class="f-size-32 f-weight-6 py2 mb-2 title">入库明细</view>
  12. <template v-for="(detail,index) in model.detailList">
  13. <view :key="index">
  14. <u-line color="#0082ff" />
  15. <detail-list-item title="备件名称">{{ detail.spareName }}</detail-list-item>
  16. <detail-list-item title="入库数量">{{ detail.num }}</detail-list-item>
  17. <detail-list-item title="单价">{{ detail.price }}</detail-list-item>
  18. <detail-list-item title="总价">{{ detail.totalPrice }}</detail-list-item>
  19. </view>
  20. </template>
  21. </view>
  22. <view class="m3" v-if="isConfirm">
  23. <u-button @click="submit" type="primary" shape="circle">提交入库</u-button>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import DetailListItem from '@/components/detail-list/DescriptionList'
  29. export default {
  30. components: { DetailListItem },
  31. data() {
  32. return {
  33. model: {
  34. 'pickNo': null,
  35. 'type': null,
  36. 'repairId': null,
  37. 'repaireNo': null,
  38. 'pickUserId': null,
  39. 'pickUserName': null,
  40. 'storeId': null,
  41. 'storeName': null,
  42. 'reason': null,
  43. 'remark': null,
  44. 'status': null,
  45. 'createdUserId': null,
  46. 'updateUserId': null,
  47. 'updateTime': null,
  48. 'createdUserName': null,
  49. 'updateUserName': null
  50. },
  51. isConfirm: false,
  52. typeMap: {},
  53. statusMap: {}
  54. };
  55. },
  56. created () {
  57. // 下拉框map
  58. this.isConfirm = false;
  59. this.typeMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.IN_STORE_FORM_TYPE)
  60. this.statusMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.IN_STORE_FORM_STATUS)
  61. },
  62. onLoad(options) {
  63. this.isConfirm = options.confirm === 1 || options.confirm === '1';
  64. this.$Http.fetchInStoreForm({ id: options.id }).then(res => {
  65. this.model = res.data;
  66. if(this.model.status == 1){
  67. this.isConfirm = true
  68. }
  69. });
  70. },
  71. methods: {
  72. submit() {
  73. this.$Http.updateInStore({ id: this.model.id })
  74. .then(() => {
  75. this.isConfirm = false
  76. uni.showToast({ icon: 'none', title: '入库成功' })
  77. }).catch(() => {
  78. })
  79. }
  80. }
  81. };
  82. </script>
  83. <style scoped lang="less">
  84. page {
  85. background-color: #f4f4f4;
  86. }
  87. .container {
  88. padding-bottom: 100rpx;
  89. .title {
  90. border-bottom: 1rpx solid #f4f4f4;
  91. color: #0082ff;
  92. }
  93. .p-fixed {
  94. border-top: 1rpx solid #f4f4f4;
  95. height: 100rpx;
  96. .common {
  97. padding: 15rpx 100rpx;
  98. border-radius: 30rpx;
  99. background-color: #0082ff;
  100. color: #fff;
  101. &:last-of-type {
  102. background-color: #fff;
  103. border: 1rpx solid #0082ff;
  104. color: #0082ff;
  105. }
  106. }
  107. }
  108. .footer {
  109. bottom: 0;
  110. left: 0;
  111. right: 0;
  112. background-color: #fff;
  113. }
  114. }
  115. </style>