GodownEntry.vue 8.8 KB

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