index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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. <view class="tab-bar">
  17. <view class="tab-item" :class="{ active: index === 0 }" @click="changeTab(0)">
  18. 待验收
  19. </view>
  20. <view class="tab-item" :class="{ active: index === 1 }" @click="changeTab(1)">
  21. 已验收
  22. </view>
  23. </view>
  24. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  25. <!-- 待验收 -->
  26. <template v-if="index === 0">
  27. <view
  28. class="inner-item"
  29. v-for="(item, indx) in dataList"
  30. :key="indx"
  31. @click="itemDetails(item)"
  32. >
  33. <view class="item-stats">
  34. <span v-if="item.stas == 'A'">待验收</span>
  35. </view>
  36. <view class="inventory-item">
  37. <view class="shuo-item-name">
  38. <view class="shuo-label">配送订单: </view>
  39. <view class="shuo-unit">{{ item.delvOrdId }}</view>
  40. </view>
  41. </view>
  42. <view class="inventory-item">
  43. <view class="shuo-item-name">
  44. <view class="shuo-label">采购订单: </view>
  45. <view class="shuo-unit">{{ item.purcOrdId }}</view>
  46. </view>
  47. </view>
  48. <view class="inventory-item">
  49. <view class="shuo-item">
  50. <view class="shuo-label">配送品种: </view>
  51. <view class="shuo-cont">{{ item.delvDrugSum || "" }}</view>
  52. </view>
  53. <view class="shuo-item">
  54. <view class="shuo-label">配送总数: </view>
  55. <view class="shuo-cont">{{ item.delvCntDetlSum }}</view>
  56. </view>
  57. </view>
  58. <view class="inventory-item">
  59. <view class="shuo-item">
  60. <view class="shuo-label">采购品种: </view>
  61. <view class="shuo-cont">{{ item.ordDetlCnt || "" }}</view>
  62. </view>
  63. <view class="shuo-item">
  64. <view class="shuo-label">采购总数: </view>
  65. <view class="shuo-cont">{{ item.purcCntDetlSum || "" }}</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">{{ item.planDocmker }}</view>
  72. </view>
  73. <view class="shuo-item-name">
  74. <view class="shuo-label">采购方式: </view>
  75. <view class="shuo-cont">{{ item.planWay }}</view>
  76. </view>
  77. </view>
  78. <view class="inventory-item">
  79. <view class="shuo-item-name">
  80. <view class="shuo-label">采购时间: </view>
  81. <view class="shuo-cont">{{ forMatTime(item.ordDocmkDate) }}</view>
  82. </view>
  83. <view class="shuo-item-name">
  84. <view class="shuo-label">配送时间: </view>
  85. <view class="shuo-cont">{{ forMatTime(item.docmkDate) }}</view>
  86. </view>
  87. </view>
  88. <view class="inventory-item">
  89. <view class="shuo-item-name">
  90. <view class="shuo-label">配送企业: </view>
  91. <view class="shuo-cont">{{ item.splerName }}</view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <!-- 已验收 -->
  97. <template v-else>
  98. <view
  99. class="inner-item"
  100. v-for="(item, indx) in dataList"
  101. :key="indx"
  102. @click="itemDetails(item)"
  103. >
  104. <view class="item-stats">
  105. <span v-if="item.delvOrdStas == 'C'">已验收</span>
  106. </view>
  107. <view class="inventory-item">
  108. <view class="shuo-item-name">
  109. <view class="shuo-label">验收单号: </view>
  110. <view class="shuo-unit">{{ item.stoinOrdId }}</view>
  111. </view>
  112. </view>
  113. <view class="inventory-item">
  114. <view class="shuo-item-name">
  115. <view class="shuo-label">配送订单: </view>
  116. <view class="shuo-unit">{{ item.delvOrdId }}</view>
  117. </view>
  118. </view>
  119. <view class="inventory-item">
  120. <view class="shuo-item-name">
  121. <view class="shuo-label">采购订单: </view>
  122. <view class="shuo-unit">{{ item.purcOrdId }}</view>
  123. </view>
  124. </view>
  125. <view class="inventory-item">
  126. <view class="shuo-item">
  127. <view class="shuo-label">采购品种: </view>
  128. <view class="shuo-cont">{{ item.detlCnt || "" }}</view>
  129. </view>
  130. <view class="shuo-item">
  131. <view class="shuo-label">配送品种: </view>
  132. <view class="shuo-cont">{{ item.delvDrugSum }}</view>
  133. </view>
  134. </view>
  135. <view class="inventory-item">
  136. <view class="shuo-item">
  137. <view class="shuo-label">本次配送: </view>
  138. <view class="shuo-cont">{{ item.delvCntDetlSum || "" }}</view>
  139. </view>
  140. <view class="shuo-item">
  141. <view class="shuo-label">采购总数: </view>
  142. <view class="shuo-cont">{{ item.purcCntDetlSum || "" }}</view>
  143. </view>
  144. </view>
  145. <view class="inventory-item">
  146. <view class="shuo-item">
  147. <view class="shuo-label">采购总额: </view>
  148. <view class="shuo-cont">{{ item.delvAmt || "" }}</view>
  149. </view>
  150. <view class="shuo-item">
  151. <view class="shuo-label">配送总额: </view>
  152. <view class="shuo-cont">{{ item.ordAmt || "" }}</view>
  153. </view>
  154. </view>
  155. <view class="inventory-item">
  156. <view class="shuo-item">
  157. <view class="shuo-label">本次验收: </view>
  158. <view class="shuo-cont">{{ item.shppCntDetlSum || "" }}</view>
  159. </view>
  160. <view class="shuo-item">
  161. <view class="shuo-label">采购员: </view>
  162. <view class="shuo-cont">{{ item.docmker || "" }}</view>
  163. </view>
  164. </view>
  165. <view class="inventory-item">
  166. <view class="shuo-item-name">
  167. <view class="shuo-label">验收时间: </view>
  168. <view class="shuo-cont">{{ forMatTime(item.stoinDate) }}</view>
  169. </view>
  170. <view class="shuo-item-name">
  171. <view class="shuo-label">配送时间: </view>
  172. <view class="shuo-cont">{{ forMatTime(item.docmkDate) }}</view>
  173. </view>
  174. </view>
  175. <view class="inventory-item">
  176. <view class="shuo-item-name">
  177. <view class="shuo-label">配送企业: </view>
  178. <view class="shuo-cont">{{ item.splerName }}</view>
  179. </view>
  180. </view>
  181. </view>
  182. </template>
  183. </z-paging>
  184. </view>
  185. </template>
  186. <script>
  187. import { debounce } from "lodash";
  188. import moment from "moment";
  189. import ZPMixin from "@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js";
  190. import UnidatetimePicker from "@/consumablespkg/components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue";
  191. export default {
  192. components: {
  193. UnidatetimePicker,
  194. },
  195. mixins: [ZPMixin],
  196. data() {
  197. return {
  198. index: 0,
  199. value: "",
  200. dataList: [],
  201. datetimesingle: [],
  202. };
  203. },
  204. methods: {
  205. async queryList(current, size) {
  206. const apiName =
  207. this.index === 0 ? "drugHospital.getDelvPage" : "drugHospital.getStoinPage";
  208. await this.$http(apiName, { current, size }, "加载中").then((res) => {
  209. if (res && res.data) {
  210. this.$refs.paging.complete(res.data);
  211. }
  212. });
  213. },
  214. //筛选时间
  215. filterTime() {
  216. this.$refs.popup.open("bottom");
  217. },
  218. forMatTime(row) {
  219. return moment(row).format("YYYY-MM-DD");
  220. },
  221. // 日期重置
  222. reset() {
  223. this.datetimesingle = [];
  224. },
  225. //日期确定按钮
  226. btnConfirm() {
  227. this.$refs.popup.close();
  228. this.$refs.paging.reload();
  229. },
  230. //跳转订单详情
  231. itemDetails(item) {
  232. uni.setStorage({
  233. key: "detailsData",
  234. data: item,
  235. });
  236. uni.navigateTo({
  237. url: "/consumablespkg/pages/management/details/index",
  238. success: function (res) {
  239. console.log(res, "res");
  240. },
  241. });
  242. },
  243. input: debounce(function (e) {
  244. this.value = e;
  245. this.$refs.paging.reload();
  246. }, 500),
  247. iconClick(e) {
  248. console.log(e, "点击搜索拿到的数据");
  249. },
  250. blur(e) {
  251. this.$nextTick(() => {});
  252. },
  253. changeTab(index) {
  254. this.index = index;
  255. this.$refs.paging.reload();
  256. },
  257. },
  258. watch: {},
  259. };
  260. </script>
  261. <style lang="scss" scoped>
  262. .query-wrap {
  263. width: 100%;
  264. padding: 20rpx;
  265. box-sizing: border-box;
  266. background-color: #f1f1f1;
  267. overflow-y: scroll;
  268. overflow-x: hidden;
  269. }
  270. uni-page-body {
  271. width: 100%;
  272. height: 100%;
  273. }
  274. .time-view {
  275. height: 350rpx;
  276. background-color: #fff;
  277. padding: 50rpx 50rpx 0 50rpx;
  278. box-sizing: border-box;
  279. .btn-view {
  280. width: 100%;
  281. height: 100rpx;
  282. margin-top: 100rpx;
  283. display: flex;
  284. justify-content: space-around;
  285. }
  286. }
  287. .card {
  288. background: #fff;
  289. border-radius: 20rpx;
  290. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
  291. padding: 0;
  292. margin-bottom: 20rpx;
  293. }
  294. .search-view {
  295. width: 100%;
  296. min-height: 100rpx;
  297. display: flex;
  298. align-items: center;
  299. // padding: 0rpx 20rpx 0rpx 20rpx;
  300. box-sizing: border-box;
  301. .filter-text {
  302. width: 72rpx;
  303. height: 50rpx;
  304. line-height: 50rpx;
  305. color: rgba(1, 169, 146, 1);
  306. font-size: 36rpx;
  307. font-family: PingFangSC-bold;
  308. padding-left: 20rpx;
  309. }
  310. }
  311. .search-view uni-easyinput {
  312. width: 100% !important;
  313. flex: 1 !important;
  314. }
  315. .item-stats {
  316. margin-top: 80rpx;
  317. }
  318. .tab-bar {
  319. display: flex;
  320. justify-content: flex-start;
  321. align-items: center;
  322. background: #fff;
  323. padding-bottom: 10rpx;
  324. border-bottom: 1px solid #f1f1f1;
  325. margin-bottom: 10rpx;
  326. border-radius: 20rpx;
  327. }
  328. .tab-item {
  329. flex: 1;
  330. text-align: center;
  331. font-size: 32rpx;
  332. color: #666;
  333. padding: 30rpx 0 20rpx 0;
  334. position: relative;
  335. cursor: pointer;
  336. }
  337. .tab-item.active {
  338. color: #36cfc9;
  339. font-weight: bold;
  340. }
  341. .tab-item.active::after {
  342. content: "";
  343. display: block;
  344. width: 60rpx;
  345. height: 6rpx;
  346. background: #36cfc9;
  347. border-radius: 3rpx;
  348. position: absolute;
  349. left: 50%;
  350. bottom: 0;
  351. transform: translateX(-50%);
  352. }
  353. </style>