index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="订单" @clickLeft="back">
  4. </uni-nav-bar>
  5. <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  6. <myCard :item="item" :index="index+1" :btnList="btnList" :columns="columns"
  7. @del="del(item)"></myCard>
  8. </view>
  9. <view class="add" @click="add">
  10. <u-icon name="plus" color="#fff"></u-icon>
  11. </view>
  12. <u-toast ref="uToast"></u-toast>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. getTableList,
  18. deleteInformation
  19. } from '@/api/saleManage/saleorder/index.js'
  20. import myCard from '../components/myCard.vue'
  21. export default {
  22. components: {
  23. myCard
  24. },
  25. data() {
  26. return {
  27. btnList: [{
  28. name: '详情',
  29. apiName: '',
  30. btnType: 'primary',
  31. type: '1',
  32. pageUrl: '/pages/saleManage/saleOrder/components/drawer',
  33. }, {
  34. name: '修改',
  35. apiName: '',
  36. btnType: 'primary',
  37. type: '1',
  38. pageUrl: '/pages/saleManage/saleOrder/add',
  39. judge: [{
  40. key: 'orderStatus',
  41. value: [0, 3]
  42. }],
  43. }, {
  44. name: '删除',
  45. apiName: 'del',
  46. btnType: 'error ',
  47. type: '2',
  48. pageUrl: '',
  49. judge: [{
  50. key: 'orderStatus',
  51. value: [0, 3]
  52. }],
  53. }],
  54. columns: [
  55. [{
  56. label: '名称:',
  57. prop: 'name',
  58. type: 'title',
  59. className: 'perce100',
  60. }],
  61. [{
  62. label: '编码:',
  63. prop: 'orderNo'
  64. }, {
  65. label: '产品名称:',
  66. prop: 'productNames'
  67. }],
  68. [{
  69. label: '销售类型:',
  70. prop: 'saleTypeName'
  71. }, {
  72. label: '项目名称:',
  73. prop: 'projectName'
  74. }],
  75. [{
  76. label: '客户名称:',
  77. prop: 'partaName'
  78. }, {
  79. label: '客户联系人:',
  80. prop: 'partaLinkName'
  81. }],
  82. [{
  83. label: '金额(元):',
  84. prop: 'payAmount'
  85. }, {
  86. label: '审核状态:',
  87. prop: 'orderStatus',
  88. formatter: (row) => {
  89. const reviewStatus = {
  90. 0: '未提交',
  91. 1: '审核中',
  92. 2: '已审核',
  93. 3: '审核不通过'
  94. }
  95. return reviewStatus[row.orderStatus];
  96. }
  97. }],
  98. [{
  99. label: '创建人:',
  100. prop: 'createUserName'
  101. }],
  102. [{
  103. label: '操作:',
  104. prop: 'action',
  105. type: 'action',
  106. className: 'perce100',
  107. }],
  108. ],
  109. tableList: [],
  110. page: 1,
  111. size: 10,
  112. isEnd: false,
  113. //报价管理-审核枚举
  114. }
  115. },
  116. computed: {
  117. },
  118. onShow() {
  119. this.isEnd = false
  120. this.page = 1
  121. this.getList()
  122. },
  123. methods: {
  124. //获取列表信息
  125. getList() {
  126. if (this.isEnd) {
  127. return
  128. }
  129. uni.showLoading({
  130. title: '加载中'
  131. })
  132. let data = {
  133. pageNum: this.page,
  134. size: this.size,
  135. }
  136. getTableList(data).then(res => {
  137. if (this.page === 1) {
  138. this.tableList = res.list
  139. } else {
  140. this.tableList.push(...res.list)
  141. }
  142. this.page += 1
  143. this.isEnd = this.tableList.length >= res.count
  144. }).then(() => {
  145. uni.hideLoading()
  146. })
  147. },
  148. del(row) {
  149. deleteInformation([row.id]).then(res => {
  150. this.isEnd = false
  151. this.page = 1
  152. this.$refs.uToast.show({
  153. type: "success",
  154. message: "操作成功",
  155. })
  156. this.getList(this.where)
  157. })
  158. },
  159. add() {
  160. uni.navigateTo({
  161. url: '/pages/saleManage/saleOrder/add'
  162. })
  163. },
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .add {
  169. width: 96rpx;
  170. height: 96rpx;
  171. border-radius: 48rpx;
  172. background: #3c9cff;
  173. position: fixed;
  174. bottom: 100rpx;
  175. right: 24rpx;
  176. display: flex;
  177. align-items: center;
  178. justify-content: center;
  179. }
  180. </style>