AccountManagement.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view>
  3. <view class="tabs-view">
  4. <view class='btn' @click="add">
  5. <!-- <u-button type="primary" size="mini" @click="edit">+</u-button> -->
  6. +
  7. </view>
  8. <view class="keyword-view clearfix">
  9. <view class="float_left">
  10. <u-search
  11. :show-action="false"
  12. @clear="searchData()"
  13. @search="searchData()"
  14. :clearabled="true"
  15. placeholder="单号/操作人"
  16. v-model="search_form.no"
  17. ></u-search>
  18. </view>
  19. <view class="float_right" @click="openSel('search_show')"><text class="custom-icon custom-icon-shaixuan"></text></view>
  20. </view>
  21. </view>
  22. <view class="list-ul">
  23. <view class="list-li clearfix" v-for="(item, index) in outgoing_list" :key="index">
  24. <view class="title clearfix" @click="details(item.id)">
  25. <view class="float_left" style="font-size: 28rpx;font-weight: 700;">{{ item.name || '--' }}</view>
  26. <view class="float_right">
  27. <span v-if="item.enableStatus === 5" class="success-status">启用</span>
  28. <span v-else class=" warning-status">禁用</span>
  29. <text class="custom-icon custom-icon-jinru"></text>
  30. </view>
  31. </view>
  32. <view class="list-cont">
  33. <view class="list-cont-li">日期:{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd') }}</view>
  34. <view class="list-cont-li clearfix">账户号:{{ item.accountNumber }}</view>
  35. <view class="list-cont-li clearfix">账户编码:{{ item.accountCode }}</view>
  36. </view>
  37. </view>
  38. <u-popup v-model="search_show" mode="right">
  39. <view class="search-pop">
  40. <view class="form-view">
  41. <u-form label-width="160rpx" label-position="left">
  42. <u-form-item label-position="top" label="制单日期">
  43. <view class="date-li">
  44. <picker mode="date" @change="bindDateStartChange">
  45. <text class="date-li">{{ search_form.startTime ? $u.timeFormat(search_form.startTime, 'yyyy-mm-dd') : '开始日期' }}</text>
  46. </picker>
  47. </view>
  48. <view class="date-line">-</view>
  49. <view class="date-li">
  50. <picker mode="date" @change="bindDateEndChange">
  51. <text class="date-li">{{ search_form.endTime ? $u.timeFormat(search_form.endTime, 'yyyy-mm-dd') : '结束日期' }}</text>
  52. </picker>
  53. </view>
  54. </u-form-item>
  55. <!-- <u-form-item label-position="top" label="审核状态">
  56. <view style="font-size: 22rpx; color: #6c6c6c;">可多选</view>
  57. <text
  58. v-for="(item, index) in order_status"
  59. :key="index"
  60. class="check-li"
  61. :class="[search_form.auditStatus.indexOf(item.value) > -1 ? 'active' : '']"
  62. @click="statusChange(item)"
  63. >
  64. {{ item.label }}
  65. </text>
  66. </u-form-item> -->
  67. </u-form>
  68. </view>
  69. <view class="search-btn">
  70. <view class="btn-li" @click="clearValue()">重置</view>
  71. <view class="btn-li" @click="searchConfirm">确定</view>
  72. </view>
  73. </view>
  74. </u-popup>
  75. <view v-if="!outgoing_list.length" class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view>
  76. <u-loadmore v-if="outgoing_list.length" :status="load_status" />
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. export default {
  82. data() {
  83. return {
  84. search_show: false,
  85. order_status: [{ value: 5, label: '禁用' }, { value: 4, label: '启用' }],
  86. load_status: 'nomore',
  87. tabs_current: 0,
  88. page: 1,
  89. pageSize: 10,
  90. total: 0,
  91. search_form: {
  92. no:"",
  93. shopId: '',
  94. shopName: '',
  95. auditStatus: [],
  96. goodsName: '', // 商品名称
  97. warehouseId: '', // 仓库id
  98. startTime: '', // 制单开始时间
  99. endTime: '' // 制单结束时间
  100. },
  101. warehouse_name: '',
  102. outgoing_list: [],
  103. werahouseData: ''
  104. };
  105. },
  106. watch: {
  107. werahouseData(val) {
  108. if (val) {
  109. this.search_form.warehouseId = val.id;
  110. this.warehouse_name = val.warehouseName;
  111. }
  112. }
  113. },
  114. onShow() {
  115. this.getAllAccount();
  116. },
  117. onReachBottom() {
  118. if (this.total / this.pageSize > this.page) {
  119. this.page += 1;
  120. this.getData();
  121. }
  122. },
  123. onPullDownRefresh() {
  124. this.searchData();
  125. },
  126. methods: {
  127. details(id){
  128. uni.navigateTo({
  129. url:'/pagesT/account/AccountDetails?id='+id
  130. })
  131. },
  132. add(){
  133. uni.navigateTo({
  134. url:'/pagesT/account/AddAcount'
  135. })
  136. },
  137. openSel(key) {
  138. this[key] = true;
  139. },
  140. bindDateStartChange(e) {
  141. this.search_form.startTime = this.$utils.timeByTimestamp(e.detail.value + ' 00:00:00');
  142. },
  143. bindDateEndChange(e) {
  144. this.search_form.endTime = this.$utils.timeByTimestamp(e.detail.value + ' 23:59:59');
  145. },
  146. // 审核状态切换
  147. statusChange(row) {
  148. const index = this.search_form.auditStatus.indexOf(row.value);
  149. if (index === -1) {
  150. this.search_form.auditStatus.push(row.value);
  151. } else {
  152. this.search_form.auditStatus.splice(index, 1);
  153. }
  154. },
  155. // 搜索确定
  156. searchConfirm() {
  157. this.search_show = false;
  158. this.searchData();
  159. },
  160. // 重置搜索
  161. clearValue(params) {
  162. if (!params) {
  163. this.search_form = {
  164. shopId: '',
  165. shopName: '',
  166. auditStatus: '',
  167. goodsName: '', // 商品名称
  168. warehouseId: '', // 仓库id
  169. startTime: '', // 制单开始时间
  170. endTime: '' // 制单结束时间
  171. };
  172. this.searchConfirm();
  173. } else {
  174. this.search_form[params] = '';
  175. }
  176. },
  177. getAllAccount() {
  178. this.load_status = 'loading';
  179. this.$u.api
  180. .getAllAccount({
  181. start:this.search_form.startTime,
  182. end:this.search_form.endTime,
  183. page: this.page,
  184. pageSize: this.pageSize,
  185. })
  186. .then(res => {
  187. console.log(res.data)
  188. if (this.page === 1) {
  189. this.outgoing_list = res.data;
  190. } else {
  191. this.outgoing_list = this.outgoing_list.concat(res.data);
  192. }
  193. this.total = res.pageTotal;
  194. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  195. });
  196. },
  197. // 判断
  198. getData() {
  199. this.getAllAccount();
  200. },
  201. searchData() {
  202. this.page = 1;
  203. this.getData();
  204. }
  205. }
  206. };
  207. </script>
  208. <style lang="scss" scoped>
  209. .tabs-view {
  210. position: fixed;
  211. width: 100%;
  212. top: 0;
  213. left: 0;
  214. z-index: 99;
  215. .btn{
  216. width: 70rpx;
  217. height: 70rpx;
  218. position: fixed;
  219. bottom: 50rpx;
  220. right: 35rpx;
  221. border-radius: 50%;
  222. background-color: #2979FF;
  223. text-align: center;
  224. color: #FFFFFF;
  225. vertical-align: middle;
  226. font-size: 49rpx;
  227. box-shadow: 0px 9rpx 76rpx 0px rgba(3, 122, 255, 0.55);
  228. }
  229. .keyword-view {
  230. padding: 20rpx 24rpx 0;
  231. background-color: #ffffff;
  232. z-index: 9;
  233. padding-bottom: 20rpx;
  234. .float_left {
  235. width: 640rpx;
  236. }
  237. .float_right {
  238. line-height: 64rpx;
  239. width: 50rpx;
  240. text-align: center;
  241. color: #666666;
  242. }
  243. }
  244. }
  245. .list-ul {
  246. padding-top: 100rpx;
  247. .list-li {
  248. width: 710rpx;
  249. margin: 20rpx auto;
  250. padding: 0 24rpx 20rpx;
  251. background-color: #ffffff;
  252. padding-bottom: 20rpx;
  253. border-radius: 20rpx;
  254. .title {
  255. line-height: 80rpx;
  256. border-bottom: 1px solid #eeeeee;
  257. .float_left {
  258. font-weight: bold;
  259. }
  260. .float_rigth {
  261. .custom-icon-jinru {
  262. margin-left: 10rpx;
  263. font-size: 28rpx;
  264. }
  265. }
  266. }
  267. .list-cont {
  268. margin-top: 10rpx;
  269. position: relative;
  270. .price {
  271. position: absolute;
  272. top: 50%;
  273. transform: translateY(-50%);
  274. right: 0;
  275. font-weight: bold;
  276. color: $uni-color-error;
  277. .custom-icon-jinru {
  278. font-size: 28rpx;
  279. color: #6c6c6c;
  280. font-weight: 400;
  281. }
  282. }
  283. .list-cont-li {
  284. line-height: 40rpx;
  285. font-size: 24rpx;
  286. color: #666666;
  287. .mobile {
  288. color: $uni-color-primary;
  289. }
  290. }
  291. }
  292. }
  293. }
  294. </style>