index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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 class="top-wrapper">
  6. <uni-section>
  7. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="客户名称">
  8. </uni-easyinput>
  9. </uni-section>
  10. <button class="search_btn" @click="doSearch">搜索</button>
  11. <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
  12. </view>
  13. <view class="wrapper">
  14. <u-list @scrolltolower="scrolltolower" class="listContent">
  15. <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  16. <myCard :item="item" :index="index+1" :btnList="btnList" :columns="columns" @del="del(item)">
  17. </myCard>
  18. </view>
  19. </u-list>
  20. </view>
  21. <!-- <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  22. <myCard :item="item" :index="index+1" :btnList="btnList" :columns="columns"
  23. @del="del(item)"></myCard>
  24. </view> -->
  25. <view style='margin-top: 20vh;' v-if="tableList.length==0">
  26. <u-empty iconSize='150' textSize='32' text='暂无数据'>
  27. </u-empty>
  28. </view>
  29. <view class="add" @click="add">
  30. <u-icon name="plus" color="#fff"></u-icon>
  31. </view>
  32. <u-toast ref="uToast"></u-toast>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. getTableList,
  38. deleteInformation
  39. } from '@/api/saleManage/saleorder/index.js'
  40. import myCard from '../components/myCard.vue'
  41. export default {
  42. components: {
  43. myCard
  44. },
  45. data() {
  46. return {
  47. btnList: [{
  48. name: '详情',
  49. apiName: '',
  50. btnType: 'primary',
  51. type: '1',
  52. pageUrl: '/pages/saleManage/saleOrder/components/drawer',
  53. }, {
  54. name: '修改',
  55. apiName: '',
  56. btnType: 'primary',
  57. type: '1',
  58. pageUrl: '/pages/saleManage/saleOrder/add',
  59. judge: [{
  60. key: 'orderStatus',
  61. value: [0, 3]
  62. }],
  63. }, {
  64. name: '删除',
  65. apiName: 'del',
  66. btnType: 'error ',
  67. type: '2',
  68. pageUrl: '',
  69. judge: [{
  70. key: 'orderStatus',
  71. value: [0, 3]
  72. }],
  73. }],
  74. columns: [
  75. [{
  76. label: '名称:',
  77. prop: 'name',
  78. type: 'title',
  79. className: 'perce100',
  80. }],
  81. [{
  82. label: '编码:',
  83. prop: 'orderNo'
  84. }, {
  85. label: '产品名称:',
  86. prop: 'productNames'
  87. }],
  88. [{
  89. label: '销售类型:',
  90. prop: 'saleTypeName'
  91. }, {
  92. label: '项目名称:',
  93. prop: 'projectName'
  94. }],
  95. [{
  96. label: '客户名称:',
  97. prop: 'partaName'
  98. }, {
  99. label: '客户联系人:',
  100. prop: 'partaLinkName'
  101. }],
  102. [{
  103. label: '金额(元):',
  104. prop: 'payAmount'
  105. }, {
  106. label: '审核状态:',
  107. prop: 'orderStatus',
  108. formatter: (row) => {
  109. const reviewStatus = {
  110. 0: '未提交',
  111. 1: '审核中',
  112. 2: '已审核',
  113. 3: '审核不通过'
  114. }
  115. return reviewStatus[row.orderStatus];
  116. }
  117. }],
  118. [{
  119. label: '创建人:',
  120. prop: 'createUserName'
  121. }],
  122. [{
  123. label: '操作:',
  124. prop: 'action',
  125. type: 'action',
  126. className: 'perce100',
  127. }],
  128. ],
  129. tableList: [],
  130. page: 1,
  131. size: 10,
  132. isEnd: false,
  133. searchVal: ''
  134. //报价管理-审核枚举
  135. }
  136. },
  137. computed: {
  138. },
  139. onShow() {
  140. this.isEnd = false
  141. this.page = 1
  142. this.getList()
  143. },
  144. methods: {
  145. doSearch() {
  146. this.isEnd = false
  147. this.page = 1
  148. this.getList()
  149. },
  150. //获取列表信息
  151. getList() {
  152. if (this.isEnd) {
  153. return
  154. }
  155. uni.showLoading({
  156. title: '加载中'
  157. })
  158. let data = {
  159. pageNum: this.page,
  160. size: this.size,
  161. partaName: this.searchVal
  162. }
  163. getTableList(data).then(res => {
  164. if (this.page === 1) {
  165. this.tableList = res.list
  166. } else {
  167. this.tableList.push(...res.list)
  168. }
  169. this.page += 1
  170. this.isEnd = this.tableList.length >= res.count
  171. }).then(() => {
  172. uni.hideLoading()
  173. })
  174. },
  175. del(row) {
  176. deleteInformation([row.id]).then(res => {
  177. this.isEnd = false
  178. this.page = 1
  179. this.$refs.uToast.show({
  180. type: "success",
  181. message: "操作成功",
  182. })
  183. this.getList(this.where)
  184. })
  185. },
  186. add() {
  187. uni.navigateTo({
  188. url: '/pages/saleManage/saleOrder/add'
  189. })
  190. },
  191. scrolltolower(){
  192. if (this.isEnd) {
  193. return
  194. }
  195. this.getList();
  196. },
  197. }
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .add {
  202. width: 96rpx;
  203. height: 96rpx;
  204. border-radius: 48rpx;
  205. background: #3c9cff;
  206. position: fixed;
  207. bottom: 100rpx;
  208. right: 24rpx;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. }
  213. .top-wrapper {
  214. background-color: #fff;
  215. display: flex;
  216. width: 750rpx;
  217. height: 88rpx;
  218. padding: 16rpx 32rpx;
  219. align-items: center;
  220. gap: 16rpx;
  221. /deep/.uni-section {
  222. margin-top: 0px;
  223. }
  224. /deep/.uni-section-header {
  225. padding: 0px;
  226. }
  227. .search_btn {
  228. width: 120rpx;
  229. height: 70rpx;
  230. line-height: 70rpx;
  231. padding: 0 24rpx;
  232. background: $theme-color;
  233. font-size: 32rpx;
  234. color: #fff;
  235. margin: 0;
  236. margin-left: 26rpx;
  237. }
  238. .menu_icon {
  239. width: 44rpx;
  240. height: 44rpx;
  241. margin-left: 14rpx;
  242. }
  243. }
  244. </style>