SalesOrder.vue 9.5 KB

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