refundAllList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="app-content">
  3. <view style="padding:20upx 0 30upx 50upx;font-size:30upx;">
  4. <text @click="changeStatus()">{{ status == -1 ? '选状态' : status == 0 ? '处理中' : status == 1 ? '已通过' : status == 2 ? '已驳回' : '已取消' }}</text>
  5. <text style="margin-left:50upx;" @click="changeClass()">选分类</text>
  6. <text style="margin-left:50upx;" @click="changeCause()">{{ cause == -1 ? '选原因' : cause == 0 ? '质量问题' : '多开错开' }}</text>
  7. </view>
  8. <view style="margin-left:50upx;margin-bottom:26upx;position:relative;">
  9. <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
  10. <text style="position: absolute;left:180upx;top:0upx;font-size:26upx;">总金额 ¥{{ totalAmount }}</text>
  11. <text style="position: absolute;left:410upx;top:0upx;font-size:26upx;">总成本 ¥{{ totalCost }}</text>
  12. </view>
  13. <block v-if="!$util.isEmpty(list.data)">
  14. <view class="flex-space list" v-for="(item, index) in list.data" :key="index" @click="goDetail(item.refundInfo)">
  15. <block v-if="!$util.isEmpty(item.refundInfo)">
  16. <view class="label">
  17. <text style="font-weight:bold;font-size:29upx;">{{item.name}}</text>
  18. <text>金额:¥{{item.xhUnitPrice?parseFloat(item.xhUnitPrice):0}} x {{item.xhNum}}</text>
  19. <text :class="[item.cause == 0?'qa_cause':'']">原因:{{item.cause == 0 ? '质量问题' : '多开错开'}}</text>
  20. <text>时间:{{item.addTime.substr(5,11)}}</text>
  21. <text v-if="!$util.isEmpty(item.refundInfo.remark)" style="color:red;font-weight:bold;">备注:{{item.refundInfo.remark}}</text>
  22. <text>状态:{{ item.status==0?'待审核':item.status==1?'已通过':item.status==2?'已驳回':item.status==3 ? '已取消':'' }}</text>
  23. </view>
  24. <view class="flex val">¥{{parseFloat(item.xhPrice)}} <view class="iconfont iconxiangyou"></view> </view>
  25. </block>
  26. </view>
  27. </block>
  28. <block v-else>
  29. <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
  30. </block>
  31. <uni-popup ref="classRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  32. <view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择分类:</view>
  33. <view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
  34. <view v-for="(item, index) in itemClassData" :key="index" @tap.stop="setClass(index)" style="margin-bottom:20upx;margin-left:3upx;">
  35. <image :src="item.cover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
  36. <view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;" v-if="item.select == 0">{{item.name}}</view>
  37. <view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;color:red;font-weight:bold;" v-else>{{item.name}}</view>
  38. </view>
  39. </view>
  40. <view style="text-align:center;padding:10upx 0 10upx 0;">
  41. <button class="admin-button-com big blue" @click="cancelClass()">取消</button>
  42. <button class="admin-button-com big blue" style="margin-left:60upx;" @click="confirmClass()">确认</button>
  43. </view>
  44. </uni-popup>
  45. </view>
  46. </template>
  47. <script>
  48. import { list } from "@/mixins";
  49. import { getRefundListByItem } from "@/api/refund"
  50. import { getAllItemClass } from "@/api/item-class"
  51. import DateSelect from "@/components/module/dateSelect";
  52. export default {
  53. name: "refundAllList",
  54. components: {DateSelect},
  55. mixins: [list],
  56. data() {
  57. return {
  58. itemClassData:[],
  59. status:-1,
  60. cause:-1,
  61. totalAmount:0,
  62. totalCost:0,
  63. searchTime:'',
  64. startTime:'',
  65. endTime:''
  66. };
  67. },
  68. onPullDownRefresh() {
  69. this.resetList();
  70. this.getRefundData().then((res) => {
  71. uni.stopPullDownRefresh();
  72. });
  73. },
  74. onReachBottom() {
  75. if (!this.list.finished) {
  76. this.getRefundData().then((res) => {
  77. uni.stopPullDownRefresh();
  78. });
  79. } else {
  80. uni.stopPullDownRefresh();
  81. }
  82. },
  83. mounted() {
  84. },
  85. onLoad(option) {
  86. this.resetList();
  87. this.getRefundData();
  88. },
  89. methods: {
  90. selectDateFn(val) {
  91. this.searchTime = val.searchTime
  92. this.startTime = val.startTime
  93. this.endTime = val.endTime
  94. this.resetList()
  95. this.getRefundData()
  96. },
  97. cancelClass(){
  98. this.$refs.classRef.close()
  99. },
  100. confirmClass(){
  101. this.$refs.classRef.close()
  102. this.resetList()
  103. this.getRefundData()
  104. },
  105. changeCause(){
  106. let that = this
  107. uni.showActionSheet({
  108. itemList: ['质量问题', '多开错开', '取消选择'],
  109. success: function (res) {
  110. if(res.tapIndex == 0){
  111. that.cause = 0
  112. }
  113. if(res.tapIndex == 1){
  114. that.cause = 1
  115. }
  116. if(res.tapIndex == 2){
  117. that.cause = -1
  118. }
  119. that.resetList()
  120. that.getRefundData()
  121. }
  122. })
  123. },
  124. changeStatus(){
  125. let that = this
  126. uni.showActionSheet({
  127. itemList: ['处理中', '已通过', '已驳回','已取消','取消选择'],
  128. success: function (res) {
  129. if(res.tapIndex == 0){
  130. that.status = 0
  131. }
  132. if(res.tapIndex == 1){
  133. that.status = 1
  134. }
  135. if(res.tapIndex == 2){
  136. that.status = 2
  137. }
  138. if(res.tapIndex == 3){
  139. that.status = 3
  140. }
  141. if(res.tapIndex == 4){
  142. that.status = -1
  143. }
  144. that.resetList()
  145. that.getRefundData()
  146. }
  147. })
  148. },
  149. changeClass(){
  150. this.$refs.classRef.open('center')
  151. },
  152. setClass(index){
  153. this.itemClassData[index].select = this.itemClassData[index].select == 0 ? 1 : 0
  154. this.$forceUpdate()
  155. },
  156. init(){
  157. getAllItemClass().then(res => {
  158. if (!this.$util.isEmpty(res.data)){
  159. let list = res.data
  160. this.itemClassData = list.map(ele => {
  161. return { ...ele,select:0}
  162. })
  163. }
  164. })
  165. },
  166. goDetail(item){
  167. if(item.book == 1){
  168. this.$msg('预订单多退少补')
  169. return false
  170. }
  171. this.$util.pageTo({url: '/pagesOrder/refundDetail?from=1&id='+item.id})
  172. },
  173. getRefundData() {
  174. let ids = []
  175. this.itemClassData.forEach((item) => {
  176. if(item.select == 1){
  177. ids.push(item.id)
  178. }
  179. })
  180. getRefundListByItem({
  181. page: this.list.page,
  182. status:this.status,
  183. ids:JSON.stringify(ids),
  184. searchTime: this.searchTime,
  185. startTime: this.startTime,
  186. endTime: this.endTime,
  187. cause:this.cause
  188. }).then((res) => {
  189. this.completes(res)
  190. this.totalAmount = res.data.totalAmount ? parseFloat(res.data.totalAmount) : 0
  191. this.totalCost = res.data.totalCost ? parseFloat(res.data.totalCost) : 0
  192. if (this.$util.isEmpty(res.data)){
  193. return false
  194. }
  195. });
  196. },
  197. },
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. .app-content{
  202. .list{
  203. padding: 20upx 30upx;
  204. margin-bottom: 20upx;
  205. background: #FFFFFF;
  206. .label{
  207. position: relative;
  208. line-height: 50upx;
  209. text{
  210. display: block;
  211. }
  212. }
  213. .val{
  214. font-size: 25upx;
  215. .iconfont{
  216. margin-left: 12upx;
  217. color: #999999;
  218. }
  219. }
  220. }
  221. }
  222. .pass-red{
  223. font-weight:bold;
  224. color:red;
  225. }
  226. .cancel-pass{
  227. font-weight: normal;
  228. color:black;
  229. }
  230. .qa_cause{
  231. color:blue;
  232. }
  233. </style>