Loss.vue 7.6 KB

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