index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="query-wrap">
  3. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入退货单号" @iconClick="iconClick" @input="input">
  4. </uni-easyinput>
  5. <v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs>
  6. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  7. <view class="inner-item" v-for="(item,indx) in dataList" :key="indx" @click="itemDetails(item)">
  8. <view class="inventory-item">
  9. <view class="shuo-item-name">
  10. <view class="shuo-label-podnme">
  11. 退货单号:
  12. </view>
  13. <view class="shuo-cont">
  14. {{item.id}}
  15. </view>
  16. </view>
  17. </view>
  18. <view class="inventory-item">
  19. <view class="shuo-item">
  20. <view class="shuo-label">
  21. 退货品种数:
  22. </view>
  23. <view class="shuo-cont">
  24. {{item.deltCnt||""}}
  25. </view>
  26. </view>
  27. <view class="shuo-item">
  28. <view class="shuo-label">
  29. 退货总金额:
  30. </view>
  31. <view class="shuo-cont">
  32. {{item.amt}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="inventory-item">
  37. <view class="shuo-item-name">
  38. <view class="shuo-label-podnme">
  39. 来源机构:
  40. </view>
  41. <view class="shuo-cont">
  42. {{item.orgName}}
  43. </view>
  44. </view>
  45. </view>
  46. <view class="inventory-item">
  47. <view class="shuo-item-name">
  48. <view class="shuo-label-podnme">
  49. 供应商名称:
  50. </view>
  51. <view class="shuo-cont">
  52. {{item.splerName}}
  53. </view>
  54. </view>
  55. </view>
  56. <view class="inventory-item">
  57. <view class="shuo-item-name">
  58. <view class="shuo-label">
  59. 退货时间:
  60. </view>
  61. <view class="shuo-cont">
  62. {{forMatTime(item.retnDate)}}
  63. </view>
  64. </view>
  65. </view>
  66. <uv-button text="确认" plain size="normal" type="primary" style="margin-top:20rpx;"
  67. @click.native.stop="itemDetails(item)" v-if="item.stas=='待确认'"></uv-button>
  68. </view>
  69. </z-paging>
  70. </view>
  71. </template>
  72. <script>
  73. import {
  74. mapState,
  75. mapMutations,
  76. mapActions
  77. } from 'vuex';
  78. import {
  79. debounce
  80. } from 'lodash';
  81. import moment from "moment";
  82. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  83. export default {
  84. mixins: [ZPMixin],
  85. data() {
  86. return {
  87. index: 0,
  88. value1: "",
  89. value: "",
  90. dataList: [],
  91. inputVal: "",
  92. codeVal: "",
  93. confirmVal: "",
  94. changeVal: "",
  95. tabList: ['待确认', '已确认'],
  96. tabIndex: ['A', 'Y'],
  97. valueList: 0,
  98. beforeClose: true,
  99. itemData: {}
  100. }
  101. },
  102. computed: {
  103. ...mapState(['instData']),
  104. },
  105. onShow() {
  106. uni.$once('update', function(data) {
  107. // uni.redirectTo({
  108. // url: '/pages/grounding/grounding' //写你的路径
  109. // });
  110. })
  111. },
  112. mounted() {
  113. },
  114. methods: {
  115. ...mapActions(['getRetData']),
  116. async queryList(pageNo, pageSize) {
  117. let pamStas = this.tabIndex[this.index];
  118. await this.getRetData({
  119. pam: {
  120. current: pageNo,
  121. size: pageSize,
  122. spdId: this.instData.spdId,
  123. stas: pamStas,
  124. id: this.value
  125. },
  126. that: this
  127. })
  128. },
  129. forMatTime(row) {
  130. return moment(row).format("YYYY-MM-DD HH:mm");
  131. },
  132. //跳转退货详情
  133. itemDetails(item) {
  134. uni.setStorage({
  135. key: 'depDetailData',
  136. data: item
  137. });
  138. uni.navigateTo({
  139. url: '/durgsubpkg/pages/depart-return/details',
  140. success: function(res) {
  141. console.log(res, "res")
  142. }
  143. });
  144. },
  145. input: debounce(function(e) {
  146. this.value = e;
  147. let pamStas = this.tabIndex[this.index];
  148. this.getRetData({
  149. pam: {
  150. spdId: this.instData.spdId,
  151. stas: pamStas,
  152. id: e
  153. },
  154. that: this
  155. })
  156. this.$nextTick(() => {
  157. // this.value = e;
  158. // this.inputVal = e;
  159. })
  160. }, 500),
  161. iconClick(e) {
  162. console.log(e, '点击搜索拿到的数据');
  163. },
  164. blur(e) {
  165. this.$nextTick(() => {
  166. // this.value = e.target.value;
  167. })
  168. },
  169. changeTab(index) {
  170. this.index = index;
  171. this.$refs.paging.reload();
  172. },
  173. handleShelf(item) {
  174. },
  175. changeList(e) {
  176. // console.log(e)
  177. },
  178. onchange(e) {
  179. // console.log(e, 44)
  180. },
  181. onnodeclick(node) {
  182. console.log(node, "node");
  183. },
  184. onpopupclosed(e) {
  185. // console.log(e, 33)
  186. }
  187. },
  188. watch: {
  189. }
  190. }
  191. </script>
  192. <style lang="scss" scoped>
  193. .query-wrap {
  194. width: 100%;
  195. padding: 20rpx;
  196. box-sizing: border-box;
  197. background-color: #F1F1F1;
  198. overflow-y: scroll;
  199. overflow-x: hidden;
  200. }
  201. uni-page-body {
  202. width: 100%;
  203. height: 100%;
  204. }
  205. </style>