index.vue 6.7 KB

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