index.vue 6.6 KB

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