index.vue 4.7 KB

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