schemeList.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="scheme">
  3. <u-list class="listContent">
  4. <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  5. <myCard :item="item" @details="add('view',item)" @edit="add('edit',item,index)" :index="index+1"
  6. :columns="columns" :btnList="btnList">
  7. </myCard>
  8. </view>
  9. </u-list>
  10. <view class="add" @click="add('add')">
  11. <u-icon name="plus" color="#fff"></u-icon>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import myCard from '@/pages/saleManage/components/myCard.vue'
  17. export default {
  18. components: {
  19. myCard
  20. },
  21. data() {
  22. return {
  23. columns: [
  24. [{
  25. label: '名称:',
  26. prop: 'name',
  27. type: 'title',
  28. className: 'perce100',
  29. }],
  30. [{
  31. label: '项目:',
  32. prop: 'typeId',
  33. formatter: (row) => {
  34. let typeId = row.typeId;
  35. return typeId == 1 ?
  36. '工时' :
  37. typeId == 2 ?
  38. '零配件' :
  39. typeId == 3 ?
  40. '差旅费' : ''
  41. }
  42. }],
  43. [{
  44. label: '编码:',
  45. prop: 'code'
  46. }, ],
  47. [{
  48. label: '型号:',
  49. prop: 'categoryModel'
  50. }, {
  51. label: '规格:',
  52. prop: 'specification',
  53. }],
  54. [{
  55. label: '仓库:',
  56. prop: 'warehouseName'
  57. }],
  58. [{
  59. label: '库存:',
  60. prop: 'warehouseNum',
  61. }, {
  62. label: '单位:',
  63. prop: 'measureUnit'
  64. }],
  65. [{
  66. label: '数量:',
  67. prop: 'totalCount',
  68. }, {
  69. label: '单价:',
  70. prop: 'singlePrice'
  71. }],
  72. [{
  73. label: '合计:',
  74. prop: 'settlementPrice',
  75. }],
  76. [{
  77. label: '详细内容:',
  78. prop: 'content'
  79. }],
  80. [{
  81. label: '操作:',
  82. prop: 'action',
  83. type: 'action',
  84. className: 'perce100',
  85. }],
  86. ],
  87. btnList: [{
  88. name: '详情',
  89. apiName: 'details',
  90. btnType: 'primary',
  91. type: '2',
  92. pageUrl: '',
  93. },
  94. {
  95. name: '修改',
  96. apiName: 'edit',
  97. btnType: 'primary',
  98. type: '2',
  99. pageUrl: '',
  100. }
  101. ],
  102. tableList: []
  103. }
  104. },
  105. computed: {},
  106. created() {
  107. uni.$off('updateInfo');
  108. uni.$on('updateInfo', (data) => {
  109. if(data.index || data.index == 0){
  110. let index = data.index;
  111. delete data.index;
  112. this.$set(this.tableList,index,data);
  113. }else{
  114. this.tableList.push(data);
  115. }
  116. console.log(data, 'data 接收的数据')
  117. })
  118. },
  119. onShow() {
  120. },
  121. methods: {
  122. add(type, item = {}, index) {
  123. if (type == 'edit') {
  124. item.index = index;
  125. }
  126. let data = JSON.stringify(item);
  127. uni.navigateTo({
  128. url: `/pages/salesServiceManagement/toDoList/components/schemeAdd?obtain=仓库&type=${type}&data=${data}`
  129. })
  130. },
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. @import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
  136. .scheme {
  137. padding: 10rpx 20rpx;
  138. }
  139. .add {
  140. width: 96rpx;
  141. height: 96rpx;
  142. border-radius: 48rpx;
  143. background: #3c9cff;
  144. position: fixed;
  145. bottom: 100rpx;
  146. right: 24rpx;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. </style>