index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="query-wrap">
  3. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入采购单号" @iconClick="iconClick" @input="input">
  4. </uni-easyinput>
  5. <v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs>
  6. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  7. <view class="inner-item" v-for="(item,indx) in dataList" :key="indx" @click="itemDetails(item)">
  8. <view class="item-stats" v-if="index=='0'">
  9. {{item.stas}}
  10. </view>
  11. <view class="inventory-item" v-if="index=='1'">
  12. <view class="shuo-item-name">
  13. <view class="shuo-label-podnme">
  14. 出库单号
  15. </view>
  16. <view class="shuo-unit">
  17. {{item.delvOrdId}}
  18. </view>
  19. </view>
  20. </view>
  21. <view class="inventory-item">
  22. <view class="shuo-item-name">
  23. <view class="shuo-label-podnme">
  24. {{index=="0"?'订单号':"关联采购单"}}
  25. </view>
  26. <view class="shuo-unit">
  27. <span v-if="index == '0'">{{ item.id }}</span>
  28. <span v-if="index == '1'">{{item.purcOrdId}}</span>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="inventory-item">
  33. <view class="shuo-item">
  34. <view class="shuo-label">
  35. {{index=="0"?'订单品种数':"采购品种数"}}
  36. </view>
  37. <view class="shuo-cont">
  38. {{item.detlCnt||""}}
  39. </view>
  40. </view>
  41. <view class="shuo-item">
  42. <view class="shuo-label">
  43. {{index=="0"?'订单总数量':"采购总数量"}}
  44. </view>
  45. <view class="shuo-cont">
  46. {{item.qtySum||""}}
  47. </view>
  48. </view>
  49. </view>
  50. <view class="inventory-item" v-if="index=='1'">
  51. <view class="shuo-item">
  52. <view class="shuo-label">
  53. 本次出库数:
  54. </view>
  55. <view class="shuo-cont">
  56. {{item.bcckl||""}}
  57. </view>
  58. </view>
  59. <view class="shuo-item">
  60. <view class="shuo-label">
  61. 本次验收量:
  62. </view>
  63. <view class="shuo-cont">
  64. {{item.shppCnt||""}}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="inventory-item" v-if="index=='1'">
  69. <view class="shuo-item">
  70. <view class="shuo-label">
  71. 待出库量:
  72. </view>
  73. <view class="shuo-cont">
  74. {{item.toDelvCnt||""}}
  75. </view>
  76. </view>
  77. <view class="shuo-item">
  78. <view class="shuo-label">
  79. 出库人:
  80. </view>
  81. <view class="shuo-cont">
  82. {{item.docmker||""}}
  83. </view>
  84. </view>
  85. </view>
  86. <view class="inventory-item" v-if="index=='0'">
  87. <view class="shuo-item">
  88. <view class="shuo-label">
  89. 订单总金额:
  90. </view>
  91. <view class="shuo-cont">
  92. {{item.purcAmt||""}}
  93. </view>
  94. </view>
  95. <view class="shuo-item">
  96. <view class="shuo-label">
  97. 剩余出库量:
  98. </view>
  99. <view class="shuo-cont">
  100. {{item.delvCnt||""}}
  101. </view>
  102. </view>
  103. </view>
  104. <view class="inventory-item">
  105. <view class="shuo-item-name">
  106. <view class="shuo-label">
  107. 来源机构:
  108. </view>
  109. <view class="shuo-cont">
  110. {{item.branchName}}
  111. </view>
  112. </view>
  113. </view>
  114. <view class="inventory-item" v-if="index=='0'">
  115. <view class="shuo-item-name">
  116. <view class="shuo-label">
  117. 采购类型:
  118. </view>
  119. <view class="shuo-cont">
  120. <span v-if="item.purcType == '2'">{{ item.oprn }}</span>
  121. <span v-if="item.purcType == '1'">普通采购</span>
  122. </view>
  123. </view>
  124. </view>
  125. <view class="inventory-item" v-if="index=='0'">
  126. <view class="shuo-item">
  127. <view class="shuo-label">
  128. 采购时间:
  129. </view>
  130. <view class="shuo-cont">
  131. {{forMatTime(item.docmkDate)}}
  132. </view>
  133. </view>
  134. </view>
  135. <view class="inventory-item" v-if="index=='1'">
  136. <view class="shuo-item">
  137. <view class="shuo-label">
  138. 出库时间:
  139. </view>
  140. <view class="shuo-cont">
  141. {{forMatTime(item.docmkDate)}}
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </z-paging>
  147. </view>
  148. </template>
  149. <script>
  150. import {
  151. mapState,
  152. mapMutations,
  153. mapActions
  154. } from 'vuex';
  155. import {
  156. debounce
  157. } from 'lodash';
  158. import moment from "moment";
  159. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  160. export default {
  161. mixins: [ZPMixin],
  162. data() {
  163. return {
  164. index: 0,
  165. value1: "",
  166. value: "",
  167. dataList: [],
  168. inputVal: "",
  169. codeVal: "",
  170. confirmVal: "",
  171. changeVal: "",
  172. tabList: ['待出库', '已出库'],
  173. valueList: 0,
  174. beforeClose: true,
  175. itemData: {}
  176. }
  177. },
  178. computed: {
  179. ...mapState(['instData', 'userData']),
  180. },
  181. onShow() {
  182. uni.$once('update', function(data) {
  183. // uni.redirectTo({
  184. // url: '/pages/grounding/grounding' //写你的路径
  185. // });
  186. })
  187. },
  188. mounted() {
  189. },
  190. //订单出库
  191. methods: {
  192. ...mapActions(['getOrderAwaitData', 'getOrderAreadyData']),
  193. async queryList(pageNo, pageSize) {
  194. if (this.index == "0") {
  195. await this.getOrderAwaitData({
  196. pam: {
  197. current: pageNo,
  198. size: pageSize,
  199. spdId: this.instData.spdId,
  200. id: this.value
  201. },
  202. that: this
  203. })
  204. } else {
  205. await this.getOrderAreadyData({
  206. pam: {
  207. current: pageNo,
  208. size: pageSize,
  209. spdId: this.instData.spdId,
  210. id: this.value
  211. },
  212. that: this
  213. })
  214. }
  215. },
  216. forMatTime(row) {
  217. return moment(row).format("YYYY-MM-DD");
  218. },
  219. //跳转订单详情
  220. itemDetails(item) {
  221. uni.setStorage({
  222. key: 'orderDetailsData',
  223. data: item
  224. });
  225. if (this.index == "0") {
  226. uni.navigateTo({
  227. url: '/subpkg/pages/order-outbond/details',
  228. success: function(res) {
  229. console.log(res, "res")
  230. }
  231. });
  232. } else {
  233. uni.navigateTo({
  234. url: '/subpkg/pages/order-outbond/ready',
  235. success: function(res) {
  236. console.log(res, "res")
  237. }
  238. });
  239. }
  240. },
  241. input: debounce(function(e) {
  242. this.value = e;
  243. if (this.index == "0") {
  244. this.getOrderAwaitData({
  245. pam: {
  246. spdId: this.instData.spdId,
  247. id: this.value
  248. },
  249. that: this
  250. })
  251. } else {
  252. this.getOrderAreadyData({
  253. pam: {
  254. spdId: this.instData.spdId,
  255. id: this.value
  256. },
  257. that: this
  258. })
  259. }
  260. }, 500),
  261. iconClick(e) {
  262. console.log(e, '点击搜索拿到的数据');
  263. },
  264. blur(e) {
  265. this.$nextTick(() => {
  266. // this.value = e.target.value;
  267. })
  268. },
  269. changeTab(index) {
  270. this.index = index;
  271. this.$refs.paging.reload();
  272. },
  273. handleShelf(item) {
  274. },
  275. changeList(e) {
  276. // console.log(e)
  277. },
  278. onchange(e) {
  279. // console.log(e, 44)
  280. },
  281. onnodeclick(node) {
  282. console.log(node, "node");
  283. },
  284. onpopupclosed(e) {
  285. // console.log(e, 33)
  286. }
  287. },
  288. watch: {
  289. }
  290. }
  291. </script>
  292. <style lang="scss" scoped>
  293. .query-wrap {
  294. width: 100%;
  295. padding: 20rpx;
  296. box-sizing: border-box;
  297. background-color: #F1F1F1;
  298. overflow-y: scroll;
  299. overflow-x: hidden;
  300. }
  301. uni-page-body {
  302. width: 100%;
  303. height: 100%;
  304. }
  305. </style>