index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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.detlCnt||""}}
  25. </view>
  26. </view>
  27. <view class="shuo-item">
  28. <view class="shuo-label">
  29. 退货总数量:
  30. </view>
  31. <view class="shuo-cont">
  32. {{item.retnCnt}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="inventory-item">
  37. <view class="shuo-item">
  38. <view class="shuo-label">
  39. 退货总金额:
  40. </view>
  41. <view class="shuo-cont">
  42. {{item.retnAmt||""}}
  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.branchName||""}}
  53. </view>
  54. </view>
  55. </view>
  56. <view class="inventory-item">
  57. <view class="shuo-item-name">
  58. <view class="shuo-label-podnme">
  59. 供应商名称:
  60. </view>
  61. <view class="shuo-cont">
  62. {{item.supplierName||""}}
  63. </view>
  64. </view>
  65. </view>
  66. <view class="inventory-item">
  67. <view class="shuo-item-name">
  68. <view class="shuo-label">
  69. 退货人:
  70. </view>
  71. <view class="shuo-cont">
  72. {{item.docmker||""}}
  73. </view>
  74. </view>
  75. </view>
  76. <view class="inventory-item">
  77. <view class="shuo-item-name">
  78. <view class="shuo-label">
  79. 退货时间:
  80. </view>
  81. <view class="shuo-cont">
  82. {{forMatTime(item.docmkDate)}}
  83. </view>
  84. </view>
  85. </view>
  86. <uv-button text="确认" plain size="normal" type="primary" style="margin-top:20rpx;"
  87. @click.native.stop="itemDetails(item)" v-if="item.stas=='待确认'"></uv-button>
  88. </view>
  89. </z-paging>
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. mapState,
  95. mapMutations,
  96. mapActions
  97. } from 'vuex';
  98. import {
  99. debounce
  100. } from 'lodash';
  101. import moment from "moment";
  102. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  103. export default {
  104. mixins: [ZPMixin],
  105. data() {
  106. return {
  107. index: 0,
  108. value1: "",
  109. value: "",
  110. dataList: [],
  111. inputVal: "",
  112. codeVal: "",
  113. confirmVal: "",
  114. changeVal: "",
  115. tabList: ['待确认', '已确认'],
  116. tabIndex: ['A', 'B'],
  117. valueList: 0,
  118. beforeClose: true,
  119. itemData: {}
  120. }
  121. },
  122. computed: {
  123. ...mapState(['instData']),
  124. },
  125. onShow() {
  126. uni.$once('update', function(data) {
  127. // uni.redirectTo({
  128. // url: '/pages/grounding/grounding' //写你的路径
  129. // });
  130. })
  131. },
  132. mounted() {
  133. },
  134. methods: {
  135. ...mapActions(['getRetData']),
  136. async queryList(pageNo, pageSize) {
  137. let pamStas = this.tabIndex[this.index];
  138. await this.getRetData({
  139. pam: {
  140. current: pageNo,
  141. size: pageSize,
  142. spdId: this.instData.spdId,
  143. stas: pamStas,
  144. id: this.value
  145. },
  146. that: this
  147. })
  148. },
  149. forMatTime(row) {
  150. return moment(row).format("YYYY-MM-DD HH:mm");
  151. },
  152. //跳转退货详情
  153. itemDetails(item) {
  154. uni.setStorage({
  155. key: 'depDetailData',
  156. data: item
  157. });
  158. uni.navigateTo({
  159. url: '/subpkg/pages/mcs-depart-return/details',
  160. success: function(res) {
  161. console.log(res, "res")
  162. }
  163. });
  164. },
  165. input: debounce(function(e) {
  166. this.value = e;
  167. let pamStas = this.tabIndex[this.index];
  168. this.getRetData({
  169. pam: {
  170. spdId: this.instData.spdId,
  171. stas: pamStas,
  172. id: e
  173. },
  174. that: this
  175. })
  176. this.$nextTick(() => {
  177. // this.value = e;
  178. // this.inputVal = e;
  179. })
  180. }, 500),
  181. iconClick(e) {
  182. console.log(e, '点击搜索拿到的数据');
  183. },
  184. blur(e) {
  185. this.$nextTick(() => {
  186. // this.value = e.target.value;
  187. })
  188. },
  189. changeTab(index) {
  190. this.index = index;
  191. this.$refs.paging.reload();
  192. },
  193. handleShelf(item) {
  194. },
  195. changeList(e) {
  196. // console.log(e)
  197. },
  198. onchange(e) {
  199. // console.log(e, 44)
  200. },
  201. onnodeclick(node) {
  202. console.log(node, "node");
  203. },
  204. onpopupclosed(e) {
  205. // console.log(e, 33)
  206. }
  207. },
  208. watch: {
  209. }
  210. }
  211. </script>
  212. <style lang="scss" scoped>
  213. .query-wrap {
  214. width: 100%;
  215. padding: 20rpx;
  216. box-sizing: border-box;
  217. background-color: #F1F1F1;
  218. overflow-y: scroll;
  219. overflow-x: hidden;
  220. }
  221. uni-page-body {
  222. width: 100%;
  223. height: 100%;
  224. }
  225. </style>