index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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="">
  15. <view class="tab_box rx-sc">
  16. <view class="tab_item" v-for="(item,index) in tabList" :key="index"
  17. :class="{active: pickTabIndex == item.value}">
  18. <view @click="changeChartsTab(item.value)">
  19. {{item.label}}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="wrapper">
  25. <u-list @scrolltolower="scrolltolower" class="listContent">
  26. <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
  27. <myCard @del="del(item)" @edit="edit('edit',item.id)" @details="edit('view',item.id)" :item="item"
  28. :index="index+1" :columns="columns" :btnList="btnList">
  29. </myCard>
  30. </view>
  31. </u-list>
  32. </view>
  33. <u-toast ref="uToast"></u-toast>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. getSalesWorkOrder,
  39. } from '@/api/salesServiceManagement/workOrder/index.js'
  40. import myCard from '@/pages/saleManage/components/myCard.vue'
  41. export default {
  42. components: {
  43. myCard,
  44. },
  45. data() {
  46. return {
  47. tabList: [
  48. {
  49. value: 'all',
  50. label: '全部',
  51. },
  52. {
  53. value: '0',
  54. label: '待执行',
  55. },
  56. {
  57. value: '1',
  58. label: '执行中',
  59. },
  60. {
  61. value: '3',
  62. label: '待验收',
  63. },
  64. {
  65. value: '5',
  66. label: '已完成',
  67. },
  68. ],
  69. pickTabIndex: 'all',
  70. searchVal: '',
  71. isEnd: false,
  72. page: 1,
  73. size: 10,
  74. tableList: [],
  75. columns: [
  76. [{
  77. label: '计划单号:',
  78. prop: 'code',
  79. type: 'title',
  80. className: 'perce100',
  81. }],
  82. [{
  83. label: '计划名称:',
  84. prop: 'name'
  85. }, ],
  86. [{
  87. label: '设备名称:',
  88. prop: 'categoryName',
  89. formatter: (row) => {
  90. if (!row.deviceDetails) return '';
  91. let str = '';
  92. row.deviceDetails.map((el, idx) => {
  93. if (idx + 1 == row.deviceDetails.length) {
  94. str += el.categoryName;
  95. } else {
  96. str = str + '' + el.categoryName + ',';
  97. }
  98. });
  99. return str;
  100. }
  101. }],
  102. [{
  103. label: '客户名称:',
  104. prop: 'contactName'
  105. }, {
  106. label: '紧急程度:',
  107. prop: 'urgent',
  108. formatter: (item) => {
  109. return {
  110. 1: '普通',
  111. 2: '紧急',
  112. 3: '重要'
  113. } [item.urgent];
  114. }
  115. }],
  116. [{
  117. label: '创建人:',
  118. prop: 'createUserName'
  119. }, {
  120. label: '创建时间:',
  121. prop: 'createTime',
  122. }],
  123. [{
  124. label: '操作:',
  125. prop: 'action',
  126. type: 'action',
  127. className: 'perce100',
  128. }],
  129. ],
  130. btnList: [{
  131. name: '详情',
  132. apiName: 'details',
  133. btnType: 'primary',
  134. type: '2',
  135. pageUrl: '',
  136. }, {
  137. name: '修改',
  138. apiName: 'edit',
  139. btnType: 'primary',
  140. type: '2',
  141. pageUrl: '',
  142. judge: [{
  143. authorities: '',
  144. }, {
  145. key: 'planStatus',
  146. value: [0, 4, 5],
  147. }],
  148. },
  149. {
  150. name: '删除',
  151. apiName: 'del',
  152. btnType: 'error ',
  153. type: '2',
  154. pageUrl: '',
  155. judge: [{
  156. authorities: '',
  157. }, {
  158. key: 'planStatus',
  159. value: [0, 4, 5],
  160. }],
  161. }, {
  162. name: '派单',
  163. apiName: 'handleAudit',
  164. btnType: 'primary',
  165. type: '2',
  166. pageUrl: '',
  167. judge: [{
  168. authorities: '',
  169. }, {
  170. key: 'planStatus',
  171. value: [0, 4, 5],
  172. }],
  173. },
  174. {
  175. name: '撤回',
  176. apiName: 'handleAudit',
  177. btnType: 'primary',
  178. type: '2',
  179. pageUrl: '',
  180. judge: [{
  181. authorities: '',
  182. }, {
  183. key: 'planStatus',
  184. value: [1],
  185. }],
  186. },
  187. ],
  188. }
  189. },
  190. computed: {
  191. },
  192. onShow() {
  193. this.isEnd = false
  194. this.page = 1
  195. this.getList()
  196. },
  197. methods: {
  198. changeChartsTab(value) {
  199. this.pickTabIndex = value;
  200. this.doSearch();
  201. },
  202. doSearch() {
  203. this.isEnd = false
  204. this.page = 1
  205. this.getList()
  206. },
  207. //获取列表信息
  208. getList() {
  209. if (this.isEnd) {
  210. return
  211. }
  212. uni.showLoading({
  213. title: '加载中'
  214. })
  215. let data = {
  216. pageNum: this.page,
  217. size: this.size,
  218. }
  219. if(this.pickTabIndex != 'all'){
  220. data.orderStatus = this.pickTabIndex;
  221. }
  222. getSalesWorkOrder(data).then(res => {
  223. if (this.page === 1) {
  224. this.tableList = res.list
  225. } else {
  226. this.tableList.push(...res.list)
  227. }
  228. this.page += 1
  229. this.isEnd = this.tableList.length >= res.count;
  230. uni.hideLoading();
  231. }).catch((e) => {
  232. uni.hideLoading()
  233. })
  234. },
  235. scrolltolower() {
  236. if (this.isEnd) {
  237. return
  238. }
  239. this.getList();
  240. },
  241. del(item) {
  242. },
  243. edit(type, id) {
  244. uni.navigateTo({
  245. url: `/pages/salesServiceManagement/toDoList/components/editPlan?type=${type}&id=${id}`
  246. })
  247. }
  248. }
  249. }
  250. </script>
  251. <style lang="scss" scoped>
  252. .top-wrapper {
  253. background-color: #fff;
  254. display: flex;
  255. width: 750rpx;
  256. height: 88rpx;
  257. padding: 16rpx 32rpx;
  258. align-items: center;
  259. gap: 16rpx;
  260. /deep/.uni-section {
  261. margin-top: 0px;
  262. }
  263. /deep/.uni-section-header {
  264. padding: 0px;
  265. }
  266. .search_btn {
  267. width: 120rpx;
  268. height: 70rpx;
  269. line-height: 70rpx;
  270. padding: 0 24rpx;
  271. background: $theme-color;
  272. font-size: 32rpx;
  273. color: #fff;
  274. margin: 0;
  275. margin-left: 26rpx;
  276. }
  277. .menu_icon {
  278. width: 44rpx;
  279. height: 44rpx;
  280. margin-left: 14rpx;
  281. }
  282. }
  283. .tab_box {
  284. width: 100%;
  285. height: 68rpx;
  286. border-bottom: 1rpx solid #E1E1E1;
  287. .tab_item {
  288. height: 68rpx;
  289. line-height: 68rpx;
  290. padding: 0 20rpx;
  291. font-size: 32rpx;
  292. color: #979C9E;
  293. }
  294. .active {
  295. box-sizing: border-box;
  296. border-bottom: 6rpx solid $theme-color;
  297. color: $theme-color;
  298. }
  299. }
  300. </style>