index.vue 4.5 KB

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