PurchaseReturnOrder.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view v-if="$accessCheck($Access.PurchaseReturnOrderGetAllPurchaseOut)">
  3. <view class="keyword-view clearfix">
  4. <view class="float_left">
  5. <u-search @clear="searchData()" @search="searchData()" :show-action="false" :clearabled="true" placeholder="采购退货单号" v-model="search_form.no"></u-search>
  6. </view>
  7. <view class="float_right" @click="openSearch"><text class="custom-icon custom-icon-shaixuan"></text></view>
  8. </view>
  9. <view class="list-ul">
  10. <block v-for="(item, index) in purchase_list" :key="index">
  11. <view v-if="$accessCheck($Access.PurchaseReturnOrderGetPurchaseOutInfoById)" class="list-li" @click="goPage(`/pagesT/Purchase/PurchaseReturnDetail?id=${item.id}`)">
  12. <view class="top clearfix">
  13. <view class="ellipsis float_left">{{ item.supplierName }}</view>
  14. <view class="float_right">
  15. <text v-if="item.auditStatus === 2" class="success-status">已审核</text>
  16. <text v-else class="warning-status">待审核</text>
  17. <u-icon name="arrow-right" size="28" color="#999999"></u-icon>
  18. </view>
  19. </view>
  20. <view class="list-cont">
  21. <view class="total-money">{{ $utils.formattedNumber(item.purchaseAmount) }}</view>
  22. <view class="info-li" style="font-size: 28rpx; color: #111111;">{{ item.warehouseName }}</view>
  23. <view class="info-li" @click.stop="copy(item.no)">
  24. <text style="margin-right: 20rpx;">{{ item.no }}</text>
  25. <u-icon name="copy" custom-prefix="custom-icon" size="22"></u-icon>
  26. </view>
  27. <view class="info-li clearfix">
  28. <text class="float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
  29. <view class="float_right">
  30. <text v-if="item.outStatus === 5" class="success-status">已出库</text>
  31. <text v-else class="warning-status">未出库</text>
  32. </view>
  33. </view>
  34. <view class="info-li clearfix">
  35. <text class="float_left">采购员:{{ item.buyerName }}</text>
  36. </view>
  37. </view>
  38. </view>
  39. </block>
  40. </view>
  41. <u-loadmore v-if="purchase_list.length" :status="load_status" />
  42. <view v-else class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view>
  43. <addBtn v-if="$accessCheck($Access.PurchaseReturnOrderAddPurchaseOut)" url="/pagesT/Purchase/AddPurchaseReturn"></addBtn>
  44. <u-popup v-model="search_show" mode="right">
  45. <view class="search-pop">
  46. <view class="form-view">
  47. <u-form label-width="160rpx" label-position="left">
  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-position="top" label="审核状态">
  57. <text
  58. v-for="(item, index) in order_status"
  59. :key="index"
  60. class="check-li"
  61. :class="[search_form.auditStatus === item.value ? '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="searchData">确定</view>
  72. </view>
  73. </view>
  74. </u-popup>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. order_status: [{ value: 2, label: '已审核' }, { value: 1, label: '待审核' }],
  82. search_show: false,
  83. warehouse_name: '',
  84. page: 1,
  85. pageSize: 10,
  86. total: 0,
  87. load_status: 'nomore',
  88. purchase_list: [],
  89. werahouseData: '',
  90. search_form: {
  91. no: '',
  92. auditStatus: '',
  93. warehouseId: ''
  94. }
  95. };
  96. },
  97. watch: {
  98. werahouseData(val) {
  99. if (val) {
  100. this.search_form.warehouseId = val.id;
  101. this.warehouse_name = val.warehouseName;
  102. }
  103. }
  104. },
  105. onShow() {
  106. this.page = 1;
  107. this.searchData();
  108. },
  109. onReachBottom() {
  110. if (this.total / this.pageSize > this.page) {
  111. this.page += 1;
  112. this.getAllPurchaseOut();
  113. }
  114. },
  115. onPullDownRefresh() {
  116. this.searchData();
  117. },
  118. methods: {
  119. clearValue(key) {
  120. if (!key) {
  121. this.search_form = {
  122. no: '',
  123. auditStatus: ''
  124. // warehouseId: ''
  125. };
  126. this.searchData();
  127. } else {
  128. this.search_form[key] = '';
  129. }
  130. },
  131. openSearch() {
  132. this.search_show = true;
  133. },
  134. statusChange(row) {
  135. this.search_form.auditStatus = row.value;
  136. },
  137. getAllPurchaseOut() {
  138. this.load_status = 'loading';
  139. this.$u.api
  140. .getAllPurchaseOut({
  141. auditStatus: this.search_form.auditStatus,
  142. sourceNo: this.search_form.no,
  143. page: this.page,
  144. pageSize: this.pageSize
  145. // warehouseId: this.search_form.warehouseId
  146. })
  147. .then(res => {
  148. if (this.page === 1) {
  149. this.purchase_list = res.data;
  150. } else {
  151. this.purchase_list = this.purchase_list.concat(res.data);
  152. }
  153. this.total = res.pageTotal;
  154. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  155. });
  156. },
  157. searchData() {
  158. this.page = 1;
  159. this.search_show = false;
  160. this.getAllPurchaseOut();
  161. }
  162. }
  163. };
  164. </script>
  165. <style lang="scss" scoped>
  166. .keyword-view {
  167. position: fixed;
  168. width: 100%;
  169. top: 0;
  170. left: 0;
  171. padding: 20rpx 24rpx;
  172. background-color: #ffffff;
  173. z-index: 9;
  174. .float_left {
  175. width: 640rpx;
  176. }
  177. .float_right {
  178. line-height: 64rpx;
  179. width: 50rpx;
  180. text-align: center;
  181. color: #666666;
  182. }
  183. }
  184. .list-ul {
  185. padding-top: 100rpx;
  186. .list-li {
  187. width: 710rpx;
  188. background-color: #ffffff;
  189. margin: 20rpx auto;
  190. border-radius: 20rpx;
  191. padding: 30rpx 24rpx;
  192. .top {
  193. padding-bottom: 20rpx;
  194. border-bottom: 1px solid #eeeeee;
  195. .float_left {
  196. width: 400rpx;
  197. font-weight: bold;
  198. }
  199. }
  200. .list-cont {
  201. padding-top: 20rpx;
  202. position: relative;
  203. .total-money {
  204. position: absolute;
  205. top: 45%;
  206. right: 0;
  207. transform: translateY(-50%);
  208. color: $uni-color-error;
  209. font-weight: bold;
  210. }
  211. .info-li {
  212. color: #6c6c6c;
  213. font-size: 24rpx;
  214. padding-bottom: 10rpx;
  215. }
  216. }
  217. }
  218. }
  219. </style>