index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="售后计划"
  4. @clickLeft="back">
  5. </uni-nav-bar>
  6. <view class="top-wrapper">
  7. <uni-section>
  8. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="名称">
  9. </uni-easyinput>
  10. </uni-section>
  11. <button class="search_btn" @click="doSearch">搜索</button>
  12. <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
  13. </view>
  14. <view class="wrapper">
  15. <u-list @scrolltolower="scrolltolower" class="listContent">
  16. <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  17. <myCard @del="del(item)" @edit="edit('edit',item.id)" @details="edit('view',item.id)" :item="item"
  18. :index="index+1" :columns="columns" :btnList="btnList">
  19. </myCard>
  20. </view>
  21. </u-list>
  22. </view>
  23. <u-toast ref="uToast"></u-toast>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. getSalesPlan,
  29. } from '@/api/salesServiceManagement/toDoList/index.js'
  30. import myCard from '@/pages/saleManage/components/myCard.vue'
  31. export default {
  32. components: {
  33. myCard,
  34. },
  35. data() {
  36. return {
  37. searchVal: '',
  38. isEnd: false,
  39. page: 1,
  40. size: 10,
  41. tableList: [],
  42. columns: [
  43. [{
  44. label: '计划单号:',
  45. prop: 'code',
  46. type: 'title',
  47. className: 'perce100',
  48. }],
  49. [{
  50. label: '计划名称:',
  51. prop: 'name'
  52. }, ],
  53. [{
  54. label: '设备名称:',
  55. prop: 'categoryName',
  56. formatter: (row) => {
  57. if (!row.deviceDetails) return '';
  58. let str = '';
  59. row.deviceDetails.map((el, idx) => {
  60. if (idx + 1 == row.deviceDetails.length) {
  61. str += el.categoryName;
  62. } else {
  63. str = str + '' + el.categoryName + ',';
  64. }
  65. });
  66. return str;
  67. }
  68. }],
  69. [{
  70. label: '客户名称:',
  71. prop: 'contactName'
  72. }, {
  73. label: '紧急程度:',
  74. prop: 'urgent',
  75. formatter: (item) => {
  76. return {
  77. 1: '普通',
  78. 2: '紧急',
  79. 3: '重要'
  80. } [item.urgent];
  81. }
  82. }],
  83. [{
  84. label: '创建人:',
  85. prop: 'createUserName'
  86. }, {
  87. label: '创建时间:',
  88. prop: 'createTime',
  89. }],
  90. [{
  91. label: '操作:',
  92. prop: 'action',
  93. type: 'action',
  94. className: 'perce100',
  95. }],
  96. ],
  97. btnList: [{
  98. name: '详情',
  99. apiName: 'details',
  100. btnType: 'primary',
  101. type: '2',
  102. pageUrl: '',
  103. }, {
  104. name: '修改',
  105. apiName: 'edit',
  106. btnType: 'primary',
  107. type: '2',
  108. pageUrl: '',
  109. judge: [{
  110. authorities: '',
  111. }, {
  112. key: 'planStatus',
  113. value: [0, 4, 5],
  114. }],
  115. },
  116. {
  117. name: '删除',
  118. apiName: 'del',
  119. btnType: 'error ',
  120. type: '2',
  121. pageUrl: '',
  122. judge: [{
  123. authorities: '',
  124. }, {
  125. key: 'planStatus',
  126. value: [0, 4, 5],
  127. }],
  128. }, {
  129. name: '派单',
  130. apiName: 'handleAudit',
  131. btnType: 'primary',
  132. type: '2',
  133. pageUrl: '',
  134. judge: [{
  135. authorities: '',
  136. }, {
  137. key: 'planStatus',
  138. value: [0, 4, 5],
  139. }],
  140. },
  141. {
  142. name: '撤回',
  143. apiName: 'handleAudit',
  144. btnType: 'primary',
  145. type: '2',
  146. pageUrl: '',
  147. judge: [{
  148. authorities: '',
  149. }, {
  150. key: 'planStatus',
  151. value: [1],
  152. }],
  153. },
  154. ],
  155. }
  156. },
  157. computed: {
  158. },
  159. onShow() {
  160. this.isEnd = false
  161. this.page = 1
  162. this.getList()
  163. },
  164. methods: {
  165. doSearch() {
  166. this.isEnd = false
  167. this.page = 1
  168. this.getList()
  169. },
  170. //获取列表信息
  171. getList() {
  172. if (this.isEnd) {
  173. return
  174. }
  175. uni.showLoading({
  176. title: '加载中'
  177. })
  178. let data = {
  179. pageNum: this.page,
  180. size: this.size,
  181. }
  182. getSalesPlan(data).then(res => {
  183. if (this.page === 1) {
  184. this.tableList = res.list
  185. } else {
  186. this.tableList.push(...res.list)
  187. }
  188. this.page += 1
  189. this.isEnd = this.tableList.length >= res.count;
  190. uni.hideLoading();
  191. }).catch((e) => {
  192. uni.hideLoading()
  193. })
  194. },
  195. scrolltolower() {
  196. if (this.isEnd) {
  197. return
  198. }
  199. this.getList();
  200. },
  201. del(item) {
  202. },
  203. edit(type,id) {
  204. uni.navigateTo({
  205. url: `/pages/salesServiceManagement/toDoList/components/editPlan?type=${type}&id=${id}`
  206. })
  207. }
  208. }
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. .top-wrapper {
  213. background-color: #fff;
  214. display: flex;
  215. width: 750rpx;
  216. height: 88rpx;
  217. padding: 16rpx 32rpx;
  218. align-items: center;
  219. gap: 16rpx;
  220. /deep/.uni-section {
  221. margin-top: 0px;
  222. }
  223. /deep/.uni-section-header {
  224. padding: 0px;
  225. }
  226. .search_btn {
  227. width: 120rpx;
  228. height: 70rpx;
  229. line-height: 70rpx;
  230. padding: 0 24rpx;
  231. background: $theme-color;
  232. font-size: 32rpx;
  233. color: #fff;
  234. margin: 0;
  235. margin-left: 26rpx;
  236. }
  237. .menu_icon {
  238. width: 44rpx;
  239. height: 44rpx;
  240. margin-left: 14rpx;
  241. }
  242. }
  243. </style>