clear.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view class="app-content">
  3. <view class="ex-page">
  4. <view class="top-bar">
  5. <DateSelect class="bar" top="0" defaultShowName="开单时间" @selectDateFn="selectKdDateFn" />
  6. <DateSelect class="bar" top="0" defaultShowName="结账时间" @selectDateFn="selectClearDateFn" />
  7. </view>
  8. <view style="position:absolute;top:80upx;">
  9. <text style="margin-left:140upx;color:#666666;font-size:28upx;" @click="selectCustom()">选客户</text>
  10. <text style="margin-left:130upx;color:#666666;font-size:28upx;" @click="showUnClear()">待结清</text>
  11. <text style="margin-left:130upx;color:#666666;font-size:28upx;" @click="resetData()">重置</text>
  12. </view>
  13. <view class="main-view">
  14. <view class="space-view ex-table">
  15. <block>
  16. <t-table :headerBackgroundColor="'#F0F2F6'">
  17. <t-tr header>
  18. <t-th>客户</t-th>
  19. <t-th>开单 / 结账</t-th>
  20. <t-th>金额</t-th>
  21. <t-th>状态</t-th>
  22. </t-tr>
  23. <block v-if="profile.list && !$util.isEmpty(profile.list)">
  24. <block v-for="(item, index) in profile.list" :key="index">
  25. <view @click="goClear(item)">
  26. <t-tr>
  27. <t-td><view style="color:#333333;">{{item.customName?item.customName:'-'}}</view></t-td>
  28. <t-td>
  29. <view style="color:#333333;" @click.stop="goOrder(item)">
  30. <view>{{item.addTime.substr(5,11)}}</view>
  31. <block v-if="item.debtPrice && Number(item.debtPrice)>0">
  32. <view v-if="item.clearId && Number(item.clearId)>0" style="margin-top:5upx;">{{item.clearTime.substr(5,11)}}</view>
  33. <block v-else>
  34. <view style="margin-top:5upx;" v-if="Number(parseFloat(item.remainDebtPrice)) == 0">已退</view>
  35. <view style="margin-top:5upx;" v-else>待结清</view>
  36. </block>
  37. </block>
  38. </view>
  39. </t-td>
  40. <t-td>
  41. <block v-if="item.debtPrice && Number(item.debtPrice)>0">
  42. <view style="color:#333333;" v-if="(item.clearId && Number(item.clearId)>0) || Number(parseFloat(item.remainDebtPrice)) == 0">¥{{item.actPrice?parseFloat(item.actPrice):0}}</view>
  43. <view style="color:red;font-weight:bold;" v-else>¥{{item.actPrice?parseFloat(item.actPrice):0}}</view>
  44. </block>
  45. <block v-else>
  46. <view style="color:#333333;">¥{{item.actPrice?parseFloat(item.actPrice):0}}</view>
  47. </block>
  48. </t-td>
  49. <t-td>
  50. <block v-if="item.debtPrice && Number(item.debtPrice)>0">
  51. <view style="color:#CCCCCC;font-weight:bold;" v-if="(item.clearId && Number(item.clearId)>0) || Number(parseFloat(item.remainDebtPrice)) == 0">已结清</view>
  52. <view style="color:red;font-weight:bold;font-size:30upx;" v-else>待结清</view>
  53. </block>
  54. <block v-else>
  55. <view style="color:red;font-weight:bold;">-</view>
  56. </block>
  57. </t-td>
  58. </t-tr>
  59. </view>
  60. </block>
  61. </block>
  62. </t-table>
  63. </block>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  71. import SelectList from "@/components/plugin/selectList";
  72. import { getStatOrderClear } from "@/api/stat";
  73. import { list } from "@/mixins";
  74. import ShopSelect from "@/components/module/shopSelect";
  75. import DateSelect from "@/components/module/dateSelect";
  76. import AppSearchModule from "@/components/module/app-search";
  77. import {mapActions, mapGetters} from "vuex";
  78. export default {
  79. components: { SelectList, AppWrapperEmpty,ShopSelect,AppSearchModule,DateSelect },
  80. mixins: [list],
  81. computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
  82. data() {
  83. return {
  84. form:{
  85. payTime:'',
  86. startTime: "",
  87. endTime: "",
  88. customId:0,
  89. customName:'',
  90. unClear:0,
  91. timeStyle:0
  92. },
  93. profile:[],
  94. searchText:'',
  95. };
  96. },
  97. onPullDownRefresh() {
  98. this.resetList();
  99. this.getList().then(res => {
  100. uni.stopPullDownRefresh();
  101. });
  102. },
  103. onShow(){
  104. if(this.form.customId && Number(this.form.customId)>0){
  105. this.getList()
  106. }
  107. },
  108. methods: {
  109. ...mapActions(['setUserShopAll']),
  110. resetData(){
  111. this.form.unClear = 0
  112. this.form.customId = 0
  113. this.form.customName = ''
  114. this.getList()
  115. },
  116. showUnClear(){
  117. this.form.unClear = 1
  118. this.getList()
  119. },
  120. goClear(order){
  121. this.$util.pageTo({ url: '/pagesArrears/details?id='+order.customId})
  122. },
  123. goOrder(order){
  124. this.$util.pageTo({ url: '/pagesOrder/detail?id='+order.id})
  125. },
  126. selectCustom(){
  127. this.pageTo({ url: '/admin/custom/selectCustom?style=2'})
  128. },
  129. searchFn(e){
  130. this.searchText = e;
  131. },
  132. selectKdDateFn(val) {
  133. this.form.timeStyle = 0
  134. this.form = {...this.form,...val}
  135. this.init();
  136. },
  137. selectClearDateFn(val){
  138. this.form.timeStyle = 1
  139. this.form = {...this.form,...val}
  140. this.init();
  141. },
  142. async init() {
  143. this.getList();
  144. },
  145. getList() {
  146. let that = this
  147. uni.showLoading()
  148. getStatOrderClear(this.form).then(res => {
  149. uni.hideLoading()
  150. that.profile = res.data
  151. });
  152. }
  153. }
  154. };
  155. </script>
  156. <style lang="scss" scoped>
  157. .ex-page {
  158. background: white;
  159. padding-top:20upx;
  160. height: 100%;
  161. display: flex;
  162. flex-direction: column;
  163. .top-bar {
  164. position: absolute;
  165. left: 0;
  166. top:15upx;
  167. display: flex;
  168. width: 100%;
  169. z-index: 20;
  170. .bar{
  171. width: 50%;
  172. height: 100%;
  173. text-align: center;
  174. &:nth-child(1){
  175. border-right: 1upx solid #eeeeec;
  176. }
  177. }
  178. }
  179. .main-view {
  180. margin-top:120upx;
  181. flex: 1;
  182. background-color: #f9fbfc;
  183. .space-view {
  184. background-color: #fff;
  185. .change-level{
  186. font-size:22upx;
  187. padding:10upx 15upx;
  188. }
  189. }
  190. .ex-info {
  191. padding: 30upx;
  192. .info-cell {
  193. display: flex;
  194. align-items: center;
  195. font-size: 28upx;
  196. &:not(:first-child) {
  197. margin-top: 20upx;
  198. }
  199. .cell-label {
  200. width: 110upx;
  201. color: #666666;
  202. }
  203. .cell-value {
  204. margin-left: 40upx;
  205. color: #333;
  206. &.warning {
  207. color: #ffaf1d;
  208. }
  209. &.success {
  210. color: #27c325;
  211. }
  212. }
  213. }
  214. }
  215. .ex-table {
  216. ::v-deep.icon-info {
  217. color: #333333;
  218. }
  219. }
  220. }
  221. .bar-view {
  222. display: flex;
  223. justify-content: space-between;
  224. align-items: center;
  225. padding: 0 30upx;
  226. width: 100%;
  227. height: 100upx;
  228. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  229. .info-view {
  230. font-size: 26upx;
  231. }
  232. .btn-view {
  233. display: flex;
  234. .admin-button-com {
  235. margin: 0 10upx;
  236. }
  237. }
  238. }
  239. }
  240. </style>