index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view class="query-wrap">
  3. <view class="search-view">
  4. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入采购订单号" @iconClick="iconClick"
  5. @input="input">
  6. </uni-easyinput>
  7. <view class="filter-text" @click.stop="filterTime">
  8. 筛选
  9. </view>
  10. </view>
  11. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  12. <view class="inner-item" v-for="(item,indx) in dataList" :key="indx" @click="itemDetails(item)">
  13. <view class="item-stats">
  14. <span v-if="item.purcOrdStas == 'A'">待受理</span>
  15. <span v-if="item.purcOrdStas == 'B'">待出库</span>
  16. <span v-if="item.purcOrdStas == 'D'">部分出库</span>
  17. <span v-if="item.purcOrdStas == 'C'">待验收</span>
  18. <span v-if="item.purcOrdStas == 'Y'">已验收</span>
  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-unit">
  26. {{item.purcOrdId}}
  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.detlCnt||""}}
  37. </view>
  38. </view>
  39. <!-- <view class="shuo-item">
  40. <view class="shuo-label">
  41. 采购总金额:
  42. </view>
  43. <view class="shuo-cont">
  44. {{item.amt}}
  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.amt||""}}
  55. </view>
  56. </view>
  57. <view class="shuo-item">
  58. <view class="shuo-label">
  59. 来源机构:
  60. </view>
  61. <view class="shuo-cont">
  62. {{item.orgName}}
  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.splerName}}
  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. {{item.docmkDate}}
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </z-paging>
  88. <uni-popup ref="popup" :mask-click="false">
  89. <view class="time-view">
  90. <UnidatetimePicker type="datetimerange" v-model="datetimesingle" />
  91. <view class="btn-view">
  92. <button type="primary" plain="true" style="height:70rpx;line-height: 70rpx;"
  93. @click.stop="reset()">重置</button>
  94. <button type="primary" plain="true" style="height:70rpx;line-height: 70rpx;"
  95. @click.stop="btnConfirm()">确定</button>
  96. </view>
  97. </view>
  98. </uni-popup>
  99. </view>
  100. </template>
  101. <script>
  102. import {
  103. mapState,
  104. mapMutations,
  105. mapActions
  106. } from 'vuex';
  107. import {
  108. debounce
  109. } from 'lodash';
  110. import moment from "moment";
  111. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  112. import UnidatetimePicker from '@/subpkg/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue';
  113. export default {
  114. components: {
  115. UnidatetimePicker
  116. },
  117. mixins: [ZPMixin],
  118. data() {
  119. return {
  120. index: 0,
  121. value1: "",
  122. value: "",
  123. dataList: [],
  124. inputVal: "",
  125. codeVal: "",
  126. confirmVal: "",
  127. changeVal: "",
  128. tabList: ['待受理', '已受理', '退回', '关闭'],
  129. tabIndex: ['A', 'B', 'C', 'D'],
  130. valueList: 0,
  131. beforeClose: true,
  132. itemData: {},
  133. datetimesingle: [],
  134. }
  135. },
  136. computed: {
  137. ...mapState(['instData']),
  138. },
  139. onShow() {
  140. uni.$once('update', function(data) {
  141. // uni.redirectTo({
  142. // url: '/pages/grounding/grounding' //写你的路径
  143. // });
  144. })
  145. },
  146. mounted() {
  147. },
  148. methods: {
  149. ...mapActions(['getPurDerData']),
  150. async queryList(pageNo, pageSize) {
  151. let pamStas = this.tabIndex[this.index];
  152. await this.getPurDerData({
  153. pam: {
  154. current: pageNo,
  155. size: pageSize,
  156. spdId: this.instData.spdId,
  157. purcOrdId: this.value.trim(),
  158. docmkDateStart: this.datetimesingle[0],
  159. docmkDateEnd: this.datetimesingle[1]
  160. },
  161. that: this
  162. })
  163. },
  164. //筛选时间
  165. filterTime() {
  166. this.$refs.popup.open('bottom')
  167. },
  168. forMatTime(row) {
  169. return moment(row).format("YYYY-MM-DD HH:mm");
  170. },
  171. // 日期重置
  172. reset() {
  173. this.datetimesingle = [];
  174. },
  175. //日期确定按钮
  176. btnConfirm() {
  177. this.$refs.popup.close();
  178. this.$refs.paging.reload();
  179. },
  180. //跳转订单详情
  181. itemDetails(item) {
  182. uni.setStorage({
  183. key: 'puderDelData',
  184. data: item
  185. });
  186. uni.navigateTo({
  187. url: '/subpkg/pages/puhse-order/details',
  188. success: function(res) {
  189. console.log(res, "res")
  190. }
  191. });
  192. },
  193. input: debounce(function(e) {
  194. this.value = e;
  195. let pamStas = this.tabIndex[this.index];
  196. this.getPurDerData({
  197. pam: {
  198. spdId: this.instData.spdId,
  199. purcOrdId: e
  200. },
  201. that: this
  202. })
  203. this.$nextTick(() => {
  204. // this.value = e;
  205. // this.inputVal = e;
  206. })
  207. }, 500),
  208. iconClick(e) {
  209. console.log(e, '点击搜索拿到的数据');
  210. },
  211. blur(e) {
  212. this.$nextTick(() => {
  213. // this.value = e.target.value;
  214. })
  215. },
  216. changeTab(index) {
  217. this.index = index;
  218. this.$refs.paging.reload();
  219. },
  220. handleShelf(item) {
  221. },
  222. changeList(e) {
  223. // console.log(e)
  224. },
  225. onchange(e) {
  226. // console.log(e, 44)
  227. },
  228. onnodeclick(node) {
  229. console.log(node, "node");
  230. },
  231. onpopupclosed(e) {
  232. // console.log(e, 33)
  233. }
  234. },
  235. watch: {
  236. }
  237. }
  238. </script>
  239. <style lang="scss" scoped>
  240. .query-wrap {
  241. width: 100%;
  242. padding: 20rpx;
  243. box-sizing: border-box;
  244. background-color: #F1F1F1;
  245. overflow-y: scroll;
  246. overflow-x: hidden;
  247. }
  248. uni-page-body {
  249. width: 100%;
  250. height: 100%;
  251. }
  252. .time-view {
  253. height: 350rpx;
  254. background-color: #fff;
  255. padding: 50rpx 50rpx 0 50rpx;
  256. box-sizing: border-box;
  257. .btn-view {
  258. width: 100%;
  259. height: 100rpx;
  260. margin-top: 100rpx;
  261. display: flex;
  262. justify-content: space-around;
  263. }
  264. }
  265. .search-view {
  266. width: 100%;
  267. height: 100rpx;
  268. display: flex;
  269. align-items: center;
  270. padding: 0rpx 20rpx 0rpx 20rpx;
  271. box-sizing: border-box;
  272. .filter-text {
  273. width: 72rpx;
  274. height: 50rpx;
  275. line-height: 50rpx;
  276. color: rgba(1, 169, 146, 1);
  277. font-size: 36rpx;
  278. font-family: PingFangSC-bold;
  279. padding-left: 20rpx;
  280. }
  281. }
  282. </style>