index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <template>
  2. <view class="query-wrap">
  3. <view class="title-cont">
  4. <view class="search-view">
  5. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入或扫描单号" @input="input" @blur="blur"
  6. @confirm="confirm">
  7. </uni-easyinput>
  8. <qs-scanlistener @scan="scan"></qs-scanlistener>
  9. <view class="filter-text" @click.stop="filterTime" v-if="index=='1'">
  10. 筛选
  11. </view>
  12. </view>
  13. <v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs>
  14. </view>
  15. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  16. <view class="inner-item" v-for="(item,index) in dataList" :key="index" @click="itemDetails(item)">
  17. <view class="item-stats">
  18. {{item.stas=='C'?'已验收':"待验收"}}
  19. </view>
  20. <view class="inventory-item" v-if="item.stas=='C'">
  21. <view class="shuo-item-name">
  22. <view class="shuo-label">
  23. 验收单号:
  24. </view>
  25. <view class="shuo-unit">
  26. {{item.id}}
  27. </view>
  28. </view>
  29. </view>
  30. <view class="inventory-item" v-if="item.stas=='C'">
  31. <view class="shuo-item-name">
  32. <view class="shuo-label">
  33. 本次验收量:
  34. </view>
  35. <view class="shuo-unit">
  36. {{item.mcsCnt}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="inventory-item" v-if="item.stas=='B'">
  41. <view class="shuo-item-name">
  42. <view class="shuo-label">
  43. 配送单号:
  44. </view>
  45. <view class="shuo-unit">
  46. {{item.stooutId}}
  47. </view>
  48. </view>
  49. </view>
  50. <view class="inventory-item">
  51. <view class="shuo-item">
  52. <view class="shuo-label">
  53. 配送品种数:
  54. </view>
  55. <view class="shuo-cont">
  56. {{item.stoCnt}}
  57. </view>
  58. </view>
  59. <view class="shuo-item">
  60. <view class="shuo-label">
  61. 配送总数量:
  62. </view>
  63. <view class="shuo-cont">
  64. {{item.devCnt}}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="inventory-item">
  69. <view class="shuo-item">
  70. <view class="shuo-label">
  71. 采购品种数:
  72. </view>
  73. <view class="shuo-cont">
  74. {{item.catCnt}}
  75. </view>
  76. </view>
  77. <view class="shuo-item">
  78. <view class="shuo-label">
  79. 采购总数量:
  80. </view>
  81. <view class="shuo-cont">
  82. {{item.sumCnt}}
  83. </view>
  84. </view>
  85. </view>
  86. <view class="inventory-item">
  87. <view class="shuo-item">
  88. <view class="shuo-label">
  89. 未配送数量:
  90. </view>
  91. <view class="shuo-cont">
  92. {{item.lstCnt}}
  93. </view>
  94. </view>
  95. </view>
  96. <view class="inventory-item" v-if="item.stas=='C'">
  97. <view class="shuo-item-name">
  98. <view class="shuo-label">
  99. 配送单号:
  100. </view>
  101. <view class="shuo-cont">
  102. {{item.stooutId}}
  103. </view>
  104. </view>
  105. </view>
  106. <view class="inventory-item" v-if="item.stas=='B'">
  107. <view class="shuo-item">
  108. <view class="shuo-label">
  109. 采购员:
  110. </view>
  111. <view class="shuo-cont">
  112. {{item.crteUsrName}}
  113. </view>
  114. </view>
  115. <view class="shuo-item">
  116. <view class="shuo-label">
  117. 采购时间:
  118. </view>
  119. <view class="shuo-cont" style="font-size: 18rpx;">
  120. {{ forMatTimehs(item.crteTime) }}
  121. </view>
  122. </view>
  123. </view>
  124. <view class="inventory-item" v-if="item.stas=='C'">
  125. <view class="shuo-item">
  126. <view class="shuo-label">
  127. 验收员:
  128. </view>
  129. <view class="shuo-cont">
  130. {{item.crteUsrName}}
  131. </view>
  132. </view>
  133. <view class="shuo-item">
  134. <view class="shuo-label">
  135. 验收时间:
  136. </view>
  137. <view class="shuo-cont">
  138. {{ forMatTime(item.crteTime) }}
  139. </view>
  140. </view>
  141. </view>
  142. <view class="inventory-item">
  143. <view class="shuo-item">
  144. <view class="shuo-label">
  145. 采购类型:
  146. </view>
  147. <view class="shuo-cont">
  148. <span v-if="item.purcType == 'A'">普通采购</span>
  149. <span v-if="item.purcType == 'B'">手术备货</span>
  150. </view>
  151. </view>
  152. <view class="shuo-item">
  153. <view class="shuo-label">
  154. 采购订单号:
  155. </view>
  156. <view class="shuo-cont">
  157. {{item.soucId}}
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. </z-paging>
  163. <uni-popup ref="popup" :mask-click="false">
  164. <view class="time-view">
  165. <uni-datetime-picker type="daterange" v-model="datetimesingle" />
  166. <view class="btn-view">
  167. <button type="primary" plain="true" style="height:70rpx;line-height: 70rpx;"
  168. @click.stop="reset()">重置</button>
  169. <button type="primary" plain="true" style="height:70rpx;line-height: 70rpx;"
  170. @click.stop="btnConfirm()">确定</button>
  171. </view>
  172. </view>
  173. </uni-popup>
  174. </view>
  175. </template>
  176. <script>
  177. import {
  178. mapState,
  179. mapMutations,
  180. mapActions
  181. } from 'vuex';
  182. import {
  183. debounce
  184. } from 'lodash';
  185. import moment from "moment";
  186. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  187. export default {
  188. mixins: [ZPMixin],
  189. data() {
  190. return {
  191. index: 0,
  192. value: "",
  193. dataList: [],
  194. inputVal: "",
  195. codeVal: "",
  196. confirmVal: "",
  197. changeVal: "",
  198. classes: [],
  199. listData: [],
  200. tabList: ['待验收', '已验收'],
  201. valueList: 0,
  202. beforeClose: true,
  203. datetimesingle: [],
  204. }
  205. },
  206. computed: {
  207. ...mapState(['houseSelectData'])
  208. },
  209. onShow() {
  210. uni.$once('update', function(data) {
  211. // uni.redirectTo({
  212. // url: '/pages/grounding/grounding' //写你的路径
  213. // });
  214. })
  215. },
  216. mounted() {
  217. },
  218. methods: {
  219. ...mapActions(['getAceptData', 'getAreadyData']),
  220. ...mapMutations(['setAcceptDetaData']),
  221. async queryList(pageNo, pageSize) {
  222. if (this.index == 0) {
  223. await this.getAceptData({
  224. pam: {
  225. current: pageNo,
  226. size: pageSize,
  227. id: this.value,
  228. pdaType: "pda",
  229. soucStroomId: this.houseSelectData.houseId
  230. },
  231. that: this
  232. });
  233. }
  234. if (this.index == 1) {
  235. await this.getAreadyData({
  236. pam: {
  237. current: pageNo,
  238. size: pageSize,
  239. id: this.value,
  240. ordDate: this.datetimesingle
  241. },
  242. that: this
  243. });
  244. }
  245. },
  246. //日期格式化
  247. forMatTime(time) {
  248. return moment(time).format("YYYY-MM-DD");
  249. },
  250. //时分秒
  251. forMatTimehs(time) {
  252. return moment(time).format("YYYY-MM-DD HH:mm");
  253. },
  254. //日期确定按钮
  255. btnConfirm() {
  256. this.$refs.popup.close();
  257. this.$refs.paging.reload();
  258. },
  259. scan(code) {
  260. this.requsData(code);
  261. },
  262. input(e) {
  263. this.requsData(e);
  264. },
  265. //筛选时间
  266. filterTime() {
  267. this.$refs.popup.open('bottom')
  268. },
  269. //跳转验收详情
  270. itemDetails(item) {
  271. uni.setStorage({
  272. key: 'accept-storage-details',
  273. data: item
  274. });
  275. uni.navigateTo({
  276. url: '/pages/accept-storage-details/index',
  277. success: function(res) {}
  278. });
  279. },
  280. requsData: debounce(function(e) {
  281. this.value = e;
  282. if (this.index == 0) {
  283. this.getAceptData({
  284. pam: {
  285. id: e
  286. },
  287. that: this
  288. });
  289. }
  290. if (this.index == 1) {
  291. this.getAreadyData({
  292. pam: {
  293. id: e
  294. },
  295. that: this
  296. });
  297. }
  298. }, 500),
  299. iconClick(e) {
  300. console.log(e, '点击搜索拿到的数据');
  301. },
  302. // 日期重置
  303. reset() {
  304. this.datetimesingle = [];
  305. },
  306. blur(e) {
  307. this.$nextTick(() => {
  308. // this.value = e.target.value;
  309. })
  310. },
  311. confirm(e) {
  312. this.$nextTick(() => {
  313. // this.value = e;
  314. // this.confirmVal = e;
  315. })
  316. },
  317. changeTab(index) {
  318. this.index = index;
  319. this.$refs.paging.reload();
  320. },
  321. oncloseList() {
  322. this.$refs.inputDialog.close()
  323. },
  324. changeList(e) {
  325. // console.log(e)
  326. },
  327. onchange(e) {
  328. // console.log(e, 44)
  329. },
  330. onnodeclick(node) {
  331. console.log(node, "node");
  332. },
  333. onpopupclosed(e) {
  334. // console.log(e, 33)
  335. }
  336. },
  337. watch: {
  338. groundData(newData, flodData) {
  339. this.$refs.paging.complete(newData);
  340. },
  341. }
  342. }
  343. </script>
  344. <style lang="scss">
  345. .query-wrap {
  346. width: 100%;
  347. padding: 20rpx;
  348. box-sizing: border-box;
  349. background-color: #F1F1F1;
  350. overflow-y: scroll;
  351. overflow-x: hidden;
  352. .time-view {
  353. height: 350rpx;
  354. background-color: #fff;
  355. padding: 50rpx 50rpx 0 50rpx;
  356. box-sizing: border-box;
  357. .btn-view {
  358. width: 100%;
  359. height: 100rpx;
  360. margin-top: 100rpx;
  361. display: flex;
  362. justify-content: space-around;
  363. }
  364. }
  365. .title-cont {
  366. padding-top: 10rpx;
  367. width: 100%;
  368. background-color: #fff;
  369. .search-view {
  370. width: 100%;
  371. height: 100rpx;
  372. display: flex;
  373. align-items: center;
  374. padding: 0rpx 20rpx 0rpx 20rpx;
  375. box-sizing: border-box;
  376. .filter-text {
  377. width: 72rpx;
  378. height: 50rpx;
  379. line-height: 50rpx;
  380. color: rgba(1, 169, 146, 1);
  381. font-size: 36rpx;
  382. font-family: PingFangSC-bold;
  383. padding-left: 20rpx;
  384. }
  385. }
  386. }
  387. }
  388. uni-page-body {
  389. width: 100%;
  390. height: 100%;
  391. }
  392. </style>