index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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="add('edit')" @details="add('view')" :item="item" :index="index+1" :columns="columns" :btnList="btnList">
  18. </myCard>
  19. </view>
  20. </u-list>
  21. </view>
  22. <view style='margin-top: 20vh;' v-if="tableList.length==0">
  23. <u-empty iconSize='150' textSize='32' text='暂无数据'>
  24. </u-empty>
  25. </view>
  26. <view class="add" @click="add('add')">
  27. <u-icon name="plus" color="#fff"></u-icon>
  28. </view>
  29. <u-toast ref="uToast"></u-toast>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. deleteInformation
  35. } from '@/api/saleManage/businessOpportunity/index.js'
  36. import {
  37. getTableList,
  38. } from '@/api/salesServiceManagement/demandList/index.js'
  39. import myCard from '@/pages/saleManage/components/myCard.vue'
  40. export default {
  41. components: {
  42. myCard,
  43. },
  44. data() {
  45. return {
  46. tableList: [],
  47. searchVal: '',
  48. page: 1,
  49. size: 10,
  50. isEnd: false,
  51. current: {},
  52. btnList: [{
  53. name: '详情',
  54. apiName: 'details',
  55. btnType: 'primary',
  56. type: '1',
  57. pageUrl: '/pages/saleManage/businessOpportunity/components/drawer',
  58. }, {
  59. name: '修改',
  60. apiName: '',
  61. btnType: 'primary',
  62. type: '1',
  63. pageUrl: '/pages/saleManage/businessOpportunity/add',
  64. judge: [{
  65. authorities: '',
  66. }, {
  67. key: 'demandStatus',
  68. value: [0, 2, 3, 4, 5],
  69. }],
  70. },
  71. {
  72. name: '删除',
  73. apiName: 'del',
  74. btnType: 'error ',
  75. type: '2',
  76. pageUrl: '',
  77. judge: [{
  78. authorities: '',
  79. }, {
  80. key: 'demandStatus',
  81. value: [0, 2, 3, 4, 5],
  82. }],
  83. }, {
  84. name: '提交',
  85. apiName: '',
  86. btnType: 'primary',
  87. type: '1',
  88. pageUrl: '',
  89. judge: [{
  90. authorities: '',
  91. }, {
  92. key: 'demandStatus',
  93. value: [0],
  94. }],
  95. },
  96. {
  97. name: '撤回',
  98. apiName: '',
  99. btnType: 'primary',
  100. type: '1',
  101. pageUrl: '',
  102. judge: [{
  103. authorities: '',
  104. }, {
  105. key: 'demandStatus',
  106. value: [0],
  107. }],
  108. }
  109. ],
  110. columns: [
  111. [{
  112. label: '名称:',
  113. prop: 'name',
  114. type: 'title',
  115. className: 'perce100',
  116. }],
  117. [{
  118. label: '编码:',
  119. prop: 'code'
  120. }, {
  121. label: '客户编码:',
  122. prop: 'contactCode'
  123. }],
  124. [{
  125. label: '客户名称:',
  126. prop: 'contactName'
  127. }, {
  128. label: '故障等级:',
  129. prop: 'faultLevel'
  130. }],
  131. [{
  132. label: '创建人:',
  133. prop: 'createUserName'
  134. }, {
  135. label: '创建时间:',
  136. prop: 'createTime',
  137. }],
  138. [{
  139. label: '审核人:',
  140. prop: 'approvalUserName'
  141. }, {
  142. label: '状态:',
  143. prop: 'demandStatus',
  144. formatter: (row) => {
  145. let cellValue = row.demandStatus;
  146. return cellValue == 0 ?
  147. '待审核' :
  148. cellValue == 2 ?
  149. '已拒绝' :
  150. cellValue == 1 ?
  151. '已通过' :
  152. cellValue == 3 ?
  153. '已撤回' :
  154. '';
  155. }
  156. }],
  157. [{
  158. label: '操作:',
  159. prop: 'action',
  160. type: 'action',
  161. className: 'perce100',
  162. }],
  163. ]
  164. }
  165. },
  166. computed: {
  167. },
  168. onShow() {
  169. this.isEnd = false
  170. this.page = 1
  171. this.getList()
  172. },
  173. methods: {
  174. doSearch() {
  175. this.isEnd = false
  176. this.page = 1
  177. this.getList()
  178. },
  179. //获取列表信息
  180. getList() {
  181. if (this.isEnd) {
  182. return
  183. }
  184. uni.showLoading({
  185. title: '加载中'
  186. })
  187. let data = {
  188. pageNum: this.page,
  189. size: this.size,
  190. type: 1,
  191. name: this.searchVal
  192. }
  193. getTableList(data).then(res => {
  194. if (this.page === 1) {
  195. this.tableList = res.list
  196. } else {
  197. this.tableList.push(...res.list)
  198. }
  199. this.page += 1
  200. this.isEnd = this.tableList.length >= res.count
  201. uni.hideLoading();
  202. }).catch((e) => {
  203. uni.hideLoading()
  204. })
  205. },
  206. add(type) {
  207. uni.navigateTo({
  208. url: `/pages/salesServiceManagement/demandList/add?type=${type}`
  209. })
  210. },
  211. scrolltolower() {
  212. if (this.isEnd) {
  213. return
  214. }
  215. this.getList();
  216. },
  217. del(item) {
  218. deleteInformation([item.id]).then(res => {
  219. this.isEnd = false
  220. this.page = 1
  221. this.$refs.uToast.show({
  222. type: "success",
  223. message: "操作成功",
  224. })
  225. this.getList(this.where)
  226. })
  227. },
  228. }
  229. }
  230. </script>
  231. <style lang="scss" scoped>
  232. .add {
  233. width: 96rpx;
  234. height: 96rpx;
  235. border-radius: 48rpx;
  236. background: #3c9cff;
  237. position: fixed;
  238. bottom: 100rpx;
  239. right: 24rpx;
  240. display: flex;
  241. align-items: center;
  242. justify-content: center;
  243. }
  244. .top-wrapper {
  245. background-color: #fff;
  246. display: flex;
  247. width: 750rpx;
  248. height: 88rpx;
  249. padding: 16rpx 32rpx;
  250. align-items: center;
  251. gap: 16rpx;
  252. /deep/.uni-section {
  253. margin-top: 0px;
  254. }
  255. /deep/.uni-section-header {
  256. padding: 0px;
  257. }
  258. .search_btn {
  259. width: 120rpx;
  260. height: 70rpx;
  261. line-height: 70rpx;
  262. padding: 0 24rpx;
  263. background: $theme-color;
  264. font-size: 32rpx;
  265. color: #fff;
  266. margin: 0;
  267. margin-left: 26rpx;
  268. }
  269. .menu_icon {
  270. width: 44rpx;
  271. height: 44rpx;
  272. margin-left: 14rpx;
  273. }
  274. }
  275. </style>