index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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)" @handleAudit="handleAudit(item)" @handleRevoke="handleRevoke(item)"
  18. @edit="add('edit',item.id)" @details="add('view',item.id)" :item="item" :index="index+1"
  19. :columns="columns" :btnList="btnList">
  20. </myCard>
  21. </view>
  22. </u-list>
  23. </view>
  24. <view style='margin-top: 20vh;' v-if="tableList.length==0">
  25. <u-empty iconSize='150' textSize='32' text='暂无数据'>
  26. </u-empty>
  27. </view>
  28. <view class="add" @click="add('add','')">
  29. <u-icon name="plus" color="#fff"></u-icon>
  30. </view>
  31. <uni-popup ref="popup" type="center" :mask-closable="false">
  32. <view class="popup-content">
  33. <view class="popup-header">
  34. <text>审核</text>
  35. <view class="close-icon" @click="hidePopup">×</view>
  36. </view>
  37. <form @submit="handleSubmit">
  38. <view class="form-item">
  39. <label class="form-label">*审核结果</label>
  40. <!-- <uni-data-picker v-model="examForm.auditResult" slot="value" placeholder="请选择"
  41. :localdata="auditResultOptions" @change="handleAuditResultChange">
  42. </uni-data-picker> -->
  43. <!-- <uni-data-picker name="auditResult" :localdata="auditResultOptions"
  44. v-model="examForm.auditResult" @change="handleAuditResultChange">
  45. </uni-data-picker> -->
  46. </view>
  47. <view class="form-item">
  48. <label class="form-label">审核意见</label>
  49. <textarea name="auditOpinion" placeholder="请输入" v-model="examForm.auditOpinion"></textarea>
  50. </view>
  51. <view class="button-group">
  52. <button formType="submit" type="primary">确认</button>
  53. <button @click="hidePopup">取消</button>
  54. </view>
  55. </form>
  56. </view>
  57. </uni-popup>
  58. <u-toast ref="uToast"></u-toast>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. deleteInformation
  64. } from '@/api/saleManage/businessOpportunity/index.js'
  65. import {
  66. getTableList,
  67. revokeSalesDemand
  68. } from '@/api/salesServiceManagement/demandList/index.js'
  69. import myCard from '@/pages/saleManage/components/myCard.vue'
  70. export default {
  71. components: {
  72. myCard,
  73. },
  74. data() {
  75. return {
  76. tableList: [],
  77. searchVal: '',
  78. page: 1,
  79. size: 10,
  80. isEnd: false,
  81. current: {},
  82. examForm: {
  83. auditOpinion: '',
  84. auditResult: '',
  85. id: ''
  86. },
  87. btnList: [{
  88. name: '详情',
  89. apiName: 'details',
  90. btnType: 'primary',
  91. type: '2',
  92. pageUrl: '',
  93. }, {
  94. name: '修改',
  95. apiName: 'edit',
  96. btnType: 'primary',
  97. type: '2',
  98. pageUrl: '',
  99. judge: [{
  100. authorities: '',
  101. }, {
  102. key: 'demandStatus',
  103. value: [0, 2, 3, 4, 5],
  104. }],
  105. },
  106. {
  107. name: '删除',
  108. apiName: 'del',
  109. btnType: 'error ',
  110. type: '2',
  111. pageUrl: '',
  112. judge: [{
  113. authorities: '',
  114. }, {
  115. key: 'demandStatus',
  116. value: [0, 2, 3, 4, 5],
  117. }],
  118. }, {
  119. name: '提交',
  120. apiName: 'handleAudit',
  121. btnType: 'primary',
  122. type: '2',
  123. pageUrl: '',
  124. judge: [{
  125. authorities: '',
  126. }, {
  127. key: 'demandStatus',
  128. value: [0],
  129. }],
  130. },
  131. {
  132. name: '撤回',
  133. apiName: 'handleRevoke',
  134. btnType: 'primary',
  135. type: '2',
  136. pageUrl: '',
  137. judge: [{
  138. authorities: '',
  139. }, {
  140. key: 'demandStatus',
  141. value: [0],
  142. }],
  143. }
  144. ],
  145. columns: [
  146. [{
  147. label: '名称:',
  148. prop: 'name',
  149. type: 'title',
  150. className: 'perce100',
  151. }],
  152. [{
  153. label: '编码:',
  154. prop: 'code'
  155. }, {
  156. label: '客户编码:',
  157. prop: 'contactCode'
  158. }],
  159. [{
  160. label: '客户名称:',
  161. prop: 'contactName'
  162. }, {
  163. label: '故障等级:',
  164. prop: 'faultLevel'
  165. }],
  166. [{
  167. label: '创建人:',
  168. prop: 'createUserName'
  169. }, {
  170. label: '创建时间:',
  171. prop: 'createTime',
  172. }],
  173. [{
  174. label: '审核人:',
  175. prop: 'approvalUserName'
  176. }, {
  177. label: '状态:',
  178. prop: 'demandStatus',
  179. formatter: (row) => {
  180. let cellValue = row.demandStatus;
  181. return cellValue == 0 ?
  182. '待审核' :
  183. cellValue == 2 ?
  184. '已拒绝' :
  185. cellValue == 1 ?
  186. '已通过' :
  187. cellValue == 3 ?
  188. '已撤回' :
  189. '';
  190. }
  191. }],
  192. [{
  193. label: '操作:',
  194. prop: 'action',
  195. type: 'action',
  196. className: 'perce100',
  197. }],
  198. ]
  199. }
  200. },
  201. computed: {
  202. },
  203. onShow() {
  204. this.isEnd = false
  205. this.page = 1
  206. this.getList()
  207. },
  208. methods: {
  209. doSearch() {
  210. this.isEnd = false
  211. this.page = 1
  212. this.getList()
  213. },
  214. //获取列表信息
  215. getList() {
  216. if (this.isEnd) {
  217. return
  218. }
  219. uni.showLoading({
  220. title: '加载中'
  221. })
  222. let data = {
  223. pageNum: this.page,
  224. size: this.size,
  225. type: 1,
  226. name: this.searchVal
  227. }
  228. getTableList(data).then(res => {
  229. if (this.page === 1) {
  230. this.tableList = res.list
  231. } else {
  232. this.tableList.push(...res.list)
  233. }
  234. this.page += 1
  235. this.isEnd = this.tableList.length >= res.count
  236. uni.hideLoading();
  237. }).catch((e) => {
  238. uni.hideLoading()
  239. })
  240. },
  241. hidePopup() {
  242. this.$refs.popup.close();
  243. this.examForm = {
  244. auditOpinion: '',
  245. auditResult: '',
  246. id: ''
  247. };
  248. },
  249. // 撤回
  250. async handleRevoke(row) {
  251. const res = await uni.showModal({
  252. title: '确认撤回',
  253. content: '确定要撤回该条数据吗?',
  254. confirmText: '撤回',
  255. confirmColor: '#FF4D4F',
  256. });
  257. console.log(res, 'res ----')
  258. if (res[1].confirm) {
  259. const data = await revokeSalesDemand({
  260. id: row.id
  261. });
  262. if (!data) return
  263. this.$refs.uToast.show({
  264. type: "success",
  265. message: "操作成功",
  266. })
  267. this.doSearch();
  268. } else if (res.cancel) {
  269. console.log('用户取消删除');
  270. }
  271. },
  272. add(type, id) {
  273. uni.navigateTo({
  274. url: `/pages/salesServiceManagement/demandList/add?type=${type}&id=${id}`
  275. })
  276. },
  277. scrolltolower() {
  278. if (this.isEnd) {
  279. return
  280. }
  281. this.getList();
  282. },
  283. del(item) {
  284. console.log(item, 'item ---')
  285. // deleteInformation([item.id]).then(res => {
  286. // this.isEnd = false
  287. // this.page = 1
  288. // this.$refs.uToast.show({
  289. // type: "success",
  290. // message: "操作成功",
  291. // })
  292. // this.getList(this.where)
  293. // })
  294. },
  295. handleAudit(item) {
  296. console.log(item,'iitem --')
  297. uni.navigateTo({
  298. url: `/pages/salesServiceManagement/demandList/components/submission?id=${item.id}`
  299. })
  300. },
  301. }
  302. }
  303. </script>
  304. <style lang="scss" scoped>
  305. .add {
  306. width: 96rpx;
  307. height: 96rpx;
  308. border-radius: 48rpx;
  309. background: #3c9cff;
  310. position: fixed;
  311. bottom: 100rpx;
  312. right: 24rpx;
  313. display: flex;
  314. align-items: center;
  315. justify-content: center;
  316. }
  317. .top-wrapper {
  318. background-color: #fff;
  319. display: flex;
  320. width: 750rpx;
  321. height: 88rpx;
  322. padding: 16rpx 32rpx;
  323. align-items: center;
  324. gap: 16rpx;
  325. /deep/.uni-section {
  326. margin-top: 0px;
  327. }
  328. /deep/.uni-section-header {
  329. padding: 0px;
  330. }
  331. .search_btn {
  332. width: 120rpx;
  333. height: 70rpx;
  334. line-height: 70rpx;
  335. padding: 0 24rpx;
  336. background: $theme-color;
  337. font-size: 32rpx;
  338. color: #fff;
  339. margin: 0;
  340. margin-left: 26rpx;
  341. }
  342. .menu_icon {
  343. width: 44rpx;
  344. height: 44rpx;
  345. margin-left: 14rpx;
  346. }
  347. }
  348. </style>