index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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="item-stats">
  9. {{item.stas}}
  10. </view>
  11. <view class="inventory-item">
  12. <view class="shuo-item-name">
  13. <view class="shuo-label-podnme">
  14. 采购员
  15. </view>
  16. <view class="shuo-unit">
  17. {{item.crteUsrName}}
  18. </view>
  19. </view>
  20. </view>
  21. <view class="inventory-item">
  22. <view class="shuo-item-name">
  23. <view class="shuo-label">
  24. 计划单号:
  25. </view>
  26. <view class="shuo-cont">
  27. {{item.planNo}}
  28. </view>
  29. </view>
  30. </view>
  31. <view class="inventory-item">
  32. <view class="shuo-item">
  33. <view class="shuo-label">
  34. 品种数:
  35. </view>
  36. <view class="shuo-cont">
  37. {{item.catCnt}}
  38. </view>
  39. </view>
  40. <view class="shuo-item">
  41. <view class="shuo-label">
  42. 采购总数:
  43. </view>
  44. <view class="shuo-cont">
  45. {{item.sumCnt}}
  46. </view>
  47. </view>
  48. </view>
  49. <view class="inventory-item">
  50. <view class="shuo-item">
  51. <view class="shuo-label">
  52. 采购金额:
  53. </view>
  54. <view class="shuo-cont">
  55. {{item.sumAmt?item.sumAmt:""}}
  56. </view>
  57. </view>
  58. </view>
  59. <view class="inventory-item">
  60. <view class="shuo-item-name">
  61. <view class="shuo-label">
  62. 采购时间:
  63. </view>
  64. <view class="shuo-cont">
  65. {{item.crteTime?item.crteTime:""}}
  66. </view>
  67. </view>
  68. </view>
  69. <uv-button text="确认" plain size="normal" type="primary" style="margin-top:20rpx;"
  70. @click.native.stop="itemDetails(item)" v-if="item.stas=='待确认'"></uv-button>
  71. </view>
  72. </z-paging>
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. mapState,
  78. mapMutations,
  79. mapActions
  80. } from 'vuex';
  81. import {
  82. debounce
  83. } from 'lodash';
  84. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  85. export default {
  86. mixins: [ZPMixin],
  87. data() {
  88. return {
  89. index: 0,
  90. value1: "",
  91. value: "",
  92. dataList: [],
  93. inputVal: "",
  94. codeVal: "",
  95. confirmVal: "",
  96. changeVal: "",
  97. tabList: ['待确认', '已确认', '已退回'],
  98. valueList: 0,
  99. beforeClose: true,
  100. itemData: {}
  101. }
  102. },
  103. computed: {
  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(['getPlanData']),
  116. async queryList(pageNo, pageSize) {
  117. let pamStas = this.tabList[this.index] == "全部" ? "" : this.tabList[this.index];
  118. await this.getPlanData({
  119. pam: {
  120. current: pageNo,
  121. size: pageSize,
  122. stas: pamStas,
  123. planNo: this.value.trim()
  124. },
  125. that: this
  126. })
  127. },
  128. //跳转采购计划详情
  129. itemDetails(item) {
  130. uni.setStorage({
  131. key: 'planDetailData',
  132. data: item
  133. });
  134. uni.navigateTo({
  135. url: '/subpkg/pages/proplanconfirm/details',
  136. success: function(res) {
  137. console.log(res, "res")
  138. }
  139. });
  140. },
  141. input: debounce(function(e) {
  142. this.value = e;
  143. let pamStas = this.tabList[this.index] == "全部" ? "" : this.tabList[this.index];
  144. this.getPlanData({
  145. pam: {
  146. planNo: e,
  147. stas: pamStas,
  148. },
  149. that: this
  150. })
  151. this.$nextTick(() => {
  152. // this.value = e;
  153. // this.inputVal = e;
  154. })
  155. }, 500),
  156. iconClick(e) {
  157. console.log(e, '点击搜索拿到的数据');
  158. },
  159. blur(e) {
  160. this.$nextTick(() => {
  161. // this.value = e.target.value;
  162. })
  163. },
  164. changeTab(index) {
  165. this.index = index;
  166. this.$refs.paging.reload();
  167. },
  168. handleShelf(item) {
  169. },
  170. changeList(e) {
  171. // console.log(e)
  172. },
  173. onchange(e) {
  174. // console.log(e, 44)
  175. },
  176. onnodeclick(node) {
  177. console.log(node, "node");
  178. },
  179. onpopupclosed(e) {
  180. // console.log(e, 33)
  181. }
  182. },
  183. watch: {
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .query-wrap {
  189. width: 100%;
  190. padding: 20rpx;
  191. box-sizing: border-box;
  192. background-color: #F1F1F1;
  193. overflow-y: scroll;
  194. overflow-x: hidden;
  195. }
  196. uni-page-body {
  197. width: 100%;
  198. height: 100%;
  199. }
  200. </style>