ReturnFrom.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view>
  3. <view class="tabs-view">
  4. <view class="keyword-view clearfix">
  5. <view class="float_left">
  6. <u-search :show-action="false" @clear="searchData()" @search="searchData()" :clearabled="true"
  7. placeholder="单据编号" v-model="search_form.keyword"></u-search>
  8. </view>
  9. <view class="float_right" @click="openSel('search_show')"><text
  10. class="custom-icon custom-icon-shaixuan"></text></view>
  11. </view>
  12. </view>
  13. <view class="list-ul">
  14. <view class="list-li clearfix" v-for="(item, index) in return_list" :key="index" @click="details(item.id, item.createTime)">
  15. <view class="title clearfix" >
  16. <view class="float_left" style="font-size: 28rpx;font-weight: 700;">{{ item.unitName || '--' }}
  17. </view>
  18. <view class="float_right">
  19. <span v-if="item.auditStatus === 1" class="warning-status">待审核</span>
  20. <span v-else class="success-status">已审核</span>
  21. <text class="custom-icon custom-icon-jinru"></text>
  22. </view>
  23. </view>
  24. <view class="list-cont">
  25. <view class="list-cont-li">日期:{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd') }}</view>
  26. <view class="list-cont-li clearfix">单据号:{{ item.no }}</view>
  27. <view class="list-cont-li clearfix" v-if="item.originNo">源单据号:{{ item.originNo }}</view>
  28. <view class="list-cont-li clearfix" v-if="item.shopName">店铺:{{ item.shopName }}</view>
  29. <view class="list-cont-li clearfix">类型:{{ item.financeType }}</view>
  30. <view class="price">
  31. <text>{{ $utils.formattedNumber(item.money) }}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <addBtn v-if="$accessCheck($Access.RefundForm_AddRefundForm)" url="/pagesT/Finance/ReturnFromAdd"></addBtn>
  36. <u-popup v-model="search_show" mode="right">
  37. <view class="search-pop">
  38. <view class="form-view">
  39. <u-form label-width="160rpx" label-position="left">
  40. <u-form-item label="客户">
  41. <view class="clearfix form-val" @click="goPage('/pagesT/customer/selCustomer')">
  42. <text
  43. class="float_left ellipsis">{{ search_form.unitId ? customer_name : '请选择' }}</text>
  44. <view class="float_right" @click.stop="clearValue('unitId')">
  45. <u-icon :name="!search_form.unitId ? 'arrow-right' : 'close-circle-fill'"
  46. size="28" color="#999999"></u-icon>
  47. </view>
  48. </view>
  49. </u-form-item>
  50. <u-form-item label="单据状态">
  51. <view class="clearfix form-val" @click="openSel('show_status')">
  52. <text
  53. class="float_left ellipsis">{{ search_form.auditStatus ? auditStatus_name : '请选择' }}</text>
  54. <view class="float_right" @click.stop="clearValue('auditStatus')">
  55. <u-icon :name="!search_form.auditStatus ? 'arrow-right' : 'close-circle-fill'"
  56. size="28" color="#999999"></u-icon>
  57. </view>
  58. </view>
  59. </u-form-item>
  60. <u-form-item label-position="top" label="创建日期">
  61. <view class="date-li">
  62. <picker mode="date" @change="bindDateStartChange">
  63. <text
  64. class="date-li">{{ search_form.start ? $u.timeFormat(search_form.start, 'yyyy-mm-dd') : '开始日期' }}</text>
  65. </picker>
  66. </view>
  67. <view class="date-line">-</view>
  68. <view class="date-li">
  69. <picker mode="date" @change="bindDateEndChange">
  70. <text
  71. class="date-li">{{ search_form.end ? $u.timeFormat(search_form.end, 'yyyy-mm-dd') : '结束日期' }}</text>
  72. </picker>
  73. </view>
  74. </u-form-item>
  75. </u-form>
  76. </view>
  77. <view class="search-btn">
  78. <view class="btn-li" @click="clearValue()">重置</view>
  79. <view class="btn-li" @click="searchConfirm">确定</view>
  80. </view>
  81. </view>
  82. </u-popup>
  83. <u-select @confirm="statusChange" v-model="show_status" :list="order_status"></u-select>
  84. <u-select @confirm="financeTypeChange" v-model="financeTypeId_status" :list="financeType"></u-select>
  85. <view v-if="!return_list.length" class="empty-view">
  86. <u-empty text="暂无数据" mode="list"></u-empty>
  87. </view>
  88. <u-loadmore v-if="return_list.length" :status="load_status" />
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. data() {
  95. return {
  96. show_status: false,
  97. search_show: false,
  98. financeTypeId_status: false,
  99. order_status: [{
  100. value: 2,
  101. label: '已审核'
  102. }, {
  103. value: 1,
  104. label: '待审核'
  105. }],
  106. financeType: [],
  107. load_status: 'nomore',
  108. tabs_current: 0,
  109. page: 1,
  110. pageSize: 10,
  111. total: 0,
  112. search_form: {
  113. keyword: '',
  114. auditStatus: '',
  115. financeTypeId: '',
  116. start: '',
  117. end: '',
  118. unitId: ''
  119. },
  120. customer_name: '',
  121. return_list: [],
  122. werahouseData: '',
  123. customerData: '',
  124. auditStatus_name: '',
  125. financeTypeId_name: ''
  126. };
  127. },
  128. watch: {
  129. customerData(val) {
  130. if (val) {
  131. this.customer_name = val.name;
  132. this.search_form.unitId = val.id;
  133. }
  134. },
  135. },
  136. onLoad() {
  137. this.getAllFinanceType()
  138. },
  139. onShow() {
  140. this.searchData();
  141. },
  142. onReachBottom() {
  143. if (this.total / this.pageSize > this.page) {
  144. this.page += 1;
  145. this.getAllRefund();
  146. }
  147. },
  148. onPullDownRefresh() {
  149. this.searchData();
  150. },
  151. methods: {
  152. // 审核状态切换
  153. statusChange(e) {
  154. this.search_form.auditStatus = e[0].value;
  155. this.auditStatus_name = e[0].label;
  156. },
  157. //业务类型切换
  158. financeTypeChange(e) {
  159. this.search_form.financeTypeId = e[0].value;
  160. this.financeTypeId_name = e[0].label;
  161. },
  162. details(id, createTime) {
  163. uni.navigateTo({
  164. url: '/pagesT/Finance/ReturnFromDetails?id=' + id + '&&createTime=' + createTime
  165. });
  166. },
  167. openSel(key) {
  168. this[key] = true;
  169. },
  170. bindDateStartChange(e) {
  171. this.search_form.start = this.$utils.timeByTimestamp(e.detail.value + ' 00:00:00');
  172. },
  173. bindDateEndChange(e) {
  174. this.search_form.end = this.$utils.timeByTimestamp(e.detail.value + ' 23:59:59');
  175. },
  176. // 搜索确定
  177. searchConfirm() {
  178. this.search_show = false;
  179. this.searchData();
  180. },
  181. // 重置搜索
  182. clearValue(params) {
  183. if (!params) {
  184. this.search_form = {
  185. keyword: '',
  186. auditStatus: '',
  187. financeTypeId: '',
  188. time: '',
  189. start: '',
  190. end: '',
  191. unitId: ''
  192. };
  193. this.searchConfirm();
  194. } else {
  195. this.search_form[params] = '';
  196. }
  197. },
  198. getAllRefund() {
  199. this.load_status = 'loading';
  200. this.$u.api
  201. .getAllRefund({
  202. page: this.page,
  203. pageSize: this.pageSize,
  204. keyword: this.search_form.keyword,
  205. financeTypeId: this.search_form.financeTypeId,
  206. start: this.search_form.start,
  207. end: this.search_form.end,
  208. unitId: this.search_form.unitId,
  209. auditStatus: this.search_form.auditStatus.toString()
  210. })
  211. .then(res => {
  212. if (this.page === 1) {
  213. this.return_list = res.data;
  214. } else {
  215. this.return_list = this.return_list.concat(res.data);
  216. }
  217. this.total = res.pageTotal;
  218. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  219. });
  220. },
  221. searchData() {
  222. this.page = 1;
  223. this.getAllRefund();
  224. },
  225. // 获取财务类型
  226. getAllFinanceType() {
  227. this.$u.api.getAllFinanceTypeNoPage(3).then(res => {
  228. this.financeType = res.data.map((item) => {
  229. return{
  230. label: item.name,
  231. value: item.id
  232. }
  233. })
  234. })
  235. },
  236. }
  237. };
  238. </script>
  239. <style lang="scss" scoped>
  240. .tabs-view {
  241. position: fixed;
  242. width: 100%;
  243. top: 0;
  244. left: 0;
  245. z-index: 99;
  246. .btn {
  247. width: 70rpx;
  248. height: 70rpx;
  249. position: fixed;
  250. bottom: 50rpx;
  251. right: 35rpx;
  252. border-radius: 50%;
  253. background-color: #2979ff;
  254. text-align: center;
  255. color: #ffffff;
  256. vertical-align: middle;
  257. font-size: 49rpx;
  258. box-shadow: 0px 9rpx 76rpx 0px rgba(3, 122, 255, 0.55);
  259. }
  260. .keyword-view {
  261. padding: 20rpx 24rpx 0;
  262. background-color: #ffffff;
  263. z-index: 9;
  264. padding-bottom: 20rpx;
  265. .float_left {
  266. width: 640rpx;
  267. }
  268. .float_right {
  269. line-height: 64rpx;
  270. width: 50rpx;
  271. text-align: center;
  272. color: #666666;
  273. }
  274. }
  275. }
  276. .list-ul {
  277. padding-top: 100rpx;
  278. .list-li {
  279. width: 710rpx;
  280. margin: 20rpx auto;
  281. padding: 0 24rpx 20rpx;
  282. background-color: #ffffff;
  283. padding-bottom: 20rpx;
  284. border-radius: 20rpx;
  285. .title {
  286. line-height: 80rpx;
  287. border-bottom: 1px solid #eeeeee;
  288. .float_left {
  289. font-weight: bold;
  290. }
  291. .float_rigth {
  292. .custom-icon-jinru {
  293. margin-left: 10rpx;
  294. font-size: 28rpx;
  295. }
  296. }
  297. }
  298. .list-cont {
  299. margin-top: 10rpx;
  300. position: relative;
  301. .price {
  302. position: absolute;
  303. top: 50%;
  304. transform: translateY(-50%);
  305. right: 0;
  306. font-weight: bold;
  307. color: $uni-color-error;
  308. .custom-icon-jinru {
  309. font-size: 28rpx;
  310. color: #6c6c6c;
  311. font-weight: 400;
  312. }
  313. }
  314. .list-cont-li {
  315. line-height: 40rpx;
  316. font-size: 24rpx;
  317. color: #666666;
  318. .mobile {
  319. color: $uni-color-primary;
  320. }
  321. }
  322. }
  323. }
  324. }
  325. </style>